X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64a3ee5fd2926c3e5341af2e4d62925fddb90c43..b1229561e530e829f61887930f2004d9814743b0:/contrib/src/stc/scintilla/include/Platform.h diff --git a/contrib/src/stc/scintilla/include/Platform.h b/contrib/src/stc/scintilla/include/Platform.h index 021bcf686f..de9cf202a1 100644 --- a/contrib/src/stc/scintilla/include/Platform.h +++ b/contrib/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,10 +203,10 @@ 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 @@ -221,6 +217,7 @@ public: // A surface abstracts a place to draw class Surface { private: + bool unicodeMode; #if PLAT_GTK GdkDrawable *drawable; GdkGC *gc; @@ -268,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); @@ -293,6 +291,10 @@ 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 @@ -303,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_; @@ -319,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); @@ -336,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(); @@ -388,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); };