Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / gadtools / gadtools_init.c
blobdee3bc192802285f1836cda482b3f2de2b86e450
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: GadTools initialization code.
6 Lang: English.
7 */
8 #include <exec/libraries.h>
9 #include <exec/types.h>
11 #include <aros/symbolsets.h>
12 #include <utility/tagitem.h>
13 #include <utility/utility.h>
14 #include <intuition/classes.h>
15 #include <intuition/imageclass.h>
16 #include <proto/exec.h>
18 #include "gadtools_intern.h"
19 #include LC_LIBDEFS_FILE
21 #ifndef INTUITIONNAME
22 #define INTUITIONNAME "intuition.library"
23 #endif
24 /****************************************************************************************/
27 static int Init(LIBBASETYPEPTR LIBBASE)
29 /* This function is single-threaded by exec by calling Forbid. */
31 InitSemaphore(&LIBBASE->bevelsema);
32 LIBBASE->bevel = NULL;
34 /* You would return NULL here if the init failed. */
35 return TRUE;
38 /****************************************************************************************/
40 Object *makebevelobj(struct GadToolsBase_intern *GadToolsBase)
42 Object * obj;
43 struct TagItem tags[4];
45 tags[0].ti_Tag = IA_EdgesOnly;
46 tags[0].ti_Data = TRUE;
47 tags[1].ti_Tag = IA_Left;
48 tags[1].ti_Data = 0UL;
49 tags[2].ti_Tag = IA_Top;
50 tags[2].ti_Data = 0UL;
51 tags[3].ti_Tag = TAG_DONE;
52 obj = NewObjectA(NULL, FRAMEICLASS, tags);
54 return obj;
57 /****************************************************************************************/
59 static int Open(LIBBASETYPEPTR LIBBASE)
62 This function is single-threaded by exec by calling Forbid.
63 If you break the Forbid() another task may enter this function
64 at the same time. Take care.
67 if (!LIBBASE->bevel)
68 LIBBASE->bevel = (struct Image *)makebevelobj(GadToolsBase);
69 if (!LIBBASE->bevel)
70 return FALSE;
72 return TRUE;
75 /****************************************************************************************/
77 static int Expunge(LIBBASETYPEPTR LIBBASE)
80 This function is single-threaded by exec by calling Forbid.
81 If you break the Forbid() another task may enter this function
82 at the same time. Take care.
85 if (LIBBASE->bevel)
86 DisposeObject(LIBBASE->bevel);
87 LIBBASE->bevel = NULL;
89 return TRUE;
92 /****************************************************************************************/
94 ADD2INITLIB(Init, 0);
95 ADD2OPENLIB(Open, 0);
96 ADD2EXPUNGELIB(Expunge, 0);