Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/eb9571ede701defafd2b9685138826a719124b5b
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/eb9571ede701defafd2b9685138826a719124b5b
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/eb9571ede701defafd2b9685138826a719124b5b

The branch, master has been updated
       via  eb9571ede701defafd2b9685138826a719124b5b (commit)
       via  bada456d49c31944861ea08636d439c0ffffec0b (commit)
       via  ea00b378744f98e38b0c00e97a5c78d9d76d6dd3 (commit)
       via  61979923c146b4456d24e794a44c08adc334cff6 (commit)
       via  ea9932dd00cc5384bc9f19d2addf683712983a4f (commit)
       via  65bf58e4a1999fca0de1279e143f714acc19fe8d (commit)
      from  313c48b8a15b6ebe683ceb8a995c62e2e0e97616 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=eb9571ede701defafd2b9685138826a719124b5b
commit eb9571ede701defafd2b9685138826a719124b5b
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Help gcc opt

diff --git a/frontends/amiga/font_cache.h b/frontends/amiga/font_cache.h
index 7c95ba5..a52f2f1 100644
--- a/frontends/amiga/font_cache.h
+++ b/frontends/amiga/font_cache.h
@@ -27,9 +27,9 @@ struct ami_font_cache_node
        struct SkipNode skip_node;
 #endif
        struct OutlineFont *font;
-       char *bold;
-       char *italic;
-       char *bolditalic;
+       char *restrict bold;
+       char *restrict italic;
+       char *restrict bolditalic;
        struct TimeVal lastused;
 };
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=bada456d49c31944861ea08636d439c0ffffec0b
commit bada456d49c31944861ea08636d439c0ffffec0b
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Fix specifying URLs on command line

diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 3b2f03a..9bf1689 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -862,7 +862,7 @@ static struct RDArgs *ami_gui_commandline(int *restrict 
argc, char ** argv,
                if(rarray[A_URL]) {
                        LOG("URL %s specified on command line",
                            (char *)rarray[A_URL]);
-                       temp_homepage_url = ami_to_utf8_easy((char 
*)rarray[A_URL]);
+                       temp_homepage_url = strdup((char *)rarray[A_URL]); 
/**\todo allow IDNs */
                }
 
                if(rarray[A_USERSDIR]) {


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=ea00b378744f98e38b0c00e97a5c78d9d76d6dd3
commit ea00b378744f98e38b0c00e97a5c78d9d76d6dd3
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Attempt to help gcc out a little

diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index d6d0c76..5b8117a 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -398,9 +398,10 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
        return bm;
 }
 
-static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap, int 
width, int height, struct BitMap *friendbm, int type)
+static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap,
+                       int width, int height, struct BitMap *restrict 
friendbm, int type)
 {
-       struct BitMap *tbm = NULL;
+       struct BitMap *restrict tbm = NULL;
 
        if(bitmap->nativebm)
        {
@@ -473,7 +474,7 @@ static inline struct BitMap *ami_bitmap_get_generic(struct 
bitmap *bitmap, int w
 
        if((bitmap->width != width) || (bitmap->height != height))
        {
-               struct BitMap *scaledbm;
+               struct BitMap *restrict scaledbm;
                struct BitScaleArgs bsa;
                int depth = 32;
                if(type == AMI_NSBM_PALETTEMAPPED) depth = 8;
@@ -539,7 +540,8 @@ static inline struct BitMap *ami_bitmap_get_generic(struct 
bitmap *bitmap, int w
 }
 
 
-static inline struct BitMap *ami_bitmap_get_truecolour(struct bitmap 
*bitmap,int width,int height,struct BitMap *friendbm)
+static inline struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,
+                       int width, int height, struct BitMap *friendbm)
 {
        if((bitmap->native != AMI_NSBM_NONE) && (bitmap->native != 
AMI_NSBM_TRUECOLOUR)) {
                amiga_bitmap_modified(bitmap);
diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c
index b0c2999..7220cb0 100644
--- a/frontends/amiga/font_bullet.c
+++ b/frontends/amiga/font_bullet.c
@@ -136,9 +136,9 @@ static lwc_string *glypharray[0xffff + 1];
 static struct List ami_diskfontlib_list;
 
 static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct 
RastPort *rp,
-               uint16 *char1, uint16 *char2, uint32 x, uint32 y, uint32 
emwidth, bool aa);
+               uint16 *restrict char1, uint16 *restrict char2, uint32 x, 
uint32 y, uint32 emwidth, bool aa);
 static inline int32 ami_font_width_glyph(struct OutlineFont *ofont, 
-               const uint16 *char1, const uint16 *char2, uint32 emwidth);
+               const uint16 *restrict char1, const uint16 *restrict char2, 
uint32 emwidth);
 static struct OutlineFont *ami_open_outline_font(const plot_font_style_t 
*fstyle,
                const uint16 *codepoint);
 static inline ULONG ami_font_unicode_width(const char *string, ULONG length,
@@ -530,7 +530,8 @@ static struct OutlineFont *ami_open_outline_font(const 
plot_font_style_t *fstyle
 }
 
 static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct 
RastPort *rp,
-               uint16 *char1, uint16 *char2, uint32 x, uint32 y, uint32 
emwidth, bool aa)
+               uint16 *restrict char1, uint16 *restrict char2, uint32 x, 
uint32 y,
+               uint32 emwidth, bool aa)
 {
        struct GlyphMap *glyph;
        UBYTE *glyphbm;
@@ -637,7 +638,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont 
*ofont, struct RastPo
 }
 
 static inline int32 ami_font_width_glyph(struct OutlineFont *ofont, 
-               const uint16 *char1, const uint16 *char2, uint32 emwidth)
+               const uint16 *restrict char1, const uint16 *restrict char2, 
uint32 emwidth)
 {
        int32 char_advance = 0;
        FIXED kern = 0;
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 3eafa59..3b2f03a 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -219,7 +219,7 @@ static const __attribute__((used)) char *stack_cookie = 
"\0$STACK:196608\0";
 const char * const versvn;
 const char * const verdate;
 
-void ami_switch_tab(struct gui_window_2 *gwin,bool redraw);
+void ami_switch_tab(struct gui_window_2 *gwin, bool redraw);
 void ami_change_tab(struct gui_window_2 *gwin, int direction);
 void ami_get_hscroll_pos(struct gui_window_2 *gwin, ULONG *xs);
 void ami_get_vscroll_pos(struct gui_window_2 *gwin, ULONG *ys);
@@ -228,13 +228,13 @@ Object *ami_gui_splash_open(void);
 void ami_gui_splash_close(Object *win_obj);
 HOOKF(uint32, ami_set_favicon_render_hook, APTR, space, struct gpRender *);
 HOOKF(uint32, ami_set_throbber_render_hook, APTR, space, struct gpRender *);
-bool ami_gui_map_filename(char **remapped, const char *path, const char *file,
-       const char *map);
+bool ami_gui_map_filename(char **remapped, const char *restrict path, const 
char *restrict file,
+       const char *restrict map);
 static void ami_gui_window_update_box_deferred(struct gui_window *g, bool 
draw);
 static void ami_do_redraw(struct gui_window_2 *g);
 static void ami_schedule_redraw_remove(struct gui_window_2 *gwin);
 
-static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy);
+static bool gui_window_get_scroll(struct gui_window *g, int *restrict sx, int 
*restrict sy);
 static void gui_window_set_scroll(struct gui_window *g, int sx, int sy);
 static void gui_window_remove_caret(struct gui_window *g);
 static void gui_window_place_caret(struct gui_window *g, int x, int y, int 
height, const struct rect *clip);
@@ -289,13 +289,14 @@ STRPTR ami_locale_langs(int *codeset)
        return acceptlangs;
 }
 
