use consistent hidd naming
[AROS.git] / rom / intuition / intuition_intern.h
blob73c2cde7bbc37450e052b6f6110ec5750bf655a8
1 #ifndef INTUITION_INTERN_H
2 #define INTUITION_INTERN_H
4 /*
5 Copyright © 1995-2013, 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)
184 /* --- Values --- */
185 #define MENULOOK_3D 0
186 #define MENULOOK_CLASSIC 1
188 #define MENUS_UNDERMOUSE(base) (GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_POPUPMENUS)
190 #define AVOID_WINBORDERERASE(base) \
191 (GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_AVOIDWINBORDERERASE)
193 /* --- Values --- */
194 /* TRUE, FALSE */
196 #define FRAME_SIZE(base) (GetPrivIBase(base)->FrameSize)
197 /* --- Values --- */
198 #define FRAMESIZE_THIN 0 /* 1:1 thin */
199 #define FRAMESIZE_MEDRES 1 /* 2:1 medres like AmigaOS */
200 #define FRAMESIZE_THICK 2 /* 1:1 thick */
202 #define SQUARE_WIN_GADGETS 1
203 #define WIN_GADGETS_KEEP_ASPECT /* Default non-decorated gadgets keep aspect if scaled */
205 #ifdef __AROS__
206 /* FIXME: possibly enable this, once gadtools has been updated */
207 #else
208 #define GADTOOLSCOMPATIBLE
209 //enables some gadtools-weirdo-code, MUST be set in both gadtools & intui to work!!!
210 #endif
212 #define ILOCKCHECK(a) ((a->task) && (a->task == IBase->IBaseLock->ss_Owner))
214 #ifdef SKINS
215 //#define USEGETIPREFS
216 #endif
218 /* simpleref layers have gadgets redrawn when app calls beginrefresh() */
219 //#define BEGINUPDATEGADGETREFRESH
220 //#define DAMAGECACHE
222 #define USEWINDOWLOCK
223 #ifdef USEWINDOWLOCK
224 # ifdef WINDOWLOCKDEBUG
225 # define LOCKWINDOW {ObtainSemaphore(&IBase->WindowLock);dprintf("%s/%ld: obtained windowlock\n",__FILE__,__LINE__);};
226 # define UNLOCKWINDOW {ReleaseSemaphore(&IBase->WindowLock);dprintf("%s/%ld: released windowlock\n",__FILE__,__LINE__);};
227 # define ATTEMPTWINDOWLOCK AttemptSemaphore(&IBase->WindowLock)
228 # else
229 # define LOCKWINDOW ObtainSemaphore(&IBase->WindowLock);
230 # define UNLOCKWINDOW ReleaseSemaphore(&IBase->WindowLock);
231 # define ATTEMPTWINDOWLOCK AttemptSemaphore(&IBase->WindowLock)
232 # endif
233 #else
234 #define LOCKWINDOW
235 #define UNLOCKWINDOW
236 #define ATTEMPTWINDOWLOCK
237 #endif
238 /* jDc: do NOT disable this! */
240 #define USEGADGETLOCK
241 #ifdef USEGADGETLOCK
242 #define LOCKGADGET(base) ObtainSemaphore(&GetPrivIBase(base)->GadgetLock);
243 #define UNLOCKGADGET(base) ReleaseSemaphore(&GetPrivIBase(base)->GadgetLock);
244 #define LOCKWINDOWLAYERS(w) ;
245 #define UNLOCKWINDOWLAYERS(w) ;
246 #else
247 #define LOCKGADGET
248 #define UNLOCKGADGET
249 #define LOCKWINDOWLAYERS(w) LockLayerInfo(&w->WScreen->LayerInfo); \
250 if (((struct IntWindow *)(w))->borderlayer) {LockLayer(0,((struct IntWindow *)(w))->borderlayer);}; \
251 if (((struct IntWindow *)(w))->wlayer) {LockLayer(0,((struct IntWindow *)(w))->wlayer);};
252 #define UNLOCKWINDOWLAYERS(w) if (((struct IntWindow *)(w))->wlayer) {UnlockLayer(((struct IntWindow *)(w))->wlayer);}; \
253 if (((struct IntWindow *)(w))->borderlayer) {UnlockLayer(((struct IntWindow *)(w))->borderlayer);} \
254 UnlockLayerInfo(&w->WScreen->LayerInfo);
255 #endif
257 #define WLAYER(w) (((struct IntWindow *)(w))->wlayer)
258 #define BLAYER(w) (((struct IntWindow *)(w))->borderlayer)
260 //#define TIMEVALWINDOWACTIVATION
262 /* If PROP_RENDER_OPTIMIZATION is set to 1, propgadget code tries to optimize rendering
263 during prop gadget knob movement. Only area of the propgadget that is affected by
264 prop gadget knob movement is re-rendered.
266 Unfortunately this can fail with some programs, like DOpus 4.x text viewer */
268 #define PROP_RENDER_OPTIMIZATION 0
270 #define SINGLE_SETPOINTERPOS_PER_EVENTLOOP 1
272 #ifndef LIFLG_SUPPORTS_OFFSCREEN_LAYERS
273 /* Defined in <graphics/layers.h>, but apparently not on MorphOS. */
274 # define LIFLG_SUPPORTS_OFFSCREEN_LAYERS 2
275 #endif
277 #define INTUITIONNAME "intuition.library"
278 #define MENUBARLABELCLASS "menubarlabelclass"
280 #define DEFPUBSCREEN TRUE
282 #define USE_NEWDISPLAYBEEP 1
284 #define TITLEBUFFERLEN 255
286 #define USE_IDCMPUPDATE_MESSAGECACHE 0
288 #ifdef __MORPHOS__
289 #if INCLUDE_VERSION < 50
291 /********************************************************************************/
292 /* imageclass.h AROS extensions */
294 #define SYSIA_WithBorder IA_FGPen /* default: TRUE */
295 #define SYSIA_Style IA_BGPen /* default: SYSISTYLE_NORMAL */
297 #define SYSISTYLE_NORMAL 0
298 #define SYSISTYLE_GADTOOLS 1 /* to get arrow images in gadtools look */
300 /********************************************************************************/
301 /* gadgetclass.h AROS extenstions */
303 /* This method is invoked to learn about the sizing requirements of your class,
304 before an object is created. This is AROS specific. */
305 #define GM_DOMAIN 7
306 struct gpDomain
308 STACKED ULONG MethodID; /* GM_DOMAIN */
309 STACKED struct GadgetInfo *gpd_GInfo; /* see <intuition/cghooks.h> */
310 STACKED struct RastPort *gpd_RPort; /* RastPort to calculate dimensions for. */
311 STACKED LONG gpd_Which; /* see below */
312 STACKED struct IBox gpd_Domain; /* Resulting domain. */
313 STACKED struct TagItem *gpd_Attrs; /* Additional attributes. None defined,
314 yet. */
317 /********************************************************************************/
319 /* gpd_Which */
320 #define GDOMAIN_MINIMUM 0 /* Calculate minimum size. */
321 #define GDOMAIN_NOMINAL 1 /* Calculate nominal size. */
322 #define GDOMAIN_MAXIMUM 2 /* Calculate maximum size. */
324 #endif /* INCLUDE_VERSION < 50 */
325 #endif /* ifdef __MORPHOS__ */
327 /********************************************************************************/
328 #define GM_MOVETEST 8
329 /* this method is used by our draggad to tell if it's OK to move the mouse when window
330 is near screen boundaries and offscreen is disabled. msg = gpInput*/
331 //retvals are:
332 #define MOVETEST_MOVE 0
333 #define MOVETEST_ADJUSTPOS 1
335 /* ObtainGIRPort must install a 0 clipregion and
336 set scrollx/scrolly of layer to 0. Since this
337 will be restored only when ReleaseGIRPort is
338 called, we must backup the orig values somewhere */
340 struct LayerContext
342 struct Region *clipregion;
343 WORD scroll_x;
344 WORD scroll_y;
345 WORD nestcount;
349 /* Preferences */
351 #define IP_OLDFONT 2
352 #define IP_OLDOVERSCAN 3
353 #define IP_OLDICONTROL 4
354 #define IP_OLDPOINTER 7
355 #define IP_OLDPALETTE 8
356 #define IP_OLDPENS 9
358 #define IP_SCREENMODE 1
359 #define IP_FONT 101//2
360 #define IP_ICONTROL 102//4
361 #define IP_POINTER 103//7
362 #define IP_PTRCOLOR 104//8
363 #define IP_PALETTE 105
364 #define IP_IACTIONS 20
365 #define IP_IEXTENSIONS 21
366 #define IP_INPUTEXT 22
368 #ifdef __MORPHOS__
370 struct IScreenModePrefs
372 ULONG smp_DisplayID;
373 UWORD smp_Width;
374 UWORD smp_Height;
375 UWORD smp_Depth;
376 UWORD smp_Control;
379 struct IIControlPrefs
381 UWORD ic_TimeOut;
382 WORD ic_MetaDrag;
383 ULONG ic_Flags;
384 UBYTE ic_WBtoFront;
385 UBYTE ic_FrontToBack;
386 UBYTE ic_ReqTrue;
387 UBYTE ic_ReqFalse;
390 #else
392 #include <intuition/iprefs.h>
394 #endif
396 struct Color32
398 ULONG red;
399 ULONG green;
400 ULONG blue;
403 #define COLORTABLEENTRIES 11
405 struct IntScreen;
407 #ifdef __mc68000
408 #define RESOURCELIST_HASHSIZE 32 /* Smaller hash for memory limited m68k */
409 #else
410 #define RESOURCELIST_HASHSIZE 256
411 #endif
413 #define RESOURCE_WINDOW 1
414 #define RESOURCE_SCREEN 2
416 struct HashNode
418 struct MinNode node;
419 UWORD type;
420 APTR resource;
423 /* Internal Screen Notification Data */
424 struct IntScreenNotify
426 struct Node node;
427 struct MsgPort *port;
428 struct Task *sigtask;
429 struct Hook *hook;
430 ULONG flags;
431 IPTR userdata;
432 char *pubname;
433 BYTE sigbit;
436 /* IntuitionBase */
437 struct IntIntuitionBase
439 struct IntuitionBase Base;
440 #ifdef __MORPHOS__
441 WORD _MinXMouse,_MaxXMouse; /* Old 1.3 Base entries*/
442 WORD _MinYMouse,_MaxYMouse; /* Old 1.3 Base entries*/
443 ULONG _StartSecs,_StartMicros; /* Old 1.3 Base entries*/
444 char *SystemRequestTitle; /* written by locale as it seems..what a crappy interface*/
445 char *WorkbenchTitle; /* written by locale as it seems..what a crappy interface*/
448 * safety pad for intuitionbase accesses
449 * probably needs to be smarter
451 UBYTE Pad[0x800];
452 #endif
454 /* Put local shit here, invisible for the user */
455 #ifdef __MORPHOS__
456 struct Library *MUIMasterBase;
457 #endif
459 struct DosLibrary *DOSBase;
460 struct LayersBase *LayersBase;
461 struct Library *UtilityBase;
462 struct GfxBase *GfxBase;
463 struct Library *OOPBase;
464 struct Library *KeymapBase;
466 struct Library *InputBase;
467 struct Library *TimerBase;
468 struct MsgPort *TimerMP;
469 struct timerequest *TimerIO;
471 struct MsgPort *WorkBenchMP;
472 struct Screen *WorkBench;
473 struct SignalSemaphore *IBaseLock;
474 struct SignalSemaphore ViewLordLock;
476 /* Intuition input handlers replyport. This one is set
477 int rom/inputhandler.c/InitIIH()
479 struct MsgPort *IntuiReplyPort;
480 struct MinList *IntuiActionQueue;
481 struct IOStdReq *InputIO;
482 struct MsgPort *InputMP;
484 /* Intuition Screennotify Replyport if SNOTIFY_WAIT_REPLY is specified */
486 struct MsgPort *ScreenNotifyReplyPort;
488 BOOL InputDeviceOpen;
489 struct Interrupt *InputHandler;
491 struct Hook *GlobalEditHook;
492 /* The default global edit hook */
493 struct Hook DefaultEditHook;
495 struct Screen *DefaultPubScreen;
496 struct SignalSemaphore PubScrListLock;
497 struct MinList PubScreenList;
498 UWORD pubScrGlobalMode;
500 struct SignalSemaphore ScreenNotificationListLock;
501 struct List ScreenNotificationList;
503 struct SignalSemaphore GadgetLock;
504 struct SignalSemaphore MenuLock;
505 struct SignalSemaphore WindowLock;
506 struct SignalSemaphore IntuiActionLock;
507 struct SignalSemaphore InputHandlerLock;
508 struct LayerContext BackupLayerContext;
510 struct IClass *dragbarclass;
511 struct IClass *sizebuttonclass;
512 struct IClass *windowsysiclass;
513 struct IClass *screenclass;
514 #ifdef __MORPHOS__
515 APTR *mosmenuclass;
516 #endif
517 struct Preferences DefaultPreferences;
518 struct Preferences ActivePreferences;
520 struct MsgPort *MenuHandlerPort;
521 BOOL MenusActive;
523 struct TextFont *ScreenFont;
524 struct TextFont *TopazFont;
526 /* Dos function DisplayError() before intuition.library patched it */
527 APTR OldDisplayErrorFunc;
529 struct SignalSemaphore ClassListLock;
530 struct MinList ClassList;
531 struct IClass RootClass;
533 #ifdef __MORPHOS__
534 struct ViewExtra *ViewLordExtra;
535 LONG SpriteNum;
536 #else
537 BOOL ViewLord_ok;
538 #endif
540 #ifdef SKINS
541 ULONG *SmallMenuPool;
542 #endif
543 ULONG *IDCMPPool;
545 struct IScreenModePrefs ScreenModePrefs;
546 struct IIControlPrefs IControlPrefs;
547 #ifdef SKINS
548 struct IAction *IControlActions;
549 struct IControlExtensions IControlExtensions;
550 ULONG NumIControlActions;
551 struct InputPrefsExt InputPrefsExt;
552 #endif
553 struct IClass *pointerclass;
554 Object *DefaultPointer;
555 Object *BusyPointer;
556 UWORD DriPens2[NUMDRIPENS];
557 UWORD DriPens4[NUMDRIPENS];
558 UWORD DriPens8[NUMDRIPENS];
559 struct Color32 Colors[COLORTABLEENTRIES];
560 UWORD PointerAlpha;
561 ULONG DMStartSecs;
562 ULONG DMStartMicro;
563 struct IntScreen *MenuVerifyScreen;
564 ULONG PointerDelay;
566 #ifdef SKINS
567 struct SignalSemaphore DataTypesSem;
568 struct Library *DataTypesBase; /* should be opened ONLY by int_InitCustomChanges!*/
569 #endif
571 ULONG LastClickSecs;
572 ULONG LastClickMicro; /* for doubleclick to front */
573 ULONG LastMenuDownSecs;
574 ULONG LastMenuDownMicro; /* for auto sticky/non-sticky menus */
575 ULONG DoubleClickCounter;
576 ULONG DoubleClickButton;
578 #ifdef SKINS
579 struct Hook transphook; /* hook for windows with intui transp */
580 struct Hook notransphook; /* hook for windows with no additional transp (borderless,etc) */
581 #endif
582 #ifdef INTUITION_NOTIFY_SUPPORT
583 struct Library *ScreenNotifyBase;
584 struct Library *NotifyIntuitionBase;
585 #endif
587 struct RastPort DoGadgetMethodRP;
588 struct GadgetInfo DoGadgetMethodGI;
590 struct SignalSemaphore ScrDecorSem;
591 struct IClass *ScrDecorClass;
592 struct TagItem *ScrDecorTags;
593 struct SignalSemaphore MenuDecorSem;
594 struct IClass *MenuDecorClass;
595 struct TagItem *MenuDecorTags;
596 struct SignalSemaphore WinDecorSem;
597 struct IClass *WinDecorClass;
598 struct TagItem *WinDecorTags;
600 struct List Decorations;
601 struct NewDecorator *Decorator;
603 #ifdef USEGETIPREFS
604 BOOL IPrefsLoaded;
605 #endif
607 #if USE_NEWDISPLAYBEEP
608 LONG BeepingScreens;
609 #endif
611 WORD prop_clickoffset_x, prop_clickoffset_y;
613 struct MinList ResourceList[RESOURCELIST_HASHSIZE];
615 /* Menu Look Settings */
616 int FrameSize;
618 Object *ActiveMonitor;
619 Object *NewMonitor;
621 OOP_AttrBase HiddAttrBase;
622 OOP_AttrBase HiddGfxAttrBase;
623 OOP_AttrBase HiddBitMapAttrBase;
624 OOP_AttrBase HiddPixFmtAttrBase;
626 OOP_MethodID ib_HiddGfxBase;
627 OOP_MethodID ib_HiddBitMapBase;
629 struct IClass *monitorclass;
630 struct MinList MonitorList;
631 struct SignalSemaphore MonitorListSem;
633 struct Interrupt ShutdownHandler;
636 struct SharedPointer
638 struct ExtSprite *sprite;
639 WORD xoffset, yoffset;
640 int ref_count;
643 struct SharedPointer *CreateSharedPointer(struct ExtSprite *, int, int, struct IntuitionBase *);
644 void ObtainSharedPointer(struct SharedPointer *, struct IntuitionBase *);
645 void ReleaseSharedPointer(struct SharedPointer *, struct IntuitionBase *);
647 #ifdef INTUITION_NOTIFY_SUPPORT
648 void sn_DoNotify(ULONG type, APTR value, struct Library *_ScreenNotifyBase);
649 #endif
652 * Private version of DrawInfo.
653 * We keep compatibility with original structure plus use some
654 * private extensions.
655 * The whole structure is rewritten in order to simplify MorphOS code merging.
657 struct IntuitionCustomize;
659 struct IntDrawInfo
661 UWORD dri_Version;
662 UWORD dri_NumPens;
663 UWORD *dri_Pens;
664 struct TextFont *dri_Font;
665 UWORD dri_Depth;
666 struct
668 UWORD X;
669 UWORD Y;
670 } dri_Resolution;
671 ULONG dri_Flags;
672 struct Image *dri_CheckMark;
673 struct Image *dri_AmigaKey;
674 /* The following two fields are compatible with AmigaOS v4 */
675 struct Screen *dri_Screen;
676 struct IntuitionCustomize *dri_Customize;
677 /* Private extensions begin */
678 ULONG *dri_Colors; /* MorphOS-compatible, unused (yet) */
679 IPTR dri_Reserved[2]; /* Remaining reserved fields */
682 /* Private dri_Flags */
683 #define DRIF_DIRECTCOLOR (1L << 16)
685 #define LOCK_WINDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
686 #define LOCKSHARED_WINDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
687 #define UNLOCK_WINDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
689 #define LOCK_SCRDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
690 #define LOCKSHARED_SCRDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
691 #define UNLOCK_SCRDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
693 #define LOCK_MENUDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
694 #define LOCKSHARED_MENUDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
695 #define UNLOCK_MENUDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
697 struct GammaControl
699 BOOL UseGammaControl;
700 BOOL Active;
701 UBYTE *GammaTableR;
702 UBYTE *GammaTableG;
703 UBYTE *GammaTableB;
706 struct IntScreen
708 struct Screen Screen;
710 /* Private fields */
711 struct HashNode hashnode;
712 struct IntDrawInfo DInfo;
713 ULONG realdepth;
714 struct TTextAttr textattr;
715 ULONG textattrtags[3];
716 UWORD Pens[NUMDRIPENS];
717 struct PubScreenNode *pubScrNode;
718 Object *depthgadget;
719 UWORD SpecialFlags;
720 struct Layer *rootLayer;
721 struct Hook *preAlphaCompHook;
722 #if !USE_NEWDISPLAYBEEP
723 ULONG DisplayBeepColor0[3];
724 struct Window *DisplayBeepWindow;
725 #endif
726 ULONG ModeID;
727 #ifdef __MORPHOS__
728 struct MonitorSpec *Monitor;
729 #endif
730 Object *IMonitorNode;
731 struct SharedPointer *Pointer;
732 BOOL ShowPointer;
733 BOOL SysFont;
734 struct Window *MenuVerifyActiveWindow;
735 int MenuVerifyTimeOut;
736 int MenuVerifyMsgCount;
737 ULONG MenuVerifySeconds;
738 ULONG MenuVerifyMicros;
739 ULONG DecorUserBufferSize;
740 IPTR DecorUserBuffer;
741 Object *ScrDecorObj;
742 Object *MenuDecorObj;
743 Object *WinDecorObj;
744 struct NewDecorator *Decorator;
746 struct BitMap *AllocatedBitMap;
747 struct DBufInfo *RestoreDBufInfo;
748 #ifdef SKINS
749 WORD LastClockPos;
750 WORD LastClockWidth;
752 struct SkinInfo SkinInfo;
753 struct RastPort *TitlebarBufferRP;
754 struct Window *TitlebarBufferWin;
755 ULONG TitlebarWinWidth;
756 ULONG TitlebarWinActive;
757 #endif
758 struct GammaControl GammaControl;
759 BOOL frontmost;
761 BOOL WindowLock;
762 #if USE_NEWDISPLAYBEEP
763 UBYTE BeepingCounter;
764 #endif
767 void UpdateScreenBitMap(struct Screen *s, struct IntuitionBase *IntuitionBase);
769 #define GetPrivScreen(s) ((struct IntScreen *)s)
770 #define IS(x) ((struct IntScreen *)x)
772 /* SpecialFlags */
773 #define SF_IsParent (0x0001)
774 #define SF_IsChild (0x0002)
775 #define SF_InvisibleBar (0x0004)
776 #define SF_AppearingBar (0x0008)
777 #define SF_Draggable (0x0020) /* Screen can be dragged */
778 #define SF_ComposeAbove (0x0100) /* Composition capabilities */
779 #define SF_ComposeBelow (0x0200)
780 #define SF_ComposeLeft (0x0400)
781 #define SF_ComposeRight (0x0800)
783 #define SF_VertCompose (SF_ComposeAbove|SF_ComposeBelow)
784 #define SF_HorCompose (SF_ComposeLeft |SF_ComposeRight)
785 #define SF_Compose (SF_ComposeAbove|SF_ComposeBelow|SF_ComposeLeft|SF_ComposeRight)
787 struct IntIntuiMessage
789 struct ExtIntuiMessage eimsg;
792 ** The following field is needed, because in case of IDCMP_RAWKEY
793 ** IntuiMessage->IAddress is a pointer to this data, not the data
794 ** itself (which is the case for IDCMP_VANILLAKEY)
797 APTR prevCodeQuals;
800 #define INT_INTUIMESSAGE(x) ((struct IntIntuiMessage *)(x))
804 /*extern struct IntuitionBase * IntuitionBase;*/
806 #define IW(window) ((struct IntWindow *) (window))
808 #define GetPubIBase(ib) ((struct IntuitionBase *)ib)
809 #define GetPrivIBase(ib) ((struct IntIntuitionBase *)ib)
810 #define IBase GetPrivIBase(IntuitionBase)
812 /* FIXME: Remove these #define xxxBase hacks
813 Do not use this in new code !
815 #ifdef __MORPHOS__
816 #ifdef MUIMasterBase
817 #undef MUIMasterBase
818 #define MUIMasterBase (GetPrivIBase(IntuitionBase)->MUIMasterBase)
819 #endif
820 #endif
822 /* struct Utilitybase is used in the following file so include it
823 before defining Utilitybase
825 #include <proto/utility.h>
827 /* stegerg: one can have sysgadgets outside of window border! All sysgadgets in window
828 border must have set GACT_???BORDER and, if they are in a gzz window, also
829 GTYP_GZZGADGET */
831 #define IS_GZZ_GADGET(gad) (((gad)->GadgetType) & GTYP_GZZGADGET)
833 #define IS_BORDER_GADGET(gad) (IS_GZZ_GADGET(gad) || \
834 ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER)))
836 #define IS_SYS_GADGET(gad) (((gad)->GadgetType) & GTYP_SYSTYPEMASK)
838 #define IS_BOOPSI_GADGET(gad) (((gad)->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET)
840 /*#define IS_BORDER_GADGET(gad) \
841 (((gad->GadgetType) & GTYP_SYSGADGET) \
842 || ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER))) */
844 #define IS_REQ_GADGET(gad) ((gad)->GadgetType & GTYP_REQGADGET)
846 #define IS_SCREEN_GADGET(gad) ((gad)->GadgetType & GTYP_SCRGADGET)
848 #define SET_GI_RPORT(gi, w, req, gad) \
849 (gi)->gi_RastPort = (IS_SCREEN_GADGET(gad) ? \
850 ((gi)->gi_Screen->BarLayer ? (gi)->gi_Screen->BarLayer->rp : NULL) : \
851 (IS_BORDER_GADGET(gad) ? (w)->BorderRPort : \
852 ((req) ? ((req)->ReqLayer->rp) : (w)->RPort)) \
856 #define REFRESHGAD_BOOPSI 1 /* boopsi gadgets */
857 #define REFRESHGAD_BORDER 2 /* gadgets in window border */
858 #define REFRESHGAD_REL 4 /* gadgets with GFLG_RELRIGHT, GFLG_RELBOTTOM,GFLG_RELWIDTH, GFLG_RELHEIGHT */
859 #define REFRESHGAD_RELS 8 /* GFLG_RELSPECIAL gadgets */
860 #define REFRESHGAD_TOPBORDER 16 /* used by setwindowtitle */
861 #define REFRESHGAD_NOGADTOOLS 32 /* used in some cases for _mustbe_ */
863 #define SYSGADGET_ACTIVE (iihdata->ActiveSysGadget != NULL)
865 VOID int_refreshglist(struct Gadget *gadgets, struct Window *window,
866 struct Requester *requester, LONG numGad, LONG mustbe, LONG mustnotbe,
867 struct IntuitionBase *IntuitionBase);
869 VOID int_RefreshWindowFrame(struct Window *window, LONG mustbe, LONG mustnotbe,
870 LONG mode,
871 struct IntuitionBase *IntuitionBase);
873 #define int_refreshwindowframe(a,b,c,d) int_RefreshWindowFrame(a,b,c,0,d);
875 struct RethinkDisplayActionMsg
877 struct IntuiActionMsg msg;
878 BOOL lock;
879 LONG failure;
882 void int_RethinkDisplay(struct RethinkDisplayActionMsg *msg,struct IntuitionBase *IntuitionBase);
884 /* Keep the system gadgets in the same order than the original intuition,
885 * some programs make bad asumptions about that...
887 enum
889 DEPTHGAD,
890 ZOOMGAD,
891 SIZEGAD,
892 CLOSEGAD,
893 ICONIFYGAD,
894 LOCKGAD,
895 MUIGAD,
896 POPUPGAD,
897 SNAPSHOTGAD,
898 JUMPGAD,
899 DRAGBAR,
900 NUM_SYSGADS
903 #define SYSGAD(w, idx) (((struct IntWindow *)(w))->sysgads[idx])
905 struct IntWindow
907 struct Window window;
909 Object *sysgads[NUM_SYSGADS];
910 struct Image *AmigaKey;
911 struct Image *Checkmark;
912 struct Image *SubMenuImage;
913 struct Window *menulendwindow;
915 struct HashNode hashnode;
917 /* When the Zoom gadget is pressed the window will have the
918 dimensions stored here. The old dimensions are backed up here
919 again. */
920 WORD ZipLeftEdge;
921 WORD ZipTopEdge;
922 WORD ZipWidth;
923 WORD ZipHeight;
925 /* max. number of mousemove events to send to this window */
926 WORD mousequeue;
928 /* act. number of mousemove events sent to this window */
929 WORD num_mouseevents;
931 /* max. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
932 messages to send to this window */
933 WORD repeatqueue;
935 /* act. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
936 messages sent to this window */
937 WORD num_repeatevents;
939 #if USE_IDCMPUPDATE_MESSAGECACHE
940 /* number of unreplied IDCMP_IDCMPUPDATE messages sent to window
941 used in few hacks :) */
942 WORD num_idcmpupdate;
943 #endif
945 WORD sizeimage_width;
946 WORD sizeimage_height;
948 ULONG helpflags;
949 ULONG helpgroup;
951 Object *pointer;
952 BOOL busy;
953 BOOL free_pointer;
954 UWORD pointer_delay;
955 ULONG extrabuttons;
956 ULONG extrabuttonsid; /* replaces ETI_Dummy if apps wishes it */
957 #ifdef SKINS
958 ULONG titlepos; /* used by titlebar pattern fill stuff */
959 #else
960 ULONG reserved1;
961 #endif
962 ULONG specialflags;
964 #ifdef SKINS
965 struct Region *transpregion;
966 struct Hook *usertransphook;
967 struct Region *usertranspregion;
968 #endif
970 #ifdef DAMAGECACHE
971 struct Region *trashregion;
972 #endif
973 char titlebuffer[TITLEBUFFERLEN+1];
975 #if USE_IDCMPUPDATE_MESSAGECACHE
976 struct IntuiMessage *messagecache; //for idcmpupdate cache
977 #endif
979 struct Layer *wlayer;
980 struct Layer *borderlayer;
982 struct timeval lastmsgsent;
983 struct timeval lastmsgreplied;
985 #ifdef TIMEVALWINDOWACTIVATION
986 struct timeval activationtime;
987 #endif
989 #ifdef SKINS
990 struct Hook custombackfill;
991 struct HookData hd;
992 #endif
993 struct Hook DefaultWindowShapeHook;
994 BOOL CustomShape;
995 struct Region *OutlineShape;
996 ULONG DecorUserBufferSize;
997 IPTR DecorUserBuffer;
1000 #define SPFLAG_ICONIFIED 1
1001 #define SPFLAG_NOICONIFY 2
1002 #define SPFLAG_SKININFO 4
1003 #define SPFLAG_LAYERREFRESH 8
1004 #define SPFLAG_TRANSPHOOK 16
1005 #define SPFLAG_LAYERRESIZED 32
1006 #define SPFLAG_USERPORT 64
1007 #define SPFLAG_IAMDEAD 128
1008 #define SPFLAG_CLOSING 256 //used with iamdead
1009 #define SPFLAG_WANTBUFFER 512
1011 #define HELPF_ISHELPGROUP 1
1012 #define HELPF_GADGETHELP 2
1014 #define IS_NOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? TRUE : FALSE)
1015 #define IS_DOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? FALSE : TRUE )
1016 #define IS_SIMPLEREFRESH(win) (((win)->Flags & WFLG_SIMPLE_REFRESH) ? TRUE : FALSE)
1017 #define IS_GZZWINDOW(win) (((win)->Flags & WFLG_GIMMEZEROZERO) ? TRUE : FALSE)
1020 /* Flag definitions for MoreFlags */
1022 #define WMFLG_NOTIFYDEPTH (1 << 0) /* Window wants notification when
1023 it's depth arranged */
1025 #define WMFLG_DO_UNLOCKPUBSCREEN (1 << 1)
1026 #define WMFLG_MENUHELP (1 << 2)
1027 #define WMFLG_POINTERDELAY (1 << 3)
1028 #define WMFLG_TABLETMESSAGES (1 << 4)
1030 // FIXME: ehm... this one should die a horrible death!
1031 #define WMFLG_IAMMUI (1 << 5)
1033 struct IntScreenBuffer
1035 struct ScreenBuffer sb;
1036 BOOL free_bitmap;
1040 /* Driver prototypes */
1042 extern int intui_init (struct IntuitionBase *);
1043 extern int intui_open (struct IntuitionBase *);
1044 extern void intui_close (struct IntuitionBase *);
1045 extern void intui_expunge (struct IntuitionBase *);
1046 extern int intui_GetWindowSize (void);
1047 extern void intui_WindowLimits (struct Window * window, WORD MinWidth, WORD MinHeight, UWORD MaxWidth, UWORD MaxHeight);
1048 extern void intui_ActivateWindow (struct Window *);
1049 extern BOOL intui_ChangeWindowBox (struct Window * window, WORD x, WORD y,
1050 WORD width, WORD height);
1051 extern void intui_CloseWindow (struct Window *, struct IntuitionBase *);
1052 extern void intui_MoveWindow (struct Window * window, WORD dx, WORD dy);
1053 extern int intui_OpenWindow (struct Window *, struct IntuitionBase *,
1054 struct BitMap * SuperBitMap, struct Hook *backfillhook,
1055 struct Region * shape, struct Hook * shapehook,
1056 struct Layer * parent, ULONG visible);
1057 extern void intui_SetWindowTitles (struct Window *, CONST_STRPTR, CONST_STRPTR);
1058 extern void intui_RefreshWindowFrame(struct Window *win);
1059 extern struct Window *intui_FindActiveWindow(struct InputEvent *ie, struct IntuitionBase *IntuitionBase);
1060 extern void intui_ScrollWindowRaster(struct Window * win, WORD dx, WORD dy, WORD xmin,
1061 WORD ymin, WORD xmax, WORD ymax,
1062 struct IntuitionBase * IntuitionBase);
1064 /* wbtasktalk protos */
1066 ULONG TellWBTaskToCloseWindows(struct IntuitionBase *IntuitionBase);
1067 ULONG TellWBTaskToOpenWindows(struct IntuitionBase *IntuitionBase);
1069 /* intuition_misc protos */
1070 extern void LoadDefaultPreferences(struct IntuitionBase * IntuitionBase);
1071 Object* CreateStdSysImage(WORD which, WORD preferred_height, struct Screen *scr,
1072 struct DrawInfo *dri, struct IntuitionBase *IntuitionBase);
1073 extern void CheckRectFill(struct RastPort *rp, WORD x1, WORD y1, WORD x2, WORD y2, struct IntuitionBase * IntuitionBase);
1074 extern BOOL CreateWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1075 extern VOID KillWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1076 extern void CreateScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1077 extern void KillScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1078 extern void RenderScreenBar(struct Screen *scr, BOOL refresh, struct IntuitionBase *IntuitionBase);
1079 extern void UpdateMouseCoords(struct Window *win);
1080 extern WORD SubtractRectFromRect(struct Rectangle *a, struct Rectangle *b, struct Rectangle *destrectarray);
1082 AROS_UFP3(BOOL, DefaultWindowShapeFunc,
1083 AROS_UFPA(struct Hook *, hook, A0),
1084 AROS_UFPA(struct Layer *, lay, A2),
1085 AROS_UFPA(struct ShapeHookMsg *, msg, A1));
1087 extern LONG CalcResourceHash(APTR resource);
1088 extern void AddResourceToList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1089 extern void RemoveResourceFromList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1090 extern BOOL ResourceExisting(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1091 void FireScreenNotifyMessage(IPTR data, ULONG flag, struct IntuitionBase *IntuitionBase);
1092 void FireScreenNotifyMessageCode(IPTR data, ULONG flag, ULONG code, struct IntuitionBase *IntuitionBase);
1094 /* misc.c */
1095 extern void MySetPointerPos(struct IntuitionBase *IntuitionBase);
1096 extern BOOL ResetPointer(struct IntuitionBase *IntuitionBase);
1097 extern void ActivateMonitor(Object *newmonitor, WORD x, WORD y, struct IntuitionBase *IntuitionBase);
1098 extern struct Screen *FindFirstScreen(Object *monitor, struct IntuitionBase *IntuitionBase);
1099 extern struct RastPort *MyCreateRastPort(struct IntuitionBase *IntuitionBase);
1100 extern struct RastPort *MyCloneRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1101 extern void MyFreeRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1102 struct TextFont *SafeReopenFont(struct IntuitionBase *, struct TextFont **);
1103 extern Object *MakePointerFromPrefs(struct IntuitionBase *, struct Preferences *);
1104 extern Object *MakePointerFromData(struct IntuitionBase *, const UWORD *, int, int, int, int);
1105 void InstallPointer(struct IntuitionBase *, UWORD, Object **, Object *);
1106 void SetPointerColors(struct IntuitionBase *IntuitionBase);
1107 struct IClass *InitITextIClass (struct IntuitionBase * IntuitionBase);
1108 struct Gadget *DoActivateGadget(struct Window *win, struct Requester *req, struct Gadget *gad,
1109 struct IntuitionBase *IntuitionBase);
1110 VOID DoGMLayout(struct Gadget *glist, struct Window *win, struct Requester *req,
1111 UWORD numgad, BOOL initial, struct IntuitionBase *IntuitionBase);
1112 BOOL ih_fire_intuimessage(struct Window * w, ULONG Class, UWORD Code, APTR IAddress,
1113 struct IntuitionBase *IntuitionBase);
1114 void NotifyDepthArrangement(struct Window *w, struct IntuitionBase *IntuitionBase);
1116 /* printitext.c */
1118 void int_PrintIText(struct RastPort * rp, struct IntuiText * iText,
1119 LONG leftOffset, LONG topOffset, BOOL ignore_attributes,
1120 struct IntuitionBase *IntuitionBase);
1122 /* Private extra functions */
1123 void *FindMonitorNode(ULONG modeid, struct IntuitionBase *IntuitionBase);
1124 void *FindBestMonitorNode(void *family, const char *name, ULONG modeid, struct IntuitionBase *IntuitionBase);
1125 void *FindBest3dMonitor(void *family, struct IntuitionBase *IntuitionBase);
1126 ULONG FindBestModeID(const char *name, ULONG depth, ULONG width, ULONG height, struct IntuitionBase *IntuitionBase);
1128 AROS_INTP(ShutdownScreenHandler);
1130 #ifdef __MORPHOS__
1131 BOOL IsLayerHiddenBySibling(struct Layer *layer, BOOL xx);
1132 LONG IsLayerVisible(struct Layer *layer);
1133 #endif
1135 void SetupGInfo(struct GadgetInfo *gi, struct Window *win, struct Requester *req,
1136 struct Gadget *gad, struct IntuitionBase *IntuitionBase);
1138 IPTR Custom_DoMethodA(struct IntuitionBase *, struct Gadget *, Msg);
1140 #ifdef __MORPHOS__
1141 #ifdef DoMethodA
1142 #undef DoMethodA
1143 #endif
1144 #define DoMethodA(x, ...) (REG_A6=(LONG)IntuitionBase, DoMethodA(x, __VA_ARGS__))
1145 #endif
1147 #define HAS_CHILDREN(w) (NULL != w->firstchild)
1149 #ifdef __MORPHOS__
1150 #define DeinitRastPort(rp) ((void)0)
1151 #endif
1152 #define CreateRastPort() MyCreateRastPort(IntuitionBase)
1153 #define CloneRastPort(rp) MyCloneRastPort(IntuitionBase, rp)
1154 #define FreeRastPort(rp) MyFreeRastPort(IntuitionBase, rp)
1156 /* Replacement for dos.library/DisplayError() */
1157 AROS_UFP3(LONG, Intuition_DisplayError,
1158 AROS_UFPA(STRPTR, formatStr , A0),
1159 AROS_UFPA(ULONG , IDCMPFlags, D0),
1160 AROS_UFPA(APTR , args , A1));
1162 #define POINTERA_SharedPointer 0x80039010
1164 #ifndef __MORPHOS__
1165 #define dprintf kprintf
1166 #endif
1168 #define DEBUG_ACTIVATEGADGET(x) ;
1169 #define DEBUG_ACTIVATEWINDOW(x) ;
1170 #define DEBUG_ADDCLASS(x) ;
1171 #define DEBUG_ADDGADGET(x) ;
1172 #define DEBUG_ADDGLIST(x) ;
1173 #define DEBUG_ALLOCINTUIMESSAGE(x) ;
1174 #define DEBUG_ALLOCSCREENBUFFER(x) ;
1175 #define DEBUG_ALOHAWORKBENCH(x) ;
1176 #define DEBUG_CHANGEWINDOWBOX(x) ;
1177 #define DEBUG_CLOSESCREEN(x) ;
1178 #define DEBUG_CLOSEWINDOW(x) ;
1179 #define DEBUG_CLOSEWORKBENCH(x) ;
1180 #define DEBUG_DISPOSEOBJECT(x) ;
1181 #define DEBUG_DOGADGETMETHOD(x) ;
1182 #define DEBUG_DRAWBORDER(x) ;
1183 #define DEBUG_FINDCLASS(x) ;
1184 #define DEBUG_FREEICDATA(x) ;
1185 #define DEBUG_FREEINTUIMESSAGE(x) ;
1186 #define DEBUG_FREESCREENBUFFER(x) ;
1187 #define DEBUG_FREESCREENDRAWINFO(x) ;
1188 #define DEBUG_GADGETMOUSE(x) ;
1189 #define DEBUG_GETATTR(x) ;
1190 #define DEBUG_GETDEFAULTPUBSCREEN(x) ;
1191 #define DEBUG_GETDEFPREFS(x) ;
1192 #define DEBUG_GETGADGETIBOX(x) ;
1193 #define DEBUG_GETPREFS(x) ;
1194 #define DEBUG_GETSCREENDATA(x) ;
1195 #define DEBUG_GETSCREENDRAWINFO(x) ;
1196 #define DEBUG_HIDEWINDOW(x) ;
1197 #define DEBUG_OPEN(x) ;
1198 #define DEBUG_CLOSE(x) ;
1199 #define DEBUG_INPUTEVENT(x) ;
1200 #define DEBUG_INTREFRESHGLIST(x) ;
1201 #define DEBUG_INTUITEXTLENGTH(x) ;
1202 #define DEBUG_LENDMENUS(x) ;
1203 #define DEBUG_LOCKPUBSCREEN(x) ;
1204 #define DEBUG_MAKECLASS(x) ;
1205 #define DEBUG_MODIFYIDCMP(x) ;
1206 #define DEBUG_NEWOBJECT(x) ;
1207 #define DEBUG_NEXTOBJECT(x) ;
1208 #define DEBUG_OBTAINGIRPORT(x) ;
1209 #define DEBUG_OFFGADGET(x) ;
1210 #define DEBUG_OFFMENU(x) ;
1211 #define DEBUG_ONGADGET(x) ;
1212 #define DEBUG_ONMENU(x) ;
1213 #define DEBUG_OPENSCREEN(x) ;
1214 #define DEBUG_OPENSCREENTAGLIST(x) ;
1215 #define DEBUG_OPENWINDOW(x) ;
1216 #define DEBUG_OPENWINDOWTAGLIST(x) ;
1217 #define DEBUG_OPENWORKBENCH(x) ;
1218 #define DEBUG_POINTER(x) ;
1219 #define DEBUG_PRINTITEXT(x) ;
1220 #define DEBUG_QUERYOVERSCAN(x) ;
1221 #define DEBUG_REFRESH(x) ;
1222 #define DEBUG_RELEASEGIRPORT(x) ;
1223 #define DEBUG_REMEMBER(x) ;
1224 #define DEBUG_REMOVEGLIST(x) ;
1225 #define DEBUG_REPORTMOUSE(x) ;
1226 #define DEBUG_REQUEST(x) ;
1227 #define DEBUG_SCROLLWINDOWRASTER(x) ;
1228 #define DEBUG_SENDINTUIMESSAGE(x) ;
1229 #define DEBUG_SETATTRS(x) ;
1230 #define DEBUG_SETGADGETATTRS(x) ;
1231 #define DEBUG_SETPOINTER(x) ;
1232 #define DEBUG_SHOWWINDOW(x) ;
1233 #define DEBUG_UNLOCKPUBSCREEN(x) ;
1234 #define DEBUG_WINDOWLIMITS(x) ;
1235 #define DEBUG_WINDOWTOBACK(x) ;
1236 #define DEBUG_WINDOWTOFRONT(x) ;
1237 #define DEBUG_ZIPWINDOW(x) ;
1238 #define DEBUG_VISITOR(x) ;
1239 #define DEBUG_WORKBENCH(x) ;
1240 #define DEBUG_LOCKPUBSCREENLIST(x) ;
1241 #define DEBUG_UNLOCKPUBSCREENLIST(x) ;
1242 #define DEBUG_RETHINKDISPLAY(x) ;
1244 #ifdef NO_RUNTIME_DEBUG
1246 #define DEBUG_INIT(x) ;
1247 #define DEBUG_SETIPREFS(x) ;
1248 #define DEBUG_SETPREFS(x) ;
1250 #else
1252 #define DEBUG_INIT(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1253 #define DEBUG_SETIPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1254 #define DEBUG_SETPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1256 #endif
1259 * Private data structures of the classes defined by intuition.library
1262 /* ICClass */
1263 struct ICData
1265 Object *ic_Target;
1266 struct TagItem *ic_Mapping;
1267 struct TagItem *ic_CloneTags;
1268 ULONG ic_LoopCounter;
1271 /* ModelClass */
1272 struct ModelData
1274 struct MinList memberlist;
1277 /* FrameIClass */
1278 struct FrameIData
1280 /* render bevel only with no fill? */
1281 BOOL fid_EdgesOnly;
1283 /* inverted bevel pens? */
1284 BOOL fid_Recessed;
1286 /* frame style? */
1287 WORD fid_FrameType;
1289 WORD fid_HOffset;
1290 WORD fid_VOffset;
1293 /* SysIClass */
1294 struct SysIData
1296 struct DrawInfo *dri;
1297 struct Image *frame;
1298 ULONG type;
1299 UWORD flags;
1302 /* FillRectClass */
1303 struct FillRectData
1305 WORD apatsize;
1306 WORD mode;
1309 /* GadgetClass */
1310 struct GadgetData
1312 struct ExtGadget EG;
1313 struct ICData IC;
1316 /* PropGClass */
1317 struct PropGData
1319 /* We use a propinfo structure, because we use the same routines
1320 for intuition propgadtets and in propgclass */
1322 struct PropInfo propinfo;
1324 /* A little kludge: since the HandleMouseMove function
1325 wants dx/dy and not absolute mouse coords, we
1326 have to remember the last ones */
1328 UWORD last_x;
1329 UWORD last_y;
1331 /* One only have to store total or visble, and use some other
1332 formulas than those in the RKRM:L, but for
1333 code simplicity I store them all. */
1334 UWORD top, visible, total;
1336 UWORD flags;
1337 struct BBox *old_knobbox;
1338 struct Hook *DisplayHook;
1341 /* StrGClass */
1342 struct StrGData
1344 struct StringInfo StrInfo;
1345 struct StringExtend StrExtend;
1346 UBYTE Flags;
1349 /* GroupGClass */
1350 struct GroupGData
1352 struct MinList memberlist;
1353 struct Gadget *activegad;
1356 /* DragBarClass */
1357 struct dragbar_data
1359 /* Current left- and topedge of moving window. Ie when the user releases
1360 the LMB after a windowdrag, the window's new coords will be (curleft, curtop)
1363 LONG curleft;
1364 LONG curtop;
1366 /* The current x and y coordinates relative to curleft/curtop */
1367 LONG mousex;
1368 LONG mousey;
1370 /* Whether the dragframe is currently drawn or erased */
1371 BOOL isrendered;
1373 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1374 BOOL drag_canceled;
1376 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1377 BOOL drag_layerlock;
1378 #ifdef USEGADGETLOCK
1379 BOOL drag_gadgetlock;
1380 BOOL drag_inputhandlerlock;
1381 #endif
1382 BOOL drag_refreshed;
1384 /* Rastport to use during update */
1385 struct RastPort *rp;
1387 UQUAD lasteventtime;
1389 LONG startleft;
1390 LONG starttop;
1392 #ifdef USEWINDOWLOCK
1393 /* used to prevent windows from opening/closing while user drags a window */
1394 BOOL drag_windowlock;
1395 #endif
1397 struct Task *movetask;
1401 /* SizeButtonClass */
1402 struct sizebutton_data
1405 /* The current width and height of the rubber band frame */
1406 ULONG width;
1407 ULONG height;
1408 ULONG top;
1409 ULONG left;
1411 /* holds original sizes */
1412 ULONG Width;
1413 ULONG Height;
1414 ULONG TopEdge;
1415 ULONG LeftEdge;
1417 /* the offset of the mouse pointer to the rubber band frame*/
1418 LONG mouseoffsetx;
1419 LONG mouseoffsety;
1421 /* Whether the dragframe is currently drawn or erased */
1422 BOOL isrendered;
1424 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1425 BOOL drag_canceled;
1427 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1428 BOOL drag_layerlock;
1429 #ifdef USEGADGETLOCK
1430 BOOL drag_gadgetlock;
1431 BOOL drag_inputhandlerlock;
1432 #endif
1434 BOOL drag_refreshed;
1436 /* Rastport to use during update */
1437 struct RastPort *rp;
1439 UQUAD lasteventtime;
1441 #ifdef USEWINDOWLOCK
1442 /* used to prevent windows from opening/closing while user drags a window */
1443 BOOL drag_windowlock;
1444 #endif
1446 #ifdef SKINS
1447 ULONG drag_type;
1448 #endif
1450 ULONG drag_ticks;
1454 /* MenuBarLabelClass */
1455 struct MenuBarLabelData
1457 struct DrawInfo *dri;
1460 /* PointerClass */
1461 struct PointerData
1463 struct SharedPointer *shared_pointer;
1466 /* WinDecorClass */
1467 struct windecor_data
1469 ULONG userbuffersize;
1472 /* ScrDecorClass */
1473 struct scrdecor_data
1475 ULONG userbuffersize;
1478 /* MenuDecorClass */
1479 struct menudecor_data
1481 ULONG userbuffersize;
1484 #endif /* INTUITION_INTERN_H */