Mercurial > projects > dwt2
comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/gdip/Gdip.d @ 39:0ecb2b338560
further work on phobosification
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 25 Mar 2009 13:20:43 +0100 |
parents | 4642ab680468 |
children | 536e43f63c81 |
comparison
equal
deleted
inserted
replaced
38:2e09b0e6857a | 39:0ecb2b338560 |
---|---|
573 | 573 |
574 /************************************************************************** | 574 /************************************************************************** |
575 | 575 |
576 **************************************************************************/ | 576 **************************************************************************/ |
577 | 577 |
578 static Bitmap Bitmap_new( wchar* filename, bool useIcm ) | 578 static Bitmap Bitmap_new( LPCWSTR filename, bool useIcm ) |
579 { | 579 { |
580 Bitmap bitmap; | 580 Bitmap bitmap; |
581 if (useIcm) { | 581 if (useIcm) { |
582 Gdip.lastResult = GdipCreateBitmapFromFileICM( filename, bitmap ); | 582 Gdip.lastResult = GdipCreateBitmapFromFileICM( filename, bitmap ); |
583 } else { | 583 } else { |
1086 | 1086 |
1087 GDI+ FontFamily Wrap Interface | 1087 GDI+ FontFamily Wrap Interface |
1088 | 1088 |
1089 **************************************************************************/ | 1089 **************************************************************************/ |
1090 | 1090 |
1091 static int FontFamily_GetFamilyName( FontFamily family, wchar* name, int language ) | 1091 static int FontFamily_GetFamilyName( FontFamily family, LPCWSTR name, int language ) |
1092 { | 1092 { |
1093 return SetStatus( GdipGetFamilyName( family, name, language ) ); | 1093 return SetStatus( GdipGetFamilyName( family, name, language ) ); |
1094 } | 1094 } |
1095 | 1095 |
1096 /************************************************************************** | 1096 /************************************************************************** |
1179 Font font = null; | 1179 Font font = null; |
1180 | 1180 |
1181 if (hfont is null) { | 1181 if (hfont is null) { |
1182 Gdip.lastResult = GdipCreateFontFromDC( hdc, font ); | 1182 Gdip.lastResult = GdipCreateFontFromDC( hdc, font ); |
1183 } else { | 1183 } else { |
1184 LOGFONTA logfont; | 1184 LOGFONTW logfont; |
1185 if (GetObjectA( hfont, LOGFONTA.sizeof, &logfont )) | 1185 if (OS.GetObject( hfont, LOGFONTW.sizeof, &logfont )) |
1186 Gdip.lastResult = GdipCreateFontFromLogfontA(hdc, logfont, font); | 1186 Gdip.lastResult = GdipCreateFontFromLogfontW(hdc, logfont, font); |
1187 else | 1187 else |
1188 Gdip.lastResult = GdipCreateFontFromDC(hdc, font); | 1188 Gdip.lastResult = GdipCreateFontFromDC(hdc, font); |
1189 } | 1189 } |
1190 | 1190 |
1191 return font; | 1191 return font; |
1194 | 1194 |
1195 /************************************************************************** | 1195 /************************************************************************** |
1196 | 1196 |
1197 **************************************************************************/ | 1197 **************************************************************************/ |
1198 | 1198 |
1199 static Font Font_new( wchar* familyName, float emSize, int style, uint unit, | 1199 static Font Font_new( LPCWSTR familyName, float emSize, int style, uint unit, |
1200 FontCollection fontCollection ) | 1200 FontCollection fontCollection ) |
1201 { | 1201 { |
1202 Font nativeFont = null; | 1202 Font nativeFont = null; |
1203 FontFamily nativeFamily = null; | 1203 FontFamily nativeFamily = null; |
1204 | 1204 |
1373 | 1373 |
1374 /************************************************************************** | 1374 /************************************************************************** |
1375 | 1375 |
1376 **************************************************************************/ | 1376 **************************************************************************/ |
1377 | 1377 |
1378 static Status GraphicsPath_AddString( Path path, wchar* string, | 1378 static Status GraphicsPath_AddString( Path path, LPCWSTR string, |
1379 int length, FontFamily family, | 1379 int length, FontFamily family, |
1380 int style, float emSize, | 1380 int style, float emSize, |
1381 ref PointF origin, StringFormat format ) | 1381 ref PointF origin, StringFormat format ) |
1382 { | 1382 { |
1383 RectF rect = { origin.X, origin.Y, 0.0f, 0.0f }; | 1383 RectF rect = { origin.X, origin.Y, 0.0f, 0.0f }; |
1646 | 1646 |
1647 /************************************************************************** | 1647 /************************************************************************** |
1648 | 1648 |
1649 **************************************************************************/ | 1649 **************************************************************************/ |
1650 | 1650 |
1651 static Status Graphics_DrawString( Graphics graphics, wchar* string, int length, | 1651 static Status Graphics_DrawString( Graphics graphics, LPCWSTR string, int length, |
1652 Font font, ref PointF origin, Brush brush ) | 1652 Font font, ref PointF origin, Brush brush ) |
1653 { | 1653 { |
1654 RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; | 1654 RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; |
1655 | 1655 |
1656 return SetStatus(GdipDrawString(graphics,string,length, font, rect, null, brush)); | 1656 return SetStatus(GdipDrawString(graphics,string,length, font, rect, null, brush)); |
1658 | 1658 |
1659 /************************************************************************** | 1659 /************************************************************************** |
1660 | 1660 |
1661 **************************************************************************/ | 1661 **************************************************************************/ |
1662 | 1662 |
1663 static Status Graphics_DrawString( Graphics graphics, wchar* string, int length, | 1663 static Status Graphics_DrawString( Graphics graphics, LPCWSTR string, int length, |
1664 Font font, ref PointF origin, | 1664 Font font, ref PointF origin, |
1665 StringFormat format, Brush brush ) | 1665 StringFormat format, Brush brush ) |
1666 { | 1666 { |
1667 RectF rect = { origin.X, origin.Y, 0.0f, 0.0f }; | 1667 RectF rect = { origin.X, origin.Y, 0.0f, 0.0f }; |
1668 | 1668 |
1844 | 1844 |
1845 /************************************************************************** | 1845 /************************************************************************** |
1846 | 1846 |
1847 **************************************************************************/ | 1847 **************************************************************************/ |
1848 | 1848 |
1849 static Status Graphics_MeasureString( Graphics graphics, wchar* string, int length, | 1849 static Status Graphics_MeasureString( Graphics graphics, LPCWSTR string, int length, |
1850 Font font, ref PointF origin, | 1850 Font font, ref PointF origin, |
1851 ref RectF boundingBox ) | 1851 ref RectF boundingBox ) |
1852 { | 1852 { |
1853 RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; | 1853 RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; |
1854 | 1854 |
1867 | 1867 |
1868 /************************************************************************** | 1868 /************************************************************************** |
1869 | 1869 |
1870 **************************************************************************/ | 1870 **************************************************************************/ |
1871 | 1871 |
1872 static Status Graphics_MeasureString( Graphics graphics, wchar* string, int length, | 1872 static Status Graphics_MeasureString( Graphics graphics, LPCWSTR string, int length, |
1873 Font font, ref PointF origin, | 1873 Font font, ref PointF origin, |
1874 StringFormat format, ref RectF boundingBox ) | 1874 StringFormat format, ref RectF boundingBox ) |
1875 { | 1875 { |
1876 RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; | 1876 RectF rect = {origin.X, origin.Y, 0.0f, 0.0f}; |
1877 | 1877 |