NetSurf
gui.h
Go to the documentation of this file.
1/*
2 * Copyright 2015 Adrián Arroyo Calle <adrian.arroyocalle@gmail.com>
3 * Copyright 2008 François Revol <mmu_man@users.sourceforge.net>
4 * Copyright 2005 James Bursa <bursa@users.sourceforge.net>
5 *
6 * This file is part of NetSurf, http://www.netsurf-browser.org/
7 *
8 * NetSurf is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * NetSurf is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <stdbool.h>
22#include <Application.h>
23#include <FilePanel.h>
24#include <Window.h>
25#include <BeBuild.h>
26
27#ifndef B_BEOS_VERSION_DANO
28#define B_UI_SETTINGS_CHANGED '_UIC'
29#endif
30
31#define CALLED() fprintf(stderr, "%s()\n", __FUNCTION__);
32
33extern bool nsbeos_done;
34
35extern bool replicated;
36int gui_init_replicant(int argc, char** argv);
37
38extern "C" nserror gui_401login_open(struct nsurl *url, const char *realm,
39 const char *username, const char *password,
40 nserror (*cb)(const char *username,
41 const char *password,
42 void *pw),
43 void *cbpw);
44
45extern "C" void nsbeos_gui_poll(void);
46
47extern char *options_file_location;
48
49class NSBrowserApplication : public BApplication {
50public:
52 virtual ~NSBrowserApplication();
53
54 virtual void MessageReceived(BMessage *message);
55 virtual void RefsReceived(BMessage *message);
56 virtual void ArgvReceived(int32 argc, char **argv);
57
58 virtual void AboutRequested();
59 virtual bool QuitRequested();
60};
61
62extern BWindow *wndAbout;
63
64extern BWindow *wndTooltip;
65
66extern BFilePanel *wndOpenFile;
67
68void nsbeos_pipe_message(BMessage *message, BView *_this, struct gui_window *gui);
69void nsbeos_pipe_message_top(BMessage *message, BWindow *_this, struct beos_scaffolding *scaffold);
70
72image_id nsbeos_find_app_path(char *path);
73char *find_resource(char *buf, const char *filename, const char *def);
74
76
77/**
78 * Cause an abnormal program termination.
79 *
80 * \note This never returns and is intended to terminate without any cleanup.
81 *
82 * \param error The message to display to the user.
83 */
84void die(const char * const error) __attribute__ ((noreturn));
85
86/**
87 * Display a warning for a serious problem (eg memory exhaustion).
88 *
89 * \param warning message key for warning message
90 * \param detail additional message, or 0
91 */
92nserror beos_warn_user(const char *warning, const char *detail);
static const __attribute__((used))
Definition: gui.c:359
nserror gui_401login_open(struct nsurl *url, const char *realm, const char *username, const char *password, nserror(*cb)(const char *username, const char *password, void *pw), void *cbpw)
Definition: login.cpp:175
void nsbeos_gui_view_source(struct hlcache_handle *content)
Send the source of a content to a text editor.
Definition: gui.cpp:830
image_id nsbeos_find_app_path(char *path)
Definition: gui.cpp:246
BWindow * wndAbout
Definition: gui.cpp:99
bool nsbeos_done
Definition: gui.cpp:90
void nsbeos_gui_poll(void)
Definition: gui.cpp:745
BWindow * wndTooltip
Definition: gui.cpp:102
int gui_init_replicant(int argc, char **argv)
called when replicated from NSBaseView::Instantiate()
Definition: gui.cpp:1102
void nsbeos_pipe_message_top(BMessage *message, BWindow *_this, struct beos_scaffolding *scaffold)
Definition: gui.cpp:731
void nsbeos_pipe_message(BMessage *message, BView *_this, struct gui_window *gui)
Definition: gui.cpp:717
char * find_resource(char *buf, const char *filename, const char *def)
Locate a shared resource file by searching known places in order.
Definition: gui.cpp:277
BFilePanel * wndOpenFile
Definition: gui.cpp:104
bool replicated
if we are running as a replicant
Definition: gui.cpp:92
void die(const char *const error) __attribute__((noreturn))
Cause an abnormal program termination.
Definition: misc.c:69
nserror beos_warn_user(const char *warning, const char *detail)
Display a warning for a serious problem (eg memory exhaustion).
Definition: gui.cpp:116
void nsbeos_update_system_ui_colors(void)
Definition: gui.cpp:503
char * options_file_location
Definition: gui.cpp:94
virtual void AboutRequested()
Definition: gui.cpp:207
virtual void MessageReceived(BMessage *message)
Definition: gui.cpp:145
virtual void ArgvReceived(int32 argc, char **argv)
Definition: gui.cpp:180
virtual ~NSBrowserApplication()
Definition: gui.cpp:139
virtual bool QuitRequested()
Definition: gui.cpp:214
virtual void RefsReceived(BMessage *message)
Definition: gui.cpp:193
nserror
Enumeration of error codes.
Definition: errors.h:29
struct nsurl nsurl
NetSurf URL object.
Definition: nsurl.h:31
int32_t int32
Definition: os3support.h:183
Content which corresponds to a single URL.
first entry in window list
Definition: gui.c:297
High-level cache handle.
Definition: hlcache.c:66
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.
Definition: plot.c:821