Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / libs / muimaster / mui.h
blobddf6ed857595f6b19cafd6319ad4b14591402179
1 /*
2 Copyright 2002-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #ifndef LIBRARIES_MUI_H
7 #define LIBRARIES_MUI_H
9 #ifndef INTUITION_CLASSES_H
10 # include <intuition/classes.h>
11 #endif
12 #ifndef GRAPHICS_GRAPHICS_H
13 # include <graphics/gfx.h>
14 #endif
15 #ifndef GRAPHICS_RASTPORT_H
16 # include <graphics/rastport.h>
17 #endif
18 #ifndef LIBRARIES_IFFPARSE_H
19 # include <libraries/iffparse.h>
20 #endif
22 #ifdef __AROS__
23 # ifndef AROS_ASMCALL_H
24 # include <aros/asmcall.h>
25 # endif
26 # define SAVEDS
27 #else
28 # include "support_amigaos.h"
29 #endif
32 #include "mui_identifiers.h"
34 #ifndef __AROS__
35 #define MUIMASTER_NAME "zunemaster.library"
36 #define MUIMASTER_VMIN 0
37 #define MUIMASTER_VLATEST 0
38 #else
39 #define MUIMASTER_NAME "muimaster.library"
40 #define MUIMASTER_VMIN 11
41 #define MUIMASTER_VLATEST 19
42 #endif
44 /* START PRIV */
46 /* This structure is used for the internal classes */
48 struct __MUIBuiltinClass {
49 CONST_STRPTR name;
50 CONST_STRPTR supername;
51 ULONG datasize;
53 #ifndef __AROS__
54 ULONG (*dispatcher)();
55 #else
56 AROS_UFP3(IPTR, (*dispatcher),
57 AROS_UFPA(Class *, cl, A0),
58 AROS_UFPA(Object *, obj, A2),
59 AROS_UFPA(Msg , msg, A1));
60 #endif
63 /* END PRIV */
65 #if defined(MUIMASTER_YES_INLINE_STDARG) && \
66 !defined(NO_INLINE_STDARG) && \
67 !defined(__SASC)
69 #define MUIOBJMACRO_START(class) (IPTR) \
70 ({ \
71 ClassID __class = (ClassID) class; \
72 enum { __ismuiobjmacro = 1 }; \
73 IPTR __tags[] = {0
75 #define BOOPSIOBJMACRO_START(class) (IPTR) \
76 ({ \
77 Class *__class = (Class *) class; \
78 enum { __ismuiobjmacro = 0 }; \
79 IPTR __tags[] = {0
81 #define OBJMACRO_END \
82 TAG_DONE}; \
83 ( \
84 __ismuiobjmacro \
85 ? MUI_NewObjectA((ClassID)__class, (struct TagItem *)(__tags + 1)) \
86 : NewObjectA((Class *)__class, NULL, (struct TagItem *)(__tags + 1)) \
87 ); \
90 #else
92 #ifdef __amigaos4__
93 # define MUIOBJMACRO_START(class) (IZuneMaster->MUI_NewObject)(class
94 # define BOOPSIOBJMACRO_START(class) (IIntuition->NewObject)(class, NULL
95 #else
96 # define MUIOBJMACRO_START(class) MUI_NewObject(class
97 # define BOOPSIOBJMACRO_START(class) NewObject(class, NULL
98 #endif
100 #define OBJMACRO_END TAG_DONE)
102 #endif
104 #ifndef _MUI_CLASSES_NOTIFY_H
105 #include "classes/notify.h"
106 #endif
108 #ifndef _MUI_CLASSES_FAMILY_H
109 #include "classes/family.h"
110 #endif
112 #ifndef _MUI_CLASSES_APPLICATION_H
113 #include "classes/application.h"
114 #endif
117 /**************************************************************************
118 Here are the possible Objecttypes for MUI_MakeObject()
119 **************************************************************************/
120 enum
122 MUIO_Label = 1, /* STRPTR label, ULONG flags */
123 MUIO_Button, /* STRPTR label */
124 MUIO_Checkmark, /* STRPTR label */
125 MUIO_Cycle, /* STRPTR label, STRPTR *entries */
126 MUIO_Radio, /* STRPTR label, STRPTR *entries */
127 MUIO_Slider, /* STRPTR label, LONG min, LONG max */
128 MUIO_String, /* STRPTR label, LONG maxlen */
129 MUIO_PopButton, /* STRPTR imagespec */
130 MUIO_HSpace, /* LONG space */
131 MUIO_VSpace, /* LONG space */
132 MUIO_HBar, /* LONG space */
133 MUIO_VBar, /* LONG space */
134 MUIO_MenustripNM, /* struct NewMenu *nm, ULONG flags */
135 MUIO_Menuitem, /* STRPTR label, STRPTR shortcut, ULONG flags, ULONG data */
136 MUIO_BarTitle, /* STRPTR label */
137 MUIO_NumericButton,/* STRPTR label, LONG min, LONG max, STRPTR format */
139 MUIO_CoolButton = 111, /* STRPTR label, APTR CoolImage, ULONG flags */
140 MUIO_ImageButton, /* CONST_STRPTR label, CONST_STRPTR imagePath */
143 /* flag for MUIO_Menuitem */
144 #define MUIO_Menuitem_CopyStrings (1<<30)
146 /* flags for MUIO_Label type */
147 #define MUIO_Label_SingleFrame (1<< 8)
148 #define MUIO_Label_DoubleFrame (1<< 9)
149 #define MUIO_Label_LeftAligned (1<<10)
150 #define MUIO_Label_Centered (1<<11)
151 #define MUIO_Label_FreeVert (1<<12)
153 /* flag for MUIO_MenustripNM */
154 #define MUIO_MenustripNM_CommandKeyCheck (1<<0) /* check for "localized" menu items such as "O\0Open" */
156 /* flag for MUI_CoolButton */
157 #define MUIO_CoolButton_CoolImageID (1<<0)
159 struct MUI_MinMax
161 WORD MinWidth;
162 WORD MinHeight;
163 WORD MaxWidth;
164 WORD MaxHeight;
165 WORD DefWidth;
166 WORD DefHeight;
169 /* special maximum dimension in case it is unlimited */
170 #define MUI_MAXMAX 10000
172 /* Number of pens, the single definintion is below */
173 #define MPEN_COUNT 8
175 /* The mask for pens from MUI_ObtainPen() and a macro */
176 #define MUIPEN_MASK 0x0000ffff
177 #define MUIPEN(pen) ((pen) & MUIPEN_MASK)
180 enum {
181 MUIV_Font_Inherit = 0,
182 MUIV_Font_Normal = -1,
183 MUIV_Font_List = -2,
184 MUIV_Font_Tiny = -3,
185 MUIV_Font_Fixed = -4,
186 MUIV_Font_Title = -5,
187 MUIV_Font_Big = -6,
188 MUIV_Font_Button = -7,
189 MUIV_Font_Knob = -8,
190 MUIV_Font_NegCount = -9,
193 /* Possible keyevents (user configurable) */
194 enum
196 MUIKEY_RELEASE = -2, /* this one is faked only, and thereforce not configurable */
197 MUIKEY_NONE = -1,
198 MUIKEY_PRESS = 0,
199 MUIKEY_TOGGLE = 1,
200 MUIKEY_UP = 2,
201 MUIKEY_DOWN = 3,
202 MUIKEY_PAGEUP = 4,
203 MUIKEY_PAGEDOWN = 5,
204 MUIKEY_TOP = 6,
205 MUIKEY_BOTTOM = 7,
206 MUIKEY_LEFT = 8,
207 MUIKEY_RIGHT = 9,
208 MUIKEY_WORDLEFT = 10,
209 MUIKEY_WORDRIGHT = 11,
210 MUIKEY_LINESTART = 12,
211 MUIKEY_LINEEND = 13,
212 MUIKEY_GADGET_NEXT = 14,
213 MUIKEY_GADGET_PREV = 15,
214 MUIKEY_GADGET_OFF = 16,
215 MUIKEY_WINDOW_CLOSE = 17,
216 MUIKEY_WINDOW_NEXT = 18,
217 MUIKEY_WINDOW_PREV = 19,
218 MUIKEY_HELP = 20,
219 MUIKEY_POPUP = 21,
220 MUIKEY_COUNT = 22
223 /* The mask definitions of the above keys */
224 #define MUIKEYF_PRESS (1<<MUIKEY_PRESS)
225 #define MUIKEYF_TOGGLE (1<<MUIKEY_TOGGLE)
226 #define MUIKEYF_UP (1<<MUIKEY_UP)
227 #define MUIKEYF_DOWN (1<<MUIKEY_DOWN)
228 #define MUIKEYF_PAGEUP (1<<MUIKEY_PAGEUP)
229 #define MUIKEYF_PAGEDOWN (1<<MUIKEY_PAGEDOWN)
230 #define MUIKEYF_TOP (1<<MUIKEY_TOP)
231 #define MUIKEYF_BOTTOM (1<<MUIKEY_BOTTOM)
232 #define MUIKEYF_LEFT (1<<MUIKEY_LEFT)
233 #define MUIKEYF_RIGHT (1<<MUIKEY_RIGHT)
234 #define MUIKEYF_WORDLEFT (1<<MUIKEY_WORDLEFT)
235 #define MUIKEYF_WORDRIGHT (1<<MUIKEY_WORDRIGHT)
236 #define MUIKEYF_LINESTART (1<<MUIKEY_LINESTART)
237 #define MUIKEYF_LINEEND (1<<MUIKEY_LINEEND)
238 #define MUIKEYF_GADGET_NEXT (1<<MUIKEY_GADGET_NEXT)
239 #define MUIKEYF_GADGET_PREV (1<<MUIKEY_GADGET_PREV)
240 #define MUIKEYF_GADGET_OFF (1<<MUIKEY_GADGET_OFF)
241 #define MUIKEYF_WINDOW_CLOSE (1<<MUIKEY_WINDOW_CLOSE)
242 #define MUIKEYF_WINDOW_NEXT (1<<MUIKEY_WINDOW_NEXT)
243 #define MUIKEYF_WINDOW_PREV (1<<MUIKEY_WINDOW_PREV)
244 #define MUIKEYF_HELP (1<<MUIKEY_HELP)
245 #define MUIKEYF_POPUP (1<<MUIKEY_POPUP)
247 struct MUI_CustomClass
249 APTR mcc_UserData; /* freely usable */
251 /* Zune/MUI had the following libraries opened for you */
252 struct Library *mcc_UtilityBase;
253 struct Library *mcc_DOSBase;
254 struct Library *mcc_GfxBase;
255 struct Library *mcc_IntuitionBase;
257 struct IClass *mcc_Super; /* the boopsi class' superclass */
258 struct IClass *mcc_Class; /* the boopsi class */
260 /* the following stuff is private */
262 struct Library *mcc_Module; /* non-null if external class */
265 #undef MPEN_COUNT
267 typedef enum {
268 MPEN_SHINE = 0,
269 MPEN_HALFSHINE = 1,
270 MPEN_BACKGROUND = 2,
271 MPEN_HALFSHADOW = 3,
272 MPEN_SHADOW = 4,
273 MPEN_TEXT = 5,
274 MPEN_FILL = 6,
275 MPEN_MARK = 7,
276 MPEN_COUNT = 8,
277 } MPen;
279 typedef enum {
280 PST_MUI = 'm',
281 PST_CMAP = 'p',
282 PST_RGB = 'r',
283 PST_SYS = 's',
284 } PenSpecType;
286 /* MUI_PenSpec is a an ascii spec like this:
288 "m5" (mui pen #5)
289 "p123" (cmap entry #123)
290 "rFFFFFFFF,00000000,00000000 (rgb #FF0000)
291 "s3" (system pen #3)
293 It needs to be like this, because for example nlist has
294 default penspecs in it's source encoded like above which
295 it directly passes to MUI_ObtainBestPen */
297 struct MUI_PenSpec
299 UBYTE ps_buf[32];
303 struct MUI_FrameSpec
305 char buf[32];
308 struct MUI_RGBcolor
310 ULONG red;
311 ULONG green;
312 ULONG blue;
315 #ifndef _MUI_CLASSES_NOTIFY_H
316 #include "classes/notify.h"
317 #endif
319 #ifndef _MUI_CLASSES_WINDOW_H
320 #include "classes/window.h"
321 #endif
323 #ifndef _MUI_CLASSES_AREA_H
324 #include "classes/area.h"
325 #endif
327 #ifndef _MUI_CLASSES_GROUP_H
328 #include "classes/group.h"
329 #endif
331 #ifndef _MUI_CLASSES_RECTANGLE_H
332 #include "classes/rectangle.h"
333 #endif
335 #ifndef _MUI_CLASSES_TEXT_H
336 #include "classes/text.h"
337 #endif
339 #ifndef _MUI_CLASSES_NUMERIC_H
340 #include "classes/numeric.h"
341 #endif
343 #ifndef _MUI_CLASSES_SLIDER_H
344 #include "classes/slider.h"
345 #endif
347 #ifndef _MUI_CLASSES_STRING_H
348 #include "classes/string.h"
349 #endif
351 #ifndef _MUI_CLASSES_BOOPSI_H
352 #include "classes/boopsi.h"
353 #endif
355 #ifndef _MUI_CLASSES_PROP_H
356 #include "classes/prop.h"
357 #endif
359 #ifndef _MUI_CLASSES_SCROLLBAR_H
360 #include "classes/scrollbar.h"
361 #endif
363 #ifndef _MUI_CLASSES_REGISTER_H
364 #include "classes/register.h"
365 #endif
367 #ifndef _MUI_CLASSES_MENUITEM_H
368 #include "classes/menuitem.h"
369 #endif
371 #ifndef _MUI_CLASSES_DATASPACE_H
372 #include "classes/dataspace.h"
373 #endif
375 #ifndef _MUI_CLASSES_VIRTGROUP_H
376 #include "classes/virtgroup.h"
377 #endif
379 #ifndef _MUI_CLASSES_SCROLLGROUP_H
380 #include "classes/scrollgroup.h"
381 #endif
383 #ifndef _MUI_CLASSES_SCROLLBUTTON_H
384 #include "classes/scrollbutton.h"
385 #endif
387 #ifndef _MUI_CLASSES_SEMAPHORE_H
388 #include "classes/semaphore.h"
389 #endif
391 #ifndef _MUI_CLASSES_BITMAP_H
392 #include "classes/bitmap.h"
393 #endif
395 #ifndef _MUI_CLASSES_BODYCHUNK_H
396 #include "classes/bodychunk.h"
397 #endif
399 #ifndef _MUI_CLASSES_CHUNKYIMAGE_H
400 #include "classes/chunkyimage.h"
401 #endif
403 #ifndef _MUI_CLASSES_LISTVIEW_H
404 #include "classes/listview.h"
405 #endif
407 #ifndef _MUI_CLASSES_LIST_H
408 #include "classes/list.h"
409 #endif
411 #ifndef _MUI_CLASSES_POPSTRING_H
412 #include "classes/popstring.h"
413 #endif
415 #ifndef _MUI_CLASSES_POPOBJECT_H
416 #include "classes/popobject.h"
417 #endif
419 #ifndef _MUI_CLASSES_CYCLE_H
420 #include "classes/cycle.h"
421 #endif
423 #ifndef _MUI_CLASSES_GAUGE_H
424 #include "classes/gauge.h"
425 #endif
427 #ifndef _MUI_CLASSES_IMAGE_H
428 #include "classes/image.h"
429 #endif
431 #ifndef _MUI_CLASSES_IMAGEDISPLAY_H
432 #include "classes/imagedisplay.h"
433 #endif
435 #ifndef _MUI_CLASSES_POPASL_H
436 #include "classes/popasl.h"
437 #endif
439 #ifndef _MUI_CLASSES_SETTINGSGROUP_H
440 #include "classes/settingsgroup.h"
441 #endif
443 #ifndef _MUI_CLASSES_SETTINGS_H
444 #include "classes/settings.h"
445 #endif
447 #ifndef _MUI_CLASSES_ABOUTMUI_H
448 #include "classes/aboutmui.h"
449 #endif
451 #ifndef _MUI_CLASSES_CONFIGDATA_H
452 #include "classes/configdata.h"
453 #endif
455 #ifndef _MUI_CLASSES_IMAGEADJUST_H
456 #include "classes/imageadjust.h"
457 #endif
459 #ifndef _MUI_CLASSES_POPIMAGE_H
460 #include "classes/popimage.h"
461 #endif
463 #ifndef _MUI_CLASSES_SCALE_H
464 #include "classes/scale.h"
465 #endif
467 #ifndef _MUI_CLASSES_RADIO_H
468 #include "classes/radio.h"
469 #endif
471 #ifndef _MUI_CLASSES_BALANCE_H
472 #include "classes/balance.h"
473 #endif
475 #ifndef _MUI_CLASSES_PENDISPLAY_H
476 #include "classes/pendisplay.h"
477 #endif
479 #ifndef _MUI_CLASSES_PENADJUST_H
480 #include "classes/penadjust.h"
481 #endif
483 #ifndef _MUI_CLASSES_POPPEN_H
484 #include "classes/poppen.h"
485 #endif
487 #ifndef _MUI_CLASSES_COLORFIELD_H
488 #include "classes/colorfield.h"
489 #endif
491 #ifndef _MUI_CLASSES_COLORADJUST_H
492 #include "classes/coloradjust.h"
493 #endif
495 #ifndef _MUI_CLASSES_MCCPREFS_H
496 #include "classes/mccprefs.h"
497 #endif
499 #ifndef _MUI_CLASSES_FRAMEADJUST_H
500 #include "classes/frameadjust.h"
501 #endif
503 #ifndef _MUI_CLASSES_FRAMEDISPLAY_H
504 #include "classes/framedisplay.h"
505 #endif
507 #ifndef _MUI_CLASSES_POPFRAME_H
508 #include "classes/popframe.h"
509 #endif
511 #ifndef _MUI_CLASSES_VOLUMELIST_H
512 #include "classes/volumelist.h"
513 #endif
515 #ifndef _MUI_CLASSES_DIRLIST_H
516 #include "classes/dirlist.h"
517 #endif
519 #ifndef _MUI_CLASSES_NUMERICBUTTON_H
520 #include "classes/numericbutton.h"
521 #endif
523 #ifndef _MUI_CLASSES_POPLIST_H
524 #include "classes/poplist.h"
525 #endif
527 #ifndef _MUI_CLASSES_POPSCREEN_H
528 #include "classes/popscreen.h"
529 #endif
531 #ifndef _MUI_CLASSES_CRAWLING_H
532 #include "classes/crawling.h"
533 #endif
535 #ifndef _MUI_CLASSES_LEVELMETER_H
536 #include "classes/levelmeter.h"
537 #endif
539 #ifndef _MUI_CLASSES_KNOB_H
540 #include "classes/knob.h"
541 #endif
543 #ifndef _MUI_CLASSES_DTPIC_H
544 #include "classes/dtpic.h"
545 #endif
547 #ifndef _MUI_CLASSES_PALETTE_H
548 #include "classes/palette.h"
549 #endif
551 /**************************************************************************
552 Zune/MUI Image and Background definition
553 **************************************************************************/
554 /* configured by the user within the prefs programm */
555 #define MUII_WindowBack 0UL
556 #define MUII_RequesterBack 1UL
557 #define MUII_ButtonBack 2UL
558 #define MUII_ListBack 3UL
559 #define MUII_TextBack 4UL
560 #define MUII_PropBack 5UL
561 #define MUII_PopupBack 6UL
562 #define MUII_SelectedBack 7UL
563 #define MUII_ListCursor 8UL
564 #define MUII_ListSelect 9UL
565 #define MUII_ListSelCur 10UL
566 #define MUII_ArrowUp 11UL
567 #define MUII_ArrowDown 12UL
568 #define MUII_ArrowLeft 13UL
569 #define MUII_ArrowRight 14UL
570 #define MUII_CheckMark 15UL
571 #define MUII_RadioButton 16UL
572 #define MUII_Cycle 17UL
573 #define MUII_PopUp 18UL
574 #define MUII_PopFile 19UL
575 #define MUII_PopDrawer 20UL
576 #define MUII_PropKnob 21UL
577 #define MUII_Drawer 22UL
578 #define MUII_HardDisk 23UL
579 #define MUII_Disk 24UL
580 #define MUII_Chip 25UL
581 #define MUII_Volume 26UL
582 #define MUII_RegisterBack 27UL
583 #define MUII_Network 28UL
584 #define MUII_Assign 29UL
585 #define MUII_TapePlay 30UL
586 #define MUII_TapePlayBack 31UL
587 #define MUII_TapePause 32UL
588 #define MUII_TapeStop 33UL
589 #define MUII_TapeRecord 34UL
590 #define MUII_GroupBack 35UL
591 #define MUII_SliderBack 36UL
592 #define MUII_SliderKnob 37UL
593 #define MUII_TapeUp 38UL
594 #define MUII_TapeDown 39UL
595 #define MUII_PageBack 40UL
596 #define MUII_ReadListBack 41UL
597 #define MUII_Count 42UL
599 /* direct color's and combinations */
600 #define MUII_BACKGROUND 128UL
601 #define MUII_SHADOW 129UL
602 #define MUII_SHINE 130UL
603 #define MUII_FILL 131UL
604 #define MUII_SHADOWBACK 132UL
605 #define MUII_SHADOWFILL 133UL
606 #define MUII_SHADOWSHINE 134UL
607 #define MUII_FILLBACK 135UL
608 #define MUII_FILLSHINE 136UL
609 #define MUII_SHINEBACK 137UL
610 #define MUII_FILLBACK2 138UL
611 #define MUII_HSHINEBACK 139UL
612 #define MUII_HSHADOWBACK 140UL
613 #define MUII_HSHINESHINE 141UL
614 #define MUII_HSHADOWSHADOW 142UL
615 #define MUII_MARKSHINE 143UL
616 #define MUII_MARKHALFSHINE 144UL
617 #define MUII_MARKBACKGROUND 145UL
618 #define MUII_LASTPAT 146UL
621 /**************************************************************************
622 For ARexx
623 **************************************************************************/
624 struct MUI_Command
626 char *mc_Name;
627 char *mc_Template;
628 LONG mc_Parameters;
629 struct Hook *mc_Hook;
630 LONG mc_Reserved[5];
633 #define MC_TEMPLATE_ID ((STRPTR)~0)
635 #define MUI_RXERR_BADDEFINITION -1
636 #define MUI_RXERR_OUTOFMEMORY -2
637 #define MUI_RXERR_UNKNOWNCOMMAND -3
638 #define MUI_RXERR_BADSYNTAX -4
640 #ifndef _MUI_MACROS_H
641 #include "macros.h"
642 #endif
644 #endif /* LIBRARIES_MUI_H */