1 #ifndef INTUITION_INTERN_H
2 #define INTUITION_INTERN_H
5 Copyright 1995-2006, The AROS Development Team. All rights reserved.
6 Copyright 2001-2003, The MorphOS Development Team. All Rights Reserved.
10 #ifndef AROS_LIBCALL_H
11 # include <aros/libcall.h>
14 # include <aros/atomic.h>
16 #ifndef EXEC_EXECBASE_H
17 # include <exec/execbase.h>
19 #ifndef EXEC_SEMAPHORES_H
20 # include <exec/semaphores.h>
23 # include <exec/tasks.h>
26 # include <exec/ports.h>
32 # include <exec/types.h>
35 # include <exec/lists.h>
37 #ifndef GRAPHICS_GFXBASE_H
38 # include <graphics/gfxbase.h>
40 #ifndef GRAPHICS_RASTPORT_H
41 # include <graphics/rastport.h>
43 #ifndef GRAPHICS_REGIONS_H
44 # include <graphics/regions.h>
46 #ifndef GRAPHICS_CLIP_H
47 # include <graphics/clip.h>
49 #ifndef GRAPHICS_TEXT_H
50 # include <graphics/text.h>
52 #ifndef INTUITION_INTUITION_H
53 # include <intuition/intuition.h>
55 #ifndef INTUITION_INTUITIONBASE_H
56 # include <intuition/intuitionbase.h>
58 #ifndef INTUITION_CLASSES_H
59 # include <intuition/classes.h>
61 #ifndef INTUITION_CGHOOKS_H
62 # include <intuition/cghooks.h>
64 #ifndef INTUITION_SGHOOKS_H
65 # include <intuition/sghooks.h>
67 #ifndef INTUITION_SCREENS_H
68 # include <intuition/screens.h>
70 #ifndef PREFS_ICONTROL_H
71 # include <prefs/icontrol.h>
74 #include <prefs/input.h>
76 #ifndef CLIB_ALIB_PROTOS_H
77 # include <clib/alib_protos.h>
79 #ifdef INTUITION_NOTIFY_SUPPORT
80 # include <libraries/screennotify.h>
81 # include <libraries/notifyintuition.h>
84 #include "intuition_debug.h"
87 #include "intuition_customize.h"
88 #include "intuition_internmos.h"
89 #include "intuition_extend.h"
92 #include "requesters.h"
94 /* Needed for aros_print_not_implemented macro */
95 #include <aros/debug.h>
97 #include <aros/asmcall.h>
99 // FIXME: implement macro for AROS ??
101 # define ASSERT_VALID_PTR_ROMOK(ptr)
104 // FIXME: seems only used for RefreshWindowTitles() ? -> better names
105 // FIXME: what are the correct values?
106 #define NO_DOUBLEBUFFER (0)
107 #define DOUBLEBUFFER (1)
111 # define USE_OPAQUESIZE 1
113 # define USE_OPAQUESIZE 0
118 void dprintf(char *, ...) __attribute__ ((format (printf
, 1, 2)));
119 void * memclr(APTR
, ULONG
);
123 void * memclr(APTR
, ULONG
);
124 #define bzero(a,b) memclr(a,b)
125 #else /* __MORPHOS__ */
126 #define memclr(a,b) bzero(a,b)
127 #endif /* __MORPHOS__ */
130 * min()/max() without macro side effects.
133 ({typeof(a) _a = (a); \
134 typeof(b) _b = (b); \
138 ({typeof(a) _a = (a); \
139 typeof(b) _b = (b); \
142 #define EXTENDWORD(x) x = (LONG)((WORD)x);
143 #define EXTENDUWORD(x) x = (ULONG)((UWORD)x);
145 /* SANITY CHECK MACRO */
146 //#define DEBUG_SANITYCHECK
148 #ifdef DEBUG_SANITYCHECK
149 #define SANITY_CHECK(x) if (!((IPTR)x)) {dprintf("Losing sanity in %s line %d\n",__FILE__,__LINE__); return;};
150 #define SANITY_CHECKR(x,v) if (!((IPTR)x)) {dprintf("Losing sanity in %s line %d\n",__FILE__,__LINE__); return v;};
152 #define SANITY_CHECK(x) if (!((IPTR)x)) return;
153 #define SANITY_CHECKR(x,v) if (!((IPTR)x)) return v;
158 #define MENUS_BACKFILL TRUE
160 #define MENUS_AMIGALOOK ((GetPrivIBase(IntuitionBase)->IControlPrefs.ic_Flags & ICF_3DMENUS) == 0)
162 #define MENULOOK_3D 0
163 #define MENULOOK_CLASSIC 1
165 #define MENUS_UNDERMOUSE (GetPrivIBase(IntuitionBase)->IControlPrefs.ic_Flags & ICF_POPUPMENUS)
167 #define AVOID_WINBORDERERASE (GetPrivIBase(IntuitionBase)->IControlPrefs.ic_Flags & ICF_AVOIDWINBORDERERASE)
172 #define FRAME_SIZE (GetPrivIBase(IntuitionBase)->FrameSize)
174 #define FRAMESIZE_THIN 0 /* 1:1 thin */
175 #define FRAMESIZE_MEDRES 1 /* 2:1 medres like AmigaOS */
176 #define FRAMESIZE_THICK 2 /* 1:1 thick */
178 #define SQUARE_WIN_GADGETS 1
181 /* FIXME: possibly enable this, once gadtools has been updated */
183 #define GADTOOLSCOMPATIBLE
184 //enables some gadtools-weirdo-code, MUST be set in both gadtools & intui to work!!!
188 //#define USEGETIPREFS
191 /* simpleref layers have gadgets redrawn when app calls beginrefresh() */
192 //#define BEGINUPDATEGADGETREFRESH
193 //#define DAMAGECACHE
195 //#define USEWINDOWLOCK
197 #define LOCKWINDOW ObtainSemaphore(&GetPrivIBase(IntuitionBase)->WindowLock);
198 #define UNLOCKWINDOW ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->WindowLock);
203 /* jDc: do NOT disable this! */
205 #define USEGADGETLOCK
207 #define LOCKGADGET ObtainSemaphore(&GetPrivIBase(IntuitionBase)->GadgetLock);
208 #define UNLOCKGADGET ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->GadgetLock);
209 #define LOCKWINDOWLAYERS(w) ;
210 #define UNLOCKWINDOWLAYERS(w) ;
214 #define LOCKWINDOWLAYERS(w) LockLayerInfo(&w->WScreen->LayerInfo); \
215 if (((struct IntWindow *)(w))->borderlayer) {LockLayer(0,((struct IntWindow *)(w))->borderlayer);}; \
216 if (((struct IntWindow *)(w))->wlayer) {LockLayer(0,((struct IntWindow *)(w))->wlayer);};
217 #define UNLOCKWINDOWLAYERS(w) if (((struct IntWindow *)(w))->wlayer) {UnlockLayer(((struct IntWindow *)(w))->wlayer);}; \
218 if (((struct IntWindow *)(w))->borderlayer) {UnlockLayer(((struct IntWindow *)(w))->borderlayer);} \
219 UnlockLayerInfo(&w->WScreen->LayerInfo);
222 #define WLAYER(w) (((struct IntWindow *)(w))->wlayer)
223 #define BLAYER(w) (((struct IntWindow *)(w))->borderlayer)
225 //#define TIMEVALWINDOWACTIVATION
227 /* If PROP_RENDER_OPTIMIZATION is set to 1, propgadget code tries to optimize rendering
228 during prop gadget knob movement. Only area of the propgadget that is affected by
229 prop gadget knob movement is re-rendered.
231 Unfortunately this can fail with some programs, like DOpus 4.x text viewer */
233 #define PROP_RENDER_OPTIMIZATION 0
235 #define SINGLE_SETPOINTERPOS_PER_EVENTLOOP 1
237 #ifndef LIFLG_SUPPORTS_OFFSCREEN_LAYERS
238 /* Defined in <graphics/layers.h>, but apparently not on MorphOS. */
239 # define LIFLG_SUPPORTS_OFFSCREEN_LAYERS 2
242 #define INTUITIONNAME "intuition.library"
243 #define MENUBARLABELCLASS "menubarlabelclass"
245 #define DEFPUBSCREEN TRUE
247 #define USE_NEWDISPLAYBEEP 1
249 #define TITLEBUFFERLEN 255
251 #define USE_IDCMPUPDATE_MESSAGECACHE 0
254 #if INCLUDE_VERSION < 50
256 /********************************************************************************/
257 /* imageclass.h AROS extensions */
259 #define SYSIA_WithBorder IA_FGPen /* default: TRUE */
260 #define SYSIA_Style IA_BGPen /* default: SYSISTYLE_NORMAL */
262 #define SYSISTYLE_NORMAL 0
263 #define SYSISTYLE_GADTOOLS 1 /* to get arrow images in gadtools look */
265 /********************************************************************************/
266 /* gadgetclass.h AROS extenstions */
268 /* This method is invoked to learn about the sizing requirements of your class,
269 before an object is created. This is AROS specific. */
273 STACKED ULONG MethodID
; /* GM_DOMAIN */
274 STACKED
struct GadgetInfo
*gpd_GInfo
; /* see <intuition/cghooks.h> */
275 STACKED
struct RastPort
*gpd_RPort
; /* RastPort to calculate dimensions for. */
276 STACKED LONG gpd_Which
; /* see below */
277 STACKED
struct IBox gpd_Domain
; /* Resulting domain. */
278 STACKED
struct TagItem
*gpd_Attrs
; /* Additional attributes. None defined,
282 /********************************************************************************/
285 #define GDOMAIN_MINIMUM 0 /* Calculate minimum size. */
286 #define GDOMAIN_NOMINAL 1 /* Calculate nominal size. */
287 #define GDOMAIN_MAXIMUM 2 /* Calculate maximum size. */
289 #endif /* INCLUDE_VERSION < 50 */
290 #endif /* ifdef __MORPHOS__ */
292 /********************************************************************************/
293 #define GM_MOVETEST 8
294 /* this method is used by our draggad to tell if it's OK to move the mouse when window
295 is near screen boundaries and offscreen is disabled. msg = gpInput*/
297 #define MOVETEST_MOVE 0
298 #define MOVETEST_ADJUSTPOS 1
300 /* ObtainGIRPort must install a 0 clipregion and
301 set scrollx/scrolly of layer to 0. Since this
302 will be restored only when ReleaseGIRPort is
303 called, we must backup the orig values somewhere */
307 struct Region
*clipregion
;
317 #define IP_OLDOVERSCAN 3
318 #define IP_OLDICONTROL 4
319 #define IP_OLDPOINTER 7
320 #define IP_OLDPALETTE 8
323 #define IP_SCREENMODE 1
324 #define IP_FONT 101//2
325 #define IP_ICONTROL 102//4
326 #define IP_POINTER 103//7
327 #define IP_PTRCOLOR 104//8
328 #define IP_PALETTE 105
329 #define IP_IACTIONS 20
330 #define IP_IEXTENSIONS 21
331 #define IP_INPUTEXT 22
335 struct IScreenModePrefs
344 struct IIControlPrefs
350 UBYTE ic_FrontToBack
;
357 #include <intuition/iprefs.h>
368 #define COLORTABLEENTRIES 8
372 #define RESOURCELIST_HASHSIZE 256
374 #define RESOURCE_WINDOW 1
375 #define RESOURCE_SCREEN 2
384 /* Internal Screen Notification Data */
385 struct IntScreenNotify
388 struct MsgPort
*port
;
389 struct Task
*sigtask
;
398 struct IntIntuitionBase
400 struct IntuitionBase IBase
;
402 WORD _MinXMouse
,_MaxXMouse
; /* Old 1.3 Base entries*/
403 WORD _MinYMouse
,_MaxYMouse
; /* Old 1.3 Base entries*/
404 ULONG _StartSecs
,_StartMicros
; /* Old 1.3 Base entries*/
405 char *SystemRequestTitle
; /* written by locale as it seems..what a crappy interface*/
406 char *WorkbenchTitle
; /* written by locale as it seems..what a crappy interface*/
409 * savety pad for intuitionbase accesses
410 * probably needs to be smarter
415 /* Put local shit here, invisible for the user */
417 struct Library
*CyberGfxBase
;
418 struct Library
*MUIMasterBase
;
421 struct Library
*InputBase
;
422 struct Library
*TimerBase
;
423 struct MsgPort
*TimerMP
;
424 struct timerequest
*TimerIO
;
426 struct MsgPort
*WorkBenchMP
;
427 struct Screen
*WorkBench
;
428 struct SignalSemaphore
*IBaseLock
;
430 /* Intuition input handlers replyport. This one is set
431 int rom/inputhandler.c/InitIIH()
433 struct MsgPort
*IntuiReplyPort
;
434 struct MinList
*IntuiActionQueue
;
435 struct IOStdReq
*InputIO
;
436 struct MsgPort
*InputMP
;
438 /* Intuition Screennotify Replyport if SNOTIFY_WAIT_REPLY is specified */
440 struct MsgPort
*ScreenNotifyReplyPort
;
442 BOOL InputDeviceOpen
;
443 struct Interrupt
*InputHandler
;
445 struct Hook
*GlobalEditHook
;
446 /* The default global edit hook */
447 struct Hook DefaultEditHook
;
450 APTR DriverData
; /* Pointer which the driver may use */
452 struct Screen
*DefaultPubScreen
;
453 struct SignalSemaphore PubScrListLock
;
454 struct MinList PubScreenList
;
455 UWORD pubScrGlobalMode
;
457 struct SignalSemaphore ScreenNotificationListLock
;
458 struct List ScreenNotificationList
;
460 struct SignalSemaphore GadgetLock
;
461 struct SignalSemaphore MenuLock
;
462 struct SignalSemaphore WindowLock
;
463 struct SignalSemaphore IntuiActionLock
;
464 struct SignalSemaphore InputHandlerLock
;
465 struct LayerContext BackupLayerContext
;
467 struct IClass
*dragbarclass
;
468 struct IClass
*sizebuttonclass
;
472 struct Preferences
*DefaultPreferences
;
473 struct Preferences
*ActivePreferences
;
475 struct MsgPort
*MenuHandlerPort
;
478 struct TextFont
*ScreenFont
;
479 struct TextFont
*TopazFont
;
481 /* Dos function DisplayError() before intuition.library patched it */
482 APTR OldDisplayErrorFunc
;
484 struct SignalSemaphore ClassListLock
;
485 struct MinList ClassList
;
486 struct IClass RootClass
;
489 struct ViewExtra
*ViewLordExtra
;
494 ULONG
*SmallMenuPool
;
498 struct IScreenModePrefs ScreenModePrefs
;
499 struct IIControlPrefs IControlPrefs
;
501 struct IAction
*IControlActions
;
502 struct IControlExtensions IControlExtensions
;
503 ULONG NumIControlActions
;
504 struct InputPrefsExt InputPrefsExt
;
506 struct IClass
*pointerclass
;
507 Object
*DefaultPointer
;
509 UWORD DriPens2
[NUMDRIPENS
];
510 UWORD DriPens4
[NUMDRIPENS
];
511 UWORD DriPens8
[NUMDRIPENS
];
512 struct Color32 Colors
[COLORTABLEENTRIES
];
515 struct IntScreen
*MenuVerifyScreen
;
519 struct SignalSemaphore DataTypesSem
;
520 struct Library
*DataTypesBase
; /* should be opened ONLY by int_InitCustomChanges!*/
524 ULONG LastClickMicro
; /* for doubleclick to front */
525 ULONG DoubleClickCounter
;
526 ULONG DoubleClickButton
;
529 struct Hook transphook
; /* hook for windows with intui transp */
530 struct Hook notransphook
; /* hook for windows with no additional transp (borderless,etc) */
532 //#ifdef INTUITION_NOTIFY_SUPPORT // commented to avoid offset fuckup! - Piru
533 struct Library
*ScreenNotifyBase
;
534 struct Library
*NotifyIntuitionBase
;
537 struct RastPort DoGadgetMethodRP
;
538 struct GadgetInfo DoGadgetMethodGI
;
540 struct SignalSemaphore WinDecorSem
;
542 struct SignalSemaphore ScrDecorSem
;
544 struct SignalSemaphore MenuDecorSem
;
545 Object
*MenuDecorObj
;
547 Object
*DefWinDecorObj
;
548 Object
*DefScrDecorObj
;
549 Object
*DefMenuDecorObj
;
551 struct List Decorations
;
552 struct NewDecorator
*Decorator
;
558 #if USE_NEWDISPLAYBEEP
562 WORD prop_clickoffset_x
, prop_clickoffset_y
;
564 struct MinList ResourceList
[RESOURCELIST_HASHSIZE
];
566 /* Menu Look Settings */
572 struct ExtSprite
*sprite
;
573 WORD xoffset
, yoffset
;
577 struct SharedPointer
*CreateSharedPointer(struct ExtSprite
*, int, int, struct IntuitionBase
*);
578 void ObtainSharedPointer(struct SharedPointer
*, struct IntuitionBase
*);
579 void ReleaseSharedPointer(struct SharedPointer
*, struct IntuitionBase
*);
581 #ifdef INTUITION_NOTIFY_SUPPORT
582 void sn_DoNotify(ULONG type
, APTR value
, struct Library
*_ScreenNotifyBase
);
588 struct Screen
*dri_Screen
;
589 struct SignalSemaphore dri_WinDecorSem
;
590 Object
*dri_WinDecorObj
;
591 struct SignalSemaphore dri_ScrDecorSem
;
592 Object
*dri_ScrDecorObj
;
595 #define LOCK_WINDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
596 #define LOCKSHARED_WINDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
597 #define UNLOCK_WINDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->WinDecorSem);
599 #define LOCK_SCRDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
600 #define LOCKSHARED_SCRDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
601 #define UNLOCK_SCRDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->ScrDecorSem);
603 #define LOCK_MENUDECOR(IntuitionBase) ObtainSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
604 #define LOCKSHARED_MENUDECOR(IntuitionBase) ObtainSemaphoreShared(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
605 #define UNLOCK_MENUDECOR(IntuitionBase) ReleaseSemaphore(&((struct IntIntuitionBase *)(IntuitionBase))->MenuDecorSem);
609 struct Screen Screen
;
612 struct HashNode hashnode
;
613 struct IntDrawInfo DInfo
;
614 struct TTextAttr textattr
;
615 ULONG textattrtags
[3];
616 UWORD Pens
[NUMDRIPENS
];
617 struct PubScreenNode
*pubScrNode
;
620 struct Layer
*rootLayer
;
621 ULONG DisplayBeepColor0
[3];
622 struct Window
*DisplayBeepWindow
;
624 struct MonitorSpec
*Monitor
;
625 struct SharedPointer
*Pointer
;
626 struct Window
*MenuVerifyActiveWindow
;
627 int MenuVerifyTimeOut
;
628 int MenuVerifyMsgCount
;
629 ULONG MenuVerifySeconds
;
630 ULONG MenuVerifyMicros
;
631 ULONG DecorUserBufferSize
;
632 IPTR DecorUserBuffer
;
635 Object
*MenuDecorObj
;
636 struct NewDecorator
*Decorator
;
638 struct BitMap
*AllocatedBitmap
;
648 struct SkinInfo SkinInfo
;
649 struct RastPort
*TitlebarBufferRP
;
650 struct Window
*TitlebarBufferWin
;
651 ULONG TitlebarWinWidth
;
652 ULONG TitlebarWinActive
;
654 #if USE_NEWDISPLAYBEEP
655 UBYTE BeepingCounter
;
659 #define GetPrivScreen(s) ((struct IntScreen *)s)
662 #define SF_IsParent (0x0001)
663 #define SF_IsChild (0x0002)
664 #define SF_InvisibleBar (0x0004)
665 #define SF_AppearingBar (0x0008)
666 #define SF_SysFont (0x0010)
668 struct IntIntuiMessage
670 struct ExtIntuiMessage eimsg
;
673 ** The following field is needed, because in case of IDCMP_RAWKEY
674 ** IntuiMessage->IAddress is a pointer to this data, not the data
675 ** itself (which is the case for IDCMP_VANILLAKEY)
681 #define INT_INTUIMESSAGE(x) ((struct IntIntuiMessage *)(x))
685 /*extern struct IntuitionBase * IntuitionBase;*/
687 #define IW(window) ((struct IntWindow *) (window))
689 #define GetPubIBase(ib) ((struct IntuitionBase *)ib)
690 #define GetPrivIBase(ib) ((struct IntIntuitionBase *)ib)
696 #define CyberGfxBase (GetPrivIBase(IntuitionBase)->CyberGfxBase)
699 #define MUIMasterBase (GetPrivIBase(IntuitionBase)->MUIMasterBase)
706 #define InputBase (GetPrivIBase(IntuitionBase)->InputBase)
711 #define TimerBase (GetPrivIBase(IntuitionBase)->TimerBase)
716 #define TimerMP (GetPrivIBase(IntuitionBase)->TimerMP)
721 #define TimerIO (GetPrivIBase(IntuitionBase)->TimerIO)
723 #define PublicClassList ((struct List *)&(GetPrivIBase(IntuitionBase)->ClassList))
726 /* stegerg: one can have sysgadgets outside of window border! All sysgadgets in window
727 border must have set GACT_???BORDER and, if they are in a gzz window, also
730 #define IS_GZZ_GADGET(gad) (((gad)->GadgetType) & GTYP_GZZGADGET)
732 #define IS_BORDER_GADGET(gad) (IS_GZZ_GADGET(gad) || \
733 ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER)))
735 #define IS_SYS_GADGET(gad) (((gad)->GadgetType) & GTYP_SYSTYPEMASK)
737 #define IS_BOOPSI_GADGET(gad) (((gad)->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET)
739 /*#define IS_BORDER_GADGET(gad) \
740 (((gad->GadgetType) & GTYP_SYSGADGET) \
741 || ((gad)->Activation & (GACT_RIGHTBORDER|GACT_LEFTBORDER|GACT_TOPBORDER|GACT_BOTTOMBORDER))) */
743 #define IS_REQ_GADGET(gad) ((gad)->GadgetType & GTYP_REQGADGET)
745 #define IS_SCREEN_GADGET(gad) ((gad)->GadgetType & GTYP_SCRGADGET)
747 #define SET_GI_RPORT(gi, w, req, gad) \
748 (gi)->gi_RastPort = (IS_SCREEN_GADGET(gad) ? \
749 ((gi)->gi_Screen->BarLayer ? (gi)->gi_Screen->BarLayer->rp : NULL) : \
750 (IS_BORDER_GADGET(gad) ? (w)->BorderRPort : \
751 ((req) ? ((req)->ReqLayer->rp) : (w)->RPort)) \
755 #define REFRESHGAD_BOOPSI 1 /* boopsi gadgets */
756 #define REFRESHGAD_BORDER 2 /* gadgets in window border */
757 #define REFRESHGAD_REL 4 /* gadgets with GFLG_RELRIGHT, GFLG_RELBOTTOM,GFLG_RELWIDTH, GFLG_RELHEIGHT */
758 #define REFRESHGAD_RELS 8 /* GFLG_RELSPECIAL gadgets */
759 #define REFRESHGAD_TOPBORDER 16 /* used by setwindowtitle */
760 #define REFRESHGAD_NOGADTOOLS 32 /* used in some cases for _mustbe_ */
762 #define SYSGADGET_ACTIVE (iihdata->ActiveSysGadget != NULL)
764 VOID
int_refreshglist(struct Gadget
*gadgets
, struct Window
*window
,
765 struct Requester
*requester
, LONG numGad
, LONG mustbe
, LONG mustnotbe
,
766 struct IntuitionBase
*IntuitionBase
);
768 VOID
int_RefreshWindowFrame(struct Window
*window
, LONG mustbe
, LONG mustnotbe
,
770 struct IntuitionBase
*IntuitionBase
);
772 #define int_refreshwindowframe(a,b,c,d) int_RefreshWindowFrame(a,b,c,0,d);
774 /* Keep the system gadgets in the same order than the original intuition,
775 * some programs make bad asumptions about that...
793 #define SYSGAD(w, idx) (((struct IntWindow *)(w))->sysgads[idx])
797 struct Window window
;
799 Object
*sysgads
[NUM_SYSGADS
];
800 struct Image
*AmigaKey
;
801 struct Image
*Checkmark
;
802 struct Image
*SubMenuImage
;
803 struct Window
*menulendwindow
;
805 struct HashNode hashnode
;
807 /* When the Zoom gadget is pressed the window will have the
808 dimensions stored here. The old dimensions are backed up here
815 /* max. number of mousemove events to send to this window */
818 /* act. number of mousemove events sent to this window */
819 WORD num_mouseevents
;
821 /* max. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
822 messages to send to this window */
825 /* act. number of repeated IDCMP_RAWKEY, IDCMP_VANILLAKEY and IDCMP_IDCMPUPDATE
826 messages sent to this window */
827 WORD num_repeatevents
;
829 #if USE_IDCMPUPDATE_MESSAGECACHE
830 /* number of unreplied IDCMP_IDCMPUPDATE messages sent to window
831 used in few hacks :) */
832 WORD num_idcmpupdate
;
835 WORD sizeimage_width
;
836 WORD sizeimage_height
;
846 ULONG extrabuttonsid
; /* replaces ETI_Dummy if apps wishes it */
848 ULONG titlepos
; /* used by titlebar pattern fill stuff */
855 struct Region
*transpregion
;
856 struct Hook
*usertransphook
;
857 struct Region
*usertranspregion
;
861 struct Region
*trashregion
;
863 char titlebuffer
[TITLEBUFFERLEN
+1];
865 #if USE_IDCMPUPDATE_MESSAGECACHE
866 struct IntuiMessage
*messagecache
; //for idcmpupdate cache
869 struct Layer
*wlayer
;
870 struct Layer
*borderlayer
;
872 struct timeval lastmsgsent
;
873 struct timeval lastmsgreplied
;
875 #ifdef TIMEVALWINDOWACTIVATION
876 struct timeval activationtime
;
880 struct Hook custombackfill
;
883 struct Hook DefaultWindowShapeHook
;
885 struct Region
*OutlineShape
;
886 ULONG DecorUserBufferSize
;
887 IPTR DecorUserBuffer
;
890 #define SPFLAG_ICONIFIED 1
891 #define SPFLAG_NOICONIFY 2
892 #define SPFLAG_SKININFO 4
893 #define SPFLAG_LAYERREFRESH 8
894 #define SPFLAG_TRANSPHOOK 16
895 #define SPFLAG_LAYERRESIZED 32
896 #define SPFLAG_USERPORT 64
897 #define SPFLAG_IAMDEAD 128
898 #define SPFLAG_CLOSING 256 //used with iamdead
899 #define SPFLAG_WANTBUFFER 512
901 #define HELPF_ISHELPGROUP 1
902 #define HELPF_GADGETHELP 2
904 #define IS_NOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? TRUE : FALSE)
905 #define IS_DOCAREREFRESH(win) (((win)->Flags & WFLG_NOCAREREFRESH) ? FALSE : TRUE )
906 #define IS_SIMPLEREFRESH(win) (((win)->Flags & WFLG_SIMPLE_REFRESH) ? TRUE : FALSE)
907 #define IS_GZZWINDOW(win) (((win)->Flags & WFLG_GIMMEZEROZERO) ? TRUE : FALSE)
910 /* Flag definitions for MoreFlags */
912 #define WMFLG_NOTIFYDEPTH (1 << 0) /* Window wants notification when
913 it's depth arranged */
915 #define WMFLG_DO_UNLOCKPUBSCREEN (1 << 1)
916 #define WMFLG_MENUHELP (1 << 2)
917 #define WMFLG_POINTERDELAY (1 << 3)
918 #define WMFLG_TABLETMESSAGES (1 << 4)
920 // FIXME: ehm... this one should die a horrible death!
921 #define WMFLG_IAMMUI (1 << 5)
923 struct IntScreenBuffer
925 struct ScreenBuffer sb
;
930 /* Driver prototypes */
932 extern int intui_init (struct IntuitionBase
*);
933 extern int intui_open (struct IntuitionBase
*);
934 extern void intui_close (struct IntuitionBase
*);
935 extern void intui_expunge (struct IntuitionBase
*);
936 extern int intui_GetWindowSize (void);
937 extern void intui_WindowLimits (struct Window
* window
, WORD MinWidth
, WORD MinHeight
, UWORD MaxWidth
, UWORD MaxHeight
);
938 extern void intui_ActivateWindow (struct Window
*);
939 extern BOOL
intui_ChangeWindowBox (struct Window
* window
, WORD x
, WORD y
,
940 WORD width
, WORD height
);
941 extern void intui_CloseWindow (struct Window
*, struct IntuitionBase
*);
942 extern void intui_MoveWindow (struct Window
* window
, WORD dx
, WORD dy
);
943 extern int intui_OpenWindow (struct Window
*, struct IntuitionBase
*,
944 struct BitMap
* SuperBitMap
, struct Hook
*backfillhook
,
945 struct Region
* shape
, struct Hook
* shapehook
,
946 struct Layer
* parent
, ULONG visible
);
947 extern void intui_SetWindowTitles (struct Window
*, CONST_STRPTR
, CONST_STRPTR
);
948 extern void intui_RefreshWindowFrame(struct Window
*win
);
949 extern struct Window
*intui_FindActiveWindow(struct InputEvent
*ie
, struct IntuitionBase
*IntuitionBase
);
950 extern void intui_ScrollWindowRaster(struct Window
* win
, WORD dx
, WORD dy
, WORD xmin
,
951 WORD ymin
, WORD xmax
, WORD ymax
,
952 struct IntuitionBase
* IntuitionBase
);
954 /* wbtasktalk protos */
956 ULONG
TellWBTaskToCloseWindows(struct IntuitionBase
*IntuitionBase
);
957 ULONG
TellWBTaskToOpenWindows(struct IntuitionBase
*IntuitionBase
);
959 /* intuition_misc protos */
960 extern void LoadDefaultPreferences(struct IntuitionBase
* IntuitionBase
);
961 Object
* CreateStdSysImage(WORD which
, WORD preferred_height
, struct Screen
*scr
, APTR buffer
,
962 struct DrawInfo
*dri
, struct IntuitionBase
*IntuitionBase
);
963 extern void CheckRectFill(struct RastPort
*rp
, WORD x1
, WORD y1
, WORD x2
, WORD y2
, struct IntuitionBase
* IntuitionBase
);
964 extern BOOL
CreateWinSysGadgets(struct Window
*w
, struct IntuitionBase
*IntuitionBase
);
965 extern VOID
KillWinSysGadgets(struct Window
*w
, struct IntuitionBase
*IntuitionBase
);
966 extern void CreateScreenBar(struct Screen
*scr
, struct IntuitionBase
*IntuitionBase
);
967 extern void KillScreenBar(struct Screen
*scr
, struct IntuitionBase
*IntuitionBase
);
968 extern void RenderScreenBar(struct Screen
*scr
, BOOL refresh
, struct IntuitionBase
*IntuitionBase
);
969 extern void UpdateMouseCoords(struct Window
*win
);
970 extern WORD
SubtractRectFromRect(struct Rectangle
*a
, struct Rectangle
*b
, struct Rectangle
*destrectarray
);
971 extern struct Region
*DefaultWindowShapeFunc(struct Hook
*hook
, struct Layer
*lay
, struct ShapeHookMsg
*msg
);
973 extern LONG
CalcResourceHash(APTR resource
);
974 extern void AddResourceToList(APTR resource
, UWORD resourcetype
, struct IntuitionBase
*IntuitionBase
);
975 extern void RemoveResourceFromList(APTR resource
, UWORD resourcetype
, struct IntuitionBase
*IntuitionBase
);
976 extern BOOL
ResourceExisting(APTR resource
, UWORD resourcetype
, struct IntuitionBase
*IntuitionBase
);
977 void FireScreenNotifyMessage(IPTR data
, ULONG flag
, struct IntuitionBase
*IntuitionBase
);
978 void FireScreenNotifyMessageCode(IPTR data
, ULONG flag
, ULONG code
, struct IntuitionBase
*IntuitionBase
);
981 extern struct RastPort
*MyCreateRastPort(struct IntuitionBase
*);
982 extern struct RastPort
*MyCloneRastPort(struct IntuitionBase
*, struct RastPort
*);
983 extern void MyFreeRastPort(struct IntuitionBase
*, struct RastPort
*);
984 extern void MySetPointerPos(struct IntuitionBase
*, int, int);
985 struct TextFont
*SafeReopenFont(struct IntuitionBase
*, struct TextFont
**);
986 extern Object
*MakePointerFromPrefs(struct IntuitionBase
*, struct Preferences
*);
987 extern Object
*MakePointerFromData(struct IntuitionBase
*, UWORD
*, int, int, int, int);
988 void InstallPointer(struct IntuitionBase
*, Object
**, Object
*);
989 void SetPointerColors(struct IntuitionBase
*IntuitionBase
);
990 struct IClass
*InitITextIClass (struct IntuitionBase
* IntuitionBase
);
991 struct Gadget
*DoActivateGadget(struct Window
*win
, struct Requester
*req
, struct Gadget
*gad
,
992 struct IntuitionBase
*IntuitionBase
);
993 VOID
DoGMLayout(struct Gadget
*glist
, struct Window
*win
, struct Requester
*req
,
994 UWORD numgad
, BOOL initial
, struct IntuitionBase
*IntuitionBase
);
995 BOOL
ih_fire_intuimessage(struct Window
* w
, ULONG Class
, UWORD Code
, APTR IAddress
,
996 struct IntuitionBase
*IntuitionBase
);
997 void NotifyDepthArrangement(struct Window
*w
, struct IntuitionBase
*IntuitionBase
);
1001 void int_PrintIText(struct RastPort
* rp
, struct IntuiText
* iText
,
1002 LONG leftOffset
, LONG topOffset
, BOOL ignore_attributes
,
1003 struct IntuitionBase
*IntuitionBase
);
1006 BOOL
IsLayerHiddenBySibling(struct Layer
*layer
, BOOL xx
);
1007 LONG
IsLayerVisible(struct Layer
*layer
);
1010 void SetupGInfo(struct GadgetInfo
*gi
, struct Window
*win
, struct Requester
*req
,
1011 struct Gadget
*gad
, struct IntuitionBase
*IntuitionBase
);
1013 IPTR
Custom_DoMethodA(struct IntuitionBase
*, struct Gadget
*, Msg
);
1019 #define DoMethodA(x, ...) (REG_A6=(LONG)IntuitionBase, DoMethodA(x, __VA_ARGS__))
1022 #define Custom_DoMethodA(x, ...) Custom_DoMethodA(IntuitionBase, x, __VA_ARGS__)
1024 #define HAS_CHILDREN(w) (NULL != w->firstchild)
1027 #define DeinitRastPort(rp) ((void)0)
1028 #define CreateRastPort() MyCreateRastPort(IntuitionBase)
1029 #define CloneRastPort(rp) MyCloneRastPort(IntuitionBase, rp)
1030 #define FreeRastPort(rp) MyFreeRastPort(IntuitionBase, rp)
1031 #define SetPointerPos(x, y) MySetPointerPos(IntuitionBase, x, y)
1032 #define MouseCoordsRelative() 1
1035 /* Replacement for dos.library/DisplayError() */
1036 AROS_UFP3(LONG
, Intuition_DisplayError
,
1037 AROS_UFPA(STRPTR
, formatStr
, A0
),
1038 AROS_UFPA(ULONG
, IDCMPFlags
, D0
),
1039 AROS_UFPA(APTR
, args
, A1
));
1041 #define POINTERA_SharedPointer 0x80039010
1044 #define dprintf kprintf
1047 #define DEBUG_ACTIVATEGADGET(x) ;
1048 #define DEBUG_ACTIVATEWINDOW(x) ;
1049 #define DEBUG_ADDCLASS(x) ;
1050 #define DEBUG_ADDGADGET(x) ;
1051 #define DEBUG_ADDGLIST(x) ;
1052 #define DEBUG_ALLOCINTUIMESSAGE(x) ;
1053 #define DEBUG_ALLOCSCREENBUFFER(x) ;
1054 #define DEBUG_ALOHAWORKBENCH(x) ;
1055 #define DEBUG_CHANGEWINDOWBOX(x) ;
1056 #define DEBUG_CLOSESCREEN(x) ;
1057 #define DEBUG_CLOSEWINDOW(x) ;
1058 #define DEBUG_CLOSEWORKBENCH(x) ;
1059 #define DEBUG_DISPOSEOBJECT(x) ;
1060 #define DEBUG_DOGADGETMETHOD(x) ;
1061 #define DEBUG_DRAWBORDER(x) ;
1062 #define DEBUG_FINDCLASS(x) ;
1063 #define DEBUG_FREEICDATA(x) ;
1064 #define DEBUG_FREEINTUIMESSAGE(x) ;
1065 #define DEBUG_FREESCREENBUFFER(x) ;
1066 #define DEBUG_FREESCREENDRAWINFO(x) ;
1067 #define DEBUG_GADGETMOUSE(x) ;
1068 #define DEBUG_GETATTR(x) ;
1069 #define DEBUG_GETDEFAULTPUBSCREEN(x) ;
1070 #define DEBUG_GETDEFPREFS(x) ;
1071 #define DEBUG_GETGADGETIBOX(x) ;
1072 #define DEBUG_GETPREFS(x) ;
1073 #define DEBUG_GETSCREENDATA(x) ;
1074 #define DEBUG_GETSCREENDRAWINFO(x) ;
1075 #define DEBUG_HIDEWINDOW(x) ;
1077 #define DEBUG_INIT(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1079 #define DEBUG_INIT(x) ;
1081 #define DEBUG_OPEN(x) ;
1082 #define DEBUG_CLOSE(x) ;
1083 #define DEBUG_INPUTEVENT(x) ;
1084 #define DEBUG_INTREFRESHGLIST(x) ;
1085 #define DEBUG_INTUITEXTLENGTH(x) ;
1086 #define DEBUG_LENDMENUS(x) ;
1087 #define DEBUG_LOCKPUBSCREEN(x) ;
1088 #define DEBUG_MAKECLASS(x) ;
1089 #define DEBUG_MODIFYIDCMP(x) ;
1090 #define DEBUG_NEWOBJECT(x) ;
1091 #define DEBUG_NEXTOBJECT(x) ;
1092 #define DEBUG_OBTAINGIRPORT(x) ;
1093 #define DEBUG_OFFGADGET(x) ;
1094 #define DEBUG_OFFMENU(x) ;
1095 #define DEBUG_ONGADGET(x) ;
1096 #define DEBUG_ONMENU(x) ;
1097 #define DEBUG_OPENSCREEN(x) ;
1098 #define DEBUG_OPENSCREENTAGLIST(x) ;
1099 #define DEBUG_OPENWINDOW(x) ;
1100 #define DEBUG_OPENWINDOWTAGLIST(x) ;
1101 #define DEBUG_OPENWORKBENCH(x) ;
1102 #define DEBUG_POINTER(x) ;
1103 #define DEBUG_PRINTITEXT(x) ;
1104 #define DEBUG_QUERYOVERSCAN(x) ;
1105 #define DEBUG_REFRESH(x) ;
1106 #define DEBUG_RELEASEGIRPORT(x) ;
1107 #define DEBUG_REMEMBER(x) ;
1108 #define DEBUG_REMOVEGLIST(x) ;
1109 #define DEBUG_REPORTMOUSE(x) ;
1110 #define DEBUG_REQUEST(x) ;
1111 #define DEBUG_SCROLLWINDOWRASTER(x) ;
1112 #define DEBUG_SENDINTUIMESSAGE(x) ;
1113 #define DEBUG_SETATTRS(x) ;
1114 #define DEBUG_SETGADGETATTRS(x) ;
1115 #define DEBUG_SETPOINTER(x) ;
1117 #define DEBUG_SETIPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1119 #define DEBUG_SETIPREFS(x) ;
1122 #define DEBUG_SETPREFS(x) if (SysBase->ex_DebugFlags & EXECDEBUGF_INIT) x;
1124 #define DEBUG_SETPREFS(x) ;
1126 #define DEBUG_SHOWWINDOW(x) ;
1127 #define DEBUG_UNLOCKPUBSCREEN(x) ;
1128 #define DEBUG_WINDOWLIMITS(x) ;
1129 #define DEBUG_WINDOWTOBACK(x) ;
1130 #define DEBUG_WINDOWTOFRONT(x) ;
1131 #define DEBUG_ZIPWINDOW(x) ;
1132 #define DEBUG_VISITOR(x) ;
1133 #define DEBUG_WORKBENCH(x) ;
1134 #define DEBUG_LOCKPUBSCREENLIST(x) ;
1135 #define DEBUG_UNLOCKPUBSCREENLIST(x) ;
1136 #define DEBUG_RETHINKDISPLAY(x) ;
1139 * Private data structures of the classes defined by intuition.library
1146 struct TagItem
*ic_Mapping
;
1147 struct TagItem
*ic_CloneTags
;
1148 ULONG ic_LoopCounter
;
1154 struct MinList memberlist
;
1160 /* render bevel only with no fill? */
1163 /* inverted bevel pens? */
1176 struct DrawInfo
*dri
;
1177 struct Image
*frame
;
1193 struct ExtGadget EG
;
1200 /* We use a propinfo structure, because we use the same routines
1201 for intuition propgadtets and in propgclass */
1203 struct PropInfo propinfo
;
1205 /* A little kludge: since the HandleMouseMove function
1206 wants dx/dy and not absolute mouse coords, we
1207 have to remember the last ones */
1212 /* One only have to store total or visble, and use some other
1213 formulas than those in the RKRM:L, but for
1214 code simplicity I store them all. */
1215 UWORD top
, visible
, total
;
1218 struct BBox
*old_knobbox
;
1219 struct Hook
*DisplayHook
;
1225 struct StringInfo StrInfo
;
1226 struct StringExtend StrExtend
;
1233 struct MinList memberlist
;
1234 struct Gadget
*activegad
;
1240 /* Current left- and topedge of moving window. Ie when the user releases
1241 the LMB after a windowdrag, the window's new coords will be (curleft, curtop)
1247 /* The current x and y coordinates relative to curleft/curtop */
1251 /* Whether the dragframe is currently drawn or erased */
1254 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1257 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1258 BOOL drag_layerlock
;
1259 #ifdef USEGADGETLOCK
1260 BOOL drag_gadgetlock
;
1262 BOOL drag_refreshed
;
1264 /* Rastport to use during update */
1265 struct RastPort
*rp
;
1267 UQUAD lasteventtime
;
1272 #ifdef USEWINDOWLOCK
1273 /* used to prevent windows from opening/closing while user drags a window */
1274 BOOL drag_windowlock
;
1277 struct Task
*movetask
;
1281 /* SizeButtonClass */
1282 struct sizebutton_data
1285 /* The current width and height of the rubber band frame */
1291 /* holds original sizes */
1297 /* the offset of the mouse pointer to the rubber band frame*/
1301 /* Whether the dragframe is currently drawn or erased */
1304 /* Used to tell GM_GOINACTIVE whether the drag was canceled or not */
1307 /* Used to tell GM_GOINACTIVE whether UnlockLayer() or not */
1308 BOOL drag_layerlock
;
1309 #ifdef USEGADGETLOCK
1310 BOOL drag_gadgetlock
;
1313 BOOL drag_refreshed
;
1315 /* Rastport to use during update */
1316 struct RastPort
*rp
;
1318 UQUAD lasteventtime
;
1320 #ifdef USEWINDOWLOCK
1321 /* used to prevent windows from opening/closing while user drags a window */
1322 BOOL drag_windowlock
;
1333 /* MenuBarLabelClass */
1334 struct MenuBarLabelData
1336 struct DrawInfo
*dri
;
1342 struct SharedPointer
*shared_pointer
;
1346 struct windecor_data
1348 ULONG userbuffersize
;
1352 struct scrdecor_data
1354 ULONG userbuffersize
;
1357 /* MenuDecorClass */
1358 struct menudecor_data
1360 ULONG userbuffersize
;
1363 #endif /* INTUITION_INTERN_H */