update copyrights
[aros:aros.git] / AROS / workbench / devs / monitors / Compositor / compositor_intern.h
1 #ifndef _COMPOSITOR_INTERN_H
2 #define _COMPOSITOR_INTERN_H
3
4 /*
5     Copyright © 2010-2013, The AROS Development Team. All rights reserved.
6     $Id$
7 */
8
9 #include "compositor.h"
10
11 #include <exec/nodes.h>
12 #include <exec/lists.h>
13 #include <exec/semaphores.h>
14 #include <graphics/gfx.h>
15
16 struct StackBitMapNode
17 {
18     struct MinNode              n;
19     OOP_Object                  *bm;
20     struct Region               *screenregion;
21     struct Rectangle            screenvisiblerect;      /* Visible part */
22     SIPTR                       leftedge;               /* Offset */
23     SIPTR                       topedge;
24     ULONG                       sbmflags;
25 };
26
27 #define STACKNODE_ALPHA         (1 << 0)
28 #define STACKNODE_VISIBLE       (1 << 1)
29
30 struct HIDDCompositorData
31 {
32     struct GfxBase              *GraphicsBase;
33     /* Bitmap to which all screen bitmaps are composited. Height/Width always 
34        matches visible mode */
35     OOP_Object                  *compositedbitmap;
36
37     /* Pointer to actuall screen bitmap, result of last HIDD_Gfx_Show().
38        Needed for graphics.library only. */
39     OOP_Object                  *screenbitmap;
40
41     /* Pointer to top bitmap on stack */
42     OOP_Object                  *topbitmap;
43
44     HIDDT_ModeID                screenmodeid;   /* ModeID of currently visible mode             */
45     struct Rectangle            screenrect;     /* Dimensions of currently visible mode         */
46
47     struct MinList              bitmapstack;
48     struct SignalSemaphore      semaphore;
49
50     struct Region               *alpharegion;
51
52     struct Hook                 defaultbackfill;
53     struct Hook                 *backfillhook;
54
55     OOP_Object                  *gfx;           /* GFX driver object                            */
56     OOP_Object                  *fb;            /* Framebuffer bitmap (if present)              */
57     OOP_Object                  *gc;            /* GC object used for drawing operations        */
58     ULONG                       capabilities;
59     BOOL                        modeschanged;   /* TRUE if new top bitmap has different mode than current screenmodeid */
60 };
61
62 #define METHOD(base, id, name) \
63   base ## __ ## id ## __ ## name (OOP_Class *cl, OOP_Object *o, struct p ## id ## _ ## name *msg)
64
65 #define LOCK_COMPOSITOR_READ       { ObtainSemaphoreShared(&compdata->semaphore); }
66 #define LOCK_COMPOSITOR_WRITE      { ObtainSemaphore(&compdata->semaphore); }
67 #define UNLOCK_COMPOSITOR          { ReleaseSemaphore(&compdata->semaphore); }
68
69 extern OOP_AttrBase HiddCompositorAttrBase;
70 extern const struct OOP_InterfaceDescr Compositor_ifdescr[];
71
72 #define IS_COMPOSITOR_ATTR(attr, idx)  \
73         ( ( ( idx ) = (attr) - HiddCompositorAttrBase) < num_Hidd_Compositor_Attrs)
74
75 #endif /* _COMPOSITOR_INTERN_H */