small refactor to region handling
[AROS.git] / workbench / devs / monitors / Compositor / compositor_intern.h
blobe391e099a3dc2b594cfd56e4805b9052ca5f8bd7
1 #ifndef _COMPOSITOR_INTERN_H
2 #define _COMPOSITOR_INTERN_H
4 /*
5 Copyright © 2010-2013, The AROS Development Team. All rights reserved.
6 $Id$
7 */
9 #include "compositor.h"
11 #include <exec/nodes.h>
12 #include <exec/lists.h>
13 #include <exec/semaphores.h>
14 #include <graphics/gfx.h>
16 struct StackBitMapNode
18 struct MinNode n;
19 OOP_Object *bm;
20 struct Region *screenregion;
21 SIPTR leftedge; /* Offset */
22 SIPTR topedge;
23 IPTR sbmflags;
24 struct Hook *prealphacomphook;
27 // sbmflags bits 0 to 3 are reserved for the normal compositing flags.
28 #define STACKNODEB_VISIBLE 16
29 #define STACKNODEF_VISIBLE (1 << STACKNODEB_VISIBLE)
30 #define STACKNODEB_DISPLAYABLE 17
31 #define STACKNODEF_DISPLAYABLE (1 << STACKNODEB_DISPLAYABLE)
33 struct HIDDCompositorData
35 struct GfxBase *GraphicsBase;
36 struct IntuitionBase *IntuitionBase;
38 ULONG capabilities;
39 ULONG flags;
41 /* Bitmap to which all screen bitmaps are composited. Height/Width always
42 matches visible mode */
43 OOP_Object *displaybitmap;
44 OOP_Object *intermedbitmap;
46 /* Pointer to actuall screen bitmap, result of last HIDD_Gfx_Show().
47 Needed for graphics.library only. */
48 OOP_Object *screenbitmap;
50 /* Pointer to top bitmap on stack */
51 OOP_Object *topbitmap;
53 struct Rectangle displayrect; /* Dimensions of currently visible mode */
54 struct Region *alpharegion;
56 struct MinList bitmapstack;
57 struct SignalSemaphore semaphore;
59 struct Hook *backfillhook;
61 OOP_Object *gfx; /* GFX driver object */
62 OOP_Object *fb; /* Framebuffer bitmap (if present) */
63 OOP_Object *gc; /* GC object used for drawing operations */
65 ULONG displayid;
66 HIDDT_ModeID displaymode; /* ModeID of currently visible mode */
67 UBYTE displaydepth;
69 struct Hook defaultbackfill;
70 BOOL modeschanged; /* TRUE if new top bitmap has different mode than current displaymode */
73 #define COMPSTATEB_HASALPHA 0
74 #define COMPSTATEF_HASALPHA (1 << COMPSTATEB_HASALPHA)
76 #define METHOD(base, id, name) \
77 base ## __ ## id ## __ ## name (OOP_Class *cl, OOP_Object *o, struct p ## id ## _ ## name *msg)
79 #define LOCK_COMPOSITOR_READ { ObtainSemaphoreShared(&compdata->semaphore); }
80 #define LOCK_COMPOSITOR_WRITE { ObtainSemaphore(&compdata->semaphore); }
81 #define UNLOCK_COMPOSITOR { ReleaseSemaphore(&compdata->semaphore); }
83 extern OOP_AttrBase HiddCompositorAttrBase;
84 extern const struct OOP_InterfaceDescr Compositor_ifdescr[];
86 #endif /* _COMPOSITOR_INTERN_H */