Added GDI+ public headers, small implementation of pen, memory and initialization, and two tests (2nd try)

Evan Stade estade at gmail.com
Thu May 31 20:02:26 CDT 2007


Hi,

Differences from last submission:
I made the fixes that Dmitry suggested.  Additionally I changed the
public header files to all lower-case (to match the wine headers
rather than platform sdk headers).  I also consolidated a couple of
source files so there wouldn't be files with only 2 functions in them.

I believe there was a question earlier on the list about why there is
"#ifndef __cplusplus ... #endif" around portions of the headers.  This
is because this implementation of gdi+ only supports c and not c++.

Changelog:
*Added GDI+ public headers
*Added some implementation (pen.c, gdiplus.c, memory.c)
*Added two tests (pen.c, init.c)

 dlls/gdiplus/Makefile.in       |    3 +
 dlls/gdiplus/gdiplus.c         |   40 ++++++++++++++++++-
 dlls/gdiplus/gdiplus.spec      |   12 +++---
 dlls/gdiplus/gdiplus_private.h |   42 ++++++++++++++++++++
 dlls/gdiplus/pen.c             |   85 ++++++++++++++++++++++++++++++++++++++++
 dlls/gdiplus/tests/Makefile.in |   14 +++++++
 dlls/gdiplus/tests/init.c      |   62 +++++++++++++++++++++++++++++
 dlls/gdiplus/tests/pen.c       |   60 ++++++++++++++++++++++++++++
 include/gdiplus.h              |   34 ++++++++++++++++
 include/gdiplusenums.h         |   32 +++++++++++++++
 include/gdiplusflat.h          |   41 +++++++++++++++++++
 include/gdiplusgpstubs.h       |   32 +++++++++++++++
 include/gdiplusinit.h          |   54 +++++++++++++++++++++++++
 include/gdiplusmem.h           |   36 +++++++++++++++++
 include/gdipluspixelformats.h  |   24 +++++++++++
 include/gdiplustypes.h         |   49 +++++++++++++++++++++++
 16 files changed, 612 insertions(+), 8 deletions(-)

-Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/Makefile.in b/dlls/gdiplus/Makefile.in
index f1d5040..a4edb46 100644
--- a/dlls/gdiplus/Makefile.in
+++ b/dlls/gdiplus/Makefile.in
@@ -7,7 +7,8 @@ IMPORTLIB = libgdiplus.$(IMPLIBEXT)
 IMPORTS   = gdi32 advapi32 kernel32 ntdll
 
 C_SRCS = \
-	gdiplus.c
+	gdiplus.c \
+	pen.c
 
 @MAKE_DLL_RULES@
 
diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c
index 367fab5..7a5995c 100644
--- a/dlls/gdiplus/gdiplus.c
+++ b/dlls/gdiplus/gdiplus.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Evan Stade
+ * Copyright (C) 2007 Google (Evan Stade)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,9 @@ #include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
 #include "wine/debug.h"
+#include "wingdi.h"
+#include "gdiplus.h"
+#include "gdiplus_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
 
@@ -43,3 +46,38 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWO
     }
     return TRUE;
 }
+
+Status WINAPI GdiplusStartup(ULONG_PTR *token, const GdiplusStartupInput *input, 
+    GdiplusStartupOutput *output)
+{
+    if(!token)
+        return InvalidParameter;
+
+    if(input->GdiplusVersion != 1) {
+        return UnsupportedGdiplusVersion;
+    } else if ((input->DebugEventCallback) || 
+        (input->SuppressBackgroundThread) || (input->SuppressExternalCodecs)){
+        FIXME("Unimplemented for non-default GdiplusStartupInput");
+        return NotImplemented;
+    } else if(output) {
+        FIXME("Unimplemented for non-null GdiplusStartupOutput");
+        return NotImplemented;
+    }
+
+    return Ok;
+}
+
+void WINAPI GdiplusShutdown(ULONG_PTR token)
+{
+    /* FIXME: no object tracking */
+}
+
+void* WINGDIPAPI GdipAlloc(size_t size)
+{
+    return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
+}
+
+void WINGDIPAPI GdipFree(void* ptr)
+{
+    HeapFree(GetProcessHeap(), 0, ptr);
+}
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 863be69..2bb3ba9 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -31,7 +31,7 @@
 @ stub GdipAddPathRectanglesI
 @ stub GdipAddPathString
 @ stub GdipAddPathStringI