-bool ami_gui_map_filename(char **remapped, const char *path, const char *file, 
const char *map)
+bool ami_gui_map_filename(char **remapped, const char *restrict path,
+               const char *restrict file, const char *restrict map)
 {
        BPTR fh = 0;
        char *mapfile = NULL;
        size_t mapfile_size = 0;
        char buffer[1024];
-       char *realfname;
+       char *restrict realfname;
        bool found = false;
 
        netsurf_mkpath(&mapfile, &mapfile_size, 2, path, map);
@@ -386,7 +387,7 @@ bool ami_locate_resource(char *fullpath, const char *file)
        locale = OpenLocale(NULL);
 
        for(i=0;i<10;i++) {
-               strcpy(fullpath,"PROGDIR:Resources/");
+               strcpy(fullpath, "PROGDIR:Resources/");
 
                if(locale->loc_PrefLanguages[i]) {
                        ami_gui_map_filename(&remapped, "PROGDIR:Resources",
@@ -839,7 +840,8 @@ static void ami_openscreenfirst(void)
        ami_theme_throbber_setup();
 }
 
-static struct RDArgs *ami_gui_commandline(int *argc, char **argv, int *nargc, 
char **nargv)
+static struct RDArgs *ami_gui_commandline(int *restrict argc, char ** argv,
+               int *restrict nargc, char ** nargv)
 {
        int new_argc = 1;
        struct RDArgs *args;
@@ -1403,8 +1405,8 @@ void ami_gui_free_space_box(struct IBox *bbox)
 #endif
 }
 
-static bool ami_spacebox_to_ns_coords(struct gui_window_2 *gwin, int *x, int 
*y,
-       int space_x, int space_y)
+static bool ami_spacebox_to_ns_coords(struct gui_window_2 *gwin,
+               int *restrict x, int *restrict y, int space_x, int space_y)
 {
        int ns_x = space_x;
        int ns_y = space_y;
@@ -1421,7 +1423,7 @@ static bool ami_spacebox_to_ns_coords(struct gui_window_2 
*gwin, int *x, int *y,
        return true;    
 }
 
-bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *x, int *y,
+bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *restrict x, int 
*restrict y,
        int mouse_x, int mouse_y)
 {
        int ns_x, ns_y;
@@ -1598,8 +1600,8 @@ static void ami_gui_menu_update_all(void)
        } while((node = nnode));
 }
 
-static void gui_window_get_dimensions(struct gui_window *g, int *width, int 
*height,
-               bool scaled)
+static void gui_window_get_dimensions(struct gui_window *g,
+               int *restrict width, int *restrict height, bool scaled)
 {
        struct IBox *bbox;
        if(!g) return;
@@ -1844,7 +1846,8 @@ static void ami_gui_refresh_favicon(void *p)
  * Returns the width of the size gadget as a convenience.
  */
 #ifdef __amigaos4__
-static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG 
*width, ULONG *height)
+static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin,
+               ULONG *restrict width, ULONG *restrict height)
 {
        static ULONG sz_gad_width = 0;
        static ULONG sz_gad_height = 0;
@@ -3127,7 +3130,8 @@ void ami_gui_update_hotlist_button(struct gui_window_2 
*gwin)
        }
 }
 
-static bool ami_gui_hotlist_add(void *userdata, int level, int item, const 
char *title, nsurl *url, bool is_folder)
+static bool ami_gui_hotlist_add(void *userdata, int level, int item,
+               const char *title, nsurl *url, bool is_folder)
 {
        struct ami_gui_tb_userdata *tb_userdata = (struct ami_gui_tb_userdata 
*)userdata;
        struct Node *speed_button_node;
@@ -4577,10 +4581,10 @@ static void gui_window_destroy(struct gui_window *g)
        win_destroyed = true;
 }
 
-static void gui_window_set_title(struct gui_window *g, const char *title)
+static void gui_window_set_title(struct gui_window *g, const char *restrict 
title)
 {
        struct Node *node;
-       char *utf8title;
+       char *restrict utf8title;
 
        if(!g) return;
        if(!title) return;
@@ -4705,11 +4709,11 @@ static void ami_gui_window_update_box_deferred(struct 
gui_window *g, bool draw)
 }
 
 static bool ami_gui_window_update_box_deferred_check(struct MinList 
*deferred_rects,
-                               const struct rect *new_rect, APTR mempool)
+                               const struct rect *restrict new_rect, APTR 
mempool)
 {
        struct nsObject *node;
        struct nsObject *nnode;
-       struct rect *rect;
+       struct rect *restrict rect;
        
        if(IsMinListEmpty(deferred_rects)) return true;
 
@@ -4740,10 +4744,10 @@ static bool 
ami_gui_window_update_box_deferred_check(struct MinList *deferred_re
        return true;
 }
 
-static void gui_window_update_box(struct gui_window *g, const struct rect 
*rect)
+static void gui_window_update_box(struct gui_window *g, const struct rect 
*restrict rect)
 {
        struct nsObject *nsobj;
-       struct rect *deferred_rect;
+       struct rect *restrict deferred_rect;
        if(!g) return;
        
        if(ami_gui_window_update_box_deferred_check(g->deferred_rects, rect,
@@ -4924,7 +4928,7 @@ void ami_get_vscroll_pos(struct gui_window_2 *gwin, ULONG 
*ys)
        *ys /= gwin->gw->scale;
 }
 
-static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy)
+static bool gui_window_get_scroll(struct gui_window *g, int *restrict sx, int 
*restrict sy)
 {
        ami_get_hscroll_pos(g->shared, (ULONG *)sx);
        ami_get_vscroll_pos(g->shared, (ULONG *)sy);
@@ -5269,7 +5273,7 @@ static bool gui_window_drag_start(struct gui_window *g, 
gui_drag_type type,
 /* return the text box at posn x,y in window coordinates
    x,y are updated to be document co-ordinates */
 
-bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y)
+bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *restrict x, ULONG 
*restrict y)
 {
        struct IBox *bbox;
        ULONG xs, ys;
@@ -5314,7 +5318,7 @@ BOOL ami_gadget_hit(Object *obj, int x, int y)
 
 Object *ami_gui_splash_open(void)
 {
-       Object *win_obj, *bm_obj;
+       Object *restrict win_obj, *restrict bm_obj;
        struct Window *win;
        struct Screen *wbscreen = LockPubScreen("Workbench");
        uint32 top = 0, left = 0;
diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h
index 4272920..69a103a 100644
--- a/frontends/amiga/gui.h
+++ b/frontends/amiga/gui.h
@@ -182,8 +182,8 @@ void ami_quit_netsurf(void);
 void ami_schedule_redraw(struct gui_window_2 *gwin, bool full_redraw);
 STRPTR ami_locale_langs(int *codeset);
 int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie);
-bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y);
-bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *x, int *y,
+bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *restrict x, ULONG 
*restrict y);
+bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *restrict x, int 
*restrict y,
        int mouse_x, int mouse_y);
 BOOL ami_gadget_hit(Object *obj, int x, int y);
 void ami_gui_history(struct gui_window_2 *gwin, bool back);
