This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  3e85cf242ac7bcd516f5ba9bf5854562db458daa (commit)
       via  4e55a370bbd085cd73b0bc8ed0e2a169acdb4bfe (commit)
      from  dcfa3fb48e309abcdfdccbea9bb883b7aa5a88e5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/3e85cf242ac7bcd516f5ba9bf5854562db458daa

commit 3e85cf242ac7bcd516f5ba9bf5854562db458daa
Author: Doug Torrance <dtorra...@monmouthcollege.edu>
Date:   Sun Apr 27 16:40:55 2014 -0500

    Added pkg-config file for WUtil.
    
    Currently, there is no WUtil.pc file so that WINGs developers can use
    pkg-config to compile programs using the WINGs utility library.  This patch
    fixes this, and such a file is created by make, just like WINGs.pc and
    wrlib.pc.
    
    In addition, the WUtil.pc file has been added to .gitignore and included in
    the debian libwings-dev package.

diff --git a/.gitignore b/.gitignore
index 77fee965..2dc28602 100644
--- a/.gitignore
+++ b/.gitignore
@@ -81,6 +81,7 @@ WPrefs.app/WPrefs
 # These files are generated from make rules
 wrlib/wrlib.pc
 WINGs/WINGs.pc
+WINGs/WUtil.pc
 
 WindowMaker/Defaults/WMRootMenu
 WindowMaker/Defaults/WMState
diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am
index 3dac104a..e70988de 100644
--- a/WINGs/Makefile.am
+++ b/WINGs/Makefile.am
@@ -94,7 +94,7 @@ AM_CPPFLAGS = -DLOCALEDIR="$(NLSDIR)" 
-DRESOURCE_PATH="$(datadir)/WINGs"      @XFTFLAGS@ @HEADER_SEARCH_PATH@
 
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = WINGs.pc
+pkgconfig_DATA = WINGs.pc WUtil.pc
 
 DISTCLEANFILES = $(pkgconfig_DATA) get-wings-flags get-wutil-flags
 
@@ -103,7 +103,7 @@ WINGs.pc: Makefile
        @echo 'Name: WINGs' > $@
        @echo 'Description: Small widget set with the NeXTStep(TM) look and 
feel' >> $@
        @echo 'Version: $(VERSION)' >> $@
-       @echo 'Requires: wrlib' >> $@
+       @echo 'Requires: wrlib WUtil' >> $@
        @echo 'Libs: $(lib_search_path) -lWINGs' >> $@
        @echo 'Libs.private: $(XFTLIBS) $(XLIBS) -lm $(INTLIBS)' >> $@
        @echo 'Cflags: $(inc_search_path)' >> $@
@@ -118,6 +118,15 @@ get-wings-flags: get-wings-flags.in Makefile
                -e 's#$${XLIBS}#$(XLIBS)#;' < $(abs_srcdir)/get-wings-flags.in 
> $@
        @chmod 755 $@
 
+WUtil.pc: Makefile
+       @echo "Generating $@"
+       @echo 'Name: WUtil' > $@
+       @echo 'Description: Utility library for WINGs' >> $@
+       @echo 'Version: $(VERSION)' >> $@
+       @echo 'Libs: -L$(libdir) -lWUtil' >> $@
+       @echo 'Libs.private: $(INTLIBS)' >> $@
+       @echo 'Cflags: -I$(includedir)' >> $@
+
 get-wutil-flags: get-wutil-flags.in Makefile
        @echo "Generating $@"
        @$(SED) -e 's#$${includedir}#$(includedir)#;' diff --git 
a/debian/libwings-dev.install b/debian/libwings-dev.install
index 475aa096..62f00166 100644
--- a/debian/libwings-dev.install
+++ b/debian/libwings-dev.install
@@ -2,6 +2,7 @@ usr/include/WINGs/WUtil.h
 usr/include/WINGs/WINGs.h
 usr/include/WINGs/WINGsP.h
 usr/lib/pkgconfig/WINGs.pc
+usr/lib/pkgconfig/WUtil.pc
 usr/lib/libWINGs.a
 usr/lib/libWUtil.a
 usr/lib/libWUtil.so

http://repo.or.cz/w/wmaker-crm.git/commit/4e55a370bbd085cd73b0bc8ed0e2a169acdb4bfe

