NetSurf
throbber.h
Go to the documentation of this file.
1/*
2 * Copyright 2005 Richard Wilson <info@tinct.net>
3 * Copyright 2011 Stephen Fryatt <stevef@netsurf-browser.org>
4 *
5 * This file is part of NetSurf, http://www.netsurf-browser.org/
6 *
7 * NetSurf is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * NetSurf is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20/** \file
21 * Throbber (interface).
22 */
23
24#ifndef _NETSURF_RISCOS_THROBBER_H_
25#define _NETSURF_RISCOS_THROBBER_H_
26
27#include <stdbool.h>
28#include "riscos/theme.h"
29
30struct throbber;
31
32
33/**
34 * Create a new throbber widget.
35 *
36 * \param *theme The theme to apply (or NULL for the default).
37 * \return A throbber handle, or NULL on failure.
38 */
39
41
42/**
43 * Place a throbber into a toolbar window and initialise any theme-specific
44 * settings. Any previous incarnation of the throbber will be forgotten: this
45 * is for use when a new toolbar is being created, or when a toolbar has been
46 * deleted and rebuilt following a theme change.
47 *
48 * \param *throbber The throbber to rebuild.
49 * \param *theme The theme to apply (or NULL for current).
50 * \param style The theme style to apply.
51 * \param window The window that the throbber is in.
52 * \param shaded true if the bar should be throbber; else false.
53 * \return true on success; else false.
54 */
55
57 struct theme_descriptor *theme, theme_style style,
58 wimp_w window, bool shaded);
59
60
61/**
62 * Destroy a throbber widget.
63 *
64 * \param *throbber The throbber to destroy.
65 */
66
68
69
70/**
71 * Return the MINIMUM dimensions required by the throbber, in RO units,
72 * allowing for the current theme.
73 *
74 * \param *throbber The throbber of interest.
75 * \param *width Return the required width.
76 * \param *height Return the required height.
77 * \return true if values are returned; else false.
78 */
79
81 int *width, int *height);
82
83
84/**
85 * Set or update the dimensions to be used by the throbber in RO units
86 *
87 * If these are greater than the minimum required, the throbber will fill
88 * the extended space; if less, the call will fail.
89 *
90 * \param throbber The throbber to update.
91 * \param x0 top left of bounding box x coordinate
92 * \param y0 top left of bounding box y coordinate
93 * \param x1 bottom right of bounding box x coordinate
94 * \param y1 bottom right of bounding box y coordinate
95 * \return true if size updated; else false.
96 */
97
99 int x0, int y0, int x1, int y1);
100
101
102/**
103 * Show or hide a throbber.
104 *
105 * \param *throbber The throbber to hide.
106 * \param hide true to hide the throbber; false to show it.
107 * \return true if successful; else false.
108 */
109
110bool ro_gui_throbber_hide(struct throbber *throbber, bool hide);
111
112
113/**
114 * Translate mouse data into an interactive help message for the throbber.
115 *
116 * \param throbber The throbber to process.
117 * \param i The wimp icon under the pointer.
118 * \param screenpos The screen position.
119 * \param state The toolbar window state.
120 * \param buttons The mouse button state.
121 * \param suffix Return a help token suffix, or "" for none.
122 * \return true if handled exclusively; else false.
123 */
124
125bool ro_gui_throbber_help_suffix(struct throbber *throbber, wimp_i i,
126 os_coord *screenpos, wimp_window_state *state,
127 wimp_mouse_state buttons, const char **suffix);
128
129/**
130 * Start or update the amimation of a throbber.
131 *
132 * \param *throbber The throbber to amimate.
133 */
134
136
137
138/**
139 * Stop the amimation of a throbber.
140 *
141 * \param *throbber The throbber to amimate.
142 */
143
145
146#endif
147
Window themes(interface).
theme_style
Theme styles, collecting groups of attributes for different locations.
Definition: theme.h:31
bool ro_gui_throbber_stop(struct throbber *throbber)
Stop the amimation of a throbber.
Definition: throbber.c:403
bool ro_gui_throbber_help_suffix(struct throbber *throbber, wimp_i i, os_coord *screenpos, wimp_window_state *state, wimp_mouse_state buttons, const char **suffix)
Translate mouse data into an interactive help message for the throbber.
Definition: throbber.c:328
bool ro_gui_throbber_set_extent(struct throbber *throbber, int x0, int y0, int x1, int y1)
Set or update the dimensions to be used by the throbber in RO units.
Definition: throbber.c:186
void ro_gui_throbber_destroy(struct throbber *throbber)
Destroy a throbber widget.
Definition: throbber.c:154
bool ro_gui_throbber_hide(struct throbber *throbber, bool hide)
Show or hide a throbber.
Definition: throbber.c:315
bool ro_gui_throbber_animate(struct throbber *throbber)
Start or update the amimation of a throbber.
Definition: throbber.c:363
bool ro_gui_throbber_get_dims(struct throbber *throbber, int *width, int *height)
Return the MINIMUM dimensions required by the throbber, in RO units, allowing for the current theme.
Definition: throbber.c:165
bool ro_gui_throbber_rebuild(struct throbber *throbber, struct theme_descriptor *theme, theme_style style, wimp_w window, bool shaded)
Place a throbber into a toolbar window and initialise any theme-specific settings.
Definition: throbber.c:124
struct throbber * ro_gui_throbber_create(struct theme_descriptor *theme)
Create a new throbber widget.
Definition: throbber.c:77
int width
Definition: gui.c:159
int height
Definition: gui.c:160
Definition: theme.h:64
bool shaded
Definition: throbber.c:58
wimp_w window
The window and icon details.
Definition: throbber.c:53