diff --git a/frontends/amiga/menu.c b/frontends/amiga/menu.c
index 5ae47de..c735141 100644
--- a/frontends/amiga/menu.c
+++ b/frontends/amiga/menu.c
@@ -564,7 +564,8 @@ void ami_free_menulabs(struct gui_window_2 *gwin)
 }
 
 static void ami_menu_alloc_item(struct gui_window_2 *gwin, int num, UBYTE type,
-                       const char *label, char key, const char *icon, void 
*func, void *hookdata)
+                       const char *restrict label, char key, const char 
*restrict icon,
+                       void *restrict func, void *restrict hookdata)
 {
        char menu_icon[1024];
 
diff --git a/frontends/amiga/misc.c b/frontends/amiga/misc.c
index 39a4bbf..2388651 100755
--- a/frontends/amiga/misc.c
+++ b/frontends/amiga/misc.c
@@ -85,7 +85,7 @@ APTR ami_misc_itempool_alloc(APTR pool, int size)
 #endif
 }
 
-void ami_misc_itempool_free(APTR pool, APTR item, int size)
+void ami_misc_itempool_free(APTR restrict pool, APTR restrict item, int size)
 {
 #ifdef __amigaos4__
        ItemPoolFree(pool, item);
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index 7e19db7..2ad7f2b 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -797,8 +797,9 @@ HOOKF(void, ami_bitmap_tile_hook, struct RastPort *, rp, 
struct BackFillMessage
        }
 }
 
-static void ami_bezier(struct bez_point *a, struct bez_point *b, struct 
bez_point *c,
-                       struct bez_point *d, double t, struct bez_point *p) {
+static void ami_bezier(struct bez_point *restrict a, struct bez_point 
*restrict b,
+                               struct bez_point *restrict c, struct bez_point 
*restrict d,
+                               double t, struct bez_point *restrict p) {
     p->x = pow((1 - t), 3) * a->x + 3 * t * pow((1 -t), 2) * b->x + 3 * (1-t) 
* pow(t, 2)* c->x + pow (t, 3)* d->x;
     p->y = pow((1 - t), 3) * a->y + 3 * t * pow((1 -t), 2) * b->y + 3 * (1-t) 
* pow(t, 2)* c->y + pow (t, 3)* d->y;
 }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=61979923c146b4456d24e794a44c08adc334cff6
commit 61979923c146b4456d24e794a44c08adc334cff6
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Use functions for determining throbber bitmap size

diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 36918a9..3eafa59 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -4228,8 +4228,8 @@ gui_window_create(struct browser_window *bw,
                                        CHILD_WeightedWidth, 
nsoption_int(web_search_width),
                                        LAYOUT_AddChild, 
g->shared->objects[GID_THROBBER] = SpaceObj,
                                                GA_ID,GID_THROBBER,
-                                               SPACE_MinWidth,throbber_width,
-                                               SPACE_MinHeight,throbber_height,
+                                               SPACE_MinWidth, 
ami_theme_throbber_get_width(),
+                                               SPACE_MinHeight, 
ami_theme_throbber_get_height(),
                                                SPACE_Transparent,TRUE,
                                        //      SPACE_RenderHook, 
&g->shared->throbber_hook,
                                        SpaceEnd,
diff --git a/frontends/amiga/theme.c b/frontends/amiga/theme.c
index d87bae3..4042d1d 100644
--- a/frontends/amiga/theme.c
+++ b/frontends/amiga/theme.c
@@ -51,9 +51,6 @@
 #include "amiga/theme.h"
 #include "amiga/misc.h"
 
-ULONG throbber_width;
-ULONG throbber_height;
-
 static struct BitMap *throbber = NULL;
 static struct bitmap *throbber_nsbm = NULL;
 static int throbber_frames, throbber_update_interval;
@@ -161,6 +158,16 @@ void ami_theme_init(void)
        }
 }
 
+int ami_theme_throbber_get_width(void)
+{
+       return bitmap_get_width(throbber_nsbm) / throbber_frames;
+}
+
+int ami_theme_throbber_get_height(void)
+{
+       return bitmap_get_height(throbber_nsbm);
+}
+
 void ami_theme_throbber_setup(void)
 {
        char throbberfile[1024];
@@ -174,8 +181,6 @@ void ami_theme_throbber_setup(void)
        bm = ami_bitmap_from_datatype(throbberfile);
        throbber = ami_bitmap_get_native(bm, bitmap_get_width(bm), 
bitmap_get_height(bm), NULL);
 
-       throbber_width = bitmap_get_width(bm) / throbber_frames;
-       throbber_height = bitmap_get_height(bm);
        throbber_nsbm = bm;
 }
 
@@ -456,8 +461,10 @@ void gui_window_stop_throbber(struct gui_window *g)
                }
 
                if(throbber != NULL) {
-                       BltBitMapRastPort(throbber, 0, 0, 
g->shared->win->RPort, bbox->Left,
-                               bbox->Top, throbber_width, throbber_height, 
0x0C0);
+                       BltBitMapRastPort(throbber, 0, 0, g->shared->win->RPort,
+                               bbox->Left, bbox->Top, 
+                               ami_theme_throbber_get_width(), 
ami_theme_throbber_get_height(),
+                               0x0C0);
                }
                ami_gui_free_space_box(bbox);
        }
@@ -490,12 +497,12 @@ static void ami_throbber_update(void *p)
 
                if(throbber != NULL) {
 #ifdef __amigaos4__
-                       BltBitMapTags(BLITA_SrcX, throbber_width * frame,
+                       BltBitMapTags(BLITA_SrcX, 
ami_theme_throbber_get_width() * frame,
                                                BLITA_SrcY, 0,
                                                BLITA_DestX, bbox->Left,
                                                BLITA_DestY, bbox->Top,
-                                               BLITA_Width, throbber_width,
-                                               BLITA_Height, throbber_height,
+                                               BLITA_Width, 
ami_theme_throbber_get_width(),
+                                               BLITA_Height, 
ami_theme_throbber_get_height(),
                                                BLITA_Source, throbber,
                                                BLITA_Dest, 
g->shared->win->RPort,
                                                BLITA_SrcType, BLITT_BITMAP,
@@ -503,8 +510,11 @@ static void ami_throbber_update(void *p)
                                        //      BLITA_UseSrcAlpha, TRUE,
                                        TAG_DONE);
 #else
-                       BltBitMapRastPort(throbber, throbber_width * frame, 0, 
g->shared->win->RPort,
-                               bbox->Left, bbox->Top, throbber_width, 
throbber_height, 0xC0);
+                       BltBitMapRastPort(throbber, 
ami_theme_throbber_get_width() * frame,
+                               0, g->shared->win->RPort,
+                               bbox->Left, bbox->Top,
+                               ami_theme_throbber_get_width(), 
ami_theme_throbber_get_height(),
+                               0xC0);
 #endif
                }
                ami_gui_free_space_box(bbox);
diff --git a/frontends/amiga/theme.h b/frontends/amiga/theme.h
index bf6ba57..6de7bc1 100644
--- a/frontends/amiga/theme.h
+++ b/frontends/amiga/theme.h
@@ -28,12 +28,12 @@ struct gui_window;
 #define AMI_GUI_POINTER_DRAG  GUI_POINTER_PROGRESS+2
 #define AMI_LASTPOINTER AMI_GUI_POINTER_DRAG
 
-extern ULONG throbber_width;
-extern ULONG throbber_height;
-
 void ami_theme_init(void);
 void ami_get_theme_filename(char *filename, const char *themestring, bool 
protocol);
 
+int ami_theme_throbber_get_width(void);
+int ami_theme_throbber_get_height(void);
+
 void ami_theme_throbber_setup(void);
 void ami_theme_throbber_free(void);
 void ami_update_throbber(struct gui_window_2 *g,bool redraw);


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=ea9932dd00cc5384bc9f19d2addf683712983a4f
commit ea9932dd00cc5384bc9f19d2addf683712983a4f
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Handle closing windows and quitting from the menu differently

diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 3806601..36918a9 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -2544,16 +2544,14 @@ static void ami_handle_msg(void)
 //     ReplyMsg((struct Message *)message);
                }
 
