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
21 ***************************************************************************/
24 #include <proto/exec.h>
25 #include <proto/intuition.h>
27 /******************************************************************************/
29 /* MCC/MCP name and version */
31 /* ATTENTION: The FIRST LETTER of NAME MUST be UPPERCASE */
33 /******************************************************************************/
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
59 #define MIN_STACKSIZE 8192
62 struct Library
*DataTypesBase
= NULL
;
63 #if !defined(__amigaos4__)
64 struct Library
*CyberGfxBase
= NULL
;
67 #if defined(__amigaos4__)
68 struct DataTypesIFace
*IDataTypes
= NULL
;
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 /******************************************************************************/
82 /******************************************************************************/
83 /* define all implementations of our user functions */
84 /******************************************************************************/
85 static BOOL
ClassInit(UNUSED
struct Library
*base
)
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
))
102 GetSetPatchVersion();
111 static VOID
ClassExpunge(UNUSED
struct Library
*base
)
115 /* close libraries */
117 #if !defined(__amigaos4__)
118 if(CyberGfxBase
!= NULL
)
120 DROPINTERFACE(ICyberGfx
);
121 CloseLibrary(CyberGfxBase
);
126 if(DataTypesBase
!= NULL
)
128 DROPINTERFACE(IDataTypes
);
129 CloseLibrary(DataTypesBase
);
130 DataTypesBase
= NULL
;