aome further corrections to copyright notices.
[AROS.git] / workbench / libs / muimaster / mui.h
blobbc814fb2f182f11b28d642c5442dc9a82199447d
1 /*
2 Copyright 2002-2018, 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) (APTR) \
70 ({ \
71 ClassID __class = (ClassID) class; \
72 enum { __ismuiobjmacro = 1 }; \
73 IPTR __tags[] = {0
75 #define BOOPSIOBJMACRO_START(class) (APTR) \
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: check for "localized" menu items such
154 * as "O\0Open" */
155 #define MUIO_MenustripNM_CommandKeyCheck (1<<0)
157 /* flag for MUI_CoolButton */
158 #define MUIO_CoolButton_CoolImageID (1<<0)
160 struct MUI_MinMax
162 WORD MinWidth;
163 WORD MinHeight;
164 WORD MaxWidth;
165 WORD MaxHeight;
166 WORD DefWidth;
167 WORD DefHeight;
170 /* special maximum dimension in case it is unlimited */
171 #define MUI_MAXMAX 10000
173 /* Number of pens, the single definintion is below */
174 #define MPEN_COUNT 8
176 /* The mask for pens from MUI_ObtainPen() and a macro */
177 #define MUIPEN_MASK 0x0000ffff
178 #define MUIPEN(pen) ((pen) & MUIPEN_MASK)
180 /* These cannot be enums, since they will
181 * not be passed properly in varadic
182 * functions by some compilers.
184 #define MUIV_Font_Inherit ((IPTR)0)
185 #define MUIV_Font_Normal ((IPTR)-1)
186 #define MUIV_Font_List ((IPTR)-2)
187 #define MUIV_Font_Tiny ((IPTR)-3)
188 #define MUIV_Font_Fixed ((IPTR)-4)
189 #define MUIV_Font_Title ((IPTR)-5)
190 #define MUIV_Font_Big ((IPTR)-6)
191 #define MUIV_Font_Button ((IPTR)-7)
192 #define MUIV_Font_Knob ((IPTR)-8)
193 #define MUIV_Font_NegCount ((IPTR)-9)
195 /* Possible keyevents (user configurable) */
196 enum
198 MUIKEY_RELEASE = -2, /* this one is faked only, so not configurable */
199 MUIKEY_NONE = -1,
200 MUIKEY_PRESS = 0,
201 MUIKEY_TOGGLE = 1,
202 MUIKEY_UP = 2,
203 MUIKEY_DOWN = 3,
204 MUIKEY_PAGEUP = 4,
205 MUIKEY_PAGEDOWN = 5,
206 MUIKEY_TOP = 6,
207 MUIKEY_BOTTOM = 7,
208 MUIKEY_LEFT = 8,
209 MUIKEY_RIGHT = 9,
210 MUIKEY_WORDLEFT = 10,
211 MUIKEY_WORDRIGHT = 11,
212 MUIKEY_LINESTART = 12,
213 MUIKEY_LINEEND = 13,
214 MUIKEY_GADGET_NEXT = 14,
215 MUIKEY_GADGET_PREV = 15,
216 MUIKEY_GADGET_OFF = 16,
217 MUIKEY_WINDOW_CLOSE = 17,
218 MUIKEY_WINDOW_NEXT = 18,
219 MUIKEY_WINDOW_PREV = 19,
220 MUIKEY_HELP = 20,
221 MUIKEY_POPUP = 21,
222 MUIKEY_COUNT = 22
225 /* The mask definitions of the above keys */
226 #define MUIKEYF_PRESS (1<<MUIKEY_PRESS)
227 #define MUIKEYF_TOGGLE (1<<MUIKEY_TOGGLE)
228 #define MUIKEYF_UP (1<<MUIKEY_UP)
229 #define MUIKEYF_DOWN (1<<MUIKEY_DOWN)
230 #define MUIKEYF_PAGEUP (1<<MUIKEY_PAGEUP)
231 #define MUIKEYF_PAGEDOWN (1<<MUIKEY_PAGEDOWN)
232 #define MUIKEYF_TOP (1<<MUIKEY_TOP)
233 #define MUIKEYF_BOTTOM (1<<MUIKEY_BOTTOM)
234 #define MUIKEYF_LEFT (1<<MUIKEY_LEFT)
235 #define MUIKEYF_RIGHT (1<<MUIKEY_RIGHT)
236 #define MUIKEYF_WORDLEFT (1<<MUIKEY_WORDLEFT)
237 #define MUIKEYF_WORDRIGHT (1<<MUIKEY_WORDRIGHT)
238 #define MUIKEYF_LINESTART (1<<MUIKEY_LINESTART)
239 #define MUIKEYF_LINEEND (1<<MUIKEY_LINEEND)
240 #define MUIKEYF_GADGET_NEXT (1<<MUIKEY_GADGET_NEXT)
241 #define MUIKEYF_GADGET_PREV (1<<MUIKEY_GADGET_PREV)
242 #define MUIKEYF_GADGET_OFF (1<<MUIKEY_GADGET_OFF)
243 #define MUIKEYF_WINDOW_CLOSE (1<<MUIKEY_WINDOW_CLOSE)
244 #define MUIKEYF_WINDOW_NEXT (1<<MUIKEY_WINDOW_NEXT)
245 #define MUIKEYF_WINDOW_PREV (1<<MUIKEY_WINDOW_PREV)
246 #define MUIKEYF_HELP (1<<MUIKEY_HELP)
247 #define MUIKEYF_POPUP (1<<MUIKEY_POPUP)
249 struct MUI_CustomClass
251 APTR mcc_UserData; /* freely usable */
253 /* Zune/MUI had the following libraries opened for you */
254 struct Library *mcc_UtilityBase;
255 struct Library *mcc_DOSBase;
256 struct Library *mcc_GfxBase;
257 struct Library *mcc_IntuitionBase;
259 struct IClass *mcc_Super; /* the boopsi class's superclass */
260 struct IClass *mcc_Class; /* the boopsi class */
262 /* the following stuff is private */
264 struct Library *mcc_Module; /* non-null if external class */
267 #undef MPEN_COUNT
269 typedef enum {
270 MPEN_SHINE = 0,
271 MPEN_HALFSHINE = 1,
272 MPEN_BACKGROUND = 2,
273 MPEN_HALFSHADOW = 3,
274 MPEN_SHADOW = 4,
275 MPEN_TEXT = 5,
276 MPEN_FILL = 6,
277 MPEN_MARK = 7,
278 MPEN_COUNT = 8,
279 } MPen;
281 typedef enum {
282 PST_MUI = 'm',
283 PST_CMAP = 'p',
284 PST_RGB = 'r',
285 PST_SYS = 's',
286 } PenSpecType;
288 /* MUI_PenSpec is an ascii spec like this:
290 "m5" (mui pen #5)
291 "p123" (cmap entry #123)
292 "rFFFFFFFF,00000000,00000000 (rgb #FF0000)
293 "s3" (system pen #3)
295 It needs to be like this, because for example nlist has
296 default penspecs in its source encoded like above which
297 it directly passes to MUI_ObtainBestPen */
299 struct MUI_PenSpec
301 UBYTE buf[32];
305 struct MUI_FrameSpec
307 char buf[32];
310 struct MUI_RGBcolor
312 ULONG red;
313 ULONG green;
314 ULONG blue;
317 struct MUI_AlphaData
319 LONG width;
320 LONG height;
321 LONG dummy[2];
322 LONG data[0];
325 #ifndef _MUI_CLASSES_NOTIFY_H
326 #include "classes/notify.h"
327 #endif
329 #ifndef _MUI_CLASSES_WINDOW_H
330 #include "classes/window.h"
331 #endif
333 #ifndef _MUI_CLASSES_AREA_H
334 #include "classes/area.h"
335 #endif
337 #ifndef _MUI_CLASSES_GROUP_H
338 #include "classes/group.h"
339 #endif
341 #ifndef _MUI_CLASSES_RECTANGLE_H
342 #include "classes/rectangle.h"
343 #endif
345 #ifndef _MUI_CLASSES_TEXT_H
346 #include "classes/text.h"
347 #endif
349 #ifndef _MUI_CLASSES_NUMERIC_H
350 #include "classes/numeric.h"
351 #endif
353 #ifndef _MUI_CLASSES_SLIDER_H
354 #include "classes/slider.h"
355 #endif
357 #ifndef _MUI_CLASSES_STRING_H
358 #include "classes/string.h"
359 #endif
361 #ifndef _MUI_CLASSES_BOOPSI_H
362 #include "classes/boopsi.h"
363 #endif
365 #ifndef _MUI_CLASSES_PROP_H
366 #include "classes/prop.h"
367 #endif
369 #ifndef _MUI_CLASSES_SCROLLBAR_H
370 #include "classes/scrollbar.h"
371 #endif
373 #ifndef _MUI_CLASSES_REGISTER_H
374 #include "classes/register.h"
375 #endif
377 #ifndef _MUI_CLASSES_MENUITEM_H
378 #include "classes/menuitem.h"
379 #endif
381 #ifndef _MUI_CLASSES_DATASPACE_H
382 #include "classes/dataspace.h"
383 #endif
385 #ifndef _MUI_CLASSES_VIRTGROUP_H
386 #include "classes/virtgroup.h"
387 #endif
389 #ifndef _MUI_CLASSES_SCROLLGROUP_H
390 #include "classes/scrollgroup.h"
391 #endif
393 #ifndef _MUI_CLASSES_SCROLLBUTTON_H
394 #include "classes/scrollbutton.h"
395 #endif
397 #ifndef _MUI_CLASSES_SEMAPHORE_H
398 #include "classes/semaphore.h"
399 #endif
401 #ifndef _MUI_CLASSES_BITMAP_H
402 #include "classes/bitmap.h"
403 #endif
405 #ifndef _MUI_CLASSES_BODYCHUNK_H
406 #include "classes/bodychunk.h"
407 #endif
409 #ifndef _MUI_CLASSES_CHUNKYIMAGE_H
410 #include "classes/chunkyimage.h"
411 #endif
413 #ifndef _MUI_CLASSES_LISTVIEW_H
414 #include "classes/listview.h"
415 #endif
417 #ifndef _MUI_CLASSES_LIST_H
418 #include "classes/list.h"
419 #endif
421 #ifndef _MUI_CLASSES_FLOATTEXT_H
422 #include "classes/floattext.h"
423 #endif
425 #ifndef _MUI_CLASSES_POPSTRING_H
426 #include "classes/popstring.h"
427 #endif
429 #ifndef _MUI_CLASSES_POPOBJECT_H
430 #include "classes/popobject.h"
431 #endif
433 #ifndef _MUI_CLASSES_CYCLE_H
434 #include "classes/cycle.h"
435 #endif
437 #ifndef _MUI_CLASSES_GAUGE_H
438 #include "classes/gauge.h"
439 #endif
441 #ifndef _MUI_CLASSES_IMAGE_H
442 #include "classes/image.h"
443 #endif
445 #ifndef _MUI_CLASSES_IMAGEDISPLAY_H
446 #include "classes/imagedisplay.h"
447 #endif
449 #ifndef _MUI_CLASSES_POPASL_H
450 #include "classes/popasl.h"
451 #endif
453 #ifndef _MUI_CLASSES_SETTINGSGROUP_H
454 #include "classes/settingsgroup.h"
455 #endif
457 #ifndef _MUI_CLASSES_SETTINGS_H
458 #include "classes/settings.h"
459 #endif
461 #ifndef _MUI_CLASSES_ABOUTMUI_H
462 #include "classes/aboutmui.h"
463 #endif
465 #ifndef _MUI_CLASSES_CONFIGDATA_H
466 #include "classes/configdata.h"
467 #endif
469 #ifndef _MUI_CLASSES_IMAGEADJUST_H
470 #include "classes/imageadjust.h"
471 #endif
473 #ifndef _MUI_CLASSES_POPIMAGE_H
474 #include "classes/popimage.h"
475 #endif
477 #ifndef _MUI_CLASSES_SCALE_H
478 #include "classes/scale.h"
479 #endif
481 #ifndef _MUI_CLASSES_RADIO_H
482 #include "classes/radio.h"
483 #endif
485 #ifndef _MUI_CLASSES_BALANCE_H
486 #include "classes/balance.h"
487 #endif
489 #ifndef _MUI_CLASSES_PENDISPLAY_H
490 #include "classes/pendisplay.h"
491 #endif
493 #ifndef _MUI_CLASSES_PENADJUST_H
494 #include "classes/penadjust.h"
495 #endif
497 #ifndef _MUI_CLASSES_POPPEN_H
498 #include "classes/poppen.h"
499 #endif
501 #ifndef _MUI_CLASSES_COLORFIELD_H
502 #include "classes/colorfield.h"
503 #endif
505 #ifndef _MUI_CLASSES_COLORADJUST_H
506 #include "classes/coloradjust.h"
507 #endif
509 #ifndef _MUI_CLASSES_MCCPREFS_H
510 #include "classes/mccprefs.h"
511 #endif
513 #ifndef _MUI_CLASSES_FRAMEADJUST_H
514 #include "classes/frameadjust.h"
515 #endif
517 #ifndef _MUI_CLASSES_FRAMEDISPLAY_H
518 #include "classes/framedisplay.h"
519 #endif
521 #ifndef _MUI_CLASSES_POPFRAME_H
522 #include "classes/popframe.h"
523 #endif
525 #ifndef _MUI_CLASSES_VOLUMELIST_H
526 #include "classes/volumelist.h"
527 #endif
529 #ifndef _MUI_CLASSES_DIRLIST_H
530 #include "classes/dirlist.h"
531 #endif
533 #ifndef _MUI_CLASSES_NUMERICBUTTON_H
534 #include "classes/numericbutton.h"
535 #endif
537 #ifndef _MUI_CLASSES_POPLIST_H
538 #include "classes/poplist.h"
539 #endif
541 #ifndef _MUI_CLASSES_POPSCREEN_H
542 #include "classes/popscreen.h"
543 #endif
545 #ifndef _MUI_CLASSES_CRAWLING_H
546 #include "classes/crawling.h"
547 #endif
549 #ifndef _MUI_CLASSES_LEVELMETER_H
550 #include "classes/levelmeter.h"
551 #endif
553 #ifndef _MUI_CLASSES_KNOB_H
554 #include "classes/knob.h"
555 #endif
557 #ifndef _MUI_CLASSES_DTPIC_H
558 #include "classes/dtpic.h"
559 #endif
561 #ifndef _MUI_CLASSES_PALETTE_H
562 #include "classes/palette.h"
563 #endif
565 #ifndef _MUI_CLASSES_TITLE_H
566 #include "classes/title.h"
567 #endif
569 #ifndef _MUI_CLASSES_PROCESS_H
570 #include "classes/process.h"
571 #endif
573 #ifndef _MUI_CLASSES_PIXMAP_H
574 #include "classes/pixmap.h"
575 #endif
577 /**************************************************************************
578 Zune/MUI Image and Background definition
579 **************************************************************************/
580 /* configured by the user within the prefs program */
581 #define MUII_WindowBack 0UL
582 #define MUII_RequesterBack 1UL
583 #define MUII_ButtonBack 2UL
584 #define MUII_ListBack 3UL
585 #define MUII_TextBack 4UL
586 #define MUII_PropBack 5UL
587 #define MUII_PopupBack 6UL
588 #define MUII_SelectedBack 7UL
589 #define MUII_ListCursor 8UL
590 #define MUII_ListSelect 9UL
591 #define MUII_ListSelCur 10UL
592 #define MUII_ArrowUp 11UL
593 #define MUII_ArrowDown 12UL
594 #define MUII_ArrowLeft 13UL
595 #define MUII_ArrowRight 14UL
596 #define MUII_CheckMark 15UL
597 #define MUII_RadioButton 16UL
598 #define MUII_Cycle 17UL
599 #define MUII_PopUp 18UL
600 #define MUII_PopFile 19UL
601 #define MUII_PopDrawer 20UL
602 #define MUII_PropKnob 21UL
603 #define MUII_Drawer 22UL
604 #define MUII_HardDisk 23UL
605 #define MUII_Disk 24UL
606 #define MUII_Chip 25UL
607 #define MUII_Volume 26UL
608 #define MUII_RegisterBack 27UL
609 #define MUII_Network 28UL
610 #define MUII_Assign 29UL
611 #define MUII_TapePlay 30UL
612 #define MUII_TapePlayBack 31UL
613 #define MUII_TapePause 32UL
614 #define MUII_TapeStop 33UL
615 #define MUII_TapeRecord 34UL
616 #define MUII_GroupBack 35UL
617 #define MUII_SliderBack 36UL
618 #define MUII_SliderKnob 37UL
619 #define MUII_TapeUp 38UL
620 #define MUII_TapeDown 39UL
621 #define MUII_PageBack 40UL
622 #define MUII_ReadListBack 41UL
623 #define MUII_Count 42UL
625 /* direct colors and combinations */
626 #define MUII_BACKGROUND 128UL
627 #define MUII_SHADOW 129UL
628 #define MUII_SHINE 130UL
629 #define MUII_FILL 131UL
630 #define MUII_SHADOWBACK 132UL
631 #define MUII_SHADOWFILL 133UL
632 #define MUII_SHADOWSHINE 134UL
633 #define MUII_FILLBACK 135UL
634 #define MUII_FILLSHINE 136UL
635 #define MUII_SHINEBACK 137UL
636 #define MUII_FILLBACK2 138UL
637 #define MUII_HSHINEBACK 139UL
638 #define MUII_HSHADOWBACK 140UL
639 #define MUII_HSHINESHINE 141UL
640 #define MUII_HSHADOWSHADOW 142UL
641 #define MUII_MARKSHINE 143UL
642 #define MUII_MARKHALFSHINE 144UL
643 #define MUII_MARKBACKGROUND 145UL
644 #define MUII_LASTPAT 146UL
647 /**************************************************************************
648 For ARexx
649 **************************************************************************/
650 struct MUI_Command
652 char *mc_Name;
653 char *mc_Template;
654 LONG mc_Parameters;
655 struct Hook *mc_Hook;
656 LONG mc_Reserved[5];
659 #define MC_TEMPLATE_ID ((STRPTR)~0)
661 #define MUI_RXERR_BADDEFINITION -1
662 #define MUI_RXERR_OUTOFMEMORY -2
663 #define MUI_RXERR_UNKNOWNCOMMAND -3
664 #define MUI_RXERR_BADSYNTAX -4
666 #ifndef _MUI_MACROS_H
667 #include "macros.h"
668 #endif
670 #endif /* LIBRARIES_MUI_H */