+               if(gwin->closed == true) {
+                       ami_gui_close_window(gwin);
+               }
+
        } while((node = nnode));
 
-       if(ami_menu_window_close)
-       {
-               if(ami_menu_window_close == (void *)AMI_MENU_WINDOW_CLOSE_ALL)
-                       ami_quit_netsurf();
-               else
-                       ami_gui_close_window(ami_menu_window_close);
-                       
-               ami_menu_window_close = NULL;
+       if(ami_menu_quit_selected() == true){
+               ami_quit_netsurf();
        }
        
        if(ami_menu_get_check_toggled() == true) {
diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h
index 8b0e223..4272920 100644
--- a/frontends/amiga/gui.h
+++ b/frontends/amiga/gui.h
@@ -144,6 +144,7 @@ struct gui_window_2 {
        gui_pointer_shape mouse_pointer;
        struct Menu *imenu; /* Intuition menu */
        struct VisualInfo *vi; /* For GadTools menu */
+       bool closed; /* Window has been closed (via menu) */
 };
 
 struct gui_window
diff --git a/frontends/amiga/menu.c b/frontends/amiga/menu.c
index e7b4c6d..5ae47de 100644
--- a/frontends/amiga/menu.c
+++ b/frontends/amiga/menu.c
@@ -87,8 +87,7 @@ enum {
        NSA_GLYPH_MAX
 };
 
-struct gui_window_2 *ami_menu_window_close = NULL;
-
+static bool menu_quit = false;
 static bool ami_menu_check_toggled = false;
 static BOOL menualreadyinit;
 static Object *menu_glyph[NSA_GLYPH_MAX];
@@ -113,6 +112,11 @@ bool ami_menu_get_check_toggled(void)
        return check_toggled;
 }
 
+bool ami_menu_quit_selected(void)
+{
+       return menu_quit;
+}
+
 /*
  * The below functions are called automatically by window.class when menu 
items are selected.
  */
@@ -175,7 +179,7 @@ HOOKF(void, ami_menu_item_project_closewin, APTR, window, 
struct IntuiMessage *)
        struct gui_window_2 *gwin;
        GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
 
-       ami_menu_window_close = gwin;
+       gwin->closed = true;
 }
 
 HOOKF(void, ami_menu_item_project_print, APTR, window, struct IntuiMessage *)
@@ -253,7 +257,7 @@ HOOKF(void, ami_menu_item_project_about, APTR, window, 
struct IntuiMessage *)
 
 HOOKF(void, ami_menu_item_project_quit, APTR, window, struct IntuiMessage *)
 {
-       ami_menu_window_close = AMI_MENU_WINDOW_CLOSE_ALL;
+       menu_quit = true;
 }
 
 HOOKF(void, ami_menu_item_edit_cut, APTR, window, struct IntuiMessage *)
diff --git a/frontends/amiga/menu.h b/frontends/amiga/menu.h
index 91077b6..ac74f38 100755
--- a/frontends/amiga/menu.h
+++ b/frontends/amiga/menu.h
@@ -129,14 +129,9 @@ enum {
 #define AMI_MENU_BACKIMG FULLMENUNUM(2,8,1)
 #define AMI_MENU_JS FULLMENUNUM(2,9,0)
 
-/** A special value for ami_menu_window_close */
-#define AMI_MENU_WINDOW_CLOSE_ALL (void *)1
-
 struct gui_window;
 struct gui_window_2;
 
-extern struct gui_window_2 *ami_menu_window_close;
-
 void ami_free_menulabs(struct gui_window_2 *gwin);
 struct Menu *ami_menu_create(struct gui_window_2 *gwin);
 void ami_menu_refresh(struct gui_window_2 *gwin);
@@ -158,5 +153,12 @@ void ami_menu_set_check_toggled(void);
  * \return true if the menus need refreshing
  */
 bool ami_menu_get_check_toggled(void);
+
+/**
+ * Gets if NetSurf has been quit from the menu
+ *
+ * \return true if NetSurf has been quit
+ */
+bool ami_menu_quit_selected(void);
 #endif
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=65bf58e4a1999fca0de1279e143f714acc19fe8d
commit 65bf58e4a1999fca0de1279e143f714acc19fe8d
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Remove ami_menu_toggle_checked global

diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 4cfb398..3806601 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -2556,9 +2556,8 @@ static void ami_handle_msg(void)
                ami_menu_window_close = NULL;
        }
        
-       if(ami_menu_check_toggled) {
+       if(ami_menu_get_check_toggled() == true) {
                ami_gui_menu_update_all();
-               ami_menu_check_toggled = false;
        }
 }
 
diff --git a/frontends/amiga/gui_options.c b/frontends/amiga/gui_options.c
index 344d823..21067fb 100755
--- a/frontends/amiga/gui_options.c
+++ b/frontends/amiga/gui_options.c
@@ -2061,8 +2061,7 @@ static void ami_gui_opts_use(bool save)
                ami_font_savescanner(); /* just in case it has changed and been 
used only */
        }
 
-       ami_menu_check_toggled = true;
-
+       ami_menu_set_check_toggled();
        ami_update_pointer(gow->win, GUI_POINTER_DEFAULT);
 }
 
diff --git a/frontends/amiga/menu.c b/frontends/amiga/menu.c
index 58ea27e..e7b4c6d 100644
--- a/frontends/amiga/menu.c
+++ b/frontends/amiga/menu.c
@@ -88,8 +88,8 @@ enum {
 };
 
 struct gui_window_2 *ami_menu_window_close = NULL;
-bool ami_menu_check_toggled = false;
 
+static bool ami_menu_check_toggled = false;
 static BOOL menualreadyinit;
 static Object *menu_glyph[NSA_GLYPH_MAX];
 static int menu_glyph_width[NSA_GLYPH_MAX];
@@ -101,6 +101,18 @@ const char * const verdate;
 static nserror ami_menu_scan(struct tree *tree, struct gui_window_2 *gwin);
 void ami_menu_arexx_scan(struct gui_window_2 *gwin);
 
+void ami_menu_set_check_toggled(void)
+{
+       ami_menu_check_toggled = true;
+}
+
+bool ami_menu_get_check_toggled(void)
+{
+       bool check_toggled = ami_menu_check_toggled;
+       ami_menu_check_toggled = false;
+       return check_toggled;
+}
+
 /*
  * The below functions are called automatically by window.class when menu 
items are selected.
  */
@@ -354,7 +366,7 @@ HOOKF(void, ami_menu_item_browser_foreimg, APTR, window, 
struct IntuiMessage *)
        if(ItemAddress(menustrip, msg->Code)->Flags & CHECKED) checked = true;
        
        nsoption_set_bool(foreground_images, checked);
-       ami_menu_check_toggled = true;
+       ami_menu_set_check_toggled();
 }
 
 HOOKF(void, ami_menu_item_browser_backimg, APTR, window, struct IntuiMessage *)
@@ -366,7 +378,7 @@ HOOKF(void, ami_menu_item_browser_backimg, APTR, window, 
struct IntuiMessage *)
        if(ItemAddress(menustrip, msg->Code)->Flags & CHECKED) checked = true;
        
        nsoption_set_bool(background_images, checked);
-       ami_menu_check_toggled = true;
+       ami_menu_set_check_toggled();
 }
 
 HOOKF(void, ami_menu_item_browser_enablejs, APTR, window, struct IntuiMessage 
*)
@@ -378,7 +390,7 @@ HOOKF(void, ami_menu_item_browser_enablejs, APTR, window, 
struct IntuiMessage *)
        if(ItemAddress(menustrip, msg->Code)->Flags & CHECKED) checked = true;
        
        nsoption_set_bool(enable_javascript, checked);
