X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/88b780d9f9c19ad3c6eca915d7df74c3549fa204..4b7b750dd1ffd0d26b78728adb613b282a37c058:/src/stc/scintilla/include/Platform.h diff --git a/src/stc/scintilla/include/Platform.h b/src/stc/scintilla/include/Platform.h index 3a5e9816dc..de9cf202a1 100644 --- a/src/stc/scintilla/include/Platform.h +++ b/src/stc/scintilla/include/Platform.h @@ -45,6 +45,7 @@ #pragma warning(disable: 4800 4244 4309) #endif #include +#include #include #endif @@ -79,12 +80,6 @@ typedef wxWindow* WindowID; typedef wxMenu* MenuID; #endif -#if PLAT_GTK || PLAT_WX -#define SHIFT_PRESSED 1 -#define LEFT_CTRL_PRESSED 2 -#define LEFT_ALT_PRESSED 4 -#endif - // Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably class Point { @@ -198,6 +193,7 @@ public: }; class Font { +protected: FontID id; #if PLAT_WX int ascent; @@ -207,18 +203,21 @@ class Font { Font &operator=(const Font &) { id=0; return *this; } public: Font(); - ~Font(); + virtual ~Font(); - void Create(const char *faceName, int size, bool bold=false, bool italic=false); - void Release(); + virtual void Create(const char *faceName, int characterSet, int size, bool bold, bool italic); + virtual void Release(); FontID GetID() { return id; } + // Alias another font - caller guarantees not to Release + void SetID(FontID id_) { id = id_; } friend class Surface; }; // A surface abstracts a place to draw class Surface { private: + bool unicodeMode; #if PLAT_GTK GdkDrawable *drawable; GdkGC *gc; @@ -266,6 +265,7 @@ public: bool Initialised(); void PenColour(Colour fore); int LogPixelsY(); + int DeviceHeightFont(int points); void MoveTo(int x_, int y_); void LineTo(int x_, int y_); void Polygon(Point *pts, int npts, Colour fore, Colour back); @@ -290,6 +290,11 @@ public: int SetPalette(Palette *pal, bool inBackGround); void SetClip(PRectangle rc); + void FlushCachedState(); + + void SetUnicodeMode(bool unicodeMode_) { + unicodeMode=unicodeMode_; + } }; // Class to hide the details of window manipulation @@ -300,6 +305,7 @@ protected: WindowID id; public: Window() : id(0) {} + Window(const Window &source) : id(source.id) {} virtual ~Window(); Window &operator=(WindowID id_) { id = id_; @@ -316,7 +322,7 @@ public: void Show(bool show=true); void InvalidateAll(); void InvalidateRectangle(PRectangle rc); - void SetFont(Font &font); + virtual void SetFont(Font &font); enum Cursor { cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow }; void SetCursor(Cursor curs); void SetTitle(const char *s); @@ -333,14 +339,17 @@ class ListBox : public Window { WindowID scroller; int current; #endif + int desiredVisibleRows; + unsigned int maxItemCharacters; + unsigned int aveCharWidth; public: ListBox(); virtual ~ListBox(); - ListBox &operator=(WindowID id_) { - id = id_; - return *this; - } void Create(Window &parent, int ctrlID); + virtual void SetFont(Font &font); + void SetAverageCharWidth(int width); + void SetVisibleRows(int rows); + PRectangle GetDesiredRect(); void Clear(); void Append(char *s); int Length(); @@ -385,6 +394,16 @@ public: // These are utility functions not really tied to a platform static int Minimum(int a, int b); static int Maximum(int a, int b); + // Next three assume 16 bit shorts and 32 bit longs + static long LongFromTwoShorts(short a,short b) { + return (a) | ((b) << 16); + } + static short HighShortFromLong(long x) { + return static_cast(x >> 16); + } + static short LowShortFromLong(long x) { + return static_cast(x & 0xffff); + } static void DebugPrintf(const char *format, ...); static int Clamp(int val, int minVal, int maxVal); };