Tested and debugged ToolTypes.
[AROS.git] / rom / intuition / intuition_intern.h
bloba02fbd2463220ca8a3503fce0bca007e92e93feb
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 ((GetPrivIBase(IntuitionBase)->IControlPrefs.ic_Flags & ICF_3DMENUS) == 0)
182 /* --- Values --- */
183 #define MENULOOK_3D 0
184 #define MENULOOK_CLASSIC 1
186 #define MENUS_UNDERMOUSE (GetPrivIBase(IntuitionBase)->IControlPrefs.ic_Flags & ICF_POPUPMENUS)
188 #define AVOID_WINBORDERERASE (GetPrivIBase(IntuitionBase)->IControlPrefs.ic_Flags & ICF_AVOIDWINBORDERERASE)
190 /* --- Values --- */
191 /* TRUE, FALSE */
193 #define FRAME_SIZE (GetPrivIBase(IntuitionBase)->FrameSize)
194 /* --- Values --- */
195 #define FRAMESIZE_THIN 0 /* 1:1 thin */
196 #define FRAMESIZE_MEDRES 1 /* 2:1 medres like AmigaOS */
197 #define FRAMESIZE_THICK 2 /* 1:1 thick */
199 #define SQUARE_WIN_GADGETS 1
201 #ifdef __AROS__
202 /* FIXME: possibly enable this, once gadtools has been updated */
203 #else
204 #define GADTOOLSCOMPATIBLE
205 //enables some gadtools-weirdo-code, MUST be set in both gadtools & intui to work!!!
206 #endif
208 #ifdef SKINS
209 //#define USEGETIPREFS
210 #endif
212 /* simpleref layers have gadgets redrawn when app calls beginrefresh() */
213 //#define BEGINUPDATEGADGETREFRESH
214 //#define DAMAGECACHE
216 #define USEWINDOWLOCK
217 #ifdef USEWINDOWLOCK
218 #define LOCKWINDOW ObtainSemaphore(&GetPrivIBase(IntuitionBase)->WindowLock);
219 #define UNLOCKWINDOW ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->WindowLock);
220 #else
221 #define LOCKWINDOW
222 #define UNLOCKWINDOW
223 #endif
224 /* jDc: do NOT disable this! */
226 #define USEGADGETLOCK
227 #ifdef USEGADGETLOCK
228 #define LOCKGADGET ObtainSemaphore(&GetPrivIBase(IntuitionBase)->GadgetLock);
229 #define UNLOCKGADGET ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->GadgetLock);
230 #define LOCKWINDOWLAYERS(w) ;
231 #define UNLOCKWINDOWLAYERS(w) ;
232 #else
233 #define LOCKGADGET
234 #define UNLOCKGADGET
235 #define LOCKWINDOWLAYERS(w) LockLayerInfo(&w->WScreen->LayerInfo); \
236 if (((struct IntWindow *)(w))->borderlayer) {LockLayer(0,((struct IntWindow *)(w))->borderlayer);}; \
237 if (((struct IntWindow *)(w))->wlayer) {LockLayer(0,((struct IntWindow *)(w))->wlayer);};
238 #define UNLOCKWINDOWLAYERS(w) if (((struct IntWindow *)(w))->wlayer) {UnlockLayer(((struct IntWindow *)(w))->wlayer);}; \
239 if (((struct IntWindow *)(w))->borderlayer) {UnlockLayer(((struct IntWindow *)(w))->borderlayer);} \
240 UnlockLayerInfo(&w->WScreen->LayerInfo);
241 #endif
243 #define WLAYER(w) (((struct IntWindow *)(w))->wlayer)
244 #define BLAYER(w) (((struct IntWindow *)(w))->borderlayer)
246 //#define TIMEVALWINDOWACTIVATION
248 /* If PROP_RENDER_OPTIMIZATION is set to 1, propgadget code tries to optimize rendering
249 during prop gadget knob movement. Only area of the propgadget that is affected by
250 prop gadget knob movement is re-rendered.
252 Unfortunately this can fail with some programs, like DOpus 4.x text viewer */
254 #define PROP_RENDER_OPTIMIZATION 0
256 #define SINGLE_SETPOINTERPOS_PER_EVENTLOOP 1
258 #ifndef LIFLG_SUPPORTS_OFFSCREEN_LAYERS
259 /* Defined in <graphics/layers.h>, but apparently not on MorphOS. */
260 # define LIFLG_SUPPORTS_OFFSCREEN_LAYERS 2
261 #endif
263 #define INTUITIONNAME "intuition.library"
264 #define MENUBARLABELCLASS "menubarlabelclass"
266 #define DEFPUBSCREEN TRUE
268 #define USE_NEWDISPLAYBEEP 1
270 #define TITLEBUFFERLEN 255
272 #define USE_IDCMPUPDATE_MESSAGECACHE 0
274 #ifdef __MORPHOS__
275 #if INCLUDE_VERSION < 50
277 /********************************************************************************/
278 /* imageclass.h AROS extensions */
280 #define SYSIA_WithBorder IA_FGPen /* default: TRUE */
281 #define SYSIA_Style IA_BGPen /* default: SYSISTYLE_NORMAL */
283 #define SYSISTYLE_NORMAL 0
284 #define SYSISTYLE_GADTOOLS 1 /* to get arrow images in gadtools look */
286 /********************************************************************************/
287 /* gadgetclass.h AROS extenstions */
289 /* This method is invoked to learn about the sizing requirements of your class,
290 before an object is created. This is AROS specific. */
291 #define GM_DOMAIN 7
292 struct gpDomain
294 STACKED ULONG MethodID; /* GM_DOMAIN */
295 STACKED struct GadgetInfo *gpd_GInfo; /* see <intuition/cghooks.h> */
296 STACKED struct RastPort *gpd_RPort; /* RastPort to calculate dimensions for. */
297 STACKED LONG gpd_Which; /* see below */
298 STACKED struct IBox gpd_Domain; /* Resulting domain. */
299 STACKED struct TagItem *gpd_Attrs; /* Additional attributes. None defined,
300 yet. */
303 /********************************************************************************/
305 /* gpd_Which */
306 #define GDOMAIN_MINIMUM 0 /* Calculate minimum size. */
307 #define GDOMAIN_NOMINAL 1 /* Calculate nominal size. */
308 #define GDOMAIN_MAXIMUM 2 /* Calculate maximum size. */
310 #endif /* INCLUDE_VERSION < 50 */
311 #endif /* ifdef __MORPHOS__ */
313 /********************************************************************************/
314 #define GM_MOVETEST 8
315 /* this method is used by our draggad to tell if it's OK to move the mouse when window
316 is near screen boundaries and offscreen is disabled. msg = gpInput*/
317 //retvals are:
318 #define MOVETEST_MOVE 0
319 #define MOVETEST_ADJUSTPOS 1
321 /* ObtainGIRPort must install a 0 clipregion and
322 set scrollx/scrolly of layer to 0. Since this
323 will be restored only when ReleaseGIRPort is
324 called, we must backup the orig values somewhere */
326 struct LayerContext
328 struct Region *clipregion;
329 WORD scroll_x;
330 WORD scroll_y;
331 WORD nestcount;
335 /* Preferences */
337 #define IP_OLDFONT 2
338 #define IP_OLDOVERSCAN 3
339 #define IP_OLDICONTROL 4
340 #define IP_OLDPOINTER 7
341 #define IP_OLDPALETTE 8
342 #define IP_OLDPENS 9
344 #define IP_SCREENMODE 1
345 #define IP_FONT 101//2
346 #define IP_ICONTROL 102//4
347 #define IP_POINTER 103//7
348 #define IP_PTRCOLOR 104//8
349 #define IP_PALETTE 105
350 #define IP_IACTIONS 20
351 #define IP_IEXTENSIONS 21
352 #define IP_INPUTEXT 22
354 #ifdef __MORPHOS__
356 struct IScreenModePrefs
358 ULONG smp_DisplayID;
359 UWORD smp_Width;
360 UWORD smp_Height;
361 UWORD smp_Depth;
362 UWORD smp_Control;
365 struct IIControlPrefs
367 UWORD ic_TimeOut;
368 WORD ic_MetaDrag;
369 ULONG ic_Flags;
370 UBYTE ic_WBtoFront;
371 UBYTE ic_FrontToBack;
372 UBYTE ic_ReqTrue;
373 UBYTE ic_ReqFalse;
376 #else
378 #include <intuition/iprefs.h>
380 #endif
382 struct Color32
384 ULONG red;
385 ULONG green;
386 ULONG blue;
389 #define COLORTABLEENTRIES 11
391 struct IntScreen;
393 #ifdef __mc68000
394 #define RESOURCELIST_HASHSIZE 32 /* Smaller hash for memory limited m68k */
395 #else
396 #define RESOURCELIST_HASHSIZE 256
397 #endif
399 #define RESOURCE_WINDOW 1
400 #define RESOURCE_SCREEN 2
402 struct HashNode
404 struct MinNode node;
405 UWORD type;
406 APTR resource;
409 /* Internal Screen Notification Data */
410 struct IntScreenNotify
412 struct Node node;
413 struct MsgPort *port;
414 struct Task *sigtask;
415 struct Hook *hook;
416 ULONG flags;
417 IPTR userdata;
418 char *pubname;
419 BYTE sigbit;
422 /* IntuitionBase */
423 struct IntIntuitionBase
425 struct IntuitionBase IBase;
426 #ifdef __MORPHOS__
427 WORD _MinXMouse,_MaxXMouse; /* Old 1.3 Base entries*/
428 WORD _MinYMouse,_MaxYMouse; /* Old 1.3 Base entries*/
429 ULONG _StartSecs,_StartMicros; /* Old 1.3 Base entries*/
430 char *SystemRequestTitle; /* written by locale as it seems..what a crappy interface*/
431 char *WorkbenchTitle; /* written by locale as it seems..what a crappy interface*/
434 * savety pad for intuitionbase accesses
435 * probably needs to be smarter
437 UBYTE Pad[0x800];
438 #endif
440 /* Put local shit here, invisible for the user */
441 #ifdef __MORPHOS__
442 struct Library *MUIMasterBase;
443 #endif
445 struct LayersBase *LayersBase;
446 struct Library *UtilityBase;
447 struct GfxBase *GfxBase;
448 struct Library *OOPBase;
449 struct Library *KeymapBase;
451 struct Library *InputBase;
452 struct Library *TimerBase;
453 struct MsgPort *TimerMP;
454 struct timerequest *TimerIO;
456 struct MsgPort *WorkBenchMP;
457 struct Screen *WorkBench;
458 struct SignalSemaphore *IBaseLock;
460 /* Intuition input handlers replyport. This one is set
461 int rom/inputhandler.c/InitIIH()
463 struct MsgPort *IntuiReplyPort;
464 struct MinList *IntuiActionQueue;
465 struct IOStdReq *InputIO;
466 struct MsgPort *InputMP;
468 /* Intuition Screennotify Replyport if SNOTIFY_WAIT_REPLY is specified */
470 struct MsgPort *ScreenNotifyReplyPort;
472 BOOL InputDeviceOpen;
473 struct Interrupt *InputHandler;
475 struct Hook *GlobalEditHook;
476 /* The default global edit hook */
477 struct Hook DefaultEditHook;
479 struct Screen *DefaultPubScreen;
480 struct SignalSemaphore PubScrListLock;
481 struct MinList PubScreenList;
482 UWORD pubScrGlobalMode;
484 struct SignalSemaphore ScreenNotificationListLock;
485 struct List ScreenNotificationList;
487 struct SignalSemaphore GadgetLock;
488 struct SignalSemaphore MenuLock;
489 struct SignalSemaphore WindowLock;
490 struct SignalSemaphore IntuiActionLock;
491 struct SignalSemaphore InputHandlerLock;
492 struct LayerContext BackupLayerContext;
494 struct IClass *dragbarclass;
495 struct IClass *sizebuttonclass;
497 APTR *mosmenuclass;
499 struct Preferences *DefaultPreferences;
500 struct Preferences *ActivePreferences;
502 struct MsgPort *MenuHandlerPort;
503 BOOL MenusActive;
505 struct TextFont *ScreenFont;
506 struct TextFont *TopazFont;
508 /* Dos function DisplayError() before intuition.library patched it */
509 APTR OldDisplayErrorFunc;
511 struct SignalSemaphore ClassListLock;
512 struct MinList ClassList;
513 struct IClass RootClass;
515 #ifdef __MORPHOS__
516 struct ViewExtra *ViewLordExtra;
517 LONG SpriteNum;
518 #else
519 BOOL ViewLord_ok;
520 #endif
522 #ifdef SKINS
523 ULONG *SmallMenuPool;
524 #endif
525 ULONG *IDCMPPool;
527 struct IScreenModePrefs ScreenModePrefs;
528 struct IIControlPrefs IControlPrefs;
529 #ifdef SKINS
530 struct IAction *IControlActions;
531 struct IControlExtensions IControlExtensions;
532 ULONG NumIControlActions;
533 struct InputPrefsExt InputPrefsExt;
534 #endif
535 struct IClass *pointerclass;
536 Object *DefaultPointer;
537 Object *BusyPointer;
538 UWORD DriPens2[NUMDRIPENS];
539 UWORD DriPens4[NUMDRIPENS];
540 UWORD DriPens8[NUMDRIPENS];
541 struct Color32 Colors[COLORTABLEENTRIES];
542 UWORD PointerAlpha;
543 ULONG DMStartSecs;
544 ULONG DMStartMicro;
545 struct IntScreen *MenuVerifyScreen;
546 ULONG PointerDelay;
548 #ifdef SKINS
549 struct SignalSemaphore DataTypesSem;
550 struct Library *DataTypesBase; /* should be opened ONLY by int_InitCustomChanges!*/
551 #endif
553 ULONG LastClickSecs;
554 ULONG LastClickMicro; /* for doubleclick to front */
555 ULONG DoubleClickCounter;
556 ULONG DoubleClickButton;
558 #ifdef SKINS
559 struct Hook transphook; /* hook for windows with intui transp */
560 struct Hook notransphook; /* hook for windows with no additional transp (borderless,etc) */
561 #endif
562 #ifdef INTUITION_NOTIFY_SUPPORT
563 struct Library *ScreenNotifyBase;
564 struct Library *NotifyIntuitionBase;
565 #endif
567 struct RastPort DoGadgetMethodRP;
568 struct GadgetInfo DoGadgetMethodGI;
570 struct SignalSemaphore WinDecorSem;
571 Object *WinDecorObj;
572 struct SignalSemaphore ScrDecorSem;
573 Object *ScrDecorObj;
574 struct SignalSemaphore MenuDecorSem;
575 Object *MenuDecorObj;
577 Object *DefWinDecorObj;
578 Object *DefScrDecorObj;
579 Object *DefMenuDecorObj;
581 struct List Decorations;
582 struct NewDecorator *Decorator;
584 #ifdef USEGETIPREFS
585 BOOL IPrefsLoaded;
586 #endif
588 #if USE_NEWDISPLAYBEEP
589 LONG BeepingScreens;
590 #endif
592 WORD prop_clickoffset_x, prop_clickoffset_y;
594 struct MinList ResourceList[RESOURCELIST_HASHSIZE];
596 /* Menu Look Settings */
597 int FrameSize;
599 Object *ActiveMonitor;
600 Object *NewMonitor;
602 OOP_AttrBase HiddAttrBase;
603 OOP_AttrBase HiddGfxAttrBase;
604 OOP_AttrBase HiddPixFmtAttrBase;
605 struct IClass *monitorclass;
606 struct MinList MonitorList;
607 struct SignalSemaphore MonitorListSem;
610 struct SharedPointer
612 struct ExtSprite *sprite;
613 WORD xoffset, yoffset;
614 int ref_count;
617 struct SharedPointer *CreateSharedPointer(struct ExtSprite *, int, int, struct IntuitionBase *);
618 void ObtainSharedPointer(struct SharedPointer *, struct IntuitionBase *);
619 void ReleaseSharedPointer(struct SharedPointer *, struct IntuitionBase *);
621 #ifdef INTUITION_NOTIFY_SUPPORT
622 void sn_DoNotify(ULONG type, APTR value, struct Library *_ScreenNotifyBase);
623 #endif
625 struct IntDrawInfo
627 struct DrawInfo dri;
628 struct Screen *dri_Screen;
629 struct SignalSemaphore dri_WinDecorSem;
630 Object *dri_WinDecorObj;
631 struct SignalSemaphore dri_ScrDecorSem;
632 Object *dri_ScrDecorObj;
635 #define DRI_VERSION_AROS (DRI_VERSION + 1)
637 #define LOCK_WINDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
638 #define LOCKSHARED_WINDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
639 #define UNLOCK_WINDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
641 #define LOCK_SCRDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
642 #define LOCKSHARED_SCRDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
643 #define UNLOCK_SCRDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
645 #define LOCK_MENUDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
646 #define LOCKSHARED_MENUDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
647 #define UNLOCK_MENUDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
649 struct IntScreen
651 struct Screen Screen;
653 /* Private fields */
654 struct HashNode hashnode;
655 struct IntDrawInfo DInfo;
656 struct TTextAttr textattr;
657 ULONG textattrtags[3];
658 UWORD Pens[NUMDRIPENS];
659 struct PubScreenNode *pubScrNode;
660 Object *depthgadget;
661 UWORD SpecialFlags;
662 struct Layer *rootLayer;
663 #if !USE_NEWDISPLAYBEEP
664 ULONG DisplayBeepColor0[3];
665 struct Window *DisplayBeepWindow;
666 #endif
667 #ifdef __MORPHOS__
668 ULONG ModeID;
669 struct MonitorSpec *Monitor;
670 #endif
671 Object *MonitorObject;
672 struct SharedPointer *Pointer;
673 struct Window *MenuVerifyActiveWindow;
674 int MenuVerifyTimeOut;
675 int MenuVerifyMsgCount;
676 ULONG MenuVerifySeconds;
677 ULONG MenuVerifyMicros;
678 ULONG DecorUserBufferSize;
679 IPTR DecorUserBuffer;
680 Object *WinDecorObj;
681 Object *ScrDecorObj;
682 Object *MenuDecorObj;
683 struct NewDecorator *Decorator;
685 struct BitMap *AllocatedBitmap;
687 STRPTR ID;
688 #ifdef SKINS
689 WORD LastClockPos;
690 WORD LastClockWidth;
691 #else
692 ULONG Reserved;
693 #endif
694 #ifdef SKINS
695 struct SkinInfo SkinInfo;
696 struct RastPort *TitlebarBufferRP;
697 struct Window *TitlebarBufferWin;
698 ULONG TitlebarWinWidth;
699 ULONG TitlebarWinActive;
700 #endif
701 #if USE_NEWDISPLAYBEEP
702 UBYTE BeepingCounter;
703 #endif
706 #define GetPrivScreen(s) ((struct IntScreen *)s)
708 /* SpecialFlags */
709 #define SF_IsParent (0x0001)
710 #define SF_IsChild (0x0002)
711 #define SF_InvisibleBar (0x0004)
712 #define SF_AppearingBar (0x0008)
713 #define SF_SysFont (0x0010)
714 #define SF_Draggable (0x0020) /* Screen can be dragged */
715 #define SF_ComposeAbove (0x0100) /* Composition capabilities */
716 #define SF_ComposeBelow (0x0200)
717 #define SF_ComposeLeft (0x0400)
718 #define SF_ComposeRight (0x0800)
720 #define SF_VertCompose (SF_ComposeAbove|SF_ComposeBelow)
721 #define SF_HorCompose (SF_ComposeLeft |SF_ComposeRight)
722 #define SF_Compose (SF_ComposeAbove|SF_ComposeBelow|SF_ComposeLeft|SF_ComposeRight)
724 struct IntIntuiMessage
726 struct ExtIntuiMessage eimsg;
729 ** The following field is needed, because in case of IDCMP_RAWKEY
730 ** IntuiMessage->IAddress is a pointer to this data, not the data
731 ** itself (which is the case for IDCMP_VANILLAKEY)
734 APTR prevCodeQuals;
737 #define INT_INTUIMESSAGE(x) ((struct IntIntuiMessage *)(x))
741 /*extern struct IntuitionBase * IntuitionBase;*/
743 #define IW(window) ((struct IntWindow *) (window))
745 #define GetPubIBase(ib) ((struct IntuitionBase *)ib)
746 #define GetPrivIBase(ib) ((struct IntIntuitionBase *)ib)
748 /* FIXME: Remove these #define xxxBase hacks
749 Do not use this in new code !
751 #ifdef __MORPHOS__
752 #ifdef MUIMasterBase
753 #undef MUIMasterBase
754 #define MUIMasterBase (GetPrivIBase(IntuitionBase)->MUIMasterBase)
755 #endif
756 #endif
758 /* struct Utilitybase is used in the following file so include it
759 before defining Utilitybase
761 #include <proto/utility.h>
763 #ifdef UtilityBase
764 #undef UtilityBase
765 #endif
766 #define UtilityBase (GetPrivIBase(IntuitionBase)->UtilityBase)
768 #ifdef LayersBase
769 #undef LayersBase
770 #endif
771 #define LayersBase (GetPrivIBase(IntuitionBase)->LayersBase)
773 #ifdef OOPBase
774 #undef OOPBase
775 #endif
776 #define OOPBase (GetPrivIBase(IntuitionBase)->OOPBase)
778 #ifdef GfxBase
779 #undef GfxBase
780 #endif
781 #define GfxBase (GetPrivIBase(IntuitionBase)->GfxBase)
783 #ifdef KeymapBase
784 #undef KeymapBase
785 #endif
786 #define KeymapBase (GetPrivIBase(IntuitionBase)->KeymapBase)
788 #ifdef InputBase
789 #undef InputBase
790 #endif
791 #define InputBase (GetPrivIBase(IntuitionBase)->InputBase)
793 #ifdef TimerBase
794 #undef TimerBase
795 #endif
796 #define TimerBase (GetPrivIBase(IntuitionBase)->TimerBase)
798 #ifdef TimerMP
799 #undef TimerMP
800 #endif
801 #define TimerMP (GetPrivIBase(IntuitionBase)->TimerMP)
803 #ifdef TimerIO
804 #undef TimerIO
805 #endif
806 #define TimerIO (GetPrivIBase(IntuitionBase)->TimerIO)
808 #define PublicClassList ((struct List *)&(GetPrivIBase(IntuitionBase)->ClassList))
811 /* stegerg: one can have sysgadgets outside of window border! All sysgadgets in window
812 border must have set GACT_???BORDER and, if they are in a gzz window, also
813 GTYP_GZZGADGET */
815 #define IS_GZZ_GADGET(gad) (((gad)->GadgetType) & GTYP_GZZGADGET)
817 #define IS_BORDER_GADGET(gad) (IS_GZZ_GADGET(gad) || \
818 ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER)))
820 #define IS_SYS_GADGET(gad) (((gad)->GadgetType) & GTYP_SYSTYPEMASK)
822 #define IS_BOOPSI_GADGET(gad) (((gad)->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET)
824 /*#define IS_BORDER_GADGET(gad) \
825 (((gad->GadgetType) & GTYP_SYSGADGET) \
826 || ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER))) */
828 #define IS_REQ_GADGET(gad) ((gad)->GadgetType & GTYP_REQGADGET)
830 #define IS_SCREEN_GADGET(gad) ((gad)->GadgetType & GTYP_SCRGADGET)
832 #define SET_GI_RPORT(gi, w, req, gad) \
833 (gi)->gi_RastPort = (IS_SCREEN_GADGET(gad) ? \
834 ((gi)->gi_Screen->BarLayer ? (gi)->gi_Screen->BarLayer->rp : NULL) : \
835 (IS_BORDER_GADGET(gad) ? (w)->BorderRPort : \
836 ((req) ? ((req)->ReqLayer->rp) : (w)->RPort)) \
840 #define REFRESHGAD_BOOPSI 1 /* boopsi gadgets */
841 #define REFRESHGAD_BORDER 2 /* gadgets in window border */
842 #define REFRESHGAD_REL 4 /* gadgets with GFLG_RELRIGHT, GFLG_RELBOTTOM,GFLG_RELWIDTH, GFLG_RELHEIGHT */
843 #define REFRESHGAD_RELS 8 /* GFLG_RELSPECIAL gadgets */
844 #define REFRESHGAD_TOPBORDER 16 /* used by setwindowtitle */
845 #define REFRESHGAD_NOGADTOOLS 32 /* used in some cases for _mustbe_ */
847 #define SYSGADGET_ACTIVE (iihdata->ActiveSysGadget != NULL)
849 VOID int_refreshglist(struct Gadget *gadgets, struct Window *window,
850 struct Requester *requester, LONG numGad, LONG mustbe, LONG mustnotbe,
851 struct IntuitionBase *IntuitionBase);
853 VOID int_RefreshWindowFrame(struct Window *window, LONG mustbe, LONG mustnotbe,
854 LONG mode,
855 struct IntuitionBase *IntuitionBase);
857 #define int_refreshwindowframe(a,b,c,d) int_RefreshWindowFrame(a,b,c,0,d);
859 /* Keep the system gadgets in the same order than the original intuition,
860 * some programs make bad asumptions about that...
862 enum
864 DEPTHGAD,
865 ZOOMGAD,
866 SIZEGAD,
867 CLOSEGAD,
868 ICONIFYGAD,
869 LOCKGAD,
870 MUIGAD,
871 POPUPGAD,
872 SNAPSHOTGAD,
873 JUMPGAD,
874 DRAGBAR,
875 NUM_SYSGADS
878 #define SYSGAD(w, idx) (((struct IntWindow *)(w))->sysgads[idx])
880 struct IntWindow
882 struct Window window;
884 Object *sysgads[NUM_SYSGADS];
885 struct Image *AmigaKey;
886 struct Image *Checkmark;
887 struct Image *SubMenuImage;
888 struct Window *menulendwindow;
890 struct HashNode hashnode;
892 /* When the Zoom gadget is pressed the window will have the
893 dimensions stored here. The old dimensions are backed up here
894 again. */
895 WORD ZipLeftEdge;
896 WORD ZipTopEdge;
897 WORD ZipWidth;
898 WORD ZipHeight;
900 /* max. number of mousemove events to send to this window */
901 WORD mousequeue;
903 /* act. number of mousemove events sent to this window */
904 WORD num_mouseevents;
906 /* max. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
907 messages to send to this window */
908 WORD repeatqueue;
910 /* act. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
911 messages sent to this window */
912 WORD num_repeatevents;
914 #if USE_IDCMPUPDATE_MESSAGECACHE
915 /* number of unreplied IDCMP_IDCMPUPDATE messages sent to window
916 used in few hacks :) */
917 WORD num_idcmpupdate;
918 #endif
920 WORD sizeimage_width;
921 WORD sizeimage_height;
923 ULONG helpflags;
924 ULONG helpgroup;
926 Object *pointer;
927 BOOL busy;
928 BOOL free_pointer;
929 UWORD pointer_delay;
930 ULONG extrabuttons;
931 ULONG extrabuttonsid; /* replaces ETI_Dummy if apps wishes it */
932 #ifdef SKINS
933 ULONG titlepos; /* used by titlebar pattern fill stuff */
934 #else
935 ULONG reserved1;
936 #endif
937 ULONG specialflags;
939 #ifdef SKINS
940 struct Region *transpregion;
941 struct Hook *usertransphook;
942 struct Region *usertranspregion;
943 #endif
945 #ifdef DAMAGECACHE
946 struct Region *trashregion;
947 #endif
948 char titlebuffer[TITLEBUFFERLEN+1];
950 #if USE_IDCMPUPDATE_MESSAGECACHE
951 struct IntuiMessage *messagecache; //for idcmpupdate cache
952 #endif
954 struct Layer *wlayer;
955 struct Layer *borderlayer;
957 struct timeval lastmsgsent;
958 struct timeval lastmsgreplied;
960 #ifdef TIMEVALWINDOWACTIVATION
961 struct timeval activationtime;
962 #endif
964 #ifdef SKINS
965 struct Hook custombackfill;
966 struct HookData hd;
967 #endif
968 struct Hook DefaultWindowShapeHook;
969 BOOL CustomShape;
970 struct Region *OutlineShape;
971 ULONG DecorUserBufferSize;
972 IPTR DecorUserBuffer;
975 #define SPFLAG_ICONIFIED 1
976 #define SPFLAG_NOICONIFY 2
977 #define SPFLAG_SKININFO 4
978 #define SPFLAG_LAYERREFRESH 8
979 #define SPFLAG_TRANSPHOOK 16
980 #define SPFLAG_LAYERRESIZED 32
981 #define SPFLAG_USERPORT 64
982 #define SPFLAG_IAMDEAD 128
983 #define SPFLAG_CLOSING 256 //used with iamdead
984 #define SPFLAG_WANTBUFFER 512
986 #define HELPF_ISHELPGROUP 1
987 #define HELPF_GADGETHELP 2
989 #define IS_NOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? TRUE : FALSE)
990 #define IS_DOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? FALSE : TRUE )
991 #define IS_SIMPLEREFRESH(win) (((win)->Flags & WFLG_SIMPLE_REFRESH) ? TRUE : FALSE)
992 #define IS_GZZWINDOW(win) (((win)->Flags & WFLG_GIMMEZEROZERO) ? TRUE : FALSE)
995 /* Flag definitions for MoreFlags */
997 #define WMFLG_NOTIFYDEPTH (1 << 0) /* Window wants notification when
998 it's depth arranged */
1000 #define WMFLG_DO_UNLOCKPUBSCREEN (1 << 1)
1001 #define WMFLG_MENUHELP (1 << 2)
1002 #define WMFLG_POINTERDELAY (1 << 3)
1003 #define WMFLG_TABLETMESSAGES (1 << 4)
1005 // FIXME: ehm... this one should die a horrible death!
1006 #define WMFLG_IAMMUI (1 << 5)
1008 struct IntScreenBuffer
1010 struct ScreenBuffer sb;
1011 BOOL free_bitmap;
1015 /* Driver prototypes */
1017 extern int intui_init (struct IntuitionBase *);
1018 extern int intui_open (struct IntuitionBase *);
1019 extern void intui_close (struct IntuitionBase *);
1020 extern void intui_expunge (struct IntuitionBase *);
1021 extern int intui_GetWindowSize (void);
1022 extern void intui_WindowLimits (struct Window * window, WORD MinWidth, WORD MinHeight, UWORD MaxWidth, UWORD MaxHeight);
1023 extern void intui_ActivateWindow (struct Window *);
1024 extern BOOL intui_ChangeWindowBox (struct Window * window, WORD x, WORD y,
1025 WORD width, WORD height);
1026 extern void intui_CloseWindow (struct Window *, struct IntuitionBase *);
1027 extern void intui_MoveWindow (struct Window * window, WORD dx, WORD dy);
1028 extern int intui_OpenWindow (struct Window *, struct IntuitionBase *,
1029 struct BitMap * SuperBitMap, struct Hook *backfillhook,
1030 struct Region * shape, struct Hook * shapehook,
1031 struct Layer * parent, ULONG visible);
1032 extern void intui_SetWindowTitles (struct Window *, CONST_STRPTR, CONST_STRPTR);
1033 extern void intui_RefreshWindowFrame(struct Window *win);
1034 extern struct Window *intui_FindActiveWindow(struct InputEvent *ie, struct IntuitionBase *IntuitionBase);
1035 extern void intui_ScrollWindowRaster(struct Window * win, WORD dx, WORD dy, WORD xmin,
1036 WORD ymin, WORD xmax, WORD ymax,
1037 struct IntuitionBase * IntuitionBase);
1039 /* wbtasktalk protos */
1041 ULONG TellWBTaskToCloseWindows(struct IntuitionBase *IntuitionBase);
1042 ULONG TellWBTaskToOpenWindows(struct IntuitionBase *IntuitionBase);
1044 /* intuition_misc protos */
1045 extern void LoadDefaultPreferences(struct IntuitionBase * IntuitionBase);
1046 Object* CreateStdSysImage(WORD which, WORD preferred_height, struct Screen *scr, APTR buffer,
1047 struct DrawInfo *dri, struct IntuitionBase *IntuitionBase);
1048 extern void CheckRectFill(struct RastPort *rp, WORD x1, WORD y1, WORD x2, WORD y2, struct IntuitionBase * IntuitionBase);
1049 extern BOOL CreateWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1050 extern VOID KillWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1051 extern void CreateScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1052 extern void KillScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1053 extern void RenderScreenBar(struct Screen *scr, BOOL refresh, struct IntuitionBase *IntuitionBase);
1054 extern void UpdateMouseCoords(struct Window *win);
1055 extern WORD SubtractRectFromRect(struct Rectangle *a, struct Rectangle *b, struct Rectangle *destrectarray);
1057 AROS_UFP3(struct Region *, DefaultWindowShapeFunc,
1058 AROS_UFPA(struct Hook *, hook, A0),
1059 AROS_UFPA(struct Layer *, lay, A2),
1060 AROS_UFPA(struct ShapeHookMsg *, msg, A1));
1062 extern LONG CalcResourceHash(APTR resource);
1063 extern void AddResourceToList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1064 extern void RemoveResourceFromList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1065 extern BOOL ResourceExisting(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1066 void FireScreenNotifyMessage(IPTR data, ULONG flag, struct IntuitionBase *IntuitionBase);
1067 void FireScreenNotifyMessageCode(IPTR data, ULONG flag, ULONG code, struct IntuitionBase *IntuitionBase);
1069 /* misc.c */
1070 extern void MySetPointerPos(struct IntuitionBase *IntuitionBase);
1071 extern BOOL ResetPointer(struct IntuitionBase *IntuitionBase);
1072 extern void ActivateMonitor(Object *newmonitor, WORD x, WORD y, struct IntuitionBase *IntuitionBase);
1073 extern struct Screen *FindFirstScreen(Object *monitor, struct IntuitionBase *IntuitionBase);
1074 struct TextFont *SafeReopenFont(struct IntuitionBase *, struct TextFont **);
1075 extern Object *MakePointerFromPrefs(struct IntuitionBase *, struct Preferences *);
1076 extern Object *MakePointerFromData(struct IntuitionBase *, UWORD *, int, int, int, int);
1077 void InstallPointer(struct IntuitionBase *, UWORD, Object **, Object *);
1078 void SetPointerColors(struct IntuitionBase *IntuitionBase);
1079 struct IClass *InitITextIClass (struct IntuitionBase * IntuitionBase);
1080 struct Gadget *DoActivateGadget(struct Window *win, struct Requester *req, struct Gadget *gad,
1081 struct IntuitionBase *IntuitionBase);
1082 VOID DoGMLayout(struct Gadget *glist, struct Window *win, struct Requester *req,
1083 UWORD numgad, BOOL initial, struct IntuitionBase *IntuitionBase);
1084 BOOL ih_fire_intuimessage(struct Window * w, ULONG Class, UWORD Code, APTR IAddress,
1085 struct IntuitionBase *IntuitionBase);
1086 void NotifyDepthArrangement(struct Window *w, struct IntuitionBase *IntuitionBase);
1088 /* printitext.c */
1090 void int_PrintIText(struct RastPort * rp, struct IntuiText * iText,
1091 LONG leftOffset, LONG topOffset, BOOL ignore_attributes,
1092 struct IntuitionBase *IntuitionBase);
1094 #ifdef __MORPHOS__
1095 BOOL IsLayerHiddenBySibling(struct Layer *layer, BOOL xx);
1096 LONG IsLayerVisible(struct Layer *layer);
1097 #endif
1099 void SetupGInfo(struct GadgetInfo *gi, struct Window *win, struct Requester *req,
1100 struct Gadget *gad, struct IntuitionBase *IntuitionBase);
1102 IPTR Custom_DoMethodA(struct IntuitionBase *, struct Gadget *, Msg);
1104 #ifdef __MORPHOS__
1105 #ifdef DoMethodA
1106 #undef DoMethodA
1107 #endif
1108 #define DoMethodA(x, ...) (REG_A6=(LONG)IntuitionBase, DoMethodA(x, __VA_ARGS__))
1109 #endif
1111 #define Custom_DoMethodA(x, ...) Custom_DoMethodA(IntuitionBase, x, __VA_ARGS__)
1113 #define HAS_CHILDREN(w) (NULL != w->firstchild)
1115 #ifdef __MORPHOS__
1116 #define DeinitRastPort(rp) ((void)0)
1117 #define CreateRastPort() MyCreateRastPort(IntuitionBase)
1118 #define CloneRastPort(rp) MyCloneRastPort(IntuitionBase, rp)
1119 #define FreeRastPort(rp) MyFreeRastPort(IntuitionBase, rp)
1120 #define SetPointerPos(x, y) MySetPointerPos(IntuitionBase, x, y)
1121 #define MouseCoordsRelative() 1
1122 #endif
1124 /* Replacement for dos.library/DisplayError() */
1125 AROS_UFP3(LONG, Intuition_DisplayError,
1126 AROS_UFPA(STRPTR, formatStr , A0),
1127 AROS_UFPA(ULONG , IDCMPFlags, D0),
1128 AROS_UFPA(APTR , args , A1));
1130 #define POINTERA_SharedPointer 0x80039010
1132 #ifndef __MORPHOS__
1133 #define dprintf kprintf
1134 #endif
1136 #define DEBUG_ACTIVATEGADGET(x) ;
1137 #define DEBUG_ACTIVATEWINDOW(x) ;
1138 #define DEBUG_ADDCLASS(x) ;
1139 #define DEBUG_ADDGADGET(x) ;
1140 #define DEBUG_ADDGLIST(x) ;
1141 #define DEBUG_ALLOCINTUIMESSAGE(x) ;
1142 #define DEBUG_ALLOCSCREENBUFFER(x) ;
1143 #define DEBUG_ALOHAWORKBENCH(x) ;
1144 #define DEBUG_CHANGEWINDOWBOX(x) ;
1145 #define DEBUG_CLOSESCREEN(x) ;
1146 #define DEBUG_CLOSEWINDOW(x) ;
1147 #define DEBUG_CLOSEWORKBENCH(x) ;
1148 #define DEBUG_DISPOSEOBJECT(x) ;
1149 #define DEBUG_DOGADGETMETHOD(x) ;
1150 #define DEBUG_DRAWBORDER(x) ;
1151 #define DEBUG_FINDCLASS(x) ;
1152 #define DEBUG_FREEICDATA(x) ;
1153 #define DEBUG_FREEINTUIMESSAGE(x) ;
1154 #define DEBUG_FREESCREENBUFFER(x) ;
1155 #define DEBUG_FREESCREENDRAWINFO(x) ;
1156 #define DEBUG_GADGETMOUSE(x) ;
1157 #define DEBUG_GETATTR(x) ;
1158 #define DEBUG_GETDEFAULTPUBSCREEN(x) ;
1159 #define DEBUG_GETDEFPREFS(x) ;
1160 #define DEBUG_GETGADGETIBOX(x) ;
1161 #define DEBUG_GETPREFS(x) ;
1162 #define DEBUG_GETSCREENDATA(x) ;
1163 #define DEBUG_GETSCREENDRAWINFO(x) ;
1164 #define DEBUG_HIDEWINDOW(x) ;
1165 #define DEBUG_OPEN(x) ;
1166 #define DEBUG_CLOSE(x) ;
1167 #define DEBUG_INPUTEVENT(x) ;
1168 #define DEBUG_INTREFRESHGLIST(x) ;
1169 #define DEBUG_INTUITEXTLENGTH(x) ;
1170 #define DEBUG_LENDMENUS(x) ;
1171 #define DEBUG_LOCKPUBSCREEN(x) ;
1172 #define DEBUG_MAKECLASS(x) ;
1173 #define DEBUG_MODIFYIDCMP(x) ;
1174 #define DEBUG_NEWOBJECT(x) ;
1175 #define DEBUG_NEXTOBJECT(x) ;
1176 #define DEBUG_OBTAINGIRPORT(x) ;
1177 #define DEBUG_OFFGADGET(x) ;
1178 #define DEBUG_OFFMENU(x) ;
1179 #define DEBUG_ONGADGET(x) ;
1180 #define DEBUG_ONMENU(x) ;
1181 #define DEBUG_OPENSCREEN(x) ;
1182 #define DEBUG_OPENSCREENTAGLIST(x) ;
1183 #define DEBUG_OPENWINDOW(x) ;
1184 #define DEBUG_OPENWINDOWTAGLIST(x) ;
1185 #define DEBUG_OPENWORKBENCH(x) ;
1186 #define DEBUG_POINTER(x) ;
1187 #define DEBUG_PRINTITEXT(x) ;
1188 #define DEBUG_QUERYOVERSCAN(x) ;
1189 #define DEBUG_REFRESH(x) ;
1190 #define DEBUG_RELEASEGIRPORT(x) ;
1191 #define DEBUG_REMEMBER(x) ;
1192 #define DEBUG_REMOVEGLIST(x) ;
1193 #define DEBUG_REPORTMOUSE(x) ;
1194 #define DEBUG_REQUEST(x) ;
1195 #define DEBUG_SCROLLWINDOWRASTER(x) ;
1196 #define DEBUG_SENDINTUIMESSAGE(x) ;
1197 #define DEBUG_SETATTRS(x) ;
1198 #define DEBUG_SETGADGETATTRS(x) ;
1199 #define DEBUG_SETPOINTER(x) ;
1200 #define DEBUG_SHOWWINDOW(x) ;
1201 #define DEBUG_UNLOCKPUBSCREEN(x) ;
1202 #define DEBUG_WINDOWLIMITS(x) ;
1203 #define DEBUG_WINDOWTOBACK(x) ;
1204 #define DEBUG_WINDOWTOFRONT(x) ;
1205 #define DEBUG_ZIPWINDOW(x) ;
1206 #define DEBUG_VISITOR(x) ;
1207 #define DEBUG_WORKBENCH(x) ;
1208 #define DEBUG_LOCKPUBSCREENLIST(x) ;
1209 #define DEBUG_UNLOCKPUBSCREENLIST(x) ;
1210 #define DEBUG_RETHINKDISPLAY(x) ;
1212 #ifdef NO_RUNTIME_DEBUG
1214 #define DEBUG_INIT(x) ;
1215 #define DEBUG_SETIPREFS(x) ;
1216 #define DEBUG_SETPREFS(x) ;
1218 #else
1220 #define DEBUG_INIT(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1221 #define DEBUG_SETIPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1222 #define DEBUG_SETPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1224 #endif
1227 * Private data structures of the classes defined by intuition.library
1230 /* ICClass */
1231 struct ICData
1233 Object *ic_Target;
1234 struct TagItem *ic_Mapping;
1235 struct TagItem *ic_CloneTags;
1236 ULONG ic_LoopCounter;
1239 /* ModelClass */
1240 struct ModelData
1242 struct MinList memberlist;
1245 /* FrameIClass */
1246 struct FrameIData
1248 /* render bevel only with no fill? */
1249 BOOL fid_EdgesOnly;
1251 /* inverted bevel pens? */
1252 BOOL fid_Recessed;
1254 /* frame style? */
1255 WORD fid_FrameType;
1257 WORD fid_HOffset;
1258 WORD fid_VOffset;
1261 /* SysIClass */
1262 struct SysIData
1264 struct DrawInfo *dri;
1265 struct Image *frame;
1266 APTR userbuffer;
1267 ULONG type;
1268 UWORD flags;
1271 /* FillRectClass */
1272 struct FillRectData
1274 WORD apatsize;
1275 WORD mode;
1278 /* GadgetClass */
1279 struct GadgetData
1281 struct ExtGadget EG;
1282 struct ICData IC;
1285 /* PropGClass */
1286 struct PropGData
1288 /* We use a propinfo structure, because we use the same routines
1289 for intuition propgadtets and in propgclass */
1291 struct PropInfo propinfo;
1293 /* A little kludge: since the HandleMouseMove function
1294 wants dx/dy and not absolute mouse coords, we
1295 have to remember the last ones */
1297 UWORD last_x;
1298 UWORD last_y;
1300 /* One only have to store total or visble, and use some other
1301 formulas than those in the RKRM:L, but for
1302 code simplicity I store them all. */
1303 UWORD top, visible, total;
1305 UWORD flags;
1306 struct BBox *old_knobbox;
1307 struct Hook *DisplayHook;
1310 /* StrGClass */
1311 struct StrGData
1313 struct StringInfo StrInfo;
1314 struct StringExtend StrExtend;
1315 UBYTE Flags;
1318 /* GroupGClass */
1319 struct GroupGData
1321 struct MinList memberlist;
1322 struct Gadget *activegad;
1325 /* DragBarClass */
1326 struct dragbar_data
1328 /* Current left- and topedge of moving window. Ie when the user releases
1329 the LMB after a windowdrag, the window's new coords will be (curleft, curtop)
1332 LONG curleft;
1333 LONG curtop;
1335 /* The current x and y coordinates relative to curleft/curtop */
1336 LONG mousex;
1337 LONG mousey;
1339 /* Whether the dragframe is currently drawn or erased */
1340 BOOL isrendered;
1342 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1343 BOOL drag_canceled;
1345 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1346 BOOL drag_layerlock;
1347 #ifdef USEGADGETLOCK
1348 BOOL drag_gadgetlock;
1349 BOOL drag_inputhandlerlock;
1350 #endif
1351 BOOL drag_refreshed;
1353 /* Rastport to use during update */
1354 struct RastPort *rp;
1356 UQUAD lasteventtime;
1358 LONG startleft;
1359 LONG starttop;
1361 #ifdef USEWINDOWLOCK
1362 /* used to prevent windows from opening/closing while user drags a window */
1363 BOOL drag_windowlock;
1364 #endif
1366 struct Task *movetask;
1370 /* SizeButtonClass */
1371 struct sizebutton_data
1374 /* The current width and height of the rubber band frame */
1375 ULONG width;
1376 ULONG height;
1377 ULONG top;
1378 ULONG left;
1380 /* holds original sizes */
1381 ULONG Width;
1382 ULONG Height;
1383 ULONG TopEdge;
1384 ULONG LeftEdge;
1386 /* the offset of the mouse pointer to the rubber band frame*/
1387 LONG mouseoffsetx;
1388 LONG mouseoffsety;
1390 /* Whether the dragframe is currently drawn or erased */
1391 BOOL isrendered;
1393 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1394 BOOL drag_canceled;
1396 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1397 BOOL drag_layerlock;
1398 #ifdef USEGADGETLOCK
1399 BOOL drag_gadgetlock;
1400 BOOL drag_inputhandlerlock;
1401 #endif
1403 BOOL drag_refreshed;
1405 /* Rastport to use during update */
1406 struct RastPort *rp;
1408 UQUAD lasteventtime;
1410 #ifdef USEWINDOWLOCK
1411 /* used to prevent windows from opening/closing while user drags a window */
1412 BOOL drag_windowlock;
1413 #endif
1415 #ifdef SKINS
1416 ULONG drag_type;
1417 #endif
1419 ULONG drag_ticks;
1423 /* MenuBarLabelClass */
1424 struct MenuBarLabelData
1426 struct DrawInfo *dri;
1429 /* PointerClass */
1430 struct PointerData
1432 struct SharedPointer *shared_pointer;
1435 /* WinDecorClass */
1436 struct windecor_data
1438 ULONG userbuffersize;
1441 /* ScrDecorClass */
1442 struct scrdecor_data
1444 ULONG userbuffersize;
1447 /* MenuDecorClass */
1448 struct menudecor_data
1450 ULONG userbuffersize;
1453 #endif /* INTUITION_INTERN_H */