root/trunk/BAL/Graphics/WebCore/Qt/BCGraphicsLayerQt.h

Revision 1387, 4.6 kB (checked in by gpenin, 7 months ago)

merge with webkit revision 55226

Line 
1 /*
2     Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
3
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Library General Public
6     License as published by the Free Software Foundation; either
7     version 2 of the License, or (at your option) any later version.
8
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     Library General Public License for more details.
13
14     You should have received a copy of the GNU Library General Public License
15     along with this library; see the file COPYING.LIB.  If not, write to
16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17     Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef GraphicsLayerQt_h
21 #define GraphicsLayerQt_h
22
23 #if USE(ACCELERATED_COMPOSITING)
24
25 #include "GraphicsLayer.h"
26
27 #include <QtCore/qglobal.h>
28
29 #if QT_VERSION >= 0x040600
30
31 #include "GraphicsLayerClient.h"
32
33 namespace WebCore {
34
35 class GraphicsLayerQtImpl;
36
37 class GraphicsLayerQt : public GraphicsLayer {
38     friend class GraphicsLayerQtImpl;
39
40 public:
41     GraphicsLayerQt(GraphicsLayerClient*);
42     virtual ~GraphicsLayerQt();
43
44     // reimps from GraphicsLayer.h
45     virtual NativeLayer nativeLayer() const;
46     virtual PlatformLayer* platformLayer() const;
47     virtual void setNeedsDisplay();
48     virtual void setNeedsDisplayInRect(const FloatRect&);
49     virtual void setParent(GraphicsLayer* layer);
50     virtual void setName(const String& name);
51     virtual bool setChildren(const Vector<GraphicsLayer*>&);
52     virtual void addChild(GraphicsLayer*);
53     virtual void addChildAtIndex(GraphicsLayer*, int index);
54     virtual void addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling);
55     virtual void addChildBelow(GraphicsLayer* layer, GraphicsLayer* sibling);
56     virtual bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
57     virtual void removeFromParent();
58     virtual void setMaskLayer(GraphicsLayer* layer);
59     virtual void setPosition(const FloatPoint& p);
60     virtual void setAnchorPoint(const FloatPoint3D& p);
61     virtual void setSize(const FloatSize& size);
62     virtual void setTransform(const TransformationMatrix& t);
63     virtual void setChildrenTransform(const TransformationMatrix& t);
64     virtual void setPreserves3D(bool b);
65     virtual void setMasksToBounds(bool b);
66     virtual void setDrawsContent(bool b);
67     virtual void setBackgroundColor(const Color&);
68     virtual void clearBackgroundColor();
69     virtual void setContentsOpaque(bool b);
70     virtual void setBackfaceVisibility(bool b);
71     virtual void setOpacity(float opacity);
72     virtual void setContentsRect(const IntRect& r);
73     virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String& keyframesName, double timeOffset);
74     virtual void removeAnimationsForProperty(AnimatedPropertyID);
75     virtual void removeAnimationsForKeyframes(const String& keyframesName);
76     virtual void pauseAnimation(const String& keyframesName, double timeOffset);
77     virtual void suspendAnimations(double time);
78     virtual void resumeAnimations();
79     virtual void setContentsToImage(Image*);
80     virtual void setContentsToMedia(PlatformLayer*);
81     virtual void setContentsBackgroundColor(const Color&);
82     virtual void setGeometryOrientation(CompositingCoordinatesOrientation orientation);
83     virtual void setContentsOrientation(CompositingCoordinatesOrientation orientation);
84     virtual void distributeOpacity(float);
85     virtual float accumulatedOpacity() const;
86     virtual void syncCompositingState();
87
88 private:
89     OwnPtr<GraphicsLayerQtImpl> m_impl;
90 };
91
92 #else // QT_VERSION >= 0x040600
93
94 namespace WebCore {
95
96 class FloatPoint3D;
97 class FloatValueList;
98 class GraphicsContext;
99 class Image;
100 class IntSize;
101 class TextStream;
102 class TimingFunction;
103 class TransformValueList;
104
105 // GraphicsLayer is an abstraction for a rendering surface with backing store,
106 // which may have associated transformation and animations.
107
108 class GraphicsLayerQt : public GraphicsLayer {
109 public:
110     GraphicsLayerQt(GraphicsLayerClient*);
111     virtual ~GraphicsLayerQt();
112
113     virtual void setNeedsDisplay();
114     // mark the given rect (in layer coords) as needing dispay. Never goes deep.
115     virtual void setNeedsDisplayInRect(const FloatRect&);
116
117     virtual bool animateTransform(const TransformValueList&, const IntSize&, const Animation*, double beginTime, bool isTransition);
118     virtual bool animateFloat(AnimatedPropertyID, const FloatValueList&, const Animation*, double beginTime);
119 };
120 #endif // QT_VERSION >= 0x040600
121
122 }
123 #endif
124 #endif // GraphicsLayerQt_h
125
Note: See TracBrowser for help on using the browser.