Module: wine Branch: master Commit: d060aeccca03e48c82ff16fc5b2a9d90b9375bb6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d060aeccca03e48c82ff16fc5b...
Author: Evan Stade estade@gmail.com Date: Mon Aug 13 18:34:51 2007 -0700
gdiplus: Added font constructor.
---
dlls/gdiplus/Makefile.in | 1 + dlls/gdiplus/font.c | 42 ++++++++++++++++++++++++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/gdiplus_private.h | 4 +++ include/gdiplusflat.h | 2 + include/gdiplusgpstubs.h | 2 + 6 files changed, 52 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/Makefile.in b/dlls/gdiplus/Makefile.in index ddf3d99..a826644 100644 --- a/dlls/gdiplus/Makefile.in +++ b/dlls/gdiplus/Makefile.in @@ -10,6 +10,7 @@ EXTRALIBS = -luuid C_SRCS = \ brush.c \ customlinecap.c \ + font.c \ gdiplus.c \ graphics.c \ graphicspath.c \ diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c new file mode 100644 index 0000000..2cd514d --- /dev/null +++ b/dlls/gdiplus/font.c @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2007 Google (Evan Stade) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" + +#include "objbase.h" + +#include "gdiplus.h" +#include "gdiplus_private.h" + +GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC hdc, + GDIPCONST LOGFONTW *logfont, GpFont **font) +{ + if(!logfont || !font) + return InvalidParameter; + + *font = GdipAlloc(sizeof(GpFont)); + if(!*font) return OutOfMemory; + + memcpy(&(*font)->lfw, logfont, sizeof(LOGFONTW)); + + return Ok; +} diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 664600d..d311c45 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -88,7 +88,7 @@ @ stub GdipCreateFontFamilyFromName @ stub GdipCreateFontFromDC @ stub GdipCreateFontFromLogfontA -@ stub GdipCreateFontFromLogfontW +@ stdcall GdipCreateFontFromLogfontW(ptr ptr ptr) @ stub GdipCreateFromHDC2 @ stdcall GdipCreateFromHDC(long ptr) @ stdcall GdipCreateFromHWND(long ptr) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index d36b8a2..5be21b1 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -170,4 +170,8 @@ struct GpImageAttributes{ WrapMode wrap; };
+struct GpFont{ + LOGFONTW lfw; +}; + #endif diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 8a45a23..05bf54e 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -236,6 +236,8 @@ GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes*, GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes*,WrapMode, ARGB,BOOL);
+GpStatus WINGDIPAPI GdipCreateFontFromLogfontW(HDC,GDIPCONST LOGFONTW*,GpFont**); + #ifdef __cplusplus } #endif diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h index 253dd1f..d0fc8c4 100644 --- a/include/gdiplusgpstubs.h +++ b/include/gdiplusgpstubs.h @@ -36,6 +36,7 @@ class GpBitmap : public GpImage {}; class GpPathGradient : public GpBrush {}; class GpLineGradient : public GpBrush {}; class GpTexture : public GpBrush {}; +class GpFont {};
#else /* end of c++ declarations */
@@ -54,6 +55,7 @@ typedef struct GpBitmap GpBitmap; typedef struct GpPathGradient GpPathGradient; typedef struct GpLineGradient GpLineGradient; typedef struct GpTexture GpTexture; +typedef struct GpFont GpFont;
#endif /* end of c declarations */