Moving to main tree, needed by SysExplorer
[AROS.git] / workbench / classes / zune / nlist / nbitmap_mcc / library.c
blob8db4eb31b9c04d550147a5d199b30f307b96269f
1 /***************************************************************************
3 NBitmap.mcc - New Bitmap MUI Custom Class
4 Copyright (C) 2006 by Daniel Allsopp
5 Copyright (C) 2007 by NList Open Source Team
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 NList classes Support Site: http://www.sf.net/projects/nlist-classes
19 $Id$
21 ***************************************************************************/
23 /* system includes */
24 #include <proto/exec.h>
25 #include <proto/intuition.h>
27 /* local includes */
28 #include "Debug.h"
29 #include "SetPatch.h"
30 #include "private.h"
31 #include "version.h"
33 /* mcc initialisation */
34 #define VERSION LIB_VERSION
35 #define REVISION LIB_REVISION
37 #define CLASS MUIC_NBitmap
38 #define SUPERCLASS MUIC_Area
40 #define INSTDATA InstData
42 #define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT
43 #define MASTERVERSION 19
45 #define CLASSINIT
46 #define CLASSEXPUNGE
47 #define MIN_STACKSIZE 8192
49 // libraries
50 struct Library *DataTypesBase = NULL;
51 #if !defined(__amigaos4__)
52 struct Library *CyberGfxBase = NULL;
53 #endif
55 #if defined(__amigaos4__)
56 struct DataTypesIFace *IDataTypes = NULL;
57 #endif
59 /******************************************************************************/
60 /* define the functions used by the startup code ahead of including mccinit.c */
61 /******************************************************************************/
62 static BOOL ClassInit(UNUSED struct Library *base);
63 static VOID ClassExpunge(UNUSED struct Library *base);
65 /******************************************************************************/
66 /* include the lib startup code for the mcc/mcp (and muimaster inlines) */
67 /******************************************************************************/
68 #include "mccinit.c"
70 /******************************************************************************/
71 /* define all implementations of our user functions */
72 /******************************************************************************/
73 static BOOL ClassInit(UNUSED struct Library *base)
75 BOOL res = FALSE;
77 ENTER();
79 // open library interfaces
80 if((DataTypesBase = OpenLibrary("datatypes.library", 39L)) != NULL &&
81 GETINTERFACE(IDataTypes, struct DataTypesIFace *, DataTypesBase))
83 #if !defined(__amigaos4__)
84 if((CyberGfxBase = OpenLibrary("cybergraphics.library", 40)) != NULL &&
85 GETINTERFACE(ICyberGfx, struct CyberGfxIFace *, CyberGfxBase))
88 #endif
90 GetSetPatchVersion();
92 res = TRUE;
95 RETURN(res);
96 return res;
99 static VOID ClassExpunge(UNUSED struct Library *base)
101 ENTER();
103 /* close libraries */
105 #if !defined(__amigaos4__)
106 if(CyberGfxBase != NULL)
108 DROPINTERFACE(ICyberGfx);
109 CloseLibrary(CyberGfxBase);
110 CyberGfxBase = NULL;
112 #endif
114 if(DataTypesBase != NULL)
116 DROPINTERFACE(IDataTypes);
117 CloseLibrary(DataTypesBase);
118 DataTypesBase = NULL;
121 LEAVE();