X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa1fcc6642439f48b1e68b6767090aaf814d90e8..a8d2fb31cbf09dcc4683c9566ff4bc89580f268c:/src/gtk1/cursor.cpp diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index dc03ce10db..3ddd0650f8 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -7,10 +7,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// - -#ifdef __GNUG__ -#pragma implementation "cursor.h" -#endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" #include "wx/cursor.h" #include "wx/utils.h" @@ -252,16 +250,27 @@ wxCursor::wxCursor( const wxImage & image ) (unsigned char)(colNextMostFreq >> 8), (unsigned char)(colNextMostFreq) ); + int fg_intensity = fg.Red() + fg.Green() + fg.Blue(); + int bg_intensity = bg.Red() + bg.Green() + bg.Blue(); + + if (bg_intensity > fg_intensity) + { + //swap fg and bg + wxColour tmp = fg; + fg = bg; + bg = tmp; + } + int hotSpotX; int hotSpotY; - if (image.HasOption(wxCUR_HOTSPOT_X)) - hotSpotX = image.GetOptionInt(wxCUR_HOTSPOT_X); + if (image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X)) + hotSpotX = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X); else hotSpotX = 0; - if (image.HasOption(wxCUR_HOTSPOT_Y)) - hotSpotY = image.GetOptionInt(wxCUR_HOTSPOT_Y); + if (image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y)) + hotSpotY = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y); else hotSpotY = 0; @@ -354,7 +363,7 @@ void wxEndBusyCursor() gs_savedCursor = wxNullCursor; if (wxTheApp) - wxTheApp->SendIdleEvents(); + wxTheApp->ProcessIdle(); } void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) @@ -370,7 +379,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) wxSetCursor( wxCursor(wxCURSOR_WATCH) ); if (wxTheApp) - wxTheApp->SendIdleEvents(); + wxTheApp->ProcessIdle(); gdk_flush(); }