# dont perform the libgen and libsocket test in configure for AROS.
[AROS-Contrib.git] / fish / surf / menu_color.c
blobce667ac76bc458eea82ab17833fc758d02638946
2 /*
3 * Menu description for selecting color mapping
4 */
5 static struct IntuiText colortext[] = {
6 { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"grey", NULL },
7 { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"red", NULL },
8 { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"green", NULL },
9 { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"blue", NULL },
10 { 0, 1, JAM2, 20, 0, NULL, (UBYTE *)"rainbow",NULL }
13 #define ColNum (sizeof(colortext)/sizeof(struct IntuiText))
14 #define ColXMask ((1<<ColNum)-1)
15 #define ColorExclude(entry) (ColXMask^( 1<<entry))
17 #define COLMEMFLAGS ( CHECKIT | ITEMTEXT | HIGHCOMP | ITEMENABLED )
19 extern void SetHourGlassCol();
20 extern void SetRainbow();
23 struct MenuItem coloritems[] = {
24 { &coloritems[1], /* next item */
25 10, 0, 80 , 10, /* x,y,w,h */
26 COLMEMFLAGS| CHECKED,
27 ColorExclude(0), /* mutual exclude bits */
28 (APTR) &colortext[0], /* grey */
29 NULL, /* highlight image */
30 'h', /* command byte ? */
31 NULL, /* submenu item */
32 0 /* next select for select dragging */
34 { &coloritems[2], /* next item */
35 10, 10, 80 , 10, /* x,y,w,h */
36 COLMEMFLAGS,
37 ColorExclude(1), /* mutual exclude bits */
38 (APTR) &colortext[1], /* red */
39 NULL, /* highlight image */
40 'h', /* command byte ? */
41 NULL, /* submenu item */
42 0 /* next select for select dragging */
44 { &coloritems[3], /* next item */
45 10, 20, 80 , 10, /* x,y,w,h */
46 COLMEMFLAGS,
47 ColorExclude(2), /* mutual exclude bits */
48 (APTR) &colortext[2],
49 NULL, /* highlight image */
50 'h', /* command byte ? */
51 NULL, /* submenu item */
52 0 /* next select for select dragging */
54 { &coloritems[4], /* next item */
55 10, 30, 80 , 10, /* x,y,w,h */
56 COLMEMFLAGS,
57 ColorExclude(3), /* mutual exclude bits */
58 (APTR) &colortext[3],
59 NULL, /* highlight image */
60 'h', /* command byte ? */
61 NULL, /* submenu item */
62 0 /* next select for select dragging */
64 { NULL, /* next item */
65 10, 40, 80 , 10, /* x,y,w,h */
66 COLMEMFLAGS,
67 ColorExclude(4), /* mutual exclude bits */
68 (APTR) &colortext[4],
69 NULL, /* highlight image */
70 'h', /* command byte ? */
71 NULL, /* submenu item */
72 0 /* next select for select dragging */
78 void MenuSetColMap()
80 int which;
82 for( which = 0; which < ColNum; which++ ) {
83 if( Selected(coloritems[which]))
84 break;
87 SetHourGlassCol();
89 switch( which ) {
90 case 0:
91 SetMono( 0xf, 0xf, 0xf );
92 break;
93 case 1:
94 SetMono( 0xf, 0, 0 );
95 break;
96 case 2:
97 SetMono( 0, 0xf, 0 );
98 break;
99 case 3:
100 SetMono( 0x0, 0x0, 0xf );
101 break;
102 case 4:
103 SetRainbow();
104 break;
105 default:
106 break;