X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/47b378bd88260611387af8604a1c8f62355350ab..4c509aecb650100d0bca898ec05801a0fbcae1f4:/src/stc/scintilla/include/Platform.h diff --git a/src/stc/scintilla/include/Platform.h b/src/stc/scintilla/include/Platform.h index 679294cad7..79be33f6ba 100644 --- a/src/stc/scintilla/include/Platform.h +++ b/src/stc/scintilla/include/Platform.h @@ -1,7 +1,7 @@ // Scintilla source code edit control /** @file Platform.h ** Interface to platform facilities. Also includes some basic utilities. - ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWidgets. + ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows. **/ // Copyright 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. @@ -12,10 +12,11 @@ // PLAT_GTK = GTK+ on Linux or Win32 // PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32 // PLAT_WIN = Win32 API on Win32 OS -// PLAT_WX is wxWidgets on any supported platform +// PLAT_WX is wxWindows on any supported platform #define PLAT_GTK 0 #define PLAT_GTK_WIN32 0 +#define PLAT_MACOSX 0 #define PLAT_WIN 0 #define PLAT_WX 0 #define PLAT_FOX 0 @@ -37,12 +38,19 @@ #define PLAT_GTK_WIN32 1 #endif +#elif defined(MACOSX) +#undef PLAT_MACOSX +#define PLAT_MACOSX 1 + #else #undef PLAT_WIN #define PLAT_WIN 1 #endif +#ifdef SCI_NAMESPACE +namespace Scintilla { +#endif // Underlying the implementation of the platform classes are platform specific types. // Sometimes these need to be passed around by client code so they are defined here @@ -114,6 +122,9 @@ public: } int Width() { return right - left; } int Height() { return bottom - top; } + bool Empty() { + return (Height() <= 0) || (Width() <= 0); + } }; /** @@ -302,8 +313,8 @@ private: Surface(const Surface &) {} Surface &operator=(const Surface &) { return *this; } public: - Surface() {} - virtual ~Surface() {} + Surface() {}; + virtual ~Surface() {}; static Surface *Allocate(); virtual void Init(WindowID wid)=0; @@ -360,9 +371,23 @@ typedef void (*CallBackAction)(void*); class Window { protected: WindowID id; +#if PLAT_MACOSX + void *windowRef; + void *control; +#endif public: - Window() : id(0), cursorLast(cursorInvalid) {} - Window(const Window &source) : id(source.id), cursorLast(cursorInvalid) {} + Window() : id(0), cursorLast(cursorInvalid) { +#if PLAT_MACOSX + windowRef = 0; + control = 0; +#endif + } + Window(const Window &source) : id(source.id), cursorLast(cursorInvalid) { +#if PLAT_MACOSX + windowRef = 0; + control = 0; +#endif + } virtual ~Window(); Window &operator=(WindowID id_) { id = id_; @@ -383,6 +408,11 @@ public: enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand }; void SetCursor(Cursor curs); void SetTitle(const char *s); + PRectangle GetMonitorRect(Point pt); +#if PLAT_MACOSX + void SetWindow(void *ref) { windowRef = ref; }; + void SetControl(void *_control) { control = _control; }; +#endif private: Cursor cursorLast; }; @@ -443,7 +473,7 @@ public: */ class DynamicLibrary { public: - virtual ~DynamicLibrary() {} + virtual ~DynamicLibrary() {}; /// @return Pointer to function "name", or NULL on failure. virtual Function FindFunction(const char *name) = 0; @@ -506,8 +536,16 @@ public: #ifdef NDEBUG #define PLATFORM_ASSERT(c) ((void)0) #else +#ifdef SCI_NAMESPACE +#define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Scintilla::Platform::Assert(#c, __FILE__, __LINE__)) +#else #define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Platform::Assert(#c, __FILE__, __LINE__)) #endif +#endif + +#ifdef SCI_NAMESPACE +} +#endif // Shut up annoying Visual C++ warnings: #ifdef _MSC_VER