diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/KeyWords.h | 8 | ||||
| -rw-r--r-- | include/Platform.h | 41 | ||||
| -rw-r--r-- | include/PropSet.h | 7 | ||||
| -rw-r--r-- | include/SString.h | 9 | ||||
| -rw-r--r-- | include/Scintilla.h | 8 | ||||
| -rw-r--r-- | include/WindowAccessor.h | 8 | 
6 files changed, 79 insertions, 2 deletions
diff --git a/include/KeyWords.h b/include/KeyWords.h index 059ac0da0..6abae5945 100644 --- a/include/KeyWords.h +++ b/include/KeyWords.h @@ -5,6 +5,10 @@  // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>  // The License.txt file describes the conditions under which this software may be distributed. +#ifdef SCI_NAMESPACE +namespace Scintilla { +#endif +  typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle,                    WordList *keywordlists[], Accessor &styler); @@ -51,6 +55,10 @@ public:  	static const LexerModule *Find(const char *languageName);  }; +#ifdef SCI_NAMESPACE +} +#endif +  /**   * Check if a character is a space.   * This is ASCII specific but is safe with chars >= 0x80. 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 diff --git a/include/PropSet.h b/include/PropSet.h index e38de7dc4..e9d028c44 100644 --- a/include/PropSet.h +++ b/include/PropSet.h @@ -13,6 +13,10 @@ bool EqualCaseInsensitive(const char *a, const char *b);  bool isprefix(const char *target, const char *prefix); +#ifdef SCI_NAMESPACE +namespace Scintilla { +#endif +  struct Property {  	unsigned int hash;  	char *key; @@ -104,6 +108,9 @@ inline bool IsAlphabetic(unsigned int ch) {  	return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'));  } +#ifdef SCI_NAMESPACE +} +#endif  #ifdef _MSC_VER  // Visual C++ doesn't like the private copy idiom for disabling diff --git a/include/SString.h b/include/SString.h index 38a206ccf..b770afebe 100644 --- a/include/SString.h +++ b/include/SString.h @@ -8,11 +8,16 @@  #ifndef SSTRING_H  #define SSTRING_H +  // These functions are implemented because each platform calls them something different.  int CompareCaseInsensitive(const char *a, const char *b);  int CompareNCaseInsensitive(const char *a, const char *b, size_t len);  bool EqualCaseInsensitive(const char *a, const char *b); +#ifdef SCI_NAMESPACE +namespace Scintilla { +#endif +  // Define another string class.  // While it would be 'better' to use std::string, that doubles the executable size.  // An SString may contain embedded nul characters. @@ -277,4 +282,8 @@ inline char *StringDup(  	return SContainer::StringAllocate(s, len);  } +#ifdef SCI_NAMESPACE +} +#endif +  #endif diff --git a/include/Scintilla.h b/include/Scintilla.h index ab5f05d76..9e67b44de 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -744,6 +744,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,  // CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.  // So older code that treats Scintilla as a RichEdit will work. +#ifdef SCI_NAMESPACE +namespace Scintilla { +#endif +  struct CharacterRange {  	long cpMin;  	long cpMax; @@ -805,6 +809,10 @@ struct SCNotification {  	int y;		// SCN_DWELLSTART, SCN_DWELLEND  }; +#ifdef SCI_NAMESPACE +} +#endif +  // Deprecation section listing all API features that are deprecated and will  // will be removed completely in a future version.  // To enable these features define INCLUDE_DEPRECATED_FEATURES diff --git a/include/WindowAccessor.h b/include/WindowAccessor.h index a55c2c459..e107a0659 100644 --- a/include/WindowAccessor.h +++ b/include/WindowAccessor.h @@ -6,6 +6,10 @@  // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>  // The License.txt file describes the conditions under which this software may be distributed. +#ifdef SCI_NAMESPACE +namespace Scintilla { +#endif +  /**   */  class WindowAccessor : public Accessor { @@ -56,3 +60,7 @@ public:  	int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0);  	void IndicatorFill(int start, int end, int indicator, int value);  }; + +#ifdef SCI_NAMESPACE +} +#endif  | 