commit 4e55a370bbd085cd73b0bc8ed0e2a169acdb4bfe
Author: David Maciejak <david.macie...@gmail.com>
Date:   Sat Mar 8 11:02:08 2014 +0800

    wrlib: added support for imagemagick third-party lib
    
    It uses to provide some missing common image format
    like SVG, BMP, PICT, ...

diff --git a/configure.ac b/configure.ac
index a0aca45a..4e3501a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -322,6 +322,11 @@ dnl ==========
 dnl AC_ARG_VAR(PKGCONFIG, [pkg-config command])
 AC_CHECK_PROG(PKGCONFIG, pkg-config, pkg-config) 
 
+dnl MagickWand-config
+dnl ==========
+dnl AC_ARG_VAR(MAGICKWCONFIG, [MagickWand-config command])
+AC_CHECK_PROG(MAGICKWCONFIG, MagickWand-config, MagickWand-config)
+
 dnl gettext
 dnl =======
 
@@ -559,6 +564,26 @@ else
 fi
 AC_SUBST(FCLIBS)
 
+dnl
+dnl libMagickWand
+dnl
+AC_MSG_CHECKING([for libmagickwand header])
+IMFLAGS=`$MAGICKWCONFIG --cflags`
+if test "x$IMFLAGS" = "x" ; then
+        AC_MSG_RESULT([not found])
+else
+        AC_MSG_RESULT([found])
+fi
+AC_SUBST(IMFLAGS)
+
+AC_MSG_CHECKING([for libmagickwand library])
+IMLIBS=`$MAGICKWCONFIG --ldflags`
+if test "x$IMLIBS" = "x" ; then
+        AC_MSG_RESULT([not found])
+else
+        AC_MSG_RESULT([found])
+fi
+AC_SUBST(IMLIBS)
 
 dnl Xft2 antialiased font support
 dnl =============================
@@ -690,6 +715,16 @@ AC_ARG_ENABLE([webp],
 WM_IMGFMT_CHECK_WEBP
 
 
+dnl MAGICK Support
+dnl ===========
+AC_ARG_ENABLE([magick],
+    [AS_HELP_STRING([--disable-magick], [disable MAGICK support through 
libMagickWand])],
+    [AS_CASE(["$enableval"],
+        [yes|no], [],
+        [AC_MSG_ERROR([bad value $enableval for --enable-magick])] )],
+    [enable_magick=auto])
+WM_IMGFMT_CHECK_MAGICK
+
 dnl PPM Support
 dnl ===========
 # The PPM format is always enabled because we have built-in support for the 
format
diff --git a/m4/wm_imgfmt_check.m4 b/m4/wm_imgfmt_check.m4
index ad37993a..535a1c57 100644
--- a/m4/wm_imgfmt_check.m4
+++ b/m4/wm_imgfmt_check.m4
@@ -244,3 +244,23 @@ AS_IF([test "x$enable_xpm" = "xno"],
     ])
 AM_CONDITIONAL([USE_XPM], [test "x$enable_xpm" != "xno"])dnl
 ]) dnl AC_DEFUN
+
+# WM_IMGFMT_CHECK_MAGICK
+# -------------------
+#
+# Check for MAGICK file support through 'libMagickWand'
+# The check depends on variable 'enable_magick' being either:
+#   yes  - detect, fail if not found
+#   no   - do not detect, disable support
+#   auto - detect, disable if not found
+#
+# When not found, append info to variable 'unsupported'
+AC_DEFUN_ONCE([WM_IMGFMT_CHECK_MAGICK],
+[WM_LIB_CHECK([MAGICK], ["$IMLIBS"], [MagickGetImagePixels], [$XLFLAGS $XLIBS],
+    [wm_save_CFLAGS="$CFLAGS $IMFLAGS"
+     AS_IF([wm_fn_lib_try_compile "wand/magick_wand.h" "" "return 0" ""],
+         [],
+         [AC_MSG_ERROR([found $CACHEVAR but could not find appropriate header 
- are you missing libmagickwand package?])])
+     CFLAGS="$wm_save_CFLAGS"],
+    [supported_gfx], [GFXLIBS])dnl
+]) dnl AC_DEFUN
diff --git a/src/dialog.c b/src/dialog.c
index f5055ae2..f2f81bbe 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -1280,7 +1280,7 @@ void wShowInfoPanel(WScreen *scr)
        }
 #endif
 
