NetSurf
theme.h
Go to the documentation of this file.
1/*
2 * Copyright 2005 Richard Wilson <info@tinct.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 * Window themes(interface).
21 */
22
23#include <stdbool.h>
24#include "oslib/osspriteop.h"
25
26#ifndef _NETSURF_RISCOS_THEME_H_
27#define _NETSURF_RISCOS_THEME_H_
28
29/** Theme styles, collecting groups of attributes for different locations. */
30
31typedef enum {
39
40/** Theme elements, which belong to styles. */
41
42typedef enum {
46
48 unsigned int magic_value;
49 unsigned int parser_version;
50 char name[32];
51 char author[64];
62};
63
64struct theme {
65 osspriteop_area *sprite_area; /**< sprite area for theme */
66 int throbber_width; /**< width of the throbber */
67 int throbber_height; /**< height of the throbber */
68 int throbber_frames; /**< frames of animation for the throbber */
69 int users; /**< number of users for the theme */
70};
71
73 char *leafname; /**< theme leafname */
74 char *filename; /**< theme filename */
75 char name[32]; /**< theme name */
76 char author[64]; /**< theme author */
77 int browser_background; /**< background colour of browser toolbar */
78 int hotlist_background; /**< background colour of hotlist toolbar */
79 int status_background; /**< background colour of status window */
80 int status_foreground; /**< colour of status window text */
81 bool throbber_right; /**< throbber is on the right (left otherwise) */
82 bool throbber_redraw; /**< throbber requires forcible updating */
83 unsigned int decompressed_size; /**< decompressed sprite size */
84 unsigned int compressed_size; /**< compressed sprite size */
85 struct theme *theme; /**< corresponding theme (must be opened) */
86 struct theme_descriptor *previous; /**< previous descriptor in the list */
87 struct theme_descriptor *next; /**< next descriptor in the list */
88};
89
91void ro_gui_theme_finalise(void);
95osspriteop_area *ro_gui_theme_get_sprites(struct theme_descriptor *descriptor);
97 theme_style style, theme_element element);
99 int *frames, int *width, int *height,
100 bool *right, bool *redraw);
101
102bool ro_gui_theme_read_file_header(struct theme_descriptor *descriptor,
103 struct theme_file_header *file_header);
104
105bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list);
106bool ro_gui_theme_apply(struct theme_descriptor *descriptor);
107void ro_gui_theme_close(struct theme_descriptor *descriptor, bool list);
108#endif
109
theme_element
Theme elements, which belong to styles.
Definition: theme.h:42
@ THEME_ELEMENT_FOREGROUND
Definition: theme.h:43
@ THEME_ELEMENT_BACKGROUND
Definition: theme.h:44
struct theme_descriptor * ro_gui_theme_get_current(void)
Returns the current theme handle, or NULL if none is set.
Definition: theme.c:207
bool ro_gui_theme_read_file_header(struct theme_descriptor *descriptor, struct theme_file_header *file_header)
Fills in the basic details for a descriptor from a file header.
Definition: theme.c:452
bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list)
Opens a theme ready for use.
Definition: theme.c:488
void ro_gui_theme_initialise(void)
Initialise the theme handler.
Definition: theme.c:68
void ro_gui_theme_finalise(void)
Finalise the theme handler.
Definition: theme.c:83
osspriteop_area * ro_gui_theme_get_sprites(struct theme_descriptor *descriptor)
Returns a sprite area for use with the given theme.
Definition: theme.c:221
void ro_gui_theme_close(struct theme_descriptor *descriptor, bool list)
Closes a theme after use.
Definition: theme.c:695
theme_style
Theme styles, collecting groups of attributes for different locations.
Definition: theme.h:31
@ THEME_STYLE_HOTLIST_TOOLBAR
Definition: theme.h:34
@ THEME_STYLE_COOKIES_TOOLBAR
Definition: theme.h:35
@ THEME_STYLE_GLOBAL_HISTORY_TOOLBAR
Definition: theme.h:36
@ THEME_STYLE_BROWSER_TOOLBAR
Definition: theme.h:33
@ THEME_STYLE_NONE
Definition: theme.h:32
@ THEME_STYLE_STATUS_BAR
Definition: theme.h:37
struct theme_descriptor * ro_gui_theme_get_available(void)
Reads and caches the currently available themes.
Definition: theme.c:125
int ro_gui_theme_get_style_element(struct theme_descriptor *descriptor, theme_style style, theme_element element)
Returns an interger element from the specified theme, or the current theme if the descriptor is NULL.
Definition: theme.c:251
struct theme_descriptor * ro_gui_theme_find(const char *leafname)
Finds a theme from the cached values.
Definition: theme.c:100
bool ro_gui_theme_get_throbber_data(struct theme_descriptor *descriptor, int *frames, int *width, int *height, bool *right, bool *redraw)
Returns details of the throbber as defined in a theme.
Definition: theme.c:325
bool ro_gui_theme_apply(struct theme_descriptor *descriptor)
Applies the theme to all current windows and subsequent ones.
Definition: theme.c:666
int width
Definition: gui.c:159
int height
Definition: gui.c:160
int hotlist_background
background colour of hotlist toolbar
Definition: theme.h:78
int browser_background
background colour of browser toolbar
Definition: theme.h:77
char * leafname
theme leafname
Definition: theme.h:73
int status_background
background colour of status window
Definition: theme.h:79
char name[32]
theme name
Definition: theme.h:75
int status_foreground
colour of status window text
Definition: theme.h:80
unsigned int decompressed_size
decompressed sprite size
Definition: theme.h:83
bool throbber_redraw
throbber requires forcible updating
Definition: theme.h:82
struct theme_descriptor * next
next descriptor in the list
Definition: theme.h:87
char author[64]
theme author
Definition: theme.h:76
struct theme_descriptor * previous
previous descriptor in the list
Definition: theme.h:86
unsigned int compressed_size
compressed sprite size
Definition: theme.h:84
struct theme * theme
corresponding theme (must be opened)
Definition: theme.h:85
bool throbber_right
throbber is on the right (left otherwise)
Definition: theme.h:81
char * filename
theme filename
Definition: theme.h:74
char future_expansion_1
Definition: theme.h:57
char browser_bg
Definition: theme.h:52
unsigned int parser_version
Definition: theme.h:49
char name[32]
Definition: theme.h:50
unsigned int decompressed_sprite_size
Definition: theme.h:61
char future_expansion_2
Definition: theme.h:58
char author[64]
Definition: theme.h:51
char theme_flags
Definition: theme.h:56
unsigned int compressed_sprite_size
Definition: theme.h:60
char status_bg
Definition: theme.h:54
char status_fg
Definition: theme.h:55
char future_expansion_3
Definition: theme.h:59
unsigned int magic_value
Definition: theme.h:48
char hotlist_bg
Definition: theme.h:53
Definition: theme.h:64
int throbber_width
width of the throbber
Definition: theme.h:66
osspriteop_area * sprite_area
sprite area for theme
Definition: theme.h:65
int throbber_frames
frames of animation for the throbber
Definition: theme.h:68
int throbber_height
height of the throbber
Definition: theme.h:67
int users
number of users for the theme
Definition: theme.h:69