-       ami_menu_check_toggled = true;
+       ami_menu_set_check_toggled();
 }
 
 HOOKF(void, ami_menu_item_browser_scale_decrease, APTR, window, struct 
IntuiMessage *)
diff --git a/frontends/amiga/menu.h b/frontends/amiga/menu.h
index 22e9984..91077b6 100755
--- a/frontends/amiga/menu.h
+++ b/frontends/amiga/menu.h
@@ -136,7 +136,6 @@ struct gui_window;
 struct gui_window_2;
 
 extern struct gui_window_2 *ami_menu_window_close;
-extern bool ami_menu_check_toggled;
 
 void ami_free_menulabs(struct gui_window_2 *gwin);
 struct Menu *ami_menu_create(struct gui_window_2 *gwin);
@@ -146,5 +145,18 @@ void ami_menu_update_disabled(struct gui_window *g, struct 
hlcache_handle *c);
 void ami_menu_free_glyphs(void);
 void ami_menu_free(struct gui_window_2 *gwin);
 
+/**
+ * Sets that an item linked to a toggle menu item has been changed.
+ */
+void ami_menu_set_check_toggled(void);
+
+/**
+ * Gets if the menu needs updating because an item linked
+ * to a toggle menu item has been changed.
+ * NB: This also *clears* the state
+ *
+ * \return true if the menus need refreshing
+ */
+bool ami_menu_get_check_toggled(void);
 #endif
 


-----------------------------------------------------------------------

Summary of changes:
 frontends/amiga/bitmap.c      |   10 +++---
 frontends/amiga/font_bullet.c |    9 ++---
 frontends/amiga/font_cache.h  |    6 ++--
 frontends/amiga/gui.c         |   75 +++++++++++++++++++++--------------------
 frontends/amiga/gui.h         |    5 +--
 frontends/amiga/gui_options.c |    3 +-
 frontends/amiga/menu.c        |   35 ++++++++++++++-----
 frontends/amiga/menu.h        |   26 ++++++++++----
 frontends/amiga/misc.c        |    2 +-
 frontends/amiga/plotters.c    |    5 +--
 frontends/amiga/theme.c       |   34 ++++++++++++-------
 frontends/amiga/theme.h       |    6 ++--
 12 files changed, 131 insertions(+), 85 deletions(-)

diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c
index d6d0c76..5b8117a 100644
--- a/frontends/amiga/bitmap.c
+++ b/frontends/amiga/bitmap.c
@@ -398,9 +398,10 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
        return bm;
 }
 
-static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap, int 
width, int height, struct BitMap *friendbm, int type)
+static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap,
+                       int width, int height, struct BitMap *restrict 
friendbm, int type)
 {
-       struct BitMap *tbm = NULL;
+       struct BitMap *restrict tbm = NULL;
 
        if(bitmap->nativebm)
        {
@@ -473,7 +474,7 @@ static inline struct BitMap *ami_bitmap_get_generic(struct 
bitmap *bitmap, int w
 
        if((bitmap->width != width) || (bitmap->height != height))
        {
-               struct BitMap *scaledbm;
+               struct BitMap *restrict scaledbm;
                struct BitScaleArgs bsa;
                int depth = 32;
                if(type == AMI_NSBM_PALETTEMAPPED) depth = 8;
@@ -539,7 +540,8 @@ static inline struct BitMap *ami_bitmap_get_generic(struct 
bitmap *bitmap, int w
 }
 
 
-static inline struct BitMap *ami_bitmap_get_truecolour(struct bitmap 
*bitmap,int width,int height,struct BitMap *friendbm)
+static inline struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,
+                       int width, int height, struct BitMap *friendbm)
 {
        if((bitmap->native != AMI_NSBM_NONE) && (bitmap->native != 
AMI_NSBM_TRUECOLOUR)) {
                amiga_bitmap_modified(bitmap);
diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c
index b0c2999..7220cb0 100644
--- a/frontends/amiga/font_bullet.c
+++ b/frontends/amiga/font_bullet.c
@@ -136,9 +136,9 @@ static lwc_string *glypharray[0xffff + 1];
 static struct List ami_diskfontlib_list;
 
 static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct 
RastPort *rp,
-               uint16 *char1, uint16 *char2, uint32 x, uint32 y, uint32 
emwidth, bool aa);
+               uint16 *restrict char1, uint16 *restrict char2, uint32 x, 
uint32 y, uint32 emwidth, bool aa);
 static inline int32 ami_font_width_glyph(struct OutlineFont *ofont, 
-               const uint16 *char1, const uint16 *char2, uint32 emwidth);
+               const uint16 *restrict char1, const uint16 *restrict char2, 
uint32 emwidth);
 static struct OutlineFont *ami_open_outline_font(const plot_font_style_t 
*fstyle,
                const uint16 *codepoint);
 static inline ULONG ami_font_unicode_width(const char *string, ULONG length,
@@ -530,7 +530,8 @@ static struct OutlineFont *ami_open_outline_font(const 
plot_font_style_t *fstyle
 }
 
 static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct 
RastPort *rp,
-               uint16 *char1, uint16 *char2, uint32 x, uint32 y, uint32 
emwidth, bool aa)
+               uint16 *restrict char1, uint16 *restrict char2, uint32 x, 
uint32 y,
+               uint32 emwidth, bool aa)
 {
        struct GlyphMap *glyph;
        UBYTE *glyphbm;
@@ -637,7 +638,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont 
*ofont, struct RastPo
 }
 
 static inline int32 ami_font_width_glyph(struct OutlineFont *ofont, 
-               const uint16 *char1, const uint16 *char2, uint32 emwidth)
+               const uint16 *restrict char1, const uint16 *restrict char2, 
uint32 emwidth)
 {
        int32 char_advance = 0;
        FIXED kern = 0;
diff --git a/frontends/amiga/font_cache.h b/frontends/amiga/font_cache.h
index 7c95ba5..a52f2f1 100644
--- a/frontends/amiga/font_cache.h
+++ b/frontends/amiga/font_cache.h
@@ -27,9 +27,9 @@ struct ami_font_cache_node
        struct SkipNode skip_node;
 #endif
        struct OutlineFont *font;
-       char *bold;
-       char *italic;
-       char *bolditalic;
+       char *restrict bold;
+       char *restrict italic;
+       char *restrict bolditalic;
        struct TimeVal lastused;
 };
 
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 4cfb398..9bf1689 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -219,7 +219,7 @@ static const __attribute__((used)) char *stack_cookie = 
"\0$STACK:196608\0";
 const char * const versvn;
 const char * const verdate;
 
-void ami_switch_tab(struct gui_window_2 *gwin,bool redraw);
+void ami_switch_tab(struct gui_window_2 *gwin, bool redraw);
 void ami_change_tab(struct gui_window_2 *gwin, int direction);
 void ami_get_hscroll_pos(struct gui_window_2 *gwin, ULONG *xs);
 void ami_get_vscroll_pos(struct gui_window_2 *gwin, ULONG *ys);
@@ -228,13 +228,13 @@ Object *ami_gui_splash_open(void);
 void ami_gui_splash_close(Object *win_obj);
 HOOKF(uint32, ami_set_favicon_render_hook, APTR, space, struct gpRender *);
 HOOKF(uint32, ami_set_throbber_render_hook, APTR, space, struct gpRender *);
-bool ami_gui_map_filename(char **remapped, const char *path, const char *file,
-       const char *map);
+bool ami_gui_map_filename(char **remapped, const char *restrict path, const 
char *restrict file,
+       const char *restrict map);
 static void ami_gui_window_update_box_deferred(struct gui_window *g, bool 
draw);
 static void ami_do_redraw(struct gui_window_2 *g);
 static void ami_schedule_redraw_remove(struct gui_window_2 *gwin);
 
