Remove dependency on nscoord.h; return caret width in pixels, and turn off blinking on UNIX

This commit is contained in:
sfraser%netscape.com 1999-02-13 04:44:23 +00:00
parent cb054e6776
commit 61fc5b2481
7 changed files with 12 additions and 11 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
}