Convert hook function definitions to macros in gui.c

This commit is contained in:
Chris Young 2015-02-23 22:58:57 +00:00
parent 821a13d740
commit 805c1a2dca
2 changed files with 12 additions and 15 deletions

View File

@ -204,10 +204,8 @@ void ami_get_vscroll_pos(struct gui_window_2 *gwin, ULONG *ys);
void ami_quit_netsurf_delayed(void); void ami_quit_netsurf_delayed(void);
Object *ami_gui_splash_open(void); Object *ami_gui_splash_open(void);
void ami_gui_splash_close(Object *win_obj); void ami_gui_splash_close(Object *win_obj);
static uint32 ami_set_favicon_render_hook(struct Hook *hook, APTR space, HOOKF(uint32, ami_set_favicon_render_hook, APTR, space, struct gpRender *);
struct gpRender *msg); HOOKF(uint32, ami_set_throbber_render_hook, APTR, space, struct gpRender *);
static uint32 ami_set_throbber_render_hook(struct Hook *hook, APTR space,
struct gpRender *msg);
bool ami_gui_map_filename(char **remapped, const char *path, const char *file, bool ami_gui_map_filename(char **remapped, const char *path, const char *file,
const char *map); const char *map);
static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw); static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw);
@ -687,7 +685,7 @@ static nsurl *gui_get_resource_url(const char *path)
return url; return url;
} }
static void ami_gui_newprefs_hook(struct Hook *hook, APTR window, APTR reserved) HOOKF(void, ami_gui_newprefs_hook, APTR, window, APTR)
{ {
ami_set_screen_defaults(scrn); ami_set_screen_defaults(scrn);
} }
@ -3644,11 +3642,7 @@ static void ami_refresh_window(struct gui_window_2 *gwin)
ami_reset_pointer(gwin); ami_reset_pointer(gwin);
} }
#ifdef __amigaos4__ HOOKF(void, ami_scroller_hook, Object *, object, struct IntuiMessage *)
static void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg)
#else
static ASM void ami_scroller_hook(REG(a0, struct Hook *hook),REG(a2, Object *object), REG(a1, struct IntuiMessage *msg))
#endif
{ {
ULONG gid; ULONG gid;
struct gui_window_2 *gwin = hook->h_Data; struct gui_window_2 *gwin = hook->h_Data;
@ -4996,9 +4990,7 @@ static nserror gui_window_set_url(struct gui_window *g, nsurl *url)
return NSERROR_OK; return NSERROR_OK;
} }
HOOKF(uint32, ami_set_favicon_render_hook, APTR, space, struct gpRender *)
static uint32 ami_set_favicon_render_hook(struct Hook *hook, APTR space,
struct gpRender *msg)
{ {
ami_schedule(0, ami_gui_refresh_favicon, hook->h_Data); ami_schedule(0, ami_gui_refresh_favicon, hook->h_Data);
return 0; return 0;
@ -5066,8 +5058,7 @@ static nserror gui_search_web_provider_update(const char *provider_name,
return NSERROR_OK; return NSERROR_OK;
} }
static uint32 ami_set_throbber_render_hook(struct Hook *hook, APTR space, HOOKF(uint32, ami_set_throbber_render_hook, APTR, space, struct gpRender *)
struct gpRender *msg)
{ {
struct gui_window_2 *gwin = hook->h_Data; struct gui_window_2 *gwin = hook->h_Data;
ami_throbber_redraw_schedule(0, gwin->gw); ami_throbber_redraw_schedule(0, gwin->gw);

View File

@ -28,6 +28,12 @@
#include "amiga/plotters.h" #include "amiga/plotters.h"
#include "amiga/menu.h" #include "amiga/menu.h"
#ifdef __amigaos4__
#define HOOKF(ret,func,type,ptr,msgtype) static ret func(struct Hook *hook, type ptr, msgtype msg)
#else
#define HOOKF(ret,func,type,ptr) static ASM ret func(REG(a0, struct Hook *hook),REG(a2, type ptr), REG(a1, msgtype msg))
#endif
enum enum
{ {
OID_MAIN = 0, OID_MAIN = 0,