gdiplus: GdipStringFormatGetGenericTypographic implemented.

This commit is contained in:
Nikolay Sivov 2008-07-29 01:13:06 +04:00 committed by Alexandre Julliard
parent 65a2274dc7
commit 2e25db0409
4 changed files with 65 additions and 1 deletions

View File

@ -601,7 +601,7 @@
@ stdcall GdipShearMatrix(ptr long long long) @ stdcall GdipShearMatrix(ptr long long long)
@ stdcall GdipStartPathFigure(ptr) @ stdcall GdipStartPathFigure(ptr)
@ stdcall GdipStringFormatGetGenericDefault(ptr) @ stdcall GdipStringFormatGetGenericDefault(ptr)
@ stub GdipStringFormatGetGenericTypographic @ stdcall GdipStringFormatGetGenericTypographic(ptr)
@ stub GdipTestControl @ stub GdipTestControl
@ stdcall GdipTransformMatrixPoints(ptr ptr long) @ stdcall GdipTransformMatrixPoints(ptr ptr long)
@ stdcall GdipTransformMatrixPointsI(ptr ptr long) @ stdcall GdipTransformMatrixPointsI(ptr ptr long)

View File

@ -237,3 +237,27 @@ GpStatus WINGDIPAPI GdipCloneStringFormat(GDIPCONST GpStringFormat *format, GpSt
return Ok; return Ok;
} }
/*FIXME: add zero tab stops number */
GpStatus WINGDIPAPI GdipStringFormatGetGenericTypographic(GpStringFormat **format)
{
GpStatus stat;
if(!format)
return InvalidParameter;
stat = GdipCreateStringFormat(StringFormatFlagsNoFitBlackBox |
StringFormatFlagsLineLimit |
StringFormatFlagsNoClip, LANG_NEUTRAL, format);
if(stat != Ok)
return stat;
(*format)->digitlang = LANG_NEUTRAL;
(*format)->digitsub = StringDigitSubstituteUser;
(*format)->trimming = StringTrimmingNone;
(*format)->hkprefix = HotkeyPrefixNone;
(*format)->align = StringAlignmentNear;
(*format)->vertalign = StringAlignmentNear;
return Ok;
}

View File

@ -130,6 +130,44 @@ static void test_digitsubstitution(void)
expect(Ok, stat); expect(Ok, stat);
} }
static void test_getgenerictypographic(void)
{
GpStringFormat *format;
GpStatus stat;
INT flags;
INT n;
StringAlignment align, valign;
StringTrimming trimming;
StringDigitSubstitute digitsub;
LANGID digitlang;
/* NULL arg */
stat = GdipStringFormatGetGenericTypographic(NULL);
expect(InvalidParameter, stat);
stat = GdipStringFormatGetGenericTypographic(&format);
expect(Ok, stat);
GdipGetStringFormatFlags(format, &flags);
GdipGetStringFormatAlign(format, &align);
GdipGetStringFormatLineAlign(format, &valign);
GdipGetStringFormatHotkeyPrefix(format, &n);
GdipGetStringFormatTrimming(format, &trimming);
GdipGetStringFormatDigitSubstitution(format, &digitlang, &digitsub);
expect((StringFormatFlagsNoFitBlackBox |StringFormatFlagsLineLimit | StringFormatFlagsNoClip),
flags);
expect(HotkeyPrefixNone, n);
expect(StringAlignmentNear, align);
expect(StringAlignmentNear, align);
expect(StringTrimmingNone, trimming);
expect(StringDigitSubstituteUser, digitsub);
expect(LANG_NEUTRAL, digitlang);
stat = GdipDeleteStringFormat(format);
expect(Ok, stat);
}
START_TEST(stringformat) START_TEST(stringformat)
{ {
struct GdiplusStartupInput gdiplusStartupInput; struct GdiplusStartupInput gdiplusStartupInput;
@ -145,6 +183,7 @@ START_TEST(stringformat)
test_constructor(); test_constructor();
test_characterrange(); test_characterrange();
test_digitsubstitution(); test_digitsubstitution();
test_getgenerictypographic();
GdiplusShutdown(gdiplusToken); GdiplusShutdown(gdiplusToken);
} }

View File

@ -435,6 +435,7 @@ GpStatus WINGDIPAPI GdipGetFontCollectionFamilyList(GpFontCollection*, INT,
GpStatus WINGDIPAPI GdipCreateStringFormat(INT,LANGID,GpStringFormat**); GpStatus WINGDIPAPI GdipCreateStringFormat(INT,LANGID,GpStringFormat**);
GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat*); GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat*);
GpStatus WINGDIPAPI GdipStringFormatGetGenericDefault(GpStringFormat **); GpStatus WINGDIPAPI GdipStringFormatGetGenericDefault(GpStringFormat **);
GpStatus WINGDIPAPI GdipStringFormatGetGenericTypographic(GpStringFormat **);
GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat*,StringAlignment*); GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat*,StringAlignment*);
GpStatus WINGDIPAPI GdipGetStringFormatDigitSubstitution(GDIPCONST GpStringFormat*,LANGID*, GpStatus WINGDIPAPI GdipGetStringFormatDigitSubstitution(GDIPCONST GpStringFormat*,LANGID*,
StringDigitSubstitute*); StringDigitSubstitute*);