-@ stub GdipAlloc
+@ stdcall GdipAlloc(long)
 @ stub GdipBeginContainer2
 @ stub GdipBeginContainer
 @ stub GdipBeginContainerI
@@ -111,7 +111,7 @@
 @ stub GdipCreatePathGradientFromPath
 @ stub GdipCreatePathGradientI
 @ stub GdipCreatePathIter
-@ stub GdipCreatePen1
+@ stdcall GdipCreatePen1(long long long ptr)
 @ stub GdipCreatePen2
 @ stub GdipCreateRegion
 @ stub GdipCreateRegionHrgn
@@ -136,7 +136,7 @@
 @ stub GdipDeleteMatrix
 @ stub GdipDeletePath
 @ stub GdipDeletePathIter
-@ stub GdipDeletePen
+@ stdcall GdipDeletePen(ptr)
 @ stub GdipDeletePrivateFontCollection
 @ stub GdipDeleteRegion
 @ stub GdipDeleteStringFormat
@@ -222,7 +222,7 @@
 @ stub GdipFillRegion
 @ stub GdipFlattenPath
 @ stub GdipFlush
-@ stub GdipFree
+@ stdcall GdipFree(ptr)
 @ stub GdipGetAdjustableArrowCapFillState
 @ stub GdipGetAdjustableArrowCapHeight
 @ stub GdipGetAdjustableArrowCapMiddleInset
@@ -605,5 +605,5 @@
 @ stub GdipWindingModeOutline
 @ stub GdiplusNotificationHook
 @ stub GdiplusNotificationUnhook