-static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy);
+static bool gui_window_get_scroll(struct gui_window *g, int *restrict sx, int 
*restrict sy);
 static void gui_window_set_scroll(struct gui_window *g, int sx, int sy);
 static void gui_window_remove_caret(struct gui_window *g);
 static void gui_window_place_caret(struct gui_window *g, int x, int y, int 
height, const struct rect *clip);
@@ -289,13 +289,14 @@ STRPTR ami_locale_langs(int *codeset)
        return acceptlangs;
 }
 
-bool ami_gui_map_filename(char **remapped, const char *path, const char *file, 
const char *map)
+bool ami_gui_map_filename(char **remapped, const char *restrict path,
+               const char *restrict file, const char *restrict map)
 {
        BPTR fh = 0;
        char *mapfile = NULL;
        size_t mapfile_size = 0;
        char buffer[1024];
-       char *realfname;
+       char *restrict realfname;
        bool found = false;
 
        netsurf_mkpath(&mapfile, &mapfile_size, 2, path, map);
@@ -386,7 +387,7 @@ bool ami_locate_resource(char *fullpath, const char *file)
        locale = OpenLocale(NULL);
 
        for(i=0;i<10;i++) {
-               strcpy(fullpath,"PROGDIR:Resources/");
+               strcpy(fullpath, "PROGDIR:Resources/");
 
                if(locale->loc_PrefLanguages[i]) {
                        ami_gui_map_filename(&remapped, "PROGDIR:Resources",
@@ -839,7 +840,8 @@ static void ami_openscreenfirst(void)
        ami_theme_throbber_setup();
 }
 
-static struct RDArgs *ami_gui_commandline(int *argc, char **argv, int *nargc, 
char **nargv)
+static struct RDArgs *ami_gui_commandline(int *restrict argc, char ** argv,
+               int *restrict nargc, char ** nargv)
 {
        int new_argc = 1;
        struct RDArgs *args;
@@ -860,7 +862,7 @@ static struct RDArgs *ami_gui_commandline(int *argc, char 
**argv, int *nargc, ch
                if(rarray[A_URL]) {
                        LOG("URL %s specified on command line",
                            (char *)rarray[A_URL]);
-                       temp_homepage_url = ami_to_utf8_easy((char 
*)rarray[A_URL]);
+                       temp_homepage_url = strdup((char *)rarray[A_URL]); 
/**\todo allow IDNs */
                }
 
                if(rarray[A_USERSDIR]) {
@@ -1403,8 +1405,8 @@ void ami_gui_free_space_box(struct IBox *bbox)
 #endif
 }
 
-static bool ami_spacebox_to_ns_coords(struct gui_window_2 *gwin, int *x, int 
*y,
-       int space_x, int space_y)
+static bool ami_spacebox_to_ns_coords(struct gui_window_2 *gwin,
+               int *restrict x, int *restrict y, int space_x, int space_y)
 {
        int ns_x = space_x;
        int ns_y = space_y;
@@ -1421,7 +1423,7 @@ static bool ami_spacebox_to_ns_coords(struct gui_window_2 
*gwin, int *x, int *y,
        return true;    
 }
 
-bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *x, int *y,
+bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *restrict x, int 
*restrict y,
        int mouse_x, int mouse_y)
 {
        int ns_x, ns_y;
@@ -1598,8 +1600,8 @@ static void ami_gui_menu_update_all(void)
        } while((node = nnode));
 }
 
-static void gui_window_get_dimensions(struct gui_window *g, int *width, int 
*height,
-               bool scaled)
+static void gui_window_get_dimensions(struct gui_window *g,
+               int *restrict width, int *restrict height, bool scaled)
 {
        struct IBox *bbox;
        if(!g) return;
@@ -1844,7 +1846,8 @@ static void ami_gui_refresh_favicon(void *p)
  * Returns the width of the size gadget as a convenience.
  */
 #ifdef __amigaos4__
-static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG 
*width, ULONG *height)
+static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin,
+               ULONG *restrict width, ULONG *restrict height)
 {
        static ULONG sz_gad_width = 0;
        static ULONG sz_gad_height = 0;
@@ -2544,21 +2547,18 @@ static void ami_handle_msg(void)
 //     ReplyMsg((struct Message *)message);
                }
 
+               if(gwin->closed == true) {
+                       ami_gui_close_window(gwin);
+               }
+
        } while((node = nnode));
 
-       if(ami_menu_window_close)
-       {
-               if(ami_menu_window_close == (void *)AMI_MENU_WINDOW_CLOSE_ALL)
-                       ami_quit_netsurf();
-               else
-                       ami_gui_close_window(ami_menu_window_close);
-                       
-               ami_menu_window_close = NULL;
+       if(ami_menu_quit_selected() == true){
+               ami_quit_netsurf();
        }
        
-       if(ami_menu_check_toggled) {
+       if(ami_menu_get_check_toggled() == true) {
                ami_gui_menu_update_all();
-               ami_menu_check_toggled = false;
        }
 }
 
@@ -3130,7 +3130,8 @@ void ami_gui_update_hotlist_button(struct gui_window_2 
*gwin)
        }
 }
 
-static bool ami_gui_hotlist_add(void *userdata, int level, int item, const 
char *title, nsurl *url, bool is_folder)
+static bool ami_gui_hotlist_add(void *userdata, int level, int item,
+               const char *title, nsurl *url, bool is_folder)
 {
        struct ami_gui_tb_userdata *tb_userdata = (struct ami_gui_tb_userdata 
*)userdata;
        struct Node *speed_button_node;
@@ -4231,8 +4232,8 @@ gui_window_create(struct browser_window *bw,
                                        CHILD_WeightedWidth, 
nsoption_int(web_search_width),
                                        LAYOUT_AddChild, 
g->shared->objects[GID_THROBBER] = SpaceObj,
                                                GA_ID,GID_THROBBER,
-                                               SPACE_MinWidth,throbber_width,
-                                               SPACE_MinHeight,throbber_height,
+                                               SPACE_MinWidth, 
ami_theme_throbber_get_width(),
+                                               SPACE_MinHeight, 
ami_theme_throbber_get_height(),
                                                SPACE_Transparent,TRUE,
                                        //      SPACE_RenderHook, 
&g->shared->throbber_hook,
                                        SpaceEnd,
@@ -4580,10 +4581,10 @@ static void gui_window_destroy(struct gui_window *g)
        win_destroyed = true;
 }
 
-static void gui_window_set_title(struct gui_window *g, const char *title)
+static void gui_window_set_title(struct gui_window *g, const char *restrict 
title)
 {
        struct Node *node;
-       char *utf8title;
+       char *restrict utf8title;
 
        if(!g) return;
        if(!title) return;
@@ -4708,11 +4709,11 @@ static void ami_gui_window_update_box_deferred(struct 
gui_window *g, bool draw)
 }
 
 static bool ami_gui_window_update_box_deferred_check(struct MinList 
*deferred_rects,
-                               const struct rect *new_rect, APTR mempool)
+                               const struct rect *restrict new_rect, APTR 
mempool)
 {
        struct nsObject *node;
        struct nsObject *nnode;
-       struct rect *rect;
+       struct rect *restrict rect;
        
        if(IsMinListEmpty(deferred_rects)) return true;
 
@@ -4743,10 +4744,10 @@ static bool 
ami_gui_window_update_box_deferred_check(struct MinList *deferred_re
        return true;
 }
 
-static void gui_window_update_box(struct gui_window *g, const struct rect 
*rect)
+static void gui_window_update_box(struct gui_window *g, const struct rect 
*restrict rect)
 {
        struct nsObject *nsobj;
-       struct rect *deferred_rect;
+       struct rect *restrict deferred_rect;
        if(!g) return;
        
        if(ami_gui_window_update_box_deferred_check(g->deferred_rects, rect,
@@ -4927,7 +4928,7 @@ void ami_get_vscroll_pos(struct gui_window_2 *gwin, ULONG 
*ys)
        *ys /= gwin->gw->scale;
 }
 
-static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy)
+static bool gui_window_get_scroll(struct gui_window *g, int *restrict sx, int 
*restrict sy)
 {
        ami_get_hscroll_pos(g->shared, (ULONG *)sx);
        ami_get_vscroll_pos(g->shared, (ULONG *)sy);
@@ -5272,7 +5273,7 @@ static bool gui_window_drag_start(struct gui_window *g, 
gui_drag_type type,
 /* return the text box at posn x,y in window coordinates
    x,y are updated to be document co-ordinates */
 
-bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y)
+bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *restrict x, ULONG 
*restrict y)
 {
        struct IBox *bbox;
        ULONG xs, ys;
@@ -5317,7 +5318,7 @@ BOOL ami_gadget_hit(Object *obj, int x, int y)
 
 Object *ami_gui_splash_open(void)
 {
-       Object *win_obj, *bm_obj;
+       Object *restrict win_obj, *restrict bm_obj;
        struct Window *win;
        struct Screen *wbscreen = LockPubScreen("Workbench");
        uint32 top = 0, left = 0;
diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h
index 8b0e223..69a103a 100644
--- a/frontends/amiga/gui.h
+++ b/frontends/amiga/gui.h
@@ -144,6 +144,7 @@ struct gui_window_2 {
        gui_pointer_shape mouse_pointer;
        struct Menu *imenu; /* Intuition menu */
        struct VisualInfo *vi; /* For GadTools menu */
+       bool closed; /* Window has been closed (via menu) */
 };
 
 struct gui_window
@@ -181,8 +182,8 @@ void ami_quit_netsurf(void);
 void ami_schedule_redraw(struct gui_window_2 *gwin, bool full_redraw);
 STRPTR ami_locale_langs(int *codeset);
 int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie);
-bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y);
-bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *x, int *y,
+bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *restrict x, ULONG 
*restrict y);
+bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *restrict x, int 
*restrict y,
        int mouse_x, int mouse_y);
 BOOL ami_gadget_hit(Object *obj, int x, int y);
 void ami_gui_history(struct gui_window_2 *gwin, bool back);
diff --git a/frontends/amiga/gui_options.c b/frontends/amiga/gui_options.c
index 344d823..21067fb 100755
--- a/frontends/amiga/gui_options.c
+++ b/frontends/amiga/gui_options.c
@@ -2061,8 +2061,7 @@ static void ami_gui_opts_use(bool save)
                ami_font_savescanner(); /* just in case it has changed and been 
used only */
        }
 
