X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c801d85f158c4cba50b588807daabdcbd0ed3853..6d44bf31a6f0b4a261280e57842bbd53b5e26cd5:/src/common/gdicmn.cpp diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index edf16d508e..a30a772c7a 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -31,27 +31,29 @@ #include -#ifdef __WINDOWS__ +#ifdef __WXMSW__ #include #endif #if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxRect, wxObject) IMPLEMENT_CLASS(wxColourDatabase, wxList) IMPLEMENT_DYNAMIC_CLASS(wxFontList, wxList) IMPLEMENT_DYNAMIC_CLASS(wxPenList, wxList) IMPLEMENT_DYNAMIC_CLASS(wxBrushList, wxList) IMPLEMENT_DYNAMIC_CLASS(wxBitmapList, wxList) +/* +IMPLEMENT_DYNAMIC_CLASS(wxRect, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxPoint, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxRealPoint, wxObject) +*/ #endif -wxRect::wxRect(void) +wxRect::wxRect() { x = 0; y = 0; width = 0; height = 0; } -wxRect::wxRect(const long xx, const long yy, const long w, const long h) +wxRect::wxRect(long xx, long yy, long w, long h) { x = xx; y = yy; width = w; height = h; } @@ -117,7 +119,7 @@ wxList (type) { } -wxColourDatabase::~wxColourDatabase (void) +wxColourDatabase::~wxColourDatabase () { // Cleanup Colour allocated in Initialize() wxNode *node = First (); @@ -131,7 +133,7 @@ wxColourDatabase::~wxColourDatabase (void) } // Colour database stuff -void wxColourDatabase::Initialize (void) +void wxColourDatabase::Initialize () { // Don't initialize for X: colours are found // in FindColour below. @@ -144,7 +146,7 @@ void wxColourDatabase::Initialize (void) cdef cc; static cdef table[]={ -#ifdef __WINDOWS__ +#ifdef __WXMSW__ {"AQUAMARINE",112, 219, 147}, {"BLACK",0, 0, 0}, {"BLUE", 0, 0, 255}, @@ -218,7 +220,7 @@ void wxColourDatabase::Initialize (void) {"YELLOW GREEN", 153, 204, 50}, #endif -#if defined(__GTK__) || defined(__X__) +#if defined(__WXGTK__) || defined(__X__) {"MEDIUM GOLDENROD", 234, 234, 173}, {"MEDIUM FOREST GREEN", 107, 142, 35}, {"LIGHT MAGENTA", 255, 0, 255}, @@ -250,11 +252,11 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) if (node) return (wxColour *)node->Data(); -#ifdef __WINDOWS__ +#ifdef __WXMSW__ else return NULL; #endif -#ifdef __GTK__ +#ifdef __WXGTK__ else { wxColour *col = new wxColour( colour ); @@ -271,7 +273,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& colour) else { XColor xcolour; -#ifdef __MOTIF__ +#ifdef __WXMOTIF__ Display *display = XtDisplay(wxTheApp->topLevel) ; #endif #ifdef __XVIEW__ @@ -317,14 +319,14 @@ wxString wxColourDatabase::FindName (const wxColour& colour) const } void -wxInitializeStockObjects (void) +wxInitializeStockObjects () { wxTheBrushList = new wxBrushList; wxThePenList = new wxPenList; wxTheFontList = new wxFontList; wxTheBitmapList = new wxBitmapList; -#ifdef __MOTIF__ +#ifdef __WXMOTIF__ #endif #ifdef __X__ wxFontPool = new XFontPool; @@ -371,7 +373,7 @@ wxInitializeStockObjects (void) } void -wxDeleteStockObjects (void) +wxDeleteStockObjects () { DELETEP(wxNORMAL_FONT); DELETEP(wxSMALL_FONT); @@ -413,11 +415,11 @@ wxDeleteStockObjects (void) DELETEP(wxCROSS_CURSOR); } -wxBitmapList::wxBitmapList (void) +wxBitmapList::wxBitmapList () { } -wxBitmapList::~wxBitmapList (void) +wxBitmapList::~wxBitmapList () { wxNode *node = First (); while (node) @@ -431,7 +433,7 @@ wxBitmapList::~wxBitmapList (void) } // Pen and Brush lists -wxPenList::~wxPenList (void) +wxPenList::~wxPenList () { wxNode *node = First (); while (node) @@ -454,7 +456,7 @@ void wxPenList::RemovePen (wxPen * pen) DeleteObject (pen); } -wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, const int width, const int style) +wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style) { for (wxNode * node = First (); node; node = node->Next ()) { @@ -477,7 +479,7 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, const int width, cons return pen; } -wxPen *wxPenList::FindOrCreatePen (const wxString& colour, const int width, const int style) +wxPen *wxPenList::FindOrCreatePen (const wxString& colour, int width, int style) { wxColour *the_colour = wxTheColourDatabase->FindColour (colour); if (the_colour) @@ -486,7 +488,7 @@ wxPen *wxPenList::FindOrCreatePen (const wxString& colour, const int width, cons return NULL; } -wxBrushList::~wxBrushList (void) +wxBrushList::~wxBrushList () { wxNode *node = First (); while (node) @@ -503,7 +505,7 @@ void wxBrushList::AddBrush (wxBrush * brush) Append (brush); } -wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, const int style) +wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, int style) { for (wxNode * node = First (); node; node = node->Next ()) { @@ -524,7 +526,7 @@ wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, const int style return brush; } -wxBrush *wxBrushList::FindOrCreateBrush (const wxString& colour, const int style) +wxBrush *wxBrushList::FindOrCreateBrush (const wxString& colour, int style) { wxColour *the_colour = wxTheColourDatabase->FindColour (colour); if (the_colour) @@ -538,9 +540,9 @@ void wxBrushList::RemoveBrush (wxBrush * brush) DeleteObject (brush); } -wxFontList::~wxFontList (void) +wxFontList::~wxFontList () { -#ifdef __WINDOWS__ +#ifdef __WXMSW__ wxNode *node = First (); while (node) { @@ -573,7 +575,7 @@ void wxFontList::RemoveFont (wxFont * font) } wxFont *wxFontList:: - FindOrCreateFont (const int PointSize, const int FamilyOrFontId, const int Style, const int Weight, const bool underline, const wxString& Face) + FindOrCreateFont (int PointSize, int FamilyOrFontId, int Style, int Weight, bool underline, const wxString& Face) { for (wxNode * node = First (); node; node = node->Next ()) { @@ -583,7 +585,7 @@ wxFont *wxFontList:: each_font->GetStyle () == Style && each_font->GetWeight () == Weight && each_font->GetUnderlined () == underline && -#if defined(__X__) || (defined(__WINDOWS__) && USE_PORTABLE_FONTS_IN_MSW) +#if defined(__X__) || (defined(__WXMSW__) && USE_PORTABLE_FONTS_IN_MSW) each_font->GetFontId () == FamilyOrFontId) /* New font system */ #else each_font->GetFamily () == FamilyOrFontId && @@ -601,3 +603,10 @@ void wxBitmapList::AddBitmap(wxBitmap *bitmap) void wxBitmapList::RemoveBitmap(wxBitmap *bitmap) { DeleteObject(bitmap); } +wxSize wxGetDisplaySize() +{ + int x, y; + wxDisplaySize(& x, & y); + return wxSize(x, y); +} +