mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:32:56 +00:00
[PSDK][GDIPLUS]
Make previously untested GDI+ C++ wrappers compilable. This involves: - adding the respective headers to gdiplus.h in a sensible order - adding forward-declarations - adding friend-declarations, so that the wrapper functions in those classes can access the private GpXXX members - const-qualifying the getters in class Color - adding the EmfToWmfBitsFlags enum - commenting out bits that use unavailable flatapi functions - commenting out bits that for some reason the compiler does not like - the typical typo/data type fixes that untested code tends to need - moving the Font class within the same header to fulfill dependencies - adding private GpXXX members to otherwise unimplemented classes - adding a data-members-only implementation of SizeF svn path=/trunk/; revision=72852
This commit is contained in:
parent
6a6a58912e
commit
0e026443cf
10 changed files with 226 additions and 156 deletions
|
@ -42,6 +42,18 @@ namespace Gdiplus
|
||||||
{
|
{
|
||||||
#include "gdiplusflat.h"
|
#include "gdiplusflat.h"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#include "gdiplusbase.h"
|
||||||
|
#include "gdiplusmatrix.h"
|
||||||
|
#include "gdiplusimageattributes.h"
|
||||||
|
#include "gdiplusbrush.h"
|
||||||
|
#include "gdipluspen.h"
|
||||||
|
#include "gdiplusstringformat.h"
|
||||||
|
#include "gdipluspath.h"
|
||||||
|
#include "gdiplusgraphics.h"
|
||||||
|
#include "gdiplusheaders.h"
|
||||||
|
#include "gdiplusmetafile.h"
|
||||||
|
#include "gdipluslinecaps.h"
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* end c++ includes */
|
#else /* end c++ includes */
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
#ifndef _GDIPLUSBRUSH_H
|
#ifndef _GDIPLUSBRUSH_H
|
||||||
#define _GDIPLUSBRUSH_H
|
#define _GDIPLUSBRUSH_H
|
||||||
|
|
||||||
|
class Image;
|
||||||
|
|
||||||
class Brush : public GdiplusBase
|
class Brush : public GdiplusBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -54,47 +54,47 @@ public:
|
||||||
Argb = a << 24 | r << 16 | g << 8 | b;
|
Argb = a << 24 | r << 16 | g << 8 | b;
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE GetA(VOID)
|
BYTE GetA(VOID) const
|
||||||
{
|
{
|
||||||
return (Argb >> 24) & 0xff;
|
return (Argb >> 24) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE GetAlpha(VOID)
|
BYTE GetAlpha(VOID) const
|
||||||
{
|
{
|
||||||
return (Argb >> 24) & 0xff;
|
return (Argb >> 24) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE GetB(VOID)
|
BYTE GetB(VOID) const
|
||||||
{
|
{
|
||||||
return Argb & 0xff;
|
return Argb & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE GetBlue(VOID)
|
BYTE GetBlue(VOID) const
|
||||||
{
|
{
|
||||||
return Argb & 0xff;
|
return Argb & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE GetG(VOID)
|
BYTE GetG(VOID) const
|
||||||
{
|
{
|
||||||
return (Argb >> 8) & 0xff;
|
return (Argb >> 8) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE GetGreen(VOID)
|
BYTE GetGreen(VOID) const
|
||||||
{
|
{
|
||||||
return (Argb >> 8) & 0xff;
|
return (Argb >> 8) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE GetR(VOID)
|
BYTE GetR(VOID) const
|
||||||
{
|
{
|
||||||
return (Argb >> 16) & 0xff;
|
return (Argb >> 16) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE GetRed(VOID)
|
BYTE GetRed(VOID) const
|
||||||
{
|
{
|
||||||
return (Argb >> 16) & 0xff;
|
return (Argb >> 16) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
ARGB GetValue(VOID)
|
ARGB GetValue(VOID) const
|
||||||
{
|
{
|
||||||
return Argb;
|
return Argb;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ public:
|
||||||
Argb = argb;
|
Argb = argb;
|
||||||
}
|
}
|
||||||
|
|
||||||
COLORREF ToCOLORREF(VOID)
|
COLORREF ToCOLORREF(VOID) const
|
||||||
{
|
{
|
||||||
return (Argb & 0x000000ff) << 16 | (Argb & 0x0000ff00) | (Argb & 0x00ff0000) >> 16;
|
return (Argb & 0x000000ff) << 16 | (Argb & 0x0000ff00) | (Argb & 0x00ff0000) >> 16;
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,6 +228,14 @@ enum EmfType
|
||||||
EmfTypeEmfPlusDual = MetafileTypeEmfPlusDual
|
EmfTypeEmfPlusDual = MetafileTypeEmfPlusDual
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum EmfToWmfBitsFlags
|
||||||
|
{
|
||||||
|
EmfToWmfBitsFlagsDefault = 0,
|
||||||
|
EmfToWmfBitsFlagsEmbedEmf = 1,
|
||||||
|
EmfToWmfBitsFlagsIncludePlaceable = 2,
|
||||||
|
EmfToWmfBitsFlagsNoXORClip = 4
|
||||||
|
};
|
||||||
|
|
||||||
enum CompositingMode
|
enum CompositingMode
|
||||||
{
|
{
|
||||||
CompositingModeSourceOver,
|
CompositingModeSourceOver,
|
||||||
|
|
|
@ -19,8 +19,21 @@
|
||||||
#ifndef _GDIPLUSGRAPHICS_H
|
#ifndef _GDIPLUSGRAPHICS_H
|
||||||
#define _GDIPLUSGRAPHICS_H
|
#define _GDIPLUSGRAPHICS_H
|
||||||
|
|
||||||
|
class Image;
|
||||||
|
class ImageAttributes;
|
||||||
|
class CachedBitmap;
|
||||||
|
class Region;
|
||||||
|
class Font;
|
||||||
|
class GraphicsPath;
|
||||||
|
class Metafile;
|
||||||
|
|
||||||
class Graphics : public GdiplusBase
|
class Graphics : public GdiplusBase
|
||||||
{
|
{
|
||||||
|
friend class Region;
|
||||||
|
friend class Font;
|
||||||
|
friend class Bitmap;
|
||||||
|
friend class CachedBitmap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Graphics(Image *image)
|
Graphics(Image *image)
|
||||||
{
|
{
|
||||||
|
|
|
@ -69,14 +69,15 @@ public:
|
||||||
|
|
||||||
Status GetEncoderParameterList(const CLSID *clsidEncoder, UINT size, EncoderParameters *buffer)
|
Status GetEncoderParameterList(const CLSID *clsidEncoder, UINT size, EncoderParameters *buffer)
|
||||||
{
|
{
|
||||||
return SetStatus(DllExports::GdipGetEncoderParameterList(image, clsidEncoder, size, buffer));
|
return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipGetEncoderParameterList(image, clsidEncoder, size, buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT GetEncoderParameterListSize(const CLSID *clsidEncoder)
|
UINT GetEncoderParameterListSize(const CLSID *clsidEncoder)
|
||||||
{
|
{
|
||||||
UINT size;
|
return 0; // FIXME: not available:
|
||||||
SetStatus(DllExports::GdipGetEncoderParameterListSize(image, clsidEncoder, &size));
|
// UINT size;
|
||||||
return size;
|
// SetStatus(DllExports::GdipGetEncoderParameterListSize(image, clsidEncoder, &size));
|
||||||
|
// return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT GetFlags(VOID)
|
UINT GetFlags(VOID)
|
||||||
|
@ -138,7 +139,7 @@ public:
|
||||||
|
|
||||||
Status GetPhysicalDimension(SizeF *size)
|
Status GetPhysicalDimension(SizeF *size)
|
||||||
{
|
{
|
||||||
return SetStatus(DllExports::GdipGetImagePhysicalDimension(image, &(size->Width), &(size->Height)));
|
return SetStatus(DllExports::GdipGetImageDimension(image, &size->Width, &size->Height));
|
||||||
}
|
}
|
||||||
|
|
||||||
PixelFormat GetPixelFormat(VOID)
|
PixelFormat GetPixelFormat(VOID)
|
||||||
|
@ -179,7 +180,7 @@ public:
|
||||||
|
|
||||||
Status GetRawFormat(GUID *format)
|
Status GetRawFormat(GUID *format)
|
||||||
{
|
{
|
||||||
return SetStatus(DllExports::GdipGetRawFormat(image, format));
|
return SetStatus(DllExports::GdipGetImageRawFormat(image, format));
|
||||||
}
|
}
|
||||||
|
|
||||||
Image *GetThumbnailImage(UINT thumbWidth, UINT thumbHeight, GetThumbnailImageAbort callback, VOID *callbackData)
|
Image *GetThumbnailImage(UINT thumbWidth, UINT thumbHeight, GetThumbnailImageAbort callback, VOID *callbackData)
|
||||||
|
@ -232,12 +233,12 @@ public:
|
||||||
|
|
||||||
Status SaveAdd(const EncoderParameters* encoderParams)
|
Status SaveAdd(const EncoderParameters* encoderParams)
|
||||||
{
|
{
|
||||||
return SetStatus(DllExports::GdipSaveAdd(image, encoderParams));
|
return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipSaveAdd(image, encoderParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
Status SaveAdd(Image *newImage, const EncoderParameters *encoderParams)
|
Status SaveAdd(Image *newImage, const EncoderParameters *encoderParams)
|
||||||
{
|
{
|
||||||
return SetStatus(DllExports::GdipSaveAddImage(image, newImage->image, encoderParams));
|
return NotImplemented; // FIXME: not available: SetStatus(DllExports::GdipSaveAddImage(image, newImage->image, encoderParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
Status SelectActiveFrame(const GUID *dimensionID, UINT frameIndex)
|
Status SelectActiveFrame(const GUID *dimensionID, UINT frameIndex)
|
||||||
|
@ -276,11 +277,13 @@ private:
|
||||||
|
|
||||||
class Bitmap : public Image
|
class Bitmap : public Image
|
||||||
{
|
{
|
||||||
|
friend class CachedBitmap;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Bitmap(IDirectDrawSurface7 *surface)
|
// Bitmap(IDirectDrawSurface7 *surface) // <-- FIXME: compiler does not like this
|
||||||
{
|
// {
|
||||||
status = DllExports::GdipCreateBitmapFromDirectDrawSurface(surface, &bitmap);
|
// status = DllExports::GdipCreateBitmapFromDirectDrawSurface(surface, &bitmap);
|
||||||
}
|
// }
|
||||||
|
|
||||||
Bitmap(INT width, INT height, Graphics *target)
|
Bitmap(INT width, INT height, Graphics *target)
|
||||||
{
|
{
|
||||||
|
@ -365,10 +368,10 @@ public:
|
||||||
return new Bitmap(gdiBitmapInfo, gdiBitmapData);
|
return new Bitmap(gdiBitmapInfo, gdiBitmapData);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bitmap *FromDirectDrawSurface7(IDirectDrawSurface7 *surface)
|
// static Bitmap *FromDirectDrawSurface7(IDirectDrawSurface7 *surface) // <-- FIXME: compiler does not like this
|
||||||
{
|
// {
|
||||||
return new Bitmap(surface);
|
// return new Bitmap(surface);
|
||||||
}
|
// }
|
||||||
|
|
||||||
static Bitmap *FromFile(const WCHAR *filename, BOOL useEmbeddedColorManagement)
|
static Bitmap *FromFile(const WCHAR *filename, BOOL useEmbeddedColorManagement)
|
||||||
{
|
{
|
||||||
|
@ -402,7 +405,7 @@ public:
|
||||||
|
|
||||||
Status GetHICON(HICON *hicon)
|
Status GetHICON(HICON *hicon)
|
||||||
{
|
{
|
||||||
return SetStatus(DllExports::GdipCreateHICONFromBitmap(bitmap, hbmReturn));
|
return SetStatus(DllExports::GdipCreateHICONFromBitmap(bitmap, hicon));
|
||||||
}
|
}
|
||||||
|
|
||||||
Status GetPixel(INT x, INT y, Color *color)
|
Status GetPixel(INT x, INT y, Color *color)
|
||||||
|
@ -458,7 +461,7 @@ class CachedBitmap : public GdiplusBase
|
||||||
public:
|
public:
|
||||||
CachedBitmap(Bitmap *bitmap, Graphics *graphics)
|
CachedBitmap(Bitmap *bitmap, Graphics *graphics)
|
||||||
{
|
{
|
||||||
status = DllExports::GdipCreateCachedBitmap(bitmap, graphics, &cachedBitmap);
|
status = DllExports::GdipCreateCachedBitmap(bitmap->bitmap, graphics->graphics, &cachedBitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status GetLastStatus(VOID)
|
Status GetLastStatus(VOID)
|
||||||
|
@ -472,124 +475,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Font : public GdiplusBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
friend class FontFamily;
|
|
||||||
friend class FontCollection;
|
|
||||||
friend class Graphics;
|
|
||||||
|
|
||||||
Font(const FontFamily *family, REAL emSize, INT style, Unit unit)
|
|
||||||
{
|
|
||||||
status = DllExports::GdipCreateFont(family->fontFamily, emSize, style. unit, &font);
|
|
||||||
}
|
|
||||||
|
|
||||||
Font(HDC hdc, const HFONT hfont)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Font(HDC hdc, const LOGFONTA *logfont)
|
|
||||||
{
|
|
||||||
status = DllExports::GdipCreateFontFromLogfontA(hdc, logfont, &font);
|
|
||||||
}
|
|
||||||
|
|
||||||
Font(HDC hdc, const LOGFONTW *logfont)
|
|
||||||
{
|
|
||||||
status = DllExports::GdipCreateFontFromLogfontW(hdc, logfont, &font);
|
|
||||||
}
|
|
||||||
|
|
||||||
Font(const WCHAR *familyName, REAL emSize, INT style, Unit unit, const FontCollection *fontCollection)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Font(HDC hdc)
|
|
||||||
{
|
|
||||||
status = DllExports::GdipCreateFontFromDC(hdc, &font);
|
|
||||||
}
|
|
||||||
|
|
||||||
Font *Clone(VOID) const
|
|
||||||
{
|
|
||||||
Font *cloneFont = new Font();
|
|
||||||
cloneFont->status = DllExports::GdipCloneFont(font, &(cloneFont->font));
|
|
||||||
return cloneFont;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status GetFamily(FontFamily* family) const
|
|
||||||
{
|
|
||||||
return SetStatus(DllExports::GdipGetFamily(font, &(family->fontFamily)));
|
|
||||||
}
|
|
||||||
|
|
||||||
REAL GetHeight(const Graphics* graphics) const
|
|
||||||
{
|
|
||||||
REAL height;
|
|
||||||
SetStatus(DllExports::GdipGetFontHeight(font, graphics->graphics, &height));
|
|
||||||
return height;
|
|
||||||
}
|
|
||||||
|
|
||||||
REAL GetHeight(REAL dpi) const
|
|
||||||
{
|
|
||||||
REAL height;
|
|
||||||
SetStatus(DllExports::GdipGetFontHeightGivenDPI(font, dpi, &height));
|
|
||||||
return height;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status GetLastStatus(VOID) const
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status GetLogFontA(const Graphics *g, LOGFONTA *logfontA) const
|
|
||||||
{
|
|
||||||
return SetStatus(DllExports::GdipGetLogFontA(font, g->graphics, logfontA));
|
|
||||||
}
|
|
||||||
|
|
||||||
Status GetLogFontW(const Graphics *g, LOGFONTW *logfontW) const
|
|
||||||
{
|
|
||||||
return SetStatus(DllExports::GdipGetLogFontW(font, g->graphics, logfontW));
|
|
||||||
}
|
|
||||||
|
|
||||||
REAL GetSize(VOID) const
|
|
||||||
{
|
|
||||||
REAL size;
|
|
||||||
SetStatus(DllExports::GdipGetFontSize(font, &size));
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
INT GetStyle(VOID) const
|
|
||||||
{
|
|
||||||
INT style;
|
|
||||||
SetStatus(DllExports::GdipGetFontStyle(font, &style));
|
|
||||||
return style;
|
|
||||||
}
|
|
||||||
|
|
||||||
Unit GetUnit(VOID) const
|
|
||||||
{
|
|
||||||
Unit unit;
|
|
||||||
SetStatus(DllExports::GdipGetFontUnit(font, &unit);
|
|
||||||
return unit;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL IsAvailable(VOID) const
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
mutable Status status;
|
|
||||||
GpFont *font;
|
|
||||||
|
|
||||||
Status SetStatus(Status status) const
|
|
||||||
{
|
|
||||||
if (status == Ok)
|
|
||||||
return status;
|
|
||||||
this->status = status;
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class FontCollection : public GdiplusBase
|
class FontCollection : public GdiplusBase
|
||||||
{
|
{
|
||||||
|
friend class FontFamily;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FontCollection(VOID)
|
FontCollection(VOID)
|
||||||
{
|
{
|
||||||
|
@ -609,11 +498,16 @@ public:
|
||||||
{
|
{
|
||||||
return NotImplemented;
|
return NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
GpFontCollection *fontCollection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class FontFamily : public GdiplusBase
|
class FontFamily : public GdiplusBase
|
||||||
{
|
{
|
||||||
|
friend class Font;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FontFamily(VOID)
|
FontFamily(VOID)
|
||||||
{
|
{
|
||||||
|
@ -621,7 +515,7 @@ public:
|
||||||
|
|
||||||
FontFamily(const WCHAR *name, const FontCollection *fontCollection)
|
FontFamily(const WCHAR *name, const FontCollection *fontCollection)
|
||||||
{
|
{
|
||||||
status = DllExports::GdipCreateFontFamilyFromName(name, fontCollection, &fontFamily);
|
status = DllExports::GdipCreateFontFamilyFromName(name, fontCollection->fontCollection, &fontFamily);
|
||||||
}
|
}
|
||||||
|
|
||||||
FontFamily *Clone(VOID)
|
FontFamily *Clone(VOID)
|
||||||
|
@ -742,6 +636,127 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Font : public GdiplusBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
friend class FontFamily;
|
||||||
|
friend class FontCollection;
|
||||||
|
friend class Graphics;
|
||||||
|
|
||||||
|
Font(const FontFamily *family, REAL emSize, INT style, Unit unit)
|
||||||
|
{
|
||||||
|
status = DllExports::GdipCreateFont(family->fontFamily, emSize, style, unit, &font);
|
||||||
|
}
|
||||||
|
|
||||||
|
Font(HDC hdc, const HFONT hfont)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Font(HDC hdc, const LOGFONTA *logfont)
|
||||||
|
{
|
||||||
|
status = DllExports::GdipCreateFontFromLogfontA(hdc, logfont, &font);
|
||||||
|
}
|
||||||
|
|
||||||
|
Font(HDC hdc, const LOGFONTW *logfont)
|
||||||
|
{
|
||||||
|
status = DllExports::GdipCreateFontFromLogfontW(hdc, logfont, &font);
|
||||||
|
}
|
||||||
|
|
||||||
|
Font(const WCHAR *familyName, REAL emSize, INT style, Unit unit, const FontCollection *fontCollection)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Font(HDC hdc)
|
||||||
|
{
|
||||||
|
status = DllExports::GdipCreateFontFromDC(hdc, &font);
|
||||||
|
}
|
||||||
|
|
||||||
|
Font *Clone(VOID) const
|
||||||
|
{
|
||||||
|
Font *cloneFont = new Font();
|
||||||
|
cloneFont->status = DllExports::GdipCloneFont(font, &(cloneFont->font));
|
||||||
|
return cloneFont;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status GetFamily(FontFamily* family) const
|
||||||
|
{
|
||||||
|
return SetStatus(DllExports::GdipGetFamily(font, &(family->fontFamily)));
|
||||||
|
}
|
||||||
|
|
||||||
|
REAL GetHeight(const Graphics* graphics) const
|
||||||
|
{
|
||||||
|
REAL height;
|
||||||
|
SetStatus(DllExports::GdipGetFontHeight(font, graphics->graphics, &height));
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
REAL GetHeight(REAL dpi) const
|
||||||
|
{
|
||||||
|
REAL height;
|
||||||
|
SetStatus(DllExports::GdipGetFontHeightGivenDPI(font, dpi, &height));
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status GetLastStatus(VOID) const
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status GetLogFontA(const Graphics *g, LOGFONTA *logfontA) const
|
||||||
|
{
|
||||||
|
return SetStatus(DllExports::GdipGetLogFontA(font, g->graphics, logfontA));
|
||||||
|
}
|
||||||
|
|
||||||
|
Status GetLogFontW(const Graphics *g, LOGFONTW *logfontW) const
|
||||||
|
{
|
||||||
|
return SetStatus(DllExports::GdipGetLogFontW(font, g->graphics, logfontW));
|
||||||
|
}
|
||||||
|
|
||||||
|
REAL GetSize(VOID) const
|
||||||
|
{
|
||||||
|
REAL size;
|
||||||
|
SetStatus(DllExports::GdipGetFontSize(font, &size));
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT GetStyle(VOID) const
|
||||||
|
{
|
||||||
|
INT style;
|
||||||
|
SetStatus(DllExports::GdipGetFontStyle(font, &style));
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
Unit GetUnit(VOID) const
|
||||||
|
{
|
||||||
|
Unit unit;
|
||||||
|
SetStatus(DllExports::GdipGetFontUnit(font, &unit));
|
||||||
|
return unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL IsAvailable(VOID) const
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
Font()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
mutable Status status;
|
||||||
|
GpFont *font;
|
||||||
|
|
||||||
|
Status SetStatus(Status status) const
|
||||||
|
{
|
||||||
|
if (status == Ok)
|
||||||
|
return status;
|
||||||
|
this->status = status;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class Region : public GdiplusBase
|
class Region : public GdiplusBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -776,13 +791,13 @@ public:
|
||||||
|
|
||||||
Region(const RectF &rect)
|
Region(const RectF &rect)
|
||||||
{
|
{
|
||||||
status = DllExports::GdipCreateRegionRectF(&rect, ®ion);
|
status = DllExports::GdipCreateRegionRect(&rect, ®ion);
|
||||||
}
|
}
|
||||||
|
|
||||||
Region *Clone(VOID)
|
Region *Clone(VOID)
|
||||||
{
|
{
|
||||||
region *cloneRegion = new Region();
|
Region *cloneRegion = new Region();
|
||||||
cloneRegion->status = DllExports::GdipCloneRegion(region, &cloneRegion);
|
cloneRegion->status = DllExports::GdipCloneRegion(region, &cloneRegion->region);
|
||||||
return cloneRegion;
|
return cloneRegion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -850,7 +865,7 @@ public:
|
||||||
|
|
||||||
Status GetData(BYTE *buffer, UINT bufferSize, UINT *sizeFilled) const
|
Status GetData(BYTE *buffer, UINT bufferSize, UINT *sizeFilled) const
|
||||||
{
|
{
|
||||||
return SetStatus(DllExports::GdipGetRegionData(region, budder, bufferSize, sizeFilled));
|
return SetStatus(DllExports::GdipGetRegionData(region, buffer, bufferSize, sizeFilled));
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT GetDataSize(VOID) const
|
UINT GetDataSize(VOID) const
|
||||||
|
@ -926,21 +941,21 @@ public:
|
||||||
BOOL IsVisible(const PointF &point, const Graphics *g) const
|
BOOL IsVisible(const PointF &point, const Graphics *g) const
|
||||||
{
|
{
|
||||||
BOOL result;
|
BOOL result;
|
||||||
SetStatus(DllExports::GdipIsVisibleRegionPoint(region, point.x, point.y, g->graphics, &result));
|
SetStatus(DllExports::GdipIsVisibleRegionPoint(region, point.X, point.Y, g->graphics, &result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL IsVisible(const RectF &rect, const Graphics *g) const
|
BOOL IsVisible(const RectF &rect, const Graphics *g) const
|
||||||
{
|
{
|
||||||
BOOL result;
|
BOOL result;
|
||||||
SetStatus(DllExports::GdipIsVisibleRegionRect(region, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, g->graphics, &result));
|
SetStatus(DllExports::GdipIsVisibleRegionRect(region, rect.X, rect.Y, rect.Width, rect.Height, g->graphics, &result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL IsVisible(const Rect &rect, const Graphics *g) const
|
BOOL IsVisible(const Rect &rect, const Graphics *g) const
|
||||||
{
|
{
|
||||||
BOOL result;
|
BOOL result;
|
||||||
SetStatus(DllExports::GdipIsVisibleRegionRectI(region, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, g->graphics, &result));
|
SetStatus(DllExports::GdipIsVisibleRegionRectI(region, rect.X, rect.Y, rect.Width, rect.Height, g->graphics, &result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -968,7 +983,7 @@ public:
|
||||||
BOOL IsVisible(const Point &point, const Graphics *g) const
|
BOOL IsVisible(const Point &point, const Graphics *g) const
|
||||||
{
|
{
|
||||||
BOOL result;
|
BOOL result;
|
||||||
SetStatus(DllExports::GdipIsVisibleRegionPointI(region, point.x, point.y, g->graphics, &result));
|
SetStatus(DllExports::GdipIsVisibleRegionPointI(region, point.X, point.Y, g->graphics, &result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
class Matrix : public GdiplusBase
|
class Matrix : public GdiplusBase
|
||||||
{
|
{
|
||||||
|
friend class Region;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Matrix(const RectF &rect, const PointF *dstplg)
|
Matrix(const RectF &rect, const PointF *dstplg)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +47,7 @@ public:
|
||||||
Matrix *Clone(VOID)
|
Matrix *Clone(VOID)
|
||||||
{
|
{
|
||||||
Matrix *cloneMatrix = new Matrix(); // FIXME: Matrix::matrix already initialized --> potential memory leak
|
Matrix *cloneMatrix = new Matrix(); // FIXME: Matrix::matrix already initialized --> potential memory leak
|
||||||
cloneMatrix->status = DllExports::GdipCloneMatrix(matrix, &cloneMatrix);
|
cloneMatrix->status = DllExports::GdipCloneMatrix(matrix, &cloneMatrix->matrix);
|
||||||
return cloneMatrix;
|
return cloneMatrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +132,7 @@ public:
|
||||||
return SetStatus(DllExports::GdipSetMatrixElements(matrix, m11, m12, m21, m22, dx, dy));
|
return SetStatus(DllExports::GdipSetMatrixElements(matrix, m11, m12, m21, m22, dx, dy));
|
||||||
}
|
}
|
||||||
|
|
||||||
Status Shear(REAL shearX, REAL shearY, REAL order)
|
Status Shear(REAL shearX, REAL shearY, MatrixOrder order)
|
||||||
{
|
{
|
||||||
return SetStatus(DllExports::GdipShearMatrix(matrix, shearX, shearY, order));
|
return SetStatus(DllExports::GdipShearMatrix(matrix, shearX, shearY, order));
|
||||||
}
|
}
|
||||||
|
@ -155,7 +157,7 @@ public:
|
||||||
return SetStatus(DllExports::GdipVectorTransformMatrixPoints(matrix, pts, count));
|
return SetStatus(DllExports::GdipVectorTransformMatrixPoints(matrix, pts, count));
|
||||||
}
|
}
|
||||||
|
|
||||||
Status Translate(REAL offsetX, REAL offsetY, REAL order)
|
Status Translate(REAL offsetX, REAL offsetY, MatrixOrder order)
|
||||||
{
|
{
|
||||||
return SetStatus(DllExports::GdipTranslateMatrix(matrix, offsetX, offsetY, order));
|
return SetStatus(DllExports::GdipTranslateMatrix(matrix, offsetX, offsetY, order));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,13 @@
|
||||||
#ifndef _GDIPLUSPATH_H
|
#ifndef _GDIPLUSPATH_H
|
||||||
#define _GDIPLUSPATH_H
|
#define _GDIPLUSPATH_H
|
||||||
|
|
||||||
|
class FontFamily;
|
||||||
|
class Graphics;
|
||||||
|
|
||||||
class GraphicsPath : public GdiplusBase
|
class GraphicsPath : public GdiplusBase
|
||||||
{
|
{
|
||||||
|
friend class Region;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GraphicsPath(const Point *points, const BYTE *types, INT count, FillMode fillMode)
|
GraphicsPath(const Point *points, const BYTE *types, INT count, FillMode fillMode)
|
||||||
{
|
{
|
||||||
|
@ -418,6 +423,9 @@ public:
|
||||||
{
|
{
|
||||||
return NotImplemented;
|
return NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
GpPath *path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
#ifndef _GDIPLUSPEN_H
|
#ifndef _GDIPLUSPEN_H
|
||||||
#define _GDIPLUSPEN_H
|
#define _GDIPLUSPEN_H
|
||||||
|
|
||||||
|
class CustomLineCap;
|
||||||
|
|
||||||
class Pen : public GdiplusBase
|
class Pen : public GdiplusBase
|
||||||
{
|
{
|
||||||
friend class Graphics;
|
friend class Graphics;
|
||||||
|
|
|
@ -227,6 +227,14 @@ public:
|
||||||
INT Length;
|
INT Length;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* FIXME: missing the methods. */
|
||||||
|
class SizeF
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
REAL Width;
|
||||||
|
REAL Height;
|
||||||
|
};
|
||||||
|
|
||||||
#else /* end of c++ typedefs */
|
#else /* end of c++ typedefs */
|
||||||
|
|
||||||
typedef struct Point
|
typedef struct Point
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue