X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/defdd888002f2dabf2228a4e4b58d4e7a0b56eda..85deaacd30470f4801a996c6e291dec43270e70e:/src/gtk/cursor.cpp?ds=sidebyside diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index f277f4b0c9..25e4e109ac 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cursor.cpp +// Name: src/gtk/cursor.cpp // Purpose: // Author: Robert Roebling // Id: $Id$ @@ -11,19 +11,18 @@ #include "wx/wxprec.h" #include "wx/cursor.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/utils.h" -#include "wx/app.h" + +#include "wx/gtk/private.h" //for idle stuff #include #include -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // wxCursor //----------------------------------------------------------------------------- @@ -45,7 +44,7 @@ wxCursorRefData::wxCursorRefData() wxCursorRefData::~wxCursorRefData() { - if (m_cursor) gdk_cursor_destroy( m_cursor ); + if (m_cursor) gdk_cursor_unref( m_cursor ); } //----------------------------------------------------------------------------- @@ -128,7 +127,7 @@ extern GtkWidget *wxGetRootWindow(); wxCursor::wxCursor(const char bits[], int width, int height, int hotSpotX, int hotSpotY, - const char maskBits[], wxColour *fg, wxColour *bg) + const char maskBits[], const wxColour *fg, const wxColour *bg) { if (!maskBits) maskBits = bits; @@ -149,15 +148,8 @@ wxCursor::wxCursor(const char bits[], int width, int height, data, mask, fg->GetColor(), bg->GetColor(), hotSpotX, hotSpotY ); - gdk_bitmap_unref( data ); - gdk_bitmap_unref( mask ); -} - - -wxCursor::wxCursor( const wxCursor &cursor ) - : wxObject() -{ - Ref( cursor ); + g_object_unref (G_OBJECT (data)); + g_object_unref (G_OBJECT (mask)); } #if wxUSE_IMAGE @@ -308,8 +300,8 @@ wxCursor::wxCursor( const wxImage & image ) hotSpotX, hotSpotY ); - gdk_bitmap_unref( data ); - gdk_bitmap_unref( mask ); + g_object_unref (G_OBJECT (data)); + g_object_unref (G_OBJECT (mask)); delete [] bits; delete [] maskBits; } @@ -320,16 +312,6 @@ wxCursor::~wxCursor() { } -wxCursor& wxCursor::operator = ( const wxCursor& cursor ) -{ - if (*this == cursor) - return (*this); - - Ref( cursor ); - - return *this; -} - bool wxCursor::operator == ( const wxCursor& cursor ) const { return m_refData == cursor.m_refData; @@ -381,7 +363,7 @@ void wxEndBusyCursor() wxTheApp->ProcessIdle(); } -void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) +void wxBeginBusyCursor( const wxCursor *WXUNUSED(cursor) ) { if (gs_busyCount++ > 0) return;