// forward declarations
// ---------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxBitmap;
-class WXDLLIMPEXP_CORE wxBrush;
-class WXDLLIMPEXP_CORE wxColour;
-class WXDLLIMPEXP_CORE wxCursor;
-class WXDLLIMPEXP_CORE wxFont;
-class WXDLLIMPEXP_CORE wxIcon;
-class WXDLLIMPEXP_CORE wxPalette;
-class WXDLLIMPEXP_CORE wxPen;
-class WXDLLIMPEXP_CORE wxRegion;
-class WXDLLIMPEXP_BASE wxString;
-class WXDLLIMPEXP_CORE wxIconBundle;
-class WXDLLIMPEXP_CORE wxPoint;
+class WXDLLIMPEXP_FWD_CORE wxBitmap;
+class WXDLLIMPEXP_FWD_CORE wxBrush;
+class WXDLLIMPEXP_FWD_CORE wxColour;
+class WXDLLIMPEXP_FWD_CORE wxCursor;
+class WXDLLIMPEXP_FWD_CORE wxFont;
+class WXDLLIMPEXP_FWD_CORE wxIcon;
+class WXDLLIMPEXP_FWD_CORE wxPalette;
+class WXDLLIMPEXP_FWD_CORE wxPen;
+class WXDLLIMPEXP_FWD_CORE wxRegion;
+class WXDLLIMPEXP_FWD_BASE wxString;
+class WXDLLIMPEXP_FWD_CORE wxIconBundle;
+class WXDLLIMPEXP_FWD_CORE wxPoint;
// ---------------------------------------------------------------------------
// constants
wxBITMAP_TYPE_TGA,
wxBITMAP_TYPE_MACCURSOR,
wxBITMAP_TYPE_MACCURSOR_RESOURCE,
+
+ wxBITMAP_TYPE_MAX,
wxBITMAP_TYPE_ANY = 50
};
+// Polygon filling mode
+enum wxPolygonFillMode
+{
+ wxODDEVEN_RULE = 1,
+ wxWINDING_RULE
+};
+
// Standard cursors
enum wxStockCursor
{
wxCURSOR_BASED_ARROW_UP,
wxCURSOR_BASED_ARROW_DOWN,
#endif // X11
-
wxCURSOR_ARROWWAIT,
+#ifdef __WXMAC__
+ wxCURSOR_OPEN_HAND,
+ wxCURSOR_CLOSED_HAND,
+#endif
wxCURSOR_MAX
};
#ifndef __WXGTK__
- #define wxCURSOR_DEFAULT wxCURSOR_ARROW
+ #define wxCURSOR_DEFAULT wxCURSOR_ARROW
+#endif
+
+#ifndef __WXMAC__
+ // TODO CS supply openhand and closedhand cursors
+ #define wxCURSOR_OPEN_HAND wxCURSOR_HAND
+ #define wxCURSOR_CLOSED_HAND wxCURSOR_HAND
#endif
// ---------------------------------------------------------------------------
#define wxICON(X) wxIcon(wxT(#X))
#elif defined(__WXMGL__)
// Initialize from an included XPM
- #define wxICON(X) wxIcon( (const char**) X##_xpm )
+ #define wxICON(X) wxIcon( X##_xpm )
#elif defined(__WXDFB__)
// Initialize from an included XPM
- #define wxICON(X) wxIcon( (const char**) X##_xpm )
+ #define wxICON(X) wxIcon( X##_xpm )
#elif defined(__WXGTK__)
// Initialize from an included XPM
- #define wxICON(X) wxIcon( (const char**) X##_xpm )
+ #define wxICON(X) wxIcon( X##_xpm )
#elif defined(__WXMAC__)
// Initialize from an included XPM
- #define wxICON(X) wxIcon( (const char**) X##_xpm )
+ #define wxICON(X) wxIcon( X##_xpm )
#elif defined(__WXMOTIF__)
// Initialize from an included XPM
#define wxICON(X) wxIcon( X##_xpm )
defined(__WXDFB__) || \
defined(__WXCOCOA__)
// Initialize from an included XPM
- #define wxBITMAP(name) wxBitmap( (const char**) name##_xpm )
+ #define wxBITMAP(name) wxBitmap(name##_xpm)
#else // other platforms
#define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM)
#endif // platform
// wxSize
// ---------------------------------------------------------------------------
-class WXDLLEXPORT wxSize
+class WXDLLIMPEXP_CORE wxSize
{
public:
// members are public for compatibility, don't use them directly.
wxSize& operator-=(const wxSize& sz) { x -= sz.x; y -= sz.y; return *this; }
wxSize& operator/=(int i) { x /= i; y /= i; return *this; }
wxSize& operator*=(int i) { x *= i; y *= i; return *this; }
+ wxSize& operator/=(unsigned int i) { x /= i; y /= i; return *this; }
+ wxSize& operator*=(unsigned int i) { x *= i; y *= i; return *this; }
+ wxSize& operator/=(long i) { x /= i; y /= i; return *this; }
+ wxSize& operator*=(long i) { x *= i; y *= i; return *this; }
+ wxSize& operator/=(unsigned long i) { x /= i; y /= i; return *this; }
+ wxSize& operator*=(unsigned long i) { x *= i; y *= i; return *this; }
+ wxSize& operator/=(double i) { x = int(x/i); y = int(y/i); return *this; }
+ wxSize& operator*=(double i) { x = int(x*i); y = int(y*i); return *this; }
void IncTo(const wxSize& sz)
{ if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; }
int GetY() const { return y; }
};
-
inline bool operator==(const wxSize& s1, const wxSize& s2)
{
return s1.x == s2.x && s1.y == s2.y;
return s1.x != s2.x || s1.y != s2.y;
}
-
inline wxSize operator+(const wxSize& s1, const wxSize& s2)
{
return wxSize(s1.x + s2.x, s1.y + s2.y);
}
-
inline wxSize operator-(const wxSize& s1, const wxSize& s2)
{
return wxSize(s1.x - s2.x, s1.y - s2.y);
}
-
inline wxSize operator/(const wxSize& s, int i)
{
return wxSize(s.x / i, s.y / i);
}
-
inline wxSize operator*(const wxSize& s, int i)
{
return wxSize(s.x * i, s.y * i);
}
-
inline wxSize operator*(int i, const wxSize& s)
{
return wxSize(s.x * i, s.y * i);
}
+inline wxSize operator/(const wxSize& s, unsigned int i)
+{
+ return wxSize(s.x / i, s.y / i);
+}
+
+inline wxSize operator*(const wxSize& s, unsigned int i)
+{
+ return wxSize(s.x * i, s.y * i);
+}
+
+inline wxSize operator*(unsigned int i, const wxSize& s)
+{
+ return wxSize(s.x * i, s.y * i);
+}
+
+inline wxSize operator/(const wxSize& s, long i)
+{
+ return wxSize(s.x / i, s.y / i);
+}
+
+inline wxSize operator*(const wxSize& s, long i)
+{
+ return wxSize(s.x * i, s.y * i);
+}
+
+inline wxSize operator*(long i, const wxSize& s)
+{
+ return wxSize(s.x * i, s.y * i);
+}
+
+inline wxSize operator/(const wxSize& s, unsigned long i)
+{
+ return wxSize(s.x / i, s.y / i);
+}
+
+inline wxSize operator*(const wxSize& s, unsigned long i)
+{
+ return wxSize(s.x * i, s.y * i);
+}
+
+inline wxSize operator*(unsigned long i, const wxSize& s)
+{
+ return wxSize(s.x * i, s.y * i);
+}
+
+inline wxSize operator*(const wxSize& s, double i)
+{
+ return wxSize(int(s.x * i), int(s.y * i));
+}
+
+inline wxSize operator*(double i, const wxSize& s)
+{
+ return wxSize(int(s.x * i), int(s.y * i));
+}
// Point classes: with real or integer coordinates
// ---------------------------------------------------------------------------
-class WXDLLEXPORT wxRealPoint
+class WXDLLIMPEXP_CORE wxRealPoint
{
public:
double x;
// wxPoint: 2D point with integer coordinates
// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxPoint
+class WXDLLIMPEXP_CORE wxPoint
{
public:
int x, y;
return wxPoint(-p.x, -p.y);
}
+WX_DECLARE_LIST_WITH_DECL(wxPoint, wxPointList, class WXDLLIMPEXP_CORE);
// ---------------------------------------------------------------------------
// wxRect
// ---------------------------------------------------------------------------
-class WXDLLEXPORT wxRect
+class WXDLLIMPEXP_CORE wxRect
{
public:
wxRect()
// return true if the point is (not strcitly) inside the rect
bool Contains(int x, int y) const;
bool Contains(const wxPoint& pt) const { return Contains(pt.x, pt.y); }
- // return true if the rectangle is (not strcitly) inside the rect
+ // return true if the rectangle 'rect' is (not strictly) inside this rect
bool Contains(const wxRect& rect) const;
#if WXWIN_COMPATIBILITY_2_6
wxList list;
};
-class WXDLLIMPEXP_CORE wxPenList: public wxGDIObjListBase
-{
-public:
- wxPen *FindOrCreatePen(const wxColour& colour, int width, int style);
-#if WXWIN_COMPATIBILITY_2_6
- wxDEPRECATED( void AddPen(wxPen*) );
- wxDEPRECATED( void RemovePen(wxPen*) );
-#endif
-};
-
-class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase
-{
-public:
- wxBrush *FindOrCreateBrush(const wxColour& colour, int style = wxSOLID);
-#if WXWIN_COMPATIBILITY_2_6
- wxDEPRECATED( void AddBrush(wxBrush*) );
- wxDEPRECATED( void RemoveBrush(wxBrush*) );
-#endif
-};
-
-class WXDLLIMPEXP_CORE wxFontList: public wxGDIObjListBase
-{
-public:
- wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight,
- bool underline = false,
- const wxString& face = wxEmptyString,
- wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
-#if WXWIN_COMPATIBILITY_2_6
- wxDEPRECATED( void AddFont(wxFont*) );
- wxDEPRECATED( void RemoveFont(wxFont*) );
-#endif
-};
-
WX_DECLARE_STRING_HASH_MAP(wxColour*, wxStringToColourHashMap);
-class WXDLLEXPORT wxColourDatabase
+class WXDLLIMPEXP_CORE wxColourDatabase
{
public:
wxColourDatabase();
wxStringToColourHashMap *m_map;
};
-class WXDLLEXPORT wxResourceCache: public wxList
+class WXDLLIMPEXP_CORE wxResourceCache: public wxList
{
public:
wxResourceCache() { }
// global variables
// ---------------------------------------------------------------------------
-// Lists of GDI objects
-extern WXDLLEXPORT_DATA(wxPenList*) wxThePenList;
-extern WXDLLEXPORT_DATA(wxBrushList*) wxTheBrushList;
-extern WXDLLEXPORT_DATA(wxFontList*) wxTheFontList;
/* Stock objects
BRUSH_BLUE,
BRUSH_CYAN,
BRUSH_GREEN,
+ BRUSH_YELLOW,
BRUSH_GREY,
BRUSH_LIGHTGREY,
BRUSH_MEDIUMGREY,
COLOUR_BLUE,
COLOUR_CYAN,
COLOUR_GREEN,
+ COLOUR_YELLOW,
COLOUR_LIGHTGREY,
COLOUR_RED,
COLOUR_WHITE,
FONT_SWISS,
PEN_BLACK,
PEN_BLACKDASHED,
+ PEN_BLUE,
PEN_CYAN,
PEN_GREEN,
+ PEN_YELLOW,
PEN_GREY,
PEN_LIGHTGREY,
PEN_MEDIUMGREY,
static wxObject* ms_stockObject[ITEMCOUNT];
- DECLARE_NO_COPY_CLASS(wxStockGDI)
+ wxDECLARE_NO_COPY_CLASS(wxStockGDI);
};
#define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC)
#define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED)
#define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK)
+#define wxBLUE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLUE)
#define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN)
#define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN)
+#define wxYELLOW_PEN wxStockGDI::GetPen(wxStockGDI::PEN_YELLOW)
#define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY)
#define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY)
#define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY)
#define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE)
#define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN)
#define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN)
+#define wxYELLOW_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_YELLOW)
#define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY)
#define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY)
#define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY)
#define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
#define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
#define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
+#define wxYELLOW wxStockGDI::GetColour(wxStockGDI::COLOUR_YELLOW)
#define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
#define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
#define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
#define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD)
// 'Null' objects
-extern WXDLLEXPORT_DATA(wxBitmap) wxNullBitmap;
-extern WXDLLEXPORT_DATA(wxIcon) wxNullIcon;
-extern WXDLLEXPORT_DATA(wxCursor) wxNullCursor;
-extern WXDLLEXPORT_DATA(wxPen) wxNullPen;
-extern WXDLLEXPORT_DATA(wxBrush) wxNullBrush;
-extern WXDLLEXPORT_DATA(wxPalette) wxNullPalette;
-extern WXDLLEXPORT_DATA(wxFont) wxNullFont;
-extern WXDLLEXPORT_DATA(wxColour) wxNullColour;
-extern WXDLLEXPORT_DATA(wxIconBundle) wxNullIconBundle;
+extern WXDLLIMPEXP_DATA_CORE(wxBitmap) wxNullBitmap;
+extern WXDLLIMPEXP_DATA_CORE(wxIcon) wxNullIcon;
+extern WXDLLIMPEXP_DATA_CORE(wxCursor) wxNullCursor;
+extern WXDLLIMPEXP_DATA_CORE(wxPen) wxNullPen;
+extern WXDLLIMPEXP_DATA_CORE(wxBrush) wxNullBrush;
+extern WXDLLIMPEXP_DATA_CORE(wxPalette) wxNullPalette;
+extern WXDLLIMPEXP_DATA_CORE(wxFont) wxNullFont;
+extern WXDLLIMPEXP_DATA_CORE(wxColour) wxNullColour;
+extern WXDLLIMPEXP_DATA_CORE(wxIconBundle) wxNullIconBundle;
-extern WXDLLEXPORT_DATA(wxColourDatabase*) wxTheColourDatabase;
+extern WXDLLIMPEXP_DATA_CORE(wxColourDatabase*) wxTheColourDatabase;
-extern WXDLLEXPORT_DATA(const wxChar) wxPanelNameStr[];
+extern WXDLLIMPEXP_DATA_CORE(const char) wxPanelNameStr[];
-extern WXDLLEXPORT_DATA(const wxSize) wxDefaultSize;
-extern WXDLLEXPORT_DATA(const wxPoint) wxDefaultPosition;
+extern WXDLLIMPEXP_DATA_CORE(const wxSize) wxDefaultSize;
+extern WXDLLIMPEXP_DATA_CORE(const wxPoint) wxDefaultPosition;
// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------
// resource management
-extern void WXDLLEXPORT wxInitializeStockLists();
-extern void WXDLLEXPORT wxDeleteStockLists();
+extern void WXDLLIMPEXP_CORE wxInitializeStockLists();
+extern void WXDLLIMPEXP_CORE wxDeleteStockLists();
// is the display colour (or monochrome)?
-extern bool WXDLLEXPORT wxColourDisplay();
+extern bool WXDLLIMPEXP_CORE wxColourDisplay();
// Returns depth of screen
-extern int WXDLLEXPORT wxDisplayDepth();
+extern int WXDLLIMPEXP_CORE wxDisplayDepth();
#define wxGetDisplayDepth wxDisplayDepth
// get the display size
-extern void WXDLLEXPORT wxDisplaySize(int *width, int *height);
-extern wxSize WXDLLEXPORT wxGetDisplaySize();
-extern void WXDLLEXPORT wxDisplaySizeMM(int *width, int *height);
-extern wxSize WXDLLEXPORT wxGetDisplaySizeMM();
+extern void WXDLLIMPEXP_CORE wxDisplaySize(int *width, int *height);
+extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySize();
+extern void WXDLLIMPEXP_CORE wxDisplaySizeMM(int *width, int *height);
+extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySizeMM();
+extern wxSize WXDLLIMPEXP_CORE wxGetDisplayPPI();
// Get position and size of the display workarea
-extern void WXDLLEXPORT wxClientDisplayRect(int *x, int *y, int *width, int *height);
-extern wxRect WXDLLEXPORT wxGetClientDisplayRect();
+extern void WXDLLIMPEXP_CORE wxClientDisplayRect(int *x, int *y, int *width, int *height);
+extern wxRect WXDLLIMPEXP_CORE wxGetClientDisplayRect();
// set global cursor
-extern void WXDLLEXPORT wxSetCursor(const wxCursor& cursor);
+extern void WXDLLIMPEXP_CORE wxSetCursor(const wxCursor& cursor);
#endif
// _WX_GDICMNH__