home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
568b.lha
/
PowerSource_v3.0
/
source.lzh
/
source
/
whatsrc.c
< prev
Wrap
C/C++ Source or Header
|
1991-09-15
|
8KB
|
340 lines
/*----------------------------------------------------------------------*
WhatScr.c version 3.0 - © Copyright 1991 Jaba Development
Author : Jan van den Baard
Purpose: Selecting what source should be generated.
*----------------------------------------------------------------------*/
/*---------------------------------------------------*
Gadgets created with PowerSource V3.0
which is (c) Copyright 1990-91 by Jaba Development
written by Jan van den Baard
*---------------------------------------------------*/
static SHORT Border0_pairs[] = {
-1,-1,294,-1,294,90,-1,90,-1,-1 };
static SHORT Border1_pairs[] = {
-1,-1,294,-1,294,9,-1,9,-1,-1 };
static struct Border Border_bord[] = {
3,2,0,0,JAM1,5,(SHORT *)&Border0_pairs,&Border_bord[1],
3,2,0,0,JAM1,5,(SHORT *)&Border1_pairs,NULL };
static struct IntuiText Render_text = {
0,1,JAM1,90,3,NULL,(UBYTE *)"Generate Source",NULL };
static SHORT CANCEL_pairs0[] = {
-1,-1,66,-1,66,35,-1,35,-1,-1 };
static struct Border CANCEL_bord = {
0,0,0,0,JAM1,5,(SHORT *)&CANCEL_pairs0,NULL };
static struct IntuiText CANCEL_text = {
0,1,JAM1,9,14,NULL,(UBYTE *)"CANCEL",NULL };
#define CANCEL_ID 10
static struct Gadget CANCEL = {
NULL,226,54,66,35,
GADGHCOMP,
RELVERIFY,
BOOLGADGET,
(APTR)&CANCEL_bord,NULL,
&CANCEL_text,NULL,NULL,CANCEL_ID,NULL };
static SHORT OKIDOKI_pairs0[] = {
-1,-1,66,-1,66,35,-1,35,-1,-1 };
static struct Border OKIDOKI_bord = {
0,0,0,0,JAM1,5,(SHORT *)&OKIDOKI_pairs0,NULL };
static struct IntuiText OKIDOKI_text = {
0,1,JAM1,25,14,NULL,(UBYTE *)"OK",NULL };
#define OKIDOKI_ID 9
static struct Gadget OKIDOKI = {
&CANCEL,153,54,66,35,
GADGHCOMP,
RELVERIFY,
BOOLGADGET,
(APTR)&OKIDOKI_bord,NULL,
&OKIDOKI_text,NULL,NULL,OKIDOKI_ID,NULL };
static SHORT MN_pairs0[] = {
-1,-1,139,-1,139,9,-1,9,-1,-1 };
static struct Border MN_bord = {
0,0,0,0,JAM1,5,(SHORT *)&MN_pairs0,NULL };
static struct IntuiText MN_text = {
0,1,JAM1,49,1,NULL,(UBYTE *)"MENUS",NULL };
#define MN_ID 8
static struct Gadget MN = {
&OKIDOKI,153,41,139,9,
GADGHCOMP+SELECTED,
TOGGLESELECT+GADGIMMEDIATE,
BOOLGADGET,
(APTR)&MN_bord,NULL,
&MN_text,NULL,NULL,MN_ID,NULL };
static SHORT GD_pairs0[] = {
-1,-1,139,-1,139,9,-1,9,-1,-1 };
static struct Border GD_bord = {
0,0,0,0,JAM1,5,(SHORT *)&GD_pairs0,NULL };
static struct IntuiText GD_text = {
0,1,JAM1,41,1,NULL,(UBYTE *)"GADGETS",NULL };
#define GD_ID 7
static struct Gadget GD = {
&MN,153,28,139,9,
GADGHCOMP+SELECTED,
TOGGLESELECT+GADGIMMEDIATE,
BOOLGADGET,
(APTR)&GD_bord,NULL,
&GD_text,NULL,NULL,GD_ID,NULL };
static SHORT SG_pairs0[] = {
-1,-1,139,-1,139,9,-1,9,-1,-1 };
static struct Border SG_bord = {
0,0,0,0,JAM1,5,(SHORT *)&SG_pairs0,NULL };
static struct IntuiText SG_text = {
0,1,JAM1,13,1,NULL,(UBYTE *)"SPECIAL GADGET",NULL };
#define SG_ID 6
static struct Gadget SG = {
&GD,7,80,139,9,
GADGHCOMP+SELECTED,
TOGGLESELECT+GADGIMMEDIATE,
BOOLGADGET,
(APTR)&SG_bord,NULL,
&SG_text,NULL,NULL,SG_ID,NULL };
static SHORT BO_pairs0[] = {
-1,-1,139,-1,139,9,-1,9,-1,-1 };
static struct Border BO_bord = {
0,0,0,0,JAM1,5,(SHORT *)&BO_pairs0,NULL };
static struct IntuiText BO_text = {
0,1,JAM1,25,1,NULL,(UBYTE *)"BORDER ONLY",NULL };
#define BO_ID 5
static struct Gadget BO = {
&SG,7,67,139,9,
GADGHCOMP+SELECTED,
TOGGLESELECT+GADGIMMEDIATE,
BOOLGADGET,
(APTR)&BO_bord,NULL,
&BO_text,NULL,NULL,BO_ID,NULL };
static SHORT RT_pairs0[] = {
-1,-1,139,-1,139,9,-1,9,-1,-1 };
static struct Border RT_bord = {
0,0,0,0,JAM1,5,(SHORT *)&RT_pairs0,NULL };
static struct IntuiText RT_text = {
0,1,JAM1,21,1,NULL,(UBYTE *)"RENDER TEXTS",NULL };
#define RT_ID 4
static struct Gadget RT = {
&BO,7,54,139,9,
GADGHCOMP+SELECTED,
TOGGLESELECT+GADGIMMEDIATE,
BOOLGADGET,
(APTR)&RT_bord,NULL,
&RT_text,NULL,NULL,RT_ID,NULL };
static SHORT CL_pairs0[] = {
-1,-1,139,-1,139,9,-1,9,-1,-1 };
static struct Border CL_bord = {
0,0,0,0,JAM1,5,(SHORT *)&CL_pairs0,NULL };
static struct IntuiText CL_text = {
0,1,JAM1,45,1,NULL,(UBYTE *)"COLORS",NULL };
#define CL_ID 3
static struct Gadget CL = {
&RT,7,41,139,9,
GADGHCOMP+SELECTED,
TOGGLESELECT+GADGIMMEDIATE,
BOOLGADGET,
(APTR)&CL_bord,NULL,
&CL_text,NULL,NULL,CL_ID,NULL };
static SHORT SC_pairs0[] = {
-1,-1,139,-1,139,9,-1,9,-1,-1 };
static struct Border SC_bord = {
0,0,0,0,JAM1,5,(SHORT *)&SC_pairs0,NULL };
static struct IntuiText SC_text = {
0,1,JAM1,45,1,NULL,(UBYTE *)"SCREEN",NULL };
#define SC_ID 2
static struct Gadget SC = {
&CL,7,28,139,9,
GADGHCOMP+SELECTED,
TOGGLESELECT+GADGIMMEDIATE,
BOOLGADGET,
(APTR)&SC_bord,NULL,
&SC_text,NULL,NULL,SC_ID,NULL };
static SHORT SI_pairs0[] = {
-1,-1,139,-1,139,9,-1,9,-1,-1 };
static struct Border SI_bord = {
0,0,0,0,JAM1,5,(SHORT *)&SI_pairs0,NULL };
static struct IntuiText SI_text = {
0,1,JAM1,21,1,NULL,(UBYTE *)"SPECIAL INFO",NULL };
#define SI_ID 1
static struct Gadget SI = {
&SC,153,15,139,9,
GADGHCOMP+SELECTED,
TOGGLESELECT+GADGIMMEDIATE,
BOOLGADGET,
(APTR)&SI_bord,NULL,
&SI_text,NULL,NULL,SI_ID,NULL };
static SHORT WD_pairs0[] = {
-1,-1,139,-1,139,9,-1,9,-1,-1 };
static struct Border WD_bord = {
0,0,0,0,JAM1,5,(SHORT *)&WD_pairs0,NULL };
static struct IntuiText WD_text = {
0,1,JAM1,45,1,NULL,(UBYTE *)"WINDOW",NULL };
#define WD_ID 0
static struct Gadget WD = {
&SI,7,15,139,9,
GADGHCOMP+SELECTED,
TOGGLESELECT+GADGIMMEDIATE,
BOOLGADGET,
(APTR)&WD_bord,NULL,
&WD_text,NULL,NULL,WD_ID,NULL };
static struct NewScreen ns = {
0,0,640,256,2,-1,-1,HIRES,CUSTOMSCREEN,NULL,NULL,NULL,NULL };
static struct NewWindow nw_src = {
10,15,300,94,0,1,
GADGETDOWN+GADGETUP,
NOCAREREFRESH+SMART_REFRESH+ACTIVATE+RMBTRAP+BORDERLESS,
NULL,NULL,
NULL,NULL,NULL,
150,50,640,256,CUSTOMSCREEN };
extern struct Screen *MainScreen;
extern struct Window *MainWindow;
extern struct Gadget *Gadget;
extern ULONG Class;
BOOL gen_wd = TRUE, gen_sc = TRUE, gen_cl = TRUE;
BOOL gen_bo = TRUE, gen_rt = TRUE, gen_sg = TRUE;
BOOL gen_gd = TRUE, gen_si = TRUE, gen_mn = TRUE;
struct Window *WhatWindow;
void SetAll( void )
{
register struct Gadget *g;
for(g = &WD; g != &OKIDOKI; g = g->NextGadget)
g->Flags = SELECTED;
}
ULONG Check( void )
{
register struct Gadget *g;
for(g = &WD; g != &OKIDOKI; g = g->NextGadget) {
if(SelectTest(g)) return(TRUE);
}
return(FALSE);
}
void GenWhat( ULONG type )
{
BOOL running = TRUE;
SetAll();
nw_src.Screen = MainScreen;
if(NOT(WhatWindow = (struct Window *)OpenWindow(&nw_src)))
return;
disable_window();
buisy();
draw(WhatWindow,&WD,&Border_bord[0],&Render_text);
do {
WaitPort(WhatWindow->UserPort);
while(read_msg(WhatWindow)) {
switch(Class) {
case GADGETUP:
switch(Gadget->GadgetID) {
case OKIDOKI_ID:
case CANCEL_ID:
running = FALSE;
break;
}
}
}
} while(running == TRUE);
CloseWindow(WhatWindow);
if(Gadget->GadgetID == OKIDOKI_ID) {
if(SelectTest(&CL)) gen_cl = TRUE;
else gen_cl = FALSE;
if(SelectTest(&BO)) gen_bo = TRUE;
else gen_bo = FALSE;
if(SelectTest(&RT)) gen_rt = TRUE;
else gen_rt = FALSE;
if(SelectTest(&SG)) gen_sg = TRUE;
else gen_sg = FALSE;
if(SelectTest(&GD)) gen_gd = TRUE;
else gen_gd = FALSE;
if(SelectTest(&WD)) gen_wd = TRUE;
else gen_wd = FALSE;
if(SelectTest(&SC)) gen_sc = TRUE;
else gen_sc = FALSE;
if(SelectTest(&SI)) gen_si = TRUE;
else gen_si = FALSE;
if(SelectTest(&MN)) gen_mn = TRUE;
else gen_mn = FALSE;
enable_window();
ok();
if(Check()) {
if(type) WriteCGadgets();
else WriteAsmGadgets();
}
return;
}
enable_window();
ok();
}