Made pointer data arguments of SetPointer() and MakePointerFromData() const.
[AROS.git] / rom / intuition / intuition_intern.h
blob4dcd7212247b764972ced7d288ac593b67171899
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-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_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"
91 #ifdef SKINS
92 #include "intuition_customize.h"
93 #include "intuition_internmos.h"
94 #include "intuition_extend.h"
95 #endif
97 #include "requesters.h"
99 /* Needed for aros_print_not_implemented macro */
100 #include <aros/debug.h>
102 #include <aros/asmcall.h>
104 #if DEBUG_ASSERTS
105 #define ASSERT_VALID_PTR_ROMOK(ptr) \
106 do { \
107 if (!((IPTR)ptr & 1)) { \
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; \
117 bug("[intuition] Invalid pointer value %p at %s, line %u\n", ptr, __FILE__, __LINE__); \
118 } while(0);
119 #else
120 #define ASSERT_VALID_PTR_ROMOK(ptr)
121 #endif
123 // FIXME: seems only used for RefreshWindowTitles() ? -> better names
124 // FIXME: what are the correct values?
125 #define NO_DOUBLEBUFFER (0)
126 #define DOUBLEBUFFER (1)
128 /* features */
129 #ifdef __MORPHOS__
130 # define USE_OPAQUESIZE 1
131 #else
132 # define USE_OPAQUESIZE 0
133 #endif
135 /* This definition turns on compatibility mode where sprite colors
136 are allocated on hi- and truecolor screens also. This may be needed
137 if some software relies on this allocation. AROS itself currently does
138 not need this.
139 #define ALWAYS_ALLOCATE_SPRITE_COLORS */
141 #ifdef __MORPHOS__
142 void dprintf(char *, ...) __attribute__ ((format (printf, 1, 2)));
143 void * memclr(APTR, ULONG);
144 #endif
146 #ifdef __MORPHOS__
147 void * memclr(APTR, ULONG);
148 #define bzero(a,b) memclr(a,b)
149 #else /* __MORPHOS__ */
150 #define memclr(a,b) bzero(a,b)
151 #endif /* __MORPHOS__ */
154 * min()/max() without macro side effects.
156 #define max(a,b) \
157 ({typeof(a) _a = (a); \
158 typeof(b) _b = (b); \
159 _a > _b ? _a : _b;})
161 #define min(a,b) \
162 ({typeof(a) _a = (a); \
163 typeof(b) _b = (b); \
164 _a > _b ? _b : _a;})
166 #define EXTENDWORD(x) x = (LONG)((WORD)x);
167 #define EXTENDUWORD(x) x = (ULONG)((UWORD)x);
169 /* SANITY CHECK MACRO */
170 //#define DEBUG_SANITYCHECK
172 #ifdef DEBUG_SANITYCHECK
173 #define SANITY_CHECK(x) if (!((IPTR)x)) {dprintf("Losing sanity in %s line %d\n",__FILE__,__LINE__); return;};
174 #define SANITY_CHECKR(x,v) if (!((IPTR)x)) {dprintf("Losing sanity in %s line %d\n",__FILE__,__LINE__); return v;};
175 #else
176 #define SANITY_CHECK(x) if (!((IPTR)x)) return;
177 #define SANITY_CHECKR(x,v) if (!((IPTR)x)) return v;
178 #endif
180 /* Options */
182 #define MENUS_BACKFILL TRUE
184 #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)
191 #define AVOID_WINBORDERERASE(base) \
192 (GetPrivIBase(base)->IControlPrefs.ic_Flags & ICF_AVOIDWINBORDERERASE)
194 /* --- Values --- */
195 /* TRUE, FALSE */
197 #define FRAME_SIZE(base) (GetPrivIBase(base)->FrameSize)
198 /* --- Values --- */
199 #define FRAMESIZE_THIN 0 /* 1:1 thin */
200 #define FRAMESIZE_MEDRES 1 /* 2:1 medres like AmigaOS */
201 #define FRAMESIZE_THICK 2 /* 1:1 thick */
203 #define SQUARE_WIN_GADGETS 1
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 #ifdef SKINS
213 //#define USEGETIPREFS
214 #endif
216 /* simpleref layers have gadgets redrawn when app calls beginrefresh() */
217 //#define BEGINUPDATEGADGETREFRESH
218 //#define DAMAGECACHE
220 #define USEWINDOWLOCK
221 #ifdef USEWINDOWLOCK
222 #define LOCKWINDOW(base) ObtainSemaphore(&GetPrivIBase(base)->WindowLock);
223 #define UNLOCKWINDOW(base) ReleaseSemaphore(&GetPrivIBase(base)->WindowLock);
224 #else
225 #define LOCKWINDOW(base)
226 #define UNLOCKWINDOW(base)
227 #endif
228 /* jDc: do NOT disable this! */
230 #define USEGADGETLOCK
231 #ifdef USEGADGETLOCK
232 #define LOCKGADGET(base) ObtainSemaphore(&GetPrivIBase(base)->GadgetLock);
233 #define UNLOCKGADGET(base) ReleaseSemaphore(&GetPrivIBase(base)->GadgetLock);
234 #define LOCKWINDOWLAYERS(w) ;
235 #define UNLOCKWINDOWLAYERS(w) ;
236 #else
237 #define LOCKGADGET
238 #define UNLOCKGADGET
239 #define LOCKWINDOWLAYERS(w) LockLayerInfo(&w->WScreen->LayerInfo); \
240 if (((struct IntWindow *)(w))->borderlayer) {LockLayer(0,((struct IntWindow *)(w))->borderlayer);}; \
241 if (((struct IntWindow *)(w))->wlayer) {LockLayer(0,((struct IntWindow *)(w))->wlayer);};
242 #define UNLOCKWINDOWLAYERS(w) if (((struct IntWindow *)(w))->wlayer) {UnlockLayer(((struct IntWindow *)(w))->wlayer);}; \
243 if (((struct IntWindow *)(w))->borderlayer) {UnlockLayer(((struct IntWindow *)(w))->borderlayer);} \
244 UnlockLayerInfo(&w->WScreen->LayerInfo);
245 #endif
247 #define WLAYER(w) (((struct IntWindow *)(w))->wlayer)
248 #define BLAYER(w) (((struct IntWindow *)(w))->borderlayer)
250 //#define TIMEVALWINDOWACTIVATION
252 /* If PROP_RENDER_OPTIMIZATION is set to 1, propgadget code tries to optimize rendering
253 during prop gadget knob movement. Only area of the propgadget that is affected by
254 prop gadget knob movement is re-rendered.
256 Unfortunately this can fail with some programs, like DOpus 4.x text viewer */
258 #define PROP_RENDER_OPTIMIZATION 0
260 #define SINGLE_SETPOINTERPOS_PER_EVENTLOOP 1
262 #ifndef LIFLG_SUPPORTS_OFFSCREEN_LAYERS
263 /* Defined in <graphics/layers.h>, but apparently not on MorphOS. */
264 # define LIFLG_SUPPORTS_OFFSCREEN_LAYERS 2
265 #endif
267 #define INTUITIONNAME "intuition.library"
268 #define MENUBARLABELCLASS "menubarlabelclass"
270 #define DEFPUBSCREEN TRUE
272 #define USE_NEWDISPLAYBEEP 1
274 #define TITLEBUFFERLEN 255
276 #define USE_IDCMPUPDATE_MESSAGECACHE 0
278 #ifdef __MORPHOS__
279 #if INCLUDE_VERSION < 50
281 /********************************************************************************/
282 /* imageclass.h AROS extensions */
284 #define SYSIA_WithBorder IA_FGPen /* default: TRUE */
285 #define SYSIA_Style IA_BGPen /* default: SYSISTYLE_NORMAL */
287 #define SYSISTYLE_NORMAL 0
288 #define SYSISTYLE_GADTOOLS 1 /* to get arrow images in gadtools look */
290 /********************************************************************************/
291 /* gadgetclass.h AROS extenstions */
293 /* This method is invoked to learn about the sizing requirements of your class,
294 before an object is created. This is AROS specific. */
295 #define GM_DOMAIN 7
296 struct gpDomain
298 STACKED ULONG MethodID; /* GM_DOMAIN */
299 STACKED struct GadgetInfo *gpd_GInfo; /* see <intuition/cghooks.h> */
300 STACKED struct RastPort *gpd_RPort; /* RastPort to calculate dimensions for. */
301 STACKED LONG gpd_Which; /* see below */
302 STACKED struct IBox gpd_Domain; /* Resulting domain. */
303 STACKED struct TagItem *gpd_Attrs; /* Additional attributes. None defined,
304 yet. */
307 /********************************************************************************/
309 /* gpd_Which */
310 #define GDOMAIN_MINIMUM 0 /* Calculate minimum size. */
311 #define GDOMAIN_NOMINAL 1 /* Calculate nominal size. */
312 #define GDOMAIN_MAXIMUM 2 /* Calculate maximum size. */
314 #endif /* INCLUDE_VERSION < 50 */
315 #endif /* ifdef __MORPHOS__ */
317 /********************************************************************************/
318 #define GM_MOVETEST 8
319 /* this method is used by our draggad to tell if it's OK to move the mouse when window
320 is near screen boundaries and offscreen is disabled. msg = gpInput*/
321 //retvals are:
322 #define MOVETEST_MOVE 0
323 #define MOVETEST_ADJUSTPOS 1
325 /* ObtainGIRPort must install a 0 clipregion and
326 set scrollx/scrolly of layer to 0. Since this
327 will be restored only when ReleaseGIRPort is
328 called, we must backup the orig values somewhere */
330 struct LayerContext
332 struct Region *clipregion;
333 WORD scroll_x;
334 WORD scroll_y;
335 WORD nestcount;
339 /* Preferences */
341 #define IP_OLDFONT 2
342 #define IP_OLDOVERSCAN 3
343 #define IP_OLDICONTROL 4
344 #define IP_OLDPOINTER 7
345 #define IP_OLDPALETTE 8
346 #define IP_OLDPENS 9
348 #define IP_SCREENMODE 1
349 #define IP_FONT 101//2
350 #define IP_ICONTROL 102//4
351 #define IP_POINTER 103//7
352 #define IP_PTRCOLOR 104//8
353 #define IP_PALETTE 105
354 #define IP_IACTIONS 20
355 #define IP_IEXTENSIONS 21
356 #define IP_INPUTEXT 22
358 #ifdef __MORPHOS__
360 struct IScreenModePrefs
362 ULONG smp_DisplayID;
363 UWORD smp_Width;
364 UWORD smp_Height;
365 UWORD smp_Depth;
366 UWORD smp_Control;
369 struct IIControlPrefs
371 UWORD ic_TimeOut;
372 WORD ic_MetaDrag;
373 ULONG ic_Flags;
374 UBYTE ic_WBtoFront;
375 UBYTE ic_FrontToBack;
376 UBYTE ic_ReqTrue;
377 UBYTE ic_ReqFalse;
380 #else
382 #include <intuition/iprefs.h>
384 #endif
386 struct Color32
388 ULONG red;
389 ULONG green;
390 ULONG blue;
393 #define COLORTABLEENTRIES 11
395 struct IntScreen;
397 #ifdef __mc68000
398 #define RESOURCELIST_HASHSIZE 32 /* Smaller hash for memory limited m68k */
399 #else
400 #define RESOURCELIST_HASHSIZE 256
401 #endif
403 #define RESOURCE_WINDOW 1
404 #define RESOURCE_SCREEN 2
406 struct HashNode
408 struct MinNode node;
409 UWORD type;
410 APTR resource;
413 /* Internal Screen Notification Data */
414 struct IntScreenNotify
416 struct Node node;
417 struct MsgPort *port;
418 struct Task *sigtask;
419 struct Hook *hook;
420 ULONG flags;
421 IPTR userdata;
422 char *pubname;
423 BYTE sigbit;
426 /* IntuitionBase */
427 struct IntIntuitionBase
429 struct IntuitionBase IBase;
430 #ifdef __MORPHOS__
431 WORD _MinXMouse,_MaxXMouse; /* Old 1.3 Base entries*/
432 WORD _MinYMouse,_MaxYMouse; /* Old 1.3 Base entries*/
433 ULONG _StartSecs,_StartMicros; /* Old 1.3 Base entries*/
434 char *SystemRequestTitle; /* written by locale as it seems..what a crappy interface*/
435 char *WorkbenchTitle; /* written by locale as it seems..what a crappy interface*/
438 * safety pad for intuitionbase accesses
439 * probably needs to be smarter
441 UBYTE Pad[0x800];
442 #endif
444 /* Put local shit here, invisible for the user */
445 #ifdef __MORPHOS__
446 struct Library *MUIMasterBase;
447 #endif
449 struct DosLibrary *DOSBase;
450 struct LayersBase *LayersBase;
451 struct Library *UtilityBase;
452 struct GfxBase *GfxBase;
453 struct Library *OOPBase;
454 struct Library *KeymapBase;
456 struct Library *InputBase;
457 struct Library *TimerBase;
458 struct MsgPort *TimerMP;
459 struct timerequest *TimerIO;
461 struct MsgPort *WorkBenchMP;
462 struct Screen *WorkBench;
463 struct SignalSemaphore *IBaseLock;
465 /* Intuition input handlers replyport. This one is set
466 int rom/inputhandler.c/InitIIH()
468 struct MsgPort *IntuiReplyPort;
469 struct MinList *IntuiActionQueue;
470 struct IOStdReq *InputIO;
471 struct MsgPort *InputMP;
473 /* Intuition Screennotify Replyport if SNOTIFY_WAIT_REPLY is specified */
475 struct MsgPort *ScreenNotifyReplyPort;
477 BOOL InputDeviceOpen;
478 struct Interrupt *InputHandler;
480 struct Hook *GlobalEditHook;
481 /* The default global edit hook */
482 struct Hook DefaultEditHook;
484 struct Screen *DefaultPubScreen;
485 struct SignalSemaphore PubScrListLock;
486 struct MinList PubScreenList;
487 UWORD pubScrGlobalMode;
489 struct SignalSemaphore ScreenNotificationListLock;
490 struct List ScreenNotificationList;
492 struct SignalSemaphore GadgetLock;
493 struct SignalSemaphore MenuLock;
494 struct SignalSemaphore WindowLock;
495 struct SignalSemaphore IntuiActionLock;
496 struct SignalSemaphore InputHandlerLock;
497 struct LayerContext BackupLayerContext;
499 struct IClass *dragbarclass;
500 struct IClass *sizebuttonclass;
502 APTR *mosmenuclass;
504 struct Preferences *DefaultPreferences;
505 struct Preferences *ActivePreferences;
507 struct MsgPort *MenuHandlerPort;
508 BOOL MenusActive;
510 struct TextFont *ScreenFont;
511 struct TextFont *TopazFont;
513 /* Dos function DisplayError() before intuition.library patched it */
514 APTR OldDisplayErrorFunc;
516 struct SignalSemaphore ClassListLock;
517 struct MinList ClassList;
518 struct IClass RootClass;
520 #ifdef __MORPHOS__
521 struct ViewExtra *ViewLordExtra;
522 LONG SpriteNum;
523 #else
524 BOOL ViewLord_ok;
525 #endif
527 #ifdef SKINS
528 ULONG *SmallMenuPool;
529 #endif
530 ULONG *IDCMPPool;
532 struct IScreenModePrefs ScreenModePrefs;
533 struct IIControlPrefs IControlPrefs;
534 #ifdef SKINS
535 struct IAction *IControlActions;
536 struct IControlExtensions IControlExtensions;
537 ULONG NumIControlActions;
538 struct InputPrefsExt InputPrefsExt;
539 #endif
540 struct IClass *pointerclass;
541 Object *DefaultPointer;
542 Object *BusyPointer;
543 UWORD DriPens2[NUMDRIPENS];
544 UWORD DriPens4[NUMDRIPENS];
545 UWORD DriPens8[NUMDRIPENS];
546 struct Color32 Colors[COLORTABLEENTRIES];
547 UWORD PointerAlpha;
548 ULONG DMStartSecs;
549 ULONG DMStartMicro;
550 struct IntScreen *MenuVerifyScreen;
551 ULONG PointerDelay;
553 #ifdef SKINS
554 struct SignalSemaphore DataTypesSem;
555 struct Library *DataTypesBase; /* should be opened ONLY by int_InitCustomChanges!*/
556 #endif
558 ULONG LastClickSecs;
559 ULONG LastClickMicro; /* for doubleclick to front */
560 ULONG LastMenuDownSecs;
561 ULONG LastMenuDownMicro; /* for auto sticky/non-sticky menus */
562 ULONG DoubleClickCounter;
563 ULONG DoubleClickButton;
565 #ifdef SKINS
566 struct Hook transphook; /* hook for windows with intui transp */
567 struct Hook notransphook; /* hook for windows with no additional transp (borderless,etc) */
568 #endif
569 #ifdef INTUITION_NOTIFY_SUPPORT
570 struct Library *ScreenNotifyBase;
571 struct Library *NotifyIntuitionBase;
572 #endif
574 struct RastPort DoGadgetMethodRP;
575 struct GadgetInfo DoGadgetMethodGI;
577 struct SignalSemaphore ScrDecorSem;
578 struct IClass *ScrDecorClass;
579 struct TagItem *ScrDecorTags;
580 struct SignalSemaphore MenuDecorSem;
581 struct IClass *MenuDecorClass;
582 struct TagItem *MenuDecorTags;
583 struct SignalSemaphore WinDecorSem;
584 struct IClass *WinDecorClass;
585 struct TagItem *WinDecorTags;
587 struct List Decorations;
588 struct NewDecorator *Decorator;
590 #ifdef USEGETIPREFS
591 BOOL IPrefsLoaded;
592 #endif
594 #if USE_NEWDISPLAYBEEP
595 LONG BeepingScreens;
596 #endif
598 WORD prop_clickoffset_x, prop_clickoffset_y;
600 struct MinList ResourceList[RESOURCELIST_HASHSIZE];
602 /* Menu Look Settings */
603 int FrameSize;
605 Object *ActiveMonitor;
606 Object *NewMonitor;
608 OOP_AttrBase HiddAttrBase;
609 OOP_AttrBase HiddGfxAttrBase;
610 OOP_AttrBase HiddPixFmtAttrBase;
612 OOP_MethodID ib_HiddGfxBase;
613 OOP_MethodID ib_HiddBitMapBase;
615 struct IClass *monitorclass;
616 struct MinList MonitorList;
617 struct SignalSemaphore MonitorListSem;
619 struct Interrupt ShutdownHandler;
622 struct SharedPointer
624 struct ExtSprite *sprite;
625 WORD xoffset, yoffset;
626 int ref_count;
629 struct SharedPointer *CreateSharedPointer(struct ExtSprite *, int, int, struct IntuitionBase *);
630 void ObtainSharedPointer(struct SharedPointer *, struct IntuitionBase *);
631 void ReleaseSharedPointer(struct SharedPointer *, struct IntuitionBase *);
633 #ifdef INTUITION_NOTIFY_SUPPORT
634 void sn_DoNotify(ULONG type, APTR value, struct Library *_ScreenNotifyBase);
635 #endif
637 struct IntDrawInfo
639 struct DrawInfo dri;
640 struct Screen *dri_Screen;
641 struct SignalSemaphore dri_WinDecorSem;
642 Object *dri_WinDecorObj;
643 struct SignalSemaphore dri_ScrDecorSem;
644 Object *dri_ScrDecorObj;
647 #define DRI_VERSION_AROS (DRI_VERSION + 1)
649 #define LOCK_WINDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
650 #define LOCKSHARED_WINDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
651 #define UNLOCK_WINDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
653 #define LOCK_SCRDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
654 #define LOCKSHARED_SCRDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
655 #define UNLOCK_SCRDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
657 #define LOCK_MENUDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
658 #define LOCKSHARED_MENUDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
659 #define UNLOCK_MENUDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
661 struct IntScreen
663 struct Screen Screen;
665 /* Private fields */
666 struct HashNode hashnode;
667 struct IntDrawInfo DInfo;
668 struct TTextAttr textattr;
669 ULONG textattrtags[3];
670 UWORD Pens[NUMDRIPENS];
671 struct PubScreenNode *pubScrNode;
672 Object *depthgadget;
673 UWORD SpecialFlags;
674 struct Layer *rootLayer;
675 #if !USE_NEWDISPLAYBEEP
676 ULONG DisplayBeepColor0[3];
677 struct Window *DisplayBeepWindow;
678 #endif
679 #ifdef __MORPHOS__
680 ULONG ModeID;
681 struct MonitorSpec *Monitor;
682 #endif
683 Object *MonitorObject;
684 struct SharedPointer *Pointer;
685 struct Window *MenuVerifyActiveWindow;
686 int MenuVerifyTimeOut;
687 int MenuVerifyMsgCount;
688 ULONG MenuVerifySeconds;
689 ULONG MenuVerifyMicros;
690 ULONG DecorUserBufferSize;
691 IPTR DecorUserBuffer;
692 Object *ScrDecorObj;
693 Object *MenuDecorObj;
694 Object *WinDecorObj;
695 struct NewDecorator *Decorator;
697 struct BitMap *AllocatedBitmap;
698 #ifdef SKINS
699 WORD LastClockPos;
700 WORD LastClockWidth;
701 #else
702 ULONG Reserved;
703 #endif
704 #ifdef SKINS
705 struct SkinInfo SkinInfo;
706 struct RastPort *TitlebarBufferRP;
707 struct Window *TitlebarBufferWin;
708 ULONG TitlebarWinWidth;
709 ULONG TitlebarWinActive;
710 #endif
711 #if USE_NEWDISPLAYBEEP
712 UBYTE BeepingCounter;
713 #endif
716 #define GetPrivScreen(s) ((struct IntScreen *)s)
718 /* SpecialFlags */
719 #define SF_IsParent (0x0001)
720 #define SF_IsChild (0x0002)
721 #define SF_InvisibleBar (0x0004)
722 #define SF_AppearingBar (0x0008)
723 #define SF_SysFont (0x0010)
724 #define SF_Draggable (0x0020) /* Screen can be dragged */
725 #define SF_ComposeAbove (0x0100) /* Composition capabilities */
726 #define SF_ComposeBelow (0x0200)
727 #define SF_ComposeLeft (0x0400)
728 #define SF_ComposeRight (0x0800)
730 #define SF_VertCompose (SF_ComposeAbove|SF_ComposeBelow)
731 #define SF_HorCompose (SF_ComposeLeft |SF_ComposeRight)
732 #define SF_Compose (SF_ComposeAbove|SF_ComposeBelow|SF_ComposeLeft|SF_ComposeRight)
734 struct IntIntuiMessage
736 struct ExtIntuiMessage eimsg;
739 ** The following field is needed, because in case of IDCMP_RAWKEY
740 ** IntuiMessage->IAddress is a pointer to this data, not the data
741 ** itself (which is the case for IDCMP_VANILLAKEY)
744 APTR prevCodeQuals;
747 #define INT_INTUIMESSAGE(x) ((struct IntIntuiMessage *)(x))
751 /*extern struct IntuitionBase * IntuitionBase;*/
753 #define IW(window) ((struct IntWindow *) (window))
755 #define GetPubIBase(ib) ((struct IntuitionBase *)ib)
756 #define GetPrivIBase(ib) ((struct IntIntuitionBase *)ib)
758 /* FIXME: Remove these #define xxxBase hacks
759 Do not use this in new code !
761 #ifdef __MORPHOS__
762 #ifdef MUIMasterBase
763 #undef MUIMasterBase
764 #define MUIMasterBase (GetPrivIBase(IntuitionBase)->MUIMasterBase)
765 #endif
766 #endif
768 /* struct Utilitybase is used in the following file so include it
769 before defining Utilitybase
771 #include <proto/utility.h>
773 /* stegerg: one can have sysgadgets outside of window border! All sysgadgets in window
774 border must have set GACT_???BORDER and, if they are in a gzz window, also
775 GTYP_GZZGADGET */
777 #define IS_GZZ_GADGET(gad) (((gad)->GadgetType) & GTYP_GZZGADGET)
779 #define IS_BORDER_GADGET(gad) (IS_GZZ_GADGET(gad) || \
780 ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER)))
782 #define IS_SYS_GADGET(gad) (((gad)->GadgetType) & GTYP_SYSTYPEMASK)
784 #define IS_BOOPSI_GADGET(gad) (((gad)->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET)
786 /*#define IS_BORDER_GADGET(gad) \
787 (((gad->GadgetType) & GTYP_SYSGADGET) \
788 || ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER))) */
790 #define IS_REQ_GADGET(gad) ((gad)->GadgetType & GTYP_REQGADGET)
792 #define IS_SCREEN_GADGET(gad) ((gad)->GadgetType & GTYP_SCRGADGET)
794 #define SET_GI_RPORT(gi, w, req, gad) \
795 (gi)->gi_RastPort = (IS_SCREEN_GADGET(gad) ? \
796 ((gi)->gi_Screen->BarLayer ? (gi)->gi_Screen->BarLayer->rp : NULL) : \
797 (IS_BORDER_GADGET(gad) ? (w)->BorderRPort : \
798 ((req) ? ((req)->ReqLayer->rp) : (w)->RPort)) \
802 #define REFRESHGAD_BOOPSI 1 /* boopsi gadgets */
803 #define REFRESHGAD_BORDER 2 /* gadgets in window border */
804 #define REFRESHGAD_REL 4 /* gadgets with GFLG_RELRIGHT, GFLG_RELBOTTOM,GFLG_RELWIDTH, GFLG_RELHEIGHT */
805 #define REFRESHGAD_RELS 8 /* GFLG_RELSPECIAL gadgets */
806 #define REFRESHGAD_TOPBORDER 16 /* used by setwindowtitle */
807 #define REFRESHGAD_NOGADTOOLS 32 /* used in some cases for _mustbe_ */
809 #define SYSGADGET_ACTIVE (iihdata->ActiveSysGadget != NULL)
811 VOID int_refreshglist(struct Gadget *gadgets, struct Window *window,
812 struct Requester *requester, LONG numGad, LONG mustbe, LONG mustnotbe,
813 struct IntuitionBase *IntuitionBase);
815 VOID int_RefreshWindowFrame(struct Window *window, LONG mustbe, LONG mustnotbe,
816 LONG mode,
817 struct IntuitionBase *IntuitionBase);
819 #define int_refreshwindowframe(a,b,c,d) int_RefreshWindowFrame(a,b,c,0,d);
821 /* Keep the system gadgets in the same order than the original intuition,
822 * some programs make bad asumptions about that...
824 enum
826 DEPTHGAD,
827 ZOOMGAD,
828 SIZEGAD,
829 CLOSEGAD,
830 ICONIFYGAD,
831 LOCKGAD,
832 MUIGAD,
833 POPUPGAD,
834 SNAPSHOTGAD,
835 JUMPGAD,
836 DRAGBAR,
837 NUM_SYSGADS
840 #define SYSGAD(w, idx) (((struct IntWindow *)(w))->sysgads[idx])
842 struct IntWindow
844 struct Window window;
846 Object *sysgads[NUM_SYSGADS];
847 struct Image *AmigaKey;
848 struct Image *Checkmark;
849 struct Image *SubMenuImage;
850 struct Window *menulendwindow;
852 struct HashNode hashnode;
854 /* When the Zoom gadget is pressed the window will have the
855 dimensions stored here. The old dimensions are backed up here
856 again. */
857 WORD ZipLeftEdge;
858 WORD ZipTopEdge;
859 WORD ZipWidth;
860 WORD ZipHeight;
862 /* max. number of mousemove events to send to this window */
863 WORD mousequeue;
865 /* act. number of mousemove events sent to this window */
866 WORD num_mouseevents;
868 /* max. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
869 messages to send to this window */
870 WORD repeatqueue;
872 /* act. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
873 messages sent to this window */
874 WORD num_repeatevents;
876 #if USE_IDCMPUPDATE_MESSAGECACHE
877 /* number of unreplied IDCMP_IDCMPUPDATE messages sent to window
878 used in few hacks :) */
879 WORD num_idcmpupdate;
880 #endif
882 WORD sizeimage_width;
883 WORD sizeimage_height;
885 ULONG helpflags;
886 ULONG helpgroup;
888 Object *pointer;
889 BOOL busy;
890 BOOL free_pointer;
891 UWORD pointer_delay;
892 ULONG extrabuttons;
893 ULONG extrabuttonsid; /* replaces ETI_Dummy if apps wishes it */
894 #ifdef SKINS
895 ULONG titlepos; /* used by titlebar pattern fill stuff */
896 #else
897 ULONG reserved1;
898 #endif
899 ULONG specialflags;
901 #ifdef SKINS
902 struct Region *transpregion;
903 struct Hook *usertransphook;
904 struct Region *usertranspregion;
905 #endif
907 #ifdef DAMAGECACHE
908 struct Region *trashregion;
909 #endif
910 char titlebuffer[TITLEBUFFERLEN+1];
912 #if USE_IDCMPUPDATE_MESSAGECACHE
913 struct IntuiMessage *messagecache; //for idcmpupdate cache
914 #endif
916 struct Layer *wlayer;
917 struct Layer *borderlayer;
919 struct timeval lastmsgsent;
920 struct timeval lastmsgreplied;
922 #ifdef TIMEVALWINDOWACTIVATION
923 struct timeval activationtime;
924 #endif
926 #ifdef SKINS
927 struct Hook custombackfill;
928 struct HookData hd;
929 #endif
930 struct Hook DefaultWindowShapeHook;
931 BOOL CustomShape;
932 struct Region *OutlineShape;
933 ULONG DecorUserBufferSize;
934 IPTR DecorUserBuffer;
937 #define SPFLAG_ICONIFIED 1
938 #define SPFLAG_NOICONIFY 2
939 #define SPFLAG_SKININFO 4
940 #define SPFLAG_LAYERREFRESH 8
941 #define SPFLAG_TRANSPHOOK 16
942 #define SPFLAG_LAYERRESIZED 32
943 #define SPFLAG_USERPORT 64
944 #define SPFLAG_IAMDEAD 128
945 #define SPFLAG_CLOSING 256 //used with iamdead
946 #define SPFLAG_WANTBUFFER 512
948 #define HELPF_ISHELPGROUP 1
949 #define HELPF_GADGETHELP 2
951 #define IS_NOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? TRUE : FALSE)
952 #define IS_DOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? FALSE : TRUE )
953 #define IS_SIMPLEREFRESH(win) (((win)->Flags & WFLG_SIMPLE_REFRESH) ? TRUE : FALSE)
954 #define IS_GZZWINDOW(win) (((win)->Flags & WFLG_GIMMEZEROZERO) ? TRUE : FALSE)
957 /* Flag definitions for MoreFlags */
959 #define WMFLG_NOTIFYDEPTH (1 << 0) /* Window wants notification when
960 it's depth arranged */
962 #define WMFLG_DO_UNLOCKPUBSCREEN (1 << 1)
963 #define WMFLG_MENUHELP (1 << 2)
964 #define WMFLG_POINTERDELAY (1 << 3)
965 #define WMFLG_TABLETMESSAGES (1 << 4)
967 // FIXME: ehm... this one should die a horrible death!
968 #define WMFLG_IAMMUI (1 << 5)
970 struct IntScreenBuffer
972 struct ScreenBuffer sb;
973 BOOL free_bitmap;
977 /* Driver prototypes */
979 extern int intui_init (struct IntuitionBase *);
980 extern int intui_open (struct IntuitionBase *);
981 extern void intui_close (struct IntuitionBase *);
982 extern void intui_expunge (struct IntuitionBase *);
983 extern int intui_GetWindowSize (void);
984 extern void intui_WindowLimits (struct Window * window, WORD MinWidth, WORD MinHeight, UWORD MaxWidth, UWORD MaxHeight);
985 extern void intui_ActivateWindow (struct Window *);
986 extern BOOL intui_ChangeWindowBox (struct Window * window, WORD x, WORD y,
987 WORD width, WORD height);
988 extern void intui_CloseWindow (struct Window *, struct IntuitionBase *);
989 extern void intui_MoveWindow (struct Window * window, WORD dx, WORD dy);
990 extern int intui_OpenWindow (struct Window *, struct IntuitionBase *,
991 struct BitMap * SuperBitMap, struct Hook *backfillhook,
992 struct Region * shape, struct Hook * shapehook,
993 struct Layer * parent, ULONG visible);
994 extern void intui_SetWindowTitles (struct Window *, CONST_STRPTR, CONST_STRPTR);
995 extern void intui_RefreshWindowFrame(struct Window *win);
996 extern struct Window *intui_FindActiveWindow(struct InputEvent *ie, struct IntuitionBase *IntuitionBase);
997 extern void intui_ScrollWindowRaster(struct Window * win, WORD dx, WORD dy, WORD xmin,
998 WORD ymin, WORD xmax, WORD ymax,
999 struct IntuitionBase * IntuitionBase);
1001 /* wbtasktalk protos */
1003 ULONG TellWBTaskToCloseWindows(struct IntuitionBase *IntuitionBase);
1004 ULONG TellWBTaskToOpenWindows(struct IntuitionBase *IntuitionBase);
1006 /* intuition_misc protos */
1007 extern void LoadDefaultPreferences(struct IntuitionBase * IntuitionBase);
1008 Object* CreateStdSysImage(WORD which, WORD preferred_height, struct Screen *scr, APTR buffer,
1009 struct DrawInfo *dri, struct IntuitionBase *IntuitionBase);
1010 extern void CheckRectFill(struct RastPort *rp, WORD x1, WORD y1, WORD x2, WORD y2, struct IntuitionBase * IntuitionBase);
1011 extern BOOL CreateWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1012 extern VOID KillWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1013 extern void CreateScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1014 extern void KillScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1015 extern void RenderScreenBar(struct Screen *scr, BOOL refresh, struct IntuitionBase *IntuitionBase);
1016 extern void UpdateMouseCoords(struct Window *win);
1017 extern WORD SubtractRectFromRect(struct Rectangle *a, struct Rectangle *b, struct Rectangle *destrectarray);
1019 AROS_UFP3(BOOL, DefaultWindowShapeFunc,
1020 AROS_UFPA(struct Hook *, hook, A0),
1021 AROS_UFPA(struct Layer *, lay, A2),
1022 AROS_UFPA(struct ShapeHookMsg *, msg, A1));
1024 extern LONG CalcResourceHash(APTR resource);
1025 extern void AddResourceToList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1026 extern void RemoveResourceFromList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1027 extern BOOL ResourceExisting(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1028 void FireScreenNotifyMessage(IPTR data, ULONG flag, struct IntuitionBase *IntuitionBase);
1029 void FireScreenNotifyMessageCode(IPTR data, ULONG flag, ULONG code, struct IntuitionBase *IntuitionBase);
1031 /* misc.c */
1032 extern void MySetPointerPos(struct IntuitionBase *IntuitionBase);
1033 extern BOOL ResetPointer(struct IntuitionBase *IntuitionBase);
1034 extern void ActivateMonitor(Object *newmonitor, WORD x, WORD y, struct IntuitionBase *IntuitionBase);
1035 extern struct Screen *FindFirstScreen(Object *monitor, struct IntuitionBase *IntuitionBase);
1036 extern struct RastPort *MyCreateRastPort(struct IntuitionBase *IntuitionBase);
1037 extern struct RastPort *MyCloneRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1038 extern void MyFreeRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1039 struct TextFont *SafeReopenFont(struct IntuitionBase *, struct TextFont **);
1040 extern Object *MakePointerFromPrefs(struct IntuitionBase *, struct Preferences *);
1041 extern Object *MakePointerFromData(struct IntuitionBase *, const UWORD *, int, int, int, int);
1042 void InstallPointer(struct IntuitionBase *, UWORD, Object **, Object *);
1043 void SetPointerColors(struct IntuitionBase *IntuitionBase);
1044 struct IClass *InitITextIClass (struct IntuitionBase * IntuitionBase);
1045 struct Gadget *DoActivateGadget(struct Window *win, struct Requester *req, struct Gadget *gad,
1046 struct IntuitionBase *IntuitionBase);
1047 VOID DoGMLayout(struct Gadget *glist, struct Window *win, struct Requester *req,
1048 UWORD numgad, BOOL initial, struct IntuitionBase *IntuitionBase);
1049 BOOL ih_fire_intuimessage(struct Window * w, ULONG Class, UWORD Code, APTR IAddress,
1050 struct IntuitionBase *IntuitionBase);
1051 void NotifyDepthArrangement(struct Window *w, struct IntuitionBase *IntuitionBase);
1053 /* printitext.c */
1055 void int_PrintIText(struct RastPort * rp, struct IntuiText * iText,
1056 LONG leftOffset, LONG topOffset, BOOL ignore_attributes,
1057 struct IntuitionBase *IntuitionBase);
1059 /* Private extra functions */
1060 OOP_Object *FindMonitor(ULONG modeid, struct IntuitionBase *IntuitionBase);
1061 AROS_INTP(ShutdownScreenHandler);
1063 #ifdef __MORPHOS__
1064 BOOL IsLayerHiddenBySibling(struct Layer *layer, BOOL xx);
1065 LONG IsLayerVisible(struct Layer *layer);
1066 #endif
1068 void SetupGInfo(struct GadgetInfo *gi, struct Window *win, struct Requester *req,
1069 struct Gadget *gad, struct IntuitionBase *IntuitionBase);
1071 IPTR Custom_DoMethodA(struct IntuitionBase *, struct Gadget *, Msg);
1073 #ifdef __MORPHOS__
1074 #ifdef DoMethodA
1075 #undef DoMethodA
1076 #endif
1077 #define DoMethodA(x, ...) (REG_A6=(LONG)IntuitionBase, DoMethodA(x, __VA_ARGS__))
1078 #endif
1080 #define HAS_CHILDREN(w) (NULL != w->firstchild)
1082 #ifdef __MORPHOS__
1083 #define DeinitRastPort(rp) ((void)0)
1084 #endif
1085 #define CreateRastPort() MyCreateRastPort(IntuitionBase)
1086 #define CloneRastPort(rp) MyCloneRastPort(IntuitionBase, rp)
1087 #define FreeRastPort(rp) MyFreeRastPort(IntuitionBase, rp)
1089 /* Replacement for dos.library/DisplayError() */
1090 AROS_UFP3(LONG, Intuition_DisplayError,
1091 AROS_UFPA(STRPTR, formatStr , A0),
1092 AROS_UFPA(ULONG , IDCMPFlags, D0),
1093 AROS_UFPA(APTR , args , A1));
1095 #define POINTERA_SharedPointer 0x80039010
1097 #ifndef __MORPHOS__
1098 #define dprintf kprintf
1099 #endif
1101 #define DEBUG_ACTIVATEGADGET(x) ;
1102 #define DEBUG_ACTIVATEWINDOW(x) ;
1103 #define DEBUG_ADDCLASS(x) ;
1104 #define DEBUG_ADDGADGET(x) ;
1105 #define DEBUG_ADDGLIST(x) ;
1106 #define DEBUG_ALLOCINTUIMESSAGE(x) ;
1107 #define DEBUG_ALLOCSCREENBUFFER(x) ;
1108 #define DEBUG_ALOHAWORKBENCH(x) ;
1109 #define DEBUG_CHANGEWINDOWBOX(x) ;
1110 #define DEBUG_CLOSESCREEN(x) ;
1111 #define DEBUG_CLOSEWINDOW(x) ;
1112 #define DEBUG_CLOSEWORKBENCH(x) ;
1113 #define DEBUG_DISPOSEOBJECT(x) ;
1114 #define DEBUG_DOGADGETMETHOD(x) ;
1115 #define DEBUG_DRAWBORDER(x) ;
1116 #define DEBUG_FINDCLASS(x) ;
1117 #define DEBUG_FREEICDATA(x) ;
1118 #define DEBUG_FREEINTUIMESSAGE(x) ;
1119 #define DEBUG_FREESCREENBUFFER(x) ;
1120 #define DEBUG_FREESCREENDRAWINFO(x) ;
1121 #define DEBUG_GADGETMOUSE(x) ;
1122 #define DEBUG_GETATTR(x) ;
1123 #define DEBUG_GETDEFAULTPUBSCREEN(x) ;
1124 #define DEBUG_GETDEFPREFS(x) ;
1125 #define DEBUG_GETGADGETIBOX(x) ;
1126 #define DEBUG_GETPREFS(x) ;
1127 #define DEBUG_GETSCREENDATA(x) ;
1128 #define DEBUG_GETSCREENDRAWINFO(x) ;
1129 #define DEBUG_HIDEWINDOW(x) ;
1130 #define DEBUG_OPEN(x) ;
1131 #define DEBUG_CLOSE(x) ;
1132 #define DEBUG_INPUTEVENT(x) ;
1133 #define DEBUG_INTREFRESHGLIST(x) ;
1134 #define DEBUG_INTUITEXTLENGTH(x) ;
1135 #define DEBUG_LENDMENUS(x) ;
1136 #define DEBUG_LOCKPUBSCREEN(x) ;
1137 #define DEBUG_MAKECLASS(x) ;
1138 #define DEBUG_MODIFYIDCMP(x) ;
1139 #define DEBUG_NEWOBJECT(x) ;
1140 #define DEBUG_NEXTOBJECT(x) ;
1141 #define DEBUG_OBTAINGIRPORT(x) ;
1142 #define DEBUG_OFFGADGET(x) ;
1143 #define DEBUG_OFFMENU(x) ;
1144 #define DEBUG_ONGADGET(x) ;
1145 #define DEBUG_ONMENU(x) ;
1146 #define DEBUG_OPENSCREEN(x) ;
1147 #define DEBUG_OPENSCREENTAGLIST(x) ;
1148 #define DEBUG_OPENWINDOW(x) ;
1149 #define DEBUG_OPENWINDOWTAGLIST(x) ;
1150 #define DEBUG_OPENWORKBENCH(x) ;
1151 #define DEBUG_POINTER(x) ;
1152 #define DEBUG_PRINTITEXT(x) ;
1153 #define DEBUG_QUERYOVERSCAN(x) ;
1154 #define DEBUG_REFRESH(x) ;
1155 #define DEBUG_RELEASEGIRPORT(x) ;
1156 #define DEBUG_REMEMBER(x) ;
1157 #define DEBUG_REMOVEGLIST(x) ;
1158 #define DEBUG_REPORTMOUSE(x) ;
1159 #define DEBUG_REQUEST(x) ;
1160 #define DEBUG_SCROLLWINDOWRASTER(x) ;
1161 #define DEBUG_SENDINTUIMESSAGE(x) ;
1162 #define DEBUG_SETATTRS(x) ;
1163 #define DEBUG_SETGADGETATTRS(x) ;
1164 #define DEBUG_SETPOINTER(x) ;
1165 #define DEBUG_SHOWWINDOW(x) ;
1166 #define DEBUG_UNLOCKPUBSCREEN(x) ;
1167 #define DEBUG_WINDOWLIMITS(x) ;
1168 #define DEBUG_WINDOWTOBACK(x) ;
1169 #define DEBUG_WINDOWTOFRONT(x) ;
1170 #define DEBUG_ZIPWINDOW(x) ;
1171 #define DEBUG_VISITOR(x) ;
1172 #define DEBUG_WORKBENCH(x) ;
1173 #define DEBUG_LOCKPUBSCREENLIST(x) ;
1174 #define DEBUG_UNLOCKPUBSCREENLIST(x) ;
1175 #define DEBUG_RETHINKDISPLAY(x) ;
1177 #ifdef NO_RUNTIME_DEBUG
1179 #define DEBUG_INIT(x) ;
1180 #define DEBUG_SETIPREFS(x) ;
1181 #define DEBUG_SETPREFS(x) ;
1183 #else
1185 #define DEBUG_INIT(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1186 #define DEBUG_SETIPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1187 #define DEBUG_SETPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1189 #endif
1192 * Private data structures of the classes defined by intuition.library
1195 /* ICClass */
1196 struct ICData
1198 Object *ic_Target;
1199 struct TagItem *ic_Mapping;
1200 struct TagItem *ic_CloneTags;
1201 ULONG ic_LoopCounter;
1204 /* ModelClass */
1205 struct ModelData
1207 struct MinList memberlist;
1210 /* FrameIClass */
1211 struct FrameIData
1213 /* render bevel only with no fill? */
1214 BOOL fid_EdgesOnly;
1216 /* inverted bevel pens? */
1217 BOOL fid_Recessed;
1219 /* frame style? */
1220 WORD fid_FrameType;
1222 WORD fid_HOffset;
1223 WORD fid_VOffset;
1226 /* SysIClass */
1227 struct SysIData
1229 struct DrawInfo *dri;
1230 struct Image *frame;
1231 APTR userbuffer;
1232 ULONG type;
1233 UWORD flags;
1236 /* FillRectClass */
1237 struct FillRectData
1239 WORD apatsize;
1240 WORD mode;
1243 /* GadgetClass */
1244 struct GadgetData
1246 struct ExtGadget EG;
1247 struct ICData IC;
1250 /* PropGClass */
1251 struct PropGData
1253 /* We use a propinfo structure, because we use the same routines
1254 for intuition propgadtets and in propgclass */
1256 struct PropInfo propinfo;
1258 /* A little kludge: since the HandleMouseMove function
1259 wants dx/dy and not absolute mouse coords, we
1260 have to remember the last ones */
1262 UWORD last_x;
1263 UWORD last_y;
1265 /* One only have to store total or visble, and use some other
1266 formulas than those in the RKRM:L, but for
1267 code simplicity I store them all. */
1268 UWORD top, visible, total;
1270 UWORD flags;
1271 struct BBox *old_knobbox;
1272 struct Hook *DisplayHook;
1275 /* StrGClass */
1276 struct StrGData
1278 struct StringInfo StrInfo;
1279 struct StringExtend StrExtend;
1280 UBYTE Flags;
1283 /* GroupGClass */
1284 struct GroupGData
1286 struct MinList memberlist;
1287 struct Gadget *activegad;
1290 /* DragBarClass */
1291 struct dragbar_data
1293 /* Current left- and topedge of moving window. Ie when the user releases
1294 the LMB after a windowdrag, the window's new coords will be (curleft, curtop)
1297 LONG curleft;
1298 LONG curtop;
1300 /* The current x and y coordinates relative to curleft/curtop */
1301 LONG mousex;
1302 LONG mousey;
1304 /* Whether the dragframe is currently drawn or erased */
1305 BOOL isrendered;
1307 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1308 BOOL drag_canceled;
1310 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1311 BOOL drag_layerlock;
1312 #ifdef USEGADGETLOCK
1313 BOOL drag_gadgetlock;
1314 BOOL drag_inputhandlerlock;
1315 #endif
1316 BOOL drag_refreshed;
1318 /* Rastport to use during update */
1319 struct RastPort *rp;
1321 UQUAD lasteventtime;
1323 LONG startleft;
1324 LONG starttop;
1326 #ifdef USEWINDOWLOCK
1327 /* used to prevent windows from opening/closing while user drags a window */
1328 BOOL drag_windowlock;
1329 #endif
1331 struct Task *movetask;
1335 /* SizeButtonClass */
1336 struct sizebutton_data
1339 /* The current width and height of the rubber band frame */
1340 ULONG width;
1341 ULONG height;
1342 ULONG top;
1343 ULONG left;
1345 /* holds original sizes */
1346 ULONG Width;
1347 ULONG Height;
1348 ULONG TopEdge;
1349 ULONG LeftEdge;
1351 /* the offset of the mouse pointer to the rubber band frame*/
1352 LONG mouseoffsetx;
1353 LONG mouseoffsety;
1355 /* Whether the dragframe is currently drawn or erased */
1356 BOOL isrendered;
1358 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1359 BOOL drag_canceled;
1361 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1362 BOOL drag_layerlock;
1363 #ifdef USEGADGETLOCK
1364 BOOL drag_gadgetlock;
1365 BOOL drag_inputhandlerlock;
1366 #endif
1368 BOOL drag_refreshed;
1370 /* Rastport to use during update */
1371 struct RastPort *rp;
1373 UQUAD lasteventtime;
1375 #ifdef USEWINDOWLOCK
1376 /* used to prevent windows from opening/closing while user drags a window */
1377 BOOL drag_windowlock;
1378 #endif
1380 #ifdef SKINS
1381 ULONG drag_type;
1382 #endif
1384 ULONG drag_ticks;
1388 /* MenuBarLabelClass */
1389 struct MenuBarLabelData
1391 struct DrawInfo *dri;
1394 /* PointerClass */
1395 struct PointerData
1397 struct SharedPointer *shared_pointer;
1400 /* WinDecorClass */
1401 struct windecor_data
1403 ULONG userbuffersize;
1406 /* ScrDecorClass */
1407 struct scrdecor_data
1409 ULONG userbuffersize;
1412 /* MenuDecorClass */
1413 struct menudecor_data
1415 ULONG userbuffersize;
1418 #endif /* INTUITION_INTERN_H */