NetSurf
gui.h
Go to the documentation of this file.
1/*
2 * Copyright 2010 Ole Loots <ole@monochrom.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#ifndef NS_ATARI_GUI_H_
20#define NS_ATARI_GUI_H_
21
22#include <stdbool.h>
23#include <mt_gem.h>
24
25#include "netsurf/mouse.h"
26
27#include "atari/redrawslots.h"
28#include "atari/gemtk/gemtk.h"
29
30#ifndef PATH_MAX
31#define PATH_MAX 1024
32#endif
33
34#define CARET_STATE_VISIBLE 0x01
35#define CARET_STATE_ENABLED 0x02
36
37struct s_caret {
39 MFDB symbol;
41 unsigned short state;
42};
43
44struct point_s {
45 int x;
46 int y;
47};
48
49typedef struct point_s POINT;
50
51#define MFORM_EX_FLAG_USERFORM 0x01
52
54{
55 unsigned char flags;
56 int number;
57 OBJECT * tree;
58};
59
60typedef struct mform_ex_s MFORM_EX;
61
79
85};
86
87
89{
91 void * element;
92};
93
94/* defines for data attached to components: */
95#define CDT_OBJECT 0x004f424aUL
96#define CDT_OWNER 0x03UL
97#define CDT_ICON 0x04UL
98#define CDT_ICON_TYPE 0x05UL
99# define CDT_ICON_TYPE_NONE 0x00UL
100# define CDT_ICON_TYPE_OBJECT 0x01UL
101# define CDT_ICON_TYPE_BITMAP 0x02UL
102
103
104struct gui_window;
105struct s_browser;
106struct s_statusbar;
107struct s_toolbar;
108
109typedef struct s_toolbar * CMP_TOOLBAR;
110typedef struct s_statusbar * CMP_STATUSBAR;
111typedef struct s_browser * CMP_BROWSER;
112
113/*
114 This is the "main" window. It can consist of several components
115 and also holds information shared by several frames within
116 the window.
117*/
119{
121 GUIWIN *win;
125 char * title;
126 struct bitmap * icon;
130 /* current size of window on screen: */
131 GRECT loc;
132};
133typedef struct s_gui_win_root ROOTWIN;
134
136{
139};
140
141/*
142 This is the part of the gui which is known by netsurf core.
143 You must implement it. Altough, you are free how to do it.
144 Each of the browser "viewports" managed by netsurf are bound
145 to this structure.
146*/
147struct gui_window {
151 /* icon to be drawn when iconified, or NULL for default resource. */
152 char * status;
153 char * title;
154 char * url;
155 float scale;
156 struct bitmap * icon;
160};
161
162extern struct gui_window *window_list;
163
164/* -------------------------------------------------------------------------- */
165/* Public - non core gui window functions */
166/* -------------------------------------------------------------------------- */
167void gui_set_input_gui_window(struct gui_window *gw);
168struct gui_window *gui_get_input_window(void);
169char *gui_window_get_url(struct gui_window *gw);
170char *gui_window_get_title(struct gui_window *gw);
171
172/**
173 * Set the status bar of a browser window.
174 *
175 * \param w The gui_window to update.
176 * \param text new status text
177 */
178void atari_window_set_status(struct gui_window *w, const char *text);
180void gui_window_destroy(struct gui_window *w);
181
182#endif
struct s_toolbar * CMP_TOOLBAR
Definition: gui.h:109
struct gui_window * gui_get_input_window(void)
Definition: gui.c:772
focus_element_type
Definition: gui.h:80
@ URL_WIDGET
Definition: gui.h:82
@ BROWSER
Definition: gui.h:84
@ SEARCH_INPUT
Definition: gui.h:83
@ WIDGET_NONE
Definition: gui.h:81
void gui_window_destroy(struct gui_window *w)
Destroy previously created gui window.
Definition: gui.c:252
struct s_gem_cursors gem_cursors
void gui_window_set_pointer(struct gui_window *gw, gui_pointer_shape shape)
set the pointer shape
Definition: theme.c:216
char * gui_window_get_url(struct gui_window *gw)
Definition: gui.c:582
void gui_set_input_gui_window(struct gui_window *gw)
Definition: gui.c:765
void atari_window_set_status(struct gui_window *w, const char *text)
Set the status bar of a browser window.
Definition: gui.c:356
struct gui_window * window_list
Definition: gui.c:75
struct s_statusbar * CMP_STATUSBAR
Definition: gui.h:110
struct s_browser * CMP_BROWSER
Definition: gui.h:111
char * gui_window_get_title(struct gui_window *gw)
Definition: gui.c:590
Core mouse and pointer states.
gui_pointer_shape
Definition: mouse.h:112
RISC OS wimp toolkit bitmap.
Definition: bitmap.c:68
Browser window data.
first entry in window list
Definition: gui.c:298
struct gui_window * prev
Previous in linked list.
Definition: gui.h:159
MFORM_EX * cursor
Definition: gui.h:150
struct gui_window * next
list for cleanup
Definition: gui.h:159
char * url
Definition: gui.h:154
struct s_search_form_session * search
Definition: gui.h:158
float scale
Definition: gui.h:155
char * status
Definition: gui.h:152
struct bitmap * icon
Definition: gui.h:156
struct s_gui_win_root * root
Definition: gui.h:148
char * title
Definition: gui.h:153
struct s_caret caret
Definition: gui.h:157
struct s_browser * browser
Definition: gui.h:149
Definition: gui.h:54
OBJECT * tree
Definition: gui.h:57
unsigned char flags
Definition: gui.h:55
int number
Definition: gui.h:56
Definition: gui.h:44
int y
Definition: gui.h:46
int x
Definition: gui.h:45
Definition: gui.h:136
bool attached
Definition: gui.h:138
struct browser_window * bw
Definition: gui.h:137
Definition: gui.h:37
int fd_size
Definition: gui.h:40
unsigned short state
Definition: gui.h:41
MFDB symbol
Definition: gui.h:39
GRECT dimensions
Definition: gui.h:38
void * element
Definition: gui.h:91
enum focus_element_type type
Definition: gui.h:90
MFORM_EX sizens
Definition: gui.h:68
MFORM_EX help
Definition: gui.h:75
MFORM_EX menu
Definition: gui.h:76
MFORM_EX wait
Definition: gui.h:71
MFORM_EX hand
Definition: gui.h:63
MFORM_EX cross
Definition: gui.h:65
MFORM_EX ibeam
Definition: gui.h:64
MFORM_EX arrow
Definition: gui.h:77
MFORM_EX sizewe
Definition: gui.h:67
MFORM_EX appstarting
Definition: gui.h:72
MFORM_EX nodrop
Definition: gui.h:73
MFORM_EX sizeall
Definition: gui.h:66
MFORM_EX deny
Definition: gui.h:74
MFORM_EX sizenwse
Definition: gui.h:70
MFORM_EX sizenesw
Definition: gui.h:69
struct bitmap * icon
Definition: gui.h:126
char * title
Definition: gui.h:125
CMP_TOOLBAR toolbar
Definition: gui.h:122
GUIWIN * win
Definition: gui.h:121
struct s_redrw_slots redraw_slots
Definition: gui.h:128
GRECT loc
Definition: gui.h:131
CMP_STATUSBAR statusbar
Definition: gui.h:123
short aes_handle
Definition: gui.h:120
struct s_caret caret
Definition: gui.h:129
struct s_focus_info focus
Definition: gui.h:124
struct gui_window * active_gui_window
Definition: gui.h:127
This struct holds scheduled redraw requests.
Definition: redrawslots.h:38
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