-       strbuf = wstrappend(strbuf, _("Supported image formats: "));
+       strbuf = wstrappend(strbuf, _("Image formats: "));
        strl = RSupportedFileFormats();
        separator = NULL;
        for (i = 0; strl[i] != NULL; i++) {
@@ -1297,6 +1297,10 @@ void wShowInfoPanel(WScreen *scr)
        strbuf = wstrappend(strbuf, ", MWM");
 #endif
 
+#ifdef USE_MAGICK
+       strbuf = wstrappend(strbuf, ", ImageMagick");
+#endif
+
 #ifdef USE_XINERAMA
        strbuf = wstrappend(strbuf, _("n"));
 #ifdef SOLARIS_XINERAMA
@@ -1305,7 +1309,7 @@ void wShowInfoPanel(WScreen *scr)
        strbuf = wstrappend(strbuf, _("Xinerama: "));
        {
                char tmp[128];
-               snprintf(tmp, sizeof(tmp) - 1, _("%d heads found."), 
scr->xine_info.count);
+               snprintf(tmp, sizeof(tmp) - 1, _("%d head(s) found."), 
scr->xine_info.count);
                strbuf = wstrappend(strbuf, tmp);
        }
 #endif
diff --git a/src/main.c b/src/main.c
index a21290e5..bc147216 100644
--- a/src/main.c
+++ b/src/main.c
@@ -201,6 +201,7 @@ noreturn void Exit(int status)
        if (dpy)
                XCloseDisplay(dpy);
 
+       RShutdown(); /* wrlib clean exit */
        wutil_shutdown();  /* WUtil clean-up */
 
        exit(status);
diff --git a/wrlib/Makefile.am b/wrlib/Makefile.am
index 48af352a..daf4a1ff 100644
--- a/wrlib/Makefile.am
+++ b/wrlib/Makefile.am
@@ -64,6 +64,10 @@ if USE_WEBP
 libwraster_la_SOURCES += load_webp.c
 endif
 
+if USE_MAGICK
+libwraster_la_SOURCES += load_magick.c
+endif
+
 AM_CPPFLAGS = $(DFLAGS) @HEADER_SEARCH_PATH@
 
 libwraster_la_LIBADD = @LIBRARY_SEARCH_PATH@ @GFXLIBS@ @XLIBS@ @LIBXMU@ -lm
diff --git a/wrlib/imgformat.h b/wrlib/imgformat.h
index 43df3ec9..0a440091 100644
--- a/wrlib/imgformat.h
+++ b/wrlib/imgformat.h
@@ -39,12 +39,13 @@ typedef enum {
        IM_PPM     =  4,
        IM_JPEG    =  5,
        IM_GIF     =  6,
-       IM_WEBP    =  7
+       IM_WEBP    =  7,
+       IM_MAGICK  =  8
 } WRImgFormat;
 
 /* How many image types we have. */
 /* Increase this when adding new image types! */
-#define IM_TYPES    7
+#define IM_TYPES    8
 
 /*
  * Function for Loading in a specific format
@@ -73,6 +74,10 @@ RImage *RLoadGIF(const char *file, int index);
 RImage *RLoadWEBP(const char *file);
 #endif
 
+#ifdef USE_MAGICK
+RImage *RLoadMagick(const char *file_name);
+ #endif
+
 /*
  * Function for Saving in a specific format
  */
diff --git a/wrlib/libwraster.map b/wrlib/libwraster.map
index 6282e2c4..6e165ef0 100644
--- a/wrlib/libwraster.map
+++ b/wrlib/libwraster.map
@@ -72,6 +72,7 @@ LIBWRASTER3
     RRotateImage;
     RSaveImage;
     RScaleImage;
+    RShutdown;
     RSmoothScaleImage;
     RSupportedFileFormats;
 
diff --git a/wrlib/load.c b/wrlib/load.c
index 641cfae6..477e92df 100644
--- a/wrlib/load.c
+++ b/wrlib/load.c
@@ -103,6 +103,13 @@ char **RSupportedFileFormats(void)
        return tmp;
 }
 
