40#include "atari/gemtk/gemtk.h"
41#include "atari/res/netsurf.rsh"
60static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out,
short msg[8]);
73 NSLOG(netsurf, INFO,
"cw:%p", cw);
79 NSLOG(netsurf, INFO,
"cw:%p", cw);
94 NSLOG(netsurf, INFO,
"ucs4: %"PRIu32, ucs4);
105 NSLOG(netsurf, INFO,
"x: %d, y: %d\n", x, y);
112static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out,
short msg[8])
114 char *cur_url = NULL;
115 char *cur_title = NULL;
118 struct core_window *cw;
124 NSLOG(netsurf, INFO,
"gw:%p", win);
127 cw = (
struct core_window *)tv;
129 if (ev_out->emo_events & MU_MESAG) {
133 NSLOG(netsurf, INFO,
"WM_TOOLBAR");
135 toolbar = gemtk_obj_get_tree(TOOLBAR_HOTLIST);
141 case TOOLBAR_HOTLIST_CREATE_FOLDER:
145 case TOOLBAR_HOTLIST_ADD:
151 cur_title = (cur_title ? cur_title : (
char*)
"New bookmark");
153 cur_url = (
char*)
"http://www";
158 case TOOLBAR_HOTLIST_DELETE:
162 case TOOLBAR_HOTLIST_EDIT:
169 toolbar[msg[4]].ob_state &= ~OS_SELECTED;
172 gemtk_wm_exec_redraw(gemtk_win, &tb_area);
199 NSLOG(netsurf, INFO,
"Hotlist: %s", (
char *)&
hl.
path);
205 OBJECT * tree = gemtk_obj_get_tree(TOOLBAR_HOTLIST);
209 hl.
window = gemtk_wm_add(handle, GEMTK_WM_FLAG_DEFAULTS, NULL);
211 gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT,
212 "Failed to allocate Hotlist");
215 wind_set_str(handle, WF_NAME, (
char*)
messages_get(
"Hotlist"));
216 gemtk_wm_set_toolbar(
hl.
window, tree, 0, 0);
226 "Failed to allocate treeview");
254 wind_set(gemtk_wm_get_handle(
hl.
window), WF_TOP, 1, 0, 0, 0);
272 wind_delete(gemtk_wm_get_handle(
hl.
window));
278 NSLOG(netsurf, INFO,
"done");
301 NSLOG(netsurf, INFO,
"URL already added as Bookmark");
char * atari_find_resource(char *buf, const char *filename, const char *def)
struct gui_window * gui_get_input_window(void)
char * gui_window_get_url(struct gui_window *gw)
char * gui_window_get_title(struct gui_window *gw)
Content handling interface.
bool hotlist_keypress(uint32_t key)
Key press handling.
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_fini(void)
Finalise the hotlist.
nserror hotlist_manager_init(void *core_window_handle)
Initialise the hotlist manager.
void hotlist_redraw(int x, int y, struct rect *clip, const struct redraw_context *ctx)
Redraw the hotlist.
nserror hotlist_add_folder(const char *title, bool at_y, int y)
Add a folder to the hotlist.
nserror hotlist_init(const char *load_path, const char *save_path)
Initialise the hotlist.
void hotlist_edit_selection(void)
Edit the first selected node.
bool hotlist_has_url(nsurl *url)
Check whether given URL is present in hotlist.
nserror
Enumeration of error codes.
static void atari_hotlist_finish(struct core_window *cw)
const char * tree_hotlist_path
static nserror atari_hotlist_init_phase2(struct core_window *cw)
void atari_hotlist_close(void)
static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
static struct atari_treeview_callbacks atari_hotlist_treeview_callbacks
void atari_hotlist_open(void)
static void atari_hotlist_mouse_action(struct core_window *cw, browser_mouse_state mouse, int x, int y)
void atari_hotlist_add_page(const char *url, const char *title)
static void atari_hotlist_keypress(struct core_window *cw, uint32_t ucs4)
void atari_hotlist_destroy(void)
void atari_hotlist_init(void)
void atari_hotlist_redraw(void)
static void atari_hotlist_draw(struct core_window *cw, int x, int y, struct rect *clip, const struct redraw_context *ctx)
void atari_treeview_delete(struct core_window *cw)
Free the Treeview, but not the gemtk window used for the treeview.
void atari_treeview_get_grect(struct core_window *cw, enum treeview_area_e mode, GRECT *dest)
Get an specific area inside the window.
bool atari_treeview_is_open(struct core_window *cw)
Returns the window "open" state.
void atari_treeview_redraw(struct core_window *cw)
Process all pending redraw requests for a single treeview.
void atari_treeview_close(struct core_window *cw)
Closes (hides) the treeview window.
GUIWIN * atari_treeview_get_gemtk_window(struct core_window *cw)
Get the window manager window handle.
struct core_window * atari_treeview_create(GUIWIN *win, struct atari_treeview_callbacks *callbacks, void *user_data, uint32_t flags)
Initalize an window to be an treeview window.
void atari_treeview_open(struct core_window *cw, GRECT *pos)
Open the treeview window.
#define ATARI_TREEVIEW_WIDGETS
Default AES Window widgets for a treeview window, can be passed to atari_treeview_create as the flags...
browser_mouse_state
Mouse state: 1 is primary mouse button.
Netsurf additional integer type formatting macros.
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).
NetSurf URL handling (interface).
nserror nsurl_create(const char *const url_s, nsurl **url)
Create a NetSurf URL object from a URL string.
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
struct nsurl nsurl
NetSurf URL object.
Interface to utility string handling.
atari_treeview_init2_callback init_phase2
first entry in window list
struct fbtk_widget_s * toolbar
struct s_browser * browser
Interface to time operations.
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.