Move ami_(re)set_pointer (back?) into gui.c as they need to set/read the gui_window_2 structure

This commit is contained in:
Chris Young 2019-05-08 00:59:04 +01:00
parent ae36d35728
commit 1cd30fdb3c
4 changed files with 18 additions and 19 deletions

View File

@ -452,9 +452,6 @@ struct form_control *ami_gui_get_control(struct gui_window *gw)
return gw->control;
}
/**
* Set control (for select menu) to gui_window
*/
void ami_gui_set_control(struct gui_window *gw, struct form_control *control)
{
assert(gw != NULL);
@ -462,6 +459,22 @@ void ami_gui_set_control(struct gui_window *gw, struct form_control *control)
}
/** undocumented, or internal, or documented elsewhere **/
void ami_set_pointer(struct gui_window_2 *gwin, gui_pointer_shape shape, bool update)
{
if(gwin->mouse_pointer == shape) return;
ami_update_pointer(ami_gui2_get_window(gwin), 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(ami_gui2_get_window(gwin), gwin->mouse_pointer);
}
STRPTR ami_locale_langs(int *codeset)
{
struct Locale *locale;

View File

@ -186,7 +186,8 @@ void ami_gui_update_hotlist_button(struct gui_window_2 *gwin);
nserror ami_gui_new_blank_tab(struct gui_window_2 *gwin);
int ami_gui_count_windows(int window, int *tabs);
void ami_gui_set_scale(struct gui_window *gw, float scale);
void ami_set_pointer(struct gui_window_2 *gwin, gui_pointer_shape shape, bool update);
void ami_reset_pointer(struct gui_window_2 *gwin);
/**
* Close a window and all tabs attached to it.

View File

@ -218,19 +218,6 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
ami_set_pointer(ami_gui_get_gui_window_2(g), 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(ami_gui2_get_window(gwin), 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(ami_gui2_get_window(gwin), gwin->mouse_pointer);
}
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
{
if(ami_drag_has_data()) return; /**\todo check this shouldn't be drag_in_progress */

View File

@ -40,8 +40,6 @@ void ami_update_throbber(struct gui_window_2 *g,bool redraw);
void ami_init_mouse_pointers(void);
void ami_mouse_pointers_free(void);
void ami_set_pointer(struct gui_window_2 *gwin, gui_pointer_shape shape, bool update);
void ami_reset_pointer(struct gui_window_2 *gwin);
/* Use the following ONLY if nothing other than the Intuition window pointer is available,
* and ALWAYS in preference to SetWindowPointer(), as it features more pointers and uses
* the correct ones specified in user preferences. */