27#include "oslib/colourtrans.h"
29#include "oslib/osspriteop.h"
30#include "oslib/wimp.h"
31#include "oslib/wimpspriteop.h"
71 wimp_WINDOW_NEW_FORMAT | wimp_WINDOW_MOVEABLE | wimp_WINDOW_NO_BOUNDS,
73 wimp_COLOUR_LIGHT_GREY,
74 wimp_COLOUR_LIGHT_GREY,
75 wimp_COLOUR_VERY_LIGHT_GREY,
76 wimp_COLOUR_DARK_GREY,
77 wimp_COLOUR_MID_LIGHT_GREY,
79 wimp_WINDOW_NEVER3D | 0x16u ,
112 error = xosspriteop_select_sprite(osspriteop_USER_AREA,
116 xosspriteop_read_sprite_info(osspriteop_USER_AREA,
118 (osspriteop_id) name,
133 pb = calloc(1,
sizeof(*pb));
140 NSLOG(netsurf, INFO,
"xwimp_create_window: 0x%x: %s",
141 error->errnum, error->errmess);
167 error = xwimp_delete_window(pb->
w);
169 NSLOG(netsurf, INFO,
"xwimp_delete_window: 0x%x:%s",
170 error->errnum, error->errmess);
210 xwimp_force_redraw(pb->
w, 0, 0, 32, 32);
329 redraw.box.x0 = cur.x1;
330 error = xwimp_update_window(&redraw, &more);
332 NSLOG(netsurf, INFO,
"Error getting update window: 0x%x: %s",
333 error->errnum, error->errmess);
355 error = xwimp_redraw_window(redraw, &more);
357 NSLOG(netsurf, INFO,
"xwimp_redraw_window: 0x%x: %s",
358 error->errnum, error->errmess);
390 error = xwimp_update_window(&redraw, &more);
392 NSLOG(netsurf, INFO,
"Error getting update window: '%s'",
412 int icon_width, icon_height;
414 osspriteop_header *
icon = NULL;
415 bool icon_redraw =
false;
429 icon_width = icon_height = 0;
434 int progress_ymid =
height / 2;
436 error = xosspriteop_read_sprite_info(osspriteop_USER_AREA,
438 (osspriteop_id)pb->
icon,
439 &icon_width, &icon_height, 0, 0);
441 error = xosspriteop_select_sprite(osspriteop_USER_AREA,
446 progress_x0 += 32 +
MARGIN;
449 icon_y0 = progress_ymid - icon_height;
460 xwimp_force_redraw(pb->
w, 0, 0, 32 +
MARGIN, 65536);
464 progress_x1 = progress_x0;
492 .background_images =
true,
502 redraw->box.y1 - redraw->box.y0);
503 progress_ymid = redraw->box.y0 + pb->
visible.y0 +
517 redraw->box.x0 + pb->
visible.x0) >> 1;
518 clip.y0 = -
min(redraw->clip.y1,
519 redraw->box.y0 + pb->
visible.y1) >> 1;
521 redraw->box.x0 + pb->
visible.x1) >> 1;
522 clip.y1 = -
max(redraw->clip.y0,
523 redraw->box.y0 + pb->
visible.y0) >> 1;
527 _swix(
Tinct_Plot, _IN(2) | _IN(3) | _IN(4) | _IN(7),
529 redraw->box.x0 - pb->
offset,
539 error = xwimp_get_rectangle(redraw, &more);
541 NSLOG(netsurf, INFO,
"xwimp_get_rectangle: 0x%x: %s",
542 error->errnum, error->errmess);
Target independent plotting interface.
#define NSLOG(catname, level, logmsg, args...)
plot_style_t * plot_style_fill_red
static char progress_animation_sprite[]
void ro_gui_progress_bar_set_icon(struct progress_bar *pb, const char *icon)
Set the icon for a progress bar.
static unsigned int progress_height
struct wimp_window_base progress_bar_definition
static void ro_gui_progress_bar_calculate(struct progress_bar *pb, int width, int height)
Calculate the position of the progress bar.
unsigned int ro_gui_progress_bar_get_range(struct progress_bar *pb)
Get the range of a progress bar.
unsigned int ro_gui_progress_bar_get_value(struct progress_bar *pb)
Get the value of a progress bar.
void ro_gui_progress_bar_update(struct progress_bar *pb, int width, int height)
Update the progress bar to a new dimension.
void ro_gui_progress_bar_set_value(struct progress_bar *pb, unsigned int value)
Set the value of a progress bar.
static void ro_gui_progress_bar_animate(void *p)
Animate the progress bar.
void ro_gui_progress_bar_destroy(struct progress_bar *pb)
Destroy a progress bar and free all associated resources.
wimp_w ro_gui_progress_bar_get_window(struct progress_bar *pb)
Get the handle of the window that represents a progress bar.
struct progress_bar * ro_gui_progress_bar_create(void)
Create a new progress bar.
void ro_gui_progress_bar_set_range(struct progress_bar *pb, unsigned int range)
Set the range of a progress bar.
static void ro_gui_progress_bar_redraw(wimp_draw *redraw)
Process a WIMP redraw request.
void ro_gui_progress_bar_init(osspriteop_area *icons)
Initialise the progress bar.
static osspriteop_header * progress_icon
static unsigned int progress_width
static void ro_gui_progress_bar_redraw_window(wimp_draw *redraw, struct progress_bar *pb)
Redraw a section of a progress bar window.
Progress bar (interface).
nserror riscos_schedule(int t, void(*callback)(void *p), void *p)
Schedule a callback.
const struct plotter_table ro_plotters
RISC OS plotter operation table.
Interface to utility string handling.
nserror(* rectangle)(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *rectangle)
Plots a rectangle.
nserror(* clip)(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
bool icon_obscured
icon is partially obscured
int offset
progress bar rotation
char icon[13]
current icon
bool recalculate
recalculation required
bool animating
progress bar is animating
int cur_width
current calculated width
unsigned int value
progress bar value
wimp_w w
progress bar window handle
unsigned int range
progress bar range
osspriteop_header * icon_img
icon image
os_box visible
progress bar position
int cur_height
current calculated height
const struct plotter_table * plot
Current plot operation table.
bool interactive
Redraw to show interactive features.
Tinct SWI numbers and flags for version 0.11.
#define tinct_ERROR_DIFFUSE
#define tinct_FILL_HORIZONTALLY
#define Tinct_PlotAlpha
Plots an alpha-blended sprite at the specified coordinates.
#define Tinct_Plot
Plots a sprite at the specified coordinates with a constant 0xff value for the alpha channel,...
Interface to a number of general purpose functionality.
bool ro_gui_wimp_event_register_redraw_window(wimp_w w, void(*callback)(wimp_draw *redraw))
Register a function to be called for all window redraw operations.
void ro_gui_wimp_event_finalise(wimp_w w)
Free any resources associated with a window.
void * ro_gui_wimp_event_get_user_data(wimp_w w)
Gets the user data associated with a window.
bool ro_gui_wimp_event_set_user_data(wimp_w w, void *user)
Sets the user data associated with a window.
Automated RISC OS WIMP event handling (interface).
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.