Improved debug messages and added missing properties.
[AROS.git] / rom / intuition / intuition_intern.h
blob9d23fc5024e161706152bf568a471c43c5a7fd39
1 #ifndef INTUITION_INTERN_H
2 #define INTUITION_INTERN_H
4 /*
5 Copyright 1995-2011, The AROS Development Team. All rights reserved.
6 Copyright 2001-2003, 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_IO_H
29 # include <exec/io.h>
30 #endif
31 #ifndef EXEC_TYPES_H
32 # include <exec/types.h>
33 #endif
34 #ifndef EXEC_LISTS_H
35 # include <exec/lists.h>
36 #endif
37 #ifndef GRAPHICS_GFXBASE_H
38 # include <graphics/gfxbase.h>
39 #endif
40 #ifndef GRAPHICS_RASTPORT_H
41 # include <graphics/rastport.h>
42 #endif
43 #ifndef GRAPHICS_REGIONS_H
44 # include <graphics/regions.h>
45 #endif
46 #ifndef GRAPHICS_CLIP_H
47 # include <graphics/clip.h>
48 #endif
49 #ifndef GRAPHICS_TEXT_H
50 # include <graphics/text.h>
51 #endif
52 #ifndef INTUITION_INTUITION_H
53 # include <intuition/intuition.h>
54 #endif
55 #ifndef INTUITION_INTUITIONBASE_H
56 # include <intuition/intuitionbase.h>
57 #endif
58 #ifndef INTUITION_CLASSES_H
59 # include <intuition/classes.h>
60 #endif
61 #ifndef INTUITION_CGHOOKS_H
62 # include <intuition/cghooks.h>
63 #endif
64 #ifndef INTUITION_SGHOOKS_H
65 # include <intuition/sghooks.h>
66 #endif
67 #ifndef INTUITION_SCREENS_H
68 # include <intuition/screens.h>
69 #endif
70 #ifndef PREFS_ICONTROL_H
71 # include <prefs/icontrol.h>
72 #endif
73 #ifndef PREFS_INPUT_H
74 #include <prefs/input.h>
75 #endif
76 #ifndef CLIB_ALIB_PROTOS_H
77 # include <clib/alib_protos.h>
78 #endif
79 #ifdef INTUITION_NOTIFY_SUPPORT
80 # include <libraries/screennotify.h>
81 # include <libraries/notifyintuition.h>
82 #endif
84 #include <oop/oop.h>
86 #include "intuition_debug.h"
88 #ifdef SKINS
89 #include "intuition_customize.h"
90 #include "intuition_internmos.h"
91 #include "intuition_extend.h"
92 #endif
94 #include "requesters.h"
96 /* Needed for aros_print_not_implemented macro */
97 #include <aros/debug.h>
99 #include <aros/asmcall.h>
101 #if DEBUG_ASSERTS
102 #define ASSERT_VALID_PTR_ROMOK(ptr) \
103 do { \
104 if (!((IPTR)ptr & 1)) { \
105 if (TypeOfMem((APTR)ptr)) \
106 break; \
107 else { \
108 struct Task *me = FindTask(NULL); \
110 if (((IPTR)(ptr) >= (IPTR)me->tc_SPLower) && ((IPTR)(ptr) < (IPTR)me->tc_SPUpper)) \
111 break; \
114 bug("[intuition] Invalid pointer value %p at %s, line %u\n", ptr, __FILE__, __LINE__); \
115 } while(0);
116 #else
117 #define ASSERT_VALID_PTR_ROMOK(ptr)
118 #endif
120 // FIXME: seems only used for RefreshWindowTitles() ? -> better names
121 // FIXME: what are the correct values?
122 #define NO_DOUBLEBUFFER (0)
123 #define DOUBLEBUFFER (1)
125 /* features */
126 #ifdef __MORPHOS__
127 # define USE_OPAQUESIZE 1
128 #else
129 # define USE_OPAQUESIZE 0
130 #endif
132 /* This definition turns on compatibility mode where sprite colors
133 are allocated on hi- and truecolor screens also. This may be needed
134 if some software relies on this allocation. AROS itself currently does
135 not need this.
136 #define ALWAYS_ALLOCATE_SPRITE_COLORS */
138 #ifdef __MORPHOS__
139 void dprintf(char *, ...) __attribute__ ((format (printf, 1, 2)));
140 void * memclr(APTR, ULONG);
141 #endif
143 #ifdef __MORPHOS__
144 void * memclr(APTR, ULONG);
145 #define bzero(a,b) memclr(a,b)
146 #else /* __MORPHOS__ */
147 #define memclr(a,b) bzero(a,b)
148 #endif /* __MORPHOS__ */
151 * min()/max() without macro side effects.
153 #define max(a,b) \
154 ({typeof(a) _a = (a); \
155 typeof(b) _b = (b); \
156 _a > _b ? _a : _b;})
158 #define min(a,b) \
159 ({typeof(a) _a = (a); \
160 typeof(b) _b = (b); \
161 _a > _b ? _b : _a;})
163 #define EXTENDWORD(x) x = (LONG)((WORD)x);
164 #define EXTENDUWORD(x) x = (ULONG)((UWORD)x);
166 /* SANITY CHECK MACRO */
167 //#define DEBUG_SANITYCHECK
169 #ifdef DEBUG_SANITYCHECK
170 #define SANITY_CHECK(x) if (!((IPTR)x)) {dprintf("Losing sanity in %s line %d\n",__FILE__,__LINE__); return;};
171 #define SANITY_CHECKR(x,v) if (!((IPTR)x)) {dprintf("Losing sanity in %s line %d\n",__FILE__,__LINE__); return v;};
172 #else
173 #define SANITY_CHECK(x) if (!((IPTR)x)) return;
174 #define SANITY_CHECKR(x,v) if (!((IPTR)x)) return v;
175 #endif
177 /* Options */
179 #define MENUS_BACKFILL TRUE
181 #define MENUS_AMIGALOOK(base) ((GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_3DMENUS) == 0)
182 /* --- Values --- */
183 #define MENULOOK_3D 0
184 #define MENULOOK_CLASSIC 1
186 #define MENUS_UNDERMOUSE(base) (GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_POPUPMENUS)
188 #define AVOID_WINBORDERERASE(base) \
189 (GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_AVOIDWINBORDERERASE)
191 /* --- Values --- */
192 /* TRUE, FALSE */
194 #define FRAME_SIZE(base) (GetPrivIBase(base)->FrameSize)
195 /* --- Values --- */
196 #define FRAMESIZE_THIN 0 /* 1:1 thin */
197 #define FRAMESIZE_MEDRES 1 /* 2:1 medres like AmigaOS */
198 #define FRAMESIZE_THICK 2 /* 1:1 thick */
200 #define SQUARE_WIN_GADGETS 1
202 #ifdef __AROS__
203 /* FIXME: possibly enable this, once gadtools has been updated */
204 #else
205 #define GADTOOLSCOMPATIBLE
206 //enables some gadtools-weirdo-code, MUST be set in both gadtools & intui to work!!!
207 #endif
209 #ifdef SKINS
210 //#define USEGETIPREFS
211 #endif
213 /* simpleref layers have gadgets redrawn when app calls beginrefresh() */
214 //#define BEGINUPDATEGADGETREFRESH
215 //#define DAMAGECACHE
217 #define USEWINDOWLOCK
218 #ifdef USEWINDOWLOCK
219 #define LOCKWINDOW(base) ObtainSemaphore(&GetPrivIBase(base)->WindowLock);
220 #define UNLOCKWINDOW(base) ReleaseSemaphore(&GetPrivIBase(base)->WindowLock);
221 #else
222 #define LOCKWINDOW(base)
223 #define UNLOCKWINDOW(base)
224 #endif
225 /* jDc: do NOT disable this! */
227 #define USEGADGETLOCK
228 #ifdef USEGADGETLOCK
229 #define LOCKGADGET(base) ObtainSemaphore(&GetPrivIBase(base)->GadgetLock);
230 #define UNLOCKGADGET(base) ReleaseSemaphore(&GetPrivIBase(base)->GadgetLock);
231 #define LOCKWINDOWLAYERS(w) ;
232 #define UNLOCKWINDOWLAYERS(w) ;
233 #else
234 #define LOCKGADGET
235 #define UNLOCKGADGET
236 #define LOCKWINDOWLAYERS(w) LockLayerInfo(&w->WScreen->LayerInfo); \
237 if (((struct IntWindow *)(w))->borderlayer) {LockLayer(0,((struct IntWindow *)(w))->borderlayer);}; \
238 if (((struct IntWindow *)(w))->wlayer) {LockLayer(0,((struct IntWindow *)(w))->wlayer);};
239 #define UNLOCKWINDOWLAYERS(w) if (((struct IntWindow *)(w))->wlayer) {UnlockLayer(((struct IntWindow *)(w))->wlayer);}; \
240 if (((struct IntWindow *)(w))->borderlayer) {UnlockLayer(((struct IntWindow *)(w))->borderlayer);} \
241 UnlockLayerInfo(&w->WScreen->LayerInfo);
242 #endif
244 #define WLAYER(w) (((struct IntWindow *)(w))->wlayer)
245 #define BLAYER(w) (((struct IntWindow *)(w))->borderlayer)
247 //#define TIMEVALWINDOWACTIVATION
249 /* If PROP_RENDER_OPTIMIZATION is set to 1, propgadget code tries to optimize rendering
250 during prop gadget knob movement. Only area of the propgadget that is affected by
251 prop gadget knob movement is re-rendered.
253 Unfortunately this can fail with some programs, like DOpus 4.x text viewer */
255 #define PROP_RENDER_OPTIMIZATION 0
257 #define SINGLE_SETPOINTERPOS_PER_EVENTLOOP 1
259 #ifndef LIFLG_SUPPORTS_OFFSCREEN_LAYERS
260 /* Defined in <graphics/layers.h>, but apparently not on MorphOS. */
261 # define LIFLG_SUPPORTS_OFFSCREEN_LAYERS 2
262 #endif
264 #define INTUITIONNAME "intuition.library"
265 #define MENUBARLABELCLASS "menubarlabelclass"
267 #define DEFPUBSCREEN TRUE
269 #define USE_NEWDISPLAYBEEP 1
271 #define TITLEBUFFERLEN 255
273 #define USE_IDCMPUPDATE_MESSAGECACHE 0
275 #ifdef __MORPHOS__
276 #if INCLUDE_VERSION < 50
278 /********************************************************************************/
279 /* imageclass.h AROS extensions */
281 #define SYSIA_WithBorder IA_FGPen /* default: TRUE */
282 #define SYSIA_Style IA_BGPen /* default: SYSISTYLE_NORMAL */
284 #define SYSISTYLE_NORMAL 0
285 #define SYSISTYLE_GADTOOLS 1 /* to get arrow images in gadtools look */
287 /********************************************************************************/
288 /* gadgetclass.h AROS extenstions */
290 /* This method is invoked to learn about the sizing requirements of your class,
291 before an object is created. This is AROS specific. */
292 #define GM_DOMAIN 7
293 struct gpDomain
295 STACKED ULONG MethodID; /* GM_DOMAIN */
296 STACKED struct GadgetInfo *gpd_GInfo; /* see <intuition/cghooks.h> */
297 STACKED struct RastPort *gpd_RPort; /* RastPort to calculate dimensions for. */
298 STACKED LONG gpd_Which; /* see below */
299 STACKED struct IBox gpd_Domain; /* Resulting domain. */
300 STACKED struct TagItem *gpd_Attrs; /* Additional attributes. None defined,
301 yet. */
304 /********************************************************************************/
306 /* gpd_Which */
307 #define GDOMAIN_MINIMUM 0 /* Calculate minimum size. */
308 #define GDOMAIN_NOMINAL 1 /* Calculate nominal size. */
309 #define GDOMAIN_MAXIMUM 2 /* Calculate maximum size. */
311 #endif /* INCLUDE_VERSION < 50 */
312 #endif /* ifdef __MORPHOS__ */
314 /********************************************************************************/
315 #define GM_MOVETEST 8
316 /* this method is used by our draggad to tell if it's OK to move the mouse when window
317 is near screen boundaries and offscreen is disabled. msg = gpInput*/
318 //retvals are:
319 #define MOVETEST_MOVE 0
320 #define MOVETEST_ADJUSTPOS 1
322 /* ObtainGIRPort must install a 0 clipregion and
323 set scrollx/scrolly of layer to 0. Since this
324 will be restored only when ReleaseGIRPort is
325 called, we must backup the orig values somewhere */
327 struct LayerContext
329 struct Region *clipregion;
330 WORD scroll_x;
331 WORD scroll_y;
332 WORD nestcount;
336 /* Preferences */
338 #define IP_OLDFONT 2
339 #define IP_OLDOVERSCAN 3
340 #define IP_OLDICONTROL 4
341 #define IP_OLDPOINTER 7
342 #define IP_OLDPALETTE 8
343 #define IP_OLDPENS 9
345 #define IP_SCREENMODE 1
346 #define IP_FONT 101//2
347 #define IP_ICONTROL 102//4
348 #define IP_POINTER 103//7
349 #define IP_PTRCOLOR 104//8
350 #define IP_PALETTE 105
351 #define IP_IACTIONS 20
352 #define IP_IEXTENSIONS 21
353 #define IP_INPUTEXT 22
355 #ifdef __MORPHOS__
357 struct IScreenModePrefs
359 ULONG smp_DisplayID;
360 UWORD smp_Width;
361 UWORD smp_Height;
362 UWORD smp_Depth;
363 UWORD smp_Control;
366 struct IIControlPrefs
368 UWORD ic_TimeOut;
369 WORD ic_MetaDrag;
370 ULONG ic_Flags;
371 UBYTE ic_WBtoFront;
372 UBYTE ic_FrontToBack;
373 UBYTE ic_ReqTrue;
374 UBYTE ic_ReqFalse;
377 #else
379 #include <intuition/iprefs.h>
381 #endif
383 struct Color32
385 ULONG red;
386 ULONG green;
387 ULONG blue;
390 #define COLORTABLEENTRIES 11
392 struct IntScreen;
394 #ifdef __mc68000
395 #define RESOURCELIST_HASHSIZE 32 /* Smaller hash for memory limited m68k */
396 #else
397 #define RESOURCELIST_HASHSIZE 256
398 #endif
400 #define RESOURCE_WINDOW 1
401 #define RESOURCE_SCREEN 2
403 struct HashNode
405 struct MinNode node;
406 UWORD type;
407 APTR resource;
410 /* Internal Screen Notification Data */
411 struct IntScreenNotify
413 struct Node node;
414 struct MsgPort *port;
415 struct Task *sigtask;
416 struct Hook *hook;
417 ULONG flags;
418 IPTR userdata;
419 char *pubname;
420 BYTE sigbit;
423 /* IntuitionBase */
424 struct IntIntuitionBase
426 struct IntuitionBase IBase;
427 #ifdef __MORPHOS__
428 WORD _MinXMouse,_MaxXMouse; /* Old 1.3 Base entries*/
429 WORD _MinYMouse,_MaxYMouse; /* Old 1.3 Base entries*/
430 ULONG _StartSecs,_StartMicros; /* Old 1.3 Base entries*/
431 char *SystemRequestTitle; /* written by locale as it seems..what a crappy interface*/
432 char *WorkbenchTitle; /* written by locale as it seems..what a crappy interface*/
435 * savety pad for intuitionbase accesses
436 * probably needs to be smarter
438 UBYTE Pad[0x800];
439 #endif
441 /* Put local shit here, invisible for the user */
442 #ifdef __MORPHOS__
443 struct Library *MUIMasterBase;
444 #endif
446 struct DosLibrary *DOSBase;
447 struct LayersBase *LayersBase;
448 struct Library *UtilityBase;
449 struct GfxBase *GfxBase;
450 struct Library *OOPBase;
451 struct Library *KeymapBase;
453 struct Library *InputBase;
454 struct Library *TimerBase;
455 struct MsgPort *TimerMP;
456 struct timerequest *TimerIO;
458 struct MsgPort *WorkBenchMP;
459 struct Screen *WorkBench;
460 struct SignalSemaphore *IBaseLock;
462 /* Intuition input handlers replyport. This one is set
463 int rom/inputhandler.c/InitIIH()
465 struct MsgPort *IntuiReplyPort;
466 struct MinList *IntuiActionQueue;
467 struct IOStdReq *InputIO;
468 struct MsgPort *InputMP;
470 /* Intuition Screennotify Replyport if SNOTIFY_WAIT_REPLY is specified */
472 struct MsgPort *ScreenNotifyReplyPort;
474 BOOL InputDeviceOpen;
475 struct Interrupt *InputHandler;
477 struct Hook *GlobalEditHook;
478 /* The default global edit hook */
479 struct Hook DefaultEditHook;
481 struct Screen *DefaultPubScreen;
482 struct SignalSemaphore PubScrListLock;
483 struct MinList PubScreenList;
484 UWORD pubScrGlobalMode;
486 struct SignalSemaphore ScreenNotificationListLock;
487 struct List ScreenNotificationList;
489 struct SignalSemaphore GadgetLock;
490 struct SignalSemaphore MenuLock;
491 struct SignalSemaphore WindowLock;
492 struct SignalSemaphore IntuiActionLock;
493 struct SignalSemaphore InputHandlerLock;
494 struct LayerContext BackupLayerContext;
496 struct IClass *dragbarclass;
497 struct IClass *sizebuttonclass;
499 APTR *mosmenuclass;
501 struct Preferences *DefaultPreferences;
502 struct Preferences *ActivePreferences;
504 struct MsgPort *MenuHandlerPort;
505 BOOL MenusActive;
507 struct TextFont *ScreenFont;
508 struct TextFont *TopazFont;
510 /* Dos function DisplayError() before intuition.library patched it */
511 APTR OldDisplayErrorFunc;
513 struct SignalSemaphore ClassListLock;
514 struct MinList ClassList;
515 struct IClass RootClass;
517 #ifdef __MORPHOS__
518 struct ViewExtra *ViewLordExtra;
519 LONG SpriteNum;
520 #else
521 BOOL ViewLord_ok;
522 #endif
524 #ifdef SKINS
525 ULONG *SmallMenuPool;
526 #endif
527 ULONG *IDCMPPool;
529 struct IScreenModePrefs ScreenModePrefs;
530 struct IIControlPrefs IControlPrefs;
531 #ifdef SKINS
532 struct IAction *IControlActions;
533 struct IControlExtensions IControlExtensions;
534 ULONG NumIControlActions;
535 struct InputPrefsExt InputPrefsExt;
536 #endif
537 struct IClass *pointerclass;
538 Object *DefaultPointer;
539 Object *BusyPointer;
540 UWORD DriPens2[NUMDRIPENS];
541 UWORD DriPens4[NUMDRIPENS];
542 UWORD DriPens8[NUMDRIPENS];
543 struct Color32 Colors[COLORTABLEENTRIES];
544 UWORD PointerAlpha;
545 ULONG DMStartSecs;
546 ULONG DMStartMicro;
547 struct IntScreen *MenuVerifyScreen;
548 ULONG PointerDelay;
550 #ifdef SKINS
551 struct SignalSemaphore DataTypesSem;
552 struct Library *DataTypesBase; /* should be opened ONLY by int_InitCustomChanges!*/
553 #endif
555 ULONG LastClickSecs;
556 ULONG LastClickMicro; /* for doubleclick to front */
557 ULONG DoubleClickCounter;
558 ULONG DoubleClickButton;
560 #ifdef SKINS
561 struct Hook transphook; /* hook for windows with intui transp */
562 struct Hook notransphook; /* hook for windows with no additional transp (borderless,etc) */
563 #endif
564 #ifdef INTUITION_NOTIFY_SUPPORT
565 struct Library *ScreenNotifyBase;
566 struct Library *NotifyIntuitionBase;
567 #endif
569 struct RastPort DoGadgetMethodRP;
570 struct GadgetInfo DoGadgetMethodGI;
572 struct SignalSemaphore WinDecorSem;
573 Object *WinDecorObj;
574 struct SignalSemaphore ScrDecorSem;
575 Object *ScrDecorObj;
576 struct SignalSemaphore MenuDecorSem;
577 Object *MenuDecorObj;
579 Object *DefWinDecorObj;
580 Object *DefScrDecorObj;
581 Object *DefMenuDecorObj;
583 struct List Decorations;
584 struct NewDecorator *Decorator;
586 #ifdef USEGETIPREFS
587 BOOL IPrefsLoaded;
588 #endif
590 #if USE_NEWDISPLAYBEEP
591 LONG BeepingScreens;
592 #endif
594 WORD prop_clickoffset_x, prop_clickoffset_y;
596 struct MinList ResourceList[RESOURCELIST_HASHSIZE];
598 /* Menu Look Settings */
599 int FrameSize;
601 Object *ActiveMonitor;
602 Object *NewMonitor;
604 OOP_AttrBase HiddAttrBase;
605 OOP_AttrBase HiddGfxAttrBase;
606 OOP_AttrBase HiddPixFmtAttrBase;
608 OOP_MethodID ib_HiddGfxBase;
609 OOP_MethodID ib_HiddBitMapBase;
611 struct IClass *monitorclass;
612 struct MinList MonitorList;
613 struct SignalSemaphore MonitorListSem;
616 struct SharedPointer
618 struct ExtSprite *sprite;
619 WORD xoffset, yoffset;
620 int ref_count;
623 struct SharedPointer *CreateSharedPointer(struct ExtSprite *, int, int, struct IntuitionBase *);
624 void ObtainSharedPointer(struct SharedPointer *, struct IntuitionBase *);
625 void ReleaseSharedPointer(struct SharedPointer *, struct IntuitionBase *);
627 #ifdef INTUITION_NOTIFY_SUPPORT
628 void sn_DoNotify(ULONG type, APTR value, struct Library *_ScreenNotifyBase);
629 #endif
631 struct IntDrawInfo
633 struct DrawInfo dri;
634 struct Screen *dri_Screen;
635 struct SignalSemaphore dri_WinDecorSem;
636 Object *dri_WinDecorObj;
637 struct SignalSemaphore dri_ScrDecorSem;
638 Object *dri_ScrDecorObj;
641 #define DRI_VERSION_AROS (DRI_VERSION + 1)
643 #define LOCK_WINDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
644 #define LOCKSHARED_WINDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
645 #define UNLOCK_WINDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
647 #define LOCK_SCRDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
648 #define LOCKSHARED_SCRDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
649 #define UNLOCK_SCRDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
651 #define LOCK_MENUDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
652 #define LOCKSHARED_MENUDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
653 #define UNLOCK_MENUDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
655 struct IntScreen
657 struct Screen Screen;
659 /* Private fields */
660 struct HashNode hashnode;
661 struct IntDrawInfo DInfo;
662 struct TTextAttr textattr;
663 ULONG textattrtags[3];
664 UWORD Pens[NUMDRIPENS];
665 struct PubScreenNode *pubScrNode;
666 Object *depthgadget;
667 UWORD SpecialFlags;
668 struct Layer *rootLayer;
669 #if !USE_NEWDISPLAYBEEP
670 ULONG DisplayBeepColor0[3];
671 struct Window *DisplayBeepWindow;
672 #endif
673 #ifdef __MORPHOS__
674 ULONG ModeID;
675 struct MonitorSpec *Monitor;
676 #endif
677 Object *MonitorObject;
678 struct SharedPointer *Pointer;
679 struct Window *MenuVerifyActiveWindow;
680 int MenuVerifyTimeOut;
681 int MenuVerifyMsgCount;
682 ULONG MenuVerifySeconds;
683 ULONG MenuVerifyMicros;
684 ULONG DecorUserBufferSize;
685 IPTR DecorUserBuffer;
686 Object *WinDecorObj;
687 Object *ScrDecorObj;
688 Object *MenuDecorObj;
689 struct NewDecorator *Decorator;
691 struct BitMap *AllocatedBitmap;
692 #ifdef SKINS
693 WORD LastClockPos;
694 WORD LastClockWidth;
695 #else
696 ULONG Reserved;
697 #endif
698 #ifdef SKINS
699 struct SkinInfo SkinInfo;
700 struct RastPort *TitlebarBufferRP;
701 struct Window *TitlebarBufferWin;
702 ULONG TitlebarWinWidth;
703 ULONG TitlebarWinActive;
704 #endif
705 #if USE_NEWDISPLAYBEEP
706 UBYTE BeepingCounter;
707 #endif
710 #define GetPrivScreen(s) ((struct IntScreen *)s)
712 /* SpecialFlags */
713 #define SF_IsParent (0x0001)
714 #define SF_IsChild (0x0002)
715 #define SF_InvisibleBar (0x0004)
716 #define SF_AppearingBar (0x0008)
717 #define SF_SysFont (0x0010)
718 #define SF_Draggable (0x0020) /* Screen can be dragged */
719 #define SF_ComposeAbove (0x0100) /* Composition capabilities */
720 #define SF_ComposeBelow (0x0200)
721 #define SF_ComposeLeft (0x0400)
722 #define SF_ComposeRight (0x0800)
724 #define SF_VertCompose (SF_ComposeAbove|SF_ComposeBelow)
725 #define SF_HorCompose (SF_ComposeLeft |SF_ComposeRight)
726 #define SF_Compose (SF_ComposeAbove|SF_ComposeBelow|SF_ComposeLeft|SF_ComposeRight)
728 struct IntIntuiMessage
730 struct ExtIntuiMessage eimsg;
733 ** The following field is needed, because in case of IDCMP_RAWKEY
734 ** IntuiMessage->IAddress is a pointer to this data, not the data
735 ** itself (which is the case for IDCMP_VANILLAKEY)
738 APTR prevCodeQuals;
741 #define INT_INTUIMESSAGE(x) ((struct IntIntuiMessage *)(x))
745 /*extern struct IntuitionBase * IntuitionBase;*/
747 #define IW(window) ((struct IntWindow *) (window))
749 #define GetPubIBase(ib) ((struct IntuitionBase *)ib)
750 #define GetPrivIBase(ib) ((struct IntIntuitionBase *)ib)
752 /* FIXME: Remove these #define xxxBase hacks
753 Do not use this in new code !
755 #ifdef __MORPHOS__
756 #ifdef MUIMasterBase
757 #undef MUIMasterBase
758 #define MUIMasterBase (GetPrivIBase(IntuitionBase)->MUIMasterBase)
759 #endif
760 #endif
762 /* struct Utilitybase is used in the following file so include it
763 before defining Utilitybase
765 #include <proto/utility.h>
767 /* stegerg: one can have sysgadgets outside of window border! All sysgadgets in window
768 border must have set GACT_???BORDER and, if they are in a gzz window, also
769 GTYP_GZZGADGET */
771 #define IS_GZZ_GADGET(gad) (((gad)->GadgetType) & GTYP_GZZGADGET)
773 #define IS_BORDER_GADGET(gad) (IS_GZZ_GADGET(gad) || \
774 ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER)))
776 #define IS_SYS_GADGET(gad) (((gad)->GadgetType) & GTYP_SYSTYPEMASK)
778 #define IS_BOOPSI_GADGET(gad) (((gad)->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET)
780 /*#define IS_BORDER_GADGET(gad) \
781 (((gad->GadgetType) & GTYP_SYSGADGET) \
782 || ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER))) */
784 #define IS_REQ_GADGET(gad) ((gad)->GadgetType & GTYP_REQGADGET)
786 #define IS_SCREEN_GADGET(gad) ((gad)->GadgetType & GTYP_SCRGADGET)
788 #define SET_GI_RPORT(gi, w, req, gad) \
789 (gi)->gi_RastPort = (IS_SCREEN_GADGET(gad) ? \
790 ((gi)->gi_Screen->BarLayer ? (gi)->gi_Screen->BarLayer->rp : NULL) : \
791 (IS_BORDER_GADGET(gad) ? (w)->BorderRPort : \
792 ((req) ? ((req)->ReqLayer->rp) : (w)->RPort)) \
796 #define REFRESHGAD_BOOPSI 1 /* boopsi gadgets */
797 #define REFRESHGAD_BORDER 2 /* gadgets in window border */
798 #define REFRESHGAD_REL 4 /* gadgets with GFLG_RELRIGHT, GFLG_RELBOTTOM,GFLG_RELWIDTH, GFLG_RELHEIGHT */
799 #define REFRESHGAD_RELS 8 /* GFLG_RELSPECIAL gadgets */
800 #define REFRESHGAD_TOPBORDER 16 /* used by setwindowtitle */
801 #define REFRESHGAD_NOGADTOOLS 32 /* used in some cases for _mustbe_ */
803 #define SYSGADGET_ACTIVE (iihdata->ActiveSysGadget != NULL)
805 VOID int_refreshglist(struct Gadget *gadgets, struct Window *window,
806 struct Requester *requester, LONG numGad, LONG mustbe, LONG mustnotbe,
807 struct IntuitionBase *IntuitionBase);
809 VOID int_RefreshWindowFrame(struct Window *window, LONG mustbe, LONG mustnotbe,
810 LONG mode,
811 struct IntuitionBase *IntuitionBase);
813 #define int_refreshwindowframe(a,b,c,d) int_RefreshWindowFrame(a,b,c,0,d);
815 /* Keep the system gadgets in the same order than the original intuition,
816 * some programs make bad asumptions about that...
818 enum
820 DEPTHGAD,
821 ZOOMGAD,
822 SIZEGAD,
823 CLOSEGAD,
824 ICONIFYGAD,
825 LOCKGAD,
826 MUIGAD,
827 POPUPGAD,
828 SNAPSHOTGAD,
829 JUMPGAD,
830 DRAGBAR,
831 NUM_SYSGADS
834 #define SYSGAD(w, idx) (((struct IntWindow *)(w))->sysgads[idx])
836 struct IntWindow
838 struct Window window;
840 Object *sysgads[NUM_SYSGADS];
841 struct Image *AmigaKey;
842 struct Image *Checkmark;
843 struct Image *SubMenuImage;
844 struct Window *menulendwindow;
846 struct HashNode hashnode;
848 /* When the Zoom gadget is pressed the window will have the
849 dimensions stored here. The old dimensions are backed up here
850 again. */
851 WORD ZipLeftEdge;
852 WORD ZipTopEdge;
853 WORD ZipWidth;
854 WORD ZipHeight;
856 /* max. number of mousemove events to send to this window */
857 WORD mousequeue;
859 /* act. number of mousemove events sent to this window */
860 WORD num_mouseevents;
862 /* max. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
863 messages to send to this window */
864 WORD repeatqueue;
866 /* act. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
867 messages sent to this window */
868 WORD num_repeatevents;
870 #if USE_IDCMPUPDATE_MESSAGECACHE
871 /* number of unreplied IDCMP_IDCMPUPDATE messages sent to window
872 used in few hacks :) */
873 WORD num_idcmpupdate;
874 #endif
876 WORD sizeimage_width;
877 WORD sizeimage_height;
879 ULONG helpflags;
880 ULONG helpgroup;
882 Object *pointer;
883 BOOL busy;
884 BOOL free_pointer;
885 UWORD pointer_delay;
886 ULONG extrabuttons;
887 ULONG extrabuttonsid; /* replaces ETI_Dummy if apps wishes it */
888 #ifdef SKINS
889 ULONG titlepos; /* used by titlebar pattern fill stuff */
890 #else
891 ULONG reserved1;
892 #endif
893 ULONG specialflags;
895 #ifdef SKINS
896 struct Region *transpregion;
897 struct Hook *usertransphook;
898 struct Region *usertranspregion;
899 #endif
901 #ifdef DAMAGECACHE
902 struct Region *trashregion;
903 #endif
904 char titlebuffer[TITLEBUFFERLEN+1];
906 #if USE_IDCMPUPDATE_MESSAGECACHE
907 struct IntuiMessage *messagecache; //for idcmpupdate cache
908 #endif
910 struct Layer *wlayer;
911 struct Layer *borderlayer;
913 struct timeval lastmsgsent;
914 struct timeval lastmsgreplied;
916 #ifdef TIMEVALWINDOWACTIVATION
917 struct timeval activationtime;
918 #endif
920 #ifdef SKINS
921 struct Hook custombackfill;
922 struct HookData hd;
923 #endif
924 struct Hook DefaultWindowShapeHook;
925 BOOL CustomShape;
926 struct Region *OutlineShape;
927 ULONG DecorUserBufferSize;
928 IPTR DecorUserBuffer;
931 #define SPFLAG_ICONIFIED 1
932 #define SPFLAG_NOICONIFY 2
933 #define SPFLAG_SKININFO 4
934 #define SPFLAG_LAYERREFRESH 8
935 #define SPFLAG_TRANSPHOOK 16
936 #define SPFLAG_LAYERRESIZED 32
937 #define SPFLAG_USERPORT 64
938 #define SPFLAG_IAMDEAD 128
939 #define SPFLAG_CLOSING 256 //used with iamdead
940 #define SPFLAG_WANTBUFFER 512
942 #define HELPF_ISHELPGROUP 1
943 #define HELPF_GADGETHELP 2
945 #define IS_NOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? TRUE : FALSE)
946 #define IS_DOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? FALSE : TRUE )
947 #define IS_SIMPLEREFRESH(win) (((win)->Flags & WFLG_SIMPLE_REFRESH) ? TRUE : FALSE)
948 #define IS_GZZWINDOW(win) (((win)->Flags & WFLG_GIMMEZEROZERO) ? TRUE : FALSE)
951 /* Flag definitions for MoreFlags */
953 #define WMFLG_NOTIFYDEPTH (1 << 0) /* Window wants notification when
954 it's depth arranged */
956 #define WMFLG_DO_UNLOCKPUBSCREEN (1 << 1)
957 #define WMFLG_MENUHELP (1 << 2)
958 #define WMFLG_POINTERDELAY (1 << 3)
959 #define WMFLG_TABLETMESSAGES (1 << 4)
961 // FIXME: ehm... this one should die a horrible death!
962 #define WMFLG_IAMMUI (1 << 5)
964 struct IntScreenBuffer
966 struct ScreenBuffer sb;
967 BOOL free_bitmap;
971 /* Driver prototypes */
973 extern int intui_init (struct IntuitionBase *);
974 extern int intui_open (struct IntuitionBase *);
975 extern void intui_close (struct IntuitionBase *);
976 extern void intui_expunge (struct IntuitionBase *);
977 extern int intui_GetWindowSize (void);
978 extern void intui_WindowLimits (struct Window * window, WORD MinWidth, WORD MinHeight, UWORD MaxWidth, UWORD MaxHeight);
979 extern void intui_ActivateWindow (struct Window *);
980 extern BOOL intui_ChangeWindowBox (struct Window * window, WORD x, WORD y,
981 WORD width, WORD height);
982 extern void intui_CloseWindow (struct Window *, struct IntuitionBase *);
983 extern void intui_MoveWindow (struct Window * window, WORD dx, WORD dy);
984 extern int intui_OpenWindow (struct Window *, struct IntuitionBase *,
985 struct BitMap * SuperBitMap, struct Hook *backfillhook,
986 struct Region * shape, struct Hook * shapehook,
987 struct Layer * parent, ULONG visible);
988 extern void intui_SetWindowTitles (struct Window *, CONST_STRPTR, CONST_STRPTR);
989 extern void intui_RefreshWindowFrame(struct Window *win);
990 extern struct Window *intui_FindActiveWindow(struct InputEvent *ie, struct IntuitionBase *IntuitionBase);
991 extern void intui_ScrollWindowRaster(struct Window * win, WORD dx, WORD dy, WORD xmin,
992 WORD ymin, WORD xmax, WORD ymax,
993 struct IntuitionBase * IntuitionBase);
995 /* wbtasktalk protos */
997 ULONG TellWBTaskToCloseWindows(struct IntuitionBase *IntuitionBase);
998 ULONG TellWBTaskToOpenWindows(struct IntuitionBase *IntuitionBase);
1000 /* intuition_misc protos */
1001 extern void LoadDefaultPreferences(struct IntuitionBase * IntuitionBase);
1002 Object* CreateStdSysImage(WORD which, WORD preferred_height, struct Screen *scr, APTR buffer,
1003 struct DrawInfo *dri, struct IntuitionBase *IntuitionBase);
1004 extern void CheckRectFill(struct RastPort *rp, WORD x1, WORD y1, WORD x2, WORD y2, struct IntuitionBase * IntuitionBase);
1005 extern BOOL CreateWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1006 extern VOID KillWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1007 extern void CreateScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1008 extern void KillScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1009 extern void RenderScreenBar(struct Screen *scr, BOOL refresh, struct IntuitionBase *IntuitionBase);
1010 extern void UpdateMouseCoords(struct Window *win);
1011 extern WORD SubtractRectFromRect(struct Rectangle *a, struct Rectangle *b, struct Rectangle *destrectarray);
1013 AROS_UFP3(BOOL, DefaultWindowShapeFunc,
1014 AROS_UFPA(struct Hook *, hook, A0),
1015 AROS_UFPA(struct Layer *, lay, A2),
1016 AROS_UFPA(struct ShapeHookMsg *, msg, A1));
1018 extern LONG CalcResourceHash(APTR resource);
1019 extern void AddResourceToList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1020 extern void RemoveResourceFromList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1021 extern BOOL ResourceExisting(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1022 void FireScreenNotifyMessage(IPTR data, ULONG flag, struct IntuitionBase *IntuitionBase);
1023 void FireScreenNotifyMessageCode(IPTR data, ULONG flag, ULONG code, struct IntuitionBase *IntuitionBase);
1025 /* misc.c */
1026 extern void MySetPointerPos(struct IntuitionBase *IntuitionBase);
1027 extern BOOL ResetPointer(struct IntuitionBase *IntuitionBase);
1028 extern void ActivateMonitor(Object *newmonitor, WORD x, WORD y, struct IntuitionBase *IntuitionBase);
1029 extern struct Screen *FindFirstScreen(Object *monitor, struct IntuitionBase *IntuitionBase);
1030 extern struct RastPort *MyCreateRastPort(struct IntuitionBase *IntuitionBase);
1031 extern struct RastPort *MyCloneRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1032 extern void MyFreeRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1033 struct TextFont *SafeReopenFont(struct IntuitionBase *, struct TextFont **);
1034 extern Object *MakePointerFromPrefs(struct IntuitionBase *, struct Preferences *);
1035 extern Object *MakePointerFromData(struct IntuitionBase *, UWORD *, int, int, int, int);
1036 void InstallPointer(struct IntuitionBase *, UWORD, Object **, Object *);
1037 void SetPointerColors(struct IntuitionBase *IntuitionBase);
1038 struct IClass *InitITextIClass (struct IntuitionBase * IntuitionBase);
1039 struct Gadget *DoActivateGadget(struct Window *win, struct Requester *req, struct Gadget *gad,
1040 struct IntuitionBase *IntuitionBase);
1041 VOID DoGMLayout(struct Gadget *glist, struct Window *win, struct Requester *req,
1042 UWORD numgad, BOOL initial, struct IntuitionBase *IntuitionBase);
1043 BOOL ih_fire_intuimessage(struct Window * w, ULONG Class, UWORD Code, APTR IAddress,
1044 struct IntuitionBase *IntuitionBase);
1045 void NotifyDepthArrangement(struct Window *w, struct IntuitionBase *IntuitionBase);
1047 /* printitext.c */
1049 void int_PrintIText(struct RastPort * rp, struct IntuiText * iText,
1050 LONG leftOffset, LONG topOffset, BOOL ignore_attributes,
1051 struct IntuitionBase *IntuitionBase);
1053 /* Private extra functions */
1054 OOP_Object *FindMonitor(ULONG modeid, struct IntuitionBase *IntuitionBase);
1056 #ifdef __MORPHOS__
1057 BOOL IsLayerHiddenBySibling(struct Layer *layer, BOOL xx);
1058 LONG IsLayerVisible(struct Layer *layer);
1059 #endif
1061 void SetupGInfo(struct GadgetInfo *gi, struct Window *win, struct Requester *req,
1062 struct Gadget *gad, struct IntuitionBase *IntuitionBase);
1064 IPTR Custom_DoMethodA(struct IntuitionBase *, struct Gadget *, Msg);
1066 #ifdef __MORPHOS__
1067 #ifdef DoMethodA
1068 #undef DoMethodA
1069 #endif
1070 #define DoMethodA(x, ...) (REG_A6=(LONG)IntuitionBase, DoMethodA(x, __VA_ARGS__))
1071 #endif
1073 #define HAS_CHILDREN(w) (NULL != w->firstchild)
1075 #ifdef __MORPHOS__
1076 #define DeinitRastPort(rp) ((void)0)
1077 #endif
1078 #define CreateRastPort() MyCreateRastPort(IntuitionBase)
1079 #define CloneRastPort(rp) MyCloneRastPort(IntuitionBase, rp)
1080 #define FreeRastPort(rp) MyFreeRastPort(IntuitionBase, rp)
1082 /* Replacement for dos.library/DisplayError() */
1083 AROS_UFP3(LONG, Intuition_DisplayError,
1084 AROS_UFPA(STRPTR, formatStr , A0),
1085 AROS_UFPA(ULONG , IDCMPFlags, D0),
1086 AROS_UFPA(APTR , args , A1));
1088 #define POINTERA_SharedPointer 0x80039010
1090 #ifndef __MORPHOS__
1091 #define dprintf kprintf
1092 #endif
1094 #define DEBUG_ACTIVATEGADGET(x) ;
1095 #define DEBUG_ACTIVATEWINDOW(x) ;
1096 #define DEBUG_ADDCLASS(x) ;
1097 #define DEBUG_ADDGADGET(x) ;
1098 #define DEBUG_ADDGLIST(x) ;
1099 #define DEBUG_ALLOCINTUIMESSAGE(x) ;
1100 #define DEBUG_ALLOCSCREENBUFFER(x) ;
1101 #define DEBUG_ALOHAWORKBENCH(x) ;
1102 #define DEBUG_CHANGEWINDOWBOX(x) ;
1103 #define DEBUG_CLOSESCREEN(x) ;
1104 #define DEBUG_CLOSEWINDOW(x) ;
1105 #define DEBUG_CLOSEWORKBENCH(x) ;
1106 #define DEBUG_DISPOSEOBJECT(x) ;
1107 #define DEBUG_DOGADGETMETHOD(x) ;
1108 #define DEBUG_DRAWBORDER(x) ;
1109 #define DEBUG_FINDCLASS(x) ;
1110 #define DEBUG_FREEICDATA(x) ;
1111 #define DEBUG_FREEINTUIMESSAGE(x) ;
1112 #define DEBUG_FREESCREENBUFFER(x) ;
1113 #define DEBUG_FREESCREENDRAWINFO(x) ;
1114 #define DEBUG_GADGETMOUSE(x) ;
1115 #define DEBUG_GETATTR(x) ;
1116 #define DEBUG_GETDEFAULTPUBSCREEN(x) ;
1117 #define DEBUG_GETDEFPREFS(x) ;
1118 #define DEBUG_GETGADGETIBOX(x) ;
1119 #define DEBUG_GETPREFS(x) ;
1120 #define DEBUG_GETSCREENDATA(x) ;
1121 #define DEBUG_GETSCREENDRAWINFO(x) ;
1122 #define DEBUG_HIDEWINDOW(x) ;
1123 #define DEBUG_OPEN(x) ;
1124 #define DEBUG_CLOSE(x) ;
1125 #define DEBUG_INPUTEVENT(x) ;
1126 #define DEBUG_INTREFRESHGLIST(x) ;
1127 #define DEBUG_INTUITEXTLENGTH(x) ;
1128 #define DEBUG_LENDMENUS(x) ;
1129 #define DEBUG_LOCKPUBSCREEN(x) ;
1130 #define DEBUG_MAKECLASS(x) ;
1131 #define DEBUG_MODIFYIDCMP(x) ;
1132 #define DEBUG_NEWOBJECT(x) ;
1133 #define DEBUG_NEXTOBJECT(x) ;
1134 #define DEBUG_OBTAINGIRPORT(x) ;
1135 #define DEBUG_OFFGADGET(x) ;
1136 #define DEBUG_OFFMENU(x) ;
1137 #define DEBUG_ONGADGET(x) ;
1138 #define DEBUG_ONMENU(x) ;
1139 #define DEBUG_OPENSCREEN(x) ;
1140 #define DEBUG_OPENSCREENTAGLIST(x) ;
1141 #define DEBUG_OPENWINDOW(x) ;
1142 #define DEBUG_OPENWINDOWTAGLIST(x) ;
1143 #define DEBUG_OPENWORKBENCH(x) ;
1144 #define DEBUG_POINTER(x) ;
1145 #define DEBUG_PRINTITEXT(x) ;
1146 #define DEBUG_QUERYOVERSCAN(x) ;
1147 #define DEBUG_REFRESH(x) ;
1148 #define DEBUG_RELEASEGIRPORT(x) ;
1149 #define DEBUG_REMEMBER(x) ;
1150 #define DEBUG_REMOVEGLIST(x) ;
1151 #define DEBUG_REPORTMOUSE(x) ;
1152 #define DEBUG_REQUEST(x) ;
1153 #define DEBUG_SCROLLWINDOWRASTER(x) ;
1154 #define DEBUG_SENDINTUIMESSAGE(x) ;
1155 #define DEBUG_SETATTRS(x) ;
1156 #define DEBUG_SETGADGETATTRS(x) ;
1157 #define DEBUG_SETPOINTER(x) ;
1158 #define DEBUG_SHOWWINDOW(x) ;
1159 #define DEBUG_UNLOCKPUBSCREEN(x) ;
1160 #define DEBUG_WINDOWLIMITS(x) ;
1161 #define DEBUG_WINDOWTOBACK(x) ;
1162 #define DEBUG_WINDOWTOFRONT(x) ;
1163 #define DEBUG_ZIPWINDOW(x) ;
1164 #define DEBUG_VISITOR(x) ;
1165 #define DEBUG_WORKBENCH(x) ;
1166 #define DEBUG_LOCKPUBSCREENLIST(x) ;
1167 #define DEBUG_UNLOCKPUBSCREENLIST(x) ;
1168 #define DEBUG_RETHINKDISPLAY(x) ;
1170 #ifdef NO_RUNTIME_DEBUG
1172 #define DEBUG_INIT(x) ;
1173 #define DEBUG_SETIPREFS(x) ;
1174 #define DEBUG_SETPREFS(x) ;
1176 #else
1178 #define DEBUG_INIT(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1179 #define DEBUG_SETIPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1180 #define DEBUG_SETPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1182 #endif
1185 * Private data structures of the classes defined by intuition.library
1188 /* ICClass */
1189 struct ICData
1191 Object *ic_Target;
1192 struct TagItem *ic_Mapping;
1193 struct TagItem *ic_CloneTags;
1194 ULONG ic_LoopCounter;
1197 /* ModelClass */
1198 struct ModelData
1200 struct MinList memberlist;
1203 /* FrameIClass */
1204 struct FrameIData
1206 /* render bevel only with no fill? */
1207 BOOL fid_EdgesOnly;
1209 /* inverted bevel pens? */
1210 BOOL fid_Recessed;
1212 /* frame style? */
1213 WORD fid_FrameType;
1215 WORD fid_HOffset;
1216 WORD fid_VOffset;
1219 /* SysIClass */
1220 struct SysIData
1222 struct DrawInfo *dri;
1223 struct Image *frame;
1224 APTR userbuffer;
1225 ULONG type;
1226 UWORD flags;
1229 /* FillRectClass */
1230 struct FillRectData
1232 WORD apatsize;
1233 WORD mode;
1236 /* GadgetClass */
1237 struct GadgetData
1239 struct ExtGadget EG;
1240 struct ICData IC;
1243 /* PropGClass */
1244 struct PropGData
1246 /* We use a propinfo structure, because we use the same routines
1247 for intuition propgadtets and in propgclass */
1249 struct PropInfo propinfo;
1251 /* A little kludge: since the HandleMouseMove function
1252 wants dx/dy and not absolute mouse coords, we
1253 have to remember the last ones */
1255 UWORD last_x;
1256 UWORD last_y;
1258 /* One only have to store total or visble, and use some other
1259 formulas than those in the RKRM:L, but for
1260 code simplicity I store them all. */
1261 UWORD top, visible, total;
1263 UWORD flags;
1264 struct BBox *old_knobbox;
1265 struct Hook *DisplayHook;
1268 /* StrGClass */
1269 struct StrGData
1271 struct StringInfo StrInfo;
1272 struct StringExtend StrExtend;
1273 UBYTE Flags;
1276 /* GroupGClass */
1277 struct GroupGData
1279 struct MinList memberlist;
1280 struct Gadget *activegad;
1283 /* DragBarClass */
1284 struct dragbar_data
1286 /* Current left- and topedge of moving window. Ie when the user releases
1287 the LMB after a windowdrag, the window's new coords will be (curleft, curtop)
1290 LONG curleft;
1291 LONG curtop;
1293 /* The current x and y coordinates relative to curleft/curtop */
1294 LONG mousex;
1295 LONG mousey;
1297 /* Whether the dragframe is currently drawn or erased */
1298 BOOL isrendered;
1300 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1301 BOOL drag_canceled;
1303 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1304 BOOL drag_layerlock;
1305 #ifdef USEGADGETLOCK
1306 BOOL drag_gadgetlock;
1307 BOOL drag_inputhandlerlock;
1308 #endif
1309 BOOL drag_refreshed;
1311 /* Rastport to use during update */
1312 struct RastPort *rp;
1314 UQUAD lasteventtime;
1316 LONG startleft;
1317 LONG starttop;
1319 #ifdef USEWINDOWLOCK
1320 /* used to prevent windows from opening/closing while user drags a window */
1321 BOOL drag_windowlock;
1322 #endif
1324 struct Task *movetask;
1328 /* SizeButtonClass */
1329 struct sizebutton_data
1332 /* The current width and height of the rubber band frame */
1333 ULONG width;
1334 ULONG height;
1335 ULONG top;
1336 ULONG left;
1338 /* holds original sizes */
1339 ULONG Width;
1340 ULONG Height;
1341 ULONG TopEdge;
1342 ULONG LeftEdge;
1344 /* the offset of the mouse pointer to the rubber band frame*/
1345 LONG mouseoffsetx;
1346 LONG mouseoffsety;
1348 /* Whether the dragframe is currently drawn or erased */
1349 BOOL isrendered;
1351 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1352 BOOL drag_canceled;
1354 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1355 BOOL drag_layerlock;
1356 #ifdef USEGADGETLOCK
1357 BOOL drag_gadgetlock;
1358 BOOL drag_inputhandlerlock;
1359 #endif
1361 BOOL drag_refreshed;
1363 /* Rastport to use during update */
1364 struct RastPort *rp;
1366 UQUAD lasteventtime;
1368 #ifdef USEWINDOWLOCK
1369 /* used to prevent windows from opening/closing while user drags a window */
1370 BOOL drag_windowlock;
1371 #endif
1373 #ifdef SKINS
1374 ULONG drag_type;
1375 #endif
1377 ULONG drag_ticks;
1381 /* MenuBarLabelClass */
1382 struct MenuBarLabelData
1384 struct DrawInfo *dri;
1387 /* PointerClass */
1388 struct PointerData
1390 struct SharedPointer *shared_pointer;
1393 /* WinDecorClass */
1394 struct windecor_data
1396 ULONG userbuffersize;
1399 /* ScrDecorClass */
1400 struct scrdecor_data
1402 ULONG userbuffersize;
1405 /* MenuDecorClass */
1406 struct menudecor_data
1408 ULONG userbuffersize;
1411 #endif /* INTUITION_INTERN_H */