From 551a606ab247a6a89dc4e1e42c28feb717827990 Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Tue, 14 Aug 2007 19:00:40 -0700 Subject: [PATCH] gdiplus: Added GdipGetStringFormatTrimming/GdipSetStringFormatTrimming. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/stringformat.c | 22 ++++++++++++++++++++++ include/gdiplusenums.h | 25 +++++++++++++++++++++++++ include/gdiplusflat.h | 2 ++ 5 files changed, 52 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 5a2bbd2ec96..b762c69f53d 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -394,7 +394,7 @@ @ stub GdipGetStringFormatMeasurableCharacterRangeCount @ stub GdipGetStringFormatTabStopCount @ stub GdipGetStringFormatTabStops -@ stub GdipGetStringFormatTrimming +@ stdcall GdipGetStringFormatTrimming(ptr ptr) @ stub GdipGetTextContrast @ stdcall GdipGetTextRenderingHint(ptr ptr) @ stub GdipGetTextureImage @@ -592,7 +592,7 @@ @ stub GdipSetStringFormatLineAlign @ stub GdipSetStringFormatMeasurableCharacterRanges @ stub GdipSetStringFormatTabStops -@ stub GdipSetStringFormatTrimming +@ stdcall GdipSetStringFormatTrimming(ptr long) @ stub GdipSetTextContrast @ stdcall GdipSetTextRenderingHint(ptr long) @ stdcall GdipSetTextureTransform(ptr ptr) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index d6c9dbae1b3..0c742456e5d 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -179,6 +179,7 @@ struct GpStringFormat{ INT attr; LANGID lang; StringAlignment align; + StringTrimming trimming; }; #endif diff --git a/dlls/gdiplus/stringformat.c b/dlls/gdiplus/stringformat.c index c8bd3d1877c..d1e3719844b 100644 --- a/dlls/gdiplus/stringformat.c +++ b/dlls/gdiplus/stringformat.c @@ -55,6 +55,17 @@ GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat *format, return Ok; } +GpStatus WINGDIPAPI GdipGetStringFormatTrimming(GpStringFormat *format, + StringTrimming *trimming) +{ + if(!format || !trimming) + return InvalidParameter; + + *trimming = format->trimming; + + return Ok; +} + GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat *format, StringAlignment align) { @@ -65,3 +76,14 @@ GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat *format, return Ok; } + +GpStatus WINGDIPAPI GdipSetStringFormatTrimming(GpStringFormat *format, + StringTrimming trimming) +{ + if(!format) + return InvalidParameter; + + format->trimming = trimming; + + return Ok; +} diff --git a/include/gdiplusenums.h b/include/gdiplusenums.h index 91e779b8104..786cf5188aa 100644 --- a/include/gdiplusenums.h +++ b/include/gdiplusenums.h @@ -221,6 +221,29 @@ enum StringAlignment StringAlignmentFar = 2 }; +enum StringFormatFlags +{ + StringFormatFlagsDirectionRightToLeft = 0x00000001, + StringFormatFlagsDirectionVertical = 0x00000002, + StringFormatFlagsNoFitBlackBox = 0x00000004, + StringFormatFlagsDisplayFormatControl = 0x00000020, + StringFormatFlagsNoFontFallback = 0x00000400, + StringFormatFlagsMeasureTrailingSpaces = 0x00000800, + StringFormatFlagsNoWrap = 0x00001000, + StringFormatFlagsLineLimit = 0x00002000, + StringFormatFlagsNoClip = 0x00004000 +}; + +enum StringTrimming +{ + StringTrimmingNone = 0, + StringTrimmingCharacter = 1, + StringTrimmingWord = 2, + StringTrimmingEllipsisCharacter = 3, + StringTrimmingEllipsisWord = 4, + StringTrimmingEllipsisPath = 5 +}; + #ifndef __cplusplus typedef enum Unit Unit; @@ -245,6 +268,8 @@ typedef enum EmfType EmfType; typedef enum CompositingMode CompositingMode; typedef enum TextRenderingHint TextRenderingHint; typedef enum StringAlignment StringAlignment; +typedef enum StringTrimming StringTrimming; +typedef enum StringFormatFlags StringFormatFlags; #endif /* end of c typedefs */ diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index ff1bcb1528c..b5123b9f01e 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -250,7 +250,9 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont*,GpGraphics*,LOGFONTW*); GpStatus WINGDIPAPI GdipCreateStringFormat(INT,LANGID,GpStringFormat**); GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat*,StringAlignment*); +GpStatus WINGDIPAPI GdipGetStringFormatTrimming(GpStringFormat*,StringTrimming*); GpStatus WINGDIPAPI GdipSetStringFormatAlign(GpStringFormat*,StringAlignment); +GpStatus WINGDIPAPI GdipSetStringFormatTrimming(GpStringFormat*,StringTrimming); #ifdef __cplusplus }