/////////////////////////////////////////////////////////////////////////////
-// Name: cursor.cpp
+// Name: src/gtk/cursor.cpp
// Purpose:
// Author: Robert Roebling
// Id: $Id$
#include "wx/wxprec.h"
#include "wx/cursor.h"
-#include "wx/utils.h"
-#include "wx/app.h"
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
+#ifndef WX_PRECOMP
+ #include "wx/app.h"
+ #include "wx/utils.h"
+ #include "wx/image.h"
+ #include "wx/colour.h"
+#endif // WX_PRECOMP
-//-----------------------------------------------------------------------------
-// idle system
-//-----------------------------------------------------------------------------
-
-extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
+#include "wx/gtk/private.h" //for idle stuff
//-----------------------------------------------------------------------------
// wxCursor
public:
wxCursorRefData();
- ~wxCursorRefData();
+ virtual ~wxCursorRefData();
GdkCursor *m_cursor;
};
wxCursorRefData::~wxCursorRefData()
{
- if (m_cursor) gdk_cursor_destroy( m_cursor );
+ if (m_cursor) gdk_cursor_unref( m_cursor );
}
//-----------------------------------------------------------------------------
case wxCURSOR_BLANK:
{
static const gchar bits[] = { 0 };
- static const GdkColor color = { 0, 0, 0, 0 };
+ static /* const -- not in GTK1 */ GdkColor color = { 0, 0, 0, 0 };
GdkPixmap *pixmap = gdk_bitmap_create_from_data(NULL, bits, 1, 1);
M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixmap(pixmap,
case wxCURSOR_ARROWWAIT:
case wxCURSOR_WAIT:
case wxCURSOR_WATCH: gdk_cur = GDK_WATCH; break;
- case wxCURSOR_SIZING: gdk_cur = GDK_SIZING; break;
+ case wxCURSOR_SIZING: gdk_cur = GDK_FLEUR; break;
case wxCURSOR_SPRAYCAN: gdk_cur = GDK_SPRAYCAN; break;
case wxCURSOR_IBEAM: gdk_cur = GDK_XTERM; break;
case wxCURSOR_PENCIL: gdk_cur = GDK_PENCIL; break;
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;
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 (data);
+ g_object_unref (mask);
}
#if wxUSE_IMAGE
hotSpotX, hotSpotY
);
- gdk_bitmap_unref( data );
- gdk_bitmap_unref( mask );
+ g_object_unref (data);
+ g_object_unref (mask);
delete [] bits;
delete [] maskBits;
}
{
}
-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;
return m_refData != cursor.m_refData;
}
-bool wxCursor::Ok() const
+bool wxCursor::IsOk() const
{
return (m_refData != NULL);
}
wxTheApp->ProcessIdle();
}
-void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
+void wxBeginBusyCursor( const wxCursor *WXUNUSED(cursor) )
{
if (gs_busyCount++ > 0)
return;