Renamed the MUI_PenSpec structure's 'ps_buf' field to the original MUI name:
[AROS.git] / workbench / libs / muimaster / mui.h
blobb08cd283ae6027065ad2c4809477b23456e661d2
1 /*
2 Copyright 2002-2015, 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 #ifndef _MUI_CLASSES_NOTIFY_H
318 #include "classes/notify.h"
319 #endif
321 #ifndef _MUI_CLASSES_WINDOW_H
322 #include "classes/window.h"
323 #endif
325 #ifndef _MUI_CLASSES_AREA_H
326 #include "classes/area.h"
327 #endif
329 #ifndef _MUI_CLASSES_GROUP_H
330 #include "classes/group.h"
331 #endif
333 #ifndef _MUI_CLASSES_RECTANGLE_H
334 #include "classes/rectangle.h"
335 #endif
337 #ifndef _MUI_CLASSES_TEXT_H
338 #include "classes/text.h"
339 #endif
341 #ifndef _MUI_CLASSES_NUMERIC_H
342 #include "classes/numeric.h"
343 #endif
345 #ifndef _MUI_CLASSES_SLIDER_H
346 #include "classes/slider.h"
347 #endif
349 #ifndef _MUI_CLASSES_STRING_H
350 #include "classes/string.h"
351 #endif
353 #ifndef _MUI_CLASSES_BOOPSI_H
354 #include "classes/boopsi.h"
355 #endif
357 #ifndef _MUI_CLASSES_PROP_H
358 #include "classes/prop.h"
359 #endif
361 #ifndef _MUI_CLASSES_SCROLLBAR_H
362 #include "classes/scrollbar.h"
363 #endif
365 #ifndef _MUI_CLASSES_REGISTER_H
366 #include "classes/register.h"
367 #endif
369 #ifndef _MUI_CLASSES_MENUITEM_H
370 #include "classes/menuitem.h"
371 #endif
373 #ifndef _MUI_CLASSES_DATASPACE_H
374 #include "classes/dataspace.h"
375 #endif
377 #ifndef _MUI_CLASSES_VIRTGROUP_H
378 #include "classes/virtgroup.h"
379 #endif
381 #ifndef _MUI_CLASSES_SCROLLGROUP_H
382 #include "classes/scrollgroup.h"
383 #endif
385 #ifndef _MUI_CLASSES_SCROLLBUTTON_H
386 #include "classes/scrollbutton.h"
387 #endif
389 #ifndef _MUI_CLASSES_SEMAPHORE_H
390 #include "classes/semaphore.h"
391 #endif
393 #ifndef _MUI_CLASSES_BITMAP_H
394 #include "classes/bitmap.h"
395 #endif
397 #ifndef _MUI_CLASSES_BODYCHUNK_H
398 #include "classes/bodychunk.h"
399 #endif
401 #ifndef _MUI_CLASSES_CHUNKYIMAGE_H
402 #include "classes/chunkyimage.h"
403 #endif
405 #ifndef _MUI_CLASSES_LISTVIEW_H
406 #include "classes/listview.h"
407 #endif
409 #ifndef _MUI_CLASSES_LIST_H
410 #include "classes/list.h"
411 #endif
413 #ifndef _MUI_CLASSES_FLOATTEXT_H
414 #include "classes/floattext.h"
415 #endif
417 #ifndef _MUI_CLASSES_POPSTRING_H
418 #include "classes/popstring.h"
419 #endif
421 #ifndef _MUI_CLASSES_POPOBJECT_H
422 #include "classes/popobject.h"
423 #endif
425 #ifndef _MUI_CLASSES_CYCLE_H
426 #include "classes/cycle.h"
427 #endif
429 #ifndef _MUI_CLASSES_GAUGE_H
430 #include "classes/gauge.h"
431 #endif
433 #ifndef _MUI_CLASSES_IMAGE_H
434 #include "classes/image.h"
435 #endif
437 #ifndef _MUI_CLASSES_IMAGEDISPLAY_H
438 #include "classes/imagedisplay.h"
439 #endif
441 #ifndef _MUI_CLASSES_POPASL_H
442 #include "classes/popasl.h"
443 #endif
445 #ifndef _MUI_CLASSES_SETTINGSGROUP_H
446 #include "classes/settingsgroup.h"
447 #endif
449 #ifndef _MUI_CLASSES_SETTINGS_H
450 #include "classes/settings.h"
451 #endif
453 #ifndef _MUI_CLASSES_ABOUTMUI_H
454 #include "classes/aboutmui.h"
455 #endif
457 #ifndef _MUI_CLASSES_CONFIGDATA_H
458 #include "classes/configdata.h"
459 #endif
461 #ifndef _MUI_CLASSES_IMAGEADJUST_H
462 #include "classes/imageadjust.h"
463 #endif
465 #ifndef _MUI_CLASSES_POPIMAGE_H
466 #include "classes/popimage.h"
467 #endif
469 #ifndef _MUI_CLASSES_SCALE_H
470 #include "classes/scale.h"
471 #endif
473 #ifndef _MUI_CLASSES_RADIO_H
474 #include "classes/radio.h"
475 #endif
477 #ifndef _MUI_CLASSES_BALANCE_H
478 #include "classes/balance.h"
479 #endif
481 #ifndef _MUI_CLASSES_PENDISPLAY_H
482 #include "classes/pendisplay.h"
483 #endif
485 #ifndef _MUI_CLASSES_PENADJUST_H
486 #include "classes/penadjust.h"
487 #endif
489 #ifndef _MUI_CLASSES_POPPEN_H
490 #include "classes/poppen.h"
491 #endif
493 #ifndef _MUI_CLASSES_COLORFIELD_H
494 #include "classes/colorfield.h"
495 #endif
497 #ifndef _MUI_CLASSES_COLORADJUST_H
498 #include "classes/coloradjust.h"
499 #endif
501 #ifndef _MUI_CLASSES_MCCPREFS_H
502 #include "classes/mccprefs.h"
503 #endif
505 #ifndef _MUI_CLASSES_FRAMEADJUST_H
506 #include "classes/frameadjust.h"
507 #endif
509 #ifndef _MUI_CLASSES_FRAMEDISPLAY_H
510 #include "classes/framedisplay.h"
511 #endif
513 #ifndef _MUI_CLASSES_POPFRAME_H
514 #include "classes/popframe.h"
515 #endif
517 #ifndef _MUI_CLASSES_VOLUMELIST_H
518 #include "classes/volumelist.h"
519 #endif
521 #ifndef _MUI_CLASSES_DIRLIST_H
522 #include "classes/dirlist.h"
523 #endif
525 #ifndef _MUI_CLASSES_NUMERICBUTTON_H
526 #include "classes/numericbutton.h"
527 #endif
529 #ifndef _MUI_CLASSES_POPLIST_H
530 #include "classes/poplist.h"
531 #endif
533 #ifndef _MUI_CLASSES_POPSCREEN_H
534 #include "classes/popscreen.h"
535 #endif
537 #ifndef _MUI_CLASSES_CRAWLING_H
538 #include "classes/crawling.h"
539 #endif
541 #ifndef _MUI_CLASSES_LEVELMETER_H
542 #include "classes/levelmeter.h"
543 #endif
545 #ifndef _MUI_CLASSES_KNOB_H
546 #include "classes/knob.h"
547 #endif
549 #ifndef _MUI_CLASSES_DTPIC_H
550 #include "classes/dtpic.h"
551 #endif
553 #ifndef _MUI_CLASSES_PALETTE_H
554 #include "classes/palette.h"
555 #endif
557 #ifndef _MUI_CLASSES_TITLE_H
558 #include "classes/title.h"
559 #endif
561 #ifndef _MUI_CLASSES_PROCESS_H
562 #include "classes/process.h"
563 #endif
565 #ifndef _MUI_CLASSES_PIXMAP_H
566 #include "classes/pixmap.h"
567 #endif
569 /**************************************************************************
570 Zune/MUI Image and Background definition
571 **************************************************************************/
572 /* configured by the user within the prefs program */
573 #define MUII_WindowBack 0UL
574 #define MUII_RequesterBack 1UL
575 #define MUII_ButtonBack 2UL
576 #define MUII_ListBack 3UL
577 #define MUII_TextBack 4UL
578 #define MUII_PropBack 5UL
579 #define MUII_PopupBack 6UL
580 #define MUII_SelectedBack 7UL
581 #define MUII_ListCursor 8UL
582 #define MUII_ListSelect 9UL
583 #define MUII_ListSelCur 10UL
584 #define MUII_ArrowUp 11UL
585 #define MUII_ArrowDown 12UL
586 #define MUII_ArrowLeft 13UL
587 #define MUII_ArrowRight 14UL
588 #define MUII_CheckMark 15UL
589 #define MUII_RadioButton 16UL
590 #define MUII_Cycle 17UL
591 #define MUII_PopUp 18UL
592 #define MUII_PopFile 19UL
593 #define MUII_PopDrawer 20UL
594 #define MUII_PropKnob 21UL
595 #define MUII_Drawer 22UL
596 #define MUII_HardDisk 23UL
597 #define MUII_Disk 24UL
598 #define MUII_Chip 25UL
599 #define MUII_Volume 26UL
600 #define MUII_RegisterBack 27UL
601 #define MUII_Network 28UL
602 #define MUII_Assign 29UL
603 #define MUII_TapePlay 30UL
604 #define MUII_TapePlayBack 31UL
605 #define MUII_TapePause 32UL
606 #define MUII_TapeStop 33UL
607 #define MUII_TapeRecord 34UL
608 #define MUII_GroupBack 35UL
609 #define MUII_SliderBack 36UL
610 #define MUII_SliderKnob 37UL
611 #define MUII_TapeUp 38UL
612 #define MUII_TapeDown 39UL
613 #define MUII_PageBack 40UL
614 #define MUII_ReadListBack 41UL
615 #define MUII_Count 42UL
617 /* direct colors and combinations */
618 #define MUII_BACKGROUND 128UL
619 #define MUII_SHADOW 129UL
620 #define MUII_SHINE 130UL
621 #define MUII_FILL 131UL
622 #define MUII_SHADOWBACK 132UL
623 #define MUII_SHADOWFILL 133UL
624 #define MUII_SHADOWSHINE 134UL
625 #define MUII_FILLBACK 135UL
626 #define MUII_FILLSHINE 136UL
627 #define MUII_SHINEBACK 137UL
628 #define MUII_FILLBACK2 138UL
629 #define MUII_HSHINEBACK 139UL
630 #define MUII_HSHADOWBACK 140UL
631 #define MUII_HSHINESHINE 141UL
632 #define MUII_HSHADOWSHADOW 142UL
633 #define MUII_MARKSHINE 143UL
634 #define MUII_MARKHALFSHINE 144UL
635 #define MUII_MARKBACKGROUND 145UL
636 #define MUII_LASTPAT 146UL
639 /**************************************************************************
640 For ARexx
641 **************************************************************************/
642 struct MUI_Command
644 char *mc_Name;
645 char *mc_Template;
646 LONG mc_Parameters;
647 struct Hook *mc_Hook;
648 LONG mc_Reserved[5];
651 #define MC_TEMPLATE_ID ((STRPTR)~0)
653 #define MUI_RXERR_BADDEFINITION -1
654 #define MUI_RXERR_OUTOFMEMORY -2
655 #define MUI_RXERR_UNKNOWNCOMMAND -3
656 #define MUI_RXERR_BADSYNTAX -4
658 #ifndef _MUI_MACROS_H
659 #include "macros.h"
660 #endif
662 #endif /* LIBRARIES_MUI_H */