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
20 ***************************************************************************/
22 #include <libraries/iffparse.h>
23 #include <libraries/mui.h>
25 #include <proto/exec.h>
26 #include <proto/dos.h>
27 #include <proto/intuition.h>
28 #include <proto/muimaster.h>
29 #include <proto/utility.h>
30 #include <clib/alib_protos.h>
31 #include <mui/NBitmap_mcc.h>
33 #if defined(__amigaos4__)
34 struct Library
*IntuitionBase
= NULL
;
35 struct Library
*UtilityBase
= NULL
;
36 struct Library
*MUIMasterBase
= NULL
;
38 struct IntuitionBase
*IntuitionBase
= NULL
;
40 struct UtilityBase
*UtilityBase
= NULL
;
42 struct Library
*UtilityBase
= NULL
;
44 struct Library
*MUIMasterBase
= NULL
;
47 #if defined(__amigaos4__)
48 struct IntuitionIFace
*IIntuition
= NULL
;
49 struct UtilityIFace
*IUtility
= NULL
;
50 struct MUIMasterIFace
*IMUIMaster
= NULL
;
52 #define GETINTERFACE(iface, base) (iface = (APTR)GetInterface((struct Library *)(base), "main", 1L, NULL))
53 #define DROPINTERFACE(iface) (DropInterface((struct Interface *)iface), iface = NULL)
55 #define GETINTERFACE(iface, base) TRUE
56 #define DROPINTERFACE(iface)
57 #endif // __amigaos4__
59 const ULONG icon32_normal
[] = {
60 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
61 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x49da7d7f, 0xebd87e80, 0xffd5856b, 0xc5c3725d, 0x37bb5e4f, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
62 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x31e68689, 0xd0df8484, 0xffd37979, 0xffbf6566, 0xffb55a5d, 0xffb96547, 0x38b05341, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
63 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x59e0b86a, 0xbcda7b81, 0xffe48b8a, 0xffd37979, 0xffc16767, 0xffae5454, 0xffa44a4d, 0xc5994339, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
64 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x6cecdb5c, 0xffe6ce73, 0xffca786b, 0xffd07477, 0xffd27877, 0xffc26868, 0xffb05656, 0xff9b4142, 0xff984336, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
65 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x6dffff00, 0xffede049, 0xffe9d876, 0xffd2a861, 0xffb66057, 0xffbf6366, 0xffba6060, 0xffa64c4c, 0xff9b4141, 0xec923839, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
66 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x66ffff00, 0xf9ffff00, 0xfff6e829, 0xffe0c657, 0xffdbbf5a, 0xffc5904b, 0xffac5949, 0xffa3474b, 0xff9a4040, 0xd1923838, 0x49892c2e, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
67 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x57ffff00, 0xe9ffff00, 0xfffbf117, 0xfffaf127, 0xffefd627, 0xffcea545, 0xffcca03d, 0xffae6d2b, 0xff974033, 0xba903438, 0x308a2a2e, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
68 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x45ffff00, 0xdbffff00, 0xfffbf118, 0xfff9f02a, 0xfff9e51c, 0xfff4c904, 0xffd7a40d, 0xffb77c25, 0xffa76522, 0xff994d1c, 0x5b8b3619, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
69 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x33ffff04, 0xccfdf821, 0xfff9ee26, 0xfff9f029, 0xfff9e51c, 0xfff4c706, 0xffddaa00, 0xffb38200, 0xff895407, 0xfc874012, 0x6e87310f, 0x05560000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
70 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x21ffff0a, 0xbafdfa1f, 0xfff9ef29, 0xfff9ef27, 0xfff9e41b, 0xfff5c804, 0xffddaa00, 0xffb58300, 0xff7e4d00, 0xf5611c00, 0x765c0000, 0x12000000, 0x0f000000, 0x0a000000, 0x05000000, 0x01000000, 0x00ff00ff, 0x00ff00ff,
71 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x04fff400, 0x89fdf318, 0xfff9ed27, 0xfff8ed27, 0xfff9e51c, 0xfff5c805, 0xffdfad00, 0xffb58300, 0xff7e4c00, 0xec601d00, 0x77550000, 0x23000000, 0x24000000, 0x22000000, 0x1d000000, 0x12000000, 0x06000000, 0x00ff00ff, 0x00ff00ff,
72 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x3bffd056, 0xe8f6c940, 0xffebc243, 0xfff5d722, 0xfff7cd03, 0xffdfab00, 0xffb58300, 0xff7d4c00, 0xe25f1e00, 0x734a0000, 0x2f000000, 0x30000000, 0x2f000000, 0x2b000000, 0x24000000, 0x16000000, 0x08000000, 0x00ff00ff, 0x00ff00ff,
73 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x06ffccb8, 0x9df9be82, 0xffe8ab76, 0xffd29658, 0xffdaa61f, 0xffd8a506, 0xffb48201, 0xff7f4f00, 0xd95b1c00, 0x6f3c0000, 0x3c000000, 0x3c000000, 0x39000000, 0x30000000, 0x24000000, 0x18000000, 0x0c000000, 0x04000000, 0x00ff00ff, 0x00ff00ff,
74 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x3bfabb83, 0xeee9ac71, 0xffd1955a, 0xffb77b40, 0xffa96e2d, 0xffa26c13, 0xff804f02, 0xcf5d2100, 0x6b2d0000, 0x46000000, 0x42000000, 0x3b000000, 0x2f000000, 0x21000000, 0x11000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
75 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x01ffffff, 0xa1f1ac66, 0xffd29558, 0xffb2763a, 0xff9d6427, 0xff90581e, 0xf285510c, 0xad562600, 0x671e0000, 0x4a000000, 0x41000000, 0x34000000, 0x26000000, 0x17000000, 0x0b000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
76 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x44777372, 0xf59e7c5c, 0xffa36d36, 0xff945b1e, 0xf6865015, 0xbf6a3e0e, 0x7f3b2304, 0x55090000, 0x45000000, 0x37000000, 0x27000000, 0x18000000, 0x0b000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
77 0x00ff00ff, 0x00ff00ff, 0x06000000, 0xb45f6162, 0xff4c4b49, 0xf85e4120, 0xc073420a, 0x7a3b2106, 0x53100701, 0x42000000, 0x35000000, 0x25000000, 0x17000000, 0x0a000000, 0x02000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
78 0x00ff00ff, 0x00ff00ff, 0x09000000, 0xfc494949, 0xc0242427, 0x7607060f, 0x420c0300, 0x2f000000, 0x24000000, 0x1c000000, 0x12000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
79 0x00ff00ff, 0x00ff00ff, 0x06000000, 0x15000000, 0x20000000, 0x1f000000, 0x15000000, 0x0a000000, 0x02000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
81 const ULONG icon32_selected
[] = {
82 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
83 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
84 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
85 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
86 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x04000000, 0x64000000, 0x07000000, 0x03000000, 0x48000000, 0x03000000, 0x00ff00ff, 0x03000000, 0x4c000000, 0x03000000, 0x00ff00ff, 0x00ff00ff,
87 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x0b000000, 0x84000000, 0x0e000000, 0x09000000, 0x67000000, 0x3d000000, 0x72000000, 0x4c000000, 0xa5000000, 0x5b000000, 0x03000000, 0x00ff00ff,
88 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x12000000, 0x88000000, 0x15000000, 0x0f000000, 0x80000000, 0x40000000, 0x87000000, 0x58000000, 0x87000000, 0x17000000, 0x03000000, 0x00ff00ff,
89 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x14000000, 0x8b000000, 0x80000000, 0x6d000000, 0x86000000, 0x52000000, 0x71000000, 0x8a000000, 0x74000000, 0x6a000000, 0x08000000, 0x00ff00ff,
90 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x0d000000, 0x13000000, 0x18000000, 0x17000000, 0x16000000, 0x1d000000, 0x22000000, 0x20000000, 0x19000000, 0x0f000000, 0x04000000, 0x00ff00ff,
91 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x06000000, 0x0c000000, 0x11000000, 0x11000000, 0x0d000000, 0x0e000000, 0x0d000000, 0x10000000, 0x0f000000, 0x09000000, 0x04000000, 0x00ff00ff,
92 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0xb9000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
93 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
94 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
95 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
96 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0xab000000, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
97 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
98 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
99 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
100 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
101 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff,
104 #define ICON32_WIDTH 24
105 #define ICON32_HEIGHT 20
106 #define ICON32_DEPTH 32
110 if((IntuitionBase
= (APTR
)OpenLibrary("intuition.library", 36)) &&
111 GETINTERFACE(IIntuition
, IntuitionBase
))
113 if((UtilityBase
= (APTR
)OpenLibrary("utility.library", 36)) &&
114 GETINTERFACE(IUtility
, UtilityBase
))
116 if((MUIMasterBase
= OpenLibrary("muimaster.library", 19)) &&
117 GETINTERFACE(IMUIMaster
, MUIMasterBase
))
119 Object
*app
, *window
;
120 const char * const classes
[] = { "NBitmap.mcc", NULL
};
122 app
= MUI_NewObject("Application.mui",
123 MUIA_Application_Author
, "NBitmap.mcc Open Source Team",
124 MUIA_Application_Base
, "NBitmap-Test",
125 MUIA_Application_Copyright
, "(c) 2007 NBitmap.mcc Open Source Team",
126 MUIA_Application_Description
, "NBitmap.mcc demo program",
127 MUIA_Application_Title
, "NBitmap-Demo",
128 MUIA_Application_Version
, "$VER: NBitmap-Demo (" __DATE__
")",
129 MUIA_Application_UsedClasses
, classes
,
131 MUIA_Application_Window
,
132 window
= WindowObject
,
133 MUIA_Window_Title
, "NBitmap-Test",
134 MUIA_Window_ID
, MAKE_ID('M','A','I','N'),
135 MUIA_Window_RootObject
, VGroup
,
137 Child
, NBitmapObject
,
138 MUIA_NBitmap_Type
, MUIV_NBitmap_Type_File
,
139 MUIA_NBitmap_Normal
, "PROGDIR:icon.png",
140 MUIA_NBitmap_Label
, "Music",
141 MUIA_NBitmap_Button
, TRUE
,
143 Child
, NBitmapObject
,
144 MUIA_NBitmap_Width
, ICON32_WIDTH
,
145 MUIA_NBitmap_Height
, ICON32_HEIGHT
,
146 MUIA_NBitmap_Type
, MUIV_NBitmap_Type_ARGB32
,
147 MUIA_NBitmap_Normal
, icon32_normal
,
148 MUIA_NBitmap_Selected
, icon32_selected
,
149 MUIA_NBitmap_Label
, "raw icon",
150 MUIA_NBitmap_Button
, TRUE
,
152 Child
, RectangleObject
, End
,
154 Child
, RectangleObject
, End
,
163 DoMethod(window
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
, app
, 2, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
165 set(window
, MUIA_Window_Open
, TRUE
);
167 while((LONG
)DoMethod(app
, MUIM_Application_NewInput
, &sigs
) != (LONG
)MUIV_Application_ReturnID_Quit
)
171 sigs
= Wait(sigs
| SIGBREAKF_CTRL_C
);
173 if(sigs
& SIGBREAKF_CTRL_C
)
178 MUI_DisposeObject(app
);
181 PutStr("Failed to create application\n");
183 DROPINTERFACE(IMUIMaster
);
184 CloseLibrary(MUIMasterBase
);
185 MUIMasterBase
= NULL
;
188 PutStr("Failed to open muimaster.library V19\n");
190 DROPINTERFACE(IUtility
);
191 CloseLibrary((struct Library
*)UtilityBase
);
195 PutStr("Failed to open utility.library V36\n");
197 DROPINTERFACE(IIntuition
);
198 CloseLibrary((struct Library
*)IntuitionBase
);
199 IntuitionBase
= NULL
;
202 PutStr("Failed to open intuition.library V36\n");