[GDI+: 1/5] Added public headers

Evan Stade estade at gmail.com
Fri Jun 8 15:44:28 CDT 2007


Hi,

I changed the gdiplus headers to match the PSDK headers better.

Changelog:
*added 8 headers, with C++ that matches the PSDK and C for wine compatibility

 include/gdiplus.h             |   57 +++++++++++++++++++++++++++++++
 include/gdiplusenums.h        |   49 ++++++++++++++++++++++++++
 include/gdiplusflat.h         |   50 +++++++++++++++++++++++++++
 include/gdiplusgpstubs.h      |   42 +++++++++++++++++++++++
 include/gdiplusinit.h         |   76 +++++++++++++++++++++++++++++++++++++++++
 include/gdiplusmem.h          |   35 +++++++++++++++++++
 include/gdipluspixelformats.h |   24 +++++++++++++
 include/gdiplustypes.h        |   54 +++++++++++++++++++++++++++++
 8 files changed, 387 insertions(+), 0 deletions(-)

-Evan Stade
-------------- next part --------------
diff --git a/include/gdiplus.h b/include/gdiplus.h
new file mode 100644
index 0000000..023edd8
--- /dev/null
+++ b/include/gdiplus.h
@@ -0,0 +1,57 @@
+/*
+ * 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
+
+#ifdef __cplusplus
+
+namespace Gdiplus
+{
+    namespace DllExports
+    {
+        #include "gdiplusmem.h"
+    };
+
+    #include "gdiplustypes.h"
+    #include "gdiplusenums.h"
+    #include "gdiplusinit.h"
+    #include "gdipluspixelformats.h"
+    #include "gdiplusgpstubs.h"
+
+    namespace DllExports
+    {
+        #include "gdiplusflat.h"
+    };
+};
+
+#else /* end c++ includes */
+
+#include "gdiplusmem.h"
+
+#include "gdiplustypes.h"
+#include "gdiplusenums.h"
+#include "gdiplusinit.h"
+#include "gdipluspixelformats.h"
+#include "gdiplusgpstubs.h"
+
+#include "gdiplusflat.h"
+
+#endif /* end c includes */
+
+#endif /* _GDIPLUS_H_ */
diff --git a/include/gdiplusenums.h b/include/gdiplusenums.h
new file mode 100644
index 0000000..e152e18
--- /dev/null
+++ b/include/gdiplusenums.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 _GDIPLUSENUMS_H
+#define _GDIPLUSENUMS_H
+
+enum Unit 
+{
+    UnitWorld       = 0,
+    UnitDisplay     = 1,
+    UnitPixel       = 2,
+    UnitPoint       = 3,
+    UnitInch        = 4,
+    UnitDocument    = 5,
+    UnitMillimeter  = 6
+};
+
+enum BrushType
+{
+   BrushTypeSolidColor       = 0,
+   BrushTypeHatchFill        = 1,
+   BrushTypeTextureFill      = 2,
+   BrushTypePathGradient     = 3,
+   BrushTypeLinearGradient   = 4
+};
+
+#ifndef __cplusplus
+
+typedef enum Unit Unit;
+typedef enum BrushType BrushType;
+
+#endif /* end of c typedefs */
+
+#endif
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
new file mode 100644
index 0000000..7ab2cee
--- /dev/null
+++ b/include/gdiplusflat.h
@@ -0,0 +1,50 @@
+/*
+ * 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 __stdcall
+
+#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 GdipCreateFromHWND(HWND hwnd, GpGraphics **graphics);
+GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics);
+GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1, 
+    INT y1, INT x2, INT y2);
+GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x, 
+    INT y, INT width, INT height);
+GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, 
+    REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle);
+
+GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **brush);
+GpStatus WINGDIPAPI GdipGetBrushType(GpBrush *brush, GpBrushType *type);
+GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h
new file mode 100644
index 0000000..f179727
--- /dev/null
+++ b/include/gdiplusgpstubs.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 _GDIPLUSGPSTUBS_H
+#define _GDIPLUSGPSTUBS_H
+
+#ifdef __cplusplus 
+
+class GpGraphics {};
+class GpGraphics {};
+class GpBrush {};
+class GpSolidFill {};
+
+#else /* end of c++ declarations */
+
+typedef struct GpGraphics GpGraphics;
+typedef struct GpPen GpPen;
+typedef struct GpBrush GpBrush;
+typedef struct GpSolidFill GpSolidFill;
+
+#endif /* end of c declarations */
+
+typedef Status GpStatus;
+typedef Unit GpUnit;
+typedef BrushType GpBrushType;
+
+#endif
diff --git a/include/gdiplusinit.h b/include/gdiplusinit.h
new file mode 100644
index 0000000..cc06855
--- /dev/null
+++ b/include/gdiplusinit.h
@@ -0,0 +1,76 @@
+/*
+ * 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
+
+#ifdef __cplusplus 
+
+typedef VOID (WINAPI *DebugEventProc)(DebugEventLevel level, CHAR *message);
+
+struct GdiplusStartupInput
+{
+    UINT32 GdiplusVersion;
+    DebugEventProc DebugEventCallback;
+    BOOL SuppressBackgroundThread;
+    BOOL SuppressExternalCodecs;
+
+    GdiplusStartupInput(DebugEventProc debugEventCallback = NULL,
+        BOOL suppressBackgroundThread = FALSE,
+        BOOL suppressExternalCodecs = FALSE)
+    {
+        GdiplusVersion = 1;
+        DebugEventCallback = debugEventCallback;
+        SuppressBackgroundThread = suppressBackgroundThread;
+        SuppressExternalCodecs = suppressExternalCodecs;
+    }
+};
+
+extern "C" Status WINAPI GdiplusStartup(
+    OUT ULONG_PTR *token,
+    const GdiplusStartupInput *input,
+    OUT GdiplusStartupOutput *output);
+
+extern "C" VOID WINAPI GdiplusShutdown(ULONG_PTR token);
+
+#else /* end of c++ declarations */
+
+typedef struct _GdiplusStartupInput
+{
+    UINT32 GdiplusVersion;
+    void * DebugEventCallback;  
+    BOOL SuppressBackgroundThread;
+    BOOL SuppressExternalCodecs;
+} GdiplusStartupInput;
+
+typedef struct _GdiplusStartupOutput
+{
+    ULONG_PTR NotificationHook;
+    ULONG_PTR NotificationUnhook;
+} GdiplusStartupOutput;
+
+Status WINAPI GdiplusStartup(
+    OUT ULONG_PTR *token,
+    const GdiplusStartupInput *input,
+    OUT GdiplusStartupOutput *output);
+
+void WINAPI GdiplusShutdown(ULONG_PTR token);
+
+#endif /* end of c declarations */
+
+#endif
diff --git a/include/gdiplusmem.h b/include/gdiplusmem.h
new file mode 100644
index 0000000..2d386b4
--- /dev/null
+++ b/include/gdiplusmem.h
@@ -0,0 +1,35 @@
+/*
+ * 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 __stdcall
+
+#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..5ff22e2
--- /dev/null
+++ b/include/gdiplustypes.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 _GDIPLUSTYPES_H
+#define _GDIPLUSTYPES_H
+
+typedef float REAL;
+
+enum Status{
+    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
+};
+
+#ifndef __cplusplus
+
+typedef enum Status Status;
+
+#endif /* end of c typedefs */
+
+#endif
-- 
1.4.1


More information about the wine-patches mailing list