summaryrefslogtreecommitdiff
path: root/beos/scaffolding.h
blob: ae78391756c6329fb19bf74320369839497300a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/*
 * Copyright 2008 Fran├žois Revol <mmu_man@users.sourceforge.net>
 * Copyright 2005 James Bursa <bursa@users.sourceforge.net>
 *
 * This file is part of NetSurf, http://www.netsurf-browser.org/
 *
 * NetSurf is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * NetSurf is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef NETSURF_BEOS_SCAFFOLDING_H
#define NETSURF_BEOS_SCAFFOLDING_H 1

#include <View.h>
#include <Window.h>
#include <NetPositive.h>

extern "C" {
#include "desktop/gui.h"
#include "desktop/plotters.h"
}

typedef struct beos_scaffolding nsbeos_scaffolding;

class NSBaseView : public BView {
public:
		NSBaseView(BRect frame);
		NSBaseView(BMessage *archive);
virtual	~NSBaseView();

virtual void	MessageReceived(BMessage *message);
//virtual void	Draw(BRect updateRect);

//virtual void	FrameMoved(BPoint new_location);
//virtual void	FrameResized(float new_width, float new_height);

virtual void		AllAttached(void);

virtual status_t	Archive(BMessage *archive, bool deep=true) const;
static BArchivable	*Instantiate(BMessage *archive);

void			SetScaffolding(struct beos_scaffolding *scaf);
private:
	struct beos_scaffolding *fScaffolding;
};

class NSBrowserWindow : public BWindow {
public:
		NSBrowserWindow(BRect frame, struct beos_scaffolding *scaf);
virtual	~NSBrowserWindow();

virtual	void	DispatchMessage(BMessage *message, BHandler *handler);
virtual void	MessageReceived(BMessage *message);
virtual bool	QuitRequested(void);

struct beos_scaffolding *Scaffolding() const { return fScaffolding; };

private:
	struct beos_scaffolding *fScaffolding;
};


// XXX: clean up
typedef enum {

	/* no/unknown actions */
	NO_ACTION = 'nsMA',

	/* help actions */
	HELP_OPEN_CONTENTS,
	HELP_OPEN_GUIDE,
	HELP_OPEN_INFORMATION,
	HELP_OPEN_ABOUT,
	HELP_LAUNCH_INTERACTIVE,

	/* history actions */
	HISTORY_SHOW_LOCAL,
	HISTORY_SHOW_GLOBAL,

	/* hotlist actions */
	HOTLIST_ADD_URL,
	HOTLIST_SHOW,

	/* cookie actions */
	COOKIES_SHOW,
	COOKIES_DELETE,

	/* page actions */
	BROWSER_PAGE,
	BROWSER_PAGE_INFO,
	BROWSER_PRINT,
	BROWSER_NEW_WINDOW,
	BROWSER_VIEW_SOURCE,

	/* object actions */
	BROWSER_OBJECT,
	BROWSER_OBJECT_INFO,
	BROWSER_OBJECT_RELOAD,

	/* save actions */
	BROWSER_OBJECT_SAVE,
	BROWSER_OBJECT_EXPORT_SPRITE,
	BROWSER_OBJECT_SAVE_URL_URI,
	BROWSER_OBJECT_SAVE_URL_URL,
	BROWSER_OBJECT_SAVE_URL_TEXT,
	BROWSER_SAVE,
	BROWSER_SAVE_COMPLETE,
	BROWSER_EXPORT_DRAW,
	BROWSER_EXPORT_TEXT,
	BROWSER_SAVE_URL_URI,
	BROWSER_SAVE_URL_URL,
	BROWSER_SAVE_URL_TEXT,
	HOTLIST_EXPORT,
	HISTORY_EXPORT,

	/* navigation actions */
	BROWSER_NAVIGATE_HOME,
	BROWSER_NAVIGATE_BACK,
	BROWSER_NAVIGATE_FORWARD,
	BROWSER_NAVIGATE_UP,
	BROWSER_NAVIGATE_RELOAD,
	BROWSER_NAVIGATE_RELOAD_ALL,
	BROWSER_NAVIGATE_STOP,
	BROWSER_NAVIGATE_URL,

	/* browser window/display actions */
	BROWSER_SCALE_VIEW,
	BROWSER_FIND_TEXT,
	BROWSER_IMAGES_FOREGROUND,
	BROWSER_IMAGES_BACKGROUND,
	BROWSER_BUFFER_ANIMS,
	BROWSER_BUFFER_ALL,
	BROWSER_SAVE_VIEW,
	BROWSER_WINDOW_DEFAULT,
	BROWSER_WINDOW_STAGGER,
	BROWSER_WINDOW_COPY,
	BROWSER_WINDOW_RESET,

	/* tree actions */
	TREE_NEW_FOLDER,
	TREE_NEW_LINK,
	TREE_EXPAND_ALL,
	TREE_EXPAND_FOLDERS,
	TREE_EXPAND_LINKS,
	TREE_COLLAPSE_ALL,
	TREE_COLLAPSE_FOLDERS,
	TREE_COLLAPSE_LINKS,
	TREE_SELECTION,
	TREE_SELECTION_EDIT,
	TREE_SELECTION_LAUNCH,
	TREE_SELECTION_DELETE,
	TREE_SELECT_ALL,
	TREE_CLEAR_SELECTION,

	/* toolbar actions */
	TOOLBAR_BUTTONS,
	TOOLBAR_ADDRESS_BAR,
	TOOLBAR_THROBBER,
	TOOLBAR_EDIT,

	/* misc actions */
	CHOICES_SHOW,
	APPLICATION_QUIT,
} menu_action;


NSBrowserWindow *nsbeos_find_last_window(void);

NSBrowserWindow *nsbeos_get_bwindow_for_scaffolding(nsbeos_scaffolding *scaffold);

nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel);

bool nsbeos_scaffolding_is_busy(nsbeos_scaffolding *scaffold);

void nsbeos_attach_toplevel_view(nsbeos_scaffolding *g, BView *view);

#if 0 /* GTK */
void nsbeos_attach_toplevel_viewport(nsbeos_scaffolding *g, GtkViewport *vp);
#endif

void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *message);

void nsbeos_scaffolding_destroy(nsbeos_scaffolding *scaffold);

//void nsbeos_window_destroy_event(NSBrowserWindow *window, nsbeos_scaffolding *g, BMessage *event);


void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, BPoint where);

#if 0 /* GTK */
void nsbeos_scaffolding_popup_menu(nsbeos_scaffolding *g, guint button);
#endif

#endif /* NETSURF_BEOS_SCAFFOLDING_H */