]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Wrap gtkutil/cursor
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 21 Jul 2017 16:26:53 +0000 (02:26 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 31 Jul 2017 12:35:47 +0000 (22:35 +1000)
libs/gtkutil/cursor.cpp
libs/gtkutil/cursor.h

index 490c34fdb077532626fdee06bbc73d1c01693278..f123854d04d7ccfa10ba1401b3ef1101c00efec2 100644 (file)
@@ -31,13 +31,13 @@ GdkCursor* create_blank_cursor(){
        return gdk_cursor_new(GDK_BLANK_CURSOR);
 }
 
-void blank_cursor( GtkWidget* widget ){
+void blank_cursor( ui::Widget widget ){
        GdkCursor* cursor = create_blank_cursor();
        gdk_window_set_cursor( gtk_widget_get_window(widget), cursor );
        gdk_cursor_unref( cursor );
 }
 
-void default_cursor( GtkWidget* widget ){
+void default_cursor( ui::Widget widget ){
        gdk_window_set_cursor( gtk_widget_get_window(widget), 0 );
 }
 
index a4d9873a7175d28e3276b05311266f121417bb1b..d5d5d3397a7603c6a1f0212c1a88d770a77d61c9 100644 (file)
 #include "debugging/debugging.h"
 
 typedef struct _GdkCursor GdkCursor;
-typedef struct _GtkWidget GtkWidget;
 
 GdkCursor* create_blank_cursor();
-void blank_cursor( GtkWidget* widget );
-void default_cursor( GtkWidget* widget );
+void blank_cursor( ui::Widget widget );
+void default_cursor( ui::Widget widget );
 void Sys_GetCursorPos( ui::Window window, int *x, int *y );
 void Sys_SetCursorPos( ui::Window window, int x, int y );
 
@@ -65,7 +64,7 @@ void motion( gdouble x, gdouble y, guint state ){
                m_handler = g_idle_add( (GSourceFunc)deferred, this );
        }
 }
-static gboolean gtk_motion( GtkWidget *widget, GdkEventMotion *event, DeferredMotion* self ){
+static gboolean gtk_motion( ui::Widget widget, GdkEventMotion *event, DeferredMotion* self ){
        self->motion( event->x, event->y, event->state );
        return FALSE;
 }
@@ -119,7 +118,7 @@ void* m_data;
 public:
 FreezePointer() : handle_motion( 0 ), m_function( 0 ), m_data( 0 ){
 }
-static gboolean motion_delta( GtkWidget *widget, GdkEventMotion *event, FreezePointer* self ){
+static gboolean motion_delta( ui::Widget widget, GdkEventMotion *event, FreezePointer* self ){
        int current_x, current_y;
        Sys_GetCursorPos( ui::Window(GTK_WINDOW( widget )), &current_x, &current_y );
        int dx = current_x - self->last_x;