NetSurf
history.c
Go to the documentation of this file.
1/*
2 * Copyright 2017 Chris Young <chris@unsatisfactorysoftware.co.uk>
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/**
20 * \file
21 * Implementation of Amiga global history viewer using core windows.
22 */
23
24#include <stdint.h>
25#include <stdlib.h>
26#include <stdbool.h>
27#include <string.h>
28
29#include <proto/asl.h>
30#include <proto/dos.h>
31#include <proto/intuition.h>
32
33#include <classes/window.h>
34#include <gadgets/layout.h>
35#include <gadgets/space.h>
36
37#include <reaction/reaction_macros.h>
38
41#include "netsurf/keypress.h"
42#include "netsurf/plotters.h"
43#include "utils/log.h"
44#include "utils/messages.h"
45#include "utils/nsoption.h"
46
47#include "amiga/corewindow.h"
48#include "amiga/drag.h"
49#include "amiga/file.h"
50#include "amiga/history.h"
51#include "amiga/libs.h"
52#include "amiga/menu.h"
53#include "amiga/theme.h"
54#include "amiga/utf8.h"
55
56enum {
57 /* Project menu */
73 /* Edit menu */
80};
81
82/**
83 * Amiga history viewer window context
84 */
86 /** Amiga core window context */
88
90 struct Menu *imenu; /* Intuition menu */
91};
92
94
95
96static void
98{
99 SetAttrs(history_win->core.objects[GID_CW_WIN],
100 WINDOW_MenuStrip, NULL,
101 TAG_DONE);
102
103 ami_menu_free_menu(history_win->menu_data, AMI_HISTORY_M_LAST, history_win->imenu);
104}
105
106/**
107 * destroy a previously created history view
108 */
109static void
111{
112 nserror res;
113
114 if(history_window == NULL)
115 return;
116
117 res = global_history_fini();
118 if (res == NSERROR_OK) {
120 res = ami_corewindow_fini(&history_window->core); /* closes the window for us, frees history_win */
121 history_window = NULL;
122 }
123}
124
125
126/**
127 * callback for mouse action for history viewer on core window
128 *
129 * \param ami_cw The Amiga core window structure.
130 * \param mouse_state netsurf mouse state on event
131 * \param x location of event
132 * \param y location of event
133 * \return NSERROR_OK on success otherwise apropriate error code
134 */
135static nserror
137 browser_mouse_state mouse_state,
138 int x, int y)
139{
140 global_history_mouse_action(mouse_state, x, y);
141
142 return NSERROR_OK;
143}
144
145/**
146 * callback for keypress for history viewer on core window
147 *
148 * \param ami_cw The Amiga core window structure.
149 * \param nskey The netsurf key code
150 * \return NSERROR_OK on success otherwise apropriate error code
151 */
152static nserror
153ami_history_global_key(struct ami_corewindow *ami_cw, uint32_t nskey)
154{
155 if (global_history_keypress(nskey)) {
156 return NSERROR_OK;
157 }
159}
160
161/**
162 * callback on draw event for history viewer on core window
163 *
164 * \param ami_cw The Amiga core window structure.
165 * \param x The x coordinate of global history area to redraw
166 * \param y The y coordinate of global history area to redraw
167 * \param r The rectangle of the window that needs updating.
168 * \param ctx The drawing context
169 * \return NSERROR_OK on success otherwise apropriate error code
170 */
171static nserror
173 int x, int y, struct rect *r,
174 struct redraw_context *ctx)
175{
176 global_history_redraw(x, y, r, ctx);
177
178 return NSERROR_OK;
179}
180
181/**
182 * callback on drag end for history viewer
183 *
184 * \param ami_cw The Amiga core window structure.
185 * \param x mouse x co-ordinate
186 * \param y mouse y co-ordinate
187 * \return NSERROR_OK on success otherwise apropriate error code
188 */
189static nserror
190ami_history_global_drag_end(struct ami_corewindow *ami_cw, int x, int y)
191{
192 struct nsurl *url = NULL;
193 const char *title = NULL;
194 bool ok = false;
195 struct gui_window_2 *gwin;
196 struct ami_corewindow *cw;
197
199 ok = global_history_get_selection(&url, &title);
200 }
201
202 if((ok == false) || (url == NULL)) {
203 ami_gui_beep();
204 } else if(url) {
205 if((gwin = ami_window_at_pointer(AMINS_WINDOW))) {
207 url,
208 NULL,
210 NULL,
211 NULL,
212 NULL);
213 } else if((cw = (struct ami_corewindow *)ami_window_at_pointer(AMINS_COREWINDOW)) &&
214 (ami_cw->icon_drop != NULL)) {
215 cw->icon_drop(cw, url, title, x, y);
216 }
217 }
218 return NSERROR_OK;
219}
220
221/**
222 * menu stuff
223 */
224
225 /* menu hook functions */
226HOOKF(void, ami_history_global_menu_item_project_export, APTR, window, struct IntuiMessage *)
227{
228 char fname[1024];
229 struct ami_corewindow *ami_cw;
230 GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&ami_cw);
231
232 if(AslRequestTags(savereq,
233 ASLFR_Window, ami_cw->win,
234 ASLFR_SleepWindow, TRUE,
235 ASLFR_TitleText, messages_get("NetSurf"),
236 ASLFR_Screen, ami_gui_get_screen(),
237 ASLFR_InitialFile, "history.html",
238 TAG_DONE)) {
239 strlcpy(fname, savereq->fr_Drawer, 1024);
240 AddPart(fname, savereq->fr_File, 1024);
242 global_history_export(fname, NULL);
244 }
245}
246
247HOOKF(void, ami_history_global_menu_item_project_expand_all, APTR, window, struct IntuiMessage *)
248{
250}
251
252HOOKF(void, ami_history_global_menu_item_project_expand_folders, APTR, window, struct IntuiMessage *)
253{
255}
256
257HOOKF(void, ami_history_global_menu_item_project_expand_links, APTR, window, struct IntuiMessage *)
258{
260}
261
262HOOKF(void, ami_history_global_menu_item_project_collapse_all, APTR, window, struct IntuiMessage *)
263{
265}
266
267HOOKF(void, ami_history_global_menu_item_project_collapse_folders, APTR, window, struct IntuiMessage *)
268{
270}
271
272HOOKF(void, ami_history_global_menu_item_project_collapse_links, APTR, window, struct IntuiMessage *)
273{
275}
276
277HOOKF(void, ami_history_global_menu_item_project_snapshot, APTR, window, struct IntuiMessage *)
278{
279 struct ami_corewindow *ami_cw;
280 GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&ami_cw);
281
282 nsoption_set_int(history_window_ypos, ami_cw->win->TopEdge);
283 nsoption_set_int(history_window_xpos, ami_cw->win->LeftEdge);
284 nsoption_set_int(history_window_xsize, ami_cw->win->Width);
285 nsoption_set_int(history_window_ysize, ami_cw->win->Height);
286}
287
288HOOKF(void, ami_history_global_menu_item_project_close, APTR, window, struct IntuiMessage *)
289{
290 struct ami_corewindow *ami_cw;
291 GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&ami_cw);
292
293 ami_cw->close_window = true;
294}
295
296HOOKF(void, ami_history_global_menu_item_edit_select_all, APTR, window, struct IntuiMessage *)
297{
299}
300
301HOOKF(void, ami_history_global_menu_item_edit_clear, APTR, window, struct IntuiMessage *)
302{
304}
305
306HOOKF(void, ami_history_global_menu_item_edit_delete, APTR, window, struct IntuiMessage *)
307{
309}
310
311
312/* menu setup */
313
315{
316 ami_menu_alloc_item(md, AMI_HISTORY_M_PROJECT, NM_TITLE, "Tree", NULL, NULL, NULL, NULL, 0);
317 ami_menu_alloc_item(md, AMI_HISTORY_M_EXPORT, NM_ITEM, "TreeExport", "S", "TBImages:list_save",
318 ami_history_global_menu_item_project_export, NULL, 0);
319 ami_menu_alloc_item(md, AMI_HISTORY_M_BAR_P1, NM_ITEM, NM_BARLABEL, NULL, NULL, NULL, NULL, 0);
320 ami_menu_alloc_item(md, AMI_HISTORY_M_EXPAND, NM_ITEM, "Expand", NULL, "TBImages:list_folderunfold", NULL, NULL, 0);
321 ami_menu_alloc_item(md, AMI_HISTORY_M_EXPAND_ALL, NM_SUB, "All", "+", NULL,
322 ami_history_global_menu_item_project_expand_all, NULL, 0);
323 ami_menu_alloc_item(md, AMI_HISTORY_M_EXPAND_FOLDERS, NM_SUB, "Folders", NULL, NULL,
324 ami_history_global_menu_item_project_expand_folders, NULL, 0);
325 ami_menu_alloc_item(md, AMI_HISTORY_M_EXPAND_LINKS, NM_SUB, "Links", NULL, NULL,
326 ami_history_global_menu_item_project_expand_links, NULL, 0);
327 ami_menu_alloc_item(md, AMI_HISTORY_M_COLLAPSE, NM_ITEM, "Collapse", NULL, "TBImages:list_folderfold", NULL, NULL, 0);
328 ami_menu_alloc_item(md, AMI_HISTORY_M_COLLAPSE_ALL, NM_SUB, "All", "-", NULL,
329 ami_history_global_menu_item_project_collapse_all, NULL, 0);
330 ami_menu_alloc_item(md, AMI_HISTORY_M_COLLAPSE_FOLDERS, NM_SUB, "Folders", NULL, NULL,
331 ami_history_global_menu_item_project_collapse_folders, NULL, 0);
332 ami_menu_alloc_item(md, AMI_HISTORY_M_COLLAPSE_LINKS, NM_SUB, "Links", NULL, NULL,
333 ami_history_global_menu_item_project_collapse_links, NULL, 0);
334 ami_menu_alloc_item(md, AMI_HISTORY_M_BAR_P2, NM_ITEM, NM_BARLABEL, NULL, NULL, NULL, NULL, 0);
335 ami_menu_alloc_item(md, AMI_HISTORY_M_SNAPSHOT, NM_ITEM, "SnapshotWindow", NULL, "TBImages:list_hold",
336 ami_history_global_menu_item_project_snapshot, NULL, 0);
337 ami_menu_alloc_item(md, AMI_HISTORY_M_BAR_P3, NM_ITEM, NM_BARLABEL, NULL, NULL, NULL, NULL, 0);
338 ami_menu_alloc_item(md, AMI_HISTORY_M_CLOSE, NM_ITEM, "CloseWindow", "K", "TBImages:list_cancel",
339 ami_history_global_menu_item_project_close, NULL, 0);
340
341 ami_menu_alloc_item(md, AMI_HISTORY_M_EDIT, NM_TITLE, "Edit", NULL, NULL, NULL, NULL, 0);
342 ami_menu_alloc_item(md, AMI_HISTORY_M_SELECTALL, NM_ITEM, "SelectAllNS", "A", NSA_SPACE,
343 ami_history_global_menu_item_edit_select_all, NULL, 0);
344 ami_menu_alloc_item(md, AMI_HISTORY_M_CLEAR, NM_ITEM, "ClearNS", NULL, NSA_SPACE,
345 ami_history_global_menu_item_edit_clear, NULL, 0);
346 ami_menu_alloc_item(md, AMI_HISTORY_M_BAR_E1, NM_ITEM, NM_BARLABEL, NULL, NULL, NULL, NULL, 0);
347 ami_menu_alloc_item(md, AMI_HISTORY_M_DELETE, NM_ITEM, "TreeDelete", "Del", "TBImages:list_delete",
348 ami_history_global_menu_item_edit_delete, NULL, 0);
349
350 ami_menu_alloc_item(md, AMI_HISTORY_M_LAST, NM_END, NULL, NULL, NULL, NULL, NULL, 0);
351}
352
353static struct Menu *
355{
357 history_win->imenu = ami_menu_layout(history_win->menu_data, AMI_HISTORY_M_LAST);
358 if(history_win->imenu == NULL) return NULL;
359
360 return history_win->imenu;
361}
362
363
364static nserror
366{
367 struct ami_corewindow *ami_cw = (struct ami_corewindow *)&history_win->core;
368 ULONG refresh_mode = WA_SmartRefresh;
369
370 if(nsoption_bool(window_simple_refresh) == true) {
371 refresh_mode = WA_SimpleRefresh;
372 }
373
374 ami_cw->objects[GID_CW_WIN] = WindowObj,
375 WA_ScreenTitle, ami_gui_get_screen_title(),
376 WA_Title, ami_cw->wintitle,
377 WA_Activate, TRUE,
378 WA_DepthGadget, TRUE,
379 WA_DragBar, TRUE,
380 WA_CloseGadget, TRUE,
381 WA_SizeGadget, TRUE,
382 WA_SizeBRight, TRUE,
383 WA_Top, nsoption_int(history_window_ypos),
384 WA_Left, nsoption_int(history_window_xpos),
385 WA_Width, nsoption_int(history_window_xsize),
386 WA_Height, nsoption_int(history_window_ysize),
387 WA_PubScreen, ami_gui_get_screen(),
388 WA_ReportMouse, TRUE,
389 refresh_mode, TRUE,
390 WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
391 IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
392 IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
393 WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
394 WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE |
395 IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
396 WINDOW_SharedPort, ami_gui_get_shared_msgport(),
397 WINDOW_HorizProp, 1,
398 WINDOW_VertProp, 1,
399 WINDOW_UserData, history_win,
400 WINDOW_MenuStrip, ami_history_global_menu_create(history_win),
401 WINDOW_MenuUserData, WGUD_HOOK,
402 WINDOW_IconifyGadget, FALSE,
403 WINDOW_Position, WPOS_CENTERSCREEN,
404 WINDOW_ParentGroup, ami_cw->objects[GID_CW_MAIN] = LayoutVObj,
405 LAYOUT_AddChild, ami_cw->objects[GID_CW_DRAW] = SpaceObj,
406 GA_ID, GID_CW_DRAW,
407 SPACE_Transparent, TRUE,
408 SPACE_BevelStyle, BVS_DISPLAY,
409 GA_RelVerify, TRUE,
410 SpaceEnd,
411 EndGroup,
412 EndWindow;
413
414 if(ami_cw->objects[GID_CW_WIN] == NULL) {
415 return NSERROR_NOMEM;
416 }
417
418 return NSERROR_OK;
419}
420
421/* exported interface documented in amiga/cookies.h */
423{
424 struct ami_history_global_window *ncwin;
425 nserror res;
426
427 if(history_window != NULL) {
428 //windowtofront()
429 return NSERROR_OK;
430 }
431
432 ncwin = calloc(1, sizeof(struct ami_history_global_window));
433 if (ncwin == NULL) {
434 return NSERROR_NOMEM;
435 }
436
437 ncwin->core.wintitle = ami_utf8_easy((char *)messages_get("GlobalHistory"));
438
440 if (res != NSERROR_OK) {
441 NSLOG(netsurf, INFO, "SSL UI builder init failed");
443 free(ncwin);
444 return res;
445 }
446
447 /* initialise Amiga core window */
452 ncwin->core.event = NULL;
454 ncwin->core.icon_drop = NULL;
455
456 res = ami_corewindow_init(&ncwin->core);
457 if (res != NSERROR_OK) {
459 DisposeObject(ncwin->core.objects[GID_CW_WIN]);
460 free(ncwin);
461 return res;
462 }
463
464 res = global_history_init((struct core_window *)ncwin);
465 if (res != NSERROR_OK) {
467 DisposeObject(ncwin->core.objects[GID_CW_WIN]);
468 free(ncwin);
469 return res;
470 }
471
472 history_window = ncwin;
473
474 return NSERROR_OK;
475}
476
nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
finalise elements of Amiga core window.
Definition: corewindow.c:987
nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
initialise elements of Amiga core window.
Definition: corewindow.c:928
@ GID_CW_MAIN
Definition: corewindow.h:35
@ GID_CW_WIN
Definition: corewindow.h:34
@ GID_CW_DRAW
Definition: corewindow.h:36
struct Screen * ami_gui_get_screen(void)
Get a pointer to the screen NetSurf is running on.
Definition: gui.c:404
void * ami_window_at_pointer(int type)
undocumented, or internal, or documented elsewhere
Definition: gui.c:683
struct browser_window * ami_gui2_get_browser_window(struct gui_window_2 *gwin)
Get browser window from gui_window_2.
Definition: gui.c:426
STRPTR ami_gui_get_screen_title(void)
Get the string for NetSurf's screen titlebar.
Definition: gui.c:975
void ami_gui_beep(void)
Beep.
Definition: gui.c:415
struct MsgPort * ami_gui_get_shared_msgport(void)
Get shared message port.
static void ami_history_global_menulabs(struct ami_menu_data **md)
Definition: history.c:314
static nserror ami_history_global_key(struct ami_corewindow *ami_cw, uint32_t nskey)
callback for keypress for history viewer on core window
Definition: history.c:153
static struct ami_history_global_window * history_window
Definition: history.c:93
static void ami_history_global_destroy(struct ami_corewindow *ami_cw)
destroy a previously created history view
Definition: history.c:110
@ AMI_HISTORY_M_CLOSE
Definition: history.c:72
@ AMI_HISTORY_M_EXPAND_LINKS
Definition: history.c:64
@ AMI_HISTORY_M_BAR_P1
Definition: history.c:60
@ AMI_HISTORY_M_CLEAR
Definition: history.c:76
@ AMI_HISTORY_M_BAR_P3
Definition: history.c:71
@ AMI_HISTORY_M_COLLAPSE
Definition: history.c:65
@ AMI_HISTORY_M_BAR_P2
Definition: history.c:69
@ AMI_HISTORY_M_EXPAND_ALL
Definition: history.c:62
@ AMI_HISTORY_M_LAST
Definition: history.c:79
@ AMI_HISTORY_M_EXPAND_FOLDERS
Definition: history.c:63
@ AMI_HISTORY_M_EDIT
Definition: history.c:74
@ AMI_HISTORY_M_EXPORT
Definition: history.c:59
@ AMI_HISTORY_M_COLLAPSE_FOLDERS
Definition: history.c:67
@ AMI_HISTORY_M_SELECTALL
Definition: history.c:75
@ AMI_HISTORY_M_PROJECT
Definition: history.c:58
@ AMI_HISTORY_M_BAR_E1
Definition: history.c:77
@ AMI_HISTORY_M_COLLAPSE_ALL
Definition: history.c:66
@ AMI_HISTORY_M_EXPAND
Definition: history.c:61
@ AMI_HISTORY_M_DELETE
Definition: history.c:78
@ AMI_HISTORY_M_COLLAPSE_LINKS
Definition: history.c:68
@ AMI_HISTORY_M_SNAPSHOT
Definition: history.c:70
nserror ami_history_global_present(void)
Open the global history viewer.
Definition: history.c:422
HOOKF(void, ami_history_global_menu_item_project_export, APTR, window, struct IntuiMessage *)
menu stuff
Definition: history.c:226
static nserror ami_history_global_create_window(struct ami_history_global_window *history_win)
Definition: history.c:365
static struct Menu * ami_history_global_menu_create(struct ami_history_global_window *history_win)
Definition: history.c:354
static nserror ami_history_global_draw(struct ami_corewindow *ami_cw, int x, int y, struct rect *r, struct redraw_context *ctx)
callback on draw event for history viewer on core window
Definition: history.c:172
static nserror ami_history_global_drag_end(struct ami_corewindow *ami_cw, int x, int y)
callback on drag end for history viewer
Definition: history.c:190
static void ami_history_global_menu_free(struct ami_history_global_window *history_win)
Definition: history.c:97
static nserror ami_history_global_mouse(struct ami_corewindow *ami_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse action for history viewer on core window
Definition: history.c:136
struct Menu * ami_menu_layout(struct ami_menu_data **md, int max)
Definition: menu.c:419
void ami_menu_free_menu(struct ami_menu_data **md, int max, struct Menu *imenu)
Definition: menu.c:430
void ami_menu_alloc_item(struct ami_menu_data **md, int num, UBYTE type, const char *restrict label, const char *restrict key, const char *restrict icon, void *restrict func, void *restrict hookdata, UWORD flags)
Definition: menu.c:115
#define NSA_SPACE
empty space
Definition: menu.h:37
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
Definition: theme.c:221
Browser window creation and manipulation interface.
nserror browser_window_navigate(struct browser_window *bw, struct nsurl *url, struct nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, struct hlcache_handle *parent)
Start fetching a page in a browser window.
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
nserror global_history_init(void *core_window_handle)
Initialise the global history.
nserror global_history_expand(bool only_folders)
Expand the treeview's nodes.
nserror global_history_fini(void)
Finalise the global history.
void global_history_redraw(int x, int y, struct rect *clip, const struct redraw_context *ctx)
Redraw the global history.
bool global_history_has_selection(void)
Determine whether there is a selection.
bool global_history_get_selection(nsurl **url, const char **title)
Get the first selected node.
nserror global_history_export(const char *path, const char *title)
Save global history to file (html)
nserror global_history_contract(bool all)
Contract the treeview's nodes.
bool global_history_keypress(uint32_t key)
Key press handling.
void global_history_mouse_action(browser_mouse_state mouse, int x, int y)
Handles all kinds of mouse action.
nserror
Enumeration of error codes.
Definition: errors.h:29
@ NSERROR_NOT_IMPLEMENTED
Functionality is not implemented.
Definition: errors.h:61
@ NSERROR_NOMEM
Memory exhaustion.
Definition: errors.h:32
@ NSERROR_OK
No error.
Definition: errors.h:30
struct FileRequester * savereq
Definition: file.c:53
@ AMINS_WINDOW
Definition: object.h:28
@ AMINS_COREWINDOW
Definition: object.h:36
void ami_utf8_free(char *ptr)
Definition: utf8.c:104
char * ami_utf8_easy(const char *string)
Definition: utf8.c:109
browser_mouse_state
Mouse state.
Definition: mouse.h:43
@ GUI_POINTER_WAIT
Definition: mouse.h:104
@ GUI_POINTER_DEFAULT
Definition: mouse.h:90
Target independent plotting interface.
Interface to key press operations.
@ NS_KEY_SELECT_ALL
Definition: keypress.h:32
@ NS_KEY_CLEAR_SELECTION
Definition: keypress.h:45
@ NS_KEY_DELETE_LEFT
Definition: keypress.h:35
#define WindowObj
Definition: libs.h:77
#define LayoutVObj
Definition: libs.h:65
#define SpaceObj
Definition: libs.h:74
#define NSLOG(catname, level, logmsg, args...)
Definition: log.h:116
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Definition: messages.c:241
Localised message support (interface).
struct nsurl nsurl
NetSurf URL object.
Definition: nsurl.h:31
#define IDCMP_EXTENDEDMOUSE
Definition: os3support.h:121
#define BVS_DISPLAY
Definition: os3support.h:120
Interface to utility string handling.
Amiga core window state.
Definition: corewindow.h:47
void(* close)(struct ami_corewindow *ami_cw)
callback to close an Amiga core window
Definition: corewindow.h:164
Object * objects[GID_CW_LAST]
Definition: corewindow.h:54
nserror(* icon_drop)(struct ami_corewindow *ami_cw, struct nsurl *url, const char *title, int x, int y)
callback for icon drop on Amiga core window ie.
Definition: corewindow.h:157
bool close_window
Definition: corewindow.h:67
nserror(* mouse)(struct ami_corewindow *ami_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse event on Amiga core window
Definition: corewindow.h:120
nserror(* draw)(struct ami_corewindow *ami_cw, int x, int y, struct rect *r, struct redraw_context *ctx)
callback to draw on drawable area of Amiga core window
Definition: corewindow.h:97
nserror(* key)(struct ami_corewindow *ami_cw, uint32_t nskey)
callback for keypress on Amiga core window
Definition: corewindow.h:109
struct Window * win
Definition: corewindow.h:53
BOOL(* event)(struct ami_corewindow *ami_cw, ULONG result)
callback for unknown events on Amiga core window eg.
Definition: corewindow.h:132
nserror(* drag_end)(struct ami_corewindow *ami_cw, int x, int y)
callback for drag end on Amiga core window ie.
Definition: corewindow.h:143
struct Hook idcmp_hook
Definition: corewindow.h:56
char * wintitle
window title, must be allocated wth ami_utf8 function
Definition: corewindow.h:78
Amiga history viewer window context.
Definition: history.c:85
struct ami_menu_data * menu_data[AMI_HISTORY_M_LAST+1]
Definition: history.c:89
struct Menu * imenu
Definition: history.c:90
struct ami_corewindow core
Amiga core window context.
Definition: history.c:87
Rectangle coordinates.
Definition: types.h:40
Redraw context.
Definition: plotters.h:51
Option reading and saving interface.
#define nsoption_int(OPTION)
Get the value of an integer option.
Definition: nsoption.h:313
#define nsoption_set_int(OPTION, VALUE)
set an integer option in the default table
Definition: nsoption.h:348
#define nsoption_bool(OPTION)
Get the value of a boolean option.
Definition: nsoption.h:304