HUNKF_FAST | HUNKF_CHIP = next long is memory flag. HUNKF_ADVISORY = ignore following...
[AROS.git] / rom / intuition / intuition_intern.h
blob5bda8eb666b2ee1bded74498b8000c3a9cdc01d0
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 ScrDecorSem;
573 struct IClass *ScrDecorClass;
574 struct TagItem *ScrDecorTags;
575 struct SignalSemaphore MenuDecorSem;
576 struct IClass *MenuDecorClass;
577 struct TagItem *MenuDecorTags;
578 struct SignalSemaphore WinDecorSem;
579 struct IClass *WinDecorClass;
580 struct TagItem *WinDecorTags;
582 struct List Decorations;
583 struct NewDecorator *Decorator;
585 #ifdef USEGETIPREFS
586 BOOL IPrefsLoaded;
587 #endif
589 #if USE_NEWDISPLAYBEEP
590 LONG BeepingScreens;
591 #endif
593 WORD prop_clickoffset_x, prop_clickoffset_y;
595 struct MinList ResourceList[RESOURCELIST_HASHSIZE];
597 /* Menu Look Settings */
598 int FrameSize;
600 Object *ActiveMonitor;
601 Object *NewMonitor;
603 OOP_AttrBase HiddAttrBase;
604 OOP_AttrBase HiddGfxAttrBase;
605 OOP_AttrBase HiddPixFmtAttrBase;
607 OOP_MethodID ib_HiddGfxBase;
608 OOP_MethodID ib_HiddBitMapBase;
610 struct IClass *monitorclass;
611 struct MinList MonitorList;
612 struct SignalSemaphore MonitorListSem;
615 struct SharedPointer
617 struct ExtSprite *sprite;
618 WORD xoffset, yoffset;
619 int ref_count;
622 struct SharedPointer *CreateSharedPointer(struct ExtSprite *, int, int, struct IntuitionBase *);
623 void ObtainSharedPointer(struct SharedPointer *, struct IntuitionBase *);
624 void ReleaseSharedPointer(struct SharedPointer *, struct IntuitionBase *);
626 #ifdef INTUITION_NOTIFY_SUPPORT
627 void sn_DoNotify(ULONG type, APTR value, struct Library *_ScreenNotifyBase);
628 #endif
630 struct IntDrawInfo
632 struct DrawInfo dri;
633 struct Screen *dri_Screen;
634 struct SignalSemaphore dri_WinDecorSem;
635 Object *dri_WinDecorObj;
636 struct SignalSemaphore dri_ScrDecorSem;
637 Object *dri_ScrDecorObj;
640 #define DRI_VERSION_AROS (DRI_VERSION + 1)
642 #define LOCK_WINDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
643 #define LOCKSHARED_WINDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
644 #define UNLOCK_WINDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
646 #define LOCK_SCRDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
647 #define LOCKSHARED_SCRDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
648 #define UNLOCK_SCRDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
650 #define LOCK_MENUDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
651 #define LOCKSHARED_MENUDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
652 #define UNLOCK_MENUDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
654 struct IntScreen
656 struct Screen Screen;
658 /* Private fields */
659 struct HashNode hashnode;
660 struct IntDrawInfo DInfo;
661 struct TTextAttr textattr;
662 ULONG textattrtags[3];
663 UWORD Pens[NUMDRIPENS];
664 struct PubScreenNode *pubScrNode;
665 Object *depthgadget;
666 UWORD SpecialFlags;
667 struct Layer *rootLayer;
668 #if !USE_NEWDISPLAYBEEP
669 ULONG DisplayBeepColor0[3];
670 struct Window *DisplayBeepWindow;
671 #endif
672 #ifdef __MORPHOS__
673 ULONG ModeID;
674 struct MonitorSpec *Monitor;
675 #endif
676 Object *MonitorObject;
677 struct SharedPointer *Pointer;
678 struct Window *MenuVerifyActiveWindow;
679 int MenuVerifyTimeOut;
680 int MenuVerifyMsgCount;
681 ULONG MenuVerifySeconds;
682 ULONG MenuVerifyMicros;
683 ULONG DecorUserBufferSize;
684 IPTR DecorUserBuffer;
685 Object *ScrDecorObj;
686 Object *MenuDecorObj;
687 Object *WinDecorObj;
688 struct NewDecorator *Decorator;
690 struct BitMap *AllocatedBitmap;
691 #ifdef SKINS
692 WORD LastClockPos;
693 WORD LastClockWidth;
694 #else
695 ULONG Reserved;
696 #endif
697 #ifdef SKINS
698 struct SkinInfo SkinInfo;
699 struct RastPort *TitlebarBufferRP;
700 struct Window *TitlebarBufferWin;
701 ULONG TitlebarWinWidth;
702 ULONG TitlebarWinActive;
703 #endif
704 #if USE_NEWDISPLAYBEEP
705 UBYTE BeepingCounter;
706 #endif
709 #define GetPrivScreen(s) ((struct IntScreen *)s)
711 /* SpecialFlags */
712 #define SF_IsParent (0x0001)
713 #define SF_IsChild (0x0002)
714 #define SF_InvisibleBar (0x0004)
715 #define SF_AppearingBar (0x0008)
716 #define SF_SysFont (0x0010)
717 #define SF_Draggable (0x0020) /* Screen can be dragged */
718 #define SF_ComposeAbove (0x0100) /* Composition capabilities */
719 #define SF_ComposeBelow (0x0200)
720 #define SF_ComposeLeft (0x0400)
721 #define SF_ComposeRight (0x0800)
723 #define SF_VertCompose (SF_ComposeAbove|SF_ComposeBelow)
724 #define SF_HorCompose (SF_ComposeLeft |SF_ComposeRight)
725 #define SF_Compose (SF_ComposeAbove|SF_ComposeBelow|SF_ComposeLeft|SF_ComposeRight)
727 struct IntIntuiMessage
729 struct ExtIntuiMessage eimsg;
732 ** The following field is needed, because in case of IDCMP_RAWKEY
733 ** IntuiMessage->IAddress is a pointer to this data, not the data
734 ** itself (which is the case for IDCMP_VANILLAKEY)
737 APTR prevCodeQuals;
740 #define INT_INTUIMESSAGE(x) ((struct IntIntuiMessage *)(x))
744 /*extern struct IntuitionBase * IntuitionBase;*/
746 #define IW(window) ((struct IntWindow *) (window))
748 #define GetPubIBase(ib) ((struct IntuitionBase *)ib)
749 #define GetPrivIBase(ib) ((struct IntIntuitionBase *)ib)
751 /* FIXME: Remove these #define xxxBase hacks
752 Do not use this in new code !
754 #ifdef __MORPHOS__
755 #ifdef MUIMasterBase
756 #undef MUIMasterBase
757 #define MUIMasterBase (GetPrivIBase(IntuitionBase)->MUIMasterBase)
758 #endif
759 #endif
761 /* struct Utilitybase is used in the following file so include it
762 before defining Utilitybase
764 #include <proto/utility.h>
766 /* stegerg: one can have sysgadgets outside of window border! All sysgadgets in window
767 border must have set GACT_???BORDER and, if they are in a gzz window, also
768 GTYP_GZZGADGET */
770 #define IS_GZZ_GADGET(gad) (((gad)->GadgetType) & GTYP_GZZGADGET)
772 #define IS_BORDER_GADGET(gad) (IS_GZZ_GADGET(gad) || \
773 ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER)))
775 #define IS_SYS_GADGET(gad) (((gad)->GadgetType) & GTYP_SYSTYPEMASK)
777 #define IS_BOOPSI_GADGET(gad) (((gad)->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET)
779 /*#define IS_BORDER_GADGET(gad) \
780 (((gad->GadgetType) & GTYP_SYSGADGET) \
781 || ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER))) */
783 #define IS_REQ_GADGET(gad) ((gad)->GadgetType & GTYP_REQGADGET)
785 #define IS_SCREEN_GADGET(gad) ((gad)->GadgetType & GTYP_SCRGADGET)
787 #define SET_GI_RPORT(gi, w, req, gad) \
788 (gi)->gi_RastPort = (IS_SCREEN_GADGET(gad) ? \
789 ((gi)->gi_Screen->BarLayer ? (gi)->gi_Screen->BarLayer->rp : NULL) : \
790 (IS_BORDER_GADGET(gad) ? (w)->BorderRPort : \
791 ((req) ? ((req)->ReqLayer->rp) : (w)->RPort)) \
795 #define REFRESHGAD_BOOPSI 1 /* boopsi gadgets */
796 #define REFRESHGAD_BORDER 2 /* gadgets in window border */
797 #define REFRESHGAD_REL 4 /* gadgets with GFLG_RELRIGHT, GFLG_RELBOTTOM,GFLG_RELWIDTH, GFLG_RELHEIGHT */
798 #define REFRESHGAD_RELS 8 /* GFLG_RELSPECIAL gadgets */
799 #define REFRESHGAD_TOPBORDER 16 /* used by setwindowtitle */
800 #define REFRESHGAD_NOGADTOOLS 32 /* used in some cases for _mustbe_ */
802 #define SYSGADGET_ACTIVE (iihdata->ActiveSysGadget != NULL)
804 VOID int_refreshglist(struct Gadget *gadgets, struct Window *window,
805 struct Requester *requester, LONG numGad, LONG mustbe, LONG mustnotbe,
806 struct IntuitionBase *IntuitionBase);
808 VOID int_RefreshWindowFrame(struct Window *window, LONG mustbe, LONG mustnotbe,
809 LONG mode,
810 struct IntuitionBase *IntuitionBase);
812 #define int_refreshwindowframe(a,b,c,d) int_RefreshWindowFrame(a,b,c,0,d);
814 /* Keep the system gadgets in the same order than the original intuition,
815 * some programs make bad asumptions about that...
817 enum
819 DEPTHGAD,
820 ZOOMGAD,
821 SIZEGAD,
822 CLOSEGAD,
823 ICONIFYGAD,
824 LOCKGAD,
825 MUIGAD,
826 POPUPGAD,
827 SNAPSHOTGAD,
828 JUMPGAD,
829 DRAGBAR,
830 NUM_SYSGADS
833 #define SYSGAD(w, idx) (((struct IntWindow *)(w))->sysgads[idx])
835 struct IntWindow
837 struct Window window;
839 Object *sysgads[NUM_SYSGADS];
840 struct Image *AmigaKey;
841 struct Image *Checkmark;
842 struct Image *SubMenuImage;
843 struct Window *menulendwindow;
845 struct HashNode hashnode;
847 /* When the Zoom gadget is pressed the window will have the
848 dimensions stored here. The old dimensions are backed up here
849 again. */
850 WORD ZipLeftEdge;
851 WORD ZipTopEdge;
852 WORD ZipWidth;
853 WORD ZipHeight;
855 /* max. number of mousemove events to send to this window */
856 WORD mousequeue;
858 /* act. number of mousemove events sent to this window */
859 WORD num_mouseevents;
861 /* max. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
862 messages to send to this window */
863 WORD repeatqueue;
865 /* act. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
866 messages sent to this window */
867 WORD num_repeatevents;
869 #if USE_IDCMPUPDATE_MESSAGECACHE
870 /* number of unreplied IDCMP_IDCMPUPDATE messages sent to window
871 used in few hacks :) */
872 WORD num_idcmpupdate;
873 #endif
875 WORD sizeimage_width;
876 WORD sizeimage_height;
878 ULONG helpflags;
879 ULONG helpgroup;
881 Object *pointer;
882 BOOL busy;
883 BOOL free_pointer;
884 UWORD pointer_delay;
885 ULONG extrabuttons;
886 ULONG extrabuttonsid; /* replaces ETI_Dummy if apps wishes it */
887 #ifdef SKINS
888 ULONG titlepos; /* used by titlebar pattern fill stuff */
889 #else
890 ULONG reserved1;
891 #endif
892 ULONG specialflags;
894 #ifdef SKINS
895 struct Region *transpregion;
896 struct Hook *usertransphook;
897 struct Region *usertranspregion;
898 #endif
900 #ifdef DAMAGECACHE
901 struct Region *trashregion;
902 #endif
903 char titlebuffer[TITLEBUFFERLEN+1];
905 #if USE_IDCMPUPDATE_MESSAGECACHE
906 struct IntuiMessage *messagecache; //for idcmpupdate cache
907 #endif
909 struct Layer *wlayer;
910 struct Layer *borderlayer;
912 struct timeval lastmsgsent;
913 struct timeval lastmsgreplied;
915 #ifdef TIMEVALWINDOWACTIVATION
916 struct timeval activationtime;
917 #endif
919 #ifdef SKINS
920 struct Hook custombackfill;
921 struct HookData hd;
922 #endif
923 struct Hook DefaultWindowShapeHook;
924 BOOL CustomShape;
925 struct Region *OutlineShape;
926 ULONG DecorUserBufferSize;
927 IPTR DecorUserBuffer;
930 #define SPFLAG_ICONIFIED 1
931 #define SPFLAG_NOICONIFY 2
932 #define SPFLAG_SKININFO 4
933 #define SPFLAG_LAYERREFRESH 8
934 #define SPFLAG_TRANSPHOOK 16
935 #define SPFLAG_LAYERRESIZED 32
936 #define SPFLAG_USERPORT 64
937 #define SPFLAG_IAMDEAD 128
938 #define SPFLAG_CLOSING 256 //used with iamdead
939 #define SPFLAG_WANTBUFFER 512
941 #define HELPF_ISHELPGROUP 1
942 #define HELPF_GADGETHELP 2
944 #define IS_NOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? TRUE : FALSE)
945 #define IS_DOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? FALSE : TRUE )
946 #define IS_SIMPLEREFRESH(win) (((win)->Flags & WFLG_SIMPLE_REFRESH) ? TRUE : FALSE)
947 #define IS_GZZWINDOW(win) (((win)->Flags & WFLG_GIMMEZEROZERO) ? TRUE : FALSE)
950 /* Flag definitions for MoreFlags */
952 #define WMFLG_NOTIFYDEPTH (1 << 0) /* Window wants notification when
953 it's depth arranged */
955 #define WMFLG_DO_UNLOCKPUBSCREEN (1 << 1)
956 #define WMFLG_MENUHELP (1 << 2)
957 #define WMFLG_POINTERDELAY (1 << 3)
958 #define WMFLG_TABLETMESSAGES (1 << 4)
960 // FIXME: ehm... this one should die a horrible death!
961 #define WMFLG_IAMMUI (1 << 5)
963 struct IntScreenBuffer
965 struct ScreenBuffer sb;
966 BOOL free_bitmap;
970 /* Driver prototypes */
972 extern int intui_init (struct IntuitionBase *);
973 extern int intui_open (struct IntuitionBase *);
974 extern void intui_close (struct IntuitionBase *);
975 extern void intui_expunge (struct IntuitionBase *);
976 extern int intui_GetWindowSize (void);
977 extern void intui_WindowLimits (struct Window * window, WORD MinWidth, WORD MinHeight, UWORD MaxWidth, UWORD MaxHeight);
978 extern void intui_ActivateWindow (struct Window *);
979 extern BOOL intui_ChangeWindowBox (struct Window * window, WORD x, WORD y,
980 WORD width, WORD height);
981 extern void intui_CloseWindow (struct Window *, struct IntuitionBase *);
982 extern void intui_MoveWindow (struct Window * window, WORD dx, WORD dy);
983 extern int intui_OpenWindow (struct Window *, struct IntuitionBase *,
984 struct BitMap * SuperBitMap, struct Hook *backfillhook,
985 struct Region * shape, struct Hook * shapehook,
986 struct Layer * parent, ULONG visible);
987 extern void intui_SetWindowTitles (struct Window *, CONST_STRPTR, CONST_STRPTR);
988 extern void intui_RefreshWindowFrame(struct Window *win);
989 extern struct Window *intui_FindActiveWindow(struct InputEvent *ie, struct IntuitionBase *IntuitionBase);
990 extern void intui_ScrollWindowRaster(struct Window * win, WORD dx, WORD dy, WORD xmin,
991 WORD ymin, WORD xmax, WORD ymax,
992 struct IntuitionBase * IntuitionBase);
994 /* wbtasktalk protos */
996 ULONG TellWBTaskToCloseWindows(struct IntuitionBase *IntuitionBase);
997 ULONG TellWBTaskToOpenWindows(struct IntuitionBase *IntuitionBase);
999 /* intuition_misc protos */
1000 extern void LoadDefaultPreferences(struct IntuitionBase * IntuitionBase);
1001 Object* CreateStdSysImage(WORD which, WORD preferred_height, struct Screen *scr, APTR buffer,
1002 struct DrawInfo *dri, struct IntuitionBase *IntuitionBase);
1003 extern void CheckRectFill(struct RastPort *rp, WORD x1, WORD y1, WORD x2, WORD y2, struct IntuitionBase * IntuitionBase);
1004 extern BOOL CreateWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1005 extern VOID KillWinSysGadgets(struct Window *w, struct IntuitionBase *IntuitionBase);
1006 extern void CreateScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1007 extern void KillScreenBar(struct Screen *scr, struct IntuitionBase *IntuitionBase);
1008 extern void RenderScreenBar(struct Screen *scr, BOOL refresh, struct IntuitionBase *IntuitionBase);
1009 extern void UpdateMouseCoords(struct Window *win);
1010 extern WORD SubtractRectFromRect(struct Rectangle *a, struct Rectangle *b, struct Rectangle *destrectarray);
1012 AROS_UFP3(BOOL, DefaultWindowShapeFunc,
1013 AROS_UFPA(struct Hook *, hook, A0),
1014 AROS_UFPA(struct Layer *, lay, A2),
1015 AROS_UFPA(struct ShapeHookMsg *, msg, A1));
1017 extern LONG CalcResourceHash(APTR resource);
1018 extern void AddResourceToList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1019 extern void RemoveResourceFromList(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1020 extern BOOL ResourceExisting(APTR resource, UWORD resourcetype, struct IntuitionBase *IntuitionBase);
1021 void FireScreenNotifyMessage(IPTR data, ULONG flag, struct IntuitionBase *IntuitionBase);
1022 void FireScreenNotifyMessageCode(IPTR data, ULONG flag, ULONG code, struct IntuitionBase *IntuitionBase);
1024 /* misc.c */
1025 extern void MySetPointerPos(struct IntuitionBase *IntuitionBase);
1026 extern BOOL ResetPointer(struct IntuitionBase *IntuitionBase);
1027 extern void ActivateMonitor(Object *newmonitor, WORD x, WORD y, struct IntuitionBase *IntuitionBase);
1028 extern struct Screen *FindFirstScreen(Object *monitor, struct IntuitionBase *IntuitionBase);
1029 extern struct RastPort *MyCreateRastPort(struct IntuitionBase *IntuitionBase);
1030 extern struct RastPort *MyCloneRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1031 extern void MyFreeRastPort(struct IntuitionBase *IntuitionBase, struct RastPort *rp);
1032 struct TextFont *SafeReopenFont(struct IntuitionBase *, struct TextFont **);
1033 extern Object *MakePointerFromPrefs(struct IntuitionBase *, struct Preferences *);
1034 extern Object *MakePointerFromData(struct IntuitionBase *, UWORD *, int, int, int, int);
1035 void InstallPointer(struct IntuitionBase *, UWORD, Object **, Object *);
1036 void SetPointerColors(struct IntuitionBase *IntuitionBase);
1037 struct IClass *InitITextIClass (struct IntuitionBase * IntuitionBase);
1038 struct Gadget *DoActivateGadget(struct Window *win, struct Requester *req, struct Gadget *gad,
1039 struct IntuitionBase *IntuitionBase);
1040 VOID DoGMLayout(struct Gadget *glist, struct Window *win, struct Requester *req,
1041 UWORD numgad, BOOL initial, struct IntuitionBase *IntuitionBase);
1042 BOOL ih_fire_intuimessage(struct Window * w, ULONG Class, UWORD Code, APTR IAddress,
1043 struct IntuitionBase *IntuitionBase);
1044 void NotifyDepthArrangement(struct Window *w, struct IntuitionBase *IntuitionBase);
1046 /* printitext.c */
1048 void int_PrintIText(struct RastPort * rp, struct IntuiText * iText,
1049 LONG leftOffset, LONG topOffset, BOOL ignore_attributes,
1050 struct IntuitionBase *IntuitionBase);
1052 /* Private extra functions */
1053 OOP_Object *FindMonitor(ULONG modeid, struct IntuitionBase *IntuitionBase);
1055 #ifdef __MORPHOS__
1056 BOOL IsLayerHiddenBySibling(struct Layer *layer, BOOL xx);
1057 LONG IsLayerVisible(struct Layer *layer);
1058 #endif
1060 void SetupGInfo(struct GadgetInfo *gi, struct Window *win, struct Requester *req,
1061 struct Gadget *gad, struct IntuitionBase *IntuitionBase);
1063 IPTR Custom_DoMethodA(struct IntuitionBase *, struct Gadget *, Msg);
1065 #ifdef __MORPHOS__
1066 #ifdef DoMethodA
1067 #undef DoMethodA
1068 #endif
1069 #define DoMethodA(x, ...) (REG_A6=(LONG)IntuitionBase, DoMethodA(x, __VA_ARGS__))
1070 #endif
1072 #define HAS_CHILDREN(w) (NULL != w->firstchild)
1074 #ifdef __MORPHOS__
1075 #define DeinitRastPort(rp) ((void)0)
1076 #endif
1077 #define CreateRastPort() MyCreateRastPort(IntuitionBase)
1078 #define CloneRastPort(rp) MyCloneRastPort(IntuitionBase, rp)
1079 #define FreeRastPort(rp) MyFreeRastPort(IntuitionBase, rp)
1081 /* Replacement for dos.library/DisplayError() */
1082 AROS_UFP3(LONG, Intuition_DisplayError,
1083 AROS_UFPA(STRPTR, formatStr , A0),
1084 AROS_UFPA(ULONG , IDCMPFlags, D0),
1085 AROS_UFPA(APTR , args , A1));
1087 #define POINTERA_SharedPointer 0x80039010
1089 #ifndef __MORPHOS__
1090 #define dprintf kprintf
1091 #endif
1093 #define DEBUG_ACTIVATEGADGET(x) ;
1094 #define DEBUG_ACTIVATEWINDOW(x) ;
1095 #define DEBUG_ADDCLASS(x) ;
1096 #define DEBUG_ADDGADGET(x) ;
1097 #define DEBUG_ADDGLIST(x) ;
1098 #define DEBUG_ALLOCINTUIMESSAGE(x) ;
1099 #define DEBUG_ALLOCSCREENBUFFER(x) ;
1100 #define DEBUG_ALOHAWORKBENCH(x) ;
1101 #define DEBUG_CHANGEWINDOWBOX(x) ;
1102 #define DEBUG_CLOSESCREEN(x) ;
1103 #define DEBUG_CLOSEWINDOW(x) ;
1104 #define DEBUG_CLOSEWORKBENCH(x) ;
1105 #define DEBUG_DISPOSEOBJECT(x) ;
1106 #define DEBUG_DOGADGETMETHOD(x) ;
1107 #define DEBUG_DRAWBORDER(x) ;
1108 #define DEBUG_FINDCLASS(x) ;
1109 #define DEBUG_FREEICDATA(x) ;
1110 #define DEBUG_FREEINTUIMESSAGE(x) ;
1111 #define DEBUG_FREESCREENBUFFER(x) ;
1112 #define DEBUG_FREESCREENDRAWINFO(x) ;
1113 #define DEBUG_GADGETMOUSE(x) ;
1114 #define DEBUG_GETATTR(x) ;
1115 #define DEBUG_GETDEFAULTPUBSCREEN(x) ;
1116 #define DEBUG_GETDEFPREFS(x) ;
1117 #define DEBUG_GETGADGETIBOX(x) ;
1118 #define DEBUG_GETPREFS(x) ;
1119 #define DEBUG_GETSCREENDATA(x) ;
1120 #define DEBUG_GETSCREENDRAWINFO(x) ;
1121 #define DEBUG_HIDEWINDOW(x) ;
1122 #define DEBUG_OPEN(x) ;
1123 #define DEBUG_CLOSE(x) ;
1124 #define DEBUG_INPUTEVENT(x) ;
1125 #define DEBUG_INTREFRESHGLIST(x) ;
1126 #define DEBUG_INTUITEXTLENGTH(x) ;
1127 #define DEBUG_LENDMENUS(x) ;
1128 #define DEBUG_LOCKPUBSCREEN(x) ;
1129 #define DEBUG_MAKECLASS(x) ;
1130 #define DEBUG_MODIFYIDCMP(x) ;
1131 #define DEBUG_NEWOBJECT(x) ;
1132 #define DEBUG_NEXTOBJECT(x) ;
1133 #define DEBUG_OBTAINGIRPORT(x) ;
1134 #define DEBUG_OFFGADGET(x) ;
1135 #define DEBUG_OFFMENU(x) ;
1136 #define DEBUG_ONGADGET(x) ;
1137 #define DEBUG_ONMENU(x) ;
1138 #define DEBUG_OPENSCREEN(x) ;
1139 #define DEBUG_OPENSCREENTAGLIST(x) ;
1140 #define DEBUG_OPENWINDOW(x) ;
1141 #define DEBUG_OPENWINDOWTAGLIST(x) ;
1142 #define DEBUG_OPENWORKBENCH(x) ;
1143 #define DEBUG_POINTER(x) ;
1144 #define DEBUG_PRINTITEXT(x) ;
1145 #define DEBUG_QUERYOVERSCAN(x) ;
1146 #define DEBUG_REFRESH(x) ;
1147 #define DEBUG_RELEASEGIRPORT(x) ;
1148 #define DEBUG_REMEMBER(x) ;
1149 #define DEBUG_REMOVEGLIST(x) ;
1150 #define DEBUG_REPORTMOUSE(x) ;
1151 #define DEBUG_REQUEST(x) ;
1152 #define DEBUG_SCROLLWINDOWRASTER(x) ;
1153 #define DEBUG_SENDINTUIMESSAGE(x) ;
1154 #define DEBUG_SETATTRS(x) ;
1155 #define DEBUG_SETGADGETATTRS(x) ;
1156 #define DEBUG_SETPOINTER(x) ;
1157 #define DEBUG_SHOWWINDOW(x) ;
1158 #define DEBUG_UNLOCKPUBSCREEN(x) ;
1159 #define DEBUG_WINDOWLIMITS(x) ;
1160 #define DEBUG_WINDOWTOBACK(x) ;
1161 #define DEBUG_WINDOWTOFRONT(x) ;
1162 #define DEBUG_ZIPWINDOW(x) ;
1163 #define DEBUG_VISITOR(x) ;
1164 #define DEBUG_WORKBENCH(x) ;
1165 #define DEBUG_LOCKPUBSCREENLIST(x) ;
1166 #define DEBUG_UNLOCKPUBSCREENLIST(x) ;
1167 #define DEBUG_RETHINKDISPLAY(x) ;
1169 #ifdef NO_RUNTIME_DEBUG
1171 #define DEBUG_INIT(x) ;
1172 #define DEBUG_SETIPREFS(x) ;
1173 #define DEBUG_SETPREFS(x) ;
1175 #else
1177 #define DEBUG_INIT(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1178 #define DEBUG_SETIPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1179 #define DEBUG_SETPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1181 #endif
1184 * Private data structures of the classes defined by intuition.library
1187 /* ICClass */
1188 struct ICData
1190 Object *ic_Target;
1191 struct TagItem *ic_Mapping;
1192 struct TagItem *ic_CloneTags;
1193 ULONG ic_LoopCounter;
1196 /* ModelClass */
1197 struct ModelData
1199 struct MinList memberlist;
1202 /* FrameIClass */
1203 struct FrameIData
1205 /* render bevel only with no fill? */
1206 BOOL fid_EdgesOnly;
1208 /* inverted bevel pens? */
1209 BOOL fid_Recessed;
1211 /* frame style? */
1212 WORD fid_FrameType;
1214 WORD fid_HOffset;
1215 WORD fid_VOffset;
1218 /* SysIClass */
1219 struct SysIData
1221 struct DrawInfo *dri;
1222 struct Image *frame;
1223 APTR userbuffer;
1224 ULONG type;
1225 UWORD flags;
1228 /* FillRectClass */
1229 struct FillRectData
1231 WORD apatsize;
1232 WORD mode;
1235 /* GadgetClass */
1236 struct GadgetData
1238 struct ExtGadget EG;
1239 struct ICData IC;
1242 /* PropGClass */
1243 struct PropGData
1245 /* We use a propinfo structure, because we use the same routines
1246 for intuition propgadtets and in propgclass */
1248 struct PropInfo propinfo;
1250 /* A little kludge: since the HandleMouseMove function
1251 wants dx/dy and not absolute mouse coords, we
1252 have to remember the last ones */
1254 UWORD last_x;
1255 UWORD last_y;
1257 /* One only have to store total or visble, and use some other
1258 formulas than those in the RKRM:L, but for
1259 code simplicity I store them all. */
1260 UWORD top, visible, total;
1262 UWORD flags;
1263 struct BBox *old_knobbox;
1264 struct Hook *DisplayHook;
1267 /* StrGClass */
1268 struct StrGData
1270 struct StringInfo StrInfo;
1271 struct StringExtend StrExtend;
1272 UBYTE Flags;
1275 /* GroupGClass */
1276 struct GroupGData
1278 struct MinList memberlist;
1279 struct Gadget *activegad;
1282 /* DragBarClass */
1283 struct dragbar_data
1285 /* Current left- and topedge of moving window. Ie when the user releases
1286 the LMB after a windowdrag, the window's new coords will be (curleft, curtop)
1289 LONG curleft;
1290 LONG curtop;
1292 /* The current x and y coordinates relative to curleft/curtop */
1293 LONG mousex;
1294 LONG mousey;
1296 /* Whether the dragframe is currently drawn or erased */
1297 BOOL isrendered;
1299 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1300 BOOL drag_canceled;
1302 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1303 BOOL drag_layerlock;
1304 #ifdef USEGADGETLOCK
1305 BOOL drag_gadgetlock;
1306 BOOL drag_inputhandlerlock;
1307 #endif
1308 BOOL drag_refreshed;
1310 /* Rastport to use during update */
1311 struct RastPort *rp;
1313 UQUAD lasteventtime;
1315 LONG startleft;
1316 LONG starttop;
1318 #ifdef USEWINDOWLOCK
1319 /* used to prevent windows from opening/closing while user drags a window */
1320 BOOL drag_windowlock;
1321 #endif
1323 struct Task *movetask;
1327 /* SizeButtonClass */
1328 struct sizebutton_data
1331 /* The current width and height of the rubber band frame */
1332 ULONG width;
1333 ULONG height;
1334 ULONG top;
1335 ULONG left;
1337 /* holds original sizes */
1338 ULONG Width;
1339 ULONG Height;
1340 ULONG TopEdge;
1341 ULONG LeftEdge;
1343 /* the offset of the mouse pointer to the rubber band frame*/
1344 LONG mouseoffsetx;
1345 LONG mouseoffsety;
1347 /* Whether the dragframe is currently drawn or erased */
1348 BOOL isrendered;
1350 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1351 BOOL drag_canceled;
1353 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1354 BOOL drag_layerlock;
1355 #ifdef USEGADGETLOCK
1356 BOOL drag_gadgetlock;
1357 BOOL drag_inputhandlerlock;
1358 #endif
1360 BOOL drag_refreshed;
1362 /* Rastport to use during update */
1363 struct RastPort *rp;
1365 UQUAD lasteventtime;
1367 #ifdef USEWINDOWLOCK
1368 /* used to prevent windows from opening/closing while user drags a window */
1369 BOOL drag_windowlock;
1370 #endif
1372 #ifdef SKINS
1373 ULONG drag_type;
1374 #endif
1376 ULONG drag_ticks;
1380 /* MenuBarLabelClass */
1381 struct MenuBarLabelData
1383 struct DrawInfo *dri;
1386 /* PointerClass */
1387 struct PointerData
1389 struct SharedPointer *shared_pointer;
1392 /* WinDecorClass */
1393 struct windecor_data
1395 ULONG userbuffersize;
1398 /* ScrDecorClass */
1399 struct scrdecor_data
1401 ULONG userbuffersize;
1404 /* MenuDecorClass */
1405 struct menudecor_data
1407 ULONG userbuffersize;
1410 #endif /* INTUITION_INTERN_H */