+/* cleaning third-party libs at shutdown */
+void RShutdown() {
+#ifdef USE_MAGICK
+       MagickWandTerminus();
+#endif
+}
+
 static void init_cache(void)
 {
        char *tmp;
@@ -165,8 +172,16 @@ RImage *RLoadImage(RContext * context, const char *file, 
int index)
                return NULL;
 
        case IM_UNKNOWN:
+#ifdef USE_MAGICK
+               /* generic file format support using ImageMagick
+                * BMP, PCX, PICT, SVG, ...
+               */
+               image = RLoadMagick(file);
+               break;
+#else
                RErrorCode = RERR_BADFORMAT;
                return NULL;
+#endif
 
        case IM_XPM:
                image = RLoadXPM(context, file);
diff --git a/wrlib/load_magick.c b/wrlib/load_magick.c
new file mode 100644
index 00000000..b08e5911
--- /dev/null
+++ b/wrlib/load_magick.c
@@ -0,0 +1,90 @@
+/* load_magick.c - load image file using ImageMagick
+ *
+ * Raster graphics library
+ *
+ * Copyright (c) 2014 Window Maker Team
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 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
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library 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 <config.h>
+#include <X11/Xlib.h>
+
+#include <wand/magick_wand.h>
+
+#include "wraster.h"
+#include "imgformat.h"
+
+RImage * RLoadMagick(const char *file_name)
+{
+       RImage *image = NULL;
+       unsigned char *ptr;
+       unsigned long w,h;
+       MagickWand *m_wand = NULL;
+       MagickBooleanType mrc;
+       MagickBooleanType hasAlfa;
+       PixelWand *bg_wand = NULL;
+
+       MagickWandGenesis();
+
+       /* Create a wand */
+       m_wand = NewMagickWand();
+
+       /* set the default background as transparent */
+       bg_wand = NewPixelWand ();
+       PixelSetColor(bg_wand, "none");
+       MagickSetBackgroundColor(m_wand, bg_wand);
+
+       /* Read the input image */
+       if (!MagickReadImage(m_wand, file_name)) {
+               RErrorCode = RERR_BADIMAGEFILE;
+               goto bye;
+       }
+
+       w = MagickGetImageWidth(m_wand);
+       h = MagickGetImageHeight(m_wand);
+       //fprintf(stderr, "%lu x %lun", w,h);
+
+       hasAlfa = MagickGetImageAlphaChannel(m_wand);
+
+       image = RCreateImage(w, h, (unsigned int) hasAlfa);
+       if (!image) {
+               RErrorCode = RERR_NOMEMORY;
+               goto bye;
+       }
+
+       ptr = image->data;
+       if (hasAlfa == MagickTrue)
+               mrc = MagickExportImagePixels(m_wand, 0, 0, (size_t)w, 
(size_t)h, "RGBA", CharPixel, ptr);
+       else
+               mrc = MagickExportImagePixels(m_wand, 0, 0, (size_t)w, 
(size_t)h, "RGB", CharPixel, ptr);
+
+       if (mrc == MagickFalse) {
+               RErrorCode = RERR_BADIMAGEFILE;
+               RReleaseImage(image);
+               goto bye;
+       }
+
+bye:
+       /* Tidy up */
+       DestroyPixelWand(bg_wand);
+       MagickClearException(m_wand);
+       m_wand = DestroyMagickWand(m_wand);
+       /* destroy is called when exiting wmaker */
+       /* MagickWandTerminus(); */
+
+       return image;
+}
diff --git a/wrlib/wraster.h b/wrlib/wraster.h
index 25e39e79..c4ed2310 100644
--- a/wrlib/wraster.h
+++ b/wrlib/wraster.h
@@ -431,7 +431,11 @@ RImage *RRenderMultiGradient(unsigned width, unsigned 
height, RColor **colors,
 RImage *RRenderInterwovenGradient(unsigned width, unsigned height,
                                   RColor colors1[2], int thickness1,
                                   RColor colors2[2], int thickness2);
+/*
+ * Cleaning
+ */
 
+void RShutdown();
 
 /*
  * Convertion into X Pixmaps

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                  |    1 +
 WINGs/Makefile.am           |   13 +++++-
 configure.ac                |   35 +++++++++++++++++
 debian/libwings-dev.install |    1 +
 m4/wm_imgfmt_check.m4       |   20 +++++++++
 src/dialog.c                |    8 +++-
 src/main.c                  |    1 +
 wrlib/Makefile.am           |    4 ++
 wrlib/imgformat.h           |    9 +++-
 wrlib/libwraster.map        |    1 +
 wrlib/load.c                |   15 +++++++
 wrlib/load_magick.c         |   90 +++++++++++++++++++++++++++++++++++++++++++
 wrlib/wraster.h             |    4 ++
 13 files changed, 196 insertions(+), 6 deletions(-)
 create mode 100644 wrlib/load_magick.c


repo.or.cz automatic notification. Contact project admin crma...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to