home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
042.lha
/
DropShadow_sources
/
myhooks.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-06-25
|
1KB
|
100 lines
/* myhooks.c -- set up layers vector stealing */
typedef LONG (*PFL)();
struct hook {
LONG hk_SysFunc;
PFL hk_MyFunc;
PFL hk_Entry; /* unique entry point */
WORD hk_Test;
LONG hk_LVO;
};
void drawShadowSignal();
/* unique entry points */
long entry0();
long entry1();
long entry2();
long entry3();
long entry4();
long entry5();
long entry6();
struct hook myhooks[] = {
{ 0,
(PFL) drawShadowSignal,
entry0,
0,
-48, /* upfront */
},
{ 0,
(PFL) drawShadowSignal,
entry1,
0,
-42 /* create behind */
},
{ 0,
(PFL) drawShadowSignal,
entry2,
0,
-36 /* create upfront */
},
{ 0,
(PFL) drawShadowSignal,
entry3,
0,
-90 /* delete */
},
{ 0,
(PFL) drawShadowSignal,
entry4,
0,
-54 /* behind */
},
{ 0,
(PFL) drawShadowSignal,
entry5,
0,
-66 /* size */
},
{ 0,
(PFL) drawShadowSignal,
entry6,
0,
-60 /* move */
}
};
#define NUMHOOKS (sizeof (myhooks)/ sizeof (struct hook))
extern long LayersBase;
setup_hooks()
{
int i;
/* install the hooks */
Forbid();
for (i = 0; i < NUMHOOKS; ++i)
{
myhooks[i].hk_SysFunc =
SetFunction(LayersBase, myhooks[i].hk_LVO, myhooks[i].hk_Entry);
}
Permit();
}
cleanup_hooks()
{
int i;
/* remove the hooks */
/*** ZZZZ need to see if vectors are still mine ***/
for (i = 0; i < NUMHOOKS; ++i)
{
SetFunction(LayersBase, myhooks[i].hk_LVO, myhooks[i].hk_SysFunc);
}
return (1); /* tell him it's ok to exit */
}