diff options
54 files changed, 1028 insertions, 1717 deletions
diff --git a/amiga/tree.c b/amiga/tree.c index a145277fc..42eae4fa6 100644 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -822,8 +822,7 @@ BOOL ami_tree_event(struct treeview_window *twin) ((twin->win->MouseY - (bbox->Top + bbox->Height)) < AMI_DRAG_THRESHOLD)) drag_y_move = twin->win->MouseY - (bbox->Top + bbox->Height); - tree_mouse_action(twin->tree, - twin->mouse_state | twin->key_state, x, y); + tree_mouse_action(twin->tree, twin->mouse_state | twin->key_state, x, y); } if((x >= xs) && (y >= ys) && (x < bbox->Width + xs) && diff --git a/atari/Makefile.target b/atari/Makefile.target index 4a416baa6..f4dba23e7 100644 --- a/atari/Makefile.target +++ b/atari/Makefile.target @@ -185,10 +185,9 @@ endif $(Q)cp $(ATARI_RES_DIR)/netsurf.rsc $(ATARI_TARGET_DIR)res/netsurf.rsc $(Q)cp $(ATARI_RES_DIR)/languages $(ATARI_TARGET_DIR)res/languages $(Q)cp $(ATARI_RES_DIR)/icons/toolbar -R $(ATARI_TARGET_DIR)res/icons - $(Q)cp \!NetSurf/Resources/Icons/content.png -R $(ATARI_TARGET_DIR)res/icons/ - $(Q)cp \!NetSurf/Resources/Icons/directory.png -R $(ATARI_TARGET_DIR)res/icons/dir.png + $(Q)cp \!NetSurf/Resources/Icons/* -R $(ATARI_TARGET_DIR)res/icons/ - $(Q)cp \!NetSurf/Resources/netsurf.png,b60 $(ATARI_TARGET_DIR)netsurf.png + $(Q)cp \!NetSurf/Resources/netsurf.png,b60 $(ATARI_TARGET_DIR)res/netsurf.png $(Q)cp \!NetSurf/Resources/AdBlock,f79 $(ATARI_TARGET_DIR)res/adblock.css $(Q)cp \!NetSurf/Resources/CSS,f79 $(ATARI_TARGET_DIR)res/default.css $(Q)cp \!NetSurf/Resources/Quirks,f79 $(ATARI_TARGET_DIR)res/quirks.css diff --git a/atari/clipboard.c b/atari/clipboard.c index bcd4ee6df..254579bba 100644 --- a/atari/clipboard.c +++ b/atari/clipboard.c @@ -28,6 +28,7 @@ #include <mint/osbind.h> #include <cflib.h> #include "atari/clipboard.h" +#include "atari/gemtk/gemtk.h" static int filesize(char * path) @@ -49,6 +50,13 @@ static int filesize(char * path) int scrap_txt_write(char *str) { scrap_wtxt(str); + + + // Send SC_CHANGED message: + gemtk_send_msg(SC_CHANGED, 0, 2, 0, 0, 0, 0); + + return(0); + } char *scrap_txt_read(void) diff --git a/atari/ctxmenu.c b/atari/ctxmenu.c index 2170dec8c..fb687b809 100644 --- a/atari/ctxmenu.c +++ b/atari/ctxmenu.c @@ -23,7 +23,10 @@ #include <string.h>
#include <stdbool.h>
#include <assert.h> -#include <mint/osbind.h>
+#include <sys/stat.h> +#include <sys/types.h> +#include <mint/osbind.h> +#include <cflib.h>
#include "desktop/gui.h"
#include "desktop/netsurf.h"
@@ -36,7 +39,8 @@ #include "content/urldb.h"
#include "css/css.h"
#include "utils/log.h"
-#include "utils/messages.h"
+#include "utils/messages.h" +#include "utils/utils.h"
#include "atari/gui.h"
#include "atari/rootwin.h"
@@ -107,6 +111,42 @@ static struct s_context_info * get_context_info( struct gui_window * gw, short m return(&ctxinfo); +} + +/*** + * Generates an unique filename for temp. files + * The generated filename includes the path. + * If TMPDIR environmenrt vairable is set, this will be used as path, + * otherwise U:\tmp\ + * \param prefix + * \param sufffix + * \return pointer to static buffer owned by get_tmpfilename() + */ +static char * get_tmpfilename(const char * prefix, const char * suffix) +{ + int i=0; + static char tmpfilename[PATH_MAX]; + char * tmpdir; + const char * tmp_path_suffix = ""; + + // TODO: make function public? + tmpdir = getenv("TMPDIR"); + if(tmpdir == NULL){ + tmpdir = (char*)"u:\\tmp\\"; + } + + if(tmpdir[strlen(tmpdir)-1] != '\\'){ + tmp_path_suffix = "\\"; + } + + do{ + /* generate a new filename: */ + snprintf(tmpfilename, PATH_MAX, "%s%s%s%d%s", tmpdir, + tmp_path_suffix, prefix, i++, suffix); + /* check with cflib: */ + } while(file_exists(tmpfilename)); + + return(tmpfilename); }
//TODO: do not open popup for gui_window, but for a rootwin?
@@ -273,9 +313,11 @@ void context_popup(struct gui_window * gw, short x, short y) editor = nsoption_charp(atari_editor);
if (editor != NULL && strlen(editor)>0) {
data = content_get_source_data(gw->browser->bw->current_content,
- &size);
+ &size); if (size > 0 && data != NULL){ - snprintf(tempfile, 127, "%s%s.htm", "u:", tmpnam(NULL)); + snprintf(tempfile, 127, "%s", get_tmpfilename("ns-", ".html")); + /* the GEMDOS cmdline contains the length of the commandline + in the first byte: */ cmdline[0] = (unsigned char)strlen(tempfile); LOG(("Creating temporay source file: %s\n", tempfile));
fp_tmpfile = fopen(tempfile, "w");
@@ -283,6 +325,10 @@ void context_popup(struct gui_window * gw, short x, short y) fwrite(data, size, 1, fp_tmpfile);
fclose(fp_tmpfile); + // Send SH_WDRAW to notify files changed: + gemtk_send_msg(SH_WDRAW, 0, -1, 0, 0, 0, 0); + + // start application: if(strlen(tempfile)<=125){ shel_write(1, 1, 1, editor, cmdline); } diff --git a/atari/deskmenu.c b/atari/deskmenu.c index b1dca1216..82de7d6cd 100644 --- a/atari/deskmenu.c +++ b/atari/deskmenu.c @@ -116,8 +116,8 @@ struct s_menu_item_evnt menu_evnt_tbl[] = {T_EDIT, MAINMENU_M_PASTE, menu_paste, {'V',0,K_CTRL}, NULL},
{T_EDIT, MAINMENU_M_FIND, menu_find, {0,NK_F4,0}, NULL},
{T_VIEW, MAINMENU_M_RELOAD, menu_reload, {0,NK_F5,0}, NULL}, - {0, 0, menu_inc_scale, {'+',0,K_CTRL}, NULL}, - {0, 0, menu_dec_scale, {'-',0,K_CTRL}, NULL},
+ {T_VIEW, MAINMENU_INC_SCALE, menu_inc_scale, {'+',0,K_CTRL}, NULL}, + {T_VIEW, MAINMENU_DEC_SCALE, menu_dec_scale, {'-',0,K_CTRL}, NULL},
{T_VIEW, MAINMENU_M_TOOLBARS, menu_toolbars, {0,NK_F1,K_CTRL}, NULL},
{T_VIEW, MAINMENU_M_SAVEWIN, menu_savewin, {0,0,0}, NULL},
{T_VIEW, MAINMENU_M_DEBUG_RENDER, menu_debug_render, {0,0,0}, NULL}, @@ -301,10 +301,10 @@ static void __CDECL menu_save_page(short item, short title, void *data) path = file_select("Select folder", ""); if (path) is_folder = is_dir(path); - } while( !is_folder && path != NULL ); + } while ((is_folder == false) && (path != NULL)); if( path != NULL ){ - save_complete( input_window->browser->bw->current_content, path, NULL ); + save_complete(input_window->browser->bw->current_content, path, NULL); } }
@@ -313,8 +313,8 @@ static void __CDECL menu_quit(short item, short title, void *data) {
short buff[8];
memset( &buff, 0, sizeof(short)*8 );
- LOG(("%s", __FUNCTION__));
- netsurf_quit = true;
+ LOG(("%s", __FUNCTION__)); + gemtk_wm_send_msg(NULL, AP_TERM, 0, 0, 0, 0);
}
static void __CDECL menu_cut(short item, short title, void *data)
@@ -378,26 +378,20 @@ static void __CDECL menu_reload(short item, short title, void *data) static void __CDECL menu_inc_scale(short item, short title, void *data)
-{
+{ if(input_window == NULL)
return;
- float now = plot_get_scale(); - plot_set_scale(now+0.25);
- LOG(("%s, scale: %f", __FUNCTION__, plot_get_scale())); - gui_window_redraw_window(input_window);
+ + gui_window_set_scale(input_window, gui_window_get_scale(input_window)+0.25);
} static void __CDECL menu_dec_scale(short item, short title, void *data)
-{
+{ if(input_window == NULL)
- return;
- float now = plot_get_scale(); - if (now > 0.5) { - plot_set_scale(now-0.25); - }
- LOG(("%s, scale: %f", __FUNCTION__, plot_get_scale())); - gui_window_redraw_window(input_window);
+ return; + + gui_window_set_scale(input_window, gui_window_get_scale(input_window)-0.25);
} diff --git a/atari/doc/changes.txt b/atari/doc/changes.txt index 30879c8da..969a44bff 100755 --- a/atari/doc/changes.txt +++ b/atari/doc/changes.txt @@ -1,3 +1,42 @@ + + + =========================== + FreeMiNT Frontend Changelog + =========================== + + + NetSurf 3.1 +======================================== + +As there was no atari NetSurf 3.0 Release FreeMiNT, this Changelog contains +the FreeMint specific changes from +NetSurf 2.9-PL1 Release (Sunday, April 15 2012) to Netsurf 3.1 Release. + + + - Removed WinDom dependency (heavy GUI code change) + - Implemented "paste clipboard" for toolbar URL textbox. + - Implemented file drop on browser window handling when netsurf core + ignores the file drop event. + - Implemented basic browser window scaling + - Integrated "search page" dialog into browser window + - New settings dialog + - New treeview implementation + - Added global history window. + - Added SSL information treeview + - Added about dialog + - Improved keyboard-shortcut handling + - Improved caret redraw + - Improved favicon display + - Improved warning display (now shows a message box) + - Improved bitmap blitting + - Fixed FreeMiNT's unified filesystem handling (it's not Linux! - but DOS!) + - Fixed default download directoy + - Fixed integer overflow in download completed calculation + - Fixed commandline filepath handling + + + NetSurf 2.9 +======================================== - Fixed redraw of rectangle outlines. - Fixed redraw of Hotlist, looks better now. - Use netsurfs textarea implementation for URL, to reduce code size. diff --git a/atari/doc/todo.txt b/atari/doc/todo.txt index a42ae61e3..49f8e6570 100755 --- a/atari/doc/todo.txt +++ b/atari/doc/todo.txt @@ -1,31 +1,18 @@ -TODO's (no priority order)
+TODO's (no priority order) for NetSurf 3.1 - 4.0
- - Optimize remove / redraw of caret, use pixbuffer instead?
- Optimize drawing of bitmaps on Low-Memory machines
- Restore the Palette when Windows get's the Focus
-> only needed for <= 256 colors
- Make drawing of tiled bitmaps optional ( they are slooow )
-> already optimized, still needed? - - only copy visible rects when copying screen rects ( during scroll ). - - Make context menu more stable, Bug lurking within core?
- - Implement TreeView History
- - Implement TreeView SSL Dialog
- - Implement Native Select Menu
- - Implement offscreen plotter
- - Implement Options Dialog
- - Implement SystemColors
- - Replace RSC strings with string from messages file.
- - Optimize Offscreen Plotter: Save inactive framebuffers to disk?
- - Ensure that a font-face is set to the default font when it couldn't be loaded.
- - Loose focus for browser / url widget etc. when changing focus
- ( at best, implement callback for this...)
+ - Make context menu more stable (grab all available context data at popup display)
+ - Implement SystemColor Choices dialog
+ - Add at least one offscreen plotter implementation + - Fix utf8 to atari character conversion (legacy VDI text plotter + must be able to handle the text argument characters correctly) + - Add URL history when typing URL's into url textarea
- Have browser_window specific cursor, window specifc cursor
- When minimized (not iconyfied) NetSurf doesn't recognize that.
- - Tabs? ( several tab-favicons when iconyfied?)
- - improve mouse tracking
- - fix this:
-path2url in: ./res/icons/dir.png
-path2url out: file:///./res/icons/dir.png
-url2path in: file:///./res/icons/dir.png
- - loesung fuer kompletten tree icons path finden
+ - Implement Tabs (up to 4 tab favicons when iconyfied)
+ - merge treeview and gui_window handling
diff --git a/atari/findfile.c b/atari/findfile.c index 61dc3a292..7badc7149 100755 --- a/atari/findfile.c +++ b/atari/findfile.c @@ -124,14 +124,14 @@ char *url_to_path(const char *url) /** * Locate a shared resource file by searching known places in order. + * Search order is: ./, NETSURF_GEM_RESPATH, ./$HOME/.netsurf/, $NETSURFRES/ + * (where NETSURFRES is an environment variable) * * \param buf buffer to write to. must be at least PATH_MAX chars * \param filename file to look for * \param def default to return if file not found * \return buf * - * Search order is: ./, NETSURF_GEM_RESPATH, ./$HOME/.netsurf/, $NETSURFRES/ (where NETSURFRES is an - * environment variable), */ #ifndef NETSURF_GEM_RESPATH #define NETSURF_GEM_RESPATH "./res/" diff --git a/atari/gemtk/gemtk.h b/atari/gemtk/gemtk.h index ba463a3c3..f16b4a7c0 100644 --- a/atari/gemtk/gemtk.h +++ b/atari/gemtk/gemtk.h @@ -60,6 +60,10 @@ void gemtk_clip_grect(VdiHdl vh, GRECT *rect); void gemtk_wind_get_str(short aes_handle, short mode, char *str, int len); +/* send application message */ +void gemtk_send_msg(short msg_type, short data2, short data3, short data4, + short data5, short data6, short data7); + #ifndef POINT_WITHIN # define POINT_WITHIN(_x,_y, r) ((_x >= r.g_x) && (_x <= r.g_x + r.g_w ) \ @@ -272,7 +276,7 @@ void gemtk_wm_clear(GUIWIN *win); /* -------------------------------------------------------------------------- */ /* AES OBJECT TREE TOOLS */ /* -------------------------------------------------------------------------- */ -char gemtk_obj_set_str_safe(OBJECT * tree, short idx, char *txt); +char gemtk_obj_set_str_safe(OBJECT * tree, short idx, const char *txt); char *gemtk_obj_get_text(OBJECT * tree, short idx); GRECT * gemtk_obj_screen_rect(OBJECT * tree, short obj); bool gemtk_obj_is_inside(OBJECT * tree, short obj, GRECT *area); diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c index 18d873c7d..920f53e24 100644 --- a/atari/gemtk/guiwin.c +++ b/atari/gemtk/guiwin.c @@ -303,7 +303,9 @@ static short preproc_wm(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8]) g.g_y = msg[5]; g.g_w = msg[6]; g.g_h = msg[7]; - gemtk_wm_toolbar_redraw(gw, WM_REDRAW, &g); + if((gw->state & GEMTK_WM_STATUS_ICONIFIED) == 0){ + gemtk_wm_toolbar_redraw(gw, WM_REDRAW, &g); + } } if (gw->form != NULL) { g.g_x = msg[4]; @@ -1219,7 +1221,7 @@ void gemtk_wm_send_msg(GUIWIN *win, short msg_type, short a, short b, short c, msg[0] = msg_type; msg[1] = gl_apid; msg[2] = 0; - msg[3] = win->handle; + msg[3] = (win != NULL) ? win->handle : 0; msg[4] = a; msg[5] = b; msg[6] = c; diff --git a/atari/gemtk/objc.c b/atari/gemtk/objc.c index 50d70dd9d..514f6b544 100644 --- a/atari/gemtk/objc.c +++ b/atari/gemtk/objc.c @@ -66,7 +66,7 @@ static void set_text(OBJECT *obj, short idx, char * text, int len) set_string(obj, idx, spare); } -char gemtk_obj_set_str_safe(OBJECT * tree, short idx, char *txt) +char gemtk_obj_set_str_safe(OBJECT * tree, short idx, const char *txt) { char spare[204]; short type = 0; @@ -77,7 +77,7 @@ char gemtk_obj_set_str_safe(OBJECT * tree, short idx, char *txt) type = (tree[idx].ob_type & 0xFF); if (type == G_FTEXT || type == G_FBOXTEXT) { TEDINFO *ted = ((TEDINFO *)get_obspec(tree, idx)); - maxlen = ted->te_txtlen+1; + maxlen = ted->te_tmplen+1; if (maxlen > 200) { maxlen = 200; } else if (maxlen < 0) { diff --git a/atari/gemtk/utils.c b/atari/gemtk/utils.c index 20fe5d424..aac293d21 100644 --- a/atari/gemtk/utils.c +++ b/atari/gemtk/utils.c @@ -95,10 +95,38 @@ void gemtk_clip_grect(VdiHdl vh, GRECT *rect) vs_clip_pxy(vh, pxy); } +/** Send an Message to a GUIWIN using AES message pipe +* \param win the GUIWIN which shall receive the message +* \param msg_type the WM_ message definition +* \param a the 4th parameter to appl_write +* \param b the 5th parameter to appl_write +* \param c the 6th parameter to appl_write +* \param d the 7th parameter to appl_write +*/ +void gemtk_send_msg(short msg_type, short data2, short data3, short data4, + short data5, short data6, short data7) +{ + short msg[8]; + + msg[0] = msg_type; + msg[1] = gl_apid; + msg[2] = data2; + msg[3] = data3; + msg[4] = data4; + msg[5] = data5; + msg[6] = data6; + msg[7] = data7; + + appl_write(gl_apid, 16, &msg); +} + + void gemtk_wind_get_str(short aes_handle, short mode, char *str, int len) { char tmp_str[255]; + // TODO: remove or implement function + if(len>255) { len = 255; } diff --git a/atari/gui.c b/atari/gui.c index 42f684486..e52a6589c 100644 --- a/atari/gui.c +++ b/atari/gui.c @@ -207,6 +207,7 @@ gui_create_browser_window(struct browser_window *bw, option_window_x, option_window_y, option_window_width, option_window_height }; + gui_window_set_scale(gw, 1.0); gui_window_set_url(gw, ""); gui_window_set_pointer(gw, BROWSER_POINTER_DEFAULT); gui_set_input_gui_window(gw); @@ -345,6 +346,23 @@ void gui_window_set_status(struct gui_window *w, const char *text) window_set_stauts(w->root, (char*)text); } +float gui_window_get_scale(struct gui_window *gw) +{ + return(gw->scale); +} + +void gui_window_set_scale(struct gui_window *gw, float scale) +{ + int width = 0, heigth = 0; + + LOG(("scale: %f", scale)); + + gw->scale = MAX(scale, 0.25); + + gui_window_get_dimensions(gw, &width, &heigth, true); + browser_window_reformat(gw->browser->bw, false, width, heigth); +} + void gui_window_redraw_window(struct gui_window *gw) { CMP_BROWSER b; diff --git a/atari/gui.h b/atari/gui.h index a1135e2e9..a1519f375 100755 --- a/atari/gui.h +++ b/atari/gui.h @@ -149,6 +149,7 @@ struct gui_window { char * title; char * url; struct bitmap * icon; + float scale; struct s_caret caret; struct s_search_form_session *search; struct gui_window *next, *prev; diff --git a/atari/hotlist.c b/atari/hotlist.c index 1644935f5..b4e36ae1a 100644 --- a/atari/hotlist.c +++ b/atari/hotlist.c @@ -308,6 +308,12 @@ void atari_hotlist_add_page( const char * url, const char * title ) if (nsurl_create(url, &nsurl) != NSERROR_OK) return; + if (hotlist_has_url(nsurl)) { + LOG(("URL already added as Bookmark")); + nsurl_unref(nsurl); + return; + } + /* doesn't look nice: if( hl.tv->click.x >= 0 && hl.tv->click.y >= 0 ){ hotlist_add_entry( nsurl, title, true, hl.tv->click.y ); diff --git a/atari/misc.c b/atari/misc.c index 90a8bee2b..d330859b9 100755 --- a/atari/misc.c +++ b/atari/misc.c @@ -487,7 +487,7 @@ long nkc_to_input_key(short nkc, long * ucs4_out) * \param name Default file name * \return a static char pointer or null if the user aborted the selection. */ -const char * file_select(const char * title, const char * name ) { +const char * file_select(const char * title, const char * name) { static char path[PATH_MAX]=""; // First usage : current directory static char fullname[PATH_MAX]=""; diff --git a/atari/misc.h b/atari/misc.h index 948b22526..8d1719ce8 100755 --- a/atari/misc.h +++ b/atari/misc.h @@ -58,7 +58,7 @@ void dbg_grect(const char * str, GRECT * r); void dbg_pxy(const char * str, short * pxy); void dbg_rect(const char * str, int * pxy); -const char * file_select( const char * title, const char * name ); +const char * file_select(const char * title, const char * name); /** * Convert NKC (atari normalized key code) to netsurf diff --git a/atari/plot/plot.c b/atari/plot/plot.c index 80551f968..2c75db335 100755 --- a/atari/plot/plot.c +++ b/atari/plot/plot.c @@ -48,7 +48,8 @@ struct s_view { short vis_y; /* coords are relative to plot location */ short vis_w; /* clipped to screen dimensions */ short vis_h; /* visible width */ - struct rect clipping; /* clipping rectangle */ + struct rect abs_clipping; /* The toplevel clipping rectangle */ + struct rect clipping; /* actual clipping rectangle */ float scale; }; @@ -865,6 +866,7 @@ static void snapshot_suspend(void) } } +#ifdef WITH_8BPP_SUPPORT if(size_buf_std > CONV_KEEP_LIMIT ) { buf_std.fd_addr = realloc( buf_std.fd_addr, CONV_KEEP_LIMIT @@ -875,6 +877,7 @@ static void snapshot_suspend(void) size_buf_std = 0; } } +#endif if(buf_scr_compat != NULL ) { size_t bs = bitmap_buffer_size(buf_scr_compat ); @@ -994,6 +997,17 @@ inline static bool ablend_bitmap( struct bitmap * img, struct bitmap * bg, #ifdef WITH_8BPP_SUPPORT +/** + * Convert an bitmap to an 8 bit device dependant MFDB + * \param img the bitmap (only tested with 32bit bitmaps) + * \param x screen coord of the background + * \param y screen coord of the background + * \param clip the region of the image that get's converted + * \param bg the background used for cheap transparency + * \param flags + * \param out receives the converted bitmap (still owned by the plot API) + * + */ static bool bitmap_convert_8(struct bitmap * img, int x, int y, GRECT * clip, uint32_t bg, uint32_t flags, MFDB *out ) @@ -1110,7 +1124,7 @@ static bool bitmap_convert_8(struct bitmap * img, int x, stdform.fd_r1 = stdform.fd_r2 = stdform.fd_r3 = 0; int img_stride = bitmap_get_rowstride(img); - uint32_t prev_pixel = 0x12345678; + uint32_t prev_pixel = 0x12345678; //TODO: check for collision in first pixel unsigned long col = 0; unsigned char val = 0; uint32_t * row; @@ -1866,10 +1880,18 @@ static bool plot_polygon(const int *p, unsigned int n, return ( true ); } +/*** + * Set plot origin and canvas size + * \param x the x origin + * \param y the y origin + * \param w the width of the plot area + * \param h the height of the plot area + */ bool plot_set_dimensions(int x, int y, int w, int h) { bool doupdate = false; struct rect newclip = {0, 0, w, h}; + GRECT absclip = {x, y, w, h}; if (!(w == view.w && h == view.h)) { struct rect newclip = { 0, 0, w-1, h-1 }; @@ -1887,13 +1909,18 @@ bool plot_set_dimensions(int x, int y, int w, int h) //dbg_rect("plot_set_dimensions", &newclip); + plot_set_abs_clipping(&absclip); plot_clip(&newclip); return(true); } +/*** + * Get current canvas size + * \param dst the GRECT * which receives the canvas size + * + */ bool plot_get_dimensions(GRECT *dst) { - dst->g_x = view.x; dst->g_y = view.y; dst->g_w = view.w; @@ -1901,19 +1928,79 @@ bool plot_get_dimensions(GRECT *dst) return(true); } -bool plot_set_scale(float scale) +/** + * set scale of plotter. + * \param scale the new scale value + * \return the old scale value + */ + +float plot_set_scale(float scale) { + float ret = view.scale; + view.scale = scale; + + return(ret); } -float plot_get_scale() +float plot_get_scale(void) { return(view.scale); } + +/** + * + * Subsequent calls to plot_clip will be clipped by the absolute clip. + * \param area the maximum clipping rectangle (absolute screen coords) + * +*/ +void plot_set_abs_clipping(const GRECT *area) +{ + GRECT canvas; + + plot_get_dimensions(&canvas); + + if(!rc_intersect(area, &canvas)){ + view.abs_clipping.x0 = 0; + view.abs_clipping.x1 = 0; + view.abs_clipping.y0 = 0; + view.abs_clipping.y1 = 0; + } + else { + view.abs_clipping.x0 = area->g_x; + view.abs_clipping.x1 = area->g_x + area->g_w; + view.abs_clipping.y0 = area->g_y; + view.abs_clipping.y1 = area->g_y + area->g_h; + } +} + + +/*** + * Get the maximum clip extent, in absolute screen coords + * \param dst the structure that receives the absolute clipping + */ +void plot_get_abs_clipping(struct rect *dst) +{ + *dst = view.abs_clipping; +} + + +/*** + * Get the maximum clip extent, in absolute screen coords + * \param dst the structure that receives the absolute clipping + */ +void plot_get_abs_clipping_grect(GRECT *dst) +{ + dst->g_x = view.abs_clipping.x0; + dst->g_w = view.abs_clipping.x1 - view.abs_clipping.x0; + dst->g_y = view.abs_clipping.y0; + dst->g_h = view.abs_clipping.y1 - view.abs_clipping.y0; +} + bool plot_clip(const struct rect *clip) { - GRECT canvas, screen, gclip, isection; + GRECT canvas, screen, gclip, maxclip; short pxy[4]; screen.g_x = 0; @@ -1946,7 +2033,9 @@ bool plot_clip(const struct rect *clip) //assert(1 == 0); } - //assert(rc_intersect(&screen, &gclip)); + // When setting VDI clipping, obey to maximum cliping rectangle: + plot_get_abs_clipping_grect(&maxclip); + rc_intersect(&maxclip, &gclip); //dbg_grect("canvas clipped to screen", &gclip); diff --git a/atari/plot/plot.h b/atari/plot/plot.h index 7bef5b92d..31c64c863 100755 --- a/atari/plot/plot.h +++ b/atari/plot/plot.h @@ -108,7 +108,9 @@ bool plot_unlock(void); bool plot_set_dimensions( int x, int y, int w, int h ); bool plot_get_dimensions(GRECT *dst); float plot_get_scale(void); -bool plot_set_scale(float); +float plot_set_scale(float); +void plot_set_abs_clipping(const GRECT *area); +void plot_get_abs_clipping(struct rect *dst); bool plot_get_clip(struct rect * out); /* Get clipping for current framebuffer as GRECT */ void plot_get_clip_grect(GRECT * out); diff --git a/atari/res/netsurf.rsc b/atari/res/netsurf.rsc Binary files differindex 0076e3322..4940c54a4 100755 --- a/atari/res/netsurf.rsc +++ b/atari/res/netsurf.rsc diff --git a/atari/res/netsurf.rsh b/atari/res/netsurf.rsh index 8dae1774e..68ecf64f4 100755 --- a/atari/res/netsurf.rsh +++ b/atari/res/netsurf.rsh @@ -13,14 +13,12 @@ #define TOOLBAR_AREA_URL 11 /* USERDEF in tree TOOLBAR */
#define TOOLBAR_AREA_RIGHT 12 /* IBOX in tree TOOLBAR */
#define TOOLBAR_THROBBER_AREA 13 /* IBOX in tree TOOLBAR */
-#define TOOLBAR_BT_CRYPTO 14 /* CICON in tree TOOLBAR */
-#define TOOLBAR_BT_FAVORITE 15 /* CICON in tree TOOLBAR */
-#define TOOLBAR_AREA_LEFT 16 /* IBOX in tree TOOLBAR */
-#define TOOLBAR_BT_BACK 17 /* CICON in tree TOOLBAR */
-#define TOOLBAR_BT_HOME 18 /* CICON in tree TOOLBAR */
-#define TOOLBAR_BT_FORWARD 19 /* CICON in tree TOOLBAR */
-#define TOOLBAR_BT_STOP 20 /* CICON in tree TOOLBAR */
-#define TOOLBAR_BT_RELOAD 21 /* CICON in tree TOOLBAR */
+#define TOOLBAR_AREA_LEFT 14 /* IBOX in tree TOOLBAR */
+#define TOOLBAR_BT_BACK 15 /* CICON in tree TOOLBAR */
+#define TOOLBAR_BT_HOME 16 /* CICON in tree TOOLBAR */
+#define TOOLBAR_BT_FORWARD 17 /* CICON in tree TOOLBAR */
+#define TOOLBAR_BT_STOP 18 /* CICON in tree TOOLBAR */
+#define TOOLBAR_BT_RELOAD 19 /* CICON in tree TOOLBAR */
#define ICONIFY 1 /* form/dial */
#define ICONIFY_GLOBE 1 /* CICON in tree ICONIFY */
@@ -136,6 +134,11 @@ #define SETTINGS_EDIT_CA_BUNDLE 7 /* FTEXT in tree SETTINGS */
#define SETTINGS_EDIT_CA_CERTS_PATH 8 /* FTEXT in tree SETTINGS */
#define SETTINGS_EDIT_EDITOR 9 /* FTEXT in tree SETTINGS */
+#define SETTINGS_BT_SEL_DOWNLOAD_DIR 96 /* BUTTON in tree SETTINGS */
+#define SETTINGS_BT_SEL_HOTLIST 97 /* BUTTON in tree SETTINGS */
+#define SETTINGS_BT_SEL_CA_BUNDLE 98 /* BUTTON in tree SETTINGS */
+#define SETTINGS_BT_SEL_CA_CERTS 99 /* BUTTON in tree SETTINGS */
+#define SETTINGS_BT_SEL_EDITOR 100 /* BUTTON in tree SETTINGS */
/* Make sure that initial value is large enough! */
#define SETTINGS_BT_SEL_FONT_RENDERER 16 /* BUTTON in tree SETTINGS */
#define SETTINGS_CB_ANTI_ALIASING 17 /* BUTTON in tree SETTINGS */
@@ -209,20 +212,21 @@ #define MAINMENU_M_FIND 34 /* STRING in tree MAINMENU */
#define MAINMENU_M_STOP 36 /* STRING in tree MAINMENU */
#define MAINMENU_M_RELOAD 37 /* STRING in tree MAINMENU */
-#define MAINMENU_M_SCALE 39 /* STRING in tree MAINMENU */
-#define MAINMENU_M_TOOLBARS 41 /* STRING in tree MAINMENU */
-#define MAINMENU_M_SAVEWIN 43 /* STRING in tree MAINMENU */
-#define MAINMENU_M_DEBUG_RENDER 44 /* STRING in tree MAINMENU */
-#define MAINMENU_M_BG_IMAGES 45 /* STRING in tree MAINMENU */
-#define MAINMENU_M_FG_IMAGES 46 /* STRING in tree MAINMENU */
-#define MAINMENU_M_BACK 48 /* STRING in tree MAINMENU */
-#define MAINMENU_M_FORWARD 49 /* STRING in tree MAINMENU */
-#define MAINMENU_M_HOME 50 /* STRING in tree MAINMENU */
-#define MAINMENU_M_LHISTORY 52 /* STRING in tree MAINMENU */
-#define MAINMENU_M_GHISTORY 53 /* STRING in tree MAINMENU */
-#define MAINMENU_M_ADD_BOOKMARK 55 /* STRING in tree MAINMENU */
-#define MAINMENU_M_BOOKMARKS 56 /* STRING in tree MAINMENU */
-#define MAINMENU_M_COOKIES 58 /* STRING in tree MAINMENU */
-#define MAINMENU_M_CHOICES 60 /* STRING in tree MAINMENU */
-#define MAINMENU_M_VLOG 61 /* STRING in tree MAINMENU */
-#define MAINMENU_M_HELP_CONTENT 63 /* STRING in tree MAINMENU */
+#define MAINMENU_INC_SCALE 39 /* STRING in tree MAINMENU */
+#define MAINMENU_DEC_SCALE 40 /* STRING in tree MAINMENU */
+#define MAINMENU_M_TOOLBARS 42 /* STRING in tree MAINMENU */
+#define MAINMENU_M_SAVEWIN 44 /* STRING in tree MAINMENU */
+#define MAINMENU_M_DEBUG_RENDER 45 /* STRING in tree MAINMENU */
+#define MAINMENU_M_BG_IMAGES 46 /* STRING in tree MAINMENU */
+#define MAINMENU_M_FG_IMAGES 47 /* STRING in tree MAINMENU */
+#define MAINMENU_M_BACK 49 /* STRING in tree MAINMENU */
+#define MAINMENU_M_FORWARD 50 /* STRING in tree MAINMENU */
+#define MAINMENU_M_HOME 51 /* STRING in tree MAINMENU */
+#define MAINMENU_M_LHISTORY 53 /* STRING in tree MAINMENU */
+#define MAINMENU_M_GHISTORY 54 /* STRING in tree MAINMENU */
+#define MAINMENU_M_ADD_BOOKMARK 56 /* STRING in tree MAINMENU */
+#define MAINMENU_M_BOOKMARKS 57 /* STRING in tree MAINMENU */
+#define MAINMENU_M_COOKIES 59 /* STRING in tree MAINMENU */
+#define MAINMENU_M_CHOICES 61 /* STRING in tree MAINMENU */
+#define MAINMENU_M_VLOG 62 /* STRING in tree MAINMENU */
+#define MAINMENU_M_HELP_CONTENT 64 /* STRING in tree MAINMENU */
diff --git a/atari/res/netsurf.rsm b/atari/res/netsurf.rsm index c3a7a64da..4b8ac69f3 100755 --- a/atari/res/netsurf.rsm +++ b/atari/res/netsurf.rsm @@ -1,10 +1,10 @@ -ResourceMaster v3.65
+ResourceMaster v3.651
#C 19@0@0@0@
#N 99@32@AZAaza___ _@AZAaza090___ _@@_@
#FoC-Header@rsm2out@C-Header@rsh@@@[C-Header@0@
#R 0@0@1@1@2@1@
-#M 11100100@0@7728@659@
-#T 0@2@TOOLBAR@@22@@
+#M 11110100@0@7728@664@
+#T 0@2@TOOLBAR@@20@@
#O 1@20@AREA_SEARCH@@
#O 2@26@BT_SEARCH_FWD@@
#O 3@26@BT_SEARCH_BACK@@
@@ -17,14 +17,12 @@ ResourceMaster v3.65 #O 11@24@AREA_URL@@
#O 12@25@AREA_RIGHT@@
#O 13@25@THROBBER_AREA@@
-#O 14@33@BT_CRYPTO@@
-#O 15@33@BT_FAVORITE@@
-#O 16@25@AREA_LEFT@@
-#O 17@33@BT_BACK@@
-#O 18@33@BT_HOME@@
-#O 19@33@BT_FORWARD@@
-#O 20@33@BT_STOP@@
-#O 21@33@BT_RELOAD@@
+#O 14@25@AREA_LEFT@@
+#O 15@33@BT_BACK@@
+#O 16@33@BT_HOME@@
+#O 17@33@BT_FORWARD@@
+#O 18@33@BT_STOP@@
+#O 19@33@BT_RELOAD@@
#T 1@2@ICONIFY@@3@@
#O 1@33@GLOBE@@
#T 2@2@FAVICON@@2@@
@@ -114,7 +112,7 @@ ResourceMaster v3.65 #T 15@2@TOOLBAR_HISTORY@@1@@
#T 16@2@TOOLBAR_SSL_CERT@@2@@
#O 1@26@TRUSTED@@
-#T 17@2@SETTINGS@@96@@
+#T 17@2@SETTINGS@@101@@
#O 1@26@SAVE@@
#O 2@26@ABORT@@
#O 5@29@EDIT_DOWNLOAD_PATH@@
@@ -122,6 +120,11 @@ ResourceMaster v3.65 #O 7@29@EDIT_CA_BUNDLE@@
#O 8@29@EDIT_CA_CERTS_PATH@@
#O 9@29@EDIT_EDITOR@@
+#O 96@26@BT_SEL_DOWNLOAD_DIR@@
+#O 97@26@BT_SEL_HOTLIST@@
+#O 98@26@BT_SEL_CA_BUNDLE@@
+#O 99@26@BT_SEL_CA_CERTS@@
+#O 100@26@BT_SEL_EDITOR@@
#O 16@26@BT_SEL_FONT_RENDERER@Make sure that initial value is large enough!@
#O 17@26@CB_ANTI_ALIASING@@
#O 18@26@CB_TRANSPARENCY@@
@@ -170,7 +173,7 @@ ResourceMaster v3.65 #O 90@29@EDIT_HISTORY_AGE@@
#O 91@27@INC_HISTORY_AGE@@
#O 94@26@BT_GUI_TOUT@@
-#T 18@1@MAINMENU@@64@@
+#T 18@1@MAINMENU@@65@@
#O 4@32@T_FILE@@
#O 5@32@T_EDIT@@
#O 6@32@T_VIEW@@
@@ -193,21 +196,22 @@ ResourceMaster v3.65 #O 34@28@M_FIND@@
#O 36@28@M_STOP@@
#O 37@28@M_RELOAD@@
-#O 39@28@M_SCALE@@
-#O 41@28@M_TOOLBARS@@
-#O 43@28@M_SAVEWIN@@
-#O 44@28@M_DEBUG_RENDER@@
-#O 45@28@M_BG_IMAGES@@
-#O 46@28@M_FG_IMAGES@@
-#O 48@28@M_BACK@@
-#O 49@28@M_FORWARD@@
-#O 50@28@M_HOME@@
-#O 52@28@M_LHISTORY@@
-#O 53@28@M_GHISTORY@@
-#O 55@28@M_ADD_BOOKMARK@@
-#O 56@28@M_BOOKMARKS@@
-#O 58@28@M_COOKIES@@
-#O 60@28@M_CHOICES@@
-#O 61@28@M_VLOG@@
-#O 63@28@M_HELP_CONTENT@@
-#c 20589@
+#O 39@28@INC_SCALE@@
+#O 40@28@DEC_SCALE@@
+#O 42@28@M_TOOLBARS@@
+#O 44@28@M_SAVEWIN@@
+#O 45@28@M_DEBUG_RENDER@@
+#O 46@28@M_BG_IMAGES@@
+#O 47@28@M_FG_IMAGES@@
+#O 49@28@M_BACK@@
+#O 50@28@M_FORWARD@@
+#O 51@28@M_HOME@@
+#O 53@28@M_LHISTORY@@
+#O 54@28@M_GHISTORY@@
+#O 56@28@M_ADD_BOOKMARK@@
+#O 57@28@M_BOOKMARKS@@
+#O 59@28@M_COOKIES@@
+#O 61@28@M_CHOICES@@
+#O 62@28@M_VLOG@@
+#O 64@28@M_HELP_CONTENT@@
+#c 3770@
diff --git a/atari/rootwin.c b/atari/rootwin.c index fddd7d068..3c89e6d55 100755 --- a/atari/rootwin.c +++ b/atari/rootwin.c @@ -835,13 +835,14 @@ static void window_redraw_content(ROOTWIN *rootwin, GRECT *content_area, struct rect redraw_area; GRECT content_area_rel; + float oldscale = 1.0; //dbg_grect("browser redraw, content area", content_area); //dbg_grect("browser redraw, content clip", clip); plot_set_dimensions(content_area->g_x, content_area->g_y, content_area->g_w, content_area->g_h); - + oldscale = plot_set_scale(gui_window_get_scale(rootwin->active_gui_window)); /* first, we make the coords relative to the content area: */ content_area_rel.g_x = clip->g_x - content_area->g_x; @@ -872,6 +873,8 @@ static void window_redraw_content(ROOTWIN *rootwin, GRECT *content_area, browser_window_redraw( bw, -(slid->x_pos*slid->x_unit_px), -(slid->y_pos*slid->y_unit_px), &redraw_area, &rootwin_rdrw_ctx); + + plot_set_scale(oldscale); } @@ -1001,6 +1004,7 @@ void window_place_caret(ROOTWIN *rootwin, short mode, int content_x, //dbg_pxy("caret screen coords (md_repl)", &pxy[4]); + // TODO: walk rectangle list (use MD_REPLACE then) // draw caret to screen coords: vrt_cpyfm(vh, /*MD_REPLACE*/ MD_XOR, pxy, &caret->symbol, &screen, colors); @@ -1051,6 +1055,7 @@ void window_process_redraws(ROOTWIN * rootwin) */ wind_get_grect(rootwin->aes_handle, WF_FIRSTXYWH, &visible_ro); while (visible_ro.g_w > 0 && visible_ro.g_h > 0) { + plot_set_abs_clipping(&visible_ro); //dbg_grect("visible ", &visible_ro); @@ -1398,6 +1403,7 @@ static void on_redraw(ROOTWIN *rootwin, short msg[8]) //dbg_grect("on_redraw", &clip); if(gemtk_wm_get_state(rootwin->win) & GEMTK_WM_STATUS_ICONIFIED) { + // TODO: remove asignment: GRECT clip = {msg[4], msg[5], msg[6], msg[7]}; window_redraw_favicon(rootwin, NULL); } else { diff --git a/atari/scripts/env-v4e.sh b/atari/scripts/env-v4e.sh new file mode 100755 index 000000000..6e353ffe4 --- /dev/null +++ b/atari/scripts/env-v4e.sh @@ -0,0 +1,7 @@ +export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf-v4e/m5475-atari-mint/cross/bin/ +export GCCSDK_INSTALL_ENV="/opt/netsurf-v4e/m5475-atari-mint/env" +export PATH=/opt/netsurf-v4e/m5475-atari-mint/cross/bin:$PATH +export PREFIX=/opt/netsurf-v4e/ +export LD_LIBRARY_PATH=/opt/netsurf-v4e/m5475-atari-mint/lib:/opt/netsurf-v4e/m5475-atari-mint/env/lib/ +export PKG_CONFIG_PATH=/opt/netsurf-v4e/m5475-atari-mint/env/lib/pkgconfig:/opt/netsurf-v4e/lib/pkgconfig +export C_INCLUDE_PATH=/opt/netsurf-v4e/include/:/opt/netsurf-v4e/m5475-atari-mint/env/include/ diff --git a/atari/scripts/env-x86.sh b/atari/scripts/env-x86.sh new file mode 100755 index 000000000..027da3f3b --- /dev/null +++ b/atari/scripts/env-x86.sh @@ -0,0 +1,9 @@ +#export PKG_CONFIG_PATH=${HOME}/netsurf/workspace_gtk/inst/lib/pkgconfig:: +#export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/netsurf/workspace_gtk/inst/lib +#export PREFIX=${HOME}/netsurf/workspace_gtk/inst + +export PATH=/opt/netsurf/x86/bin:$PATH +export PREFIX=/opt/netsurf/x86 +export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/netsurf/x86/lib +export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/opt/netsurf/x86/lib/pkgconfig + diff --git a/atari/scripts/make.sh b/atari/scripts/make.sh deleted file mode 100755 index bea956e21..000000000 --- a/atari/scripts/make.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -arch="68000" -#arch="68020-60" -#arch="5475" -prefix="/usr/m68k-atari-mint/" -libdir=$prefix"lib/" -outfile="ns.prg" -release="0" - -while [ "$1" != "" ] # When there are arguments... -do # Process the next one - case $1 # Look at $1 - in - -arch) - shift - arch=$1 - shift - ;; - - -prefix) - shift - prefix=$1 - shift - ;; - - -release) - release="1" - shift - ;; - - *) - echo "Unknown commandline option" - exit;; - esac -done - -libdir=$prefix"lib/" - - -if [ "$arch" = "68000" ] -then -echo "Default m68000 build." -else -libdir="$libdir/m$arch/" -fi - -if [ "$arch" = "68020-60" ] -then -outfile="ns020.prg" -fi - -if [ "$arch" = "5475" ] -then -outfile="nscf.prg" -fi - - -echo "compiling: " $outfile -echo - - - -pkgconfdir="$libdir"pkgconfig -export PKG_CONFIG_PATH=$pkgconfdir -export PKG_CONFIG_LIBDIR=$pkgconfdir - -#env - -echo "ibdir: $libdir" -echo "pkgconfdir: $pkgconfdir" -echo "arch: $arch" - - -echo PKG_CONFIG_PATH="$pkgconfdir" PKG_CONFIG_LIBDIR="$pkgconfdir" AS="m68k-atari-mint-as" CC="m68k-atari-mint-gcc" LD="m68k-atari-mint-ld" AR="m68k-atari-mint-ar" RANLIB="m68k-atari-mint-ranlib" make TARGET="atari" -PKG_CONFIG_PATH="$pkgconfdir" PKG_CONFIG_LIBDIR="$pkgconfdir" AS="m68k-atari-mint-as" CC="m68k-atari-mint-gcc" LD="m68k-atari-mint-ld" AR="m68k-atari-mint-ar" RANLIB="m68k-atari-mint-ranlib" make TARGET="atari" -if [ "$arch" != "68000" ] -then -mv ns.prg $outfile -fi - - -if [ "$release" = "1" ] -then -echo Stripping $outfile ... -m68k-atari-mint-strip $outfile -fi - - diff --git a/atari/scripts/makelibs.sh b/atari/scripts/makelibs.sh deleted file mode 100755 index 80c316147..000000000 --- a/atari/scripts/makelibs.sh +++ /dev/null @@ -1,591 +0,0 @@ -#!/bin/sh - -#todo: cflib, libcurl -> ensure ssl support, force ssl support - -#example usage: -#./makelibs.sh -prefix /usr -dest /media/EXT3_DATA/nslibs/m68000 -cross -nsonly -clean -src ./ -#./makelibs.sh -prefix /usr -dest /media/EXT3_DATA/nslibs/m68020 -cross -arch 68020 -nsonly -clean -src ./ -#./makelibs.sh -prefix /usr -dest /media/EXT3_DATA/nslibs/m68020-60 -cross -arch 68020-60 -nsonly -clean -src ./ -#./makelibs.sh -prefix /usr -dest /media/EXT3_DATA/nslibs/m5475 -cross -arch 5475 -clean - -# option description: -# -#-buildroot - this option tells the script where it is located, only needen when the script isn|t located in cwd. -#-arch - specifiy architecture type (format: 68000, 68020, 5475 etc...) -#-src - tell the tool where the sources for the ns libs are located -#-prefix - what prefix to use ( -prefix local ) -#-dest - where to install result files, this should NOT point to /usr or something like that!!! Its a temporary folder. -#-optflags -#-with-nsfb - compile with libnsfb -#-cross - set up some cross-compiler vars -#-clean - clean source dirs before building -#-nsonly - only build netsurf libs -#-dry - only set environment variables, echo them and then exit the script -#-release - compile from release svn tree - -buildroot=`pwd`"/" -libopensslpkg="openssl-0.9.8r" -libpngpkg="libpng-1.5.10" -libzlibpkg="zlib-1.2.5" -libldgpkg="ldg-dev-2.33" -libiconvpkg="libiconv-1.13.1" -libcurlpkg="curl-7.25.0" -libfreetypepkg="freetype-2.4.9" -libhermespkg="Hermes-1.3.3" -libjpegpkg="jpeg-8b" -libparserutils_version=0.1.1 -libwapcaplet_version=0.1.1 -hubbub_version=0.1.2 -libnsgif_version=0.0.3 -libnsbmp_version=0.0.3 -libnsfb_version=0.0.2 -libcss_version=0.1.2 -arch="68000" -archdir="" -debugmode="1" -profileflags="" -optflags="-O2" -withnsfb="1" -prefix="/usr" -userfs=$buildroot"userfs" -patchdir=$buildroot"patches/" -builddir=$buildroot"build/" -rpmdir=$buildroot"packages/" -nssrctree=$buildroot -compiler="gcc" -cross="0" -cleanup="echo no cleaning" -ssltarget="m68k-mint" -dry="0" -nsonly="0" -release="0" - -if [ "$CC" != "" ] -then - compiler=$CC -fi - -while [ "$1" != "" ] # When there are arguments... -do # Process the next one - case $1 # Look at $1 - in - -dummy) - dummy="1" - shift - ;; - - -p) - profileflags="-pg" - shift - ;; - - -buildroot) - shift - buildroot=$1 - userfs=$buildroot"userfs" - patchdir=$buildroot"patches/" - builddir=$buildroot"build/" - rpmdir=$buildroot"packages/" - nssrctree=$buildroot"src/" - shift - ;; - - -arch) - shift - arch=$1 - shift - ;; - - -src) - shift - nssrctree=$1 - shift - ;; - - -prefix) - shift - prefix=$1 - shift - ;; - - -release) - release="1" - shift - ;; - - -dest) - shift - userfs=$1 - shift - ;; - - -optflags) - shift - optflags=$1 - shift - ;; - - -with-nsfb) - withnsfb="1" - shift - ;; - - -cross ) - cross="1" - shift - ;; - - -nsonly ) - nsonly="1" - shift - ;; - - -clean ) - cleanup="make clean && make distclean" - shift - ;; - - -dry ) - dry="1" - shift - ;; - - *) echo "Option [$1] not one of [-buildroot,-arch,-src,-prefix,-dest,-optflags,-with-nsfb]"; - exit;; - esac -done - - -if [ -d "$buildroot" ] -then - echo "Buildroot: $buildroot" -else - echo "Invalid buildroot directory ("$buildroot") !" - echo "This script must know where it is located!" - echo "Either use buildroot option or start from directory where the script is located." - exit 0 -fi - -if [ "$release" = "0" ] -then -libparserutils_version="" -libwapcaplet_version="" -hubbub_version="" -libnsgif_version="" -libnsbmp_version="" -libnsfb_version="" -libcss_version="" -fi - -if [ "$nssrctree" = "./" ] -then - nssrctree=`pwd` -fi - - - -#testarch: -archok=0 -if [ "$arch" = "68000" ] -then - archok=1 -fi -if [ "$arch" = "68020" ] -then - archok=1 -fi -if [ "$arch" = "68020-60" ] -then - archok=1 - openssltarget="m680x0-mint" -fi -if [ "$arch" = "5475" ] -then - archok=1 - openssltarget="cf-mint" -fi - -if [ "$archok" = "0" ] -then - echo "Invalid arch:"$arch" valid: 68000,68020,68020-69,5475" - exit 0 -fi - -if [ "$cross" = "1" ] -then - echo "enabling cross compiler mode" - export CC="m68k-atari-mint-gcc" - export LD="m68k-atari-mint-ld" - export AR="m68k-atari-mint-ar" - export RANLIB="m68k-atari-mint-ranlib" - export CPP="m68k-atari-mint-cpp" - compiler="m68k-atari-mint-gcc" -fi - - -# handle arch specific settings here. - -if [ "$arch" = "68000" ] -then - archlibdir=$userfs$prefix"/lib" - archdir="" -else - archlibdir=$userfs$prefix"/lib/m"$arch - archdir="m"$arch -fi - -if [ "$arch" = "5475" ] -then - machineflag="cpu="$arch -else - machineflag=$arch -fi - - -echo "machine: " $machineflag -incdir="-I$userfs$prefix/include" -CFLAGS_ORG="-m$machineflag $optflags $profileflags $incdir" -LDLAGS_ORG="-m$machineflag $profileflags" -CFLAGS="$CFLAGS_ORG" -LDFLAGS="$LDFLAGS_ORG" -export CFLAGS_ORG -export LDLAGS_ORG -export CFLAGS -export LDFLAGS - -echo "Build root: "$buildroot -echo "Netsurf sources: "$nssrctree -echo "Build directory: "$builddir -echo "Patches: "$patchdir -echo "Libdir: "$archlibdir -echo "Dest: "$userfs -echo "Prefix: "$prefix -echo "Compiler: "$compiler -echo "CFLAGS: "$CFLAGS -echo "PKG_CONFIG_PATH=$archlibdir/pkgconfig" -echo "PKG_CONFIG_LIBDIR=$archlibdir/pkgconfig" -echo "PKG_CONFIG_SYSROOT_DIR=$userfs" -echo "Dry: " $dry - - -#echo "Installing RPMs:" -#rpm -i $rpmdir""$opensslpkg - -#cd $buildroot -#exit 0 - - -# configure flags for curl, this actually saves 30kb in the lib and about 100k in the final executable -#./configure --disable-debug --enable-optimize --disable-ldap --disable-ldaps --disable-rtsp --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-manual -- disable-sspi --target="m"$arch - -# freetype configured for winfnt, truetype, raster (not smooth) -# saves around 160kb in the lib. - -if [ "$dry" = "1" ] -then -echo "export CFLAGS=$CFLAGS" -echo "export PKG_CONFIG_PATH=$archlibdir/pkgconfig" -echo "export PKG_CONFIG_LIBDIR=$archlibdir/pkgconfig" -echo "export PKG_CONFIG_SYSROOT_DIR=$userfs" -exit 0 -fi - -echo "creating staging directory" -mkdir "$userfs" -mkdir "$userfs$prefix" -mkdir "$userfs$prefix/include" -mkdir "$archlibdir" -mkdir "$archlibdir/pkgconfig" - - -export PKG_CONFIG_PATH="$archlibdir/pkgconfig" -export PKG_CONFIG_LIBDIR="$archlibdir/pkgconfig" -export PKG_CONFIG_SYSROOT_DIR="$userfs" - -echo "Building Libraries..." -cd $nssrctree - -#start test -if [ "$nsonly" = "0" ] -then - -echo "compiling Hermes..." -cd $libhermespkg -$cleanup -./configure --disable-x86asm --disable-debug --host="m68k-atari-mint" --prefix="$userfs$prefix" -make install -cd .. - -echo "compiling iconv..." -cd $libiconvpkg -$cleanup -./configure --enable-static \ - --host="m68k-atari-mint"\ - --prefix="$prefix"\ - --exec-prefix="$prefix"\ - --enable-extra-encodings\ - lt_cv_sys_max_cmd_len=65536 -make install DESTDIR=$destdir PREFIX=$prefix -cd .. - - -cd $libzlibpkg -$cleanup -if [ "$cross" = "1" ] -then - ./configure --prefix=$prefix --static -else - ./configure --prefix=$prefix --static -fi -make -# there is an error within make instal, copy headers manually. -install -m644 zlib.h "$userfs$prefix/include/zlib.h" -install -m644 zconf.h "$userfs$prefix/include/zconf.h" -install -m644 zutil.h "$userfs$prefix/include/zutil.h" -make install DESTDIR=$userfs PREFIX="$prefix" -cd .. - -pwd -cd $libfreetypepkg -$cleanup -if [ "$cross" = "1" ] -then -./configure --prefix="$prefix" \ - --host="m68k-atari-mint" \ - CFLAGS="$CFLAGS_ORG" -make -make install DESTDIR=$userfs -else -./configure --prefix="$userfs$prefix" --host="m68k-atari-mint" --target="m$arch" CFLAGS="$CFLAGS_ORG" -make -make install DESTDIR=$userfs -fi - -cd .. - - -cd $libopensslpkg -$cleanup -if [ "$cross" = "1" ] -then -./Configure $openssltarget --prefix="$prefix" --install-prefix="$userfs" -else -./Configure $openssltarget --prefix="$prefix" --install-prefix="$userfs" -fi -make -make rehash -make install -cd .. - -# FIXME: build c-ares here, if you want to - -cd $libcurlpkg -$cleanup -/configure\ - --prefix="$prefix" \ - --libdir=$prefix"/lib/$archdir"\ - --host="m68k-atari-mint"\ - --program-suffix=".ttp"\ - --with-random="/dev/urandom"\ - --enable-static\ - --enable-optimize\ - --enable-warnings\ - --enable-http\ - --enable-gopher\ - --enable-nonblocking\ - --enable-cookies\ - --disable-libtool-lock\ - --disable-verbose\ - --disable-shared\ - --disable-dependency-tracking\ - --disable-manual\ - --disable-curldebug\ - --disable-debug\ - --disable-ipv6\ - --disable-largefile\ - --disable-thread\ - --disable-threaded-resolver\ - --disable-telnet\ - --disable-tftp\ - --disable-dict\ - --disable-pop3\ - --disable-imap\ - --disable-smtp\ - --disable-ldaps\ - --disable-ldap\ - --disable-rtsp\ - --disable-sspi\ - --disable-rtsp\ - --without-polarssl\ - --without-cyassl\ - --without-nss\ - --without-libssh2\ - --without-librtmp\ - --without-libidn\ - --without-gnutls -# --with-ares="/usr/m68k-atari-mint/lib/"$archdir\ -# --enable-ares - -make CFLAGS="$CFLAGS_ORG" -make install DESTDIR="$userfs" -cd .. - -cd $libjpegpkg -./configure --enable-static --prefix="$userfs$prefix" --host="m68k-atari-mint" -make install -cd .. - -cd $libpngpkg -$cleanup -if [ "$cross" = "1" ] -then - ./configure --prefix=$prefix --host=m68k-atari-mint -else - ./configure --prefix=$prefix -fi - -make -make install DESTDIR="$userfs" -cd .. - -# we only need header files of ldg... -#cd $libldgpkg -#cp ./include/ldg.h "$userfs$prefix/include" -#cd .. - -cd windom -cd src -rm ../lib/gcc/libwindom.a -$cleanup -export M68K_ATARI_MINT_CFLAGS="$CFLAGS" -echo $M68K_ATARI_MINT_CFLAGS -echo "dest:" $userfs$prefix -if [ "$cross" = "1" ] -then -make cross -cp ../lib/gcc/libwindom.a "$userfs$prefix/lib" -cp ../include/* "$userfs$prefix/include/" -R -else -make -f gcc.mak -cp ./lib/gcc/libwindom.a "$userfs$prefix/lib" -cp ./include/* "$userfs$prefix/include/" -R -fi -cd ../.. - -fi # END OF TEST - -# set TARGET, so that make clean and build use the same directory. -export TARGET="freemint" - -echo "compiling libparserutils..." -cd libparserutils/$libparserutils_version -export CFLAGS="$CFLAGS_ORG -DWITH_ICONV_FILTER" -$cleanup -if [ "$cross" = "1" ] -then - make TARGET="freemint" - make install DESTDIR="$userfs" PREFIX="$prefix" TARGET="freemint" -else -# make install DESTDIR="$userfs" PREFIX="$prefix" - make install DESTDIR="$archlibdir" PREFIX="$prefix" -fi -cd $nssrctree -export CFLAGS="$CFLAGS_ORG" - - -echo "compiling libwapcaplet..." -cd libwapcaplet/$libwapcaplet_version || exit 1 -$cleanup -if [ "$cross" = "1" ] -then - make install DESTDIR=$userfs PREFIX=$prefix TARGET="freemint" - #make install DESTDIR="$userfs/$archdir" TARGET="freemint" - #PREFIX=$prefix TARGET="freemint" -else - make install DESTDIR=$userfs PREFIX=$prefix - #make install DESTDIR="$archlibdir" PREFIX=$prefix -fi -cd $nssrctree - -cd libcss/$libcss_version -$cleanup -if [ "$cross" = "1" ] -then - make install DESTDIR=$userfs PREFIX=$prefix TARGET="freemint" -# make install DESTDIR="$archlibdir" TARGET="freemint" -#PREFIX=$prefix TARGET="freemint" -else - make install DESTDIR=$userfs PREFIX=$prefix -# make install DESTDIR="$archlibdir" PREFIX=$prefix -fi -cd $nssrctree - -echo "compiling hubbub..." -pwd -cd hubbub/$hubbub_version || exit 1 -$cleanup -if [ "$cross" = "1" ] -then - make install DESTDIR=$userfs PREFIX=$prefix TARGET="freemint" -else - make install DESTDIR=$userfs PREFIX=$prefix -fi -cd $nssrctree - - -echo "compiling libnsgif..." -cd libnsgif/$libnsgif_version || exit 1 -$cleanup -if [ "$cross" = "1" ] -then - make install DESTDIR=$userfs PREFIX=$prefix TARGET="freemint" -else - make install DESTDIR=$userfs PREFIX=$prefix -fi -cd $nssrctree - -echo "compiling libnsbmp..." -cd libnsbmp/$libnsbmp_version || exit 1 -$cleanup -if [ "$cross" = "1" ] -then - make install DESTDIR=$userfs PREFIX=$prefix TARGET="freemint" -else - make install DESTDIR=$userfs PREFIX=$prefix -fi -cd $nssrctree - - -if [ "$withnsfb" = "1" ] -then - echo "compiling libnsfb..." - cd libnsfb/$libnsfb_version || exit 1 - $cleanup - if [ "$cross" = "1" ] - then - make install DESTDIR=$userfs PREFIX=$prefix TARGET="freemint" - else - make install DESTDIR=$userfs PREFIX=$prefix - fi - cd $nssrctree -else - echo "libnsfb skipped" -fi - - -if [ "$arch" = "68000" ] -then - echo "No library relocation needed!" -else - echo "Relocation Libraries to :" - echo $archlibdir - srclibdir=$userfs$prefix"/lib/" - srcpkgdir=$userfs$prefix"/lib/pkgconfig" - mkdir $archlibdir - rm $archlib/*.a - mv $srclibdir*.a $archlibdir/ -v - mv $srcpkgdir $archlibdir -v -fi - -echo "please add symlink to freetype2/freetype within /usr/m68k-atari-mint/include" -exit 0 diff --git a/atari/scripts/mkpkg.sh b/atari/scripts/mkpkg.sh deleted file mode 100755 index 419e6999f..000000000 --- a/atari/scripts/mkpkg.sh +++ /dev/null @@ -1,234 +0,0 @@ -#!/bin/bash - -# this is an small build script to create an package for nsgem -# invoke: mkpkg.sh [-s,-d,-8,-fonts] -# -# Parameters: -# -# -8 -# Description: The package will be build for 8.3 filesystems -# This also defines the -fonts parameter -# -# -fonts -# Description: The package will include the DejaVu fonts package -# ( 8.3 compatible names ) -# -# -fpath -# Description: Set path to dejavu Fonts -# -# -s (srcpath) -# Description: use it like: -s "path to netsurf root" to configure from which -# directory the package files are taken. -# The Path must have trailing slash! -# -# -d (dstpath) -# Description: use it like: -d "path to dir where the package will be placed" -# to configure the output path of this script. -# The path mus have trailing slash! -# - -# config variable, set default values -src="/usr/src/netsurf-2.9/release/netsurf/2.9/" -dst="/tmp/nspkg/" -shortfs=0 -inc_short_fonts=0 -font_src="/usr/share/fonts/truetype/ttf-dejavu/" -framebuffer=0 - -while [ "$1" != "" ] # When there are arguments... -do # Process the next one - case $1 # Look at $1 - in - -8) - shortfs="1" - shift - ;; - - -fonts) - inc_short_fonts="1" - shift - ;; - - -fpath) - shift - font_src=$1 - shift - ;; - - -d) - shift - dst=$1 - shift - ;; - - -s) - shift - src=$1 - shift - ;; - - *) echo "Option [$1] not one of [-8,-fonts,-d,-s,-fpath]"; - exit;; - - esac -done - -echo "Building from: "$src -echo "Building in: "$dst -echo "Building for short fs: "$shortfs - -if [ "$shortfs" = "1" ] -then - inc_short_fonts=1 -fi - -if [ -d "$font_src" ] -then - echo "Found fonts in $font_src" -else - echo "Error: TTF Fonts not found ($font_src)!" - exit 0 -fi - -set -o verbose -rm $dst -r -mkdir $dst -mkdir $dst"download" -mkdir $dst"res" -mkdir $dst"res/icons" -mkdir $dst"res/fonts" -touch $dst"res/cookies" -cp $src"atari/doc" $dst -R -cp $src"ns.prg" $dst -cp $src"ChangeLog" $dst -chmod +x $dst"ns.prg" -m68k-atari-mint-strip $dst"ns.prg" -m68k-atari-mint-stack -S 256k $dst"ns.prg" - -cp $src"atari/res/" $dst -rL -cp $src"!NetSurf/Resources/AdBlock,f79" $dst"res/adblock.css" -rL -cp $src"!NetSurf/Resources/CSS,f79" $dst"res/default.css" -rL -cp $src"!NetSurf/Resources/Quirks,f79" $dst"res/quirks.css" -rL -cp $src"!NetSurf/Resources/internal.css,f79" $dst"res/internal.css" -rL -cp $src"!NetSurf/Resources/SearchEngines" $dst"res/search" -rL -cp $src"!NetSurf/Resources/ca-bundle" $dst"res/cabundle" -rL -cp $src"!NetSurf/Resources/en/Messages" $dst"res/messages" -rL -cp $src"!NetSurf/Resources/Icons/content.png" $dst"res/icons/content.png" -rL -cp $src"!NetSurf/Resources/Icons/directory.png" $dst"res/icons/dir.png" -rL - -#remove uneeded files: -rm $dst"res/netsurf.rsm" -rm $dst"res/netsurf.rsh" -rm $dst"res/.svn" -r -rm $dst"res/icons/.svn" -r -rm $dst"res/fonts/.svn" -r -rm $dst"doc/.svn" -r -rm $dst"download/.svn" -r - -if [ "$inc_short_fonts" = "1" ] -then - cp $font_src"DejaVuSans.ttf" $dst"res/fonts/ss.ttf" - cp $font_src"DejaVuSans-Bold.ttf" $dst"res/fonts/ssb.ttf" - cp $font_src"DejaVuSans-Oblique.ttf" $dst"res/fonts/ssi.ttf" - cp $font_src"DejaVuSans-BoldOblique.ttf" $dst"res/fonts/ssib.ttf" - cp $font_src"DejaVuSansMono.ttf" $dst"res/fonts/mono.ttf" - cp $font_src"DejaVuSansMono-Bold.ttf" $dst"res/fonts/monob.ttf" - cp $font_src"DejaVuSansMono-Oblique.ttf" $dst"res/fonts/cursive.ttf" - cp $font_src"DejaVuSerif.ttf" $dst"res/fonts/s.ttf" - cp $font_src"DejaVuSerif-Bold.ttf" $dst"res/fonts/sb.ttf" - cp $font_src"DejaVuSerifCondensed-Bold.ttf" $dst"res/fonts/fantasy.ttf" -fi - -#create an simple startup script: -if [ "$framebuffer" = "1" ] -then -echo "NETSURFRES=./res/ -export NETSURFRES -./nsfb.prg -v file:///f/" > $dst"ns.sh" -chmod +x $dst"ns.sh" -fi - -echo " -atari_screen_driver:vdi -# select font driver, available values: freetype, internal -atari_font_driver:freetype -atari_transparency:1 -atari_realtime_move:1 -# uncomment the following to show source within editor: -#atari_editor:/path/to/editor.app - -# url to start netsurf with ( and new windows ) -homepage_url:file://./res/blank - -#configure css font settings: -font_size:130 -font_min_size:120 - -# 20 MB Cache as default: -memory_cache_size:2048512 - -# this actually hides advertisements, it still generates network traffic: -block_advertisements:0 - -#network configuration: -send_referer:1 -http_proxy:0 -http_proxy_host: -http_proxy_port:8123 -http_proxy_auth:0 -http_proxy_auth_user: -http_proxy_auth_pass: -suppress_curl_debug:1 - -# animation configuration ( GIF ): -minimum_gif_delay:50 -animate_images:1 - -foreground_images:1 -background_images:1 - - -# path configuration -ca_bundle:./res/cabundle -ca_path:./res/certs -cookie_file:./res/cookies -url_file:./res/url.db -tree_icons_path:./res/icons -downloads_path:./download -hotlist_file:./res/hotlist - -# enable reflow for interactive content and during fetch: -incremental_reflow:1 -# reformat time during fetch: -min_reflow_period:2500 -core_select_menu:1 -max_fetchers:3 -max_fetchers_per_host:2 -max_cached_fetch_handles:5 - -# allow target=_blank (link opens in new window): -target_blank:1 - -# options nowhere used currently follow: - -# suppres images when exporting pages (to PDF): -# suppress_images:0 -# turn off backgrounds for printed content: -#remove_backgrounds:0 -# smooth resizing: -#render_resample:1 -# enable loosening for printed content: -#enable_loosening:1 -# configure disc cache ( currently not implemented ) -#option_disc_cache_age:28 -#configure urldb (url search): -#expire_url:28 -#hover_urls:1 -" > $dst"Choices" - -cd $dst -tar cvf - ./* | gzip -9 -c > netsurf.tar.gz -zip netsurf.zip -9 -r ./ -x netsurf.tar.gz - -echo -exit 0 diff --git a/atari/settings.c b/atari/settings.c index b16e274a8..fa835bfbf 100644 --- a/atari/settings.c +++ b/atari/settings.c @@ -91,7 +91,7 @@ static const char *gui_timeouts[] = { #define INPUT_PROXY_PORT_MAX_LEN 5 #define INPUT_MIN_REFLOW_PERIOD_MAX_LEN 4 #define LABEL_FONT_RENDERER_MAX_LEN 8 -#define LABEL_PATH_MAX_LEN 43 +#define LABEL_PATH_MAX_LEN 40 #define LABEL_ICONSET_MAX_LEN 8 #define INPUT_TOOLBAR_COLOR_MAX_LEN 6 @@ -322,6 +322,79 @@ static void display_settings(void) toggle_objects(); } +static bool handle_filesystem_select_button(short rsc_bt) +{ + bool require_path = false; + bool is_folder = false; + short rsc_te = 0; // The textarea that is bound to the button + const char * title = ""; + const char * path = NULL; + + // TODO: localize String: + switch (rsc_bt) { + + + case SETTINGS_BT_SEL_DOWNLOAD_DIR: + title = "Select Download Directory:"; + rsc_te = SETTINGS_EDIT_DOWNLOAD_PATH; + require_path = true; + break; + + case SETTINGS_BT_SEL_HOTLIST: + title = "Select Hotlist File:"; + rsc_te = SETTINGS_EDIT_HOTLIST_FILE; + break; + + case SETTINGS_BT_SEL_CA_BUNDLE: + title = "Select CA Bundle File:"; + rsc_te = SETTINGS_EDIT_CA_BUNDLE; + break; + + case SETTINGS_BT_SEL_CA_CERTS: + title = "Select Certs Directory:"; + rsc_te = SETTINGS_EDIT_CA_CERTS_PATH; + require_path = true; + break; + + case SETTINGS_BT_SEL_EDITOR: + title = "Select Editor Application:"; + rsc_te = SETTINGS_EDIT_EDITOR; + break; + + default: + break; + }; + + assert(rsc_te != 0); + + if (require_path == false) { + path = file_select(title, ""); + if (path != NULL) { + gemtk_obj_set_str_safe(dlgtree, rsc_te, path); + } + } + else { + do { + /* display file selector: */ + path = file_select(title, ""); + if (path) { + is_folder = is_dir(path); + } + if ((is_folder == false) && (path != NULL)) { + gemtk_msg_box_show(GEMTK_MSG_BOX_ALERT, "Folder Required!"); + } + } while ((is_folder == false) && (path != NULL)); + + if ((is_folder == true) && (path != NULL)) { + gemtk_obj_set_str_safe(dlgtree, rsc_te, path); + } + } + + OBJ_UNCHECK(rsc_bt); + OBJ_REDRAW(rsc_bt); + OBJ_REDRAW(rsc_te); +} + static void form_event(int index, int external) { char spare[255]; @@ -486,28 +559,14 @@ static void form_event(int index, int external) OBJ_REDRAW(SETTINGS_BT_GUI_TOUT); break; - /* - case SETTINGS_INPUT_TOOLBAR_BGCOLOR: - objc_offset( FORM(win), SETTINGS_INPUT_TOOLBAR_BGCOLOR, &x, &y ); - choice = color_popup(x, y, tmp_option_atari_toolbar_bg); - snprintf( spare, 255, "%06x", choice ); - tmp_option_atari_toolbar_bg = choice; - ObjcStrCpy( dlgtree, SETTINGS_INPUT_TOOLBAR_BGCOLOR, - spare ); - is_button = true; - OBJ_REDRAW(SETTINGS_INPUT_TOOLBAR_BGCOLOR); - break; - */ - /* - case SETTINGS_BT_TOOLBAR_ICONSET: - objc_offset( FORM(win), SETTINGS_BT_TOOLBAR_ICONSET, &x, &y ); - tmp = toolbar_iconset_popup(x,y); - if( tmp != NULL ){ - ObjcStrCpy( dlgtree, SETTINGS_BT_TOOLBAR_ICONSET, tmp ); - } - is_button = true; - break; - */ + case SETTINGS_BT_SEL_DOWNLOAD_DIR: + case SETTINGS_BT_SEL_HOTLIST:
+ case SETTINGS_BT_SEL_CA_BUNDLE:
+ case SETTINGS_BT_SEL_CA_CERTS:
+ case SETTINGS_BT_SEL_EDITOR: + handle_filesystem_select_button(index); + break; + case SETTINGS_INC_MEM_CACHE: case SETTINGS_DEC_MEM_CACHE: if( index == SETTINGS_DEC_MEM_CACHE ) diff --git a/atari/toolbar.c b/atari/toolbar.c index 9a3412ebd..fd9051dd9 100644 --- a/atari/toolbar.c +++ b/atari/toolbar.c @@ -96,6 +96,7 @@ static bool init = false; static int area_navigation_height = 0; static int area_search_height = 0; static int area_full_height = 0; +static float toolbar_url_scale = 1.0; static plot_font_style_t font_style_url = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
@@ -142,18 +143,6 @@ static struct s_tb_button tb_buttons[] = {0,0}, 0, 0, 0, {0,0,0,0}
}, - {
- TOOLBAR_BT_FAVORITE,
- toolbar_favorite_click,
- {0,0}, - 0, 0, 0, {0,0,0,0}
- }, - {
- TOOLBAR_BT_CRYPTO,
- toolbar_crypto_click,
- {0,0}, - 0, 0, 0, {0,0,0,0}
- },
{ 0, 0, {0,0}, 0, -1, 0, {0,0,0,0}}
}; @@ -418,22 +407,6 @@ static void toolbar_reflow(struct s_toolbar *tb) throbber_form[tb->throbber.index].ob_x = offx; throbber_form[tb->throbber.index].ob_y = offy; - /*throbber_form[tb->throbber.index].ob_x = tb->area.g_x - + tb->form[TOOLBAR_AREA_RIGHT].ob_x - + tb->form[TOOLBAR_THROBBER_AREA].ob_x;*/ - -/* - throbber_form[tb->throbber.index].ob_x = tb->area.g_x - + tb->form[TOOLBAR_AREA_RIGHT].ob_x - + tb->form[TOOLBAR_THROBBER_AREA].ob_x - + ((tb->form[TOOLBAR_THROBBER_AREA].ob_width - - throbber_form[tb->throbber.index].ob_width) >> 1); - - throbber_form[tb->throbber.index].ob_y = tb->area.g_y - + ((tb->form[TOOLBAR_THROBBER_AREA].ob_height - - throbber_form[tb->throbber.index].ob_height) >> 1); - */ - // align the search button: tb->form[TOOLBAR_SEARCH_ALIGN_RIGHT].ob_x = tb->area.g_w - tb->form[TOOLBAR_SEARCH_ALIGN_RIGHT].ob_width; @@ -454,6 +427,7 @@ static void toolbar_reflow(struct s_toolbar *tb) void toolbar_redraw(struct s_toolbar *tb, GRECT *clip) { GRECT area, area_ro; + float old_scale; if (tb->attached == false) { return; @@ -483,7 +457,10 @@ void toolbar_redraw(struct s_toolbar *tb, GRECT *clip) //dbg_rect("tb textarea clip: ", &r); // TODO: let this be handled by an userdef object redraw function: /* Redraw the url input: */ - textarea_redraw(tb->url.textarea, 0, 0, 0xffffff, 1.0, &r, &toolbar_rdrw_ctx); + old_scale = plot_set_scale(toolbar_url_scale); + textarea_redraw(tb->url.textarea, 0, 0, 0xffffff, 1.0, &r, + &toolbar_rdrw_ctx); + plot_set_scale(old_scale); } } @@ -546,46 +523,6 @@ void toolbar_update_buttons(struct s_toolbar *tb, struct browser_window *bw, } } - if (button == TOOLBAR_BT_FAVORITE || button <= 0) { - bt = find_button(tb, TOOLBAR_BT_FAVORITE); - ns_url = toolbar_get_nsurl(tb); - if (ns_url != NULL) { - if (hotlist_has_url(ns_url)) { - bt->state = button_on; - tb->form[TOOLBAR_BT_FAVORITE].ob_state |= OS_SELECTED; - } - else { - bt->state = button_on; - tb->form[TOOLBAR_BT_FAVORITE].ob_state &= ~OS_SELECTED; - } - } - nsurl_unref(ns_url); - } - - if (button == TOOLBAR_BT_CRYPTO|| button <= 0) { - bt = find_button(tb, TOOLBAR_BT_CRYPTO); - ns_url = toolbar_get_nsurl(tb); - if (ns_url != NULL && - nsurl_get(ns_url, NSURL_SCHEME, &c_url, &c_url_len) == NSERROR_OK) { - if (strncasecmp("https", c_url, 5) == 0) { - bt->state = button_on; - // TODO: this check actually doesn't work - why? - if (urldb_get_cert_permissions(ns_url) == true) { - tb->form[TOOLBAR_BT_CRYPTO].ob_state &= ~OS_SELECTED; - } - else { - tb->form[TOOLBAR_BT_CRYPTO].ob_state |= OS_SELECTED; - } - } - else { - bt->state = button_off; - tb->form[TOOLBAR_BT_CRYPTO].ob_state &= ~OS_SELECTED; - } - nsurl_unref(ns_url); - free(c_url); - } - } - if (tb->attached) { if (button > 0) { toolbar_get_grect(tb, button, &area); @@ -1045,17 +982,19 @@ void toolbar_home_click(struct s_toolbar *tb) struct browser_window * bw; struct gui_window * gw; nsurl *url; + char * use_url = NULL; gw = window_get_active_gui_window(tb->owner); assert(gw != NULL); bw = gw->browser->bw; assert(bw != NULL); - if(nsoption_charp(homepage_url) == NULL){ - return; + use_url = nsoption_charp(homepage_url); + if(use_url == NULL || strlen(use_url) == 0){ + use_url = (char*)"about:welcome"; } - if (nsurl_create(nsoption_charp(homepage_url), &url) != NSERROR_OK) {
+ if (nsurl_create(use_url, &url) != NSERROR_OK) {
warn_user("NoMemory", 0);
} else {
browser_window_navigate(bw,
diff --git a/atari/treeview.c b/atari/treeview.c index fe92a02b3..8c7330640 100644 --- a/atari/treeview.c +++ b/atari/treeview.c @@ -38,6 +38,7 @@ #include "atari/misc.h" #include "atari/gemtk/gemtk.h" #include "atari/treeview.h" +#include "atari/res/netsurf.rsh" /** @@ -154,6 +155,40 @@ static void atari_treeview_dump_info(struct atari_treeview_window *tv, printf("Extent: x: %d, y: %d\n", tv->extent, tv->extent); } +static bool atari_treeview_is_iconified(struct core_window *cw){ + + struct atari_treeview_window *tv = (struct atari_treeview_window *)cw; + + return((gemtk_wm_get_state(tv->window)&GEMTK_WM_STATUS_ICONIFIED) != 0); +} + +static void atari_treeview_redraw_icon(struct core_window *cw, GRECT *clip) +{ + struct atari_treeview_window *tv = (struct atari_treeview_window *)cw; + GRECT visible, work; + OBJECT * tree = gemtk_obj_get_tree(ICONIFY); + short aesh = gemtk_wm_get_handle(tv->window); + + gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_WORK, &work); + + tree->ob_x = work.g_x; + tree->ob_y = work.g_y; + tree->ob_width = work.g_w; + tree->ob_height = work.g_h; + + wind_get_grect(aesh, WF_FIRSTXYWH, &visible); + while (visible.g_h > 0 && visible.g_w > 0) { + + if (rc_intersect(&work, &visible)) { + objc_draw(tree, 0, 8, visible.g_x, visible.g_y, visible.g_w, + visible.g_h); + } else { + //dbg_grect("redraw vis area outside", &visible); + } + + wind_get_grect(aesh, WF_NEXTXYWH, &visible); + } +} void atari_treeview_redraw(struct core_window *cw) { @@ -236,7 +271,7 @@ void atari_treeview_redraw(struct core_window *cw) clip.x1 = clip.x0 + todo[2]+(slid->x_pos*slid->x_unit_px); clip.y1 = clip.y0 + todo[3]+(slid->y_pos*slid->y_unit_px); - tv->io->draw(cw, -(slid->x_pos*slid->x_unit_px), + tv->io->draw(cw, -(slid->x_pos*slid->x_unit_px), -(slid->y_pos*slid->y_unit_px), &clip, &ctx); } @@ -262,140 +297,9 @@ void atari_treeview_redraw(struct core_window *cw) } } -// -//// TODO: rename to atari_treeview_draw_content -//void atari_treeview_redraw(struct atari_treeview_window *tv) -//{ -// static FONT_PLOTTER vdi_txt_plotter = NULL; -// FONT_PLOTTER old_txt_plotter; -// -// VdiHdl plot_vdi_handle = 0; -// long atari_plot_flags = 0; -// short pxy[4]; -// struct rect clip; -// -// /* TODO: do not use the global vdi handle for plot actions! */ -// /* TODO: implement getter/setter for the vdi handle */ -// -// if (tv != NULL && tv->is_open) { -// if( tv->redraw && ((atari_plot_flags & PLOT_FLAG_OFFSCREEN) == 0) ) { -// -// atari_treeview_dump_info(tv, "atari_treeview_redraw"); -// -// plot_vdi_handle = plot_get_vdi_handle(); -// long atari_plot_flags = plot_get_flags(); -// short todo[4]; -// GRECT work; -// short handle = gemtk_wm_get_handle(tv->window); -// struct gemtk_wm_scroll_info_s *slid; -// -///* -// if (vdi_txt_plotter == NULL) { -// int err = 0; -// VdiHdl vdih = plot_get_vdi_handle(); -// vdi_txt_plotter = new_font_plotter(vdih, (char*)"vdi", PLOT_FLAG_TRANS, -// &err); -// if(err) { -// const char * desc = plot_err_str(err); -// die(("Unable to load vdi font plotter %s -> %s", "vdi", desc )); -// } -// } -//*/ -// gemtk_wm_get_grect(tv->window, GEMTK_WM_AREA_CONTENT, &work); -// slid = gemtk_wm_get_scroll_info(tv->window); -// -// struct redraw_context ctx = { -// .interactive = true, -// .background_images = true, -// .plot = &atari_plotters -// }; -// plot_set_dimensions(work.g_x, work.g_y, work.g_w, work.g_h); -// if (plot_lock() == false) -// return; -///* -// if(vdi_txt_plotter != NULL){ -// old_txt_plotter = plot_get_text_plotter(); -// plot_set_text_plotter(vdi_txt_plotter); -// } -//*/ -// if( wind_get(handle, WF_FIRSTXYWH, -// &todo[0], &todo[1], &todo[2], &todo[3] )!=0 ) { -// while (todo[2] && todo[3]) { -// -// pxy[0] = todo[0]; -// pxy[1] = todo[1]; -// pxy[2] = todo[0] + todo[2]-1; -// pxy[3] = todo[1] + todo[3]-1; -// //vs_clip(plot_vdi_handle, 1, (short*)&pxy); -// -// /* convert screen to treeview coords: */ -// todo[0] = todo[0] - work.g_x + slid->x_pos*slid->x_unit_px; -// todo[1] = todo[1] - work.g_y + slid->y_pos*slid->y_unit_px; -// if( todo[0] < 0 ){ -// todo[2] = todo[2] + todo[0]; -// todo[0] = 0; -// } -// if( todo[1] < 0 ){ -// todo[3] = todo[3] + todo[1]; -// todo[1] = 0; -// } -// -// clip.x0 = todo[0]; -// clip.y0 = todo[1]; -// clip.x1 = clip.x0 + todo[2]; -// clip.y1 = clip.y0 + todo[3]; -// -// clip.x0 = todo[0]; -// clip.y0 = todo[1]; -// clip.x1 = clip.x0 + todo[2] ; -// clip.y1 = clip.y0 + todo[3] ; -///* -// clip.x0 = 0; -// clip.y0 = 0; -// clip.x1 = work.g_w;//MAX(tv->extent.x, work.g_w); -// clip.y1 = MAX(tv->extent.y, work.g_h)+200; -//*/ -// dbg_rect("treeview redraw clip", &clip); -// -// if (rc_intersect((GRECT *)&tv->rdw_area,(GRECT *)&todo)) { -// tv->io->draw(tv, -(slid->x_pos*slid->x_unit_px), -// -(slid->y_pos*slid->y_unit_px), &clip, -// &ctx); -// -// /*tv->io->draw(tv, 0,0, &clip, -// &ctx);*/ -// } -// //vs_clip(plot_vdi_handle, 0, (short*)&pxy); -// if (wind_get(handle, WF_NEXTXYWH, -// &todo[0], &todo[1], &todo[2], &todo[3])==0) { -// break; -// } -// } -// } else { -// /* -// plot_set_text_plotter(old_txt_plotter); -// */ -// plot_unlock(); -// return; -// } -// /* -// plot_set_text_plotter(old_txt_plotter); -// */ -// plot_unlock(); -// tv->redraw = false; -// tv->rdw_area.g_x = 65000; -// tv->rdw_area.g_y = 65000; -// tv->rdw_area.g_w = -1; -// tv->rdw_area.g_h = -1; -// } else { -// /* just copy stuff from the offscreen buffer */ -// } -// } -//} - /** - * GEMTK event sink + * GEMTK (netsurf's GEM toolkit) event sink * */ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) @@ -488,6 +392,11 @@ static void __CDECL on_redraw_event(struct core_window *cw, EVMULT_OUT *ev_out, return; } + if (atari_treeview_is_iconified(cw) == true) { + atari_treeview_redraw_icon(cw, &clip); + return; + } + /* make redraw coords relative to content viewport */ clip.g_x -= work.g_x; clip.g_y -= work.g_y; @@ -874,7 +783,14 @@ void atari_treeview_flush_redraws(void) while(tmp){ assert(tmp->is_open); if(tmp->redraw){ - atari_treeview_redraw((struct core_window *)tmp); + if (atari_treeview_is_iconified((struct core_window *)tmp)) { + /* No content redraw for iconified windows */ + /* because otherwise the icon draw function would */ + /* have to deal with plot canvas coords */ + continue; + } + + atari_treeview_redraw((struct core_window *)tmp); } tmp = tmp->next_open; } @@ -226,7 +226,7 @@ static nserror nscss_create_css_data(struct content_css_data *c, params.font = NULL; params.font_pw = NULL; - error = css_stylesheet_create(¶ms, ns_realloc, NULL, &c->sheet); + error = css_stylesheet_create(¶ms, &c->sheet); if (error != CSS_OK) { return NSERROR_NOMEM; } @@ -783,9 +783,7 @@ css_error nscss_register_import(struct content_css_data *c, params.font = NULL; params.font_pw = NULL; - error = css_stylesheet_create(¶ms, - ns_realloc, NULL, - &blank_import); + error = css_stylesheet_create(¶ms, &blank_import); if (error != CSS_OK) { return error; } diff --git a/css/select.c b/css/select.c index 4e82884df..ee0e7dacd 100644 --- a/css/select.c +++ b/css/select.c @@ -94,6 +94,10 @@ static css_error node_presentational_hint(void *pw, void *node, uint32_t property, css_hint *hint); static css_error ua_default_for_property(void *pw, uint32_t property, css_hint *hint); +static css_error set_libcss_node_data(void *pw, void *node, + void *libcss_node_data); +static css_error get_libcss_node_data(void *pw, void *node, + void **libcss_node_data); static int cmp_colour_name(const void *a, const void *b); static bool parse_named_colour(const char *data, css_color *result); @@ -104,9 +108,6 @@ static bool parse_number(const char *data, bool non_negative, bool real, static bool parse_font_size(const char *size, uint8_t *val, css_fixed *len, css_unit *unit); -static css_computed_style *nscss_get_initial_style(nscss_select_ctx *ctx, - css_allocator_fn, void *pw); - static bool isWhitespace(char c); static bool isHex(char c); static uint8_t charToHex(char c); @@ -151,7 +152,9 @@ static css_select_handler selection_handler = { node_is_lang, node_presentational_hint, ua_default_for_property, - nscss_compute_font_size + nscss_compute_font_size, + set_libcss_node_data, + get_libcss_node_data }; /** @@ -162,13 +165,10 @@ static css_select_handler selection_handler = { * \param charset Charset of data, or NULL if unknown * \param url URL of document containing data * \param allow_quirks True to permit CSS parsing quirks - * \param alloc Memory allocation function - * \param pw Private word for allocator * \return Pointer to stylesheet, or NULL on failure. */ css_stylesheet *nscss_create_inline_style(const uint8_t *data, size_t len, - const char *charset, const char *url, bool allow_quirks, - css_allocator_fn alloc, void *pw) + const char *charset, const char *url, bool allow_quirks) { css_stylesheet_params params; css_stylesheet *sheet; @@ -190,7 +190,7 @@ css_stylesheet *nscss_create_inline_style(const uint8_t *data, size_t len, params.font = NULL; params.font_pw = NULL; - error = css_stylesheet_create(¶ms, alloc, pw, &sheet); + error = css_stylesheet_create(¶ms, &sheet); if (error != CSS_OK) { LOG(("Failed creating sheet: %d", error)); return NULL; @@ -213,61 +213,47 @@ css_stylesheet *nscss_create_inline_style(const uint8_t *data, size_t len, return sheet; } -#ifdef PRINT_NODE_BLOOM_DETAILS -/* Count bits set in uint32_t */ -static int bits_set(uint32_t n) { - n = n - ((n >> 1) & 0x55555555); - n = (n & 0x33333333) + ((n >> 2) & 0x33333333); - n = (n + (n >> 4)) & 0x0f0f0f0f; - n = n + (n >> 8); - n = n + (n >> 16); - return n & 0x0000003f; -} - -/* Node bloom instrumentation ouput display. */ -static void print_node_bloom_details(css_bloom bloom[CSS_BLOOM_SIZE]) -{ - printf("Node bloom:\t"); - int total = 0, i; - int set[CSS_BLOOM_SIZE]; - for (i = 0; i < CSS_BLOOM_SIZE; i++) { - set[i] = bits_set(bloom[i]); - total += set[i]; - } - printf("bits set:"); - for (i = 0; i < CSS_BLOOM_SIZE; i++) { - printf(" %2i", set[i]); - } - printf(" (total:%4i of %i) saturation: %3i%%\n", total, - (32 * CSS_BLOOM_SIZE), - (100 * total) / (32 * CSS_BLOOM_SIZE)); -} -#endif - -/* Handler for libdom node user data - * We store our libcss selection bloom filter on the DOM node. */ +/* Handler for libcss_node_data, stored as libdom node user data */ static void nscss_dom_user_data_handler(dom_node_operation operation, dom_string *key, void *data, struct dom_node *src, struct dom_node *dst) { + css_error error; bool match; - if (lwc_string_isequal(corestring_dom_key_css_bloom, key, &match) != - lwc_error_ok || match == false || data == NULL) { + if (lwc_string_isequal(corestring_dom___ns_key_libcss_node_data, + key, &match) != lwc_error_ok || match == false || + data == NULL) { return; } switch (operation) { case DOM_NODE_CLONED: - case DOM_NODE_IMPORTED: + error = css_libcss_node_data_handler(&selection_handler, + CSS_NODE_CLONED, + NULL, src, dst, data); + if (error != CSS_OK) + LOG(("Failed to clone libcss_node_data.")); + break; + case DOM_NODE_RENAMED: + error = css_libcss_node_data_handler(&selection_handler, + CSS_NODE_MODIFIED, + NULL, src, NULL, data); + if (error != CSS_OK) + LOG(("Failed to update libcss_node_data.")); + break; + + case DOM_NODE_IMPORTED: case DOM_NODE_ADOPTED: - /* TODO: Do something about these. - * For now, just cautiously fall through to delete. - */ case DOM_NODE_DELETED: - free(data); + error = css_libcss_node_data_handler(&selection_handler, + CSS_NODE_DELETED, + NULL, src, NULL, data); + if (error != CSS_OK) + LOG(("Failed to delete libcss_node_data.")); break; + default: LOG(("User data operation not handled.")); assert(0); @@ -275,71 +261,75 @@ static void nscss_dom_user_data_handler(dom_node_operation operation, } /** - * Get a style selection results (partial computed styles) for an element + * Get style selection results for an element * * \param ctx CSS selection context * \param n Element to select for * \param media Permitted media types * \param inline_style Inline style associated with element, or NULL - * \param alloc Memory allocation function - * \param pw Private word for allocator - * \return Pointer to selection results (containing partial computed styles), + * \return Pointer to selection results (containing computed styles), * or NULL on failure */ css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n, - uint64_t media, const css_stylesheet *inline_style, - css_allocator_fn alloc, void *pw) + uint64_t media, const css_stylesheet *inline_style) { css_select_results *styles; - css_bloom *bloom = NULL; - dom_exception err; + int pseudo_element; css_error error; - /* Create the node's bloom */ - ctx->bloom = calloc(sizeof(css_bloom), CSS_BLOOM_SIZE); - if (ctx->bloom == NULL) { + /* Select style for node */ + error = css_select_style(ctx->ctx, n, media, inline_style, + &selection_handler, ctx, &styles); + + if (error != CSS_OK || styles == NULL) { + /* Failed selecting partial style -- bail out */ return NULL; } - /* Get parent node */ - ctx->parent = NULL; - dom_element_parent_node((struct dom_element *) n, &(ctx->parent)); - - /* Get parent node's bloom */ - if (ctx->parent != NULL) { - err = dom_node_get_user_data(ctx->parent, - corestring_dom_key_css_bloom, (void *) &bloom); - if (err != DOM_NO_ERR) { - dom_node_unref(ctx->parent); + /* If there's a parent style, compose with partial to obtain + * complete computed style for element */ + if (ctx->parent_style != NULL) { + /* Complete the computed style, by composing with the parent + * element's style */ + error = css_computed_style_compose(ctx->parent_style, + styles->styles[CSS_PSEUDO_ELEMENT_NONE], + nscss_compute_font_size, NULL, + styles->styles[CSS_PSEUDO_ELEMENT_NONE]); + if (error != CSS_OK) { + css_select_results_destroy(styles); return NULL; } - /* TODO: no bloom; walk up the tree to generate it. */ - assert(bloom != NULL); - } else { - /* No parents means empty bloom. Just use node bloom. */ - bloom = ctx->bloom; } - /* Select style for node */ - ctx->current = n; - error = css_select_style(ctx->ctx, n, bloom, media, inline_style, - &selection_handler, ctx, &styles); - if (error != CSS_OK) { - return NULL; + for (pseudo_element = CSS_PSEUDO_ELEMENT_NONE + 1; + pseudo_element < CSS_PSEUDO_ELEMENT_COUNT; + pseudo_element++) { + + if (pseudo_element == CSS_PSEUDO_ELEMENT_FIRST_LETTER || + pseudo_element == CSS_PSEUDO_ELEMENT_FIRST_LINE) + /* TODO: Handle first-line and first-letter pseudo + * element computed style completion */ + continue; + + if (styles->styles[pseudo_element] == NULL) + /* There were no rules concerning this pseudo element */ + continue; + + /* Complete the pseudo element's computed style, by composing + * with the base element's style */ + error = css_computed_style_compose( + styles->styles[CSS_PSEUDO_ELEMENT_NONE], + styles->styles[pseudo_element], + nscss_compute_font_size, NULL, + styles->styles[pseudo_element]); + if (error != CSS_OK) { + /* TODO: perhaps this shouldn't be quite so + * catastrophic? */ + css_select_results_destroy(styles); + return NULL; + } } - /* Merge parent bloom into node bloom */ - css_bloom_merge(bloom, ctx->bloom); - -#ifdef PRINT_NODE_BLOOM_DETAILS - print_node_bloom_details(ctx->bloom); -#endif - - /* Set this node's bloom */ - /* TODO: For now, this is LEAKED. Move it into libdom? */ - dom_node_set_user_data(n, corestring_dom_key_css_bloom, ctx->bloom, - nscss_dom_user_data_handler, (void *) &bloom); - return styles; } @@ -347,17 +337,14 @@ css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n, * Get an initial style * * \param ctx CSS selection context - * \param alloc Memory allocation function - * \param pw Private word for allocator * \return Pointer to partial computed style, or NULL on failure */ -css_computed_style *nscss_get_initial_style(nscss_select_ctx *ctx, - css_allocator_fn alloc, void *pw) +static css_computed_style *nscss_get_initial_style(nscss_select_ctx *ctx) { css_computed_style *style; css_error error; - error = css_computed_style_create(alloc, pw, &style); + error = css_computed_style_create(&style); if (error != CSS_OK) return NULL; @@ -375,18 +362,15 @@ css_computed_style *nscss_get_initial_style(nscss_select_ctx *ctx, * * \param ctx CSS selection context * \param parent Parent style to cascade inherited properties from - * \param alloc Memory allocation function - * \param pw Private word for allocator * \return Pointer to blank style, or NULL on failure */ css_computed_style *nscss_get_blank_style(nscss_select_ctx *ctx, - const css_computed_style *parent, - css_allocator_fn alloc, void *pw) + const css_computed_style *parent) { css_computed_style *partial; css_error error; - partial = nscss_get_initial_style(ctx, alloc, pw); + partial = nscss_get_initial_style(ctx); if (partial == NULL) return NULL; @@ -558,7 +542,6 @@ bool nscss_parse_colour(const char *data, css_color *result) */ css_error node_name(void *pw, void *node, css_qname *qname) { - nscss_select_ctx *ctx = (nscss_select_ctx *) pw; dom_node *n = node; dom_string *name; dom_exception err; @@ -575,21 +558,6 @@ css_error node_name(void *pw, void *node, css_qname *qname) return CSS_NOMEM; } - /* If 'n' is the element we are currently selecting for, - * add element name to the node's bloom. */ - if (n == ctx->current) { - /* Element names are case insensitive in HTML */ - if (qname->name->insensitive == NULL) { - if (lwc__intern_caseless_string(qname->name) != - lwc_error_ok) { - dom_string_unref(name); - return CSS_NOMEM; - } - } - css_bloom_add_hash(ctx->bloom, lwc_string_hash_value( - qname->name->insensitive)); - } - dom_string_unref(name); return CSS_OK; @@ -612,10 +580,8 @@ css_error node_name(void *pw, void *node, css_qname *qname) css_error node_classes(void *pw, void *node, lwc_string ***classes, uint32_t *n_classes) { - nscss_select_ctx *ctx = (nscss_select_ctx *) pw; dom_node *n = node; dom_exception err; - unsigned int i; *classes = NULL; *n_classes = 0; @@ -624,34 +590,7 @@ css_error node_classes(void *pw, void *node, if (err != DOM_NO_ERR) return CSS_NOMEM; - /* If 'n' is the element we are currently selecting for, - * add class names to the node's bloom. */ - if (n == ctx->current) { - lwc_string *s; - for (i = 0; i < (*n_classes); i++) { - s = (*classes)[i]; - /* TODO: remain case sensitive in standards mode */ - if (s->insensitive == NULL) { - if (lwc__intern_caseless_string(s) != - lwc_error_ok) { - goto error; - } - } - css_bloom_add_hash(ctx->bloom, - lwc_string_hash_value(s->insensitive)); - } - } - return CSS_OK; - -error: - - for (i = 0; i < (*n_classes); i++) - lwc_string_unref((*classes)[i]); - - free(*classes); - - return CSS_NOMEM; } /** @@ -665,7 +604,6 @@ error: */ css_error node_id(void *pw, void *node, lwc_string **id) { - nscss_select_ctx *ctx = (nscss_select_ctx *) pw; dom_node *n = node; dom_string *attr; dom_exception err; @@ -683,18 +621,6 @@ css_error node_id(void *pw, void *node, lwc_string **id) dom_string_unref(attr); return CSS_NOMEM; } - if (n == ctx->current) { - /* TODO: remain case sensitive in standards mode */ - if ((*id)->insensitive == NULL) { - if (lwc__intern_caseless_string(*id) != - lwc_error_ok) { - dom_string_unref(attr); - return CSS_NOMEM; - } - } - css_bloom_add_hash(ctx->bloom, lwc_string_hash_value( - (*id)->insensitive)); - } dom_string_unref(attr); } @@ -3192,6 +3118,42 @@ css_error ua_default_for_property(void *pw, uint32_t property, css_hint *hint) return CSS_OK; } +css_error set_libcss_node_data(void *pw, void *node, void *libcss_node_data) +{ + dom_node *n = node; + dom_exception err; + void *old_node_data; + + /* Set this node's node data */ + err = dom_node_set_user_data(n, + corestring_dom___ns_key_libcss_node_data, + libcss_node_data, nscss_dom_user_data_handler, + (void *) &old_node_data); + if (err != DOM_NO_ERR) { + return CSS_NOMEM; + } + + assert(old_node_data == NULL); + + return CSS_OK; +} + +css_error get_libcss_node_data(void *pw, void *node, void **libcss_node_data) +{ + dom_node *n = node; + dom_exception err; + + /* Get this node's node data */ + err = dom_node_get_user_data(n, + corestring_dom___ns_key_libcss_node_data, + libcss_node_data); + if (err != DOM_NO_ERR) { + return CSS_NOMEM; + } + + return CSS_OK; +} + /** * Mapping of colour name to CSS color */ diff --git a/css/select.h b/css/select.h index 764c43fb9..083fd91b6 100644 --- a/css/select.h +++ b/css/select.h @@ -37,23 +37,17 @@ typedef struct nscss_select_ctx bool quirks; nsurl *base_url; lwc_string *universal; - - dom_node *current; - dom_element *parent; - css_bloom *bloom; + const css_computed_style *parent_style; } nscss_select_ctx; css_stylesheet *nscss_create_inline_style(const uint8_t *data, size_t len, - const char *charset, const char *url, bool allow_quirks, - css_allocator_fn alloc, void *pw); + const char *charset, const char *url, bool allow_quirks); css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n, - uint64_t media, const css_stylesheet *inline_style, - css_allocator_fn alloc, void *pw); + uint64_t media, const css_stylesheet *inline_style); css_computed_style *nscss_get_blank_style(nscss_select_ctx *ctx, - const css_computed_style *parent, - css_allocator_fn alloc, void *pw); + const css_computed_style *parent); css_error nscss_compute_font_size(void *pw, const css_hint *parent, css_hint *size); diff --git a/render/box.c b/render/box.c index e955b4303..295308b5a 100644 --- a/render/box.c +++ b/render/box.c @@ -54,24 +54,6 @@ static bool box_nearest_text_box(struct box *box, int bx, int by, box->type == BOX_FLOAT_RIGHT) /** - * Allocator - * - * \param ptr Pointer to reallocate, or NULL for new allocation - * \param size Number of bytes requires - * \param pw Allocation context - * \return Pointer to allocated block, or NULL on failure - */ -void *box_style_alloc(void *ptr, size_t len, void *pw) -{ - if (len == 0) { - free(ptr); - return NULL; - } - - return realloc(ptr, len); -} - -/** * Destructor for box nodes which own styles * * \param b The box being destroyed. diff --git a/render/box.h b/render/box.h index 1ce26c28b..878ebc8d3 100644 --- a/render/box.h +++ b/render/box.h @@ -315,7 +315,6 @@ extern const char *TARGET_BLANK; -void *box_style_alloc(void *ptr, size_t len, void *pw); struct box * box_create(css_select_results *styles, css_computed_style *style, bool style_owned, nsurl *href, const char *target, const char *title, lwc_string *id, void *context); diff --git a/render/box_construct.c b/render/box_construct.c index 3251cc17f..a72f918f8 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -1425,8 +1425,6 @@ css_select_results *box_get_style(html_content *c, { dom_string *s; dom_exception err; - int pseudo_element; - css_error error; css_stylesheet *inline_style = NULL; css_select_results *styles; nscss_select_ctx ctx; @@ -1442,8 +1440,7 @@ css_select_results *box_get_style(html_content *c, dom_string_byte_length(s), c->encoding, nsurl_access(content_get_url(&c->base)), - c->quirks != DOM_DOCUMENT_QUIRKS_MODE_NONE, - box_style_alloc, NULL); + c->quirks != DOM_DOCUMENT_QUIRKS_MODE_NONE); dom_string_unref(s); @@ -1456,63 +1453,15 @@ css_select_results *box_get_style(html_content *c, ctx.quirks = (c->quirks == DOM_DOCUMENT_QUIRKS_MODE_FULL); ctx.base_url = c->base_url; ctx.universal = c->universal; + ctx.parent_style = parent_style; - /* Select partial style for element */ - styles = nscss_get_style(&ctx, n, CSS_MEDIA_SCREEN, inline_style, - box_style_alloc, NULL); + /* Select style for element */ + styles = nscss_get_style(&ctx, n, CSS_MEDIA_SCREEN, inline_style); /* No longer need inline style */ if (inline_style != NULL) css_stylesheet_destroy(inline_style); - /* Failed selecting partial style -- bail out */ - if (styles == NULL) - return NULL; - - /* If there's a parent style, compose with partial to obtain - * complete computed style for element */ - if (parent_style != NULL) { - /* Complete the computed style, by composing with the parent - * element's style */ - error = css_computed_style_compose(parent_style, - styles->styles[CSS_PSEUDO_ELEMENT_NONE], - nscss_compute_font_size, NULL, - styles->styles[CSS_PSEUDO_ELEMENT_NONE]); - if (error != CSS_OK) { - css_select_results_destroy(styles); - return NULL; - } - } - - for (pseudo_element = CSS_PSEUDO_ELEMENT_NONE + 1; - pseudo_element < CSS_PSEUDO_ELEMENT_COUNT; - pseudo_element++) { - - if (pseudo_element == CSS_PSEUDO_ELEMENT_FIRST_LETTER || - pseudo_element == CSS_PSEUDO_ELEMENT_FIRST_LINE) - /* TODO: Handle first-line and first-letter pseudo - * element computed style completion */ - continue; - - if (styles->styles[pseudo_element] == NULL) - /* There were no rules concerning this pseudo element */ - continue; - - /* Complete the pseudo element's computed style, by composing - * with the base element's style */ - error = css_computed_style_compose( - styles->styles[CSS_PSEUDO_ELEMENT_NONE], - styles->styles[pseudo_element], - nscss_compute_font_size, NULL, - styles->styles[pseudo_element]); - if (error != CSS_OK) { - /* TODO: perhaps this shouldn't be quite so - * catastrophic? */ - css_select_results_destroy(styles); - return NULL; - } - } - return styles; } diff --git a/render/box_normalise.c b/render/box_normalise.c index 42b20cbb7..5a4b6256a 100644 --- a/render/box_normalise.c +++ b/render/box_normalise.c @@ -156,8 +156,7 @@ bool box_normalise_block(struct box *block, html_content *c) ctx.base_url = c->base_url; ctx.universal = c->universal; - style = nscss_get_blank_style(&ctx, block->style, - box_style_alloc, NULL); + style = nscss_get_blank_style(&ctx, block->style); if (style == NULL) return false; @@ -258,8 +257,7 @@ bool box_normalise_table(struct box *table, html_content * c) ctx.base_url = c->base_url; ctx.universal = c->universal; - style = nscss_get_blank_style(&ctx, table->style, - box_style_alloc, NULL); + style = nscss_get_blank_style(&ctx, table->style); if (style == NULL) { free(col_info.spans); return false; @@ -345,8 +343,7 @@ bool box_normalise_table(struct box *table, html_content * c) ctx.base_url = c->base_url; ctx.universal = c->universal; - style = nscss_get_blank_style(&ctx, table->style, - box_style_alloc, NULL); + style = nscss_get_blank_style(&ctx, table->style); if (style == NULL) { free(col_info.spans); return false; @@ -361,8 +358,7 @@ bool box_normalise_table(struct box *table, html_content * c) } row_group->type = BOX_TABLE_ROW_GROUP; - style = nscss_get_blank_style(&ctx, row_group->style, - box_style_alloc, NULL); + style = nscss_get_blank_style(&ctx, row_group->style); if (style == NULL) { box_free(row_group); free(col_info.spans); @@ -482,8 +478,7 @@ bool box_normalise_table_spans(struct box *table, struct span_info *spans, ctx.universal = c->universal; style = nscss_get_blank_style(&ctx, - table_row->style, - box_style_alloc, NULL); + table_row->style); if (style == NULL) return false; @@ -591,8 +586,7 @@ bool box_normalise_table_row_group(struct box *row_group, ctx.base_url = c->base_url; ctx.universal = c->universal; - style = nscss_get_blank_style(&ctx, row_group->style, - box_style_alloc, NULL); + style = nscss_get_blank_style(&ctx, row_group->style); if (style == NULL) return false; @@ -666,8 +660,7 @@ bool box_normalise_table_row_group(struct box *row_group, ctx.base_url = c->base_url; ctx.universal = c->universal; - style = nscss_get_blank_style(&ctx, row_group->style, - box_style_alloc, NULL); + style = nscss_get_blank_style(&ctx, row_group->style); if (style == NULL) { return false; } @@ -736,8 +729,7 @@ bool box_normalise_table_row(struct box *row, ctx.base_url = c->base_url; ctx.universal = c->universal; - style = nscss_get_blank_style(&ctx, row->style, - box_style_alloc, NULL); + style = nscss_get_blank_style(&ctx, row->style); if (style == NULL) return false; diff --git a/render/html_css.c b/render/html_css.c index bf20dcf14..88c67697d 100644 --- a/render/html_css.c +++ b/render/html_css.c @@ -596,7 +596,7 @@ html_css_new_selection_context(html_content *c, css_select_ctx **ret_select_ctx) } /* Create selection context */ - css_ret = css_select_ctx_create(ns_realloc, c, &select_ctx); + css_ret = css_select_ctx_create(&select_ctx); if (css_ret != CSS_OK) { return css_error_to_nserror(css_ret); } diff --git a/render/textplain.c b/render/textplain.c index 10cf16a71..892e03e57 100644 --- a/render/textplain.c +++ b/render/textplain.c @@ -283,12 +283,11 @@ nserror textplain_create_internal(textplain_content *c, lwc_string *encoding) goto no_memory; error = parserutils_inputstream_create(lwc_string_data(encoding), 0, - textplain_charset_hack, ns_realloc, NULL, &stream); + textplain_charset_hack, &stream); if (error == PARSERUTILS_BADENCODING) { /* Fall back to Windows-1252 */ error = parserutils_inputstream_create("Windows-1252", 0, - textplain_charset_hack, ns_realloc, NULL, - &stream); + textplain_charset_hack, &stream); } if (error != PARSERUTILS_OK) { free(utf8_data); diff --git a/resources/FatMessages b/resources/FatMessages index 443485deb..2d74f3d6d 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -39,15 +39,15 @@ de.all.NetSurf:NetSurf fr.all.NetSurf:NetSurf it.all.NetSurf:NetSurf nl.all.NetSurf:NetSurf -en.all.NetSurfCopyright:Copyright © 2003 - 2013 The NetSurf Developers -de.all.NetSurfCopyright:Copyright © 2003 - 2013 The NetSurf Developers -fr.all.NetSurfCopyright:Copyright © 2003 - 2013 The NetSurf Developers -it.all.NetSurfCopyright:Copyright © 2003 - 2013 The NetSurf Developers -nl.all.NetSurfCopyright:Copyright © 2003 - 2013 The NetSurf Developers +en.all.NetSurfCopyright:Copyright © 2003 - 2014 The NetSurf Developers +de.all.NetSurfCopyright:Copyright © 2003 - 2014 The NetSurf Developers +fr.all.NetSurfCopyright:Copyright © 2003 - 2014 The NetSurf Developers +it.all.NetSurfCopyright:Copyright © 2003 - 2014 The NetSurf Developers +nl.all.NetSurfCopyright:Copyright © 2003 - 2014 The NetSurf Developers en.ami.NetSurfDesc:Small as a mouse, fast as a cheetah and available for free. NetSurf is a multi-platform web browser. de.ami.NetSurfDesc:Small as a mouse, fast as a cheetah and available for free. NetSurf is a multi-platform web browser. fr.ami.NetSurfDesc:Small as a mouse, fast as a cheetah and available for free. NetSurf is a multi-platform web browser. -it.ami.NetSurfDesc:Small as a mouse, fast as a cheetah and available for free. NetSurf is a multi-platform web browser. +it.ami.NetSurfDesc:Piccolo come un mouse, veloce come un ghepardo. NetSurf è un browser web opensource e multi-piattaforma. nl.ami.NetSurfDesc:Small as a mouse, fast as a cheetah and available for free. NetSurf is a multi-platform web browser. # Menus @@ -1159,7 +1159,7 @@ nl.all.TreeClear:Clear default en.all.TreeviewLabelTitle:Title de.all.TreeviewLabelTitle:Title fr.all.TreeviewLabelTitle:Title -it.all.TreeviewLabelTitle:Title +it.all.TreeviewLabelTitle:Titolo nl.all.TreeviewLabelTitle:Title en.all.TreeviewLabelURL:URL de.all.TreeviewLabelURL:URL @@ -1299,7 +1299,7 @@ nl.all.HotlistDefaultFolderName:Unsorted entries en.all.NewFolderName:New folder de.all.NewFolderName:New folder fr.all.NewFolderName:New folder -it.all.NewFolderName:New folder +it.all.NewFolderName:Nuova cartella nl.all.NewFolderName:New folder @@ -1308,7 +1308,7 @@ nl.all.NewFolderName:New folder en.all.NoTitle:<No title> de.all.NoTitle:<No title> fr.all.NoTitle:<No title> -it.all.NoTitle:<No title> +it.all.NoTitle:<Nessun titolo> nl.all.NoTitle:<No title> @@ -2944,7 +2944,7 @@ nl.all.HotlistSaveError:The hotlist was unable to be correctly saved. en.all.TreeLoadError:The tree was unable to be correctly loaded. de.all.TreeLoadError:The tree was unable to be correctly loaded. fr.all.TreeLoadError:The tree was unable to be correctly loaded. -it.all.TreeLoadError:L'albero non è stato caricato correttamente. +it.all.TreeLoadError:L'albero della directory non è stato caricato correttamente. nl.all.TreeLoadError:The tree was unable to be correctly loaded. en.all.NoDirError:%s is not a directory de.all.NoDirError:%s ist kein Verzeichnis. @@ -3051,6 +3051,11 @@ de.all.OverwriteFile:Eine Datei mit diesem Namen existiert bereits und würde ü fr.all.OverwriteFile:Un fichier portant ce nom existe déjà et serait perdu. it.all.OverwriteFile:Un file con questo nome è già esistente, continuare comporterà la sovrascrittura del file originale. nl.all.OverwriteFile:Een bestand met deze naam bestaat al en zal verloren gaan. +en.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist? +de.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist? +fr.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist? +it.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist? +nl.all.RemoveHotlist:Are you sure you wish to remove this address from the hotlist? # Page fetching # ============= @@ -3247,7 +3252,7 @@ nl.all.HTTP302:Found en.all.HTTP303:See other de.all.HTTP303:See other fr.all.HTTP303:Voir autre -it.all.HTTP303:Vedi altro +it.all.HTTP303:Mostra altro nl.all.HTTP303:See other en.all.HTTP304:Not modified de.all.HTTP304:Not modified @@ -3590,6 +3595,16 @@ de.all.DontReplace:Abbrechen fr.all.DontReplace:Ne pas remplacer le fichier it.all.DontReplace:Non sostituire nl.all.DontReplace:Bestand niet vervangen +en.all.Remove:Remove address +de.all.Remove:Remove address +rf.all.Remove:Remove address +it.all.Remove:Remove address +nl.all.Remove:Remove address +en.all.DontRemove:Don't remove +de.all.DontRemove:Don't remove +rf.all.DontRemove:Don't remove +it.all.DontRemove:Don't remove +nl.all.DontRemove:Don't remove en.all.obj:object de.all.obj:Objekt fr.all.obj:objet @@ -3696,6 +3711,16 @@ de.ro.HelpToolbar16:Das ist die Ladeaktivitätsanzeige.|MSie wird animiert, wenn fr.ro.HelpToolbar16:\Tle pulseur.|MIl s'anime lorsque cette \w est active. it.ro.HelpToolbar16:\Tthrobber animato durante le attività di rete nl.ro.HelpToolbar16:\Tthrobber.|MIt animates while this \w is active. +en.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available. +de.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available. +fr.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available. +it.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available. +nl.ro.HelpToolbarFav:\TFavicon: a small logo supplied by the current site, if available. +en.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist. +de.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist. +fr.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist. +it.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist. +nl.ro.HelpToolbarHot:\Thotlist indicator: if lit, the current address is in the hotlist.|M\Sto add the current address to the hotlist.|M\Ato remove the current address from the hotlist. en.ro.HelpStatus0:\Tstatus bar resizer.|MDrag to alter the size of the status bar. de.ro.HelpStatus0:Das ist die Begrenzung der Statusanzeige.|MKlicken und Ziehen verändert die Länge der Statusanzeige. @@ -4063,27 +4088,27 @@ nl.ro.HelpBrowserMenu4-5:\Rcontrol the default \w positioning. en.ro.HelpBrowserMenu4-5-0:\S make the current \w position the default. de.ro.HelpBrowserMenu4-5-0:Die Position des aktuellen Fensters wird als globaler Standardwert übernommen. Alle nachfolgend neu geöffneten Fenster werden an dieser Position plaziert. fr.ro.HelpBrowserMenu4-5-0:\Spromouvoir la position de fenêtre courante en celle par défault. -it.ro.HelpBrowserMenu4-5-0:\S imposta come predefinita la posizione corrente della finestra. +it.ro.HelpBrowserMenu4-5-0:\Simposta come predefinita la posizione corrente della finestra. nl.ro.HelpBrowserMenu4-5-0:\Sto make the current \w position the default. en.ro.HelpBrowserMenu4-5-1:\S toggle whether subsequent windows are staggered down the screen. de.ro.HelpBrowserMenu4-5-1:Neu geöffnete Fenster werden nicht alle an der Standardposition sondern zueinander leicht versetzt plaziert. fr.ro.HelpBrowserMenu4-5-1:\Sdécider si les fenêtres suivantes doivent être ouvertes en décalage à l'écran. -it.ro.HelpBrowserMenu4-5-1:\S imposta nel caso le finestre successive siano sfalsate rispetto alla parte bassa dello schermo. +it.ro.HelpBrowserMenu4-5-1:\Simposta nel caso le finestre successive siano sfalsate rispetto alla parte bassa dello schermo. nl.ro.HelpBrowserMenu4-5-1:\Sto toggle whether subsequent windows are staggered down the screen. en.ro.HelpBrowserMenu4-5-2:\S toggle whether child windows copy the size and position of their parent.|MWhen off, all new windows open in the default position. de.ro.HelpBrowserMenu4-5-2:Neue Fenster behalten die Größe des Fensters, aus dem heraus sie geöffnet werden, bei. fr.ro.HelpBrowserMenu4-5-2:\Sdécider si les fenêtres-filles doivent être ouvertes à la même taille que celle de leurs parents. -it.ro.HelpBrowserMenu4-5-2:\S alterna nel caso le finestre figlie seguano la dimensione ed il posizionamento di quelle genitrici.|MSe disattivato tutte le finestre verranno aperte nel posizionamento predefinito. +it.ro.HelpBrowserMenu4-5-2:\Salterna nel caso le finestre figlie seguano la dimensione ed il posizionamento di quelle genitrici.|MSe disattivato tutte le finestre verranno aperte nel posizionamento predefinito. nl.ro.HelpBrowserMenu4-5-2:\Sto toggle whether child windows copy the size and position of their parent.|MWhen off, all new windows open in the default position. en.ro.HelpBrowserMenu4-5-3:\S return to the default \w positioning. de.ro.HelpBrowserMenu4-5-3:Setzt die festgelegte Standardposition für Fenster auf einen in NetSurf voreingestellten Wert zurück. fr.ro.HelpBrowserMenu4-5-3:\Srevenir au positionnement de fenêtre par défaut. -it.ro.HelpBrowserMenu4-5-3:\S ritorna al posizionamento della finestra predefinito. +it.ro.HelpBrowserMenu4-5-3:\Sritorna al posizionamento della finestra predefinito. nl.ro.HelpBrowserMenu4-5-3:\Sto return to the default \w positioning. en.ro.HelpBrowserMenu5:\Raccess NetSurf's built in utilities.|MUtilities are tools such as the hotlist, history tree and various setup options. de.ro.HelpBrowserMenu5:Untermenü Werkzeuge.|MEnthält verschiedene nützliche Zusatz- und Sonderfunktionen. fr.ro.HelpBrowserMenu5:\Raccéder aux utilitaires intégrés à NetSurf.|MLes utilitaires sont des outils comme les favoris, l'historique arborescent et diverses options de configuration. -it.ro.HelpBrowserMenu5:\Raccesso a NetSurf attraverso le utilità .|MLe utilità sono strumenti simili ai segnalibri, gli alberi della cronologia e le altre opzioni di configurazione. +it.ro.HelpBrowserMenu5:\Raccedi a NetSurf attraverso le utilità .|MLe utilità sono strumenti simili ai segnalibri, gli alberi della cronologia e le altre opzioni di configurazione. nl.ro.HelpBrowserMenu5:\Rto access NetSurf's built in utilities.|MUtilities are tools such as the hotlist, history tree and various setup options. en.ro.HelpBrowserMenu5-0:\Rmanage the hotlist. de.ro.HelpBrowserMenu5-0:Verwaltung der Hotlist. @@ -4123,7 +4148,7 @@ nl.ro.HelpBrowserMenu5-2:\Rmanage your cookies. en.ro.HelpBrowserMenu5-2-0:\Sopen the cookie management \w. de.ro.HelpBrowserMenu5-2-0:Anklicken um die gespeicherten Cookies anzusehen und zu bearbeiten. fr.ro.HelpBrowserMenu5-2-0:\Souvrir la fenêtre de gestion des cookies. -it.ro.HelpBrowserMenu5-2-0:\Sapri ila finestra del gestore dei cookie +it.ro.HelpBrowserMenu5-2-0:\Sapri la finestra del gestore dei cookie nl.ro.HelpBrowserMenu5-2-0:\Sopen the cookie management \w. en.ro.HelpBrowserMenu6:\Rsee the help resources available. de.ro.HelpBrowserMenu6:Untermenü Hilfe.|MZeigt Informationen zu und über NetSurf. @@ -4259,7 +4284,7 @@ nl.ro.HelpScaleView10:\Schange the view to the scale you have chosen. en.ro.HelpSearch:Use this \w to search for text within the page. de.ro.HelpSearch:Dialogfenster zum Suchen von Text innerhalb der dargestellten Seite. fr.ro.HelpSearch:Utiliser cette fenêtre pour faire une recherche textuelle sur cette page. -it.ro.HelpSearch:Use this \w to search for text within the page. +it.ro.HelpSearch:Usa questa finestra per cercare un testo nella pagina. nl.ro.HelpSearch:Use this \w to search for text within the page. en.ro.HelpSearch0:Enter the search text. # matches any single character, * matches 0 or more characters. de.ro.HelpSearch0:Suchtext hier eingeben. # steht für exakt ein beliebiges Zeichen. * steht für 0 oder mehrere Zeichen. @@ -4392,7 +4417,7 @@ nl.ro.HelpHotlistMenu0-0-1:\Rcreate a new address. en.ro.HelpHotlistMenu0-1:\Rexport the hotlist as an HTML file. de.ro.HelpHotlistMenu0-1:Die gesamte Hotlist als HTML Datei speichern. fr.ro.HelpHotlistMenu0-1:\Rexporter les favoris en fichier HTML. -it.ro.HelpHotlistMenu0-1:\Rexport the hotlist as an HTML file. +it.ro.HelpHotlistMenu0-1:\Resporta i segnalibri come file HTML. nl.ro.HelpHotlistMenu0-1:\Rexport the hotlist as an HTML file. en.ro.HelpHotlistMenu0-2:\Rexpand items within the hotlist. de.ro.HelpHotlistMenu0-2:Öffnen von Verzeichnissen und Anzeigen von Zusatzinformationen. @@ -4402,7 +4427,7 @@ nl.ro.HelpHotlistMenu0-2:\Rexpand items within the hotlist. en.ro.HelpHotlistMenu0-2-0:\Sopen all directories and show all entry details. de.ro.HelpHotlistMenu0-2-0:Öffnet alle Verzeichnisse und zeigt zu Einträgen die Zusatzinformationen an. fr.ro.HelpHotlistMenu0-2-0:\Souvrir tous les répertoires et afficher tous les détails connus sur les entrées. -it.ro.HelpHotlistMenu0-2-0:\Sopen all directories and show all entry details. +it.ro.HelpHotlistMenu0-2-0:\Sapri tutte le directory e mostra in dettaglio tutte le immissioni. nl.ro.HelpHotlistMenu0-2-0:\Sopen all directories and show all entry details. en.ro.HelpHotlistMenu0-2-1:\Sopen all directories. de.ro.HelpHotlistMenu0-2-1:Öffnet alle Verzeichnisse. @@ -4462,12 +4487,12 @@ nl.ro.HelpHotlistMenu1-0:\Redit the current item. en.ro.HelpHotlistMenu1-1:\Slaunch the current selection. de.ro.HelpHotlistMenu1-1:Öffnet markierte Einträge in je einem neuen Browserfenster. fr.ro.HelpHotlistMenu1-1:\Slancer la sélection courante. -it.ro.HelpHotlistMenu1-1:\Slaunch the current selection. +it.ro.HelpHotlistMenu1-1:\Savvia la selezione corrente. nl.ro.HelpHotlistMenu1-1:\Slaunch the current selection. en.ro.HelpHotlistMenu1-2:\Sdelete the current selection from the hotlist. de.ro.HelpHotlistMenu1-2:Löscht markierte Elemente aus der Hotlist.|MAchtung: Verzeichnisse werden mit allen in ihnen enthaltenen Einträgen gelöscht. fr.ro.HelpHotlistMenu1-2:\Ssupprimer la sélection courante de la liste des favoris. -it.ro.HelpHotlistMenu1-2:\Sdelete the current selection from the hotlist. +it.ro.HelpHotlistMenu1-2:\Scancella dai segnalibri la selezione corrente. nl.ro.HelpHotlistMenu1-2:\Sdelete the current selection from the hotlist. en.ro.HelpHotlistMenu1-3:\Sreset statistics, such as visit count, for selected items. de.ro.HelpHotlistMenu1-3:Setzt für die markierten Einträge die Statistik, z.B. Anzahl der Seitenbesuche, zurück. @@ -4477,18 +4502,18 @@ nl.ro.HelpHotlistMenu1-3:\Sreset statistics, such as visit count, for selected i en.ro.HelpHotlistMenu2:\Sselect all the items in the hotlist. de.ro.HelpHotlistMenu2:Markiert alle Elemente der Hotlist. fr.ro.HelpHotlistMenu2:\Ssélectionner tous les items de la liste des favoris. -it.ro.HelpHotlistMenu2:\Sselect all the items in the hotlist. +it.ro.HelpHotlistMenu2:\Sseleziona tutti gli elementi dei segnalibri. nl.ro.HelpHotlistMenu2:\Sselect all the items in the hotlist. en.ro.HelpHotlistMenu3:\Sdeselect all selected items. de.ro.HelpHotlistMenu3:Deselektiert alle markierten Elemente. fr.ro.HelpHotlistMenu3:\Sdésélectionner la sélection courante. -it.ro.HelpHotlistMenu3:\Sdeselect all selected items. +it.ro.HelpHotlistMenu3:\Sdeseleziona tutti gli oggetti selezionati. nl.ro.HelpHotlistMenu3:\Sdeselect all selected items. en.ro.HelpGHistory:\Tglobal history window. de.ro.HelpGHistory:Das ist das Fenster der globalen History. fr.ro.HelpGHistory:\Tla fenêtre d'historique global. -it.ro.HelpGHistory:\Tglobal history window. +it.ro.HelpGHistory:\Tfinestra cronologia globale. nl.ro.HelpGHistory:\Tglobal history window. en.ro.HelpGHistoryToolbar0:\Tdelete button.|M\Sdelete the current selection. de.ro.HelpGHistoryToolbar0:Entfernt markierte Bereiche.|MAnklicken mit AUSWAHL löscht die vorher markierten Bereiche aus der History. @@ -4529,17 +4554,17 @@ nl.ro.HelpGHistoryMenu0-1:\Rexpand items within global history. en.ro.HelpGHistoryMenu0-1-0:\Sopen all directories and show all entry details. de.ro.HelpGHistoryMenu0-1-0:Öffnet alle Verzeichnisse und zeigt die Details der Einträge an. fr.ro.HelpGHistoryMenu0-1-0:\Souvrir tous les répertoires et donner le détail de toutes les entrées. -it.ro.HelpGHistoryMenu0-1-0:\Sopen all directories and show all entry details. +it.ro.HelpGHistoryMenu0-1-0:\Sapri tutte le directory e mostra in dettaglio tutte le immissioni. nl.ro.HelpGHistoryMenu0-1-0:\Sopen all directories and show all entry details. en.ro.HelpGHistoryMenu0-1-1:\Sopen all directories. de.ro.HelpGHistoryMenu0-1-1:Öffnet alle Verzeichnisse. fr.ro.HelpGHistoryMenu0-1-1:\Souvrir tous les répertoires. -it.ro.HelpGHistoryMenu0-1-1:\Sopen all directories. +it.ro.HelpGHistoryMenu0-1-1:\Sapri tutte le directory. nl.ro.HelpGHistoryMenu0-1-1:\Sopen all directories. en.ro.HelpGHistoryMenu0-1-2:\Sshow all entry details. de.ro.HelpGHistoryMenu0-1-2:Zeigt die Details der sichtbaren Einträge an. fr.ro.HelpGHistoryMenu0-1-2:\Smontrer le détail de toutes les entrées. -it.ro.HelpGHistoryMenu0-1-2:\Sshow all entry details. +it.ro.HelpGHistoryMenu0-1-2:\Smostra tutte le immissioni in dettaglio. nl.ro.HelpGHistoryMenu0-1-2:\Sshow all entry details. en.ro.HelpGHistoryMenu0-2:\Rcollapse items within global history. de.ro.HelpGHistoryMenu0-2:Weniger Information anzeigen @@ -4549,17 +4574,17 @@ nl.ro.HelpGHistoryMenu0-2:\Rcollapse items within global history. en.ro.HelpGHistoryMenu0-2-0:\Sclose all directories and hide all entry details. de.ro.HelpGHistoryMenu0-2-0:Schließt alle Verzeichnisse und versteckt die Details der Einträge. fr.ro.HelpGHistoryMenu0-2-0:\Sfermer tous les répertoires et cacher le détail de toutes les entrées. -it.ro.HelpGHistoryMenu0-2-0:\Sclose all directories and hide all entry details. +it.ro.HelpGHistoryMenu0-2-0:\Schiudi tutte le directory e nascondi i dettagli delle immissioni. nl.ro.HelpGHistoryMenu0-2-0:\Sclose all directories and hide all entry details. en.ro.HelpGHistoryMenu0-2-1:\Sclose all directories. de.ro.HelpGHistoryMenu0-2-1:Schließt alle Verzeichnisse. fr.ro.HelpGHistoryMenu0-2-1:\Sfermer tous les répertoires. -it.ro.HelpGHistoryMenu0-2-1:\Sclose all directories. +it.ro.HelpGHistoryMenu0-2-1:\Schiudi tutte le directory. nl.ro.HelpGHistoryMenu0-2-1:\Sclose all directories. en.ro.HelpGHistoryMenu0-2-2:\Shide all entry details. de.ro.HelpGHistoryMenu0-2-2:Versteckt die Detailanzeige der Einträge. fr.ro.HelpGHistoryMenu0-2-2:\Scacher le détail de toutes les entrées. -it.ro.HelpGHistoryMenu0-2-2:\Shide all entry details. +it.ro.HelpGHistoryMenu0-2-2:\Snascondi tutti i dettagli dell'immissione. nl.ro.HelpGHistoryMenu0-2-2:\Shide all entry details. en.ro.HelpGHistoryMenu0-3:\Rcontrol the display of NetSurf's toolbars. de.ro.HelpGHistoryMenu0-3:Die Iconleiste der globalen History verändern. @@ -4579,17 +4604,17 @@ nl.ro.HelpGHistoryMenu0-3-1:\Stoggle toolbar edit mode. en.ro.HelpGHistoryMenu1:\Roperate on the current selection. de.ro.HelpGHistoryMenu1:Die aktuelle Auswahl bearbeiten. fr.ro.HelpGHistoryMenu1:\Reffectuer une opération sur la sélection courante. -it.ro.HelpGHistoryMenu1:\Roperate on the current selection. +it.ro.HelpGHistoryMenu1:\Ropera nella selezione corrente. nl.ro.HelpGHistoryMenu1:\Roperate on the current selection. en.ro.HelpGHistoryMenu1-0:\Slaunch the current selection. de.ro.HelpGHistoryMenu1-0:Lädt Webseiten.|MAnklicken mit AUSWAHL öffnet die markierten Webseiten in je einem neuen Browserfenster. fr.ro.HelpGHistoryMenu1-0:\Slancer la sélection courante. -it.ro.HelpGHistoryMenu1-0:\Slaunch the current selection. +it.ro.HelpGHistoryMenu1-0:\Savvia la selezione corrente. nl.ro.HelpGHistoryMenu1-0:\Slaunch the current selection. en.ro.HelpGHistoryMenu1-1:\Sdelete the current selection from global history. de.ro.HelpGHistoryMenu1-1:Entfernt markierte Bereiche.|MAnklicken mit AUSWAHL löscht die vorher markierten Bereiche aus der History. fr.ro.HelpGHistoryMenu1-1:\Ssupprimer la sélection courante de l'historique global. -it.ro.HelpGHistoryMenu1-1:\Sdelete the current selection from global history. +it.ro.HelpGHistoryMenu1-1:\Scancella la selezione corrente dalla cronologia globale. nl.ro.HelpGHistoryMenu1-1:\Sdelete the current selection from global history. en.ro.HelpGHistoryMenu1-2:\Sreset statistics, such as visit count, for selected items. de.ro.HelpGHistoryMenu1-2:Setzt die Besuchsstatistik der markierten Einträge zurück. @@ -4599,18 +4624,18 @@ nl.ro.HelpGHistoryMenu1-2:\Sreset statistics, such as visit count, for selected en.ro.HelpGHistoryMenu2:\Sselect all the items in the history. de.ro.HelpGHistoryMenu2:Markiert alle Elemente der globalen History. fr.ro.HelpGHistoryMenu2:\Ssélectionner tous les items des favoris. -it.ro.HelpGHistoryMenu2:\Sselect all the items in the history. +it.ro.HelpGHistoryMenu2:\Sseleziona tutti gli oggetti della cronologia. nl.ro.HelpGHistoryMenu2:\Sselect all the items in the hotlist. en.ro.HelpGHistoryMenu3:\Sdeselect all selected items. de.ro.HelpGHistoryMenu3:Deselektiert alle markierten Elemente. fr.ro.HelpGHistoryMenu3:\Sdéselectionner tous les items sélectionnés. -it.ro.HelpGHistoryMenu3:\Sdeselect all selected items. +it.ro.HelpGHistoryMenu3:\Sdeseleziona tutti gli oggetti selezionati. nl.ro.HelpGHistoryMenu3:\Sdeselect all selected items. en.ro.HelpCookies:\TCookie management window. de.ro.HelpCookies:Das ist das Fenster zur Cookie-Verwaltung. fr.ro.HelpCookies:\TFenêtre de gestion des cookies. -it.ro.HelpCookies:\TCookie management window. +it.ro.HelpCookies:\TFinestra di gestione Cookie. nl.ro.HelpCookies:\TCookie management window. en.ro.HelpCookiesToolbar0:\Tdelete button.|M\Sdelete the current selection. de.ro.HelpCookiesToolbar0:Dies ist der Löschschalter.|MAnklicken löscht alle markierten Einträge. @@ -4641,7 +4666,7 @@ nl.ro.HelpCookiesMenu0-0:\Rexpand items within the cookie list. en.ro.HelpCookiesMenu0-0-0:\Sopen all directories and show all cookie details. de.ro.HelpCookiesMenu0-0-0:Klicken mit AUSWAHL öffnet alle Verzeichnisse und zeigt Details zu allen angezeigten Cookies. fr.ro.HelpCookiesMenu0-0-0:\Souvrir tous les répertoires et montrer le détail de tous les cookies. -it.ro.HelpCookiesMenu0-0-0:\Sopen all directories and show all cookie details. +it.ro.HelpCookiesMenu0-0-0:\Sapri tutte le directory e mostra i dettagli di tutti i cookie. nl.ro.HelpCookiesMenu0-0-0:\Sopen all directories and show all cookie details. en.ro.HelpCookiesMenu0-0-1:\Sopen all directories. de.ro.HelpCookiesMenu0-0-1:Klicken mit AUSWAHL öffnet alle Verzeichnisse. @@ -4661,7 +4686,7 @@ nl.ro.HelpCookiesMenu0-1:\Rcollapse items within the cookie list. en.ro.HelpCookiesMenu0-1-0:\Sclose all directories and hide all cookie details. de.ro.HelpCookiesMenu0-1-0:Klicken mit AUSWAHL schließt alle Verzeichnisse und versteckt die Cookiedetails. fr.ro.HelpCookiesMenu0-1-0:\Sfermer tous les répertoires et cacher le détail de tous les cookies. -it.ro.HelpCookiesMenu0-1-0:\Sclose all directories and hide all cookie details. +it.ro.HelpCookiesMenu0-1-0:\Schiudi tutte le directory e nascondi i dettagli di tutti i cookie. nl.ro.HelpCookiesMenu0-1-0:\Sclose all directories and hide all cookie details. en.ro.HelpCookiesMenu0-1-1:\Sclose all directories. de.ro.HelpCookiesMenu0-1-1:Klicken mit AUSWAHL schließt alle Verzeichnisse. @@ -4671,7 +4696,7 @@ nl.ro.HelpCookiesMenu0-1-1:\Sclose all directories. en.ro.HelpCookiesMenu0-1-2:\Shide all cookie details. de.ro.HelpCookiesMenu0-1-2:Klicken mit AUSWAHL versteckt alle Cookiedetails. fr.ro.HelpCookiesMenu0-1-2:\Scacher le détail de tous les cookies. -it.ro.HelpCookiesMenu0-1-2:\Shide all cookie details. +it.ro.HelpCookiesMenu0-1-2:\Snascondi i dettagli dei cookie. nl.ro.HelpCookiesMenu0-1-2:\Shide all cookie details. en.ro.HelpCookiesMenu0-2:\Rcontrol the display of NetSurf's toolbars. de.ro.HelpCookiesMenu0-2:Die Iconleiste verändern. @@ -4691,7 +4716,7 @@ nl.ro.HelpCookiesMenu0-2-1:\Stoggle toolbar edit mode. en.ro.HelpCookiesMenu1:\Roperate on the current selection. de.ro.HelpCookiesMenu1:Die ausgewählten Einträge bearbeiten. fr.ro.HelpCookiesMenu1:\Rfaire une opération sur la sélection courante. -it.ro.HelpCookiesMenu1:\Roperate on the current selection. +it.ro.HelpCookiesMenu1:\Ropera nella selezione corrente. nl.ro.HelpCookiesMenu1:\Roperate on the current selection. en.ro.HelpCookiesMenu1-0:\Sdelete any selected cookies. de.ro.HelpCookiesMenu1-0:Klicken mit AUSWAHL löscht alle markierten Cookies. @@ -4785,12 +4810,12 @@ nl.ro.HelpCacheConfig3:\Tamount of memory to be used for caching content. en.ro.HelpCacheConfig4:\Sreduce the amount of memory. de.ro.HelpCacheConfig4:Klicken mit AUSWAHL verringert die Größe des Cachespeichers. fr.ro.HelpCacheConfig4:\Sréduire la quantité de mémoire. -it.ro.HelpCacheConfig4:\Sreduce the amount of memory. +it.ro.HelpCacheConfig4:\Sriduce la quantità di memoria. nl.ro.HelpCacheConfig4:\Sreduce the amount of memory. en.ro.HelpCacheConfig5:\Sincrease the amount of memory. de.ro.HelpCacheConfig5:Klicken mit AUSWAHL vergrößert die Größe des Cachespeichers. fr.ro.HelpCacheConfig5:\Saugmenter la quantité de mémoire. -it.ro.HelpCacheConfig5:\Sincrease the amount of memory. +it.ro.HelpCacheConfig5:\Saumenta la quantità di memoria. nl.ro.HelpCacheConfig5:\Sincrease the amount of memory. en.ro.HelpCacheConfig7:\Sreset the Cache options back to their default values. de.ro.HelpCacheConfig7:Stellt die Standardeinstellungen wieder her. @@ -4821,27 +4846,27 @@ nl.ro.HelpConnectConfig3:\Tcurrently selected proxy type.|MUse the menu to selec en.ro.HelpConnectConfig4:\Sselect a proxy type. de.ro.HelpConnectConfig4:Klicken mit AUSWAHL um einen anderen Proxytyp auszuwählen. fr.ro.HelpConnectConfig4:\Schoisir un type de proxy. -it.ro.HelpConnectConfig4:\Sselect a proxy type. +it.ro.HelpConnectConfig4:\Sseleziona un tipo di proxy. nl.ro.HelpConnectConfig4:\Sselect a proxy type. en.ro.HelpConnectConfig6:You can enter the proxy's host name here. de.ro.HelpConnectConfig6:Hier kann der Hostname des Proxys eingegeben werden. fr.ro.HelpConnectConfig6:Vous pouvez entrer ici le nom d'hôte du proxy. -it.ro.HelpConnectConfig6:You can enter the proxy's host name here. +it.ro.HelpConnectConfig6:Inserisci qui il nome host del proxy. nl.ro.HelpConnectConfig6:You can enter the proxy's host name here. en.ro.HelpConnectConfig8:You can enter the proxy's port number here. de.ro.HelpConnectConfig8:Hier kann die zugehörige Portnummer eingestellt werden. fr.ro.HelpConnectConfig8:Vous pouvez entrer ici le numéro de port du proxy. -it.ro.HelpConnectConfig8:You can enter the proxy's port number here. +it.ro.HelpConnectConfig8:Inserisci qui il numero di porta del proxy. nl.ro.HelpConnectConfig8:You can enter the proxy's port number here. en.ro.HelpConnectConfig10:You can enter a username for proxies that require authentication here. de.ro.HelpConnectConfig10:Hier kann ein Username eingegeben werden, wenn der Proxy das erfordert. fr.ro.HelpConnectConfig10:Vous pouvez entrer ici un nom d'utilisateur pour les proxies nécessitant une authentification. -it.ro.HelpConnectConfig10:You can enter a username for proxies that require authentication here. +it.ro.HelpConnectConfig10:Inserisci un nome utente per i proxy che richiedano un'autentificazione. nl.ro.HelpConnectConfig10:You can enter a username for proxies that require authentication here. en.ro.HelpConnectConfig12:You can enter a password for proxies that require authentication here. de.ro.HelpConnectConfig12:Hier kann das zum Usernamen gehörige Passwort eingegeben werden. fr.ro.HelpConnectConfig12:Vous pouvez entrer ici un mot de passe pour les proxies nécessitant une authentification. -it.ro.HelpConnectConfig12:You can enter a password for proxies that require authentication here. +it.ro.HelpConnectConfig12:Inserisci una password per i proxy che richiedano un'autentificazione. nl.ro.HelpConnectConfig12:You can enter a password for proxies that require authentication here. en.ro.HelpConnectConfig16:\Tmaximum number of simultaneous fetches that NetSurf will perform. de.ro.HelpConnectConfig16:Das ist die Maximalzahl simultaner Fetches, die NetSurf verwenden soll. diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c index eede2ac88..845f8b3e8 100644 --- a/riscos/gui/url_bar.c +++ b/riscos/gui/url_bar.c @@ -30,7 +30,7 @@ #include "oslib/os.h" #include "oslib/osspriteop.h" #include "oslib/wimp.h" -#include "desktop/hotlist.h" +#include "riscos/hotlist.h" #include "riscos/gui/url_bar.h" #include "riscos/theme.h" #include "riscos/url_suggest.h" @@ -83,7 +83,7 @@ struct url_bar { bool shaded; struct { - bool add; + bool set; os_box extent; os_coord offset; } hotlist; @@ -111,6 +111,7 @@ static struct url_bar_resource url_bar_res[URLBAR_RES_LAST] = { }; /**< Treeview content resources */ +static void ro_gui_url_bar_set_hotlist(struct url_bar *url_bar, bool set); /* This is an exported interface documented in url_bar.h */ @@ -159,7 +160,7 @@ struct url_bar *ro_gui_url_bar_create(struct theme_descriptor *theme) strncpy(url_bar->favicon_sprite, "Ssmall_xxx", URLBAR_FAVICON_NAME_LENGTH); - url_bar->hotlist.add = true; + url_bar->hotlist.set = false; url_bar->hotlist.extent.x0 = 0; url_bar->hotlist.extent.y0 = 0; url_bar->hotlist.extent.x1 = 0; @@ -337,7 +338,10 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) if (!url_bar->hidden && url_bar->container_icon == -1) { icon.icon.flags = wimp_ICON_BORDER | - (wimp_COLOUR_BLACK << wimp_ICON_FG_COLOUR_SHIFT); + (wimp_COLOUR_BLACK << + wimp_ICON_FG_COLOUR_SHIFT) | + (wimp_BUTTON_DOUBLE_CLICK_DRAG << + wimp_ICON_BUTTON_TYPE_SHIFT); error = xwimp_create_icon(&icon, &url_bar->container_icon); if (error != NULL) { LOG(("xwimp_create_icon: 0x%x: %s", @@ -694,9 +698,9 @@ void ro_gui_url_bar_redraw(struct url_bar *url_bar, wimp_draw *redraw) .background_images = true, .plot = &ro_plotters }; - struct url_bar_resource *hotlist_icon = url_bar->hotlist.add ? - &(url_bar_res[URLBAR_RES_HOTLIST_ADD]) : - &(url_bar_res[URLBAR_RES_HOTLIST_REMOVE]); + struct url_bar_resource *hotlist_icon = url_bar->hotlist.set ? + &(url_bar_res[URLBAR_RES_HOTLIST_REMOVE]) : + &(url_bar_res[URLBAR_RES_HOTLIST_ADD]); xwimp_set_colour(wimp_COLOUR_WHITE); xos_plot(os_MOVE_TO, @@ -757,41 +761,22 @@ bool ro_gui_url_bar_click(struct url_bar *url_bar, pos.y > url_bar->extent.y1) return false; - /* If we have a click over the hotlist icon, hotlist add/remove. */ - /* TODO: this doesn't work - * neither does the TOOLBAR_URL_DRAG_FAVICON below */ - if (pointer->buttons & (wimp_CLICK_SELECT | wimp_SINGLE_SELECT) && - url_bar->text_buffer != NULL) { + /* If we have a Select or Adjust click, check if it originated on the + * hotlist icon; if it did, return an event. + */ + + if (pointer->buttons == wimp_SINGLE_SELECT || + pointer->buttons == wimp_SINGLE_ADJUST) { if (pos.x >= url_bar->hotlist.extent.x0 && pos.x <= url_bar->hotlist.extent.x1 && pos.y >= url_bar->hotlist.extent.y0 && pos.y <= url_bar->hotlist.extent.y1) { - nsurl *n; - bool redraw = false; - if (nsurl_create((const char *)url_bar->text_buffer, - &n) == NSERROR_OK) { - if (url_bar->hotlist.add) { - if (hotlist_add_url(n)) { - redraw = true; - url_bar->hotlist.add = false; - } - } else { - /* TODO: Open "Remove page from - * Hotlist?" query dialogue box, - * rather than silent removal. */ - hotlist_remove_url(n); - redraw = true; - url_bar->hotlist.add = true; - } - nsurl_unref(n); - - if (redraw && !url_bar->hidden) - xwimp_force_redraw(url_bar->window, - url_bar->hotlist.extent.x0, - url_bar->hotlist.extent.y0, - url_bar->hotlist.extent.x1, - url_bar->hotlist.extent.y1); - } + if (pointer->buttons == wimp_SINGLE_SELECT && + action != NULL) + *action = TOOLBAR_URL_SELECT_HOTLIST; + else if (pointer->buttons == wimp_SINGLE_ADJUST && + action != NULL) + *action = TOOLBAR_URL_ADJUST_HOTLIST; return true; } } @@ -909,6 +894,16 @@ bool ro_gui_url_bar_help_suffix(struct url_bar *url_bar, wimp_i i, *suffix = "14"; else if (i == url_bar->suggest_icon) *suffix = "15"; + else if (pos.x >= url_bar->hotlist.extent.x0 && + pos.x <= url_bar->hotlist.extent.x1 && + pos.y >= url_bar->hotlist.extent.y0 && + pos.y <= url_bar->hotlist.extent.y1) + *suffix = "Hot"; + else if (pos.x >= url_bar->favicon_extent.x0 && + pos.x <= url_bar->favicon_extent.x1 && + pos.y >= url_bar->favicon_extent.y0 && + pos.y <= url_bar->favicon_extent.y1) + *suffix = "Fav"; else *suffix = ""; @@ -953,16 +948,8 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, return; if (nsurl_create(url, &n) == NSERROR_OK) { - bool prev = url_bar->hotlist.add; - url_bar->hotlist.add = !hotlist_has_url(n); + ro_gui_url_bar_set_hotlist(url_bar, ro_gui_hotlist_has_page(n)); nsurl_unref(n); - - if (prev != url_bar->hotlist.add && !url_bar->hidden) - xwimp_force_redraw(url_bar->window, - url_bar->hotlist.extent.x0, - url_bar->hotlist.extent.y0, - url_bar->hotlist.extent.x1, - url_bar->hotlist.extent.y1); } if (url_bar->text_icon == -1) { @@ -999,23 +986,42 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, /* This is an exported interface documented in url_bar.h */ -void ro_gui_url_bar_hotlist_modifed(struct url_bar *url_bar, nsurl *url) +void ro_gui_url_bar_update_hotlist(struct url_bar *url_bar) { + const char *url; nsurl *n; - if (nsurl_create((const char *)url_bar->text_buffer, - &n) == NSERROR_OK) { - bool prev = url_bar->hotlist.add; - url_bar->hotlist.add = !hotlist_has_url(n); + if (url_bar == NULL) + return; + + url = (const char *) url_bar->text_buffer; + if (url != NULL && nsurl_create(url, &n) == NSERROR_OK) { + ro_gui_url_bar_set_hotlist(url_bar, ro_gui_hotlist_has_page(n)); nsurl_unref(n); + } +} + + +/** + * Set the state of a URL Bar's hotlist icon. + * + * \param *url_bar The URL Bar to update. + * \param set TRUE to set the hotlist icon; FALSE to clear it. + */ - if (prev != url_bar->hotlist.add && !url_bar->hidden) { +static void ro_gui_url_bar_set_hotlist(struct url_bar *url_bar, bool set) +{ + if (url_bar == NULL || set == url_bar->hotlist.set) + return; + + url_bar->hotlist.set = set; + + if (!url_bar->hidden) { xwimp_force_redraw(url_bar->window, url_bar->hotlist.extent.x0, url_bar->hotlist.extent.y0, url_bar->hotlist.extent.x1, url_bar->hotlist.extent.y1); - } } } @@ -1083,7 +1089,6 @@ bool ro_gui_url_bar_test_for_text_field_keypress(struct url_bar *url_bar, { const char *url; nsurl *n; - bool changed = false; if (url_bar == NULL || url_bar->hidden || key == NULL) return false; @@ -1091,30 +1096,14 @@ bool ro_gui_url_bar_test_for_text_field_keypress(struct url_bar *url_bar, if (key->w != url_bar->window || key->i != url_bar->text_icon) return false; - if (url_bar->hidden) - return true; - /* Update hotlist indicator */ + url = (const char *) url_bar->text_buffer; if (url != NULL && nsurl_create(url, &n) == NSERROR_OK) { - bool prev = url_bar->hotlist.add; - url_bar->hotlist.add = !hotlist_has_url(n); + ro_gui_url_bar_set_hotlist(url_bar, ro_gui_hotlist_has_page(n)); nsurl_unref(n); - - if (prev != url_bar->hotlist.add) { - changed = true; - } - } else if (!url_bar->hotlist.add) { - url_bar->hotlist.add = true; - changed = true; - } - - if (changed) { - xwimp_force_redraw(url_bar->window, - url_bar->hotlist.extent.x0, - url_bar->hotlist.extent.y0, - url_bar->hotlist.extent.x1, - url_bar->hotlist.extent.y1); + } else if (url_bar->hotlist.set) { + ro_gui_url_bar_set_hotlist(url_bar, false); } return true; @@ -1166,12 +1155,12 @@ bool ro_gui_url_bar_set_site_favicon(struct url_bar *url_bar, "Ssmall_xxx"); } - if (!url_bar->hidden) - xwimp_force_redraw(url_bar->window, - url_bar->favicon_extent.x0, - url_bar->favicon_extent.y0, - url_bar->favicon_extent.x1, - url_bar->favicon_extent.y1); + if (!url_bar->hidden) + xwimp_force_redraw(url_bar->window, + url_bar->favicon_extent.x0, + url_bar->favicon_extent.y0, + url_bar->favicon_extent.x1, + url_bar->favicon_extent.y1); return true; } diff --git a/riscos/gui/url_bar.h b/riscos/gui/url_bar.h index 04a8468ba..034f74df6 100644 --- a/riscos/gui/url_bar.h +++ b/riscos/gui/url_bar.h @@ -34,6 +34,8 @@ typedef enum { TOOLBAR_URL_NONE = 0, /* Special case: no action */ TOOLBAR_URL_DRAG_URL, TOOLBAR_URL_DRAG_FAVICON, + TOOLBAR_URL_SELECT_HOTLIST, + TOOLBAR_URL_ADJUST_HOTLIST } url_bar_action; struct url_bar; @@ -232,13 +234,13 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, /** - * Update urlbar's hotlist icon, if necessary. + * Update the state of a URL Bar's hotlist icon to reflect any changes to the + * URL or the contents of the hotlist. * * \param *url_bar The URL Bar to update. - * \param *url URL with updated hotlist presence, or NULL if unknown. */ -void ro_gui_url_bar_hotlist_modifed(struct url_bar *url_bar, nsurl *url); +void ro_gui_url_bar_update_hotlist(struct url_bar *url_bar); /** diff --git a/riscos/hotlist.c b/riscos/hotlist.c index 7b5762fad..f47d05e9c 100644 --- a/riscos/hotlist.c +++ b/riscos/hotlist.c @@ -62,6 +62,15 @@ static bool ro_gui_hotlist_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, static void ro_gui_hotlist_toolbar_click(button_bar_action action); static void ro_gui_hotlist_addurl_bounce(wimp_message *message); static void ro_gui_hotlist_scheduled_callback(void *p); +static void ro_gui_hotlist_remove_confirmed(query_id id, + enum query_response res, void *p); +static void ro_gui_hotlist_remove_cancelled(query_id id, + enum query_response res, void *p); + +static const query_callback remove_funcs = { + ro_gui_hotlist_remove_confirmed, + ro_gui_hotlist_remove_cancelled +}; struct ro_treeview_callbacks ro_hotlist_treeview_callbacks = { ro_gui_hotlist_toolbar_click, @@ -85,6 +94,11 @@ struct ro_hotlist_message_hotlist_changed { static char *hotlist_url = NULL; /**< URL area claimed from RMA. */ static char *hotlist_title = NULL; /**< Title area claimed from RMA. */ +/** Hotlist Query Handler. */ + +static query_id hotlist_query = QUERY_INVALID; +static nsurl *hotlist_delete_url = NULL; + /* The RISC OS hotlist window, toolbar and treeview data. */ static struct ro_hotlist { @@ -241,6 +255,7 @@ void ro_gui_hotlist_toolbar_click(button_bar_action action) switch (action) { case TOOLBAR_BUTTON_DELETE: hotlist_keypress(KEY_DELETE_LEFT); + ro_toolbar_update_all_hotlists(); break; case TOOLBAR_BUTTON_EXPAND: @@ -410,6 +425,7 @@ bool ro_gui_hotlist_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, return true; case TREE_SELECTION_DELETE: hotlist_keypress(KEY_DELETE_LEFT); + ro_toolbar_update_all_hotlists(); return true; case TREE_SELECT_ALL: hotlist_keypress(KEY_SELECT_ALL); @@ -496,8 +512,6 @@ void ro_gui_hotlist_add_page(nsurl *url) ro_gui_hotlist_add_cleanup(); - LOG(("Sending Hotlist AddURL to potential hotlist clients.")); - data = urldb_get_url_data(url); if (data == NULL) return; @@ -540,8 +554,6 @@ void ro_gui_hotlist_add_page(nsurl *url) static void ro_gui_hotlist_addurl_bounce(wimp_message *message) { - LOG(("Hotlist AddURL Bounced")); - if (hotlist_url != NULL) { nsurl *nsurl; @@ -570,8 +582,6 @@ static void ro_gui_hotlist_addurl_bounce(wimp_message *message) static void ro_gui_hotlist_scheduled_callback(void *p) { - LOG(("Hotlist AddURL was claimed by something.")); - ro_gui_hotlist_add_cleanup(); } @@ -582,8 +592,6 @@ static void ro_gui_hotlist_scheduled_callback(void *p) void ro_gui_hotlist_add_cleanup(void) { - LOG(("Clean up RMA")); - if (hotlist_url != NULL) { osmodule_free(hotlist_url); hotlist_url = NULL; @@ -596,6 +604,104 @@ void ro_gui_hotlist_add_cleanup(void) } +/** + * Remove a URL from the hotlist. This will be passed on to the core hotlist, + * unless we're configured to use external hotlists in which case we ignore it. + * + * \param *url The URL to be removed. + */ + +void ro_gui_hotlist_remove_page(nsurl *url) +{ + if (url == NULL || nsoption_bool(external_hotlists) || + !hotlist_has_url(url)) + return; + + /* Clean up any existing delete attempts before continuing. */ + + if (hotlist_query != QUERY_INVALID) { + query_close(hotlist_query); + hotlist_query = QUERY_INVALID; + } + + if (hotlist_delete_url != NULL) { + nsurl_unref(hotlist_delete_url); + hotlist_delete_url = NULL; + } + + /* Check with the user before removing the URL, unless they don't + * want us to be careful in which case just do it. + */ + + if (nsoption_bool(confirm_hotlist_remove)) { + hotlist_query = query_user("RemoveHotlist", NULL, + &remove_funcs, NULL, + messages_get("Remove"), + messages_get("DontRemove")); + + hotlist_delete_url = nsurl_ref(url); + } else { + hotlist_remove_url(url); + ro_toolbar_update_all_hotlists(); + } +} + + +/** + * Callback confirming a URL delete query. + * + * \param id The ID of the query calling us. + * \param res The user's response to the query. + * \param *p Callback data (always NULL). + */ + +static void ro_gui_hotlist_remove_confirmed(query_id id, + enum query_response res, void *p) +{ + hotlist_remove_url(hotlist_delete_url); + ro_toolbar_update_all_hotlists(); + + nsurl_unref(hotlist_delete_url); + hotlist_delete_url = NULL; + hotlist_query = QUERY_INVALID; +} + + +/** + * Callback cancelling a URL delete query. + * + * \param id The ID of the query calling us. + * \param res The user's response to the query. + * \param *p Callback data (always NULL). + */ + +static void ro_gui_hotlist_remove_cancelled(query_id id, + enum query_response res, void *p) +{ + nsurl_unref(hotlist_delete_url); + hotlist_delete_url = NULL; + hotlist_query = QUERY_INVALID; +} + + +/** + * Report whether the hotlist contains a given URL. This will be passed on to + * the core hotlist, unless we're configured to use an external hotlist in which + * case we always report false. + * + * \param *url The URL to be tested. + * \return true if the hotlist contains the URL; else false. + */ + +bool ro_gui_hotlist_has_page(nsurl *url) +{ + if (url == NULL || nsoption_bool(external_hotlists)) + return false; + + return hotlist_has_url(url); +} + + #if 0 /** * Handle URL dropped on hotlist diff --git a/riscos/hotlist.h b/riscos/hotlist.h index 25e4794a7..4cb5a1ff3 100644 --- a/riscos/hotlist.h +++ b/riscos/hotlist.h @@ -47,6 +47,8 @@ bool ro_gui_hotlist_check_window(wimp_w window); bool ro_gui_hotlist_check_menu(wimp_menu *menu); void ro_gui_hotlist_add_page(nsurl *url); void ro_gui_hotlist_add_cleanup(void); +void ro_gui_hotlist_remove_page(nsurl *url); +bool ro_gui_hotlist_has_page(nsurl *url); #endif diff --git a/riscos/mouse.c b/riscos/mouse.c index c655340b4..a20965e31 100644 --- a/riscos/mouse.c +++ b/riscos/mouse.c @@ -50,6 +50,8 @@ static void (*ro_mouse_drag_track_callback)(wimp_pointer *pointer, void *data) static void (*ro_mouse_drag_cancel_callback)(void *data) = NULL; static void *ro_mouse_drag_data = NULL; +static bool ro_mouse_ignore_leaving_event = false; + /* Data for the wimp poll handler. */ static void (*ro_mouse_poll_end_callback)(wimp_leaving *leaving, void *data) @@ -123,6 +125,12 @@ void ro_mouse_drag_start(void (*drag_end)(wimp_dragged *dragged, void *data), ro_mouse_drag_track_callback = drag_track; ro_mouse_drag_cancel_callback = drag_cancel; ro_mouse_drag_data = data; + + /* The Wimp sends a PointerLeaving event when Wimp_DragBox is called, + * so we mask out the next event that will come our way. + */ + + ro_mouse_ignore_leaving_event = true; } @@ -184,14 +192,20 @@ void ro_mouse_track_start(void (*poll_end)(wimp_leaving *leaving, void *data), * Process Wimp_PointerLeaving events by terminating an active mouse track and * passing the details on to any registered event handler. * + * If the ignore mask is set, we don't pass the event on to the client as it + * is assumed that it's a result of starting a Wimp_DragBox operation. + * * \param *leaving The Wimp_PointerLeaving data block. */ void ro_mouse_pointer_leaving_window(wimp_leaving *leaving) { - if (ro_mouse_poll_end_callback != NULL) + if (ro_mouse_poll_end_callback != NULL && + ro_mouse_ignore_leaving_event == false) ro_mouse_poll_end_callback(leaving, ro_mouse_poll_data); + ro_mouse_ignore_leaving_event = false; + /* Poll tracking is a one-shot event, so clear the data ready for * another claimant. */ diff --git a/riscos/options.h b/riscos/options.h index 9ee35929d..cb2b78bd8 100644 --- a/riscos/options.h +++ b/riscos/options.h @@ -53,6 +53,7 @@ NSOPTION_BOOL(no_plugins, false) NSOPTION_BOOL(block_popups, false) NSOPTION_BOOL(strip_extensions, false) NSOPTION_BOOL(confirm_overwrite, true) +NSOPTION_BOOL(confirm_hotlist_remove, true) NSOPTION_STRING(url_path, "NetSurf:URL") NSOPTION_STRING(url_save, CHOICES_PREFIX "URL") NSOPTION_STRING(hotlist_path, "NetSurf:Hotlist") diff --git a/riscos/toolbar.c b/riscos/toolbar.c index 4da4db478..93c4438c3 100644 --- a/riscos/toolbar.c +++ b/riscos/toolbar.c @@ -162,7 +162,7 @@ static wimp_window ro_toolbar_window = { wimp_WINDOW_NEVER3D | 0x16u /* RISC OS 5.03+ */, {0, 0, TOOLBAR_DEFAULT_WIDTH, 16384}, 0, - wimp_BUTTON_CLICK_DRAG << wimp_ICON_BUTTON_TYPE_SHIFT, + wimp_BUTTON_DOUBLE_CLICK_DRAG << wimp_ICON_BUTTON_TYPE_SHIFT, wimpspriteop_AREA, 1, 1, @@ -1620,10 +1620,27 @@ const char *ro_toolbar_get_url(struct toolbar *toolbar) /* This is an exported interface documented in toolbar.h */ -void ro_toolbar_hotlist_modifed(struct toolbar *toolbar, nsurl *url) +void ro_toolbar_update_all_hotlists(void) { - if (toolbar != NULL && toolbar->url != NULL) - ro_gui_url_bar_hotlist_modifed(toolbar->url, url); + struct toolbar *bar; + + bar = ro_toolbar_bars; + while (bar != NULL) { + ro_toolbar_update_hotlist(bar); + + bar = bar->next; + } +} + + +/* This is an exported interface documented in toolbar.h */ + +void ro_toolbar_update_hotlist(struct toolbar *toolbar) +{ + if (toolbar == NULL || toolbar->url == NULL) + return; + + ro_gui_url_bar_update_hotlist(toolbar->url); } diff --git a/riscos/toolbar.h b/riscos/toolbar.h index 284eee22d..336f95d15 100644 --- a/riscos/toolbar.h +++ b/riscos/toolbar.h @@ -386,13 +386,20 @@ const char *ro_toolbar_get_url(struct toolbar *toolbar); /** - * Update toolbar's urlbar hotlist icon, if necessary. + * Update the state of the URL Bar hotlist icons in all open toolbars. + */ + +void ro_toolbar_update_all_hotlists(void); + + +/** + * Update the state of a toolbar's URL Bar hotlist icon to reflect any changes + * to the URL or the hotlist contents. * * \param *toolbar The toolbar to update. - * \param *url URL with updated hotlist presence, or NULL if unknown. */ -void ro_toolbar_hotlist_modifed(struct toolbar *toolbar, nsurl *url); +void ro_toolbar_update_hotlist(struct toolbar *toolbar); /** diff --git a/riscos/window.c b/riscos/window.c index 35f9b201e..f6b274a20 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -138,6 +138,7 @@ static void ro_gui_window_action_save(struct gui_window *g, static void ro_gui_window_action_search(struct gui_window *g); static void ro_gui_window_action_zoom(struct gui_window *g); static void ro_gui_window_action_add_bookmark(struct gui_window *g); +static void ro_gui_window_action_remove_bookmark(struct gui_window *g); static void ro_gui_window_action_print(struct gui_window *g); static void ro_gui_window_action_page_info(struct gui_window *g); @@ -188,6 +189,8 @@ static wimp_menu *ro_gui_browser_window_menu = NULL; static wimp_menu *gui_form_select_menu = NULL; /** Browser window associated with open select menu. */ static struct browser_window *ro_gui_select_menu_bw = NULL; +/** Main content object under menu, or 0 if none. */ +static hlcache_handle *current_menu_main = 0; /** Object under menu, or 0 if no object. */ static hlcache_handle *current_menu_object = 0; /** URL of link under menu, or 0 if no link. */ @@ -2206,6 +2209,7 @@ bool ro_gui_window_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu, if (pointer != NULL && g->window == w) { ro_gui_url_complete_close(); + current_menu_main = NULL; current_menu_object = NULL; current_menu_url = NULL; @@ -2214,6 +2218,7 @@ bool ro_gui_window_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu, browser_window_get_contextual_content(bw, pos.x, pos.y, &cont); + current_menu_main = cont.main; current_menu_object = cont.object; current_menu_url = cont.link_url; } @@ -2789,8 +2794,11 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, ro_gui_window_action_new_window(g); break; case BROWSER_VIEW_SOURCE: - if (h != NULL) + if (current_menu_main != NULL) { + ro_gui_view_source(current_menu_main); + } else if (h != NULL) { ro_gui_view_source(h); + } break; /* object actions */ @@ -3604,9 +3612,12 @@ void ro_gui_window_toolbar_click(void *data, return; - if (action_type == TOOLBAR_ACTION_URL && - action.url == TOOLBAR_URL_DRAG_URL) { - if (g->bw->current_content) { + if (action_type == TOOLBAR_ACTION_URL) { + switch (action.url) { + case TOOLBAR_URL_DRAG_URL: + if (g->bw->current_content == NULL) + break; + hlcache_handle *h = g->bw->current_content; if (ro_gui_shift_pressed()) @@ -3617,6 +3628,18 @@ void ro_gui_window_toolbar_click(void *data, ro_gui_drag_save_link(save_type, nsurl_access(hlcache_handle_get_url(h)), content_get_title(h), g); + break; + + case TOOLBAR_URL_SELECT_HOTLIST: + ro_gui_window_action_add_bookmark(g); + break; + + case TOOLBAR_URL_ADJUST_HOTLIST: + ro_gui_window_action_remove_bookmark(g); + break; + + default: + break; } return; @@ -4243,7 +4266,7 @@ void ro_gui_window_action_zoom(struct gui_window *g) * \param *g The browser window to act on. */ -void ro_gui_window_action_add_bookmark(struct gui_window *g) +static void ro_gui_window_action_add_bookmark(struct gui_window *g) { nsurl *url; @@ -4255,7 +4278,28 @@ void ro_gui_window_action_add_bookmark(struct gui_window *g) url = hlcache_handle_get_url(g->bw->current_content); ro_gui_hotlist_add_page(url); - ro_toolbar_hotlist_modifed(g->toolbar, url); + ro_toolbar_update_hotlist(g->toolbar); +} + + +/** + * Remove a hotlist entry for a browser window. + * + * \param *g The browser window to act on. + */ + +static void ro_gui_window_action_remove_bookmark(struct gui_window *g) +{ + nsurl *url; + + if (g == NULL || g->bw == NULL || g->toolbar == NULL || + g->bw->current_content == NULL || + hlcache_handle_get_url(g->bw->current_content) == NULL) + return; + + url = hlcache_handle_get_url(g->bw->current_content); + + ro_gui_hotlist_remove_page(url); } diff --git a/utils/corestrings.c b/utils/corestrings.c index 9e992b894..efdd0e07f 100644 --- a/utils/corestrings.c +++ b/utils/corestrings.c @@ -174,7 +174,6 @@ dom_string *corestring_dom_invalid; dom_string *corestring_dom_keydown; dom_string *corestring_dom_keypress; dom_string *corestring_dom_keyup; -dom_string *corestring_dom_key_css_bloom; dom_string *corestring_dom_link; dom_string *corestring_dom_load; dom_string *corestring_dom_loadeddata; @@ -233,6 +232,7 @@ dom_string *corestring_dom_volumechange; dom_string *corestring_dom_vspace; dom_string *corestring_dom_waiting; dom_string *corestring_dom_width; +dom_string *corestring_dom___ns_key_libcss_node_data; /* @@ -405,7 +405,6 @@ void corestrings_fini(void) CSS_DOM_STRING_UNREF(keydown); CSS_DOM_STRING_UNREF(keypress); CSS_DOM_STRING_UNREF(keyup); - CSS_DOM_STRING_UNREF(key_css_bloom); CSS_DOM_STRING_UNREF(link); CSS_DOM_STRING_UNREF(load); CSS_DOM_STRING_UNREF(loadeddata); @@ -464,6 +463,7 @@ void corestrings_fini(void) CSS_DOM_STRING_UNREF(vspace); CSS_DOM_STRING_UNREF(waiting); CSS_DOM_STRING_UNREF(width); + CSS_DOM_STRING_UNREF(__ns_key_libcss_node_data); #undef CSS_DOM_STRING_UNREF } @@ -724,6 +724,7 @@ nserror corestrings_init(void) CSS_DOM_STRING_INTERN(vspace); CSS_DOM_STRING_INTERN(waiting); CSS_DOM_STRING_INTERN(width); + CSS_DOM_STRING_INTERN(__ns_key_libcss_node_data); #undef CSS_DOM_STRING_INTERN exc = dom_string_create_interned((const uint8_t *) "text/javascript", diff --git a/utils/corestrings.h b/utils/corestrings.h index c37242a0e..c50cc3113 100644 --- a/utils/corestrings.h +++ b/utils/corestrings.h @@ -180,7 +180,6 @@ extern struct dom_string *corestring_dom_invalid; extern struct dom_string *corestring_dom_keydown; extern struct dom_string *corestring_dom_keypress; extern struct dom_string *corestring_dom_keyup; -extern struct dom_string *corestring_dom_key_css_bloom; extern struct dom_string *corestring_dom_link; extern struct dom_string *corestring_dom_load; extern struct dom_string *corestring_dom_loadeddata; @@ -239,6 +238,7 @@ extern struct dom_string *corestring_dom_volumechange; extern struct dom_string *corestring_dom_vspace; extern struct dom_string *corestring_dom_waiting; extern struct dom_string *corestring_dom_width; +extern struct dom_string *corestring_dom___ns_key_libcss_node_data; #endif diff --git a/utils/utils.c b/utils/utils.c index ac9f5af7a..8cb1987d4 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -37,20 +37,6 @@ #include "utils/utf8.h" #include "utils/utils.h" -void * -ns_realloc(void *ptr, size_t size, void *pw) -{ - (void)pw; - - if (ptr == NULL) - return size > 0 ? malloc(size) : NULL; - if (size == 0) { - free(ptr); - return NULL; - } - return realloc(ptr, size); -} - char * strip(char * const s) { size_t i; diff --git a/utils/utils.h b/utils/utils.h index a1ff683d3..f2241ae07 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -136,17 +136,6 @@ typedef struct #endif -/** - * Private-word-capable realloc() implementation which - * behaves as most NS libraries expect in the face of - * realloc(ptr, 0) and realloc(NULL, size). - * - * \param ptr The pointer for reallocation - * \param size The number of bytes for the allocation - * \param pw A "private word" which we ignore. - * \return The new pointer (NULL on frees or errors) - */ -void *ns_realloc(void *ptr, size_t size, void *pw); char * strip(char * const s); int whitespace(const char * str); |