6 * (C) Copyright 1998 Manuel Lemos.
7 * (C) Copyright 1995 Jaba Development.
8 * (C) Copyright 1995 Jan van den Baard.
12 * Revision 42.8 2003/01/18 19:10:11 chodorowski
13 * Instead of using the _AROS or __AROS preprocessor symbols, use __AROS__.
15 * Revision 42.7 2000/08/10 17:53:19 stegerg
16 * removed a debug output.
18 * Revision 42.6 2000/08/08 20:36:51 stegerg
19 * UtilityBase on AROS is not of type struct Library *, but
20 * struct UtilityBase *. BTW: Why????????? I think we should
21 * fix this. Also locale.library seems to have this "problem".
23 * Revision 42.5 2000/08/08 19:29:54 chodorowski
26 * Revision 42.4 2000/08/08 13:51:34 chodorowski
27 * Removed all REGFUNC, REGPARAM and REG macros. Now includes
28 * contrib/bgui/compilerspecific.h where they are defined.
30 * Revision 42.3 2000/08/07 21:49:06 stegerg
31 * fixed/activated REGFUNC/REGPARAM macros.
33 * Revision 42.2 2000/07/04 05:02:22 bergers
34 * Made examples compilable.
36 * Revision 42.1 2000/05/15 19:28:19 stegerg
37 * REG() macro replacementes
39 * Revision 42.0 2000/05/09 22:19:38 mlemos
40 * Bumped to revision 42.0 before handing BGUI to AROS team
42 * Revision 41.11 2000/05/09 20:33:28 mlemos
43 * Bumped to revision 41.11
45 * Revision 1.2 2000/05/09 19:58:47 mlemos
46 * Merged with the branch Manuel_Lemos_fixes.
48 * Revision 1.1.2.2 1999/02/19 05:03:50 mlemos
49 * Added support to build with Storm C.
51 * Revision 1.1.2.1 1998/02/28 17:45:49 mlemos
57 #include <exec/types.h>
58 #include <exec/memory.h>
60 #include <libraries/gadtools.h>
61 #include <libraries/bgui.h>
62 #include <libraries/bgui_macros.h>
63 #include <intuition/sghooks.h>
65 #include <graphics/gfxmacros.h>
67 #include <workbench/workbench.h>
68 #include <workbench/startup.h>
70 #include <clib/alib_protos.h>
72 #include <proto/exec.h>
73 #include <proto/intuition.h>
74 #include <proto/dos.h>
75 #include <proto/bgui.h>
76 #include <proto/graphics.h>
77 #include <proto/diskfont.h>
78 #include <proto/utility.h>
81 #include <graphics/gfxmacros.h>
88 * The entry point of all demo programs.
90 extern VOID
StartDemo( void );
93 * Output file handle and BGUI
99 struct Library
*BGUIBase
;
102 struct IntuitionBase
*IntuitionBase
;
103 struct GfxBase
*GfxBase
;
104 struct UtilityBase
*UtilityBase
;
108 * Output text to the CLI or Workbench console.
110 #define Tell(fstr, args...) do { \
111 if ( StdOut ) FPrintf( StdOut, fstr ,##args); \
116 IntuitionBase
= (struct IntuitionBase
*) OpenLibrary( "intuition.library", 0 );
117 GfxBase
= (struct GfxBase
*) OpenLibrary( "graphics.library", 0 );
118 UtilityBase
= (APTR
)OpenLibrary( "utility.library", 0 );
120 if (!IntuitionBase
|| !GfxBase
|| ! UtilityBase
)
128 if (IntuitionBase
) CloseLibrary((struct Library
*)IntuitionBase
);
129 if (GfxBase
) CloseLibrary((struct Library
*)GfxBase
);
130 if (UtilityBase
) CloseLibrary((struct Library
*)UtilityBase
);
136 int main( int argc
, char **argv
)
138 struct Process
*this_task
= ( struct Process
* )FindTask( NULL
);
141 if (FALSE
== openlibs())
147 if ( this_task
->pr_CLI
)
149 * Started from the CLI. Simply pickup
150 * the CLI output handle.
155 * Workbench startup. Open a console
158 StdOut
= Open( "CON:10/10/500/100/BGUI Demo Output/WAIT/AUTO", MODE_NEWFILE
);
165 if (( BGUIBase
= OpenLibrary( BGUINAME
, BGUIVERSION
))) {
170 CloseLibrary( BGUIBase
);
172 Tell( "Unable to open %s version %ld\n", BGUINAME
, BGUIVERSION
);
175 * Close console if ran from
179 if ( StdOut
) Close( StdOut
);
186 * DICE stub which simply calls
187 * main() when run from the
190 #if _DCC || __STORM__
191 int wbmain( struct WBStartup
*wbs
)
193 return( main( NULL
, 0 ));
197 #define FuzzButton(label,id) ButtonObject, LAB_Label, label, LAB_Underscore, '_',\
198 GA_ID, id, FuzzButtonFrame, EndObject