grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / classes / zune / nlist / nbitmap_mcc / library.c
blobe85b41cf9522f6af032a5dca912499e6ca6a4cd2
1 /***************************************************************************
3 NBitmap.mcc - New Bitmap MUI Custom Class
4 Copyright (C) 2006 by Daniel Allsopp
5 Copyright (C) 2007-2013 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 /******************************************************************************/
28 /* */
29 /* MCC/MCP name and version */
30 /* */
31 /* ATTENTION: The FIRST LETTER of NAME MUST be UPPERCASE */
32 /* */
33 /******************************************************************************/
35 #include "Debug.h"
36 #include "SetPatch.h"
37 #include "private.h"
38 #include "version.h"
40 /******************************************************************************/
41 /* include the minimal startup code to be able to start the class from a */
42 /* shell without crashing the system */
43 /******************************************************************************/
44 #include "shellstart.c"
46 #define VERSION LIB_VERSION
47 #define REVISION LIB_REVISION
49 #define CLASS MUIC_NBitmap
50 #define SUPERCLASS MUIC_Area
52 #define INSTDATA InstData
54 #define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT
55 #define MASTERVERSION 19
57 #define CLASSINIT
58 #define CLASSEXPUNGE
59 #define MIN_STACKSIZE 8192
61 // libraries
62 struct Library *DataTypesBase = NULL;
63 #if !defined(__amigaos4__)
64 struct Library *CyberGfxBase = NULL;
65 #endif
67 #if defined(__amigaos4__)
68 struct DataTypesIFace *IDataTypes = NULL;
69 #endif
71 /******************************************************************************/
72 /* define the functions used by the startup code ahead of including mccinit.c */
73 /******************************************************************************/
74 static BOOL ClassInit(UNUSED struct Library *base);
75 static VOID ClassExpunge(UNUSED struct Library *base);
77 /******************************************************************************/
78 /* include the lib startup code for the mcc/mcp (and muimaster inlines) */
79 /******************************************************************************/
80 #include "mccinit.c"
82 /******************************************************************************/
83 /* define all implementations of our user functions */
84 /******************************************************************************/
85 static BOOL ClassInit(UNUSED struct Library *base)
87 BOOL res = FALSE;
89 ENTER();
91 // open library interfaces
92 if((DataTypesBase = OpenLibrary("datatypes.library", 39L)) != NULL &&
93 GETINTERFACE(IDataTypes, struct DataTypesIFace *, DataTypesBase))
95 #if !defined(__amigaos4__)
96 if((CyberGfxBase = OpenLibrary("cybergraphics.library", 40)) != NULL &&
97 GETINTERFACE(ICyberGfx, struct CyberGfxIFace *, CyberGfxBase))
100 #endif
102 GetSetPatchVersion();
104 res = TRUE;
107 RETURN(res);
108 return res;
111 static VOID ClassExpunge(UNUSED struct Library *base)
113 ENTER();
115 /* close libraries */
117 #if !defined(__amigaos4__)
118 if(CyberGfxBase != NULL)
120 DROPINTERFACE(ICyberGfx);
121 CloseLibrary(CyberGfxBase);
122 CyberGfxBase = NULL;
124 #endif
126 if(DataTypesBase != NULL)
128 DROPINTERFACE(IDataTypes);
129 CloseLibrary(DataTypesBase);
130 DataTypesBase = NULL;
133 LEAVE();