00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef BCGraphicsContext_h
00028 #define BCGraphicsContext_h
00029
00030 #include "BIGraphicsContext.h"
00031 #include "FloatRect.h"
00032 #include "Font.h"
00033 #include "IntRect.h"
00034 #include "Pen.h"
00035 #include "TextDirection.h"
00036 #include "TextStyle.h"
00037 #include <wtf/Noncopyable.h>
00038
00039 #include "Widget.h"
00040
00041 typedef struct SDL_Surface PlatformGraphicsContext;
00042
00043 class DeprecatedString;
00044
00045 namespace WebCore {
00046
00047 class IntPoint;
00048 class IntPointArray;
00049 class Path;
00050
00051 #if SVG_SUPPORT
00052 class KRenderingDeviceContext;
00053 #endif
00054 }
00055
00056 namespace BAL {
00057
00058 class GraphicsContextPrivate;
00059 class GraphicsContextPlatformPrivate;
00060
00061 class BCGraphicsContext : Noncopyable, public BIGraphicsContext {
00062 public:
00063 BCGraphicsContext(bool isReal);
00064 virtual ~BCGraphicsContext();
00065
00066 PlatformGraphicsContext* platformContext() const;
00067 IMPLEMENT_BIGRAPHICSCONTEXT;
00068
00069 #if SVG_SUPPORT
00070 #ifndef __OWB__
00071 KRenderingDeviceContext* createRenderingDeviceContext();
00072 #endif
00073 #endif
00074
00075 private:
00076 void realDraw(BINativeImage*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator);
00077 void realDrawTiled(BINativeImage*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, CompositeOperator);
00078 void realDrawTiled(BINativeImage*, const FloatRect& dstRect, const FloatRect& srcRect, TileRule hRule, TileRule vRule, CompositeOperator);
00079
00080 void drawArc(int zone, int xc, int yc, float& x0, float& y0, float x1, float y1, bool doSwap);
00081
00082 private:
00083
00084 int focusRingWidth() const;
00085 int focusRingOffset() const;
00086 const Vector<IntRect>& focusRingRects() const;
00087
00088 static GraphicsContextPrivate* createGraphicsContextPrivate();
00089 static void destroyGraphicsContextPrivate(GraphicsContextPrivate*);
00090
00091 GraphicsContextPrivate* m_common;
00092 GraphicsContextPlatformPrivate* m_data;
00093 float m_alphaLayerValue;
00094
00095 const BTWidget* m_widget;
00096 };
00097
00098 }
00099 #endif