diff options
Diffstat (limited to 'frontends/riscos/window.h')
-rw-r--r-- | frontends/riscos/window.h | 193 |
1 files changed, 193 insertions, 0 deletions
diff --git a/frontends/riscos/window.h b/frontends/riscos/window.h index 30b096580..0a5bd43c2 100644 --- a/frontends/riscos/window.h +++ b/frontends/riscos/window.h @@ -30,10 +30,21 @@ struct nsurl; extern struct gui_window_table *riscos_window_table; +/** + * Initialise the browser window module and its menus. + */ void ro_gui_window_initialise(void); + +/** + * Check if a particular menu handle is a browser window menu + * + * \param menu The menu in question. + * \return true if this menu is a browser window menu + */ bool ro_gui_window_check_menu(wimp_menu *menu); + /** * Set the contents of a window's address bar. * @@ -42,6 +53,7 @@ bool ro_gui_window_check_menu(wimp_menu *menu); */ nserror ro_gui_window_set_url(struct gui_window *g, struct nsurl *url); + /** * Cause an area of a window to be invalidated * @@ -56,5 +68,186 @@ nserror ro_gui_window_set_url(struct gui_window *g, struct nsurl *url); */ nserror ro_gui_window_invalidate_area(struct gui_window *g, const struct rect *rect); + +/** + * Set a gui_window's scale + */ +void ro_gui_window_set_scale(struct gui_window *g, float scale); + + +/** + * Handle Message_DataLoad (file dragged in) for a window. + * + * If the file was dragged into a form file input, it is used as the value. + * + * \param g window + * \param message Message_DataLoad block + * \return true if the load was processed + */ +bool ro_gui_window_dataload(struct gui_window *g, wimp_message *message); + + +/** + * Handle pointer movements in a browser window. + * + * \param pointer new mouse position + * \param data browser window that the pointer is in + */ +void ro_gui_window_mouse_at(wimp_pointer *pointer, void *data); + + +/** + * Window is being iconised. + * + * Create a suitable thumbnail sprite (which, sadly, must be in the + * Wimp sprite pool), and return the sprite name and truncated title + * to the iconiser + * + * \param g the gui window being iconised + * \param wi the WindowInfo message from the iconiser + */ +void ro_gui_window_iconise(struct gui_window *g, wimp_full_message_window_info *wi); + + +/** + * Handle Message_DataLoad (file dragged in) for a toolbar + * + * @todo This belongs in the toolbar module, and should be moved there + * once the module is able to usefully handle its own events. + * + * \param g window + * \param message Message_DataLoad block + * \return true if the load was processed + */ +bool ro_gui_toolbar_dataload(struct gui_window *g, wimp_message *message); + + +/** + * Redraws the content for all windows. + */ +void ro_gui_window_redraw_all(void); + + +/** + * Redraw any pending update boxes. + */ +void ro_gui_window_update_boxes(void); + + +/** + * Destroy all browser windows. + */ +void ro_gui_window_quit(void); + + +/** + * Close all browser windows + * + * no need for a separate fn same operation as quit +*/ +#define ro_gui_window_close_all ro_gui_window_quit + + +/** + * Animate the "throbbers" of all browser windows. + */ +void ro_gui_throb(void); + +/** + * Makes a browser window's options the default. + * + * \param gui The riscos gui window to set default options in. + */ +void ro_gui_window_default_options(struct gui_window *gui); + + +/** + * Convert a RISC OS window handle to a gui_window. + * + * \param window RISC OS window handle. + * \return A pointer to a riscos gui window if found or NULL. + */ +struct gui_window *ro_gui_window_lookup(wimp_w window); + + +/** + * Convert a toolbar RISC OS window handle to a gui_window. + * + * \param window RISC OS window handle of a toolbar + * \return pointer to a structure if found, NULL otherwise + */ +struct gui_window *ro_gui_toolbar_lookup(wimp_w window); + + +/** + * Convert x,y screen co-ordinates into window co-ordinates. + * + * \param g gui window + * \param x x ordinate + * \param y y ordinate + * \param pos receives position in window co-ordinatates + * \return true iff conversion successful + */ +bool ro_gui_window_to_window_pos(struct gui_window *g, int x, int y, os_coord *pos); + + +/** + * Convert x,y window co-ordinates into screen co-ordinates. + * + * \param g gui window + * \param x x ordinate + * \param y y ordinate + * \param pos receives position in screen co-ordinatates + * \return true iff conversion successful + */ +bool ro_gui_window_to_screen_pos(struct gui_window *g, int x, int y, os_coord *pos); + +/** + * Returns the state of the mouse buttons and modifiers keys for a + * mouse action, suitable for passing to the OS-independent + * browser window/ treeview/ etc code. + * + * \param buttons Wimp button state. + * \param type Wimp work-area/icon type for decoding. + * \return NetSurf core button state. + */ +enum browser_mouse_state ro_gui_mouse_click_state(wimp_mouse_state buttons, wimp_icon_flags type); + + +/** + * Returns the state of the mouse buttons and modifiers keys whilst + * dragging, for passing to the OS-independent browser window/ treeview/ + * etc code + * + * \param buttons Wimp button state. + * \param type Wimp work-area/icon type for decoding. + * \return NetSurf core button state. + */ +enum browser_mouse_state ro_gui_mouse_drag_state(wimp_mouse_state buttons, wimp_icon_flags type); + + +/** + * Returns true iff one or more Shift keys is held down + */ +bool ro_gui_shift_pressed(void); + + +/** + * Returns true iff one or more Ctrl keys is held down + */ +bool ro_gui_ctrl_pressed(void); + + +/** + * Returns true iff one or more Alt keys is held down + */ +bool ro_gui_alt_pressed(void); + + +/** + * Change mouse pointer shape + */ +void gui_window_set_pointer(struct gui_window *g, enum gui_pointer_shape shape); + #endif |