-       ami_menu_check_toggled = true;
-
+       ami_menu_set_check_toggled();
        ami_update_pointer(gow->win, GUI_POINTER_DEFAULT);
 }
 
diff --git a/frontends/amiga/menu.c b/frontends/amiga/menu.c
index 58ea27e..c735141 100644
--- a/frontends/amiga/menu.c
+++ b/frontends/amiga/menu.c
@@ -87,9 +87,8 @@ enum {
        NSA_GLYPH_MAX
 };
 
-struct gui_window_2 *ami_menu_window_close = NULL;
-bool ami_menu_check_toggled = false;
-
+static bool menu_quit = false;
+static bool ami_menu_check_toggled = false;
 static BOOL menualreadyinit;
 static Object *menu_glyph[NSA_GLYPH_MAX];
 static int menu_glyph_width[NSA_GLYPH_MAX];
@@ -101,6 +100,23 @@ const char * const verdate;
 static nserror ami_menu_scan(struct tree *tree, struct gui_window_2 *gwin);
 void ami_menu_arexx_scan(struct gui_window_2 *gwin);
 
+void ami_menu_set_check_toggled(void)
+{
+       ami_menu_check_toggled = true;
+}
+
+bool ami_menu_get_check_toggled(void)
+{
+       bool check_toggled = ami_menu_check_toggled;
+       ami_menu_check_toggled = false;
+       return check_toggled;
+}
+
+bool ami_menu_quit_selected(void)
+{
+       return menu_quit;
+}
+
 /*
  * The below functions are called automatically by window.class when menu 
items are selected.
  */
@@ -163,7 +179,7 @@ HOOKF(void, ami_menu_item_project_closewin, APTR, window, 
struct IntuiMessage *)
        struct gui_window_2 *gwin;
        GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
 
-       ami_menu_window_close = gwin;
+       gwin->closed = true;
 }
 
 HOOKF(void, ami_menu_item_project_print, APTR, window, struct IntuiMessage *)
@@ -241,7 +257,7 @@ HOOKF(void, ami_menu_item_project_about, APTR, window, 
struct IntuiMessage *)
 
 HOOKF(void, ami_menu_item_project_quit, APTR, window, struct IntuiMessage *)
 {
-       ami_menu_window_close = AMI_MENU_WINDOW_CLOSE_ALL;
+       menu_quit = true;
 }
 
 HOOKF(void, ami_menu_item_edit_cut, APTR, window, struct IntuiMessage *)
@@ -354,7 +370,7 @@ HOOKF(void, ami_menu_item_browser_foreimg, APTR, window, 
struct IntuiMessage *)
        if(ItemAddress(menustrip, msg->Code)->Flags & CHECKED) checked = true;
        
        nsoption_set_bool(foreground_images, checked);
-       ami_menu_check_toggled = true;
+       ami_menu_set_check_toggled();
 }
 
 HOOKF(void, ami_menu_item_browser_backimg, APTR, window, struct IntuiMessage *)
@@ -366,7 +382,7 @@ HOOKF(void, ami_menu_item_browser_backimg, APTR, window, 
struct IntuiMessage *)
        if(ItemAddress(menustrip, msg->Code)->Flags & CHECKED) checked = true;
        
        nsoption_set_bool(background_images, checked);
-       ami_menu_check_toggled = true;
+       ami_menu_set_check_toggled();
 }
 
 HOOKF(void, ami_menu_item_browser_enablejs, APTR, window, struct IntuiMessage 
*)
@@ -378,7 +394,7 @@ HOOKF(void, ami_menu_item_browser_enablejs, APTR, window, 
struct IntuiMessage *)
        if(ItemAddress(menustrip, msg->Code)->Flags & CHECKED) checked = true;
        
        nsoption_set_bool(enable_javascript, checked);
