fall back to a repository that does provide the version of acpica we use. (NicJA)
[AROS.git] / rom / intuition / intuition_intern.h
blob108aefcc9ec5ef389b9ad3180e80856e8a244668
1 #ifndef INTUITION_INTERN_H
2 #define INTUITION_INTERN_H
4 /*
5 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
6 Copyright © 2001-2013, The MorphOS Development Team. All Rights Reserved.
7 $Id$
8 */
10 #ifndef AROS_LIBCALL_H
11 # include <aros/libcall.h>
12 #endif
13 #ifndef AROS_ATOMIC_H
14 # include <aros/atomic.h>
15 #endif
16 #ifndef EXEC_EXECBASE_H
17 # include <exec/execbase.h>
18 #endif
19 #ifndef EXEC_SEMAPHORES_H
20 # include <exec/semaphores.h>
21 #endif
22 #ifndef EXEC_TASKS_H
23 # include <exec/tasks.h>
24 #endif
25 #ifndef EXEC_PORTS_H
26 # include <exec/ports.h>
27 #endif
28 #ifndef EXEC_INTERRUPTS_H
29 # include <exec/interrupts.h>
30 #endif
31 #ifndef EXEC_IO_H
32 # include <exec/io.h>
33 #endif
34 #ifndef EXEC_TYPES_H
35 # include <exec/types.h>
36 #endif
37 #ifndef EXEC_LISTS_H
38 # include <exec/lists.h>
39 #endif
40 #ifndef GRAPHICS_GFXBASE_H
41 # include <graphics/gfxbase.h>
42 #endif
43 #ifndef GRAPHICS_RASTPORT_H
44 # include <graphics/rastport.h>
45 #endif
46 #ifndef GRAPHICS_REGIONS_H
47 # include <graphics/regions.h>
48 #endif
49 #ifndef GRAPHICS_CLIP_H
50 # include <graphics/clip.h>
51 #endif
52 #ifndef GRAPHICS_TEXT_H
53 # include <graphics/text.h>
54 #endif
55 #ifndef INTUITION_INTUITION_H
56 # include <intuition/intuition.h>
57 #endif
58 #ifndef INTUITION_INTUITIONBASE_H
59 # include <intuition/intuitionbase.h>
60 #endif
61 #ifndef INTUITION_CLASSES_H
62 # include <intuition/classes.h>
63 #endif
64 #ifndef INTUITION_CGHOOKS_H
65 # include <intuition/cghooks.h>
66 #endif
67 #ifndef INTUITION_SGHOOKS_H
68 # include <intuition/sghooks.h>
69 #endif
70 #ifndef INTUITION_SCREENS_H
71 # include <intuition/screens.h>
72 #endif
73 #ifndef PREFS_ICONTROL_H
74 # include <prefs/icontrol.h>
75 #endif
76 #ifndef PREFS_INPUT_H
77 #include <prefs/input.h>
78 #endif
79 #ifndef CLIB_ALIB_PROTOS_H
80 # include <clib/alib_protos.h>
81 #endif
82 #ifdef INTUITION_NOTIFY_SUPPORT
83 # include <libraries/screennotify.h>
84 # include <libraries/notifyintuition.h>
85 #endif
87 #include <oop/oop.h>
89 #include "intuition_debug.h"
90 #include "inputhandler_actions.h"
92 #ifdef SKINS
93 #include "intuition_customize.h"
94 #include "intuition_internmos.h"
95 #include "intuition_extend.h"
96 #endif
98 #include "requesters.h"
100 /* Needed for aros_print_not_implemented macro */
101 #include <aros/debug.h>
103 #include <aros/asmcall.h>
105 #if DEBUG_ASSERTS
106 #define ASSERT_VALID_PTR_ROMOK(ptr) \
107 do { \
108 if (TypeOfMem((APTR)ptr)) \
109 break; \
110 else { \
111 struct Task *me = FindTask(NULL); \
113 if (((IPTR)(ptr) >= (IPTR)me->tc_SPLower) && ((IPTR)(ptr) < (IPTR)me->tc_SPUpper)) \
114 break; \
116 bug("[intuition] Invalid pointer value %p at %s, line %u\n", ptr, __FILE__, __LINE__); \
117 } while(0);
118 #else
119 #define ASSERT_VALID_PTR_ROMOK(ptr)
120 #endif
122 // FIXME: seems only used for RefreshWindowTitles() ? -> better names
123 // FIXME: what are the correct values?
124 #define NO_DOUBLEBUFFER (0)
125 #define DOUBLEBUFFER (1)
127 /* features */
128 #ifdef __MORPHOS__
129 # define USE_OPAQUESIZE 1
130 #else
131 # define USE_OPAQUESIZE 0
132 #endif
134 /* This definition turns on compatibility mode where sprite colors
135 are allocated on hi- and truecolor screens also. This may be needed
136 if some software relies on this allocation. AROS itself currently does
137 not need this.
138 #define ALWAYS_ALLOCATE_SPRITE_COLORS */
140 #ifdef __MORPHOS__
141 void dprintf(char *, ...) __attribute__ ((format (printf, 1, 2)));
142 void * memclr(APTR, ULONG);
143 #endif
145 #ifdef __MORPHOS__
146 void * memclr(APTR, ULONG);
147 #define bzero(a,b) memclr(a,b)
148 #else /* __MORPHOS__ */
149 #define memclr(a,b) bzero(a,b)
150 #endif /* __MORPHOS__ */
153 * min()/max() without macro side effects.
155 #define max(a,b) \
156 ({typeof(a) _a = (a); \
157 typeof(b) _b = (b); \
158 _a > _b ? _a : _b;})
160 #define min(a,b) \
161 ({typeof(a) _a = (a); \
162 typeof(b) _b = (b); \
163 _a > _b ? _b : _a;})
165 #define EXTENDWORD(x) x = (LONG)((WORD)x);
166 #define EXTENDUWORD(x) x = (ULONG)((UWORD)x);
168 /* SANITY CHECK MACRO */
169 //#define DEBUG_SANITYCHECK
171 #ifdef DEBUG_SANITYCHECK
172 #define SANITY_CHECK(x) if (!((IPTR)x)) {dprintf("Losing sanity in %s line %d\n",__FILE__,__LINE__); return;};
173 #define SANITY_CHECKR(x,v) if (!((IPTR)x)) {dprintf("Losing sanity in %s line %d\n",__FILE__,__LINE__); return v;};
174 #else
175 #define SANITY_CHECK(x) if (!((IPTR)x)) return;
176 #define SANITY_CHECKR(x,v) if (!((IPTR)x)) return v;
177 #endif
179 /* Options */
181 #define MENUS_BACKFILL TRUE
183 #define MENUS_AMIGALOOK(base) ((GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_3DMENUS) == 0)
185 /* --- Values --- */
186 #define MENULOOK_3D 0
187 #define MENULOOK_CLASSIC 1
189 #define MENUS_UNDERMOUSE(base) (GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_POPUPMENUS)
190 #define MENUS_TITLEPULL(base) ((GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_PULLDOWNTITLEMENUS) != 0)
192 #define AVOID_WINBORDERERASE(base) \
193 (GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_AVOIDWINBORDERERASE)
195 /* --- Values --- */
196 /* TRUE, FALSE */
198 #define FRAME_SIZE(base) (GetPrivIBase(base)->FrameSize)
199 /* --- Values --- */
200 #define FRAMESIZE_THIN 0 /* 1:1 thin */
201 #define FRAMESIZE_MEDRES 1 /* 2:1 medres like AmigaOS */
202 #define FRAMESIZE_THICK 2 /* 1:1 thick */
204 #define SQUARE_WIN_GADGETS 1
205 #define WIN_GADGETS_KEEP_ASPECT /* Default non-decorated gadgets keep aspect if scaled */
207 #ifdef __AROS__
208 /* FIXME: possibly enable this, once gadtools has been updated */
209 #else
210 #define GADTOOLSCOMPATIBLE
211 //enables some gadtools-weirdo-code, MUST be set in both gadtools & intui to work!!!
212 #endif
214 #define ILOCKCHECK(a) ((a->task) && (a->task == IBase->IBaseLock->ss_Owner))
216 #ifdef SKINS
217 //#define USEGETIPREFS
218 #endif
220 /* simpleref layers have gadgets redrawn when app calls beginrefresh() */
221 //#define BEGINUPDATEGADGETREFRESH
222 //#define DAMAGECACHE
224 #define USEWINDOWLOCK
225 #ifdef USEWINDOWLOCK
226 # ifdef WINDOWLOCKDEBUG
227 # define LOCKWINDOW {ObtainSemaphore(&IBase->WindowLock);dprintf("%s/%ld: obtained windowlock\n",__FILE__,__LINE__);};
228 # define UNLOCKWINDOW {ReleaseSemaphore(&IBase->WindowLock);dprintf("%s/%ld: released windowlock\n",__FILE__,__LINE__);};
229 # define ATTEMPTWINDOWLOCK AttemptSemaphore(&IBase->WindowLock)
230 # else
231 # define LOCKWINDOW ObtainSemaphore(&IBase->WindowLock);
232 # define UNLOCKWINDOW ReleaseSemaphore(&IBase->WindowLock);
233 # define ATTEMPTWINDOWLOCK AttemptSemaphore(&IBase->WindowLock)
234 # endif
235 #else
236 #define LOCKWINDOW
237 #define UNLOCKWINDOW
238 #define ATTEMPTWINDOWLOCK
239 #endif
240 /* jDc: do NOT disable this! */
242 #define USEGADGETLOCK
243 #ifdef USEGADGETLOCK
244 #define LOCKGADGET(base) ObtainSemaphore(&GetPrivIBase(base)->GadgetLock);
245 #define UNLOCKGADGET(base) ReleaseSemaphore(&GetPrivIBase(base)->GadgetLock);
246 #define LOCKWINDOWLAYERS(w) ;
247 #define UNLOCKWINDOWLAYERS(w) ;
248 #else
249 #define LOCKGADGET
250 #define UNLOCKGADGET
251 #define LOCKWINDOWLAYERS(w) LockLayerInfo(&w->WScreen->LayerInfo); \
252 if (((struct IntWindow *)(w))->borderlayer) {LockLayer(0,((struct IntWindow *)(w))->borderlayer);}; \
253 if (((struct IntWindow *)(w))->wlayer) {LockLayer(0,((struct IntWindow *)(w))->wlayer);};
254 #define UNLOCKWINDOWLAYERS(w) if (((struct IntWindow *)(w))->wlayer) {UnlockLayer(((struct IntWindow *)(w))->wlayer);}; \
255 if (((struct IntWindow *)(w))->borderlayer) {UnlockLayer(((struct IntWindow *)(w))->borderlayer);} \
256 UnlockLayerInfo(&w->WScreen->LayerInfo);
257 #endif
259 #define WLAYER(w) (((struct IntWindow *)(w))->wlayer)
260 #define BLAYER(w) (((struct IntWindow *)(w))->borderlayer)
262 //#define TIMEVALWINDOWACTIVATION
264 /* If PROP_RENDER_OPTIMIZATION is set to 1, propgadget code tries to optimize rendering
265 during prop gadget knob movement. Only area of the propgadget that is affected by
266 prop gadget knob movement is re-rendered.
268 Unfortunately this can fail with some programs, like DOpus 4.x text viewer */
270 #define PROP_RENDER_OPTIMIZATION 0
272 #define SINGLE_SETPOINTERPOS_PER_EVENTLOOP 1
274 #ifndef LIFLG_SUPPORTS_OFFSCREEN_LAYERS
275 /* Defined in <graphics/layers.h>, but apparently not on MorphOS. */
276 # define LIFLG_SUPPORTS_OFFSCREEN_LAYERS 2
277 #endif
279 #define INTUITIONNAME "intuition.library"
280 #define MENUBARLABELCLASS "menubarlabelclass"
282 #define DEFPUBSCREEN TRUE
284 #define USE_NEWDISPLAYBEEP 1
286 #define TITLEBUFFERLEN 255
288 #define USE_IDCMPUPDATE_MESSAGECACHE 0
290 #ifdef __MORPHOS__
291 #if INCLUDE_VERSION < 50
293 /********************************************************************************/
294 /* imageclass.h AROS extensions */
296 #define SYSIA_WithBorder IA_FGPen /* default: TRUE */
297 #define SYSIA_Style IA_BGPen /* default: SYSISTYLE_NORMAL */
299 #define SYSISTYLE_NORMAL 0
300 #define SYSISTYLE_GADTOOLS 1 /* to get arrow images in gadtools look */
302 /********************************************************************************/
303 /* gadgetclass.h AROS extenstions */
305 /* This method is invoked to learn about the sizing requirements of your class,
306 before an object is created. This is AROS specific. */
307 #define GM_DOMAIN 7
308 struct gpDomain
310 STACKED ULONG MethodID; /* GM_DOMAIN */
311 STACKED struct GadgetInfo *gpd_GInfo; /* see <intuition/cghooks.h> */
312 STACKED struct RastPort *gpd_RPort; /* RastPort to calculate dimensions for. */
313 STACKED LONG gpd_Which; /* see below */
314 STACKED struct IBox gpd_Domain; /* Resulting domain. */
315 STACKED struct TagItem *gpd_Attrs; /* Additional attributes. None defined,
316 yet. */
319 /********************************************************************************/
321 /* gpd_Which */
322 #define GDOMAIN_MINIMUM 0 /* Calculate minimum size. */
323 #define GDOMAIN_NOMINAL 1 /* Calculate nominal size. */
324 #define GDOMAIN_MAXIMUM 2 /* Calculate maximum size. */
326 #endif /* INCLUDE_VERSION < 50 */
327 #endif /* ifdef __MORPHOS__ */
329 /********************************************************************************/
330 #define GM_MOVETEST 8
331 /* this method is used by our draggad to tell if it's OK to move the mouse when window
332 is near screen boundaries and offscreen is disabled. msg = gpInput*/
333 //retvals are:
334 #define MOVETEST_MOVE 0
335 #define MOVETEST_ADJUSTPOS 1
337 /* ObtainGIRPort must install a 0 clipregion and
338 set scrollx/scrolly of layer to 0. Since this
339 will be restored only when ReleaseGIRPort is
340 called, we must backup the orig values somewhere */
342 struct LayerContext
344 struct Region *clipregion;
345 WORD scroll_x;
346 WORD scroll_y;
347 WORD nestcount;
351 /* Preferences */
353 #define IP_OLDFONT 2
354 #define IP_OLDOVERSCAN 3
355 #define IP_OLDICONTROL 4
356 #define IP_OLDPOINTER 7
357 #define IP_OLDPALETTE 8
358 #define IP_OLDPENS 9
360 #define IP_SCREENMODE 1
361 #define IP_FONT 101//2
362 #define IP_ICONTROL 102//4
363 #define IP_POINTER 103//7
364 #define IP_PTRCOLOR 104//8
365 #define IP_PALETTE 105
366 #define IP_IACTIONS 20
367 #define IP_IEXTENSIONS 21
368 #define IP_INPUTEXT 22
370 #ifdef __MORPHOS__
372 struct IScreenModePrefs
374 ULONG smp_DisplayID;
375 UWORD smp_Width;
376 UWORD smp_Height;
377 UWORD smp_Depth;
378 UWORD smp_Control;
381 struct IIControlPrefs
383 UWORD ic_TimeOut;
384 WORD ic_MetaDrag;
385 ULONG ic_Flags;
386 UBYTE ic_WBtoFront;
387 UBYTE ic_FrontToBack;
388 UBYTE ic_ReqTrue;
389 UBYTE ic_ReqFalse;
392 #else
394 #include <intuition/iprefs.h>
396 #endif
398 struct Color32
400 ULONG red;
401 ULONG green;
402 ULONG blue;
405 #define COLORTABLEENTRIES 11
407 struct IntScreen;
409 #ifdef __mc68000
410 #define RESOURCELIST_HASHSIZE 32 /* Smaller hash for memory limited m68k */
411 #else
412 #define RESOURCELIST_HASHSIZE 256
413 #endif
415 #define RESOURCE_WINDOW 1
416 #define RESOURCE_SCREEN 2
418 struct HashNode
420 struct MinNode node;
421 UWORD type;
422 APTR resource;
425 /* Internal Screen Notification Data */
426 struct IntScreenNotify
428 struct Node node;
429 struct MsgPort *port;
430 struct Task *sigtask;
431 struct Hook *hook;
432 ULONG flags;
433 IPTR userdata;
434 char *pubname;
435 BYTE sigbit;
438 /* IntuitionBase */
439 struct IntIntuitionBase
441 struct IntuitionBase Base;
442 #ifdef __MORPHOS__
443 WORD _MinXMouse,_MaxXMouse; /* Old 1.3 Base entries*/
444 WORD _MinYMouse,_MaxYMouse; /* Old 1.3 Base entries*/
445 ULONG _StartSecs,_StartMicros; /* Old 1.3 Base entries*/
446 char *SystemRequestTitle; /* written by locale as it seems..what a crappy interface*/
447 char *WorkbenchTitle; /* written by locale as it seems..what a crappy interface*/
450 * safety pad for intuitionbase accesses
451 * probably needs to be smarter
453 UBYTE Pad[0x800];
454 #endif
456 /* Put local shit here, invisible for the user */
457 #ifdef __MORPHOS__
458 struct Library *MUIMasterBase;
459 #endif
461 struct DosLibrary *DOSBase;
462 struct LayersBase *LayersBase;
463 struct Library *UtilityBase;
464 struct GfxBase *GfxBase;
465 struct Library *OOPBase;
466 struct Library *KeymapBase;
468 struct Library *InputBase;
469 struct Library *TimerBase;
470 struct MsgPort *TimerMP;
471 struct timerequest *TimerIO;
473 struct MsgPort *WorkBenchMP;
474 struct Screen *WorkBench;
475 struct SignalSemaphore *IBaseLock;
476 struct SignalSemaphore ViewLordLock;
478 /* Intuition input handlers replyport. This one is set
479 int rom/inputhandler.c/InitIIH()
481 struct MsgPort *IntuiReplyPort;
482 struct MinList *IntuiActionQueue;
483 struct IOStdReq *InputIO;
484 struct MsgPort *InputMP;
486 /* Intuition Screennotify Replyport if SNOTIFY_WAIT_REPLY is specified */
488 struct MsgPort *ScreenNotifyReplyPort;
490 BOOL InputDeviceOpen;
491 struct Interrupt *InputHandler;
493 struct Hook *GlobalEditHook;
494 /* The default global edit hook */
495 struct Hook DefaultEditHook;
497 struct Screen *DefaultPubScreen;
498 struct SignalSemaphore PubScrListLock;
499 struct MinList PubScreenList;
500 UWORD pubScrGlobalMode;
502 struct SignalSemaphore ScreenNotificationListLock;
503 struct List ScreenNotificationList;
505 struct SignalSemaphore GadgetLock;
506 struct SignalSemaphore MenuLock;
507 struct SignalSemaphore WindowLock;
508 struct SignalSemaphore IntuiActionLock;
509 struct SignalSemaphore InputHandlerLock;
510 struct LayerContext BackupLayerContext;
512 struct IClass *dragbarclass;
513 struct IClass *sizebuttonclass;
514 struct IClass *windowsysiclass;
515 struct IClass *screenclass;
516 #ifdef __MORPHOS__
517 APTR *mosmenuclass;
518 #endif
519 struct Preferences DefaultPreferences;
520 struct Preferences ActivePreferences;
522 struct MsgPort *MenuHandlerPort;
523 BOOL MenusActive;
525 struct TextFont *ScreenFont;
526 struct TextFont *TopazFont;
528 /* Dos function DisplayError() before intuition.library patched it */
529 APTR OldDisplayErrorFunc;
531 struct SignalSemaphore ClassListLock;
532 struct MinList ClassList;
533 struct IClass RootClass;
535 #ifdef __MORPHOS__
536 struct ViewExtra *ViewLordExtra;
537 LONG SpriteNum;
538 #else
539 BOOL ViewLord_ok;
540 #endif
542 #ifdef SKINS
543 ULONG *SmallMenuPool;
544 #endif
545 ULONG *IDCMPPool;
547 struct IScreenModePrefs *ScreenModePrefs;
548 struct IIControlPrefs IControlPrefs;
549 #ifdef SKINS
550 struct IAction *IControlActions;
551 struct IControlExtensions IControlExtensions;
552 ULONG NumIControlActions;
553 struct InputPrefsExt InputPrefsExt;
554 #endif
555 struct IClass *pointerclass;
556 Object *DefaultPointer;
557 Object *BusyPointer;
558 UWORD DriPens2[NUMDRIPENS];
559 UWORD DriPens4[NUMDRIPENS];
560 UWORD DriPens8[NUMDRIPENS];
561 struct Color32 Colors[COLORTABLEENTRIES];
562 UWORD PointerAlpha;
563 ULONG DMStartSecs;
564 ULONG DMStartMicro;
565 struct IntScreen *MenuVerifyScreen;
566 ULONG PointerDelay;
568 #ifdef SKINS
569 struct SignalSemaphore DataTypesSem;
570 struct Library *DataTypesBase; /* should be opened ONLY by int_InitCustomChanges!*/
571 #endif
573 ULONG LastClickSecs;
574 ULONG LastClickMicro; /* for doubleclick to front */
575 ULONG LastMenuDownSecs;
576 ULONG LastMenuDownMicro; /* for auto sticky/non-sticky menus */
577 ULONG DoubleClickCounter;
578 ULONG DoubleClickButton;
580 #ifdef SKINS
581 struct Hook transphook; /* hook for windows with intui transp */
582 struct Hook notransphook; /* hook for windows with no additional transp (borderless,etc) */
583 #endif
584 #ifdef INTUITION_NOTIFY_SUPPORT
585 struct Library *ScreenNotifyBase;
586 struct Library *NotifyIntuitionBase;
587 #endif
589 struct RastPort DoGadgetMethodRP;
590 struct GadgetInfo DoGadgetMethodGI;
592 struct SignalSemaphore ScrDecorSem;
593 struct IClass *ScrDecorClass;
594 struct TagItem *ScrDecorTags;
595 struct SignalSemaphore MenuDecorSem;
596 struct IClass *MenuDecorClass;
597 struct TagItem *MenuDecorTags;
598 struct SignalSemaphore WinDecorSem;
599 struct IClass *WinDecorClass;
600 struct TagItem *WinDecorTags;
602 struct List Decorations;
603 struct NewDecorator *Decorator;
605 #ifdef USEGETIPREFS
606 BOOL IPrefsLoaded;
607 #endif
609 #if USE_NEWDISPLAYBEEP
610 LONG BeepingScreens;
611 #endif
613 WORD prop_clickoffset_x, prop_clickoffset_y;
615 struct MinList ResourceList[RESOURCELIST_HASHSIZE];
617 /* Menu Look Settings */
618 int FrameSize;
620 Object *ActiveMonitor;
621 Object *NewMonitor;
623 OOP_AttrBase HiddAttrBase;
624 OOP_AttrBase HiddGfxAttrBase;
625 OOP_AttrBase HiddBitMapAttrBase;
626 OOP_AttrBase HiddPixFmtAttrBase;
627 OOP_AttrBase HiddSyncAttrBase;
629 OOP_MethodID ib_HiddGfxBase;
630 OOP_MethodID ib_HiddBitMapBase;
632 struct IClass *monitorclass;
633 struct MinList MonitorList;
634 struct SignalSemaphore MonitorListSem;
636 struct Interrupt ShutdownHandler;
637 #if defined(__AROSEXEC_SMP__)
638 void * ExecLockBase;
639 #endif
642 struct SharedPointer
644 struct ExtSprite *sprite;
645 WORD xoffset, yoffset;
646 int ref_count;
649 struct SharedPointer *CreateSharedPointer(struct ExtSprite *, int, int, struct IntuitionBase *);
650 void ObtainSharedPointer(struct SharedPointer *, struct IntuitionBase *);
651 void ReleaseSharedPointer(struct SharedPointer *, struct IntuitionBase *);
653 #ifdef INTUITION_NOTIFY_SUPPORT
654 void sn_DoNotify(ULONG type, APTR value, struct Library *_ScreenNotifyBase);
655 #endif
658 * Private version of DrawInfo.
659 * We keep compatibility with original structure plus use some
660 * private extensions.
661 * The whole structure is rewritten in order to simplify MorphOS code merging.
663 struct IntuitionCustomize;
665 struct IntDrawInfo
667 UWORD dri_Version;
668 UWORD dri_NumPens;
669 UWORD *dri_Pens;
670 struct TextFont *dri_Font;
671 UWORD dri_Depth;
672 struct
674 UWORD X;
675 UWORD Y;
676 } dri_Resolution;
677 ULONG dri_Flags;
678 struct Image *dri_CheckMark;
679 struct Image *dri_AmigaKey;
680 /* The following two fields are compatible with AmigaOS v4 */
681 struct Screen *dri_Screen;
682 struct IntuitionCustomize *dri_Customize;
683 /* Private extensions begin */
684 ULONG *dri_Colors; /* MorphOS-compatible, unused (yet) */
685 IPTR dri_Reserved[2]; /* Remaining reserved fields */
688 /* Private dri_Flags */
689 #define DRIF_DIRECTCOLOR (1L << 16)
691 #define LOCK_WINDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
692 #define LOCKSHARED_WINDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
693 #define UNLOCK_WINDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
695 #define LOCK_SCRDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
696 #define LOCKSHARED_SCRDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
697 #define UNLOCK_SCRDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
699 #define LOCK_MENUDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
700 #define LOCKSHARED_MENUDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
701 #define UNLOCK_MENUDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
703 struct GammaControl
705 BOOL UseGammaControl;
706 BOOL Active;
707 UBYTE *GammaTableR;
708 UBYTE *GammaTableG;
709 UBYTE *GammaTableB;
712 struct IntScreen
714 struct Screen Screen;
716 /* Private fields */
717 struct HashNode hashnode;
718 struct IntDrawInfo DInfo;
719 ULONG realdepth;
720 struct TTextAttr textattr;
721 ULONG textattrtags[3];
722 UWORD Pens[NUMDRIPENS];
723 struct PubScreenNode *pubScrNode;
724 Object *depthgadget;
725 UWORD SpecialFlags;
726 struct Layer *rootLayer;
727 struct Hook *preAlphaCompHook;
728 #if !USE_NEWDISPLAYBEEP
729 ULONG DisplayBeepColor0[3];
730 struct Window *DisplayBeepWindow;
731 #endif
732 ULONG ModeID;
733 #ifdef __MORPHOS__
734 struct MonitorSpec *Monitor;
735 #endif
736 Object *IMonitorNode;
737 struct SharedPointer *Pointer;
738 BOOL ShowPointer;
739 BOOL SysFont;
740 struct Window *MenuVerifyActiveWindow;
741 int MenuVerifyTimeOut;
742 int MenuVerifyMsgCount;
743 ULONG MenuVerifySeconds;
744 ULONG MenuVerifyMicros;
745 ULONG DecorUserBufferSize;
746 IPTR DecorUserBuffer;
747 Object *ScrDecorObj;
748 Object *MenuDecorObj;
749 Object *WinDecorObj;
750 struct NewDecorator *Decorator;
752 struct BitMap *AllocatedBitMap;
753 struct DBufInfo *RestoreDBufInfo;
754 #ifdef SKINS
755 WORD LastClockPos;
756 WORD LastClockWidth;
758 struct SkinInfo SkinInfo;
759 struct RastPort *TitlebarBufferRP;
760 struct Window *TitlebarBufferWin;
761 ULONG TitlebarWinWidth;
762 ULONG TitlebarWinActive;
763 #endif
764 struct GammaControl GammaControl;
765 BOOL frontmost;
767 BOOL WindowLock;
768 #if USE_NEWDISPLAYBEEP
769 UBYTE BeepingCounter;
770 #endif
773 void UpdateScreenBitMap(struct Screen *s, struct IntuitionBase *IntuitionBase);
775 #define GetPrivScreen(s) ((struct IntScreen *)s)
776 #define IS(x) ((struct IntScreen *)x)
778 /* SpecialFlags */
779 #define SF_IsParent (0x0001)
780 #define SF_IsChild (0x0002)
781 #define SF_InvisibleBar (0x0004)
782 #define SF_AppearingBar (0x0008)
783 #define SF_Draggable (0x0020) /* Screen can be dragged */
784 #define SF_ComposeAbove (0x0100) /* Composition capabilities */
785 #define SF_ComposeBelow (0x0200)
786 #define SF_ComposeLeft (0x0400)
787 #define SF_ComposeRight (0x0800)
789 #define SF_VertCompose (SF_ComposeAbove|SF_ComposeBelow)
790 #define SF_HorCompose (SF_ComposeLeft |SF_ComposeRight)
791 #define SF_Compose (SF_ComposeAbove|SF_ComposeBelow|SF_ComposeLeft|SF_ComposeRight)
793 struct IntIntuiMessage
795 struct ExtIntuiMessage eimsg;
798 ** The following field is needed, because in case of IDCMP_RAWKEY
799 ** IntuiMessage->IAddress is a pointer to this data, not the data
800 ** itself (which is the case for IDCMP_VANILLAKEY)
803 APTR prevCodeQuals;
806 #define INT_INTUIMESSAGE(x) ((struct IntIntuiMessage *)(x))
810 /*extern struct IntuitionBase * IntuitionBase;*/
812 #define IW(window) ((struct IntWindow *) (window))
814 #define GetPubIBase(ib) ((struct IntuitionBase *)(ib))
815 #define GetPrivIBase(ib) ((struct IntIntuitionBase *)(ib))
816 #define IBase GetPrivIBase(IntuitionBase)
818 /* FIXME: Remove these #define xxxBase hacks
819 Do not use this in new code !
821 #ifdef __MORPHOS__
822 #ifdef MUIMasterBase
823 #undef MUIMasterBase
824 #define MUIMasterBase (GetPrivIBase(IntuitionBase)->MUIMasterBase)
825 #endif
826 #endif
828 /* struct Utilitybase is used in the following file so include it
829 before defining Utilitybase
831 #include <proto/utility.h>
833 /* stegerg: one can have sysgadgets outside of window border! All sysgadgets in window
834 border must have set GACT_???BORDER and, if they are in a gzz window, also
835 GTYP_GZZGADGET */
837 #define IS_GZZ_GADGET(gad) (((gad)->GadgetType) & GTYP_GZZGADGET)
839 #define IS_BORDER_GADGET(gad) (IS_GZZ_GADGET(gad) || \
840 ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER)))
842 #define IS_SYS_GADGET(gad) (((gad)->GadgetType) & GTYP_SYSTYPEMASK)
844 #define IS_BOOPSI_GADGET(gad) (((gad)->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET)
846 /*#define IS_BORDER_GADGET(gad) \
847 (((gad->GadgetType) & GTYP_SYSGADGET) \
848 || ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER))) */
850 #define IS_REQ_GADGET(gad) ((gad)->GadgetType & GTYP_REQGADGET)
852 #define IS_SCREEN_GADGET(gad) ((gad)->GadgetType & GTYP_SCRGADGET)
854 #define SET_GI_RPORT(gi, w, req, gad) \
855 (gi)->gi_RastPort = (IS_SCREEN_GADGET(gad) ? \
856 ((gi)->gi_Screen->BarLayer ? (gi)->gi_Screen->BarLayer->rp : NULL) : \
857 (IS_BORDER_GADGET(gad) ? (w)->BorderRPort : \
858 ((req) ? ((req)->ReqLayer->rp) : (w)->RPort)) \
862 #define REFRESHGAD_BOOPSI 1 /* boopsi gadgets */
863 #define REFRESHGAD_BORDER 2 /* gadgets in window border */
864 #define REFRESHGAD_REL 4 /* gadgets with GFLG_RELRIGHT, GFLG_RELBOTTOM,GFLG_RELWIDTH, GFLG_RELHEIGHT */
865 #define REFRESHGAD_RELS 8 /* GFLG_RELSPECIAL gadgets */
866 #define REFRESHGAD_TOPBORDER 16 /* used by setwindowtitle */
867 #define REFRESHGAD_NOGADTOOLS 32 /* used in some cases for _mustbe_ */
869 #define SYSGADGET_ACTIVE (iihdata->ActiveSysGadget != NULL)
871 VOID int_refreshglist(struct Gadget *gadgets, struct Window *window,
872 struct Requester *requester, LONG numGad, LONG mustbe, LONG mustnotbe,
873 struct IntuitionBase *IntuitionBase);
875 VOID int_RefreshWindowFrame(struct Window *window, LONG mustbe, LONG mustnotbe,
876 LONG mode,
877 struct IntuitionBase *IntuitionBase);
879 #define int_refreshwindowframe(a,b,c,d) int_RefreshWindowFrame(a,b,c,0,d);
881 struct RethinkDisplayActionMsg
883 struct IntuiActionMsg msg;
884 BOOL lock;
885 LONG failure;
888 void int_RethinkDisplay(struct RethinkDisplayActionMsg *msg,struct IntuitionBase *IntuitionBase);
890 /* Keep the system gadgets in the same order than the original intuition,
891 * some programs make bad asumptions about that...
893 enum
895 DEPTHGAD,
896 ZOOMGAD,
897 SIZEGAD,
898 CLOSEGAD,
899 ICONIFYGAD,
900 LOCKGAD,
901 MUIGAD,
902 POPUPGAD,
903 SNAPSHOTGAD,
904 JUMPGAD,
905 DRAGBAR,
906 NUM_SYSGADS
909 #define SYSGAD(w, idx) (((struct IntWindow *)(w))->sysgads[idx])
911 struct IntWindow
913 struct Window window;
915 Object *sysgads[NUM_SYSGADS];
916 struct Image *AmigaKey;
917 struct Image *Checkmark;
918 struct Image *SubMenuImage;
919 struct Window *menulendwindow;
921 struct HashNode hashnode;
923 /* When the Zoom gadget is pressed the window will have the
924 dimensions stored here. The old dimensions are backed up here
925 again. */
926 WORD ZipLeftEdge;
927 WORD ZipTopEdge;
928 WORD ZipWidth;
929 WORD ZipHeight;
931 /* max. number of mousemove events to send to this window */
932 WORD mousequeue;
934 /* act. number of mousemove events sent to this window */
935 WORD num_mouseevents;
937 /* max. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
938 messages to send to this window */
939 WORD repeatqueue;
941 /* act. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
942 messages sent to this window */
943 WORD num_repeatevents;
945 #if USE_IDCMPUPDATE_MESSAGECACHE
946 /* number of unreplied IDCMP_IDCMPUPDATE messages sent to window
947 used in few hacks :) */
948 WORD num_idcmpupdate;
949 #endif
951 WORD sizeimage_width;
952 WORD sizeimage_height;
954 ULONG helpflags;
955 ULONG helpgroup;
957 Object *pointer;
958 BOOL busy;
959 BOOL free_pointer;
960 UWORD pointer_delay;
961 ULONG extrabuttons;
962 ULONG extrabuttonsid; /* replaces ETI_Dummy if apps wishes it */
963 #ifdef SKINS
964 ULONG titlepos; /* used by titlebar pattern fill stuff */
965 #else
966 ULONG reserved1;
967 #endif
968 ULONG specialflags;
970 #ifdef SKINS
971 struct Region *transpregion;
972 struct Hook *usertransphook;
973 struct Region *usertranspregion;
974 #endif
976 #ifdef DAMAGECACHE
977 struct Region *trashregion;
978 #endif
979 char titlebuffer[TITLEBUFFERLEN+1];
981 #if USE_IDCMPUPDATE_MESSAGECACHE
982 struct IntuiMessage *messagecache; //for idcmpupdate cache
983 #endif
985 struct Layer *wlayer;
986 struct Layer *borderlayer;
988 struct timeval lastmsgsent;
989 struct timeval lastmsgreplied;
991 #ifdef TIMEVALWINDOWACTIVATION
992 struct timeval activationtime;
993 #endif
995 #ifdef SKINS
996 struct Hook custombackfill;
997 struct HookData hd;
998 #endif
999 struct Hook DefaultWindowShapeHook;
1000 BOOL CustomShape;
1001 struct Region *OutlineShape;
1002 ULONG DecorUserBufferSize;
1003 IPTR DecorUserBuffer;
1006 #define SPFLAG_ICONIFIED 1
1007 #define SPFLAG_NOICONIFY 2
1008 #define SPFLAG_SKININFO 4
1009 #define SPFLAG_LAYERREFRESH 8
1010 #define SPFLAG_TRANSPHOOK 16
1011 #define SPFLAG_LAYERRESIZED 32
1012 #define SPFLAG_USERPORT 64
1013 #define SPFLAG_IAMDEAD 128
1014 #define SPFLAG_CLOSING 256 //used with iamdead
1015 #define SPFLAG_WANTBUFFER 512
1017 #define HELPF_ISHELPGROUP 1
1018 #define HELPF_GADGETHELP 2
1020 #define IS_NOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? TRUE : FALSE)
1021 #define IS_DOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? FALSE : TRUE )
1022 #define IS_SIMPLEREFRESH(win) (((win)->Flags & WFLG_SIMPLE_REFRESH) ? TRUE : FALSE)
1023 #define IS_GZZWINDOW(win) (((win)->Flags & WFLG_GIMMEZEROZERO) ? TRUE : FALSE)
1026 /* Flag definitions for MoreFlags */
1028 #define WMFLG_NOTIFYDEPTH (1 << 0) /* Window wants notification when
1029 it's depth arranged */
1031 #define WMFLG_DO_UNLOCKPUBSCREEN (1 << 1)
1032 #define WMFLG_MENUHELP (1 << 2)
1033 #define WMFLG_POINTERDELAY (1 << 3)
1034 #define WMFLG_TABLETMESSAGES (1 << 4)
1036 // FIXME: ehm... this one should die a horrible death!
1037 #define WMFLG_IAMMUI (1 << 5)
1039 struct IntScreenBuffer
1041 struct ScreenBuffer sb;
1042 BOOL free_bitmap;
1046 /* Driver prototypes */
1048 extern int intui_init (struct IntuitionBase *);
1049 extern int intui_open (struct IntuitionBase *);
1050 extern void intui_close (struct IntuitionBase *);
1051 extern void intui_expunge (struct IntuitionBase *);
1052 extern int intui_GetWindowSize (void);
1053 extern void intui_WindowLimits (struct Window * window, WORD MinWidth, WORD MinHeight, UWORD MaxWidth, UWORD MaxHeight);
1054 extern void intui_ActivateWindow (struct Window *);
1055 extern BOOL intui_ChangeWindowBox (struct Window * window, WORD x, WORD y,
1056 WORD width, WORD height);
1057 extern void intui_CloseWindow (struct Window *, struct IntuitionBase *);
1058 extern void intui_MoveWindow (struct Window * window, WORD dx, WORD dy);
1059 extern int intui_OpenWindow (struct Window *, struct IntuitionBase *,
1060 struct BitMap * SuperBitMap, struct Hook *backfillhook,
1061 struct Region * shape, struct Hook * shapehook,
1062 struct Layer * parent, ULONG visible);
1063 extern void intui_SetWindowTitles (struct Window *, CONST_STRPTR, CONST_STRPTR);
1064 extern void intui_RefreshWindowFrame(struct Window *win);
1065 extern struct Window *intui_FindActiveWindow(struct InputEvent *ie, struct IntuitionBase *IntuitionBase);
1066 extern void intui_ScrollWindowRaster(struct Window * win, WORD dx, WORD dy, WORD xmin,
1067 WORD ymin, WORD xmax, WORD ymax,
1068 struct IntuitionBase * IntuitionBase);
1070 /* wbtasktalk protos */
1072 ULONG TellWBTaskToCloseWindows(struct IntuitionBase *IntuitionBase);
1073 ULONG TellWBTaskToOpenWindows(struct IntuitionBase *IntuitionBase);
1075 /* intuition_misc protos */
1076 extern void SetDisplayDefaults(struct IntuitionBase * IntuitionBase);
1077 extern void LoadDefaultPreferences(struct IntuitionBase * IntuitionBase);
1078 Object* CreateStdSysImage(WORD which, WORD preferred_height, struct Screen *scr,
1079 struct DrawInfo *dri, struct IntuitionBase *IntuitionBase);
1080 extern void CheckRectFill(struct RastPort *rp, WORD x1, WORD y1, WORD x2, WORD y2, struct IntuitionBase * IntuitionBase);
1081 extern BOOL CreateWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1082 extern VOID KillWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1083 extern void CreateScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1084 extern void KillScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1085 extern void RenderScreenBar(struct Screen *scr, BOOL refresh, struct IntuitionBase *IntuitionBase);
1086 extern void UpdateMouseCoords(struct Window *win);
1087 extern WORD SubtractRectFromRect(struct Rectangle *a, struct Rectangle *b, struct Rectangle *destrectarray);
1089 AROS_UFP3(BOOL, DefaultWindowShapeFunc,
1090 AROS_UFPA(struct Hook *, hook, A0),
1091 AROS_UFPA(struct Layer *, lay, A2),
1092 AROS_UFPA(struct ShapeHookMsg *, msg, A1));
1094 extern LONG CalcResourceHash(APTR resource);
1095 extern void AddResourceToList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1096 extern void RemoveResourceFromList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1097 extern BOOL ResourceExisting(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1098 void FireScreenNotifyMessage(IPTR data, ULONG flag, struct IntuitionBase *IntuitionBase);
1099 void FireScreenNotifyMessageCode(IPTR data, ULONG flag, ULONG code, struct IntuitionBase *IntuitionBase);
1101 /* misc.c */
1102 extern void MySetPointerPos(struct IntuitionBase *IntuitionBase);
1103 extern BOOL ResetPointer(struct IntuitionBase *IntuitionBase);
1104 extern void ActivateMonitor(Object *newmonitor, WORD x, WORD y, struct IntuitionBase *IntuitionBase);
1105 extern struct Screen *FindFirstScreen(Object *monitor, struct IntuitionBase *IntuitionBase);
1106 extern struct RastPort *MyCreateRastPort(struct IntuitionBase *IntuitionBase);
1107 extern struct RastPort *MyCloneRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1108 extern void MyFreeRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1109 struct TextFont *SafeReopenFont(struct IntuitionBase *, struct TextFont **);
1110 extern Object *MakePointerFromPrefs(struct IntuitionBase *, struct Preferences *);
1111 extern Object *MakePointerFromData(struct IntuitionBase *, const UWORD *, int, int, int, int);
1112 void InstallPointer(struct IntuitionBase *, UWORD, Object **, Object *);
1113 void SetPointerColors(struct IntuitionBase *IntuitionBase);
1114 struct IClass *InitITextIClass (struct IntuitionBase * IntuitionBase);
1115 struct Gadget *DoActivateGadget(struct Window *win, struct Requester *req, struct Gadget *gad,
1116 struct IntuitionBase *IntuitionBase);
1117 VOID DoGMLayout(struct Gadget *glist, struct Window *win, struct Requester *req,
1118 UWORD numgad, BOOL initial, struct IntuitionBase *IntuitionBase);
1119 BOOL ih_fire_intuimessage(struct Window * w, ULONG Class, UWORD Code, APTR IAddress,
1120 struct IntuitionBase *IntuitionBase);
1121 void NotifyDepthArrangement(struct Window *w, struct IntuitionBase *IntuitionBase);
1123 /* printitext.c */
1125 void int_PrintIText(struct RastPort * rp, struct IntuiText * iText,
1126 LONG leftOffset, LONG topOffset, BOOL ignore_attributes,
1127 struct IntuitionBase *IntuitionBase);
1129 /* Private extra functions */
1130 void *FindMonitorNode(ULONG modeid, struct IntuitionBase *IntuitionBase);
1131 void *FindBestMonitorNode(void *family, const char *name, ULONG modeid, struct IntuitionBase *IntuitionBase);
1132 void *FindBest3dMonitor(void *family, struct IntuitionBase *IntuitionBase);
1133 ULONG FindBestModeID(const char *name, ULONG depth, ULONG width, ULONG height, struct IntuitionBase *IntuitionBase);
1135 AROS_INTP(ShutdownScreenHandler);
1137 #ifdef __MORPHOS__
1138 BOOL IsLayerHiddenBySibling(struct Layer *layer, BOOL xx);
1139 LONG IsLayerVisible(struct Layer *layer);
1140 #endif
1142 void SetupGInfo(struct GadgetInfo *gi, struct Window *win, struct Requester *req,
1143 struct Gadget *gad, struct IntuitionBase *IntuitionBase);
1145 IPTR Custom_DoMethodA(struct IntuitionBase *, struct Gadget *, Msg);
1147 #ifdef __MORPHOS__
1148 #ifdef DoMethodA
1149 #undef DoMethodA
1150 #endif
1151 #define DoMethodA(x, ...) (REG_A6=(LONG)IntuitionBase, DoMethodA(x, __VA_ARGS__))
1152 #endif
1154 #define HAS_CHILDREN(w) (NULL != w->firstchild)
1156 #ifdef __MORPHOS__
1157 #define DeinitRastPort(rp) ((void)0)
1158 #endif
1159 #define CreateRastPort() MyCreateRastPort(IntuitionBase)
1160 #define CloneRastPort(rp) MyCloneRastPort(IntuitionBase, rp)
1161 #define FreeRastPort(rp) MyFreeRastPort(IntuitionBase, rp)
1163 /* Replacement for dos.library/DisplayError() */
1164 AROS_UFP3(LONG, Intuition_DisplayError,
1165 AROS_UFPA(STRPTR, formatStr , A0),
1166 AROS_UFPA(ULONG , IDCMPFlags, D0),
1167 AROS_UFPA(APTR , args , A1));
1169 #define POINTERA_SharedPointer 0x80039010
1171 #ifndef __MORPHOS__
1172 #define dprintf kprintf
1173 #endif
1175 #define DEBUG_ACTIVATEGADGET(x) ;
1176 #define DEBUG_ACTIVATEWINDOW(x) ;
1177 #define DEBUG_ADDCLASS(x) ;
1178 #define DEBUG_ADDGADGET(x) ;
1179 #define DEBUG_ADDGLIST(x) ;
1180 #define DEBUG_ALLOCINTUIMESSAGE(x) ;
1181 #define DEBUG_ALLOCSCREENBUFFER(x) ;
1182 #define DEBUG_ALOHAWORKBENCH(x) ;
1183 #define DEBUG_CHANGEWINDOWBOX(x) ;
1184 #define DEBUG_CLOSESCREEN(x) ;
1185 #define DEBUG_CLOSEWINDOW(x) ;
1186 #define DEBUG_CLOSEWORKBENCH(x) ;
1187 #define DEBUG_DISPOSEOBJECT(x) ;
1188 #define DEBUG_DOGADGETMETHOD(x) ;
1189 #define DEBUG_DRAWBORDER(x) ;
1190 #define DEBUG_FINDCLASS(x) ;
1191 #define DEBUG_FREEICDATA(x) ;
1192 #define DEBUG_FREEINTUIMESSAGE(x) ;
1193 #define DEBUG_FREESCREENBUFFER(x) ;
1194 #define DEBUG_FREESCREENDRAWINFO(x) ;
1195 #define DEBUG_GADGETMOUSE(x) ;
1196 #define DEBUG_GETATTR(x) ;
1197 #define DEBUG_GETDEFAULTPUBSCREEN(x) ;
1198 #define DEBUG_GETDEFPREFS(x) ;
1199 #define DEBUG_GETGADGETIBOX(x) ;
1200 #define DEBUG_GETPREFS(x) ;
1201 #define DEBUG_GETSCREENDATA(x) ;
1202 #define DEBUG_GETSCREENDRAWINFO(x) ;
1203 #define DEBUG_HIDEWINDOW(x) ;
1204 #define DEBUG_OPEN(x) ;
1205 #define DEBUG_CLOSE(x) ;
1206 #define DEBUG_INPUTEVENT(x) ;
1207 #define DEBUG_INTREFRESHGLIST(x) ;
1208 #define DEBUG_INTUITEXTLENGTH(x) ;
1209 #define DEBUG_LENDMENUS(x) ;
1210 #define DEBUG_LOCKPUBSCREEN(x) ;
1211 #define DEBUG_MAKECLASS(x) ;
1212 #define DEBUG_MODIFYIDCMP(x) ;
1213 #define DEBUG_NEWOBJECT(x) ;
1214 #define DEBUG_NEXTOBJECT(x) ;
1215 #define DEBUG_OBTAINGIRPORT(x) ;
1216 #define DEBUG_OFFGADGET(x) ;
1217 #define DEBUG_OFFMENU(x) ;
1218 #define DEBUG_ONGADGET(x) ;
1219 #define DEBUG_ONMENU(x) ;
1220 #define DEBUG_OPENSCREEN(x) ;
1221 #define DEBUG_OPENSCREENTAGLIST(x) ;
1222 #define DEBUG_OPENWINDOW(x) ;
1223 #define DEBUG_OPENWINDOWTAGLIST(x) ;
1224 #define DEBUG_OPENWORKBENCH(x) ;
1225 #define DEBUG_POINTER(x) ;
1226 #define DEBUG_PRINTITEXT(x) ;
1227 #define DEBUG_QUERYOVERSCAN(x) ;
1228 #define DEBUG_REFRESH(x) ;
1229 #define DEBUG_RELEASEGIRPORT(x) ;
1230 #define DEBUG_REMEMBER(x) ;
1231 #define DEBUG_REMOVEGLIST(x) ;
1232 #define DEBUG_REPORTMOUSE(x) ;
1233 #define DEBUG_REQUEST(x) ;
1234 #define DEBUG_SCROLLWINDOWRASTER(x) ;
1235 #define DEBUG_SENDINTUIMESSAGE(x) ;
1236 #define DEBUG_SETATTRS(x) ;
1237 #define DEBUG_SETGADGETATTRS(x) ;
1238 #define DEBUG_SETPOINTER(x) ;
1239 #define DEBUG_SHOWWINDOW(x) ;
1240 #define DEBUG_UNLOCKPUBSCREEN(x) ;
1241 #define DEBUG_WINDOWLIMITS(x) ;
1242 #define DEBUG_WINDOWTOBACK(x) ;
1243 #define DEBUG_WINDOWTOFRONT(x) ;
1244 #define DEBUG_ZIPWINDOW(x) ;
1245 #define DEBUG_VISITOR(x) ;
1246 #define DEBUG_WORKBENCH(x) ;
1247 #define DEBUG_LOCKPUBSCREENLIST(x) ;
1248 #define DEBUG_UNLOCKPUBSCREENLIST(x) ;
1249 #define DEBUG_RETHINKDISPLAY(x) ;
1251 #ifdef NO_RUNTIME_DEBUG
1253 #define DEBUG_INIT(x) ;
1254 #define DEBUG_SETIPREFS(x) ;
1255 #define DEBUG_SETPREFS(x) ;
1257 #else
1259 #define DEBUG_INIT(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1260 #define DEBUG_SETIPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1261 #define DEBUG_SETPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1263 #endif
1266 * Private data structures of the classes defined by intuition.library
1269 /* ICClass */
1270 struct ICData
1272 Object *ic_Target;
1273 struct TagItem *ic_Mapping;
1274 struct TagItem *ic_CloneTags;
1275 ULONG ic_LoopCounter;
1278 /* ModelClass */
1279 struct ModelData
1281 struct MinList memberlist;
1284 /* FrameIClass */
1285 struct FrameIData
1287 /* render bevel only with no fill? */
1288 BOOL fid_EdgesOnly;
1290 /* inverted bevel pens? */
1291 BOOL fid_Recessed;
1293 /* frame style? */
1294 WORD fid_FrameType;
1296 WORD fid_HOffset;
1297 WORD fid_VOffset;
1300 /* SysIClass */
1301 struct SysIData
1303 struct DrawInfo *dri;
1304 struct Image *frame;
1305 ULONG type;
1306 UWORD flags;
1309 /* FillRectClass */
1310 struct FillRectData
1312 WORD apatsize;
1313 WORD mode;
1316 /* GadgetClass */
1317 struct GadgetData
1319 struct ExtGadget EG;
1320 struct ICData IC;
1323 /* PropGClass */
1324 struct PropGData
1326 /* We use a propinfo structure, because we use the same routines
1327 for intuition propgadtets and in propgclass */
1329 struct PropInfo propinfo;
1331 /* A little kludge: since the HandleMouseMove function
1332 wants dx/dy and not absolute mouse coords, we
1333 have to remember the last ones */
1335 UWORD last_x;
1336 UWORD last_y;
1338 /* One only have to store total or visble, and use some other
1339 formulas than those in the RKRM:L, but for
1340 code simplicity I store them all. */
1341 UWORD top, visible, total;
1343 UWORD flags;
1344 struct BBox *old_knobbox;
1345 struct Hook *DisplayHook;
1348 /* StrGClass */
1349 struct StrGData
1351 struct StringInfo StrInfo;
1352 struct StringExtend StrExtend;
1353 UBYTE Flags;
1356 /* GroupGClass */
1357 struct GroupGData
1359 struct MinList memberlist;
1360 struct Gadget *activegad;
1363 /* DragBarClass */
1364 struct dragbar_data
1366 /* Current left- and topedge of moving window. Ie when the user releases
1367 the LMB after a windowdrag, the window's new coords will be (curleft, curtop)
1370 LONG curleft;
1371 LONG curtop;
1373 /* The current x and y coordinates relative to curleft/curtop */
1374 LONG mousex;
1375 LONG mousey;
1377 /* Whether the dragframe is currently drawn or erased */
1378 BOOL isrendered;
1380 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1381 BOOL drag_canceled;
1383 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1384 BOOL drag_layerlock;
1385 #ifdef USEGADGETLOCK
1386 BOOL drag_gadgetlock;
1387 BOOL drag_inputhandlerlock;
1388 #endif
1389 BOOL drag_refreshed;
1391 /* Rastport to use during update */
1392 struct RastPort *rp;
1394 UQUAD lasteventtime;
1396 LONG startleft;
1397 LONG starttop;
1399 #ifdef USEWINDOWLOCK
1400 /* used to prevent windows from opening/closing while user drags a window */
1401 BOOL drag_windowlock;
1402 #endif
1404 struct Task *movetask;
1408 /* SizeButtonClass */
1409 struct sizebutton_data
1412 /* The current width and height of the rubber band frame */
1413 ULONG width;
1414 ULONG height;
1415 ULONG top;
1416 ULONG left;
1418 /* holds original sizes */
1419 ULONG Width;
1420 ULONG Height;
1421 ULONG TopEdge;
1422 ULONG LeftEdge;
1424 /* the offset of the mouse pointer to the rubber band frame*/
1425 LONG mouseoffsetx;
1426 LONG mouseoffsety;
1428 /* Whether the dragframe is currently drawn or erased */
1429 BOOL isrendered;
1431 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1432 BOOL drag_canceled;
1434 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1435 BOOL drag_layerlock;
1436 #ifdef USEGADGETLOCK
1437 BOOL drag_gadgetlock;
1438 BOOL drag_inputhandlerlock;
1439 #endif
1441 BOOL drag_refreshed;
1443 /* Rastport to use during update */
1444 struct RastPort *rp;
1446 UQUAD lasteventtime;
1448 #ifdef USEWINDOWLOCK
1449 /* used to prevent windows from opening/closing while user drags a window */
1450 BOOL drag_windowlock;
1451 #endif
1453 #ifdef SKINS
1454 ULONG drag_type;
1455 #endif
1457 ULONG drag_ticks;
1461 /* MenuBarLabelClass */
1462 struct MenuBarLabelData
1464 struct DrawInfo *dri;
1467 /* PointerClass */
1468 struct PointerData
1470 struct SharedPointer *shared_pointer;
1473 /* WinDecorClass */
1474 struct windecor_data
1476 ULONG userbuffersize;
1479 /* ScrDecorClass */
1480 struct scrdecor_data
1482 ULONG userbuffersize;
1485 /* MenuDecorClass */
1486 struct menudecor_data
1488 ULONG userbuffersize;
1491 #endif /* INTUITION_INTERN_H */