mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Remove dependency on nscoord.h; return caret width in pixels, and turn off blinking on UNIX
This commit is contained in:
parent
cb054e6776
commit
61fc5b2481
@ -16,8 +16,6 @@
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "nsCoord.h"
|
||||
|
||||
// this class is used to gather caret properties from the OS. It
|
||||
// must be implemented by each platform that wants more than
|
||||
// the generic caret properties.
|
||||
@ -30,7 +28,7 @@ class nsCaretProperties
|
||||
nsCaretProperties();
|
||||
virtual ~nsCaretProperties() {}
|
||||
|
||||
virtual nscoord GetCaretWidth() { return mCaretWidth; }
|
||||
virtual PRUint32 GetCaretWidth() { return mCaretWidth; }
|
||||
virtual PRUint32 GetCaretBlinkRate() { return mBlinkRate; }
|
||||
|
||||
|
||||
@ -40,11 +38,11 @@ class nsCaretProperties
|
||||
|
||||
enum {
|
||||
eDefaulBlinkRate = 500, // twice a second
|
||||
eDetaultCaretWidthTwips = 20 // one pixel wide
|
||||
eDefaultCaretWidth = 1 // one pixel wide
|
||||
};
|
||||
|
||||
|
||||
nscoord mCaretWidth; // caret width in twips
|
||||
PRUint32 mCaretWidth; // caret width in twips
|
||||
PRUint32 mBlinkRate; // blink rate in milliseconds
|
||||
|
||||
|
||||
|
@ -24,10 +24,12 @@
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDetaultCaretWidthTwips)
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
|
||||
mBlinkRate = 0; // don't blink the caret
|
||||
}
|
||||
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDetaultCaretWidthTwips)
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDetaultCaretWidthTwips)
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDetaultCaretWidthTwips)
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDetaultCaretWidthTwips)
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
|
@ -25,10 +25,11 @@
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
nsCaretProperties::nsCaretProperties()
|
||||
: mCaretWidth(eDetaultCaretWidthTwips)
|
||||
: mCaretWidth(eDefaultCaretWidth)
|
||||
, mBlinkRate(eDefaulBlinkRate)
|
||||
{
|
||||
// in your platform-specific class, get data from the OS in your constructor
|
||||
mCaretWidth = 2; // 2 pixel caret on Windows
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user