-       ami_menu_check_toggled = true;
+       ami_menu_set_check_toggled();
 }
 
 HOOKF(void, ami_menu_item_browser_scale_decrease, APTR, window, struct 
IntuiMessage *)
@@ -548,7 +564,8 @@ void ami_free_menulabs(struct gui_window_2 *gwin)
 }
 
 static void ami_menu_alloc_item(struct gui_window_2 *gwin, int num, UBYTE type,
-                       const char *label, char key, const char *icon, void 
*func, void *hookdata)
+                       const char *restrict label, char key, const char 
*restrict icon,
+                       void *restrict func, void *restrict hookdata)
 {
        char menu_icon[1024];
 
diff --git a/frontends/amiga/menu.h b/frontends/amiga/menu.h
index 22e9984..ac74f38 100755
--- a/frontends/amiga/menu.h
+++ b/frontends/amiga/menu.h
@@ -129,15 +129,9 @@ enum {
 #define AMI_MENU_BACKIMG FULLMENUNUM(2,8,1)
 #define AMI_MENU_JS FULLMENUNUM(2,9,0)
 
-/** A special value for ami_menu_window_close */
-#define AMI_MENU_WINDOW_CLOSE_ALL (void *)1
-
 struct gui_window;
 struct gui_window_2;
 
-extern struct gui_window_2 *ami_menu_window_close;
-extern bool ami_menu_check_toggled;
-
 void ami_free_menulabs(struct gui_window_2 *gwin);
 struct Menu *ami_menu_create(struct gui_window_2 *gwin);
 void ami_menu_refresh(struct gui_window_2 *gwin);
@@ -146,5 +140,25 @@ void ami_menu_update_disabled(struct gui_window *g, struct 
hlcache_handle *c);
 void ami_menu_free_glyphs(void);
 void ami_menu_free(struct gui_window_2 *gwin);
 
+/**
+ * Sets that an item linked to a toggle menu item has been changed.
+ */
+void ami_menu_set_check_toggled(void);
+
+/**
+ * Gets if the menu needs updating because an item linked
+ * to a toggle menu item has been changed.
+ * NB: This also *clears* the state
+ *
+ * \return true if the menus need refreshing
+ */
+bool ami_menu_get_check_toggled(void);
+
+/**
+ * Gets if NetSurf has been quit from the menu
+ *
+ * \return true if NetSurf has been quit
+ */
+bool ami_menu_quit_selected(void);
 #endif
 
diff --git a/frontends/amiga/misc.c b/frontends/amiga/misc.c
index 39a4bbf..2388651 100755
--- a/frontends/amiga/misc.c
+++ b/frontends/amiga/misc.c
@@ -85,7 +85,7 @@ APTR ami_misc_itempool_alloc(APTR pool, int size)
 #endif
 }
 
-void ami_misc_itempool_free(APTR pool, APTR item, int size)
+void ami_misc_itempool_free(APTR restrict pool, APTR restrict item, int size)
 {
 #ifdef __amigaos4__
        ItemPoolFree(pool, item);
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index 7e19db7..2ad7f2b 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -797,8 +797,9 @@ HOOKF(void, ami_bitmap_tile_hook, struct RastPort *, rp, 
struct BackFillMessage
        }
 }
 
-static void ami_bezier(struct bez_point *a, struct bez_point *b, struct 
bez_point *c,
-                       struct bez_point *d, double t, struct bez_point *p) {
+static void ami_bezier(struct bez_point *restrict a, struct bez_point 
*restrict b,
+                               struct bez_point *restrict c, struct bez_point 
*restrict d,
+                               double t, struct bez_point *restrict p) {
     p->x = pow((1 - t), 3) * a->x + 3 * t * pow((1 -t), 2) * b->x + 3 * (1-t) 
* pow(t, 2)* c->x + pow (t, 3)* d->x;
     p->y = pow((1 - t), 3) * a->y + 3 * t * pow((1 -t), 2) * b->y + 3 * (1-t) 
* pow(t, 2)* c->y + pow (t, 3)* d->y;
 }
diff --git a/frontends/amiga/theme.c b/frontends/amiga/theme.c
index d87bae3..4042d1d 100644
--- a/frontends/amiga/theme.c
+++ b/frontends/amiga/theme.c
@@ -51,9 +51,6 @@
 #include "amiga/theme.h"
 #include "amiga/misc.h"
 
-ULONG throbber_width;
-ULONG throbber_height;
-
 static struct BitMap *throbber = NULL;
 static struct bitmap *throbber_nsbm = NULL;
 static int throbber_frames, throbber_update_interval;
@@ -161,6 +158,16 @@ void ami_theme_init(void)
        }
 }
 
+int ami_theme_throbber_get_width(void)
+{
+       return bitmap_get_width(throbber_nsbm) / throbber_frames;
+}
+
+int ami_theme_throbber_get_height(void)
+{
+       return bitmap_get_height(throbber_nsbm);
+}
+
 void ami_theme_throbber_setup(void)
 {
        char throbberfile[1024];
@@ -174,8 +181,6 @@ void ami_theme_throbber_setup(void)
        bm = ami_bitmap_from_datatype(throbberfile);
        throbber = ami_bitmap_get_native(bm, bitmap_get_width(bm), 
bitmap_get_height(bm), NULL);
 
-       throbber_width = bitmap_get_width(bm) / throbber_frames;
-       throbber_height = bitmap_get_height(bm);
        throbber_nsbm = bm;
 }
 
@@ -456,8 +461,10 @@ void gui_window_stop_throbber(struct gui_window *g)
                }
 
                if(throbber != NULL) {
-                       BltBitMapRastPort(throbber, 0, 0, 
g->shared->win->RPort, bbox->Left,
-                               bbox->Top, throbber_width, throbber_height, 
0x0C0);
+                       BltBitMapRastPort(throbber, 0, 0, g->shared->win->RPort,
+                               bbox->Left, bbox->Top, 
+                               ami_theme_throbber_get_width(), 
ami_theme_throbber_get_height(),
+                               0x0C0);
                }
                ami_gui_free_space_box(bbox);
        }
@@ -490,12 +497,12 @@ static void ami_throbber_update(void *p)
 
                if(throbber != NULL) {
 #ifdef __amigaos4__
-                       BltBitMapTags(BLITA_SrcX, throbber_width * frame,
+                       BltBitMapTags(BLITA_SrcX, 
ami_theme_throbber_get_width() * frame,
                                                BLITA_SrcY, 0,
                                                BLITA_DestX, bbox->Left,
                                                BLITA_DestY, bbox->Top,
-                                               BLITA_Width, throbber_width,
-                                               BLITA_Height, throbber_height,
+                                               BLITA_Width, 
ami_theme_throbber_get_width(),
+                                               BLITA_Height, 
ami_theme_throbber_get_height(),
                                                BLITA_Source, throbber,
                                                BLITA_Dest, 
g->shared->win->RPort,
                                                BLITA_SrcType, BLITT_BITMAP,
@@ -503,8 +510,11 @@ static void ami_throbber_update(void *p)
                                        //      BLITA_UseSrcAlpha, TRUE,
                                        TAG_DONE);
 #else
-                       BltBitMapRastPort(throbber, throbber_width * frame, 0, 
g->shared->win->RPort,
-                               bbox->Left, bbox->Top, throbber_width, 
throbber_height, 0xC0);
+                       BltBitMapRastPort(throbber, 
ami_theme_throbber_get_width() * frame,
+                               0, g->shared->win->RPort,
+                               bbox->Left, bbox->Top,
+                               ami_theme_throbber_get_width(), 
ami_theme_throbber_get_height(),
+                               0xC0);
 #endif
                }
                ami_gui_free_space_box(bbox);
diff --git a/frontends/amiga/theme.h b/frontends/amiga/theme.h
index bf6ba57..6de7bc1 100644
--- a/frontends/amiga/theme.h
+++ b/frontends/amiga/theme.h
@@ -28,12 +28,12 @@ struct gui_window;
 #define AMI_GUI_POINTER_DRAG  GUI_POINTER_PROGRESS+2
 #define AMI_LASTPOINTER AMI_GUI_POINTER_DRAG
 
-extern ULONG throbber_width;
-extern ULONG throbber_height;
-
 void ami_theme_init(void);
 void ami_get_theme_filename(char *filename, const char *themestring, bool 
protocol);
 
+int ami_theme_throbber_get_width(void);
+int ami_theme_throbber_get_height(void);
+
 void ami_theme_throbber_setup(void);
 void ami_theme_throbber_free(void);
 void ami_update_throbber(struct gui_window_2 *g,bool redraw);


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to