diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2006-03-10 09:46:26 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2006-03-10 09:46:26 +0000 |
commit | e057817d515daab7ba3bef9ed73865c1314ae13d (patch) | |
tree | 11b6fc0f201e5b0c1d5d9f129b4c14f7f0c4c6e7 /gtk | |
parent | 17d059f53f00ca7815774f98e80e2ddff4442e75 (diff) | |
download | netsurf-e057817d515daab7ba3bef9ed73865c1314ae13d.tar.gz netsurf-e057817d515daab7ba3bef9ed73865c1314ae13d.tar.bz2 |
[project @ 2006-03-10 09:46:26 by dsilvers]
Very basic GTK cursor support.
svn path=/import/netsurf/; revision=2124
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtk_window.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c index 6f5ada59a..752f6e446 100644 --- a/gtk/gtk_window.c +++ b/gtk/gtk_window.c @@ -362,7 +362,47 @@ void gui_window_set_status(struct gui_window *g, const char *text) void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape) { - + GdkCursor *cursor = NULL; + GdkCursorType cursortype; + bool nullcursor = false; + if (g->current_pointer == shape) return; + g->current_pointer = shape; + switch (shape) { + case GUI_POINTER_POINT: + cursortype = GDK_HAND1; + break; + case GUI_POINTER_CARET: + cursortype = GDK_XTERM; + break; + case GUI_POINTER_UD: + cursortype = GDK_SB_V_DOUBLE_ARROW; + break; + case GUI_POINTER_LR: + cursortype = GDK_SB_H_DOUBLE_ARROW; + break; + case GUI_POINTER_LD: + cursortype = GDK_SIZING; /* XXX */ + break; + case GUI_POINTER_RD: + cursortype = GDK_SIZING; /* XXX */ + break; + case GUI_POINTER_CROSS: + cursortype = GDK_CROSS; + break; + case GUI_POINTER_MOVE: + cursortype = GDK_FLEUR; + break; + case GUI_POINTER_MENU: + /* Cannot think of a good cursor for 'menu' yet */ + case GUI_POINTER_DEFAULT: + default: + nullcursor = true; + } + if (!nullcursor) + cursor = gdk_cursor_new_for_display(gtk_widget_get_display(GTK_WIDGET(g->drawing_area)), cursortype); + gdk_window_set_cursor(g->drawing_area->window, cursor); + if (!nullcursor) + gdk_cursor_unref(cursor); } |