Commit ffb4ceed authored by eric@webkit.org's avatar eric@webkit.org

2009-08-12 Maxime Simon <simon.maxime@gmail.com>

        Reviewed by Eric Seidel.

        [Haiku] Modifying WebCore/platform/graphics files to allow Haiku port.
        https://bugs.webkit.org/show_bug.cgi?id=28128

        * platform/graphics/BitmapImage.h: Adding getBBitmap() function.
        * platform/graphics/Color.h: rgb_color is the Color struct in Haiku.
        * platform/graphics/FloatPoint.h: BPoint is the Point class in Haiku.
        * platform/graphics/FloatRect.h: BRect is the Rect class in Haiku.
        * platform/graphics/GraphicsContext.cpp:
        * platform/graphics/GraphicsContext.h: BView is the PlatformGraphicsContext
        class for Haiku. Adding getHaikuStrokeStyle() function.
        * platform/graphics/Icon.h: Adding an empty Icon() constructor because
        this class isn't implemented for the moment.
        * platform/graphics/ImageSource.h: BBitmap is the native bitmap class
        for Haiku.
        * platform/graphics/IntPoint.h: BPoint is the Point class in Haiku.
        * platform/graphics/IntRect.h: BRect is the Rect class in Haiku.
        * platform/graphics/IntSize.h: BSize is the Size class in Haiku.
        * platform/graphics/Path.h: BRegion is the Path class in Haiku.
        * platform/graphics/Pattern.h: Adding the GraphicsDef.h header and the
        native pattern type.
        * platform/graphics/SimpleFontData.h: Adding Haiku's Font.h header.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c4efd654
