31#include <proto/intuition.h>
33#include <classes/window.h>
34#include <gadgets/layout.h>
35#include <gadgets/space.h>
37#include <reaction/reaction_macros.h>
114 if(menu_ctx->
in_menu ==
true) {
115 if(menu_ctx->
cb(menu_ctx->
userdata, menu_ctx->
level, menu_ctx->
item, title, NULL,
true) ==
true)
118 if((menu_ctx->
level == 0) && (strcmp(title, menu_ctx->
folder) == 0)) {
120 menu_ctx->
found =
true;
131 if(menu_ctx->
in_menu ==
true) {
132 if(menu_ctx->
cb(menu_ctx->
userdata, menu_ctx->
level, menu_ctx->
item, title, url,
false) ==
true)
145 if((menu_ctx->
in_menu ==
true) && (menu_ctx->
level == 0))
158 ctx.
item = first_item;
162 ctx.
cb = cb_add_item;
244 const char *title = NULL;
253 if((ok ==
false) || (url == NULL)) {
299 WINDOW_MenuStrip, NULL,
306HOOKF(
void, ami_hotlist_menu_item_project_export, APTR, window,
struct IntuiMessage *)
310 GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&ami_cw);
313 ASLFR_Window, ami_cw->
win,
314 ASLFR_SleepWindow, TRUE,
317 ASLFR_InitialFile,
"hotlist.html",
319 strlcpy(fname,
savereq->fr_Drawer, 1024);
320 AddPart(fname,
savereq->fr_File, 1024);
327HOOKF(
void, ami_hotlist_menu_item_project_expand_all, APTR, window,
struct IntuiMessage *)
332HOOKF(
void, ami_hotlist_menu_item_project_expand_folders, APTR, window,
struct IntuiMessage *)
337HOOKF(
void, ami_hotlist_menu_item_project_expand_links, APTR, window,
struct IntuiMessage *)
342HOOKF(
void, ami_hotlist_menu_item_project_collapse_all, APTR, window,
struct IntuiMessage *)
347HOOKF(
void, ami_hotlist_menu_item_project_collapse_folders, APTR, window,
struct IntuiMessage *)
352HOOKF(
void, ami_hotlist_menu_item_project_collapse_links, APTR, window,
struct IntuiMessage *)
357HOOKF(
void, ami_hotlist_menu_item_project_snapshot, APTR, window,
struct IntuiMessage *)
360 GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&ami_cw);
368HOOKF(
void, ami_hotlist_menu_item_project_close, APTR, window,
struct IntuiMessage *)
371 GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&ami_cw);
376HOOKF(
void, ami_hotlist_menu_item_edit_newfolder, APTR, window,
struct IntuiMessage *)
381HOOKF(
void, ami_hotlist_menu_item_edit_newlink, APTR, window,
struct IntuiMessage *)
386HOOKF(
void, ami_hotlist_menu_item_edit_edit, APTR, window,
struct IntuiMessage *)
391HOOKF(
void, ami_hotlist_menu_item_edit_select_all, APTR, window,
struct IntuiMessage *)
396HOOKF(
void, ami_hotlist_menu_item_edit_clear, APTR, window,
struct IntuiMessage *)
401HOOKF(
void, ami_hotlist_menu_item_edit_delete, APTR, window,
struct IntuiMessage *)
413 ami_hotlist_menu_item_project_export, NULL, 0);
417 ami_hotlist_menu_item_project_expand_all, NULL, 0);
419 ami_hotlist_menu_item_project_expand_folders, NULL, 0);
421 ami_hotlist_menu_item_project_expand_links, NULL, 0);
424 ami_hotlist_menu_item_project_collapse_all, NULL, 0);
426 ami_hotlist_menu_item_project_collapse_folders, NULL, 0);
428 ami_hotlist_menu_item_project_collapse_links, NULL, 0);
431 ami_hotlist_menu_item_project_snapshot, NULL, 0);
434 ami_hotlist_menu_item_project_close, NULL, 0);
439 ami_hotlist_menu_item_edit_newfolder, NULL, 0);
441 ami_hotlist_menu_item_edit_newlink, NULL, 0);
443 ami_hotlist_menu_item_edit_edit, NULL, 0);
446 ami_hotlist_menu_item_edit_select_all, NULL, 0);
448 ami_hotlist_menu_item_edit_clear, NULL, 0);
451 ami_hotlist_menu_item_edit_delete, NULL, 0);
461 if(hotlist_win->
imenu == NULL)
return NULL;
463 return hotlist_win->
imenu;
471 ULONG refresh_mode = WA_SmartRefresh;
474 refresh_mode = WA_SimpleRefresh;
481 WA_DepthGadget, TRUE,
483 WA_CloseGadget, TRUE,
491 WA_ReportMouse, TRUE,
493 WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
494 IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
498 IDCMP_SIZEVERIFY | IDCMP_REFRESHWINDOW,
502 WINDOW_UserData, hotlist_win,
504 WINDOW_MenuUserData, WGUD_HOOK,
505 WINDOW_IconifyGadget, FALSE,
506 WINDOW_Position, WPOS_CENTERSCREEN,
510 SPACE_Transparent, TRUE,
566 NSLOG(netsurf, INFO,
"SSL UI builder init failed");
nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
finalise elements of Amiga core window.
nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
initialise elements of Amiga core window.
struct Screen * ami_gui_get_screen(void)
Get a pointer to the screen NetSurf is running on.
void ami_gui_hotlist_update_all(void)
Update hotlist toolbar and recreate the menu for all windows.
void * ami_window_at_pointer(int type)
undocumented, or internal, or documented elsewhere
struct browser_window * ami_gui2_get_browser_window(struct gui_window_2 *gwin)
Get browser window from gui_window_2.
STRPTR ami_gui_get_screen_title(void)
Get the string for NetSurf's screen titlebar.
void ami_gui_beep(void)
Beep.
struct MsgPort * ami_gui_get_shared_msgport(void)
Get shared message port.
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
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)
bool hotlist_keypress(uint32_t key)
Key press handling.
bool hotlist_has_selection(void)
Determine whether there is a selection.
nserror hotlist_add_entry(nsurl *url, const char *title, bool at_y, int y)
Add an entry to the hotlist for given Title/URL.
void hotlist_mouse_action(browser_mouse_state mouse, int x, int y)
Handles all kinds of mouse action.
nserror hotlist_manager_init(void *core_window_handle)
Initialise the hotlist manager.
nserror hotlist_manager_fini(void)
Finalise the hotlist manager.
void hotlist_redraw(int x, int y, struct rect *clip, const struct redraw_context *ctx)
Redraw the hotlist.
nserror hotlist_iterate(void *ctx, hotlist_folder_enter_cb enter_cb, hotlist_address_cb address_cb, hotlist_folder_leave_cb leave_cb)
Walk (depth first) the hotlist, calling callbacks on entering folders, address nodes,...
nserror hotlist_add_folder(const char *title, bool at_y, int y)
Add a folder to the hotlist.
nserror hotlist_export(const char *path, const char *title)
Save hotlist to file.
nserror hotlist_expand(bool only_folders)
Expand the treeview's nodes.
void hotlist_edit_selection(void)
Edit the first selected node.
bool hotlist_get_selection(nsurl **url, const char **title)
Get the first selected node.
nserror hotlist_contract(bool all)
Contract the treeview's nodes.
nserror
Enumeration of error codes.
@ NSERROR_NOT_IMPLEMENTED
Functionality is not implemented.
@ NSERROR_NOMEM
Memory exhaustion.
struct FileRequester * savereq
static void ami_hotlist_destroy(struct ami_corewindow *ami_cw)
destroy a previously created hotlist view
static nserror ami_hotlist_folder_leave_cb(void *ctx)
static nserror ami_hotlist_drag_end(struct ami_corewindow *ami_cw, int x, int y)
callback for drag end on Amiga core window ie.
static struct Menu * ami_hotlist_menu_create(struct ami_hotlist_window *hotlist_win)
static nserror ami_hotlist_address_cb(void *ctx, nsurl *url, const char *title)
static nserror ami_hotlist_mouse(struct ami_corewindow *ami_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse action for hotlist viewer on core window
nserror ami_hotlist_scan(void *userdata, int first_item, const char *folder, bool(*cb_add_item)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder))
Scan the hotlist.
HOOKF(void, ami_hotlist_menu_item_project_export, APTR, window, struct IntuiMessage *)
static void ami_hotlist_menulabs(struct ami_menu_data **md)
void ami_hotlist_close(void)
Close the hotlist viewer normally this shouldn't be used; only exists for ARexx use.
static nserror ami_hotlist_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.
static nserror ami_hotlist_create_window(struct ami_hotlist_window *hotlist_win)
static nserror ami_hotlist_draw(struct ami_corewindow *ami_cw, int x, int y, struct rect *r, struct redraw_context *ctx)
callback on draw event for hotlist viewer on core window
static nserror ami_hotlist_folder_enter_cb(void *ctx, const char *title)
hotlist scanner
nserror ami_hotlist_present(void)
Open the hotlist viewer.
static nserror ami_hotlist_key(struct ami_corewindow *ami_cw, uint32_t nskey)
callback for keypress for hotlist viewer on core window
static void ami_hotlist_menu_free(struct ami_hotlist_window *hotlist_win)
menu stuff
static struct ami_hotlist_window * hotlist_window
@ AMI_HOTLIST_M_COLLAPSE_ALL
@ AMI_HOTLIST_M_EXPAND_FOLDERS
@ AMI_HOTLIST_M_NEWFOLDER
@ AMI_HOTLIST_M_SELECTALL
@ AMI_HOTLIST_M_COLLAPSE_FOLDERS
@ AMI_HOTLIST_M_EXPAND_LINKS
@ AMI_HOTLIST_M_COLLAPSE_LINKS
@ AMI_HOTLIST_M_EDIT_EDIT
@ AMI_HOTLIST_M_EXPAND_ALL
void ami_utf8_free(char *ptr)
char * ami_utf8_easy(const char *string)
browser_mouse_state
Mouse state: 1 is primary mouse button.
Target independent plotting interface.
Interface to key press operations.
#define NSLOG(catname, level, logmsg, args...)
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Localised message support (interface).
struct nsurl nsurl
NetSurf URL object.
#define IDCMP_EXTENDEDMOUSE
Interface to utility string handling.
void(* close)(struct ami_corewindow *ami_cw)
callback to close an Amiga core window
Object * objects[GID_CW_LAST]
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.
nserror(* mouse)(struct ami_corewindow *ami_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse event on Amiga core window
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
nserror(* key)(struct ami_corewindow *ami_cw, uint32_t nskey)
callback for keypress on Amiga core window
BOOL(* event)(struct ami_corewindow *ami_cw, ULONG result)
callback for unknown events on Amiga core window eg.
nserror(* drag_end)(struct ami_corewindow *ami_cw, int x, int y)
callback for drag end on Amiga core window ie.
char * wintitle
window title, must be allocated wth ami_utf8 function
bool(* cb)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder)
Amiga hotlist viewer window context.
struct ami_menu_data * menu_data[AMI_HOTLIST_M_LAST+1]
struct ami_corewindow core
Amiga core window context.
Option reading and saving interface.
#define nsoption_int(OPTION)
Get the value of an integer option.
#define nsoption_set_int(OPTION, VALUE)
set an integer option in the default table
#define nsoption_bool(OPTION)
Get the value of a boolean option.