1/*
2 * Copyright 2011, 2012 Collabora Limited
3 * Copyright (C) 2012 Intel Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU Lesser General Public License,
7 * version 2.1, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT ANY
10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19
20#ifndef GraphicsLayerActor_h
21#define GraphicsLayerActor_h
22
23#if USE(ACCELERATED_COMPOSITING)
24
25#include "GraphicsLayerClutter.h"
26#include <clutter/clutter.h>
27#include <cogl/cogl.h>
28#include <glib-object.h>
29
30G_BEGIN_DECLS
31
32#define GRAPHICS_LAYER_TYPE_ACTOR graphics_layer_actor_get_type()
33
34#define GRAPHICS_LAYER_ACTOR(obj) \
35    (G_TYPE_CHECK_INSTANCE_CAST((obj), \
36    GRAPHICS_LAYER_TYPE_ACTOR, GraphicsLayerActor))
37
38#define GRAPHICS_LAYER_ACTOR_CLASS(klass) \
39    (G_TYPE_CHECK_CLASS_CAST((klass), \
40    GRAPHICS_LAYER_TYPE_ACTOR, GraphicsLayerActorClass))
41
42#define GRAPHICS_LAYER_IS_ACTOR(obj) \
43    (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
44    GRAPHICS_LAYER_TYPE_ACTOR))
45
46#define GRAPHICS_LAYER_IS_ACTOR_CLASS(klass) \
47    (G_TYPE_CHECK_CLASS_TYPE((klass), \
48    GRAPHICS_LAYER_TYPE_ACTOR))
49
50#define GRAPHICS_LAYER_ACTOR_GET_CLASS(obj) \
51    (G_TYPE_INSTANCE_GET_CLASS((obj), \
52    GRAPHICS_LAYER_TYPE_ACTOR, GraphicsLayerActorClass))
53
54typedef struct _GraphicsLayerActor GraphicsLayerActor;
55typedef struct _GraphicsLayerActorClass GraphicsLayerActorClass;
56typedef struct _GraphicsLayerActorPrivate GraphicsLayerActorPrivate;
57
58/**
59 * GraphicsLayerActor:
60 *
61 * The contents of this structure are private and should only be accessed
62 * through the public API.
63 */
64struct _GraphicsLayerActor {
65    ClutterRectangle parent;
66    GraphicsLayerActorPrivate *priv;
67};
68
69struct _GraphicsLayerActorClass {
70    ClutterRectangleClass parent_class;
71};
72
73GType graphics_layer_actor_get_type(void) G_GNUC_CONST;
74
75GraphicsLayerActor* graphicsLayerActorNewWithClient(WebCore::GraphicsLayerClutter::LayerType, WebCore::PlatformClutterLayerClient*);
76
77WebCore::GraphicsLayerClutter::LayerType graphicsLayerActorGetLayerType(GraphicsLayerActor*);
78void graphicsLayerActorSetLayerType(GraphicsLayerActor*, WebCore::GraphicsLayerClutter::LayerType);
79
80WebCore::PlatformClutterLayerClient* graphicsLayerActorGetClient(GraphicsLayerActor*);
81void graphicsLayerActorSetClient(GraphicsLayerActor*, WebCore::PlatformClutterLayerClient*);
82
83void graphicsLayerActorInvalidateRectangle(GraphicsLayerActor*, const WebCore::FloatRect&);
84void graphicsLayerActorSetScrollPosition(GraphicsLayerActor*, float, float);
85void graphicsLayerActorSetTranslateX(GraphicsLayerActor*, float);
86float graphicsLayerActorGetTranslateX(GraphicsLayerActor*);
87void graphicsLayerActorSetTranslateY(GraphicsLayerActor*, float);
88float graphicsLayerActorGetTranslateY(GraphicsLayerActor*);
89
90void graphicsLayerActorRemoveFromSuperLayer(GraphicsLayerActor*);
91
92void graphicsLayerActorSetAnchorPoint(GraphicsLayerActor*, float, float, float);
93void graphicsLayerActorSetDrawsContent(GraphicsLayerActor*, bool drawsContent);
94void graphicsLayerActorSetFlatten(GraphicsLayerActor*, bool flatten);
95void graphicsLayerActorSetMasksToBounds(GraphicsLayerActor*, bool masksToBounds);
96void graphicsLayerActorSetSublayers(GraphicsLayerActor*, WebCore::GraphicsLayerActorList&);
97void graphicsLayerActorSetSurface(GraphicsLayerActor*, cairo_surface_t*);
98
99WebCore::PlatformClutterAnimation* graphicsLayerActorGetAnimationForKey(GraphicsLayerActor*, const String);
100
101G_END_DECLS
102
103#endif // USE(ACCELERATED_COMPOSITING)
104
105#endif /* GraphicsLayerActor_h */
106