NetSurf
wimp.h
Go to the documentation of this file.
1/*
2 * Copyright 2004 Richard Wilson <not_ginger_matt@users.sourceforge.net>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/** \file
20 * General RISC OS WIMP/OS library functions (interface).
21 */
22
23
24#ifndef _NETSURF_RISCOS_WIMP_H_
25#define _NETSURF_RISCOS_WIMP_H_
26
27#include <assert.h>
28#include <stdbool.h>
29#include <stdlib.h>
30#include <stdio.h>
31#include <string.h>
32#include "oslib/os.h"
33#include "oslib/wimp.h"
34#include "rufl.h"
35
36
37int ro_get_hscroll_height(wimp_w w);
38int ro_get_vscroll_width(wimp_w w);
39int ro_get_title_height(wimp_w w);
40bool ro_gui_wimp_read_eig_factors(os_mode mode, int *xeig, int *yeig);
41void ro_convert_os_units_to_pixels(os_coord *os_units, os_mode mode);
42void ro_convert_pixels_to_os_units(os_coord *pixels, os_mode mode);
43
44#define ro_gui_redraw_icon(w, i) xwimp_set_icon_state(w, i, 0, 0)
45void ro_gui_force_redraw_icon(wimp_w w, wimp_i i);
46const char *ro_gui_get_icon_string(wimp_w w, wimp_i i);
47void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8);
48
49void ro_gui_set_icon_integer(wimp_w w, wimp_i i, int value);
50void ro_gui_set_icon_decimal(wimp_w w, wimp_i i, int value, int decimal_places);
51int ro_gui_get_icon_decimal(wimp_w w, wimp_i i, int decimal_places);
52
53void ro_gui_set_icon_selected_state(wimp_w w, wimp_i i, bool state);
54bool ro_gui_get_icon_selected_state(wimp_w w, wimp_i i);
55void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state);
56bool ro_gui_get_icon_shaded_state(wimp_w w, wimp_i i);
57void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state);
58bool ro_gui_get_icon_deleted_state(wimp_w w, wimp_i i);
59void ro_gui_set_icon_button_type(wimp_w w, wimp_i i, int type);
60void ro_gui_set_icon_sprite(wimp_w w, wimp_i i, osspriteop_area *area,
61 const char *name);
62void ro_gui_set_window_title(wimp_w w, const char *title);
63bool ro_gui_set_caret_first(wimp_w w);
64void ro_gui_open_window_centre(wimp_w parent, wimp_w child);
65
66osspriteop_area *ro_gui_load_sprite_file(const char *pathname);
67bool ro_gui_wimp_sprite_exists(const char *sprite);
68os_error *ro_gui_wimp_get_sprite(const char *name, osspriteop_header **sprite);
69bool ro_gui_wimp_get_sprite_dimensions(osspriteop_area *area, char *sprite,
70 int *width, int *height);
71
72wimp_w ro_gui_set_window_background_colour(wimp_w window, wimp_colour background);
73void ro_gui_set_icon_colours(wimp_w window, wimp_i icon,
74 wimp_colour foreground, wimp_colour background);
75void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, os_colour user_colour);
76void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask,
77 wimp_window_flags xor_mask);
78bool ro_gui_wimp_check_window_furniture(wimp_w w, wimp_window_flags mask);
79
80void ro_gui_scroll(wimp_scroll *scroll);
81
82#endif
83
static os_mode mode
The current sprite mode.
Definition: buffer.c:72
wimp_w parent
Definition: dialog.c:88
const char * type
Definition: filetype.cpp:44
int width
Definition: gui.c:159
int height
Definition: gui.c:160
Interface to utility string handling.
os_error * ro_gui_wimp_get_sprite(const char *name, osspriteop_header **sprite)
Locate a sprite in the Wimp sprite pool, returning a pointer to it.
Definition: wimp.c:896
void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8)
Set the contents of a text or sprite icon to a string.
Definition: wimp.c:269
void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state)
Set the deleted state of an icon.
Definition: wimp.c:552
void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask, wimp_window_flags xor_mask)
Sets whether a piece of window furniture is present for a window.
Definition: wimp.c:1016
int ro_get_hscroll_height(wimp_w w)
Gets the horizontal scrollbar height.
Definition: wimp.c:58
int ro_gui_get_icon_decimal(wimp_w w, wimp_i i, int decimal_places)
Get the contents of an icon as a number.
Definition: wimp.c:423
void ro_convert_os_units_to_pixels(os_coord *os_units, os_mode mode)
Converts the supplied os_coord from OS units to pixels.
Definition: wimp.c:151
void ro_gui_set_icon_button_type(wimp_w w, wimp_i i, int type)
Set the button type of an icon.
Definition: wimp.c:617
void ro_gui_force_redraw_icon(wimp_w w, wimp_i i)
Forces an icon to be redrawn entirely (ie not just updated).
Definition: wimp.c:193
bool ro_gui_wimp_get_sprite_dimensions(osspriteop_area *area, char *sprite, int *width, int *height)
Get the dimensions of a sprite.
Definition: wimp.c:925
bool ro_gui_get_icon_deleted_state(wimp_w w, wimp_i i)
Gets the deleted state of an icon.
Definition: wimp.c:600
int ro_get_title_height(wimp_w w)
Gets the title bar height.
Definition: wimp.c:82
osspriteop_area * ro_gui_load_sprite_file(const char *pathname)
Load a sprite file into memory.
Definition: wimp.c:806
void ro_gui_open_window_centre(wimp_w parent, wimp_w child)
void ro_gui_set_icon_colours(wimp_w window, wimp_i icon, wimp_colour foreground, wimp_colour background)
void ro_gui_set_window_title(wimp_w w, const char *title)
Set a window title.
Definition: wimp.c:675
void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state)
Set the shaded state of an icon.
Definition: wimp.c:487
bool ro_gui_wimp_sprite_exists(const char *sprite)
Check if a sprite is present in the Wimp sprite pool.
Definition: wimp.c:862
const char * ro_gui_get_icon_string(wimp_w w, wimp_i i)
Read the contents of a text or sprite icon.
Definition: wimp.c:235
bool ro_gui_wimp_read_eig_factors(os_mode mode, int *xeig, int *yeig)
Reads a modes EIG factors.
Definition: wimp.c:123
void ro_gui_set_icon_selected_state(wimp_w w, wimp_i i, bool state)
Set the selected state of an icon.
Definition: wimp.c:444
wimp_w ro_gui_set_window_background_colour(wimp_w window, wimp_colour background)
bool ro_gui_wimp_check_window_furniture(wimp_w w, wimp_window_flags mask)
Checks whether a piece of window furniture is present for a window.
Definition: wimp.c:1066
bool ro_gui_get_icon_shaded_state(wimp_w w, wimp_i i)
Gets the shaded state of an icon.
Definition: wimp.c:535
void ro_gui_set_icon_sprite(wimp_w w, wimp_i i, osspriteop_area *area, const char *name)
Set an icon's sprite.
Definition: wimp.c:638
bool ro_gui_set_caret_first(wimp_w w)
Places the caret in the first available icon.
Definition: wimp.c:731
void ro_convert_pixels_to_os_units(os_coord *pixels, os_mode mode)
Converts the supplied os_coord from pixels to OS units.
Definition: wimp.c:167
void ro_gui_set_icon_integer(wimp_w w, wimp_i i, int value)
Set the contents of an icon to a number.
Definition: wimp.c:374
void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, os_colour user_colour)
Performs simple user redraw for a window.
Definition: wimp.c:971
void ro_gui_set_icon_decimal(wimp_w w, wimp_i i, int value, int decimal_places)
Set the contents of an icon to a number.
Definition: wimp.c:392
bool ro_gui_get_icon_selected_state(wimp_w w, wimp_i i)
Gets the selected state of an icon.
Definition: wimp.c:463
void ro_gui_scroll(wimp_scroll *scroll)
Generic window scroll event handler.
Definition: wimp.c:1131
int ro_get_vscroll_width(wimp_w w)
Gets the vertical scrollbar width.
Definition: wimp.c:70
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.
Definition: plot.c:978