2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
9 #include <proto/intuition.h>
10 #include <exec/memory.h>
11 #include <intuition/classusr.h>
12 #include <utility/tagitem.h>
13 #include <libraries/gadtools.h>
14 #include "gadtools_intern.h"
16 /*********************************************************************
19 #include <proto/gadtools.h>
20 #include <intuition/intuition.h>
22 AROS_LH1(struct Gadget
*, CreateContext
,
25 AROS_LHA(struct Gadget
**, glistpointer
, A0
),
28 struct Library
*, GadToolsBase
, 19, GadTools
)
31 Creates a virtual first gadget to which all following gadgets must be
35 glistpointer - pointer to a pointer to the virtual gadget. Use the
36 gadget pointer as NewWindow->FirstGadget or in
37 AddGList(). The gadget pointer must be initialized
38 to NULL before CreateContext() is called.
41 A point to the first gadget or NULL, if there was an error.
55 ***************************************************************************/
59 struct GT_ContextGadget
*rc
;
61 DEBUG_CREATECONTEXT(dprintf("CreateContext: glistptr 0x%lx\n", glistpointer
));
63 rc
= (struct GT_ContextGadget
*)AllocMem(sizeof(struct GT_ContextGadget
), MEMF_PUBLIC
| MEMF_CLEAR
);
66 rc
->magic
= CONTEXT_MAGIC
;
67 rc
->magic2
= CONTEXT_MAGIC2
;
68 rc
->gad
.Flags
= GFLG_GADGHNONE
| GFLG_DISABLED
;
69 rc
->gad
.GadgetType
= GTYP_GADTOOLS
;
72 *glistpointer
= (struct Gadget
*)rc
;
74 DEBUG_CREATECONTEXT(dprintf("CreateContext: return 0x%lx\n", rc
));
76 return (struct Gadget
*)rc
;