diff options
Diffstat (limited to 'include/Platform.h')
| -rw-r--r-- | include/Platform.h | 41 | 
1 files changed, 39 insertions, 2 deletions
| diff --git a/include/Platform.h b/include/Platform.h index 60d7896ac..39e2b6eaf 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -16,6 +16,7 @@  #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 @@ -360,9 +368,23 @@ typedef void (*CallBackAction)(void*);  class Window {  protected:  	WindowID id; +#ifdef 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) { +#ifdef PLAT_MACOSX +	  windowRef = 0; +	  control = 0; +#endif +	} +	Window(const Window &source) : id(source.id), cursorLast(cursorInvalid) { +#ifdef PLAT_MACOSX +	  windowRef = 0; +	  control = 0; +#endif +	}  	virtual ~Window();  	Window &operator=(WindowID id_) {  		id = id_; @@ -383,6 +405,10 @@ public:  	enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand };  	void SetCursor(Cursor curs);  	void SetTitle(const char *s); +#ifdef PLAT_MACOSX +	void SetWindow(void *ref) { windowRef = ref; }; +	void SetControl(void *_control) { control = _control; }; +#endif  private:  	Cursor cursorLast;  }; @@ -474,6 +500,9 @@ public:  	static int DefaultFontSize();  	static unsigned int DoubleClickTime();  	static bool MouseButtonBounce(); +#ifdef __APPLE__ +	static bool WaitMouseMoved(Point pt); +#endif  	static void DebugDisplay(const char *s);  	static bool IsKeyDown(int key);  	static long SendScintilla( @@ -506,8 +535,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 | 
