Fix more hook functions

This commit is contained in:
Chris Young 2015-02-24 19:51:51 +00:00
parent a18f79ee5e
commit 1ea747196e
5 changed files with 19 additions and 15 deletions

View File

@ -7,7 +7,11 @@
#include "amiga/os3support.h"
#include "amigaguide_class.h"
#ifdef __amigaos4__
#define DISPATCHHOOK(func) static uint32 func(Class *cl, Object *o, Msg msg)
#else
#define DISPATCHHOOK(func) static ASM uint32 func(REG(a0, Class *cl),REG(a2, Object *o), REG(a1, Msg msg))
#endif
struct localObjectData
{
@ -24,7 +28,8 @@ struct AmigaGuideIFace *IAmigaGuide = NULL;
/* ********************************** function prototypes ************************************ */
static uint32 dispatchAGClass(Class *, Object *, Msg);
DISPATCHHOOK(dispatchAGClass);
// class methods
uint32 om_new(Class *, Object *, struct opSet *);
@ -89,7 +94,7 @@ BOOL freeAGClass(Class *cl)
/* ************************************** class dispatcher ************************************ */
static uint32 dispatchAGClass(Class *cl, Object *o, Msg msg)
DISPATCHHOOK(dispatchAGClass)
{
switch (msg->MethodID)

View File

@ -52,12 +52,12 @@
#include "amiga/context_menu.h"
static uint32 ami_context_menu_hook(struct Hook *hook, Object *item, APTR reserved);
HOOKF(uint32, ami_context_menu_hook, Object *, item, APTR);
HOOKF(uint32, ami_popup_hook, Object *, item, APTR);
static bool ami_context_menu_history(const struct browser_window *bw, int x0, int y0,
int x1, int y1, const struct history_entry *entry, void *user_data);
static uint32 ami_popup_hook(struct Hook *hook,Object *item,APTR reserved);
enum {
CMID_SELECTFILE,
CMID_COPYURL,
@ -695,7 +695,7 @@ void ami_context_menu_show(struct gui_window_2 *gwin,int x,int y)
IDoMethod(ctxmenuobj, PM_OPEN, gwin->win);
}
static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved)
HOOKF(uint32, ami_context_menu_hook, Object *, item, APTR)
{
int32 itemid = 0;
struct gui_window_2 *gwin = hook->h_Data;
@ -1255,7 +1255,7 @@ static bool ami_context_menu_history(const struct browser_window *bw,
return true;
}
static uint32 ami_popup_hook(struct Hook *hook,Object *item,APTR reserved)
HOOKF(uint32, ami_popup_hook, Object *, item, APTR)
{
uint32 itemid = 0;
struct gui_window *gwin = hook->h_Data;

View File

@ -46,8 +46,7 @@
static struct Hook aslhookfunc;
static ULONG ami_file_asl_mime_hook(struct Hook *mh,
struct FileRequester *fr, struct AnchorPathOld *ap)
HOOKF(ULONG, ami_file_asl_mime_hook, struct FileRequester *, fr, struct AnchorPathOld *)
{
char fname[1024];
BOOL ret = FALSE;
@ -56,10 +55,10 @@ static ULONG ami_file_asl_mime_hook(struct Hook *mh,
lwc_error lerror;
content_type ct;
if(ap->ap_Info.fib_DirEntryType > 0) return(TRUE);
if(msg->ap_Info.fib_DirEntryType > 0) return(TRUE);
strcpy(fname,fr->fr_Drawer);
AddPart(fname,ap->ap_Info.fib_FileName,1024);
AddPart(fname, msg->ap_Info.fib_FileName,1024);
mt = strdup(fetch_filetype(fname));
lerror = lwc_intern_string(mt, strlen(mt), &lwc_mt);

View File

@ -57,7 +57,7 @@
#include "amiga/history_local.h"
void ami_history_update_extent(struct history_window *hw);
static void ami_history_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg);
HOOKF(void, ami_history_scroller_hook, Object *, object, struct IntuiMessage *);
/**
* Redraw history window.
@ -323,7 +323,7 @@ void ami_history_update_extent(struct history_window *hw)
ami_gui_free_space_box(bbox);
}
void ami_history_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg)
HOOKF(void, ami_history_scroller_hook, Object *, object, struct IntuiMessage *)
{
ULONG gid;
struct history_window *hw = hook->h_Data;

View File

@ -524,7 +524,7 @@ static void ami_tree_drag_end(struct treeview_window *twin, int x, int y)
}
}
static void ami_tree_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg)
HOOKF(void, ami_tree_scroller_hook, Object *, object, struct IntuiMessage *)
{
ULONG gid;
struct treeview_window *twin = hook->h_Data;