2009-08-12 Maxime Simon <simon.maxime@gmail.com>
Reviewed by Eric Seidel.
[Haiku] Modifying WebCore/platform/graphics files to allow Haiku port.
https://bugs.webkit.org/show_bug.cgi?id=28128
* platform/graphics/BitmapImage.h: Adding getBBitmap() function.
* platform/graphics/Color.h: rgb_color is the Color struct in Haiku.
* platform/graphics/FloatPoint.h: BPoint is the Point class in Haiku.
* platform/graphics/FloatRect.h: BRect is the Rect class in Haiku.
* platform/graphics/GraphicsContext.cpp:
* platform/graphics/GraphicsContext.h: BView is the PlatformGraphicsContext
class for Haiku. Adding getHaikuStrokeStyle() function.
* platform/graphics/Icon.h: Adding an empty Icon() constructor because
this class isn't implemented for the moment.
* platform/graphics/ImageSource.h: BBitmap is the native bitmap class
for Haiku.
* platform/graphics/IntPoint.h: BPoint is the Point class in Haiku.
* platform/graphics/IntRect.h: BRect is the Rect class in Haiku.
* platform/graphics/IntSize.h: BSize is the Size class in Haiku.
* platform/graphics/Path.h: BRegion is the Path class in Haiku.
* platform/graphics/Pattern.h: Adding the GraphicsDef.h header and the
native pattern type.
* platform/graphics/SimpleFontData.h: Adding Haiku's Font.h header.
2009-08-12 Maxime Simon <simon.maxime@gmail.com>
Reviewed by Eric Seidel.
......@@ -45,6 +45,10 @@ class NSImage;
typedef struct HBITMAP__ *HBITMAP;
#endif
#if PLATFORM(HAIKU)
class BBitmap;
#endif
namespace WebCore {
struct FrameData;
}
......@@ -161,10 +165,16 @@ protected:
virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, CompositeOperator);
#endif
virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator);
#if PLATFORM(WX) || PLATFORM(WINCE)
virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform,
const FloatPoint& phase, CompositeOperator, const FloatRect& destRect);
#endif
#endif
#if PLATFORM(HAIKU)
virtual BBitmap* getBBitmap() const;
#endif
size_t currentFrame() const { return m_currentFrame; }
size_t frameCount();
NativeImagePtr frameAtIndex(size_t);
......
......@@ -47,6 +47,10 @@ typedef struct _GdkColor GdkColor;
class wxColour;
#endif
#if PLATFORM(HAIKU)
struct rgb_color;
#endif
namespace WebCore {
class String;
......@@ -121,6 +125,11 @@ public:
Color(CGColorRef);
#endif
#if PLATFORM(HAIKU)
Color(const rgb_color&);
operator rgb_color() const;
#endif
static bool parseHexColor(const String& name, RGBA32& rgb);
static const RGBA32 black = 0xFF000000;
......
......@@ -51,6 +51,10 @@ class QPointF;
QT_END_NAMESPACE
#endif
#if PLATFORM(HAIKU)
class BPoint;
#endif
#if PLATFORM(SKIA)
struct SkPoint;
#endif
......@@ -90,6 +94,11 @@ public:
operator QPointF() const;
#endif
#if PLATFORM(HAIKU)
FloatPoint(const BPoint&);
operator BPoint() const;
#endif
#if PLATFORM(SKIA)
operator SkPoint() const;
FloatPoint(const SkPoint&);
......
......@@ -51,6 +51,10 @@ QT_END_NAMESPACE
class wxRect2DDouble;
#endif
#if PLATFORM(HAIKU)
class BRect;
#endif
#if PLATFORM(SKIA)
struct SkRect;
#endif
......@@ -138,6 +142,11 @@ public:
operator wxRect2DDouble() const;
#endif
#if PLATFORM(HAIKU)
FloatRect(const BRect&);
operator BRect() const;
#endif
#if PLATFORM(SKIA)
FloatRect(const SkRect&);
operator SkRect() const;
......
......@@ -540,7 +540,7 @@ void GraphicsContext::setPlatformTextDrawingMode(int mode)
}
#endif
#if !PLATFORM(QT) && !PLATFORM(CAIRO) && !PLATFORM(SKIA)
#if !PLATFORM(QT) && !PLATFORM(CAIRO) && !PLATFORM(SKIA) && !PLATFORM(HAIKU)
void GraphicsContext::setPlatformStrokeStyle(const StrokeStyle&)
{
}
......
......@@ -66,6 +66,10 @@ class wxWindowDC;
#endif
#elif PLATFORM(SKIA)
typedef class PlatformContextSkia PlatformGraphicsContext;
#elif PLATFORM(HAIKU)
class BView;
typedef BView PlatformGraphicsContext;
struct pattern;
#elif PLATFORM(WINCE)
typedef struct HDC__ PlatformGraphicsContext;
#else
......@@ -381,6 +385,10 @@ namespace WebCore {
GdkEventExpose* gdkExposeEvent() const;
#endif
#if PLATFORM(HAIKU)
pattern getHaikuStrokeStyle();
#endif
private:
void savePlatformState();
void restorePlatformState();
......
......@@ -78,6 +78,8 @@ private:
#elif PLATFORM(CHROMIUM)
Icon(const PlatformIcon&);
PlatformIcon m_icon;
#elif PLATFORM(HAIKU)
Icon();
#endif
};
......
......@@ -47,6 +47,8 @@ struct _cairo_surface;
typedef struct _cairo_surface cairo_surface_t;
#elif PLATFORM(SKIA)
class NativeImageSkia;
#elif PLATFORM(HAIKU)
class BBitmap;
#elif PLATFORM(WINCE)
#include "SharedBitmap.h"
#endif
......@@ -81,6 +83,10 @@ typedef cairo_surface_t* NativeImagePtr;
class ImageDecoder;
typedef ImageDecoder* NativeImageSourcePtr;
typedef NativeImageSkia* NativeImagePtr;
#elif PLATFORM(HAIKU)
class ImageDecoder;
typedef ImageDecoder* NativeImageSourcePtr;
typedef BBitmap* NativeImagePtr;
#elif PLATFORM(WINCE)
class ImageDecoder;
typedef ImageDecoder* NativeImageSourcePtr;
......
......@@ -55,6 +55,8 @@ class QPoint;
QT_END_NAMESPACE
#elif PLATFORM(GTK)
typedef struct _GdkPoint GdkPoint;
#elif PLATFORM(HAIKU)
class BPoint;
#endif
#if PLATFORM(WX)
......@@ -121,6 +123,9 @@ public:
#elif PLATFORM(GTK)
IntPoint(const GdkPoint&);
operator GdkPoint() const;
#elif PLATFORM(HAIKU)
explicit IntPoint(const BPoint&);
operator BPoint() const;
#endif
#if PLATFORM(WX)
......
......@@ -49,6 +49,8 @@ class QRect;
QT_END_NAMESPACE
#elif PLATFORM(GTK)
typedef struct _GdkRectangle GdkRectangle;
#elif PLATFORM(HAIKU)
class BRect;
#endif
#if PLATFORM(WX)
......@@ -144,6 +146,9 @@ public:
#elif PLATFORM(GTK)
IntRect(const GdkRectangle&);
operator GdkRectangle() const;
#elif PLATFORM(HAIKU)
explicit IntRect(const BRect&);
operator BRect() const;
#endif
#if PLATFORM(CG)
......
......@@ -47,6 +47,8 @@ typedef struct tagSIZE SIZE;
QT_BEGIN_NAMESPACE
class QSize;
QT_END_NAMESPACE
#elif PLATFORM(HAIKU)
class BSize;
#endif
namespace WebCore {
......@@ -113,6 +115,11 @@ public:
operator QSize() const;
#endif
#if PLATFORM(HAIKU)
explicit IntSize(const BSize&);
operator BSize() const;
#endif
private:
int m_width, m_height;
......
......@@ -49,6 +49,9 @@ typedef WebCore::CairoPath PlatformPath;
#elif PLATFORM(SKIA)
class SkPath;
typedef SkPath PlatformPath;
#elif PLATFORM(HAIKU)
class BRegion;
typedef BRegion PlatformPath;
#elif PLATFORM(WINCE)
namespace WebCore {
class PlatformPath;
......
......@@ -53,6 +53,9 @@ typedef wxGraphicsBrush* PlatformPatternPtr;
class wxBrush;
typedef wxBrush* PlatformPatternPtr;
#endif // USE(WXGC)
#elif PLATFORM(HAIKU)
#include <interface/GraphicsDefs.h>
typedef pattern* PlatformPatternPtr;
#elif PLATFORM(WINCE)
typedef void* PlatformPatternPtr;
#endif
......
......@@ -45,6 +45,10 @@ typedef struct OpaqueATSUStyle* ATSUStyle;
#include <QFont>
#endif
#if PLATFORM(HAIKU)
#include <Font.h>
#endif
namespace WebCore {
class FontDescription;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment