X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/debe6624c1e9d4bf3243381153d1e173c849bcd8..5de5db0eb14aa86b5b177050720deb0f4c210fba:/src/gtk/cursor.cpp diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 1f84b80f69..73babdfb05 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -2,10 +2,9 @@ // Name: cursor.cpp // Purpose: // Author: Robert Roebling -// Created: 01/02/97 -// Id: -// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem -// Licence: wxWindows licence +// Id: $Id$ +// Copyright: (c) 1998 Robert Roebling +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -22,22 +21,22 @@ class wxCursorRefData: public wxObjectRefData { public: - - wxCursorRefData(void); - ~wxCursorRefData(void); - + + wxCursorRefData(); + ~wxCursorRefData(); + GdkCursor *m_cursor; }; -wxCursorRefData::wxCursorRefData(void) +wxCursorRefData::wxCursorRefData() { - m_cursor = NULL; -}; + m_cursor = (GdkCursor *) NULL; +} -wxCursorRefData::~wxCursorRefData(void) +wxCursorRefData::~wxCursorRefData() { if (m_cursor) gdk_cursor_destroy( m_cursor ); -}; +} //----------------------------------------------------------------------------- @@ -45,14 +44,14 @@ wxCursorRefData::~wxCursorRefData(void) IMPLEMENT_DYNAMIC_CLASS(wxCursor,wxObject) -wxCursor::wxCursor(void) +wxCursor::wxCursor() { -}; +} wxCursor::wxCursor( int cursorId ) { m_refData = new wxCursorRefData(); - + GdkCursorType gdk_cur = GDK_LEFT_PTR; switch (cursorId) { @@ -67,13 +66,13 @@ wxCursor::wxCursor( int cursorId ) case wxCURSOR_IBEAM: gdk_cur = GDK_XTERM; break; case wxCURSOR_PENCIL: gdk_cur = GDK_PENCIL; break; case wxCURSOR_NO_ENTRY: gdk_cur = GDK_PIRATE; break; - }; - + } + M_CURSORDATA->m_cursor = gdk_cursor_new( gdk_cur ); - + /* do that yourself - + wxCURSOR_BULLSEYE, wxCURSOR_CHAR, wxCURSOR_LEFT_BUTTON, @@ -96,50 +95,44 @@ wxCursor::wxCursor( int cursorId ) wxCURSOR_BASED_ARROW_UP, wxCURSOR_BASED_ARROW_DOWN */ - -}; + +} wxCursor::wxCursor( const wxCursor &cursor ) { Ref( cursor ); -}; - -wxCursor::wxCursor( const wxCursor *cursor ) -{ - UnRef(); - if (cursor) Ref( *cursor ); -}; +} -wxCursor::~wxCursor(void) +wxCursor::~wxCursor() { -}; +} wxCursor& wxCursor::operator = ( const wxCursor& cursor ) { - if (*this == cursor) return (*this); - Ref( cursor ); - return *this; -}; + if (*this == cursor) return (*this); + Ref( cursor ); + return *this; +} -bool wxCursor::operator == ( const wxCursor& cursor ) +bool wxCursor::operator == ( const wxCursor& cursor ) const { - return m_refData == cursor.m_refData; -}; + return m_refData == cursor.m_refData; +} -bool wxCursor::operator != ( const wxCursor& cursor ) +bool wxCursor::operator != ( const wxCursor& cursor ) const { - return m_refData != cursor.m_refData; -}; + return m_refData != cursor.m_refData; +} -bool wxCursor::Ok(void) const +bool wxCursor::Ok() const { - return TRUE; -}; + return (m_refData != NULL); +} -GdkCursor *wxCursor::GetCursor(void) const +GdkCursor *wxCursor::GetCursor() const { return M_CURSORDATA->m_cursor; -}; +} //----------------------------------------------------------------------------- // busy cursor routines @@ -147,27 +140,27 @@ GdkCursor *wxCursor::GetCursor(void) const bool g_isBusy = FALSE; -void wxEndBusyCursor(void) +void wxEndBusyCursor() { g_isBusy = FALSE; -}; +} void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) { g_isBusy = TRUE; -}; +} -bool wxIsBusy(void) +bool wxIsBusy() { return g_isBusy; -}; +} void wxSetCursor( const wxCursor& cursor ) { extern wxCursor *g_globalCursor; if (g_globalCursor) (*g_globalCursor) = cursor; - if (cursor.Ok()) {}; -}; + if (cursor.Ok()) {} +}