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
21 ***************************************************************************/
24 #include <proto/exec.h>
25 #include <proto/intuition.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
47 #define MIN_STACKSIZE 8192
50 struct Library
*DataTypesBase
= NULL
;
51 #if !defined(__amigaos4__)
52 struct Library
*CyberGfxBase
= NULL
;
55 #if defined(__amigaos4__)
56 struct DataTypesIFace
*IDataTypes
= NULL
;
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 /******************************************************************************/
70 /******************************************************************************/
71 /* define all implementations of our user functions */
72 /******************************************************************************/
73 static BOOL
ClassInit(UNUSED
struct Library
*base
)
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
))
99 static VOID
ClassExpunge(UNUSED
struct Library
*base
)
103 /* close libraries */
105 #if !defined(__amigaos4__)
106 if(CyberGfxBase
!= NULL
)
108 DROPINTERFACE(ICyberGfx
);
109 CloseLibrary(CyberGfxBase
);
114 if(DataTypesBase
!= NULL
)
116 DROPINTERFACE(IDataTypes
);
117 CloseLibrary(DataTypesBase
);
118 DataTypesBase
= NULL
;