home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The AGA Experience 2
/
agavol2.iso
/
software
/
utilities
/
wb_tools
/
urouhack
/
source
/
urouhack.c
< prev
Wrap
C/C++ Source or Header
|
1996-03-01
|
38KB
|
1,226 lines
/********************************************************************************/
/* Urouhack V1.3beta by Tinic Urou 18.02.96 */
/* */
/* Please leave me a mail, if you are using this code. */
/* And, it would be nice, if you could send me a copy of your modified codes */
/* uuencoded via mail. */
/* */
/* 5uro@informatik.uni-hamburg.de */
/********************************************************************************/
/********************************************************************************/
/* Some macros for class creation handling */
/* Why did no one have this idea?.. Hmmm... this is really missing in MUI... */
/* I will enhance these macros and release them sometimes... */
/********************************************************************************/
#define BOOPSI_Class( initName, dispatchName, ClassID, SuperClass, SuperClassPtr, InstantStruct, Flags)\
Class *initName(void);\
ULONG dispatchName(Class *, Object *, Msg);\
Class * initName(void)\
{\
Class *cl;\
extern ULONG HookEntry();\
if(cl=MakeClass(ClassID,SuperClass,SuperClassPtr,sizeof(struct InstantStruct), Flags))\
{\
cl->cl_Dispatcher.h_Entry = HookEntry;\
cl->cl_Dispatcher.h_SubEntry= dispatchName;\
}\
return(cl);\
}\
__geta4 ULONG dispatchName(Class *cl, Object *object,Msg msg)\
{\
struct InstantStruct *data;\
data=(struct *InstantStruct)0;\
switch(msg->MethodID)\
{
#define BOOPSI_Method( MethodID)\
case MethodID:
#define BOOPSI_Method_End\
break;
#define BOOPSI_InitData\
data=INST_DATA(cl,object);
#define BOOPSI_Method_SuperDefault\
default : return(DoSuperMethodA(cl,object,msg));
#define BOOPSI_Method_SuperReturn\
return(DoSuperMethodA(cl,object,msg));
#define BOOPSI_End\
}\
}
/********************************************************************************/
/* Includes and libbases */
/********************************************************************************/
#include <exec/types.h>
#include <intuition/intuition.h>
#include <intuition/classes.h>
#include <intuition/classusr.h>
#include <intuition/imageclass.h>
#include <intuition/gadgetclass.h>
#include <intuition/cghooks.h>
#include <intuition/icclass.h>
#include <utility/tagitem.h>
#include <utility/hooks.h>
#include <clib/intuition_protos.h>
#include <clib/utility_protos.h>
#include <clib/alib_protos.h>
#include <clib/alib_stdio_protos.h>
#include <intuition/IntuitionBase.h>
#include <graphics/gfxbase.h>
#include <graphics/text.h>
#include <datatypes/datatypes.h>
#include <datatypes/pictureclass.h>
#include <dos/dos.h>
#include <dos/rdargs.h>
#include <exec/memory.h>
#include <exec/tasks.h>
#include <clib/macros.h>
extern struct IntuitionBase *IntuitionBase;
extern struct Library *UtilityBase;
static char *version="$VER: Urouhack V1.3 by Tinic Urou";
BOOL pframes = TRUE,
psysi = TRUE,
sysihackstyle = FALSE,
pwin = TRUE,
trymwb = FALSE,
XStyle = FALSE;
/********************************************************************************/
/* Append new pens to the DrawInfo and allocate them */
/********************************************************************************/
#define HALFSHADOWPEN (0x000C)
#define HALFSHINEPEN (0x000D)
#define DARKPAINTPEN (0x000E) /* Brown on MagicWB */
#define SHINEPAINTPEN (0x000F) /* Orange on MagicWB */
#define NEWNUMDRIPENS (0x0010)
#define NEWDRIVERSION (0x0003)
struct NewPenStruct
{
UWORD halfdark;
UWORD halfshine;
UWORD darkpaint;
UWORD shinepaint;
};
struct ExtNewPenStruct
{
ULONG c1r;
ULONG c1g;
ULONG c1b;
ULONG c2r;
ULONG c2g;
ULONG c2b;
ULONG c3r;
ULONG c3g;
ULONG c3b;
ULONG c4r;
ULONG c4g;
ULONG c4b;
};
/***** Default shit *****/
struct ExtNewPenStruct defpens=
{
0x80808080,0x80808080,0x80808080,
0xafafafaf,0xafafafaf,0xafafafaf,
0xaaaaaaaa,0x99999999,0x77777777,
0xffffffff,0xa9a9a9a9,0x97979797
};
struct NewPenStruct p1={3,0,1,1};
struct NewPenStruct p2={4,5,6,7};
struct NewPenStruct *penlist[256]=
{
&p1,
&p2
};
BOOL exttrymwb[256];
char *namelist[256]=
{
"Don't look at me!",
"Workbench"
};
int GetPubScreens(struct Screen *src, char *namelist[])
{
struct List *PubScreenList;
struct PubScreenNode *ScreenNode;
PubScreenList = LockPubScreenList();
for(ScreenNode=(struct PubScreenNode *)PubScreenList->lh_Head;ScreenNode->psn_Node.ln_Succ;ScreenNode=(struct PubScreenNode *)ScreenNode->psn_Node.ln_Succ)
{
if(ScreenNode->psn_Screen==src)
{
int i=0;
while(namelist[i])
{
if(strcmp(ScreenNode->psn_Node.ln_Name,namelist[i])==0)
{
UnlockPubScreenList();
return(i);
}
i++;
}
UnlockPubScreenList();
return(0);
}
}
UnlockPubScreenList();
return(0);
}
__geta4 void allocNewPens(__A2 struct Screen *scr)
{
struct DrawInfo *dr;
int i;
if(dr=GetScreenDrawInfo(scr))
{
if(dr->dri_Version==DRI_VERSION)
{
UWORD *newpens;
if(newpens=(UWORD *)AllocVec((NEWNUMDRIPENS+1)<<1,0L))
{
CopyMem(dr->dri_Pens,newpens,NUMDRIPENS<<1);
dr->dri_Pens = newpens;
dr->dri_Version = NEWDRIVERSION;
newpens[NEWNUMDRIPENS] = ~0;
if(i=GetPubScreens(scr,namelist))
{
if(exttrymwb[i]) /* Try to allocate Mwb colors on selected screen */
{
i=ObtainBestPen(scr->ViewPort.ColorMap,defpens.c1r,defpens.c1g, defpens.c1b,OBP_Precision,PRECISION_IMAGE,TAG_DONE);
newpens[HALFSHADOWPEN]= i>-1 ? i : penlist[0]->halfdark;
i=ObtainBestPen(scr->ViewPort.ColorMap,defpens.c2r,defpens.c2g, defpens.c2b,OBP_Precision,PRECISION_IMAGE,TAG_DONE);
newpens[HALFSHINEPEN] = i>-1 ? i : penlist[0]->halfshine;
i=ObtainBestPen(scr->ViewPort.ColorMap,defpens.c3r,defpens.c3g, defpens.c3b,OBP_Precision,PRECISION_IMAGE,TAG_DONE);
newpens[DARKPAINTPEN] = i>-1 ? i : penlist[0]->darkpaint;
i=ObtainBestPen(scr->ViewPort.ColorMap,defpens.c4r,defpens.c4g, defpens.c4b,OBP_Precision,PRECISION_IMAGE,TAG_DONE);
newpens[SHINEPAINTPEN]= i>-1 ? i : penlist[0]->shinepaint;
}
else
{
newpens[HALFSHADOWPEN]=penlist[i]->halfdark;
newpens[HALFSHINEPEN]= penlist[i]->halfshine;
newpens[DARKPAINTPEN]= penlist[i]->darkpaint;
newpens[SHINEPAINTPEN]=penlist[i]->shinepaint;
}
}
else
{
if(trymwb) /* Try to allocate Mwb colors on any screen */
{
i=ObtainBestPen(scr->ViewPort.ColorMap,defpens.c1r,defpens.c1g, defpens.c1b,OBP_Precision,PRECISION_IMAGE,OBP_FailIfBad,TRUE,TAG_DONE);
newpens[HALFSHADOWPEN]= i>-1 ? i : penlist[0]->halfdark;
i=ObtainBestPen(scr->ViewPort.ColorMap,defpens.c2r,defpens.c2g, defpens.c2b,OBP_Precision,PRECISION_IMAGE,OBP_FailIfBad,TRUE,TAG_DONE);
newpens[HALFSHINEPEN] = i>-1 ? i : penlist[0]->halfshine;
i=ObtainBestPen(scr->ViewPort.ColorMap,defpens.c3r,defpens.c3g, defpens.c3b,OBP_Precision,PRECISION_IMAGE,OBP_FailIfBad,TRUE,TAG_DONE);
newpens[DARKPAINTPEN] = i>-1 ? i : penlist[0]->darkpaint;
i=ObtainBestPen(scr->ViewPort.ColorMap,defpens.c4r,defpens.c4g, defpens.c4b,OBP_Precision,PRECISION_IMAGE,OBP_FailIfBad,TRUE,TAG_DONE);
newpens[SHINEPAINTPEN]= i>-1 ? i : penlist[0]->shinepaint;
}
else /* No! */
{
newpens[HALFSHADOWPEN]= penlist[0]->halfdark;
newpens[HALFSHINEPEN] = penlist[0]->halfshine;
newpens[DARKPAINTPEN] = penlist[0]->darkpaint;
newpens[SHINEPAINTPEN]= penlist[0]->shinepaint;
}
}
}
}
FreeScreenDrawInfo(scr,dr);
}
}
BYTE b_top = 3,
b_bottom= 3,
b_left = 3,
b_right = 3,
b_height=14,
b_width =18;
/* This change is needed for some programs like DeliTrackerII etc... */
__geta4 changeSize(__A0 struct NewWindow *win,__A1 struct TagItem *tags)
{
struct TagItem *ti;
if(tags)
{
ULONG flags=GetTagData(WA_Flags,win->Flags,tags);
if(flags&WFLG_SIZEGADGET)
{
if(flags&WFLG_SIZEBBOTTOM)
{
if(ti=FindTagItem(WA_InnerHeight,tags))
{
ti->ti_Data+=(b_height-10);
}
}
if(flags&WFLG_SIZEBRIGHT)
{
if(ti=FindTagItem(WA_InnerWidth,tags))
{
ti->ti_Data+=(b_width-10);
}
}
}
}
}
/********************************************************************************/
/* standard function for drawing frames, I should convert this to assembler.... */
/********************************************************************************/
draw_frame(struct RastPort *rp, UWORD x, UWORD y, UWORD width, UWORD height, UWORD col1, UWORD col2, UWORD col3, UWORD col4, UWORD col5, BOOL bg)
{
if((width>x)&&(height>y))
{
UWORD *ptr=rp->AreaPtrn;
rp->AreaPtrn=0L; /* Remove any patterns, since we use RectFills */
SetAPen(rp,col2);
RectFill(rp,width,y,width,height-1);
RectFill(rp,x,height,width,height);
SetAPen(rp,col1);
RectFill(rp,x+1,y,width,y);
RectFill(rp,x,y,x,height);
x++;y++;height--;width--;
if(bg)
{
SetAPen(rp,col5);
RectFill(rp,x+1,y+1,width-1,height-1);
}
SetAPen(rp,col3);
RectFill(rp,x+1,y,width-1,y);
RectFill(rp,x,y,x,height-1);
SetAPen(rp,col4);
RectFill(rp,x+1,height,width,height);
RectFill(rp,width,y+1,width,height-1);
rp->AreaPtrn=ptr;
}
}
draw_simple(struct RastPort *rp,UWORD x, UWORD y, UWORD width, UWORD height, UWORD col1, UWORD col2)
{
if((width>x)&&(height>y))
{
SetAPen(rp,col1);
RectFill(rp,x,y,width,y);
RectFill(rp,x,y,x,height);
SetAPen(rp,col2);
RectFill(rp,width,y,width,height);
RectFill(rp,x,height,width,height);
}
}
/******************************************************************/
/* FRAMEICLASS Hack */
/******************************************************************/
struct FRAMEData
{
ULONG type;
ULONG edgesonly;
ULONG recessed;
ULONG data;
};
BOOL DrawXEN(struct impDraw *imsg,struct FRAMEData *data, struct RastPort *rp, UWORD minx, UWORD miny, UWORD maxx, UWORD maxy, UWORD *pens)
{
switch (data->type)
{
case FRAME_DEFAULT:
case FRAME_BUTTON:
if (imsg->imp_State==IDS_NORMAL)
{
if(data->edgesonly)
{
if(!data->recessed) draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[SHADOWPEN],pens[HALFSHINEPEN],pens[HALFSHADOWPEN],0,FALSE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHINEPEN],0,FALSE);
}
else
{
if(!data->recessed) draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHINEPEN],TRUE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHADOWPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[BACKGROUNDPEN],TRUE);
}
}
else
{
if(data->edgesonly) draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHINEPEN],0,FALSE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHADOWPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[BACKGROUNDPEN],TRUE);
}
break;
case FRAME_RIDGE:
if(data->edgesonly)
{
if(!data->recessed) draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[SHADOWPEN],pens[SHADOWPEN],pens[SHINEPEN],0,FALSE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHINEPEN],pens[SHINEPEN],pens[SHADOWPEN],0,FALSE);
}
else
{
if(!data->recessed) draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[SHADOWPEN],pens[SHADOWPEN],pens[SHINEPEN],pens[BACKGROUNDPEN],TRUE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHINEPEN],pens[SHINEPEN],pens[SHADOWPEN],pens[BACKGROUNDPEN],TRUE);
}
break;
}
return(TRUE);
}
BOOL DrawX(struct impDraw *imsg,struct FRAMEData *data, struct RastPort *rp, UWORD minx, UWORD miny, UWORD maxx, UWORD maxy, UWORD *pens)
{
switch (data->type)
{
case FRAME_DEFAULT:
case FRAME_BUTTON:
if (imsg->imp_State==IDS_NORMAL)
{
if(data->edgesonly)
{
if(!data->recessed) draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],0,FALSE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],0,FALSE);
}
else
{
if(!data->recessed) draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHINEPEN],TRUE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[BACKGROUNDPEN],TRUE);
}
}
else
{
if(data->edgesonly) draw_frame (rp,minx,miny,maxx,maxy,pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],0,FALSE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[BACKGROUNDPEN],TRUE);
}
break;
case FRAME_RIDGE:
if(data->edgesonly)
{
if(!data->recessed) draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],0,FALSE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[HALFSHADOWPEN],pens[SHINEPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],0,FALSE);
}
else
{
if(!data->recessed) draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[BACKGROUNDPEN],TRUE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[HALFSHADOWPEN],pens[SHINEPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[BACKGROUNDPEN],TRUE);
}
break;
}
return(TRUE);
}
BOOPSI_Class(initFRAMEClass,dispatchFRAME,"frameiclass","breizhclass",NULL,FRAMEData, 0)
BOOPSI_Method(OM_NEW)
{
ULONG type,edgesonly,recessed;
type =GetTagData(IA_FrameType,0L,((struct opSet *)msg)->ops_AttrList);
edgesonly =GetTagData(IA_EdgesOnly,0L,((struct opSet *)msg)->ops_AttrList);
recessed =GetTagData(IA_Recessed ,0L,((struct opSet *)msg)->ops_AttrList);
if(object=(Object *)DoSuperMethodA(cl,object,msg))
{
BOOPSI_InitData
data->type =type;
data->edgesonly =edgesonly;
data->recessed =recessed;
}
return(object);
}
BOOPSI_Method_End
BOOPSI_Method(IM_DRAWFRAME)
BOOPSI_Method(IM_DRAW)
{
BOOPSI_InitData
if((data->type==FRAME_BUTTON)||(data->type==FRAME_RIDGE))
{
struct impDraw *imsg;
imsg=(struct impDraw *)msg;
if(imsg->imp_DrInfo)
{
UWORD *pens;
pens=imsg->imp_DrInfo->dri_Pens;
if(imsg->imp_DrInfo->dri_Version==NEWDRIVERSION)
{
UWORD minx,miny,maxx,maxy;
struct RastPort *rp;
rp =imsg->imp_RPort;
minx=imsg->imp_Offset.X+((struct Image *)object)->LeftEdge;
miny=imsg->imp_Offset.Y+((struct Image *)object)->TopEdge;
maxx=minx+((msg->MethodID==IM_DRAWFRAME) ? imsg->imp_Dimensions.Width : ((struct Image *)object)->Width )-1;
maxy=miny+((msg->MethodID==IM_DRAWFRAME) ? imsg->imp_Dimensions.Height : ((struct Image *)object)->Height)-1;
if(XStyle)
{
return(DrawX(imsg,data,rp,minx,miny,maxx,maxy,pens));
}
else
{
return(DrawXEN(imsg,data,rp,minx,miny,maxx,maxy,pens));
}
}
}
}
BOOPSI_Method_SuperReturn
}
BOOPSI_Method_End
BOOPSI_Method_SuperDefault
BOOPSI_End
/********************************************************************/
/* GADCLASS Hack */
/* */
/* This patch is needed to adjust the position of the sizing gadget */
/********************************************************************/
struct GADData
{
ULONG what;
};
BOOPSI_Class(initGADClass, dispatchGADClass, "buttongclass","tinicclass",NULL,GADData, 0)
BOOPSI_Method(OM_NEW)
{
ULONG type=GetTagData(GA_SysGType,0L,((struct opSet *)msg)->ops_AttrList);
if(object=(Object *)DoSuperMethodA(cl,object,msg))
{
if(type==GTYP_SIZING)
{
SetAttrs(object,GA_RelBottom,1-((struct Gadget *)(object))->Height,
GA_RelRight, 1-((struct Gadget *)(object))->Width,
TAG_DONE);
}
}
return(object);
}
BOOPSI_Method_End
BOOPSI_Method_SuperDefault
BOOPSI_End
/******************************************************************/
/* SYSIClass Hack */
/******************************************************************/
struct SYSIData
{
UWORD what;
UWORD dummy;
};
ULONG DrawUrou(struct SYSIData *data,struct impDraw *imsg,Object *object, Class *cl, Msg msg)
{
UWORD y_size,dummy,minx,miny,maxx,maxy;
struct RastPort *rp;
UWORD *pens;
pens=imsg->imp_DrInfo->dri_Pens;
rp=imsg->imp_RPort;
y_size=((struct Image *)object)->Height-1;
dummy=(y_size+1)>>1;
minx=imsg->imp_Offset.X+((struct Image *)object)->LeftEdge;
miny=imsg->imp_Offset.Y+((struct Image *)object)->TopEdge;
maxx=minx+((struct Image *)object)->Width-1;
maxy=miny+((struct Image *)object)->Height-1;
switch (data->what)
{
case SDEPTHIMAGE:
SetAPen(rp,pens[BACKGROUNDPEN]);
RectFill(rp,minx+1,miny+1,maxx-1,maxy-1);
case ZOOMIMAGE:
case DEPTHIMAGE:
minx++;
case LEFTIMAGE:
case UPIMAGE:
case DOWNIMAGE:
case RIGHTIMAGE:
case SIZEIMAGE:
case CLOSEIMAGE:
if(XStyle)
{
if(imsg->imp_State==IDS_SELECTED) draw_frame (rp,minx,miny,maxx,maxy,pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHINEPEN],TRUE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHINEPEN],TRUE);
}
else
{
if(imsg->imp_State==IDS_SELECTED) draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHINEPEN],pens[BACKGROUNDPEN],TRUE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[SHADOWPEN],pens[HALFSHINEPEN],pens[HALFSHADOWPEN],pens[BACKGROUNDPEN],TRUE);
}
break;
};
switch (data->what)
{
case LEFTIMAGE:
SetAPen(rp,pens[SHADOWPEN]);
Move(rp,minx+3,miny+dummy);
Draw(rp,maxx-3,maxy-3);
Draw(rp,maxx-3,miny+3);
SetAPen(rp,pens[SHINEPEN]);
Draw(rp,minx+3,maxy-dummy);
return(0L);
case RIGHTIMAGE:
SetAPen(rp,pens[SHINEPEN]);
Move(rp,maxx-3,maxy-dummy);
Draw(rp,minx+3,miny+3);
Draw(rp,minx+3,maxy-3);
SetAPen(rp,pens[SHADOWPEN]);
Draw(rp,maxx-3,miny+dummy);
return(0L);
case UPIMAGE:
SetAPen(rp,pens[SHADOWPEN]);
Move(rp,maxx-((maxx-minx)>>1),miny+3);
Draw(rp,maxx-3,maxy-3);
Draw(rp,minx+3,maxy-3);
SetAPen(rp,pens[SHINEPEN]);
Draw(rp,minx+((maxx-minx)>>1),miny+3);
return(0L);
case DOWNIMAGE:
SetAPen(rp,pens[SHADOWPEN]);
Move(rp,maxx-((maxx-minx)>>1),maxy-3);
Draw(rp,maxx-3,miny+3);
SetAPen(rp,pens[SHINEPEN]);
Draw(rp,minx+3,miny+3);
Draw(rp,minx+((maxx-minx)>>1),maxy-3);
return(0L);
break;
case SIZEIMAGE:
switch (imsg->imp_State)
{
case IDS_NORMAL:
case IDS_SELECTED:
SetAPen(rp,pens[FILLPEN]);
RectFill(rp,minx+1,miny+1,minx+((maxx-minx)>>1)-1,miny+dummy-1);
break;
}
SetAPen(rp,pens[SHADOWPEN]);
RectFill(rp,minx+1,miny+dummy,minx+((maxx-minx)>>1),miny+dummy);
RectFill(rp,minx+((maxx-minx)>>1),miny+1,minx+((maxx-minx)>>1),miny+dummy);
SetAPen(rp,pens[SHINEPEN]);
RectFill(rp,minx+1,miny+dummy+1,minx+((maxx-minx)>>1)+1,miny+dummy+1);
RectFill(rp,minx+((maxx-minx)>>1)+1,miny+1,minx+((maxx-minx)>>1)+1,miny+dummy+1);
return(0L);
case CLOSEIMAGE:
SetAPen(rp,pens[SHINEPEN]);
RectFill(rp,maxx+1,miny+1,maxx+1,maxy);
switch (imsg->imp_State)
{
case IDS_NORMAL:
SetAPen(rp,pens[SHINEPEN]);
RectFill(rp,minx+4,miny+dummy-2,maxx-4,miny+dummy-2);
RectFill(rp,minx+4,miny+dummy-2,minx+4,miny+dummy+1);
SetAPen(rp,pens[SHADOWPEN]);
RectFill(rp,minx+4,miny+dummy+1,maxx-4,miny+dummy+1);
RectFill(rp,maxx-4,miny+dummy-2,maxx-4,miny+dummy+1);
SetAPen(rp,pens[FILLPEN]);
RectFill(rp,minx+5,miny+dummy-1,maxx-5,miny+dummy);
break;
case IDS_SELECTED:
RectFill(rp,minx+6,miny+dummy-2,maxx-6,miny+dummy-2);
RectFill(rp,minx+6,miny+dummy-2,minx+6,miny+dummy+1);
SetAPen(rp,pens[SHADOWPEN]);
RectFill(rp,minx+6,miny+dummy+1,maxx-6,miny+dummy+1);
RectFill(rp,maxx-6,miny+dummy-2,maxx-6,miny+dummy+1);
SetAPen(rp,pens[FILLPEN]);
RectFill(rp,minx+7,miny+dummy-1,maxx-7,miny+dummy);
break;
default:
SetAPen(rp,pens[SHINEPEN]);
RectFill(rp,minx+4,miny+dummy-2,maxx-4,miny+dummy-2);
RectFill(rp,minx+4,miny+dummy-2,minx+4,miny+dummy+1);
SetAPen(rp,pens[SHADOWPEN]);
RectFill(rp,minx+4,miny+dummy+1,maxx-4,miny+dummy+1);
RectFill(rp,maxx-4,miny+dummy-2,maxx-4,miny+dummy+1);
break;
}
return(0L);
case DEPTHIMAGE:
case SDEPTHIMAGE:
minx--;
SetAPen(rp,pens[SHADOWPEN]);
RectFill(rp,minx,miny+1,minx,maxy);
switch (imsg->imp_State)
{
case IDS_NORMAL:
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+5,maxx-3,maxy-3,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+4,miny+3,minx+((maxx-minx)>>1)+3,maxy-5,pens[SHINEPEN],pens[SHADOWPEN]);
SetAPen(rp,pens[FILLPEN]);
RectFill(rp,minx+5,miny+4,minx+((maxx-minx)>>1)+2,maxy-6);
break;
case IDS_SELECTED:
draw_simple(rp,minx+4,miny+3,minx+((maxx-minx)>>1)+3,maxy-5,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+5,maxx-3,maxy-3,pens[SHINEPEN],pens[SHADOWPEN]);
SetAPen(rp,pens[FILLPEN]);
RectFill(rp,minx+((maxx-minx)>>1),miny+6,maxx-4,maxy-4);
break;
default:
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+5,maxx-3,maxy-3,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+4,miny+3,minx+((maxx-minx)>>1)+3,maxy-5,pens[SHINEPEN],pens[SHADOWPEN]);
SetAPen(rp,pens[BACKGROUNDPEN]);
RectFill(rp,minx+5,miny+4,minx+((maxx-minx)>>1)+2,maxy-6);
break;
}
return(0L);
case ZOOMIMAGE:
minx--;
SetAPen(rp,pens[SHADOWPEN]);
RectFill(rp,minx,miny+1,minx,maxy);
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+dummy-1,maxx-((maxx-minx)>>1)+2,miny+dummy,pens[SHADOWPEN],pens[SHINEPEN]);
return(0L);
default:
BOOPSI_Method_SuperReturn
}
}
ULONG DrawSysiHack(struct SYSIData *data,struct impDraw *imsg,Object *object, Class *cl, Msg msg)
{
UWORD y_size,dummy,minx,miny,maxx,maxy,h,w;
struct RastPort *rp;
UWORD *pens;
pens=imsg->imp_DrInfo->dri_Pens;
rp=imsg->imp_RPort;
y_size=((struct Image *)object)->Height-1;
dummy=(y_size+1)>>1;
minx=imsg->imp_Offset.X+((struct Image *)object)->LeftEdge;
miny=imsg->imp_Offset.Y+((struct Image *)object)->TopEdge;
w=((struct Image *)object)->Width;
h=((struct Image *)object)->Height;
maxx=minx+w-1;
maxy=miny+h-1;
switch (data->what)
{
case ZOOMIMAGE:
case DEPTHIMAGE:
minx++;
case LEFTIMAGE:
case UPIMAGE:
case DOWNIMAGE:
case RIGHTIMAGE:
case SIZEIMAGE:
case CLOSEIMAGE:
switch(imsg->imp_State)
{
case IDS_SELECTED:
SetAPen(rp,pens[FILLPEN]);
RectFill(rp,minx+1,miny+1,maxx-1,maxy-1);
draw_simple(rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHINEPEN]);
break;
case IDS_NORMAL:
SetAPen(rp,pens[FILLPEN]);
RectFill(rp,minx+1,miny+1,maxx-1,maxy-1);
draw_simple(rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[SHADOWPEN]);
break;
default:
SetAPen(rp,pens[BACKGROUNDPEN]);
RectFill(rp,minx+1,miny+1,maxx-1,maxy-1);
draw_simple(rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[SHADOWPEN]);
break;
}
break;
case SDEPTHIMAGE:
SetAPen(rp,pens[BACKGROUNDPEN]);
RectFill(rp,minx+1,miny+1,maxx-1,maxy-1);
if(imsg->imp_State==IDS_SELECTED) draw_simple(rp,minx+1,miny,maxx,maxy,pens[SHADOWPEN],pens[SHINEPEN]);
else draw_simple(rp,minx+1,miny,maxx,maxy,pens[SHINEPEN],pens[SHADOWPEN]);
break;
};
switch (data->what)
{
case LEFTIMAGE:
SetAPen(rp,pens[SHADOWPEN]);
Move(rp,minx+3,miny+dummy);
Draw(rp,maxx-3,maxy-3);
Draw(rp,maxx-3,miny+3);
SetAPen(rp,pens[SHINEPEN]);
Draw(rp,minx+3,maxy-dummy);
return(0L);
case RIGHTIMAGE:
SetAPen(rp,pens[SHINEPEN]);
Move(rp,maxx-3,maxy-dummy);
Draw(rp,minx+3,miny+3);
Draw(rp,minx+3,maxy-3);
SetAPen(rp,pens[SHADOWPEN]);
Draw(rp,maxx-3,miny+dummy);
return(0L);
case UPIMAGE:
SetAPen(rp,pens[SHADOWPEN]);
Move(rp,maxx-((maxx-minx)>>1),miny+3);
Draw(rp,maxx-3,maxy-3);
Draw(rp,minx+3,maxy-3);
SetAPen(rp,pens[SHINEPEN]);
Draw(rp,minx+((maxx-minx)>>1),miny+3);
return(0L);
case DOWNIMAGE:
SetAPen(rp,pens[SHADOWPEN]);
Move(rp,maxx-((maxx-minx)>>1),maxy-3);
Draw(rp,maxx-3,miny+3);
SetAPen(rp,pens[SHINEPEN]);
Draw(rp,minx+3,miny+3);
Draw(rp,minx+((maxx-minx)>>1),maxy-3);
return(0L);
break;
case ZOOMIMAGE:
minx--;
SetAPen(rp,pens[SHADOWPEN]);
RectFill(rp,minx,miny+1,minx,maxy);
if(imsg->imp_State==IDS_SELECTED)
{
draw_simple(rp,minx+4,miny+3,maxx-4,maxy-3,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+5,miny+4,maxx-((w-4)>>1),maxy-((h-4)>>1)-1,pens[SHADOWPEN],pens[SHINEPEN]);
}
else
{
draw_simple(rp,minx+4,miny+3,maxx-4,maxy-3,pens[SHADOWPEN],pens[SHINEPEN]);
draw_simple(rp,minx+5,miny+4,maxx-((w-4)>>1),maxy-((h-4)>>1)-1,pens[SHINEPEN],pens[SHADOWPEN]);
}
return(0L);
case CLOSEIMAGE:
{
UWORD foo,fao;
SetAPen(rp,pens[SHINEPEN]);
RectFill(rp,maxx+1,miny+1,maxx+1,maxy);
foo=(h-1)/3;
fao=(w-1)/3;
if(imsg->imp_State==IDS_SELECTED)
{
draw_simple(rp,minx+fao+1,miny+foo+1,maxx-fao-1,maxy-foo-1,pens[SHADOWPEN],pens[SHINEPEN]);
}
else
{
draw_simple(rp,minx+fao,miny+foo,maxx-fao,maxy-foo,pens[SHADOWPEN],pens[SHINEPEN]);
}
}
return(0L);
case DEPTHIMAGE:
minx--;
SetAPen(rp,pens[SHADOWPEN]);
RectFill(rp,minx,miny+1,minx,maxy);
switch (imsg->imp_State)
{
case IDS_NORMAL:
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+5,maxx-3,maxy-2,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+4,miny+3,minx+((maxx-minx)>>1)+3,maxy-4,pens[SHADOWPEN],pens[SHINEPEN]);
SetAPen(rp,pens[FILLPEN]);
RectFill(rp,minx+((maxx-minx)>>1),miny+6,maxx-4,maxy-3);
break;
case IDS_SELECTED:
draw_simple(rp,minx+4,miny+3,minx+((maxx-minx)>>1)+3,maxy-4,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+5,maxx-3,maxy-2,pens[SHINEPEN],pens[SHADOWPEN]);
break;
default:
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+5,maxx-3,maxy-2,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+4,miny+3,minx+((maxx-minx)>>1)+3,maxy-4,pens[SHADOWPEN],pens[SHINEPEN]);
SetAPen(rp,pens[BACKGROUNDPEN]);
RectFill(rp,minx+((maxx-minx)>>1),miny+6,maxx-4,maxy-3);
break;
}
return(0L);
case SDEPTHIMAGE:
SetAPen(rp,pens[SHADOWPEN]);
RectFill(rp,minx,miny+1,minx,maxy);
switch (imsg->imp_State)
{
case IDS_NORMAL:
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+5,maxx-3,maxy-2,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+4,miny+3,minx+((maxx-minx)>>1)+3,maxy-4,pens[SHADOWPEN],pens[SHINEPEN]);
SetAPen(rp,pens[BACKGROUNDPEN]);
RectFill(rp,minx+((maxx-minx)>>1),miny+6,maxx-4,maxy-3);
break;
case IDS_SELECTED:
draw_simple(rp,minx+4,miny+3,minx+((maxx-minx)>>1)+3,maxy-4,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+5,maxx-3,maxy-2,pens[SHINEPEN],pens[SHADOWPEN]);
break;
default:
draw_simple(rp,minx+((maxx-minx)>>1)-1,miny+5,maxx-3,maxy-2,pens[SHINEPEN],pens[SHADOWPEN]);
draw_simple(rp,minx+4,miny+3,minx+((maxx-minx)>>1)+3,maxy-4,pens[SHADOWPEN],pens[SHINEPEN]);
SetAPen(rp,pens[BACKGROUNDPEN]);
RectFill(rp,minx+((maxx-minx)>>1),miny+6,maxx-4,maxy-3);
break;
}
return(0L);
case SIZEIMAGE:
minx--;
SetAPen(rp,pens[SHADOWPEN]);
Move(rp,maxx-3,miny+3);
Draw(rp,maxx-3,maxy-3);
Draw(rp,minx+3,maxy-3);
SetAPen(rp,pens[SHINEPEN]);
Draw(rp,maxx-3,miny+3);
return(0L);
default:
BOOPSI_Method_SuperReturn
}
}
BOOPSI_Class(initSYSIClass,dispatchSYSIClass,"sysiclass","urouclass",NULL,SYSIData, 0)
BOOPSI_Method(OM_NEW)
{
ULONG what;
struct DrawInfo *mydr;
what= GetTagData(SYSIA_Which, 0x0, ((struct opSet *)msg)->ops_AttrList);
mydr= (struct DrawInfo *)GetTagData(SYSIA_DrawInfo,0x0,((struct opSet *)msg)->ops_AttrList);
if(object=(Object *)DoSuperMethodA(cl,object,msg))
{
BOOPSI_InitData
switch (what)
{
case SIZEIMAGE:
case LEFTIMAGE:
case RIGHTIMAGE:
case UPIMAGE:
case DOWNIMAGE:
SetAttrs(object,IA_Width,b_width,IA_Height,b_height,TAG_DONE);
break;
case CLOSEIMAGE:
case ZOOMIMAGE:
case DEPTHIMAGE:
{
LONG tmp;
GetAttr(IA_Height,object,&tmp);
if(tmp) SetAttrs(object,IA_Height,tmp+(b_top-2),TAG_DONE);
}
break;
}
data->what=what;
}
return(object);
}
BOOPSI_Method_End
BOOPSI_Method(IM_DRAW)
{
struct impDraw *imsg;
BOOPSI_InitData;
if((imsg=(struct impDraw *)msg)->imp_DrInfo)
{
if(imsg->imp_DrInfo->dri_Version==NEWDRIVERSION)
{
switch (data->what)
{
case CHECKIMAGE:
case MXIMAGE:
{
UWORD minx,miny,maxx,maxy;
struct RastPort *rp=imsg->imp_RPort;
UWORD *pens=imsg->imp_DrInfo->dri_Pens;
minx=imsg->imp_Offset.X+((struct Image *)object)->LeftEdge;
miny=imsg->imp_Offset.Y+((struct Image *)object)->TopEdge;
maxx=minx+((struct Image *)object)->Width-1;
maxy=miny+((struct Image *)object)->Height-1;
if(XStyle)
{
if(imsg->imp_State==IDS_SELECTED) draw_frame (rp,minx,miny,maxx,maxy,pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHINEPEN],TRUE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[SHINEPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHINEPEN],TRUE);
}
else
{
if(imsg->imp_State==IDS_SELECTED) draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHADOWPEN],pens[HALFSHADOWPEN],pens[SHINEPEN],pens[HALFSHINEPEN],TRUE);
else draw_frame (rp,minx,miny,maxx,maxy,pens[SHADOWPEN],pens[SHADOWPEN],pens[SHINEPEN],pens[HALFSHADOWPEN],pens[HALFSHINEPEN],TRUE);
}
if(imsg->imp_State==IDS_SELECTED)
{
SetAPen(rp,pens[FILLPEN]);
if(((maxx-minx)<6)&&((maxy-miny)<6)) RectFill(rp,minx+3,miny+3,maxx-3,maxy-3);
}
}
return(TRUE);
break;
default:
if(sysihackstyle)
{
return(DrawSysiHack(data,imsg,object,cl,msg));
}
else
{
return(DrawUrou(data,imsg,object,cl,msg));
}
break;
}
}
}
BOOPSI_Method_SuperReturn;
}
BOOPSI_Method_End
BOOPSI_Method_SuperDefault
BOOPSI_End
/************************************************************************/
/* Patched functions */
/************************************************************************/
ULONG oldOTLRoutine;
extern newOTLRoutine();
ULONG oldOSRoutine;
extern newOSRoutine();
ULONG oldOWTLRoutine;
extern newOWTLRoutine();
ULONG oldOWRoutine;
extern newOWRoutine();
fail()
{
PutStr("uRøURAçK SUCKS! Please run it before any screen was opened or IPrefs was started!");
exit(0);
}
enum{SCRFIL,WIN_TOP,WIN_BOT,WIN_LEF,WIN_RIG,FINBOT,FINRIG,PATFRAME,PATSYSI,ONLYWIN,TRYMWB,SYSISTYLE,XWIN,ARG_COUNT};
#define ARGTEMPLATE "SCREENFILE/M,WINDOW_TOP/K/N,WINDOW_BOTTOM/K/N,WINDOW_LEFT/K/N,WINDOW_RIGHT/K/N,FINE_BOTTOM/K/N,FINE_RIGHT/K/N,NOFRAMEPATCH/S,NOSYSIPATCH/S,ONLYWINDOWIMAGES/S,TRYMAGICWB/S,SYSIHACKSTYLE/S,XWINSTYLE/S"
enum{SCRNAME,SCRPEN1,SCRPEN2,SCRPEN3,SCRPEN4,ALLMWB,SCRARG_COUNT};
#define SCRARGTMPL "SCREEN,PEN1/N,PEN2/N,PEN3/N,PEN4/N,ALLOCATEMWB/S"
getscreenlist(char *filename)
{
BPTR file;
STRPTR *ArgArray;
char *line,*name;
if(line=(char *)AllocVec(256L,MEMF_CLEAR))
{
if(file=(BPTR)Open(filename,MODE_OLDFILE))
{
int i=0;
while(FGets(file,line,255))
{
i++;
if(penlist[i]=(struct NewPenStruct *)AllocVec(sizeof(struct NewPenStruct),MEMF_CLEAR))
{
if(ArgArray = (STRPTR *)AllocVec((sizeof(STRPTR) * (SCRARG_COUNT)) + 16L,MEMF_ANY|MEMF_CLEAR))
{
struct RDArgs *rd;
if(rd=(struct RDArgs *)AllocDosObject(DOS_RDARGS,TAG_DONE))
{
rd->RDA_Source.CS_Buffer=line;
rd->RDA_Source.CS_Length=strlen(line);
rd->RDA_Source.CS_CurChr=0L;
if(ReadArgs(SCRARGTMPL,(LONG *)ArgArray,rd))
{
if(ArgArray[SCRNAME])
{
if(name = (char *)((LONG *)ArgArray[SCRNAME]))
{
if(namelist[i]=(char *)AllocVec(strlen(name)+4L,0L))
{
strcpy(namelist[i],name);
}
}
}
if(ArgArray[SCRPEN1])
{
penlist[i]->halfdark = (UWORD)(*(LONG *)ArgArray[SCRPEN1])&0xFFFF;
}
if(ArgArray[SCRPEN2])
{
penlist[i]->halfshine = (UWORD)(*(LONG *)ArgArray[SCRPEN2])&0xFFFF;
}
if(ArgArray[SCRPEN3])
{
penlist[i]->darkpaint = (UWORD)(*(LONG *)ArgArray[SCRPEN3])&0xFFFF;
}
if(ArgArray[SCRPEN4])
{
penlist[i]->shinepaint = (UWORD)(*(LONG *)ArgArray[SCRPEN4])&0xFFFF;
}
if(ArgArray[ALLMWB])
{
exttrymwb[i]=TRUE;
}
FreeArgs(rd);
}
FreeDosObject(rd);
}
FreeVec(ArgArray);
}
}
}
Close(file);
}
else PutStr("Could not open file...");
FreeVec(line);
}
}
getconfig()
{
STRPTR *ArgArray;
if(ArgArray = (STRPTR *)AllocVec((sizeof(STRPTR) * (ARG_COUNT)) + 16L,MEMF_ANY|MEMF_CLEAR))
{
struct RDArgs *rd;
if(rd=(struct RDArgs *)AllocDosObject(DOS_RDARGS,TAG_DONE))
{
if(ReadArgs(ARGTEMPLATE,(LONG *)ArgArray,rd))
{
if(ArgArray[SCRFIL])
{
if((char *)(*(LONG *)ArgArray[SCRFIL]))
{
getscreenlist((char *)(*(LONG *)ArgArray[SCRFIL]));
}
}
if(ArgArray[WIN_TOP])
{
b_top = (BYTE)(*(LONG *)ArgArray[WIN_TOP])&0xFF;
}
if(ArgArray[WIN_BOT])
{
b_bottom = (BYTE)(*(LONG *)ArgArray[WIN_BOT])&0xFF;
}
if(ArgArray[WIN_LEF])
{
b_left = (BYTE)(*(LONG *)ArgArray[WIN_LEF])&0xFF;
}
if(ArgArray[WIN_RIG])
{
b_right = (BYTE)(*(LONG *)ArgArray[WIN_RIG])&0xFF;
}
if(ArgArray[FINBOT])
{
b_height = (*(LONG *)ArgArray[FINBOT])&0xFF;
}
if(ArgArray[FINRIG])
{
b_width = (*(LONG *)ArgArray[FINBOT])&0xFF;
}
if(ArgArray[PATFRAME])
{
pframes=FALSE;
}
if(ArgArray[PATSYSI])
{
psysi=FALSE;
}
if(ArgArray[ONLYWIN])
{
pwin=FALSE;
}
if(ArgArray[TRYMWB])
{
trymwb=TRUE;
}
if(ArgArray[SYSISTYLE])
{
sysihackstyle=TRUE;
}
if(ArgArray[XWIN])
{
XStyle=TRUE;
}
FreeArgs(rd);
}
FreeDosObject(rd);
}
FreeVec(ArgArray);
}
}
void main(int argc, char *argv[])
{
UWORD pens[8];
struct TextAttr topaz_font = { "topaz.font", 8, 0, FPF_ROMFONT, };
struct DrawInfo mydrawinfo = { DRI_VERSION, 9, &pens[BACKGROUNDPEN], 0, 2, 1, 1, NULL, NULL, NULL, 0, 0, 0, 0, 0 };
Class *my_cl,*oldcl;
Object *g;
getconfig();
if(pframes)
{
Forbid();
oldOTLRoutine = SetFunction(IntuitionBase,(WORD)-612,newOTLRoutine);
oldOSRoutine = SetFunction(IntuitionBase,(WORD)-198,newOSRoutine);
Permit();
if( g=(Object *)NewObject(NULL,"frameiclass",IA_Width,10,IA_Height,10, TAG_END))
{
oldcl=OCLASS(g); DisposeObject(g);
Forbid();
oldcl->cl_ID="breizhclass";
if(my_cl=initFRAMEClass())
{
AddClass(my_cl);
Permit();
}
else fail();
}
else fail();
}
if(psysi)
{
mydrawinfo.dri_Font=(struct TextFont *)OpenFont(&topaz_font);
Forbid();
oldOWTLRoutine= SetFunction(IntuitionBase,(WORD)-606,newOWTLRoutine);
oldOWRoutine = SetFunction(IntuitionBase,(WORD)-204,newOWRoutine);
Permit();
if( g=(Object *)NewObject(NULL, "sysiclass", SYSIA_Which, RIGHTIMAGE, SYSIA_DrawInfo, &mydrawinfo, TAG_END))
{
oldcl=OCLASS(g); DisposeObject(g);
Forbid();
oldcl->cl_ID="urouclass";
if(my_cl=initSYSIClass())
{
AddClass(my_cl);
Permit();
}
else fail();
}
else fail();
if( g=(Object *)NewObject(NULL,"buttongclass",GA_Width,10,GA_Height,10,TAG_END))
{
oldcl=OCLASS(g); DisposeObject(g);
Forbid();
oldcl->cl_ID="tinicclass";
if(my_cl=initGADClass())
{
AddClass(my_cl);
Permit();
}
else fail();
}
else fail();
}
if(Cli()) ((struct CommandLineInterface *)Cli())->cli_Module=0L; /* That wwas a good tip ;-)) */
else Wait(0L); /* for the security */
}