GDI+: headers, two tests

Evan Stade estade at gmail.com
Wed May 30 15:19:10 CDT 2007


Skipped content of type multipart/alternative-------------- next part --------------
diff --git a/dlls/gdiplus/Makefile.in b/dlls/gdiplus/Makefile.in
index f1d5040..25160a9 100644
--- a/dlls/gdiplus/Makefile.in
+++ b/dlls/gdiplus/Makefile.in
@@ -7,7 +7,9 @@ IMPORTLIB = libgdiplus.$(IMPLIBEXT)
 IMPORTS   = gdi32 advapi32 kernel32 ntdll
 
 C_SRCS = \
-	gdiplus.c
+	gdiplus.c \
+	memory.c \
+	pen.c
 
 @MAKE_DLL_RULES@
 
diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c
index 367fab5..bedc9e3 100644
--- a/dlls/gdiplus/gdiplus.c
+++ b/dlls/gdiplus/gdiplus.c
@@ -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,28 @@ 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 */
+}
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..ed0c2d5
--- /dev/null
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2007 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 _GP_PRIVATE_H_
+#define _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/memory.c b/dlls/gdiplus/memory.c
new file mode 100644
index 0000000..37eff0f
--- /dev/null
+++ b/dlls/gdiplus/memory.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2007 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 "Gdiplus.h"
+#include "gdiplus_private.h"
+
+void* WINGDIPAPI GdipAlloc(size_t size)
+{
+    return HeapAlloc(GetProcessHeap(), 0, size);
+}
+
+void WINGDIPAPI GdipFree(void* ptr)
+{
+    if(ptr)
+        HeapFree(GetProcessHeap(), 0, ptr);
+}
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
new file mode 100644
index 0000000..b681792
--- /dev/null
+++ b/dlls/gdiplus/pen.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2007 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(gdip);
+
+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..7024e24
--- /dev/null
+++ b/dlls/gdiplus/tests/init.c
@@ -0,0 +1,60 @@
+/*
+ * Unit test suite for GDI+ initialization
+ *
+ * Copyright 2007 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);
+}
+
+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..7ac1a85
--- /dev/null
+++ b/dlls/gdiplus/tests/pen.c
@@ -0,0 +1,60 @@
+/*
+ * Unit test suite for pens
+ *
+ * Copyright 2007 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;
+    GpGraphics *pen;
+
+    status = GdipCreatePen1((ARGB)0xffff00ff, 10.0f, UnitPixel, &pen);
+    expect(Ok, status);
+    ok(pen, "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..a56b1c2
--- /dev/null
+++ b/include/Gdiplus.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2007 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..f37198b
--- /dev/null
+++ b/include/GdiplusEnums.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2007 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 _GP_ENUMERATIONS_H_
+#define _GP_ENUMERATIONS_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..09da264
--- /dev/null
+++ b/include/GdiplusFlat.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2007 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 _GP_FLATAPI_H_
+#define _GP_FLATAPI_H_
+
+#define WINGDIPAPI WINAPI
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics);
+GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics);
+
+GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit, 
+    GpPen **pen);
+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..7fd8517
--- /dev/null
+++ b/include/GdiplusGpStubs.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2007 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 _GP_STUBS_H_
+#define _GP_STUBS_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 100755
index 0000000..967cbb4
--- /dev/null
+++ b/include/GdiplusInit.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2007 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 _GP_INIT_H_
+#define _GP_INIT_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..8e153a8
--- /dev/null
+++ b/include/GdiplusMem.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2007 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 _GP_MEMORY_H_
+#define _GP_MEMORY_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..1607e96
--- /dev/null
+++ b/include/GdiplusPixelFormats.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2007 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 _GP_PIXELFORMATS_H_
+#define _GP_PIXELFORMATS_H_
+
+typedef DWORD ARGB;
+
+#endif
diff --git a/include/GdiplusTypes.h b/include/GdiplusTypes.h
new file mode 100755
index 0000000..53c77c0
--- /dev/null
+++ b/include/GdiplusTypes.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2007 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 _GP_TYPES_H_
+#define _GP_TYPES_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