grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / classes / zune / nlist / nbitmap_mcc / NBitmap-Test.c
blob7a4b6e6e0d655065c378da7d14437d7855414b82
1 /***************************************************************************
3 NBitmap.mcc - New Bitmap MUI Custom Class
4 Copyright (C) 2007-2013 by NList Open Source Team
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc
18 $Id$
20 ***************************************************************************/
22 #include <libraries/iffparse.h>
24 #include <proto/exec.h>
25 #include <proto/dos.h>
26 #include <proto/intuition.h>
27 #include <proto/muimaster.h>
28 #include <proto/utility.h>
29 #include <proto/graphics.h>
30 #include <proto/cybergraphics.h>
31 #include <proto/datatypes.h>
32 #include <mui/NBitmap_mcc.h>
34 #include "private.h"
36 #if defined(__amigaos4__)
37 struct Library *IntuitionBase = NULL;
38 struct Library *UtilityBase = NULL;
39 struct Library *GfxBase = NULL;
40 struct Library *DataTypesBase = NULL;
41 struct Library *MUIMasterBase = NULL;
42 #else
43 struct IntuitionBase *IntuitionBase = NULL;
44 #if defined(__AROS__)
45 struct UtilityBase *UtilityBase = NULL;
46 #else
47 struct Library *UtilityBase = NULL;
48 #endif
49 struct GfxBase *GfxBase = NULL;
50 struct Library *CyberGfxBase = NULL;
51 struct Library *DataTypesBase = NULL;
52 struct Library *MUIMasterBase = NULL;
53 #endif
55 #if defined(__amigaos4__)
56 struct IntuitionIFace *IIntuition = NULL;
57 struct UtilityIFace *IUtility = NULL;
58 struct GraphicsIFace *IGraphics = NULL;
59 struct DataTypesIFace *IDataTypes = NULL;
60 struct MUIMasterIFace *IMUIMaster = NULL;
61 #endif
63 const unsigned long icon32_normal[] = {
64 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
65 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x49da7d7f, 0xebd87e80, 0xffd5856b, 0xc5c3725d, 0x37bb5e4f, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
66 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x31e68689, 0xd0df8484, 0xffd37979, 0xffbf6566, 0xffb55a5d, 0xffb96547, 0x38b05341, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
67 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x59e0b86a, 0xbcda7b81, 0xffe48b8a, 0xffd37979, 0xffc16767, 0xffae5454, 0xffa44a4d, 0xc5994339, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
68 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x6cecdb5c, 0xffe6ce73, 0xffca786b, 0xffd07477, 0xffd27877, 0xffc26868, 0xffb05656, 0xff9b4142, 0xff984336, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
69 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x6dffff00, 0xffede049, 0xffe9d876, 0xffd2a861, 0xffb66057, 0xffbf6366, 0xffba6060, 0xffa64c4c, 0xff9b4141, 0xec923839, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
70 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x66ffff00, 0xf9ffff00, 0xfff6e829, 0xffe0c657, 0xffdbbf5a, 0xffc5904b, 0xffac5949, 0xffa3474b, 0xff9a4040, 0xd1923838, 0x49892c2e, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
71 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x57ffff00, 0xe9ffff00, 0xfffbf117, 0xfffaf127, 0xffefd627, 0xffcea545, 0xffcca03d, 0xffae6d2b, 0xff974033, 0xba903438, 0x308a2a2e, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
72 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x45ffff00, 0xdbffff00, 0xfffbf118, 0xfff9f02a, 0xfff9e51c, 0xfff4c904, 0xffd7a40d, 0xffb77c25, 0xffa76522, 0xff994d1c, 0x5b8b3619, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
73 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x33ffff04, 0xccfdf821, 0xfff9ee26, 0xfff9f029, 0xfff9e51c, 0xfff4c706, 0xffddaa00, 0xffb38200, 0xff895407, 0xfc874012, 0x6e87310f, 0x05560000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
74 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x21ffff0a, 0xbafdfa1f, 0xfff9ef29, 0xfff9ef27, 0xfff9e41b, 0xfff5c804, 0xffddaa00, 0xffb58300, 0xff7e4d00, 0xf5611c00, 0x765c0000, 0x12000000, 0x0f000000, 0x0a000000, 0x05000000, 0x01000000, 0x00ff00ff, 0x00ff00ff,
75 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x04fff400, 0x89fdf318, 0xfff9ed27, 0xfff8ed27, 0xfff9e51c, 0xfff5c805, 0xffdfad00, 0xffb58300, 0xff7e4c00, 0xec601d00, 0x77550000, 0x23000000, 0x24000000, 0x22000000, 0x1d000000, 0x12000000, 0x06000000, 0x00ff00ff, 0x00ff00ff,
76 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x3bffd056, 0xe8f6c940, 0xffebc243, 0xfff5d722, 0xfff7cd03, 0xffdfab00, 0xffb58300, 0xff7d4c00, 0xe25f1e00, 0x734a0000, 0x2f000000, 0x30000000, 0x2f000000, 0x2b000000, 0x24000000, 0x16000000, 0x08000000, 0x00ff00ff, 0x00ff00ff,
77 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x06ffccb8, 0x9df9be82, 0xffe8ab76, 0xffd29658, 0xffdaa61f, 0xffd8a506, 0xffb48201, 0xff7f4f00, 0xd95b1c00, 0x6f3c0000, 0x3c000000, 0x3c000000, 0x39000000, 0x30000000, 0x24000000, 0x18000000, 0x0c000000, 0x04000000, 0x00ff00ff, 0x00ff00ff,
78 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x3bfabb83, 0xeee9ac71, 0xffd1955a, 0xffb77b40, 0xffa96e2d, 0xffa26c13, 0xff804f02, 0xcf5d2100, 0x6b2d0000, 0x46000000, 0x42000000, 0x3b000000, 0x2f000000, 0x21000000, 0x11000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
79 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x01ffffff, 0xa1f1ac66, 0xffd29558, 0xffb2763a, 0xff9d6427, 0xff90581e, 0xf285510c, 0xad562600, 0x671e0000, 0x4a000000, 0x41000000, 0x34000000, 0x26000000, 0x17000000, 0x0b000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
80 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x44777372, 0xf59e7c5c, 0xffa36d36, 0xff945b1e, 0xf6865015, 0xbf6a3e0e, 0x7f3b2304, 0x55090000, 0x45000000, 0x37000000, 0x27000000, 0x18000000, 0x0b000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
81 0x00ff00ff, 0x00ff00ff, 0x06000000, 0xb45f6162, 0xff4c4b49, 0xf85e4120, 0xc073420a, 0x7a3b2106, 0x53100701, 0x42000000, 0x35000000, 0x25000000, 0x17000000, 0x0a000000, 0x02000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
82 0x00ff00ff, 0x00ff00ff, 0x09000000, 0xfc494949, 0xc0242427, 0x7607060f, 0x420c0300, 0x2f000000, 0x24000000, 0x1c000000, 0x12000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
83 0x00ff00ff, 0x00ff00ff, 0x06000000, 0x15000000, 0x20000000, 0x1f000000, 0x15000000, 0x0a000000, 0x02000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
85 const unsigned long icon32_selected[] = {
86 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
87 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
88 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
89 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
90 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x04000000, 0x64000000, 0x07000000, 0x03000000, 0x48000000, 0x03000000, 0x00ff00ff, 0x03000000, 0x4c000000, 0x03000000, 0x00ff00ff, 0x00ff00ff,
91 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x0b000000, 0x84000000, 0x0e000000, 0x09000000, 0x67000000, 0x3d000000, 0x72000000, 0x4c000000, 0xa5000000, 0x5b000000, 0x03000000, 0x00ff00ff,
92 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x12000000, 0x88000000, 0x15000000, 0x0f000000, 0x80000000, 0x40000000, 0x87000000, 0x58000000, 0x87000000, 0x17000000, 0x03000000, 0x00ff00ff,
93 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x14000000, 0x8b000000, 0x80000000, 0x6d000000, 0x86000000, 0x52000000, 0x71000000, 0x8a000000, 0x74000000, 0x6a000000, 0x08000000, 0x00ff00ff,
94 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x0d000000, 0x13000000, 0x18000000, 0x17000000, 0x16000000, 0x1d000000, 0x22000000, 0x20000000, 0x19000000, 0x0f000000, 0x04000000, 0x00ff00ff,
95 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x06000000, 0x0c000000, 0x11000000, 0x11000000, 0x0d000000, 0x0e000000, 0x0d000000, 0x10000000, 0x0f000000, 0x09000000, 0x04000000, 0x00ff00ff,
96 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0xb9000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
97 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
98 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
99 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
100 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0xab000000, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
101 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
102 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
103 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
104 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
105 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
108 #define ICON32_WIDTH 24
109 #define ICON32_HEIGHT 20
110 #define ICON32_DEPTH 32
112 DISPATCHERPROTO(_Dispatcher);
114 int main(void)
116 if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 36)) &&
117 GETINTERFACE(IIntuition, IntuitionBase))
119 #if defined(DEBUG)
120 SetupDebug();
121 #endif
123 if((UtilityBase = (APTR)OpenLibrary("utility.library", 36)) &&
124 GETINTERFACE(IUtility, UtilityBase))
126 if((GfxBase = (APTR)OpenLibrary("graphics.library", 36)) &&
127 GETINTERFACE(IGraphics, GfxBase))
129 if((DataTypesBase = OpenLibrary("datatypes.library", 36)) &&
130 GETINTERFACE(IDataTypes, DataTypesBase))
132 if((MUIMasterBase = OpenLibrary("muimaster.library", 19)) &&
133 GETINTERFACE(IMUIMaster, MUIMasterBase))
135 struct MUI_CustomClass *mcc;
137 #if !defined(__amigaos4__)
138 // don't check for success, we can live without it
139 CyberGfxBase = OpenLibrary("cybergraphics.library", 40);
140 #endif
142 mcc = MUI_CreateCustomClass(NULL, "Area.mui", NULL, sizeof(struct InstData), ENTRY(_Dispatcher));
144 if(mcc != NULL)
146 Object *app, *window;
147 const char * const classes[] = { "NBitmap.mcc", NULL };
149 app = MUI_NewObject("Application.mui",
150 MUIA_Application_Author, "NBitmap.mcc Open Source Team",
151 MUIA_Application_Base, "NBitmap-Test",
152 MUIA_Application_Copyright, "(c) 2007-2010 NBitmap.mcc Open Source Team",
153 MUIA_Application_Description, "NBitmap.mcc test program",
154 MUIA_Application_Title, "NBitmap-Test",
155 MUIA_Application_Version, "$VER: NBitmap-Test (" __DATE__ ")",
156 MUIA_Application_UsedClasses, classes,
158 MUIA_Application_Window,
159 window = WindowObject,
160 MUIA_Window_Title, "NBitmap-Test",
161 MUIA_Window_ID, MAKE_ID('M','A','I','N'),
162 MUIA_Window_RootObject, VGroup,
163 Child, HGroup,
164 Child, NewObject(mcc->mcc_Class, NULL,
165 MUIA_NBitmap_Type, MUIV_NBitmap_Type_File,
166 MUIA_NBitmap_Normal, "PROGDIR:icon.png",
167 MUIA_NBitmap_Label, "Music",
168 MUIA_NBitmap_Button, TRUE,
169 End,
170 Child, NewObject(mcc->mcc_Class, NULL,
171 MUIA_NBitmap_Width, ICON32_WIDTH,
172 MUIA_NBitmap_Height, ICON32_HEIGHT,
173 MUIA_NBitmap_Type, MUIV_NBitmap_Type_ARGB32,
174 MUIA_NBitmap_Normal, icon32_normal,
175 MUIA_NBitmap_Selected, icon32_selected,
176 MUIA_NBitmap_Label, "ICON32",
177 MUIA_NBitmap_Button, TRUE,
178 End,
179 Child, RectangleObject, End,
180 End,
181 Child, RectangleObject, End,
182 End,
183 End,
184 End;
186 if(app != NULL)
188 ULONG sigs = 0;
190 DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
192 set(window, MUIA_Window_Open, TRUE);
194 while((LONG)DoMethod(app, MUIM_Application_NewInput, &sigs) != (LONG)MUIV_Application_ReturnID_Quit)
196 if(sigs)
198 sigs = Wait(sigs | SIGBREAKF_CTRL_C);
200 if(sigs & SIGBREAKF_CTRL_C)
201 break;
205 MUI_DisposeObject(app);
207 else
208 PutStr("Failed to create application\n");
210 MUI_DeleteCustomClass(mcc);
213 #if !defined(__amigaos4__)
214 if(CyberGfxBase != NULL)
216 CloseLibrary(CyberGfxBase);
217 CyberGfxBase = NULL;
219 #endif
221 DROPINTERFACE(IMUIMaster);
222 CloseLibrary(MUIMasterBase);
223 MUIMasterBase = NULL;
226 DROPINTERFACE(IDataTypes);
227 CloseLibrary(DataTypesBase);
228 DataTypesBase = NULL;
231 DROPINTERFACE(IGraphics);
232 CloseLibrary((struct Library *)GfxBase);
233 GfxBase = NULL;
236 DROPINTERFACE(IUtility);
237 CloseLibrary((struct Library *)UtilityBase);
238 UtilityBase = NULL;
241 DROPINTERFACE(IIntuition);
242 CloseLibrary((struct Library *)IntuitionBase);
243 IntuitionBase = NULL;
246 return 0;