NetSurf
toolbar.h
Go to the documentation of this file.
1/*
2 * Copyright 2013 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_TOOLBAR_H
20#define NS_ATARI_TOOLBAR_H
21
22#include <stdbool.h>
23#include <stdint.h>
24
25struct s_toolbar;
26struct nsurl;
27
30};
31
34 GRECT area;
35};
36
38 short index;
39 short max_index;
40 bool running;
41};
42
43struct s_toolbar {
47 OBJECT *form;
48 GRECT area;
49
50 /* size & location of buttons: */
52 int btcnt;
53 int style;
55 bool reflow;
56 bool visible;
58};
59
60
61void toolbar_init(void);
63void toolbar_destroy(struct s_toolbar * tb);
64void toolbar_exit( void );
65bool toolbar_text_input(struct s_toolbar *tb, char *text);
66bool toolbar_key_input(struct s_toolbar *tb, short nkc);
67void toolbar_mouse_input(struct s_toolbar *tb, short obj, short mbut);
68void toolbar_update_buttons(struct s_toolbar *tb, struct browser_window *bw,
69 short idx);
70void toolbar_get_grect(struct s_toolbar *tb, short which, GRECT *g);
71OBJECT *toolbar_get_form(struct s_toolbar *tb);
72struct textarea *toolbar_get_textarea(struct s_toolbar *tb,
73 enum toolbar_textarea which);
74char *toolbar_get_url(struct s_toolbar *tb);
75struct nsurl * toolbar_get_nsurl(struct s_toolbar * tb);
76void toolbar_set_throbber_state(struct s_toolbar *tb, bool active);
77void toolbar_set_attached(struct s_toolbar *tb, bool attached);
78void toolbar_set_visible(struct s_toolbar *tb, short area, bool visible);
79void toolbar_set_reflow(struct s_toolbar *tb, bool do_reflow);
80void toolbar_set_width(struct s_toolbar *tb, short w);
81void toolbar_set_origin(struct s_toolbar *tb, short x, short y);
82void toolbar_set_dimensions(struct s_toolbar *tb, GRECT *area);
83void toolbar_set_url(struct s_toolbar *tb, const char *text);
84void toolbar_redraw(struct s_toolbar *tb, GRECT *clip);
86/* public events handlers: */
87void toolbar_back_click(struct s_toolbar *tb);
88void toolbar_reload_click(struct s_toolbar *tb);
89void toolbar_forward_click(struct s_toolbar *tb);
90void toolbar_home_click(struct s_toolbar *tb);
91void toolbar_stop_click(struct s_toolbar *tb);
92void toolbar_favorite_click(struct s_toolbar *tb);
93void toolbar_crypto_click(struct s_toolbar *tb);
94
95
96#endif
void toolbar_init(void)
Definition: toolbar.c:236
void toolbar_set_url(struct s_toolbar *tb, const char *text)
Definition: toolbar.c:584
char * toolbar_get_url(struct s_toolbar *tb)
Definition: toolbar.c:881
struct nsurl * toolbar_get_nsurl(struct s_toolbar *tb)
Definition: toolbar.c:896
void toolbar_set_throbber_state(struct s_toolbar *tb, bool active)
Definition: toolbar.c:600
OBJECT * toolbar_get_form(struct s_toolbar *tb)
Definition: toolbar.c:910
void toolbar_set_reflow(struct s_toolbar *tb, bool do_reflow)
Definition: toolbar.c:638
void toolbar_redraw(struct s_toolbar *tb, GRECT *clip)
Definition: toolbar.c:416
void toolbar_update_buttons(struct s_toolbar *tb, struct browser_window *bw, short idx)
Definition: toolbar.c:458
struct s_toolbar * toolbar_create(struct s_gui_win_root *owner)
Definition: toolbar.c:267
void toolbar_favorite_click(struct s_toolbar *tb)
Definition: toolbar.c:1008
void toolbar_set_attached(struct s_toolbar *tb, bool attached)
Definition: toolbar.c:643
void toolbar_back_click(struct s_toolbar *tb)
Definition: toolbar.c:917
void toolbar_mouse_input(struct s_toolbar *tb, short obj, short mbut)
Definition: toolbar.c:755
void toolbar_stop_click(struct s_toolbar *tb)
Definition: toolbar.c:992
struct textarea * toolbar_get_textarea(struct s_toolbar *tb, enum toolbar_textarea which)
Definition: toolbar.c:875
void toolbar_get_grect(struct s_toolbar *tb, short which, GRECT *g)
Receive a specific region of the toolbar.
Definition: toolbar.c:854
bool toolbar_text_input(struct s_toolbar *tb, char *text)
Definition: toolbar.c:668
void toolbar_set_visible(struct s_toolbar *tb, short area, bool visible)
Definition: toolbar.c:616
void toolbar_set_width(struct s_toolbar *tb, short w)
Definition: toolbar.c:528
void toolbar_reload_click(struct s_toolbar *tb)
Definition: toolbar.c:932
void toolbar_destroy(struct s_toolbar *tb)
Definition: toolbar.c:337
void toolbar_throbber_progress(struct s_toolbar *tb)
Definition: toolbar.c:649
void toolbar_forward_click(struct s_toolbar *tb)
Definition: toolbar.c:945
void toolbar_set_dimensions(struct s_toolbar *tb, GRECT *area)
Definition: toolbar.c:561
bool toolbar_key_input(struct s_toolbar *tb, short nkc)
Definition: toolbar.c:677
void toolbar_home_click(struct s_toolbar *tb)
Definition: toolbar.c:960
void toolbar_crypto_click(struct s_toolbar *tb)
Definition: toolbar.c:1036
toolbar_textarea
Definition: toolbar.h:28
@ URL_INPUT_TEXT_AREA
Definition: toolbar.h:29
void toolbar_set_origin(struct s_toolbar *tb, short x, short y)
Definition: toolbar.c:548
void toolbar_exit(void)
Definition: toolbar.c:261
struct nsurl nsurl
NetSurf URL object.
Definition: nsurl.h:31
Browser window data.
short max_index
Definition: toolbar.h:39
int style
Definition: toolbar.h:53
bool search_visible
Definition: toolbar.h:57
struct s_tb_button * buttons
Definition: toolbar.h:51
GRECT area
Definition: toolbar.h:48
struct s_gui_win_root * owner
Definition: toolbar.h:44
int btcnt
Definition: toolbar.h:52
struct s_url_widget url
Definition: toolbar.h:45
bool visible
Definition: toolbar.h:56
bool reflow
Definition: toolbar.h:55
bool attached
Definition: toolbar.h:54
OBJECT * form
Definition: toolbar.h:47
struct textarea * textarea
Definition: toolbar.h:33
GRECT area
Definition: toolbar.h:34
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
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
Definition: plot.c:357