// Scintilla source code edit control
-// 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 wxWindows
-// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
+/** @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 wxWindows.
+ **/
+// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
#ifndef PLATFORM_H
#define PLATFORM_H
-// PLAT_GTK = GTK+ on Linux, PLAT_WIN = Win32 API on Win32 OS
+// 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 wxWindows on any supported platform
-// Could also have PLAT_GTKWIN = GTK+ on Win32 OS in future
#define PLAT_GTK 0
+#define PLAT_GTK_WIN32 0
+#define PLAT_GTK_MACOSX 0
+#define PLAT_MACOSX 0
#define PLAT_WIN 0
#define PLAT_WX 0
+#define PLAT_QT 0
+#define PLAT_FOX 0
-#if defined(__WX__)
+#if defined(FOX)
+#undef PLAT_FOX
+#define PLAT_FOX 1
+
+#elif defined(__WX__)
#undef PLAT_WX
#define PLAT_WX 1
+#elif defined(SCINTILLA_QT)
+#undef PLAT_QT
+#define PLAT_QT 1
+
#elif defined(GTK)
#undef PLAT_GTK
#define PLAT_GTK 1
-#else
-#undef PLAT_WIN
-#define PLAT_WIN 1
-
+#if defined(__WIN32__) || defined(_MSC_VER)
+#undef PLAT_GTK_WIN32
+#define PLAT_GTK_WIN32 1
#endif
-
-// Include the main header for each platform
-
-#if PLAT_GTK
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-#endif
-
-#if PLAT_WIN
-#define _WIN32_WINNT 0x0400 // Otherwise some required stuff gets ifdef'd out
-// Vassili Bourdo: shut up annoying Visual C++ warnings:
-#ifdef _MSC_VER
-#pragma warning(disable: 4800 4244 4309)
-#endif
-#include <windows.h>
-#include <commctrl.h>
-#include <richedit.h>
+#if defined(__APPLE__)
+#undef PLAT_GTK_MACOSX
+#define PLAT_GTK_MACOSX 1
#endif
-#if PLAT_WX
-#include <wx/wx.h>
-#endif
+#elif defined(__APPLE__)
-// 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
+#undef PLAT_MACOSX
+#define PLAT_MACOSX 1
-#if PLAT_GTK
-typedef GdkColor ColourID;
-typedef GdkFont* FontID;
-typedef GdkDrawable* SurfaceID;
-typedef GtkWidget* WindowID;
-typedef GtkItemFactory* MenuID;
-#endif
+#else
+#undef PLAT_WIN
+#define PLAT_WIN 1
-#if PLAT_WIN
-typedef COLORREF ColourID;
-typedef HFONT FontID;
-typedef HDC SurfaceID;
-typedef HWND WindowID;
-typedef HMENU MenuID;
#endif
-#if PLAT_WX
-typedef wxColour ColourID;
-typedef wxFont* FontID;
-typedef wxDC* SurfaceID;
-typedef wxWindow* WindowID;
-typedef wxMenu* MenuID;
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
#endif
-#if PLAT_GTK || PLAT_WX
-#define SHIFT_PRESSED 1
-#define LEFT_CTRL_PRESSED 2
-#define LEFT_ALT_PRESSED 4
-#endif
+typedef float XYPOSITION;
+typedef double XYACCUMULATOR;
+//#define XYPOSITION int
-// Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably
+// 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
+typedef void *FontID;
+typedef void *SurfaceID;
+typedef void *WindowID;
+typedef void *MenuID;
+typedef void *TickerID;
+typedef void *Function;
+typedef void *IdlerID;
+
+/**
+ * A geometric point class.
+ * Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably.
+ */
class Point {
public:
- int x;
- int y;
-
- Point(int x_=0, int y_=0) : x(x_), y(y_) {
+ XYPOSITION x;
+ XYPOSITION y;
+
+ explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) : x(x_), y(y_) {
}
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
-
+
static Point FromLong(long lpoint);
};
-// PRectangle is exactly the same as the Win32 RECT so can be used interchangeably
-// PRectangles contain their top and left sides, but not their right and bottom sides
+/**
+ * A geometric rectangle class.
+ * PRectangle is exactly the same as the Win32 RECT so can be used interchangeably.
+ * PRectangles contain their top and left sides, but not their right and bottom sides.
+ */
class PRectangle {
public:
- int left;
- int top;
- int right;
- int bottom;
+ XYPOSITION left;
+ XYPOSITION top;
+ XYPOSITION right;
+ XYPOSITION bottom;
- PRectangle(int left_=0, int top_=0, int right_=0, int bottom_ = 0) :
+ PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) :
left(left_), top(top_), right(right_), bottom(bottom_) {
}
// Other automatically defined methods (assignment, copy constructor, destructor) are fine
+ bool operator==(PRectangle &rc) {
+ return (rc.left == left) && (rc.right == right) &&
+ (rc.top == top) && (rc.bottom == bottom);
+ }
bool Contains(Point pt) {
return (pt.x >= left) && (pt.x <= right) &&
(pt.y >= top) && (pt.y <= bottom);
(rc.top >= top) && (rc.bottom <= bottom);
}
bool Intersects(PRectangle other) {
- return (right >= other.left) && (left <= other.right) &&
- (bottom >= other.top) && (top <= other.bottom);
+ return (right > other.left) && (left < other.right) &&
+ (bottom > other.top) && (top < other.bottom);
+ }
+ void Move(XYPOSITION xDelta, XYPOSITION yDelta) {
+ left += xDelta;
+ top += yDelta;
+ right += xDelta;
+ bottom += yDelta;
+ }
+ XYPOSITION Width() { return right - left; }
+ XYPOSITION Height() { return bottom - top; }
+ bool Empty() {
+ return (Height() <= 0) || (Width() <= 0);
}
- int Width() { return right - left; }
- int Height() { return bottom - top; }
};
-#if PLAT_WX
-wxRect wxRectFromPRectangle(PRectangle prc);
-PRectangle PRectangleFromwxRect(wxRect rc);
-#endif
-
-class Colour {
- ColourID co;
+/**
+ * Holds a desired RGB colour.
+ */
+class ColourDesired {
+ long co;
public:
- Colour(long lcol=0);
- Colour(unsigned int red, unsigned int green, unsigned int blue);
- bool operator==(const Colour &other) const;
- long AsLong() const;
- unsigned int GetRed();
- unsigned int GetGreen();
- unsigned int GetBlue();
-
- friend class Surface;
- friend class Palette;
-};
+ ColourDesired(long lcol=0) {
+ co = lcol;
+ }
+
+ ColourDesired(unsigned int red, unsigned int green, unsigned int blue) {
+ Set(red, green, blue);
+ }
+
+ bool operator==(const ColourDesired &other) const {
+ return co == other.co;
+ }
+
+ void Set(long lcol) {
+ co = lcol;
+ }
+
+ void Set(unsigned int red, unsigned int green, unsigned int blue) {
+ co = red | (green << 8) | (blue << 16);
+ }
+
+ static inline unsigned int ValueOfHex(const char ch) {
+ if (ch >= '0' && ch <= '9')
+ return ch - '0';
+ else if (ch >= 'A' && ch <= 'F')
+ return ch - 'A' + 10;
+ else if (ch >= 'a' && ch <= 'f')
+ return ch - 'a' + 10;
+ else
+ return 0;
+ }
+
+ void Set(const char *val) {
+ if (*val == '#') {
+ val++;
+ }
+ unsigned int r = ValueOfHex(val[0]) * 16 + ValueOfHex(val[1]);
+ unsigned int g = ValueOfHex(val[2]) * 16 + ValueOfHex(val[3]);
+ unsigned int b = ValueOfHex(val[4]) * 16 + ValueOfHex(val[5]);
+ Set(r, g, b);
+ }
+
+ long AsLong() const {
+ return co;
+ }
+
+ unsigned int GetRed() {
+ return co & 0xff;
+ }
-// Colour pairs hold a desired colour and the colour that the graphics engine
-// allocates to approximate the desired colour.
-// To make palette management more automatic, ColourPairs could register at
-// construction time with a palette management object.
-struct ColourPair {
- Colour desired;
- Colour allocated;
-
- ColourPair(Colour desired_=Colour(0,0,0)) {
- desired = desired_;
- allocated = desired;
+ unsigned int GetGreen() {
+ return (co >> 8) & 0xff;
+ }
+
+ unsigned int GetBlue() {
+ return (co >> 16) & 0xff;
}
};
-class Window; // Forward declaration for Palette
-
-class Palette {
- int used;
- enum {numEntries = 100};
- ColourPair entries[numEntries];
-#if PLAT_GTK
- GdkColor *allocatedPalette;
- int allocatedLen;
-#elif PLAT_WIN
- HPALETTE hpal;
-#elif PLAT_WX
- // wxPalette* pal; // **** Is this needed?
-#endif
-public:
- bool allowRealization;
-
- Palette();
- ~Palette();
-
- void Release();
-
- // This method either adds a colour to the list of wanted colours (want==true)
- // or retrieves the allocated colour back to the ColourPair.
- // This is one method to make it easier to keep the code for wanting and retrieving in sync.
- void WantFind(ColourPair &cp, bool want);
-
- void Allocate(Window &w);
-
- friend class Surface;
+/**
+ * Font management.
+ */
+
+struct FontParameters {
+ const char *faceName;
+ float size;
+ int weight;
+ bool italic;
+ int extraFontFlag;
+ int technology;
+ int characterSet;
+
+ FontParameters(
+ const char *faceName_,
+ float size_=10,
+ int weight_=400,
+ bool italic_=false,
+ int extraFontFlag_=0,
+ int technology_=0,
+ int characterSet_=0) :
+
+ faceName(faceName_),
+ size(size_),
+ weight(weight_),
+ italic(italic_),
+ extraFontFlag(extraFontFlag_),
+ technology(technology_),
+ characterSet(characterSet_)
+ {
+ }
+
};
class Font {
- FontID id;
+protected:
+ FontID fid;
#if PLAT_WX
int ascent;
#endif
// Private so Font objects can not be copied
- Font(const Font &) {}
- Font &operator=(const Font &) { id=0; return *this; }
+ Font(const Font &);
+ Font &operator=(const Font &);
public:
Font();
- ~Font();
+ virtual ~Font();
- void Create(const char *faceName, int characterSet, int size, bool bold, bool italic);
- void Release();
+ virtual void Create(const FontParameters &fp);
+ virtual void Release();
- FontID GetID() { return id; }
+ FontID GetID() { return fid; }
// Alias another font - caller guarantees not to Release
- void SetID(FontID id_) { id = id_; }
+ void SetID(FontID fid_) { fid = fid_; }
+#if PLAT_WX
+ void SetAscent(int ascent_) { ascent = ascent_; }
+#endif
friend class Surface;
+ friend class SurfaceImpl;
};
-// A surface abstracts a place to draw
+/**
+ * A surface abstracts a place to draw.
+ */
class Surface {
private:
- bool unicodeMode;
-#if PLAT_GTK
- GdkDrawable *drawable;
- GdkGC *gc;
- GdkPixmap *ppixmap;
- int x;
- int y;
- bool inited;
- bool createdGC;
-#elif PLAT_WIN
- HDC hdc;
- bool hdcOwned;
- HPEN pen;
- HPEN penOld;
- HBRUSH brush;
- HBRUSH brushOld;
- HFONT font;
- HFONT fontOld;
- HBITMAP bitmap;
- HBITMAP bitmapOld;
- HPALETTE paletteOld;
-#elif PLAT_WX
- wxDC* hdc;
- bool hdcOwned;
- wxBitmap* bitmap;
- int x;
- int y;
-#endif
-
// Private so Surface objects can not be copied
Surface(const Surface &) {}
Surface &operator=(const Surface &) { return *this; }
-#if PLAT_WIN || PLAT_WX
- void BrushColor(Colour back);
- void SetFont(Font &font_);
-#endif
public:
- Surface();
- ~Surface();
-
- void Init();
- void Init(SurfaceID hdc_);
- void InitPixMap(int width, int height, Surface *surface_);
-
- void Release();
- 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);
- void RectangleDraw(PRectangle rc, Colour fore, Colour back);
- void FillRectangle(PRectangle rc, Colour back);
- void FillRectangle(PRectangle rc, Surface &surfacePattern);
- void RoundedRectangle(PRectangle rc, Colour fore, Colour back);
- void Ellipse(PRectangle rc, Colour fore, Colour back);
- void Copy(PRectangle rc, Point from, Surface &surfaceSource);
-
- void DrawText(PRectangle rc, Font &font_, int ybase, const char *s, int len, Colour fore, Colour back);
- void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, Colour fore, Colour back);
- void MeasureWidths(Font &font_, const char *s, int len, int *positions);
- int WidthText(Font &font_, const char *s, int len);
- int WidthChar(Font &font_, char ch);
- int Ascent(Font &font_);
- int Descent(Font &font_);
- int InternalLeading(Font &font_);
- int ExternalLeading(Font &font_);
- int Height(Font &font_);
- int AverageCharWidth(Font &font_);
-
- int SetPalette(Palette *pal, bool inBackGround);
- void SetClip(PRectangle rc);
- void FlushCachedState();
-
- void SetUnicodeMode(bool unicodeMode_) {
- unicodeMode=unicodeMode_;
- }
+ Surface() {}
+ virtual ~Surface() {}
+ static Surface *Allocate(int technology);
+
+ virtual void Init(WindowID wid)=0;
+ virtual void Init(SurfaceID sid, WindowID wid)=0;
+ virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0;
+
+ virtual void Release()=0;
+ virtual bool Initialised()=0;
+ virtual void PenColour(ColourDesired fore)=0;
+ virtual int LogPixelsY()=0;
+ virtual int DeviceHeightFont(int points)=0;
+ virtual void MoveTo(int x_, int y_)=0;
+ virtual void LineTo(int x_, int y_)=0;
+ virtual void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back)=0;
+ virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
+ virtual void FillRectangle(PRectangle rc, ColourDesired back)=0;
+ virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0;
+ virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
+ virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
+ ColourDesired outline, int alphaOutline, int flags)=0;
+ virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) = 0;
+ virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0;
+ virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0;
+
+ virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0;
+ virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0;
+ virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore)=0;
+ virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions)=0;
+ virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0;
+ virtual XYPOSITION WidthChar(Font &font_, char ch)=0;
+ virtual XYPOSITION Ascent(Font &font_)=0;
+ virtual XYPOSITION Descent(Font &font_)=0;
+ virtual XYPOSITION InternalLeading(Font &font_)=0;
+ virtual XYPOSITION ExternalLeading(Font &font_)=0;
+ virtual XYPOSITION Height(Font &font_)=0;
+ virtual XYPOSITION AverageCharWidth(Font &font_)=0;
+
+ virtual void SetClip(PRectangle rc)=0;
+ virtual void FlushCachedState()=0;
+
+ virtual void SetUnicodeMode(bool unicodeMode_)=0;
+ virtual void SetDBCSMode(int codePage)=0;
};
-// Class to hide the details of window manipulation
-// Does not own the window which will normally have a longer life than this object
+/**
+ * A simple callback action passing one piece of untyped user data.
+ */
+typedef void (*CallBackAction)(void*);
+
+/**
+ * Class to hide the details of window manipulation.
+ * Does not own the window which will normally have a longer life than this object.
+ */
class Window {
- friend class ListBox;
protected:
- WindowID id;
+ WindowID wid;
+#if PLAT_MACOSX
+ void *windowRef;
+ void *control;
+#endif
public:
- Window() : id(0) {}
- Window(const Window &source) : id(source.id) {}
+ Window() : wid(0), cursorLast(cursorInvalid) {
+#if PLAT_MACOSX
+ windowRef = 0;
+ control = 0;
+#endif
+ }
+ Window(const Window &source) : wid(source.wid), cursorLast(cursorInvalid) {
+#if PLAT_MACOSX
+ windowRef = 0;
+ control = 0;
+#endif
+ }
virtual ~Window();
- Window &operator=(WindowID id_) {
- id = id_;
+ Window &operator=(WindowID wid_) {
+ wid = wid_;
return *this;
}
- WindowID GetID() { return id; }
- bool Created() { return id != 0; }
+ WindowID GetID() const { return wid; }
+ bool Created() const { return wid != 0; }
void Destroy();
bool HasFocus();
PRectangle GetPosition();
void Show(bool show=true);
void InvalidateAll();
void InvalidateRectangle(PRectangle rc);
- void SetFont(Font &font);
- enum Cursor { cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow };
+ virtual void SetFont(Font &font);
+ enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand };
void SetCursor(Cursor curs);
void SetTitle(const char *s);
-#if PLAT_WIN
- LRESULT SendMessage(UINT msg, WPARAM wParam=0, LPARAM lParam=0);
- int GetDlgCtrlID();
- HINSTANCE GetInstance();
+ PRectangle GetMonitorRect(Point pt);
+#if PLAT_MACOSX
+ void SetWindow(void *ref) { windowRef = ref; }
+ void SetControl(void *_control) { control = _control; }
#endif
+private:
+ Cursor cursorLast;
};
+/**
+ * Listbox management.
+ */
+
class ListBox : public Window {
-#if PLAT_GTK
- WindowID list;
- WindowID scroller;
- int current;
-#endif
public:
ListBox();
virtual ~ListBox();
- ListBox &operator=(WindowID id_) {
- id = id_;
- return *this;
- }
- void Create(Window &parent, int ctrlID);
- void Clear();
- void Append(char *s);
- int Length();
- void Select(int n);
- int GetSelection();
- int Find(const char *prefix);
- void GetValue(int n, char *value, int len);
- void Sort();
+ static ListBox *Allocate();
+
+ virtual void SetFont(Font &font)=0;
+ virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_, int technology_)=0;
+ virtual void SetAverageCharWidth(int width)=0;
+ virtual void SetVisibleRows(int rows)=0;
+ virtual int GetVisibleRows() const=0;
+ virtual PRectangle GetDesiredRect()=0;
+ virtual int CaretFromEdge()=0;
+ virtual void Clear()=0;
+ virtual void Append(char *s, int type = -1)=0;
+ virtual int Length()=0;
+ virtual void Select(int n)=0;
+ virtual int GetSelection()=0;
+ virtual int Find(const char *prefix)=0;
+ virtual void GetValue(int n, char *value, int len)=0;
+ virtual void RegisterImage(int type, const char *xpm_data)=0;
+ virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) = 0;
+ virtual void ClearRegisteredImages()=0;
+ virtual void SetDoubleClickAction(CallBackAction, void *)=0;
+ virtual void SetList(const char* list, char separator, char typesep)=0;
};
+/**
+ * Menu management.
+ */
class Menu {
- MenuID id;
+ MenuID mid;
public:
Menu();
- MenuID GetID() { return id; }
+ MenuID GetID() { return mid; }
void CreatePopUp();
void Destroy();
void Show(Point pt, Window &w);
};
-// Platform class used to retrieve system wide parameters such as double click speed
-// and chrome colour. Not a creatable object, more of a module with several functions.
+class ElapsedTime {
+ long bigBit;
+ long littleBit;
+public:
+ ElapsedTime();
+ double Duration(bool reset=false);
+};
+
+/**
+ * Dynamic Library (DLL/SO/...) loading
+ */
+class DynamicLibrary {
+public:
+ virtual ~DynamicLibrary() {}
+
+ /// @return Pointer to function "name", or NULL on failure.
+ virtual Function FindFunction(const char *name) = 0;
+
+ /// @return true if the library was loaded successfully.
+ virtual bool IsValid() = 0;
+
+ /// @return An instance of a DynamicLibrary subclass with "modulePath" loaded.
+ static DynamicLibrary *Load(const char *modulePath);
+};
+
+/**
+ * Platform class used to retrieve system wide parameters such as double click speed
+ * and chrome colour. Not a creatable object, more of a module with several functions.
+ */
class Platform {
// Private so Platform objects can not be copied
Platform(const Platform &) {}
// but gcc warns about this
Platform() {}
~Platform() {}
- static Colour Chrome();
- static Colour ChromeHighlight();
+ static ColourDesired Chrome();
+ static ColourDesired ChromeHighlight();
static const char *DefaultFont();
static int DefaultFontSize();
static unsigned int DoubleClickTime();
+ static bool MouseButtonBounce();
static void DebugDisplay(const char *s);
static bool IsKeyDown(int key);
static long SendScintilla(
WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0);
-
+ static long SendScintillaPointer(
+ WindowID w, unsigned int msg, unsigned long wParam=0, void *lParam=0);
+ static bool IsDBCSLeadByte(int codePage, char ch);
+ static int DBCSCharLength(int codePage, const char *s);
+ static int DBCSCharMaxLength();
+
// 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<short>(x >> 16);
+ }
+ static short LowShortFromLong(long x) {
+ return static_cast<short>(x & 0xffff);
+ }
static void DebugPrintf(const char *format, ...);
+ static bool ShowAssertionPopUps(bool assertionPopUps_);
+ static void Assert(const char *c, const char *file, int line);
static int Clamp(int val, int minVal, int maxVal);
};
+#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
+#pragma warning(disable: 4244 4309 4514 4710)
+#endif
+
+#if defined(__GNUC__) && defined(SCINTILLA_QT)
+#pragma GCC diagnostic ignored "-Wmissing-braces"
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#pragma GCC diagnostic ignored "-Wchar-subscripts"
+#endif
+
#endif