From 16dea47a5c690d1833547f5740631c558a9def89 Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Tue, 14 Aug 2007 19:00:32 -0700 Subject: [PATCH] gdiplus: Added GdipGetStringFormatAlign/GdipSetStringFormatAlign. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/stringformat.c | 22 ++++++++++++++++++++++ include/gdiplusenums.h | 8 ++++++++ include/gdiplusflat.h | 2 ++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 71a6b268ec5..5a2bbd2ec96 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -386,7 +386,7 @@ @ stub GdipGetRenderingOrigin @ stdcall GdipGetSmoothingMode(ptr ptr) @ stdcall GdipGetSolidFillColor(ptr ptr) -@ stub GdipGetStringFormatAlign +@ stdcall GdipGetStringFormatAlign(ptr ptr) @ stub GdipGetStringFormatDigitSubstitution @ stub GdipGetStringFormatFlags @ stub GdipGetStringFormatHotkeyPrefix @@ -585,7 +585,7 @@ @ stub GdipSetRenderingOrigin @ stdcall GdipSetSmoothingMode(ptr long) @ stdcall GdipSetSolidFillColor(ptr ptr) -@ stub GdipSetStringFormatAlign +@ stdcall GdipSetStringFormatAlign(ptr long) @ stub GdipSetStringFormatDigitSubstitution @ stub GdipSetStringFormatFlags @ stub GdipSetStringFormatHotkeyPrefix diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index c462e108a78..d6c9dbae1b3 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -178,6 +178,7 @@ struct GpFont{ struct GpStringFormat{ INT attr; LANGID lang; + StringAlignment align; }; #endif diff --git a/dlls/gdiplus/stringformat.c b/dlls/gdiplus/stringformat.c index 0836a3b4f22..c8bd3d1877c 100644 --- a/dlls/gdiplus/stringformat.c +++ b/dlls/gdiplus/stringformat.c @@ -43,3 +43,25 @@ GpStatus WINGDIPAPI GdipCreateStringFormat(INT attr, LANGID lang, return Ok; } + +GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat *format, + StringAlignment *align) +{ + if(!format || !align) + return InvalidParameter; + + *align = format->align; + + return Ok; +} + +GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat *format, + StringAlignment align) +{ + if(!format) + return InvalidParameter; + + format->align = align; + + return Ok; +} diff --git a/include/gdiplusenums.h b/include/gdiplusenums.h index 3a68a54d5fe..91e779b8104 100644 --- a/include/gdiplusenums.h +++ b/include/gdiplusenums.h @@ -214,6 +214,13 @@ enum TextRenderingHint TextRenderingHintClearTypeGridFit }; +enum StringAlignment +{ + StringAlignmentNear = 0, + StringAlignmentCenter = 1, + StringAlignmentFar = 2 +}; + #ifndef __cplusplus typedef enum Unit Unit; @@ -237,6 +244,7 @@ typedef enum LinearGradientMode LinearGradientMode; typedef enum EmfType EmfType; typedef enum CompositingMode CompositingMode; typedef enum TextRenderingHint TextRenderingHint; +typedef enum StringAlignment StringAlignment; #endif /* end of c typedefs */ diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 8b325a6665e..ff1bcb1528c 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -249,6 +249,8 @@ GpStatus WINGDIPAPI GdipDeleteFont(GpFont*); GpStatus WINGDIPAPI GdipGetLogFontW(GpFont*,GpGraphics*,LOGFONTW*); GpStatus WINGDIPAPI GdipCreateStringFormat(INT,LANGID,GpStringFormat**); +GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat*,StringAlignment*); +GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat*,StringAlignment); #ifdef __cplusplus }