NetSurf
|
UTF8 status bar (implementation). More...
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include "swis.h"
#include "oslib/colourtrans.h"
#include "oslib/os.h"
#include "oslib/wimp.h"
#include "oslib/wimpspriteop.h"
#include "utils/log.h"
#include "utils/utils.h"
#include "netsurf/plotters.h"
#include "riscos/gui.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/wimputils.h"
#include "riscos/font.h"
#include "riscos/gui/progress_bar.h"
#include "riscos/gui/status_bar.h"
Go to the source code of this file.
Data Structures | |
struct | status_bar |
Macros | |
#define | ICON_WIDGET 0 |
#define | WIDGET_WIDTH 12 |
#define | PROGRESS_WIDTH 160 |
Functions | |
wimp_WINDOW (1) | |
static void | ro_gui_status_bar_open (wimp_open *open) |
Process an open_window request for a status window. More... | |
static bool | ro_gui_status_bar_click (wimp_pointer *pointer) |
Process an mouse_click event for a status window. More... | |
static void | ro_gui_status_bar_redraw (wimp_draw *redraw) |
Process a WIMP redraw request. More... | |
static void | ro_gui_status_bar_redraw_callback (void *handle) |
Callback for scheduled redraw. More... | |
static void | ro_gui_status_position_progress_bar (struct status_bar *sb) |
Reposition the progress component following a change in the dimension of the status window. More... | |
struct status_bar * | ro_gui_status_bar_create (wimp_w parent, unsigned int width) |
Create a new status bar. More... | |
void | ro_gui_status_bar_destroy (struct status_bar *sb) |
Destroy a status bar and free all associated resources. More... | |
wimp_w | ro_gui_status_bar_get_window (struct status_bar *sb) |
Get the handle of the window that represents a status bar. More... | |
unsigned int | ro_gui_status_bar_get_width (struct status_bar *sb) |
Get the proportional width the status bar is currently using. More... | |
void | ro_gui_status_bar_set_visible (struct status_bar *sb, bool visible) |
Set the visibility status of the status bar. More... | |
bool | ro_gui_status_bar_get_visible (struct status_bar *sb) |
Get the visibility status of the status bar. More... | |
void | ro_gui_status_bar_set_progress_value (struct status_bar *sb, unsigned int value) |
Set the value of the progress bar. More... | |
void | ro_gui_status_bar_set_progress_range (struct status_bar *sb, unsigned int range) |
Set the range of the progress bar. More... | |
void | ro_gui_status_bar_set_progress_icon (struct status_bar *sb, const char *icon) |
Set the icon for the progress bar. More... | |
void | ro_gui_status_bar_set_text (struct status_bar *sb, const char *text) |
Set the text to display in the status bar. More... | |
void | ro_gui_status_bar_resize (struct status_bar *sb) |
Resize a status bar following a change in the dimensions of the parent window. More... | |
Variables | |
static char | status_widget_text [] = "" |
static char | status_widget_validation [] = "R5;Pptr_lr,8,6" |
UTF8 status bar (implementation).
Definition in file status_bar.c.
#define ICON_WIDGET 0 |
Definition at line 44 of file status_bar.c.
#define PROGRESS_WIDTH 160 |
Definition at line 46 of file status_bar.c.
#define WIDGET_WIDTH 12 |
Definition at line 45 of file status_bar.c.
|
static |
Process an mouse_click event for a status window.
pointer | details of the mouse click |
Definition at line 538 of file status_bar.c.
References ICON_WIDGET, and NSLOG.
Referenced by ro_gui_status_bar_create().
struct status_bar * ro_gui_status_bar_create | ( | wimp_w | parent, |
unsigned int | width | ||
) |
Create a new status bar.
parent | the window to contain the status bar |
width | the proportional width to use (0...10,000) |
Definition at line 118 of file status_bar.c.
References NSLOG, parent, status_bar::parent, status_bar::pb, ro_gui_progress_bar_create(), ro_gui_status_bar_click(), ro_gui_status_bar_open(), ro_gui_status_bar_redraw(), ro_gui_status_bar_resize(), ro_gui_wimp_event_register_mouse_click(), ro_gui_wimp_event_register_open_window(), ro_gui_wimp_event_register_redraw_window(), ro_gui_wimp_event_set_help_prefix(), ro_gui_wimp_event_set_user_data(), status_bar::scale, status_bar::visible, status_bar::w, and width.
Referenced by gui_window_create().
void ro_gui_status_bar_destroy | ( | struct status_bar * | sb | ) |
Destroy a status bar and free all associated resources.
sb | the status bar to destroy |
Definition at line 161 of file status_bar.c.
References NSLOG, status_bar::pb, riscos_schedule(), ro_gui_progress_bar_destroy(), ro_gui_status_bar_redraw_callback(), ro_gui_wimp_event_finalise(), and status_bar::w.
Referenced by gui_window_destroy().
bool ro_gui_status_bar_get_visible | ( | struct status_bar * | sb | ) |
Get the visibility status of the status bar.
sb | the status bar to check the visiblity of |
Definition at line 240 of file status_bar.c.
References status_bar::visible.
unsigned int ro_gui_status_bar_get_width | ( | struct status_bar * | sb | ) |
Get the proportional width the status bar is currently using.
sb | the status bar to get the width of |
Definition at line 202 of file status_bar.c.
References status_bar::scale.
Referenced by ro_gui_window_default_options().
wimp_w ro_gui_status_bar_get_window | ( | struct status_bar * | sb | ) |
Get the handle of the window that represents a status bar.
sb | the status bar to get the window handle of |
Definition at line 188 of file status_bar.c.
References status_bar::w.
|
static |
Process an open_window request for a status window.
open | the request to process |
Definition at line 569 of file status_bar.c.
References NSLOG, status_bar::parent, ro_gui_status_bar_resize(), ro_gui_wimp_event_get_user_data(), and status_bar::scale.
Referenced by ro_gui_status_bar_create().
|
static |
Process a WIMP redraw request.
redraw | the redraw request to process |
Definition at line 444 of file status_bar.c.
References redraw_context::interactive, NSLOG, redraw_context::plot, plot_style_fill_black, plotter_table::rectangle, ro_gui_desktop_font_family, ro_gui_desktop_font_size, ro_gui_desktop_font_style, ro_gui_wimp_event_get_user_data(), ro_plot_origin_x, ro_plot_origin_y, ro_plotters, status_bar::text, WIDGET_WIDTH, status_bar::width, rect::x0, rect::x1, rect::y0, and rect::y1.
Referenced by ro_gui_status_bar_create().
|
static |
Callback for scheduled redraw.
handle | Callback handle |
Definition at line 525 of file status_bar.c.
References status_bar::w, WIDGET_WIDTH, and status_bar::width.
Referenced by ro_gui_status_bar_destroy(), and ro_gui_status_bar_set_text().
void ro_gui_status_bar_resize | ( | struct status_bar * | sb | ) |
Resize a status bar following a change in the dimensions of the parent window.
sb | the status bar to resize |
Definition at line 346 of file status_bar.c.
References ICON_WIDGET, max, min, NSLOG, status_bar::parent, PTR_WIMP_OPEN, ro_get_hscroll_height(), ro_gui_status_position_progress_bar(), status_bar::scale, status_bar::visible, status_bar::w, WIDGET_WIDTH, and status_bar::width.
Referenced by ro_gui_status_bar_create(), ro_gui_status_bar_open(), ro_gui_status_bar_set_visible(), and ro_gui_window_open().
void ro_gui_status_bar_set_progress_icon | ( | struct status_bar * | sb, |
const char * | icon | ||
) |
Set the icon for the progress bar.
sb | the status bar to set the icon for |
icon | the icon to use, or NULL for no icon |
Definition at line 301 of file status_bar.c.
References status_bar::pb, and ro_gui_progress_bar_set_icon().
void ro_gui_status_bar_set_progress_range | ( | struct status_bar * | sb, |
unsigned int | range | ||
) |
Set the range of the progress bar.
sb | the status bar to set the range of |
range | the range of the progress bar |
Definition at line 271 of file status_bar.c.
References NSLOG, status_bar::pb, ro_gui_progress_bar_get_range(), ro_gui_progress_bar_get_window(), ro_gui_progress_bar_set_range(), and ro_gui_status_position_progress_bar().
Referenced by ro_gui_status_bar_set_progress_value().
void ro_gui_status_bar_set_progress_value | ( | struct status_bar * | sb, |
unsigned int | value | ||
) |
Set the value of the progress bar.
sb | the status bar to set the progress of |
value | the value to use |
Definition at line 254 of file status_bar.c.
References max, status_bar::pb, ro_gui_progress_bar_get_range(), ro_gui_progress_bar_set_value(), and ro_gui_status_bar_set_progress_range().
void ro_gui_status_bar_set_text | ( | struct status_bar * | sb, |
const char * | text | ||
) |
Set the text to display in the status bar.
sb | the status bar to set the text for |
text | the UTF8 text to display, or NULL for none |
Definition at line 316 of file status_bar.c.
References riscos_schedule(), ro_gui_status_bar_redraw_callback(), status_bar::text, text(), and status_bar::visible.
Referenced by riscos_window_set_status().
void ro_gui_status_bar_set_visible | ( | struct status_bar * | sb, |
bool | visible | ||
) |
Set the visibility status of the status bar.
sb | the status bar to check the visiblity of |
visible | if the status bar should be shown or not. |
Definition at line 217 of file status_bar.c.
References NSLOG, ro_gui_status_bar_resize(), status_bar::visible, and status_bar::w.
|
static |
Reposition the progress component following a change in the dimension of the status window.
sb | the status bar to update |
Definition at line 606 of file status_bar.c.
References max, NSLOG, status_bar::pb, PROGRESS_WIDTH, PTR_WIMP_OPEN, ro_gui_progress_bar_get_range(), ro_gui_progress_bar_get_window(), ro_gui_progress_bar_update(), progress_bar::visible, status_bar::w, and WIDGET_WIDTH.
Referenced by ro_gui_status_bar_resize(), and ro_gui_status_bar_set_progress_range().
wimp_WINDOW | ( | 1 | ) |
Definition at line 61 of file status_bar.c.
References status_widget_text, and status_widget_validation.
|
static |
Definition at line 58 of file status_bar.c.
Referenced by wimp_WINDOW().
|
static |
Definition at line 59 of file status_bar.c.
Referenced by wimp_WINDOW().