diff --git a/build-win32 b/build-win32 index 558e280..36bad8d 100755 --- a/build-win32 +++ b/build-win32 @@ -21,7 +21,7 @@ make distclean || true cd "${BUILDDIR}" # Build for win32 -"${SRCDIR}/configure" --host=i586-mingw32msvc --prefix=/ --bindir=/bin --libdir=/lib "$@" +"${SRCDIR}/configure" --host=i586-mingw32msvc --prefix=/ --bindir=/bin --libdir=/lib CPPFLAGS="-I${SRCDIR}/win32/gdiplus/include" LIBS="-L${SRCDIR}/win32/gdiplus/lib" "$@" make pkglibdir=/lib pkgdatadir=/data bindir=/bin # Install into our private directory make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/ diff --git a/configure.ac b/configure.ac index ff3cd7d..a00cb9c 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,8 @@ AC_SUBST(LT_VERSION) AM_PROG_CC_C_O AC_PROG_CPP +AC_PROG_CXX +AC_PROG_CXXCPP AC_PROG_OBJC _AM_DEPENDENCIES([OBJC]) OBJC="${CC}" @@ -148,7 +150,19 @@ if test "${ac_cv_my_have_gdi}" != "no"; then AC_DEFINE(USE_GDI, 1, Define to 1 to use GDI) fi AM_CONDITIONAL(USE_GDI, test "${ac_cv_my_have_gdi}" = "yes") -AM_CONDITIONAL(USE_GDIPLUS, test "${ac_cv_my_have_gdi}" = "yes") + +# Use Windows GDI+? +ac_cv_my_have_gdiplus="no" +AC_LANG_PUSH(C++) +AC_CHECK_HEADERS(Gdiplus.h, + [ac_cv_my_have_gdiplus="yes"], + [ac_cv_my_have_gdiplus="no"], + [#include ]) +AC_LANG_POP(C++) +if test "${ac_cv_my_have_gdiplus}" != "no"; then + AC_DEFINE(USE_GDIPLUS, 1, Define to 1 to use GDI+) +fi +AM_CONDITIONAL(USE_GDIPLUS, test "${ac_cv_my_have_gdiplus}" = "yes") # Use Cocoa? ac_cv_my_have_cocoa="no" diff --git a/pipi/codec/gdiplus.cpp b/pipi/codec/gdiplus.cpp index faf5672..c387f8c 100755 --- a/pipi/codec/gdiplus.cpp +++ b/pipi/codec/gdiplus.cpp @@ -26,11 +26,14 @@ #include +extern "C" { #include "pipi.h" #include "pipi_internals.h" +} extern "C" pipi_image_t *pipi_load_gdiplus(const char *name) { +#if 0 size_t len; len = mbstowcs(NULL, name, 0); wchar_t *wname = new wchar_t[len + 1]; @@ -75,10 +78,13 @@ extern "C" pipi_image_t *pipi_load_gdiplus(const char *name) img->u8 = 1; return img; +#endif +return NULL; } extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name) { +#if 0 wchar_t const *fmt; if(strstr(name, ".gif")) fmt = L"image/gif"; @@ -148,6 +154,7 @@ extern "C" int pipi_save_gdiplus(pipi_image_t *img, const char *name) delete[] wname; delete b; +#endif return 0; } diff --git a/pipi/pipi_internals.h b/pipi/pipi_internals.h index 73012f8..4fa77fd 100644 --- a/pipi/pipi_internals.h +++ b/pipi/pipi_internals.h @@ -82,6 +82,11 @@ pipi_image_t *pipi_load_sdl(const char *name); int pipi_save_sdl(pipi_image_t *img, const char *name); #endif +#ifdef USE_GDIPLUS +pipi_image_t *pipi_load_gdiplus(const char *name); +int pipi_save_gdiplus(pipi_image_t *img, const char *name); +#endif + #ifdef USE_GDI pipi_image_t *pipi_load_gdi(const char *name); int pipi_save_gdi(pipi_image_t *img, const char *name); diff --git a/win32/gdiplus/include/GdiplusEnums.h b/win32/gdiplus/include/GdiplusEnums.h index 42b620c..6d06619 100644 --- a/win32/gdiplus/include/GdiplusEnums.h +++ b/win32/gdiplus/include/GdiplusEnums.h @@ -530,7 +530,7 @@ enum ObjectType inline BOOL ObjectTypeIsValid( - ObjectType type + enum ObjectType type ) { return ((type >= ObjectTypeMin) && (type <= ObjectTypeMax)); diff --git a/win32/gdiplus/include/GdiplusFlat.h b/win32/gdiplus/include/GdiplusFlat.h index 8b5369e..909923c 100644 --- a/win32/gdiplus/include/GdiplusFlat.h +++ b/win32/gdiplus/include/GdiplusFlat.h @@ -32,7 +32,7 @@ extern "C" { VOID WINGDIPAPI -GdipDisplayPaletteWindowNotify(WindowNotifyEnum notify); +GdipDisplayPaletteWindowNotify(enum WindowNotifyEnum notify); #endif diff --git a/win32/gdiplus/lib/gdiplus.lib b/win32/gdiplus/lib/libgdiplus.a similarity index 100% rename from win32/gdiplus/lib/gdiplus.lib rename to win32/gdiplus/lib/libgdiplus.a diff --git a/win32/gdiplus/lib/gdiplus.dll b/win32/gdiplus/lib/libgdiplus.dll similarity index 100% rename from win32/gdiplus/lib/gdiplus.dll rename to win32/gdiplus/lib/libgdiplus.dll