-@ stub GdiplusShutdown
-@ stub GdiplusStartup
+@ stdcall GdiplusShutdown(ptr)
+@ stdcall GdiplusStartup(ptr ptr ptr)
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
new file mode 100644
index 0000000..61fb0a0
--- /dev/null
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_GP_PRIVATE_H_
+#define __WINE_GP_PRIVATE_H_
+
+#include "windef.h"
+#include "winbase.h"
+#include "gdiplus.h"
+
+/* FIXME: this is just a guess, must check later */
+#define GP_DEFAULT_PENSTYLE (PS_SOLID | PS_GEOMETRIC | PS_ENDCAP_SQUARE | \
+        PS_JOIN_BEVEL)
+
+struct GpPen{
+    UINT style;
+    ARGB color;
+    GpUnit unit;
+    REAL width;
+    HPEN gdipen;
+};
+
+struct GpGraphics{
+    HDC hdc;
+};
+
+#endif
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
new file mode 100644
index 0000000..e1041f1
--- /dev/null
+++ b/dlls/gdiplus/pen.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "gdiplus.h"
+#include "gdiplus_private.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
+
+static COLORREF ARGB2COLORREF(ARGB color)
+{
+    /*
+    Packing of these color structures:
+    COLORREF:   00bbggrr
+    ARGB:       aarrggbb
+    FIXME:doesn't handle alpha channel
+    */
+    return (COLORREF)
+        ((color & 0x0000ff) << 16) + 
+         (color & 0x00ff00) + 
+        ((color & 0xff0000) >> 16);
+}
+
+GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, FLOAT width, GpUnit unit, 
+    GpPen **pen)
+{
+    LOGBRUSH lb;
+    GpPen *gp_pen;
+
+    gp_pen = (GpPen*) GdipAlloc(sizeof(GpPen));
+    if(!pen)    return OutOfMemory;
+
+    gp_pen->style = GP_DEFAULT_PENSTYLE;
+    gp_pen->color = ARGB2COLORREF(color);
+    gp_pen->width = width;
+    gp_pen->unit = unit;
+
+    /* FIXME: Currently only solid lines supported. */
+    lb.lbStyle = BS_SOLID;
+    lb.lbColor = gp_pen->color;
+    lb.lbHatch = 0;
+
+    if((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel)) {
+        gp_pen->gdipen = ExtCreatePen(gp_pen->style, (INT) gp_pen->width, &lb, 
+            0, NULL);
+    } else {
+        FIXME("UnitWorld, UnitPixel only supported units");
+        return InvalidParameter;
+    }
+
+    if(!gp_pen)
+        return GenericError;
+
+    *pen = gp_pen;
+
+    return Ok;
+}
+
+GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen)
+{
+    if(!pen)    return InvalidParameter;
+    DeleteObject(pen->gdipen);
+    GdipFree(pen);
+    return Ok;
+}
diff --git a/dlls/gdiplus/tests/Makefile.in b/dlls/gdiplus/tests/Makefile.in
new file mode 100644
index 0000000..19e5fdf
--- /dev/null
+++ b/dlls/gdiplus/tests/Makefile.in
@@ -0,0 +1,14 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+TESTDLL   = gdiplus.dll
+IMPORTS   = user32 gdi32 kernel32 gdiplus
+
+CTESTS = \
+	init.c \
+	pen.c
+
+ at MAKE_TEST_RULES@
+
+ at DEPENDENCIES@  # everything below this line is overwritten by make depend
diff --git a/dlls/gdiplus/tests/init.c b/dlls/gdiplus/tests/init.c
new file mode 100644
index 0000000..63aa4d2
--- /dev/null
+++ b/dlls/gdiplus/tests/init.c
@@ -0,0 +1,62 @@
+/*
+ * Unit test suite for GDI+ initialization
+ *
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "gdiplus.h"
+#include "wine/test.h"
+
+#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
+
+static void test_startup(void)
+{
+    GpPen *pen;
+    Status status;
+    GdiplusStartupInput gdiplusStartupInput;
+    ULONG_PTR gdiplusToken;
+
+    gdiplusStartupInput.GdiplusVersion              = 1;
+    gdiplusStartupInput.DebugEventCallback          = NULL;
+    gdiplusStartupInput.SuppressBackgroundThread    = 0;
+    gdiplusStartupInput.SuppressExternalCodecs      = 0;
+
+    status = GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
+    expect(Ok, status);
+    GdiplusShutdown(gdiplusToken);
+
+    gdiplusStartupInput.GdiplusVersion = 2;
+
+    status = GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
+    expect(UnsupportedGdiplusVersion, status);
+    GdiplusShutdown(gdiplusToken);
+
+    status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
+
+    todo_wine
+        expect(GdiplusNotInitialized, status);
+
+    GdipDeletePen(pen);
+}
+
+START_TEST(init)
+{
+    test_startup();
+}
diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c
new file mode 100644
index 0000000..64bfa32
--- /dev/null
+++ b/dlls/gdiplus/tests/pen.c
@@ -0,0 +1,60 @@
+/*
+ * Unit test suite for pens
+ *
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "gdiplus.h"
+#include "wine/test.h"
+
+#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
+
+static void test_constructor_destructor(void)
+{
+    GpStatus status;
+    GpPen *pen = NULL;
+
+    status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
+    expect(Ok, status);
+    ok(pen != NULL, "Expected pen to be initialized");
+
+    status = GdipDeletePen(NULL);
+    expect(InvalidParameter, status);
+
+    status = GdipDeletePen(pen);
+    expect(Ok, status);
+}
+
+START_TEST(pen)
+{
+    GdiplusStartupInput gdiplusStartupInput;
+    ULONG_PTR gdiplusToken;
+
+    gdiplusStartupInput.GdiplusVersion              = 1;
+    gdiplusStartupInput.DebugEventCallback          = NULL;
+    gdiplusStartupInput.SuppressBackgroundThread    = 0;
+    gdiplusStartupInput.SuppressExternalCodecs      = 0;
+
+    GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
+
+    test_constructor_destructor();
+
+    GdiplusShutdown(gdiplusToken);
+}
diff --git a/include/gdiplus.h b/include/gdiplus.h
new file mode 100644
index 0000000..36961f5
--- /dev/null
+++ b/include/gdiplus.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _GDIPLUS_H_
+#define _GDIPLUS_H_
+
+#ifndef __cplusplus
+
+#include "gdiplusmem.h"
+#include "gdiplustypes.h"
+#include "gdiplusenums.h"
+#include "gdiplusinit.h"
+#include "gdipluspixelformats.h"
+#include "gdiplusgpstubs.h"
+#include "gdiplusflat.h"
+
+#endif /* __cplusplus */
+
+#endif
diff --git a/include/gdiplusenums.h b/include/gdiplusenums.h
new file mode 100644
index 0000000..04a5536
--- /dev/null
+++ b/include/gdiplusenums.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _GDIPLUSENUMS_H
+#define _GDIPLUSENUMS_H
+
+typedef enum {
+    UnitWorld = 0,
+    UnitDisplay = 1,
+    UnitPixel = 2,
+    UnitPoint = 3,
+    UnitInch = 4,
+    UnitDocument = 5,
+    UnitMillimeter = 6
+} Unit;
+
+#endif
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
new file mode 100644
index 0000000..4c3bdcb
--- /dev/null
+++ b/include/gdiplusflat.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _FLATAPI_H
+#define _FLATAPI_H
+
+#define WINGDIPAPI WINAPI
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit, 
+    GpPen **pen);
+GpStatus WINGDIPAPI GdipDeletePen(GpPen *pen);
+
+GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics);
+GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics);
+GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1, 
+    INT y1, INT x2, INT y2);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h
new file mode 100644
index 0000000..37d576f
--- /dev/null
+++ b/include/gdiplusgpstubs.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _GDIPLUSGPSTUBS_H
+#define _GDIPLUSGPSTUBS_H
+
+#ifndef __cplusplus
+
+typedef Status GpStatus;
+typedef Unit GpUnit;
+
+typedef struct GpGraphics GpGraphics;
+typedef struct GpPen GpPen;
+
+#endif /* __cplusplus */
+
+#endif
diff --git a/include/gdiplusinit.h b/include/gdiplusinit.h
new file mode 100644
index 0000000..65c5080
--- /dev/null
+++ b/include/gdiplusinit.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _GDIPLUSINIT_H
+#define _GDIPLUSINIT_H
+
+#ifndef __cplusplus
+
+typedef struct _GdiplusStartupInput
+{
+    UINT32 GdiplusVersion;
+    void * DebugEventCallback;	
+    BOOL SuppressBackgroundThread;
+    BOOL SuppressExternalCodecs;
+} GdiplusStartupInput;
+
+typedef struct _GdiplusStartupOutput
+{
+    ULONG_PTR NotificationHook;
+    ULONG_PTR NotificationUnhook;
+} GdiplusStartupOutput;
+#endif /* __cplusplus */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+Status WINAPI GdiplusStartup(
+    OUT ULONG_PTR *token,
+    const GdiplusStartupInput *input,
+    OUT GdiplusStartupOutput *output);
+
+void WINAPI GdiplusShutdown(ULONG_PTR token);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/gdiplusmem.h b/include/gdiplusmem.h
new file mode 100644
index 0000000..cf7c00f
--- /dev/null
+++ b/include/gdiplusmem.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _GDIPLUSMEM_H
+#define _GDIPLUSMEM_H
+
+#define WINGDIPAPI WINAPI
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void* WINGDIPAPI GdipAlloc(size_t size);
+
+void WINGDIPAPI GdipFree(void* ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/gdipluspixelformats.h b/include/gdipluspixelformats.h
new file mode 100644
index 0000000..b2110c1
--- /dev/null
+++ b/include/gdipluspixelformats.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _GDIPLUSPIXELFORMATS_H
+#define _GDIPLUSPIXELFORMATS_H
+
+typedef DWORD ARGB;
+
+#endif
diff --git a/include/gdiplustypes.h b/include/gdiplustypes.h
new file mode 100644
index 0000000..13e8536
--- /dev/null
+++ b/include/gdiplustypes.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _GDIPLUSTYPES_H
+#define _GDIPLUSTYPES_H
+
+typedef float REAL;
+
+typedef enum {
+    Ok = 0,
+    GenericError = 1,
+    InvalidParameter = 2,
+    OutOfMemory = 3,
+    ObjectBusy = 4,
+    InsufficientBuffer = 5,
+    NotImplemented = 6,
+    Win32Error = 7,
+    WrongState = 8,
+    Aborted = 9,
+    FileNotFound = 10,
+    ValueOverflow = 11,
+    AccessDenied = 12,
+    UnknownImageFormat = 13,
+    FontFamilyNotFound = 14,
+    FontStyleNotFound = 15,
+    NotTrueTypeFont = 16,
+    UnsupportedGdiplusVersion = 17,
+    GdiplusNotInitialized = 18,
+    PropertyNotFound = 19,
+    PropertyNotSupported = 20,
+    ProfileNotFound = 21
+} Status;
+
+#endif
-- 
1.4.1


More information about the wine-patches mailing list