1 /********************************************
3 * (C) Copyright 92-94 by Nico François *
4 * 95-96 by Magnus Holmgren *
6 ********************************************/
8 #include <exec/execbase.h>
10 #include <proto/gadtools.h>
11 #include <proto/icon.h>
12 #include <proto/utility.h>
15 #include <proto/reqtools.h>
17 #include <proto/graphics.h>
18 #include <proto/icon.h>
19 #include <proto/exec.h>
20 #include <proto/intuition.h>
21 #include <proto/gadtools.h>
23 #include <exec/types.h>
25 #include <exec/memory.h>
26 #include <exec/lists.h>
27 #include <dos/stdio.h>
28 #include <dos/dosextens.h>
29 #include <utility/tagitem.h>
30 #include <libraries/gadtools.h>
31 #include <intuition/intuition.h>
32 #include <intuition/intuitionbase.h>
33 #include <intuition/gadgetclass.h>
34 #include <graphics/gfxbase.h>
35 #include <workbench/startup.h>
36 #include <workbench/workbench.h>
37 #include <libraries/reqtools.h>
38 #include <libraries/locale.h>
46 #include "reqtools_rev.h"
49 #include <aros/macros.h>
50 #include <proto/alib.h>
52 #define __main was__main
54 #define _WBenchMsg WBenchMsg
57 const char VersTag
[] = VERSTAG
;
59 #define CONFIGFILE "Env:ReqTools.prefs"
60 #define CONFIGFILE_ARC "EnvArc:ReqTools.prefs"
63 #pragma libcall ReqToolsBase rtLockPrefs a8 00
64 #pragma libcall ReqToolsBase rtUnlockPrefs ae 00
67 #define STRGADBUFF(x) ((struct StringInfo *)(x->SpecialInfo))->Buffer
68 #define INTGADVALUE(x) ((struct StringInfo *)(x->SpecialInfo))->LongInt
71 struct Library
*ConsoleDevice
;
73 struct MenuItem
*iconitem
;
77 struct Library
*GadToolsBase
;
78 struct Library
*IconBase
;
79 struct GfxBase
*GfxBase
;
80 struct IntuitionBase
*IntuitionBase
;
81 struct ReqToolsBase
*ReqToolsBase
;
83 struct UtilityBase
*UtilityBase
;
85 struct Library
*UtilityBase
;
87 struct Window
*WindowPtr
;
88 struct Screen
*Screen
;
89 struct DrawInfo
*DrawInfo
;
98 struct ReqToolsPrefs RTPrefs
;
99 struct ReqToolsPrefs DefaultPrefs
;
100 struct ReqDefaults
*ReqDefs
;
102 #define PREFSLEN RTPREFS_SIZE
104 WORD CurrentReq
, WheelType
;
105 BOOL CreateIcons
, UseScreenFont
= TRUE
;
107 struct rtFileRequester
*FileReq
;
109 struct RDArgs
*RDArgs
;
110 struct DiskObject
*DiskObject
;
112 struct Hook IntuiHook
;
115 struct NewMenu NewMenu
[] =
117 { NM_TITLE
, MSG_PROJECT_MENU
, NULL
, 0, 0, 0 },
118 { NM_ITEM
, MSG_PROJECT_OPEN
, NULL
, 0, 0, 0 },
119 { NM_ITEM
, MSG_PROJECT_SAVEAS
, NULL
, 0, 0, 0 },
120 { NM_ITEM
, NM_BARLABEL
, NULL
, 0, 0, 0 },
121 { NM_ITEM
, MSG_PROJECT_ABOUT
, NULL
, 0, 0, 0 },
122 { NM_ITEM
, NM_BARLABEL
, NULL
, 0, 0, 0 },
123 { NM_ITEM
, MSG_PROJECT_QUIT
, NULL
, 0, 0, 0 },
124 { NM_TITLE
, MSG_EDIT_MENU
, NULL
, 0, 0, 0 },
125 { NM_ITEM
, MSG_EDIT_RESET
, NULL
, 0, 0, 0 },
126 { NM_ITEM
, MSG_EDIT_LASTSAVED
, NULL
, 0, 0, 0 },
127 { NM_ITEM
, MSG_EDIT_RESTORE
, NULL
, 0, 0, 0 },
128 { NM_TITLE
, MSG_OPTIONS_MENU
, NULL
, 0, 0, 0 },
129 { NM_ITEM
, MSG_OPTIONS_CREATEICONS
, NULL
, CHECKED
|CHECKIT
|MENUTOGGLE
, 0, 0 },
130 { NM_END
, NULL
, NULL
, 0, 0, 0 }
133 #define MENU_PROJECT 0
135 #define MENU_OPTIONS 2
137 #define ITEM_OPEN FULLMENUNUM( MENU_PROJECT, 0, NOSUB )
138 #define ITEM_SAVEAS FULLMENUNUM( MENU_PROJECT, 1, NOSUB )
139 #define ITEM_ABOUT FULLMENUNUM( MENU_PROJECT, 3, NOSUB )
140 #define ITEM_QUIT FULLMENUNUM( MENU_PROJECT, 5, NOSUB )
142 #define ITEM_RESET FULLMENUNUM( MENU_EDIT, 0, NOSUB )
143 #define ITEM_LASTSAVED FULLMENUNUM( MENU_EDIT, 1, NOSUB )
144 #define ITEM_RESTORE FULLMENUNUM( MENU_EDIT, 2, NOSUB )
146 #define ITEM_CREATEICONS FULLMENUNUM( MENU_OPTIONS, 0, NOSUB )
154 #define CloseLib(lib) CloseLibrary( ( struct Library * ) lib )
163 ClearMenuStrip( WindowPtr
);
173 FreeScreenDrawInfo( Screen
, DrawInfo
);
174 UnlockPubScreen (NULL
, Screen
);
179 FreeVisualInfo( VisualInfo
);
184 rtFreeRequest( FileReq
);
189 FreeDiskObject( DiskObject
);
195 CloseLib( GadToolsBase
);
196 CloseLib( IconBase
);
197 CloseLib( IntuitionBase
);
198 CloseLib( ReqToolsBase
);
199 CloseLib( UtilityBase
);
201 CloseLibrary( ( struct Library
* ) GfxBase
);
209 VOID
WriteErr( VOID
);
210 VOID
OpenFile( VOID
);
212 VOID
CreateIcon( STRPTR
);
213 LONG
GetFilename( STRPTR
, STRPTR
, ULONG
);
214 LONG
LoadConfig( STRPTR
);
215 LONG
SaveConfig( STRPTR
);
226 #define TEMPLATE "FROM,SCREENFONT/K,PUBSCREEN/K"
228 extern struct WBStartup
*_WBenchMsg
;
232 GetWheelType( ULONG flags
)
236 if( flags
& RTPRF_DOWHEEL
)
240 if( flags
& RTPRF_FANCYWHEEL
)
251 SetWheelType( WORD type
)
256 return( RTPRF_DOWHEEL
);
259 return( RTPRF_DOWHEEL
| RTPRF_FANCYWHEEL
);
267 OpenLib( STRPTR name
, LONG ver
)
271 if( !( lib
= OpenLibrary( name
, ver
) ) )
273 LocEZReq( MSG_ERROR_LIBRARY
, MSG_ABORT
, name
, ver
);
274 FreeExit( RETURN_FAIL
);
282 __main( char *argstring
)
284 static struct Args args
;
287 /* Get arguments if started from CLI */
290 if( !( RDArgs
= ReadArgs( TEMPLATE
, ( LONG
* ) &args
, NULL
) ) )
292 PrintFault( IoErr(), GetString( MSG_ERROR_ARGS
) );
297 IntuiHook
.h_Entry
= ( HOOKFUNC
) IntuiMsgFunc
;
299 // DefaultPrefs.Flags = 0;
300 DefaultPrefs
.ReqDefaults
[ RTPREF_OTHERREQ
].ReqPos
= REQPOS_POINTER
;
301 DefaultPrefs
.ReqDefaults
[ RTPREF_FILEREQ
].Size
= 75;
302 DefaultPrefs
.ReqDefaults
[ RTPREF_FONTREQ
].Size
=
303 DefaultPrefs
.ReqDefaults
[ RTPREF_SCREENMODEREQ
].Size
=
304 DefaultPrefs
.ReqDefaults
[ RTPREF_VOLUMEREQ
].Size
= 65;
305 DefaultPrefs
.ReqDefaults
[ RTPREF_FILEREQ
].ReqPos
=
306 DefaultPrefs
.ReqDefaults
[ RTPREF_FONTREQ
].ReqPos
=
307 DefaultPrefs
.ReqDefaults
[ RTPREF_SCREENMODEREQ
].ReqPos
=
308 DefaultPrefs
.ReqDefaults
[ RTPREF_VOLUMEREQ
].ReqPos
=
309 DefaultPrefs
.ReqDefaults
[ RTPREF_PALETTEREQ
].ReqPos
= REQPOS_TOPLEFTSCR
;
310 DefaultPrefs
.ReqDefaults
[ RTPREF_FILEREQ
].LeftOffset
=
311 DefaultPrefs
.ReqDefaults
[ RTPREF_FONTREQ
].LeftOffset
=
312 DefaultPrefs
.ReqDefaults
[ RTPREF_SCREENMODEREQ
].LeftOffset
=
313 DefaultPrefs
.ReqDefaults
[ RTPREF_VOLUMEREQ
].LeftOffset
=
314 DefaultPrefs
.ReqDefaults
[ RTPREF_PALETTEREQ
].LeftOffset
=
315 DefaultPrefs
.ReqDefaults
[ RTPREF_OTHERREQ
].LeftOffset
= 25;
316 DefaultPrefs
.ReqDefaults
[ RTPREF_FILEREQ
].TopOffset
=
317 DefaultPrefs
.ReqDefaults
[ RTPREF_FONTREQ
].TopOffset
=
318 DefaultPrefs
.ReqDefaults
[ RTPREF_SCREENMODEREQ
].TopOffset
=
319 DefaultPrefs
.ReqDefaults
[ RTPREF_VOLUMEREQ
].TopOffset
=
320 DefaultPrefs
.ReqDefaults
[ RTPREF_PALETTEREQ
].TopOffset
=
321 DefaultPrefs
.ReqDefaults
[ RTPREF_OTHERREQ
].TopOffset
= 18;
322 DefaultPrefs
.ReqDefaults
[ RTPREF_FILEREQ
].MinEntries
= 10;
323 DefaultPrefs
.ReqDefaults
[ RTPREF_FONTREQ
].MinEntries
=
324 DefaultPrefs
.ReqDefaults
[ RTPREF_SCREENMODEREQ
].MinEntries
=
325 DefaultPrefs
.ReqDefaults
[ RTPREF_VOLUMEREQ
].MinEntries
= 6;
326 DefaultPrefs
.ReqDefaults
[ RTPREF_FILEREQ
].MaxEntries
= 50;
327 DefaultPrefs
.ReqDefaults
[ RTPREF_FONTREQ
].MaxEntries
=
328 DefaultPrefs
.ReqDefaults
[ RTPREF_SCREENMODEREQ
].MaxEntries
=
329 DefaultPrefs
.ReqDefaults
[ RTPREF_VOLUMEREQ
].MaxEntries
= 10;
331 if( !( IntuitionBase
= ( struct IntuitionBase
* ) OpenLibrary( "intuition.library", 37 ) ) )
335 if( ( con
= Open( "CON:40/20/320/40/ReqTools 2.8", MODE_NEWFILE
) ) )
337 Write( con
, "\nNeed OS 2.04 or better!\n", 25 );
346 GfxBase
= OpenLib( "graphics.library", 37 );
347 UtilityBase
= OpenLib( "utility.library", 36 );
348 IconBase
= OpenLib( "icon.library", 0 );
349 GadToolsBase
= OpenLib( "gadtools.library", 37 );
350 ReqToolsBase
= OpenLib( "reqtools.library", 38 );
352 rev
= ReqToolsBase
->LibNode
.lib_Revision
;
354 if( ( rev
>= 693 && rev
<= 811 ) || ( rev
>= 347 && rev
<= 363 ) )
356 LocEZReq( MSG_WRONG_REQTOOLS_VERSION
, MSG_ABORT
);
357 FreeExit( RETURN_FAIL
);
360 if( rtLockPrefs()->PrefsSize
!= PREFSLEN
)
362 LocEZReq( MSG_ALL_PREFS_NOT_SUPPORTED
, MSG_OK
);
373 wbarg
= &_WBenchMsg
->sm_ArgList
[ 0 ];
374 oldcd
= CurrentDir( wbarg
->wa_Lock
);
376 if( ( DiskObject
= GetDiskObject( wbarg
->wa_Name
) ) )
380 if( ( str
= FindToolType( (UBYTE
**)DiskObject
->do_ToolTypes
, "CREATEICONS" ) ) )
382 CreateIcons
= Stricmp( str
, "NO" );
385 if( ( str
= FindToolType( (UBYTE
**)DiskObject
->do_ToolTypes
, "SCREENFONT" ) ) )
387 UseScreenFont
= Stricmp( str
, "NO" );
390 if( ( str
= FindToolType( (UBYTE
**)DiskObject
->do_ToolTypes
, "PUBSCREEN" ) ) )
392 args
.PubScreen
= str
;
400 if( args
.ScreenFont
)
402 UseScreenFont
= Stricmp( args
.ScreenFont
, "NO" );
406 if( !( FileReq
= rtAllocRequestA( RT_FILEREQ
, NULL
) ) )
408 FreeExit( RETURN_FAIL
);
412 struct TagItem tags
[] =
414 {RTFI_Dir
, (IPTR
)"Presets" },
418 rtChangeReqAttrA( FileReq
, tags
);
421 /* Get current prefs from ReqTools */
422 CopyMem( rtLockPrefs(), &RTPrefs
, sizeof( struct ReqToolsPrefs
) );
425 /* If FROM was used load prefs from disk */
428 if( !LoadConfig( args
.From
) )
430 FreeExit( RETURN_ERROR
);
434 WheelType
= GetWheelType( RTPrefs
.Flags
);
436 if( !( Screen
= LockPubScreen( args
.PubScreen
) ) )
438 LocEZReq( MSG_COULDNT_LOCK_PUBSCREEN
, MSG_ABORT
);
439 FreeExit( RETURN_ERROR
);
442 if( !( DrawInfo
= GetScreenDrawInfo( Screen
) ) )
444 LocEZReq( MSG_ERROR_GETSCREENDRAWINFO
, MSG_ABORT
);
445 FreeExit( RETURN_ERROR
);
448 if( !( VisualInfo
= GetVisualInfoA( Screen
, NULL
) ) )
450 LocEZReq( MSG_ERROR_GETVISUALINFO
, MSG_ABORT
);
451 FreeExit( RETURN_FAIL
);
454 if( IntuitionBase
->LibNode
.lib_Version
>= 39 )
456 Zoom
[ 0 ] = Zoom
[ 1 ] = 65535;
460 Zoom
[ 1 ] = Screen
->BarHeight
+ 1;
464 Zoom
[ 3 ] = Screen
->WBorTop
+ Screen
->Font
->ta_YSize
+ 1;
465 LocalizeMenus( NewMenu
);
467 if( !( Menus
= CreateMenusA( NewMenu
, NULL
) ) )
469 LocEZReq( MSG_ERROR_MENUS
, MSG_ABORT
);
470 FreeExit( RETURN_FAIL
);
473 LayoutMenus( Menus
, VisualInfo
,
474 GTMN_NewLookMenus
, TRUE
,
479 LocEZReq( MSG_COULDNT_OPEN_WINDOW
, MSG_ABORT
);
480 FreeExit( RETURN_FAIL
);
485 struct MenuItem
*iconItem
;
487 iconItem
= ItemAddress( Menus
, FULLMENUNUM( OPTIONS_MENU
, SAVEICONS_ITEM
, NOSUB
) );
491 iconItem
->Flags
&= ~CHECKED
;
495 CurrentReq
= RTPREF_FILEREQ
;
496 ReqDefs
= &RTPrefs
.ReqDefaults
[ CurrentReq
];
503 ProcessGadget( UWORD id
, UWORD code
)
510 case NOSCRTOFRONT_GADID
:
511 RTPrefs
.Flags
^= RTPRF_NOSCRTOFRONT
;
515 RTPrefs
.Flags
^= RTPRF_IMMSORT
;
518 case DIRSFIRST_GADID
:
519 RTPrefs
.Flags
^= RTPRF_DIRSFIRST
;
521 if( RTPrefs
.Flags
& RTPRF_DIRSMIXED
)
523 SetCheckState( mixdirsgad
, FALSE
);
524 RTPrefs
.Flags
&= ~RTPRF_DIRSMIXED
;
529 case DIRSMIXED_GADID
:
530 RTPrefs
.Flags
^= RTPRF_DIRSMIXED
;
532 if( RTPrefs
.Flags
& RTPRF_DIRSFIRST
)
534 SetCheckState( dirsfirstgad
, FALSE
);
535 RTPrefs
.Flags
&= ~RTPRF_DIRSFIRST
;
541 RTPrefs
.Flags
^= RTPRF_NOLED
;
545 RTPrefs
.Flags
^= RTPRF_MMBPARENT
;
548 case DEFAULTFONT_GADID
:
549 RTPrefs
.Flags
^= RTPRF_DEFAULTFONT
;
553 /* First clear all bits */
554 RTPrefs
.Flags
&= ~( RTPRF_DOWHEEL
| RTPRF_FANCYWHEEL
);
555 /* Then set appropriate ones */
556 RTPrefs
.Flags
|= SetWheelType( WheelType
= code
);
560 RTPrefs
.Flags
^= RTPRF_FKEYS
;
564 if( CurrentReq
!= code
)
567 UpdatePrefsWindow( TRUE
);
568 ReqDefs
= &RTPrefs
.ReqDefaults
[ CurrentReq
];
574 ReqDefs
->Size
= code
;
577 case MINENTRIES_GADID
:
578 val
= IntGadValue( mingad
);
585 if( val
> ReqDefs
->MaxEntries
)
587 val
= ReqDefs
->MaxEntries
;
590 if( val
!= IntGadValue( mingad
) )
592 SetIntGad( mingad
, val
);
595 ReqDefs
->MinEntries
= val
;
598 case MAXENTRIES_GADID
:
599 val
= IntGadValue( maxgad
);
606 if( val
< ReqDefs
->MinEntries
)
608 val
= ReqDefs
->MinEntries
;
611 if( val
!= IntGadValue( maxgad
) )
613 SetIntGad( maxgad
, val
);
616 ReqDefs
->MaxEntries
= val
;
620 if( ReqDefs
->ReqPos
!= code
)
622 ReqDefs
->ReqPos
= code
;
624 if( code
<= REQPOS_CENTERSCR
)
626 GadgetOff( xoffgad
);
627 GadgetOff( yoffgad
);
639 ReqDefs
->LeftOffset
= IntGadValue( xoffgad
);
643 ReqDefs
->TopOffset
= IntGadValue( yoffgad
);
647 SaveConfig( CONFIGFILE_ARC
);
652 struct ReqToolsPrefs
*prefs
;
654 SaveConfig( CONFIGFILE
);
655 prefs
= rtLockPrefs();
656 CopyMem( &RTPrefs
.Flags
, &prefs
->Flags
, PREFSLEN
);
672 ProcessMenuItem( UWORD id
)
680 if( id
== ITEM_LASTSAVED
)
682 if( !LoadConfig( CONFIGFILE_ARC
) )
692 UpdatePrefsWindow( FALSE
);
701 struct TagItem tags
[] =
703 {RT_LockWindow
, TRUE
},
704 {RT_Window
, (IPTR
)WindowPtr
},
705 {RT_ShareIDCMP
, TRUE
},
706 {RT_IntuiMsgFunc
, (IPTR
)&IntuiHook
},
707 {RTEZ_Flags
, EZREQF_CENTERTEXT
},
712 "ReqTools Preferences 2.8\n"
714 "Copyright © 1992-1994 Nico François\n"
715 " 1995-1996 Magnus Holmgren\n"
716 "(Compilation Date: " DATE
")",
717 GetString( MSG_OK
), NULL
, NULL
, tags
);
726 CopyMem( &DefaultPrefs
, &RTPrefs
, sizeof( struct ReqToolsPrefs
) );
727 UpdatePrefsWindow( FALSE
);
731 CopyMem( rtLockPrefs(), &RTPrefs
, sizeof( struct ReqToolsPrefs
) );
733 UpdatePrefsWindow( FALSE
);
736 case ITEM_CREATEICONS
:
737 CreateIcons
= !CreateIcons
;
749 TEXT FileName
[ 108 ];
751 struct TagItem RTTags
[] =
755 {RT_LockWindow
, TRUE
},
756 {RT_ShareIDCMP
, TRUE
},
757 {RT_IntuiMsgFunc
, &IntuiHook
},
766 GetFilename( STRPTR file
, STRPTR hail
, ULONG flags
)
768 RTTags
[ TAG_FLAGS
].ti_Data
= flags
;
769 RTTags
[ TAG_WINDOW
].ti_Data
= WindowPtr
;
771 if( rtFileRequestA( FileReq
, FileName
, hail
, RTTags
) )
773 strcpy( file
, FileReq
->Dir
);
774 return( ( LONG
) AddPart( file
, FileName
, 256 ) );
784 if( GetFilename( File
, GetString( MSG_PROJECT_OPEN
) + 2, 0 ) )
786 if( !LoadConfig( File
) )
788 FreeExit( RETURN_ERROR
);
797 if( GetFilename( File
, GetString( MSG_PROJECT_SAVEAS
) + 2, FREQF_SAVE
) )
799 if( SaveConfig( File
) )
809 TEXT FaultBuff
[ 100 ];
812 #define LOADSAVETO configbuffer
813 UBYTE configbuffer
[PREFSLEN
];
815 #define LOADSAVETO &RTPrefs.Flags
819 LoadConfig( STRPTR fname
)
823 if( !( file
= Open( fname
, MODE_OLDFILE
) ) )
825 Fault( IoErr(), "", FaultBuff
, sizeof( FaultBuff
) );
826 LocEZReq( MSG_ERROR_ACCESSING_FILE
, MSG_OK
, fname
, FaultBuff
+ 2 );
830 if( Read( file
, LOADSAVETO
, PREFSLEN
) != PREFSLEN
)
832 LocEZReq( MSG_READ_ERROR
, MSG_ABORT
);
837 #define READ_ULONG *((ULONG *)configptr); configptr += sizeof(ULONG)
838 #define READ_UWORD *((UWORD *)configptr); configptr += sizeof(UWORD)
841 UBYTE
*configptr
= configbuffer
;
846 RTPrefs
.Flags
= AROS_LONG2BE(val
);
848 for(i
= 0;i
< RTPREF_NR_OF_REQ
; i
++)
851 RTPrefs
.ReqDefaults
[i
].Size
= AROS_LONG2BE(val
);
854 RTPrefs
.ReqDefaults
[i
].ReqPos
= AROS_LONG2BE(val
);
857 RTPrefs
.ReqDefaults
[i
].LeftOffset
= AROS_WORD2BE(val
);
860 RTPrefs
.ReqDefaults
[i
].TopOffset
= AROS_WORD2BE(val
);
863 RTPrefs
.ReqDefaults
[i
].MinEntries
= AROS_WORD2BE(val
);
866 RTPrefs
.ReqDefaults
[i
].MaxEntries
= AROS_WORD2BE(val
);
873 WheelType
= GetWheelType( RTPrefs
.Flags
);
879 SaveConfig( STRPTR fname
)
883 if( !( file
= Open( fname
, MODE_NEWFILE
) ) )
885 Fault( IoErr(), "", FaultBuff
, sizeof( FaultBuff
) );
886 LocEZReq( MSG_ERROR_ACCESSING_FILE
, MSG_OK
, fname
, FaultBuff
+ 2 );
891 #define WRITE_ULONG *((ULONG *)configptr) = AROS_LONG2BE(val); configptr += sizeof(ULONG)
892 #define WRITE_UWORD *((UWORD *)configptr) = AROS_WORD2BE(val); configptr += sizeof(UWORD)
895 UBYTE
*configptr
= configbuffer
;
902 for(i
= 0;i
< RTPREF_NR_OF_REQ
; i
++)
904 val
= RTPrefs
.ReqDefaults
[i
].Size
;
907 val
= RTPrefs
.ReqDefaults
[i
].ReqPos
;
910 val
= RTPrefs
.ReqDefaults
[i
].LeftOffset
;
913 val
= RTPrefs
.ReqDefaults
[i
].TopOffset
;
916 val
= RTPrefs
.ReqDefaults
[i
].MinEntries
;
919 val
= RTPrefs
.ReqDefaults
[i
].MaxEntries
;
926 if( Write( file
, LOADSAVETO
, PREFSLEN
) != PREFSLEN
)
928 LocEZReq( MSG_ERROR_SAVING_PREFS
, MSG_OK
);
943 UWORD IconImageData
[ 176 ] =
945 0,0,4,1023,0,0,1,1023,0,2047,32768,17407,0,6144,24576,5119,0,8444,4096,3071,
946 0,16642,2048,4095,0,16514,2048,4095,0,16514,2048,4095,0,8452,2048,4095,
947 0,7704,4096,4095,0,96,8192,4095,0,128,49152,4095,0,259,0,4095,0,540,0,4095,
948 0,264,0,4095,0,240,0,4095,0,264,0,4095,0,264,0,4095,16384,240,0,4095,
949 4096,0,0,4095,1024,0,0,4095,511,65535,65535,65535,65535,65535,65528,1023,
950 54613,21845,21846,1023,54613,20480,21845,33791,54613,18431,38229,25599,54613,
951 24323,58709,21503,54613,15957,62805,21503,54613,16213,62805,21503,54613,
952 16213,62805,21503,54613,24147,62805,21503,54613,16711,58709,21503,54613,
953 21791,54613,21503,54613,21887,5461,21503,54613,21756,21845,21503,54613,
954 21985,21845,21503,54613,21749,21845,21503,54613,21765,21845,21503,54613,
955 21749,21845,21503,54613,21749,21845,21503,13653,21765,21845,21503,3413,
956 21845,21845,21503,853,21845,21845,21503,0,0,0,1023
959 struct Image IconImage
=
961 0, 0, 54, 22, 2, IconImageData
, 3, 0, NULL
973 CreateIcon( STRPTR fname
)
975 struct DiskObject
*dob
;
978 if( ( dob
= GetDiskObjectNew( NULL
) ) )
980 gad
= &dob
->do_Gadget
;
983 gad
->Flags
= GFLG_GADGIMAGE
| GFLG_GADGBACKFILL
;
984 gad
->GadgetType
= GTYP_BOOLGADGET
;
985 gad
->GadgetRender
= ( APTR
) &IconImage
;
986 gad
->UserData
= ( APTR
) WB_DISKREVISION
;
987 dob
->do_Magic
= WB_DISKMAGIC
;
988 dob
->do_Version
= WB_DISKVERSION
;
989 dob
->do_Type
= WBPROJECT
;
990 dob
->do_DefaultTool
= "ReqTools";
991 dob
->do_ToolTypes
= ToolTypes
;
992 dob
->do_CurrentX
= dob
->do_CurrentY
= NO_ICON_POSITION
;
993 PutDiskObject( fname
, dob
);
994 FreeDiskObject( dob
);
999 int main(int argc
, char **argv
)