summaryrefslogtreecommitdiff
path: root/amiga/theme.c
diff options
context:
space:
mode:
Diffstat (limited to 'amiga/theme.c')
-rw-r--r--amiga/theme.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/amiga/theme.c b/amiga/theme.c
index fce69eda3..65d2f51e1 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -48,7 +48,6 @@ struct bitmap *throbber_nsbm = NULL;
ULONG throbber_frames,throbber_update_interval;
static Object *mouseptrobj[AMI_LASTPOINTER+1];
static struct BitMap *mouseptrbm[AMI_LASTPOINTER+1];
-static int mouseptrcurrent=0;
char *ptrs[AMI_LASTPOINTER+1] = {
"ptr_default",
@@ -174,12 +173,24 @@ void ami_get_theme_filename(char *filename, char *themestring, bool protocol)
void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
{
- ami_update_pointer(g->shared->win,shape);
+ ami_set_pointer(g->shared, shape, true);
+}
+
+void ami_set_pointer(struct gui_window_2 *gwin, gui_pointer_shape shape, bool update)
+{
+ if(gwin->mouse_pointer == shape) return;
+ ami_update_pointer(gwin->win, shape);
+ if(update == true) gwin->mouse_pointer = shape;
+}
+
+/* reset the mouse pointer back to what NetSurf last set it as */
+void ami_reset_pointer(struct gui_window_2 *gwin)
+{
+ ami_update_pointer(gwin->win, gwin->mouse_pointer);
}
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
{
- if(mouseptrcurrent == shape) return;
if(drag_save_data) return;
if(nsoption_bool(use_os_pointers))
@@ -187,24 +198,24 @@ void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
switch(shape)
{
case GUI_POINTER_DEFAULT:
- SetWindowPointer(win,TAG_DONE);
+ SetWindowPointer(win, TAG_DONE);
break;
case GUI_POINTER_WAIT:
SetWindowPointer(win,
- WA_BusyPointer,TRUE,
- WA_PointerDelay,TRUE,
+ WA_BusyPointer, TRUE,
+ WA_PointerDelay, TRUE,
TAG_DONE);
break;
default:
if(mouseptrobj[shape])
{
- SetWindowPointer(win,WA_Pointer,mouseptrobj[shape],TAG_DONE);
+ SetWindowPointer(win, WA_Pointer, mouseptrobj[shape], TAG_DONE);
}
else
{
- SetWindowPointer(win,TAG_DONE);
+ SetWindowPointer(win, TAG_DONE);
}
break;
}
@@ -213,34 +224,28 @@ void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
{
if(mouseptrobj[shape])
{
- SetWindowPointer(win,WA_Pointer,mouseptrobj[shape],TAG_DONE);
+ SetWindowPointer(win, WA_Pointer, mouseptrobj[shape], TAG_DONE);
}
else
{
if(shape == GUI_POINTER_WAIT)
{
SetWindowPointer(win,
- WA_BusyPointer,TRUE,
- WA_PointerDelay,TRUE,
+ WA_BusyPointer, TRUE,
+ WA_PointerDelay, TRUE,
TAG_DONE);
}
else
{
- SetWindowPointer(win,TAG_DONE);
+ SetWindowPointer(win, TAG_DONE);
}
}
}
-
- mouseptrcurrent = shape;
}
void gui_window_hide_pointer(struct gui_window *g)
{
- if(mouseptrcurrent != AMI_GUI_POINTER_BLANK)
- {
- SetWindowPointer(g->shared->win,WA_Pointer,mouseptrobj[AMI_GUI_POINTER_BLANK],TAG_DONE);
- mouseptrcurrent = AMI_GUI_POINTER_BLANK;
- }
+ ami_set_pointer(g->shared, AMI_GUI_POINTER_BLANK, true);
}
void ami_init_mouse_pointers(void)