query a screens pre-alphacomposit processing hook and call it as appropriate.
[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     IPTR                        sbmflags;
25     struct Hook                 *prealphacomphook;
26 };
27
28 // sbmflags bits 0 to 3 are reserved for the normal compositing flags.
29 #define STACKNODEB_VISIBLE       16
30 #define STACKNODEF_VISIBLE       (1 << STACKNODEB_VISIBLE)
31 #define STACKNODEB_DISPLAYABLE   17
32 #define STACKNODEF_DISPLAYABLE   (1 << STACKNODEB_DISPLAYABLE)
33
34 struct HIDDCompositorData
35 {
36     struct GfxBase              *GraphicsBase;
37     struct IntuitionBase        *IntuitionBase;
38
39     /* Bitmap to which all screen bitmaps are composited. Height/Width always 
40        matches visible mode */
41     OOP_Object                  *displaybitmap;
42     OOP_Object                  *intermedbitmap;
43
44     /* Pointer to actuall screen bitmap, result of last HIDD_Gfx_Show().
45        Needed for graphics.library only. */
46     OOP_Object                  *screenbitmap;
47
48     /* Pointer to top bitmap on stack */
49     OOP_Object                  *topbitmap;
50
51     HIDDT_ModeID                screenmodeid;   /* ModeID of currently visible mode             */
52     struct Rectangle            displayrect;     /* Dimensions of currently visible mode         */
53     struct Region               *alpharegion;
54
55     struct MinList              bitmapstack;
56     struct SignalSemaphore      semaphore;
57
58     struct Hook                 defaultbackfill;
59     struct Hook                 *backfillhook;
60
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        */
64     ULONG                       capabilities;
65     ULONG                       flags;        
66     BOOL                        modeschanged;   /* TRUE if new top bitmap has different mode than current screenmodeid */
67 };
68
69 #define COMPSTATEB_HASALPHA     0
70 #define COMPSTATEF_HASALPHA     (1 << COMPSTATEB_HASALPHA)
71
72 #define METHOD(base, id, name) \
73   base ## __ ## id ## __ ## name (OOP_Class *cl, OOP_Object *o, struct p ## id ## _ ## name *msg)
74
75 #define LOCK_COMPOSITOR_READ       { ObtainSemaphoreShared(&compdata->semaphore); }
76 #define LOCK_COMPOSITOR_WRITE      { ObtainSemaphore(&compdata->semaphore); }
77 #define UNLOCK_COMPOSITOR          { ReleaseSemaphore(&compdata->semaphore); }
78
79 extern OOP_AttrBase HiddCompositorAttrBase;
80 extern const struct OOP_InterfaceDescr Compositor_ifdescr[];
81
82 #endif /* _COMPOSITOR_INTERN_H */