Adam Petaccia : gdiplus: Implement GdipGetGeneric*.

Alexandre Julliard julliard at winehq.org
Wed Jun 25 16:44:19 CDT 2008


Module: wine
Branch: master
Commit: d6bad2d6de6e9175ff7c32521d3a9f5e209abe3c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d6bad2d6de6e9175ff7c32521d3a9f5e209abe3c

Author: Adam Petaccia <adam at tpetaccia.com>
Date:   Sat Jun 21 13:02:50 2008 -0400

gdiplus: Implement GdipGetGeneric*.

---

 dlls/gdiplus/font.c       |   65 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/gdiplus/gdiplus.spec |    6 ++--
 include/gdiplusflat.h     |    4 +++
 3 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index f38261d..fe514a3 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -278,3 +278,68 @@ GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily *FontFamily)
 
     return Ok;
 }
+
+/*****************************************************************************
+ * GdipGetGenericFontFamilyMonospace [GDIPLUS.@]
+ *
+ * Obtains a serif family (Courier New on Windows)
+ *
+ * PARAMS
+ *  **nativeFamily         [I] Where the font will be stored
+ *
+ * RETURNS
+ *  InvalidParameter if nativeFamily is NULL.
+ *  Ok otherwise.
+ */
+GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(GpFontFamily **nativeFamily)
+{
+    static const WCHAR CourierNew[] = {'C','o','u','r','i','e','r',' ','N','e','w','\0'};
+
+    if (nativeFamily == NULL) return InvalidParameter;
+
+    return GdipCreateFontFamilyFromName(CourierNew, NULL, nativeFamily);
+}
+
+/*****************************************************************************
+ * GdipGetGenericFontFamilySerif [GDIPLUS.@]
+ *
+ * Obtains a serif family (Times New Roman on Windows)
+ *
+ * PARAMS
+ *  **nativeFamily         [I] Where the font will be stored
+ *
+ * RETURNS
+ *  InvalidParameter if nativeFamily is NULL.
+ *  Ok otherwise.
+ */
+GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif(GpFontFamily **nativeFamily)
+{
+    static const WCHAR TimesNewRoman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n','\0'};
+
+    if (nativeFamily == NULL) return InvalidParameter;
+
+    return GdipCreateFontFamilyFromName(TimesNewRoman, NULL, nativeFamily);
+}
+
+/*****************************************************************************
+ * GdipGetGenericFontFamilySansSerif [GDIPLUS.@]
+ *
+ * Obtains a serif family (Microsoft Sans Serif on Windows)
+ *
+ * PARAMS
+ *  **nativeFamily         [I] Where the font will be stored
+ *
+ * RETURNS
+ *  InvalidParameter if nativeFamily is NULL.
+ *  Ok otherwise.
+ */
+GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily)
+{
+    /* FIXME: On Windows this is called Microsoft Sans Serif, this shouldn't
+     * affect anything */
+    static const WCHAR MSSansSerif[] = {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'};
+
+    if (nativeFamily == NULL) return InvalidParameter;
+
+    return GdipCreateFontFamilyFromName(MSSansSerif, NULL, nativeFamily);
+}
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 0b093a4..7b71fc8 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -272,9 +272,9 @@
 @ stub GdipGetFontSize
 @ stub GdipGetFontStyle
 @ stub GdipGetFontUnit
-@ stub GdipGetGenericFontFamilyMonospace
-@ stub GdipGetGenericFontFamilySansSerif
-@ stub GdipGetGenericFontFamilySerif
+@ stdcall GdipGetGenericFontFamilyMonospace(ptr)
+@ stdcall GdipGetGenericFontFamilySansSerif(ptr)
+@ stdcall GdipGetGenericFontFamilySerif(ptr)
 @ stub GdipGetHatchBackgroundColor
 @ stub GdipGetHatchForegroundColor
 @ stub GdipGetHatchStyle
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index fb4fbfc..b4cde21 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -353,6 +353,10 @@ GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR*,
 GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily*);
 GpStatus WINGDIPAPI GdipGetFamilyName(GDIPCONST GpFontFamily*, WCHAR*, LANGID);
 
+GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily**);
+GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif(GpFontFamily**);
+GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(GpFontFamily**);
+
 GpStatus WINGDIPAPI GdipCreateStringFormat(INT,LANGID,GpStringFormat**);
 GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat*);
 GpStatus WINGDIPAPI GdipGetStringFormatAlign(GpStringFormat*,StringAlignment*);




More information about the wine-cvs mailing list