Hello community,

here is the log from the commit of package xcm for openSUSE:Factory checked in 
at 2012-04-12 09:56:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xcm (Old)
 and      /work/SRC/openSUSE:Factory/.xcm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xcm", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:Factory/xcm/xcm.changes  2012-01-20 20:28:48.000000000 
+0100
+++ /work/SRC/openSUSE:Factory/.xcm.new/xcm.changes     2012-04-12 
09:56:46.000000000 +0200
@@ -1,0 +2,19 @@
+Mon Apr 03 12:00:00 UTC 2012 - Kai-Uwe Behrmann <[email protected]> - 0.5.0
+
+- new switch to X Color Management spec
+- new window informations can be be printed with xcm -p.
+- new window regions can be delected with xcm -d
+- new xcm -r accepts a --profile argument
+- requires libXcm-0.5.0
+
+-------------------------------------------------------------------
+Mon Apr 02 12:00:01 UTC 2012 - Kai-Uwe Behrmann <[email protected]> - 0.5.0
+
+- fix Url
+
+-------------------------------------------------------------------
+Fri Mar 09 12:00:01 UTC 2012 - Kai-Uwe Behrmann <[email protected]> - 0.5.0
+
+- release 0.5.0
+
+-------------------------------------------------------------------

Old:
----
  xcm-0.4.2.tar.bz2

New:
----
  xcm-0.5.0.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xcm.spec ++++++
--- /var/tmp/diff_new_pack.1Uos6v/_old  2012-04-12 09:56:46.000000000 +0200
+++ /var/tmp/diff_new_pack.1Uos6v/_new  2012-04-12 09:56:46.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package xcm
 #
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -14,9 +14,11 @@
 
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
-Version:        0.4.2
+
+
+Version:        0.5.0
 Release:        0
-Source:         
http://downloads.sourceforge.net/projects/oyranos/xcm/xcm-0.4.x/xcm-0.4.2.tar.bz2
+Source:         
http://sourceforge.net/projects/oyranos/files/Xcm/xcm-0.5.0.tar.bz2
 Summary:        X Color Management tools
 
 Name:           xcm
@@ -77,7 +79,6 @@
 BuildRequires:  xorg-x11-devel
 BuildRequires:  xorg-x11-proto-devel
 BuildRequires:  xorg-x11-xtrans-devel
-
 %endif
 %if 0%{?debian_version} > 0
 BuildRequires:  gcc-c++
@@ -113,6 +114,8 @@
 %{_bindir}/%{name}events
 %{_bindir}/%{name}edid
 %{_bindir}/%{name}ddc
+%{_bindir}/%{name}
+%{_mandir}/man1/%{name}.1*
 %{_mandir}/man1/%{name}ddc.1*
 %{_mandir}/man1/%{name}edid.1*
 %{_mandir}/man1/%{name}events.1*

++++++ xcm-0.4.2.tar.bz2 -> xcm-0.5.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/ChangeLog new/xcm-0.5.0/ChangeLog
--- old/xcm-0.4.2/ChangeLog     2011-05-06 17:18:21.000000000 +0200
+++ new/xcm-0.5.0/ChangeLog     2012-03-08 20:17:33.000000000 +0100
@@ -1,3 +1,48 @@
+Version xcm-0.5.0
+
+Kai-Uwe Behrmann (31):
+       * [core]: add warning
+       * [build]: add ltdl to spec file
+       * [core]: fix compile warnings
+       * [build]: sync spec file with openSUSE
+       * [conf]: resolve XCM_ macro conflict
+       * [build]: skip X11 and LINUX build and install on osX
+       * [conf]: generalise OS detection for Win32
+       * [docu]: describe new xcm -d option
+       * [conf]: support MINGW32
+       * [core]: support colour region removal in xcm
+       * [core]: fix build without Oyranos II
+       * [core]: fix build without Oyranos
+       * [core]: add --ppmcie option to xcmedid
+       * [conf]: bump to 0.5 like libXcm
+       * [conf]: bump libXcm requirement to 0.5
+       * [build]: add xcm_macros.h to package
+       * [core]: rename net-color spec atoms
+       * [core]: fix xcmedid argument order
+       * [core]: move cli parsing macros to header file
+       * [core]: fix xcm region deletion
+       * [docu]: fix xcm man page
+       * [biuld]: install xcm
+       * [build]: add xcm to RPM and makefile
+       * [docu]: add man page for xcm tool
+       * [core]: add --geometry option to renamed xcm tool
+       * [core]: add region option to xcmwindow
+       * [core]: use Oyranos in xcmwindow for more infos
+       * [core]: begin xcmwindow tool
+       * [build]: fix spec file
+       * [build]: more streamlining of spec file
+       * [conf]: bump version
+
+Version xcm-0.4.2
+
+Kai-Uwe Behrmann (6):
+       * [docu]: man page minor fixes
+       * [build]: switch to bz2 compression for RPM
+       * [docu]: add xcmevents man page
+       * [core]: add JSON from EDID output
+       * [core]: we support DDC only on Linux
+       * [conf]: bump version
+
 Version xcm-0.4.1
 
 Kai-Uwe Behrmann (10):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/configure new/xcm-0.5.0/configure
--- old/xcm-0.4.2/configure     2011-07-09 15:16:23.000000000 +0200
+++ new/xcm-0.5.0/configure     2012-02-22 09:21:10.000000000 +0100
@@ -2,7 +2,7 @@
 
 TARGET_BASE=Xcm
 TARGET_MINI=xcm
-MACRO_NAME=XCM
+MACRO_NAME=XCM_TOOLS
 TARGET=$TARGET_MINI
 TARGET_NAME=$TARGET_BASE
 
@@ -33,14 +33,14 @@
 test -f error.tmp && rm error.tmp
 
 VERSION_A=0
-VERSION_B=4
-VERSION_C=2
+VERSION_B=5
+VERSION_C=0
 VERSION_ABI_A=1
 VERSION_ABI_B=0
 RELEASE=0
 START_MONTH=09
 START_YEAR=2010
-DEVEL_MONTH=01 # numeric
+DEVEL_MONTH=09 # numeric
 DEVEL_YEAR=2011
 GIT_MASTER="`cat $ROOT_DIR/.git/refs/heads/master`"
 time="`date +%y%m%d.%H%M%S`"
@@ -411,8 +411,17 @@
         test -n "$ECHO" && $ECHO $e "$echo_" >> $CONF_LOG; test -n "$INFOECHO" 
&& $INFOECHO "$echo_"
         OSUNAME=BSD
       else
-        echo_="Oyranos may or may not compile on your $UNAME_ system"
-        test -n "$ECHO" && $ECHO $e "$echo_" >> $CONF_LOG; test -n "$INFOECHO" 
&& $INFOECHO "$echo_"
+        if [ `uname -a | grep W32 | wc -l` -gt 0 ]; then
+          test -n "$ECHO" && $ECHO "WIN32 = 1" >> $CONF
+          EXEC_END=.exe
+          test -n "$ECHO" && $ECHO "#define WIN32 1" >> $CONF_H
+          echo_="Windows $UNAME_             detected"
+          test -n "$ECHO" && $ECHO $e "$echo_" >> $CONF_LOG; test -n 
"$INFOECHO" && $INFOECHO "$echo_"
+          OSUNAME=WIN32
+        else
+          echo_="Oyranos may or may not compile on your $UNAME_ system"
+          test -n "$ECHO" && $ECHO $e "$echo_" >> $CONF_LOG; test -n 
"$INFOECHO" && $INFOECHO "$echo_"
+        fi
       fi
     fi
   fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/configure_tests.sh 
new/xcm-0.5.0/configure_tests.sh
--- old/xcm-0.4.2/configure_tests.sh    2011-01-10 08:18:00.000000000 +0100
+++ new/xcm-0.5.0/configure_tests.sh    2011-09-23 08:05:35.000000000 +0200
@@ -341,6 +341,63 @@
   fi
 fi
 
+if [ -n "$YAJL" ] && [ $YAJL -gt 0 ]; then
+  name="yajl"
+  minversion=1
+  version=`pkg-config --modversion $name 2>/dev/null`
+  url="http://lloyd.github.com/yajl/";
+  HAVE_LIB=0
+  ID=YAJL
+  ID_H="$ID"_H
+  ID_LIBS="$ID"_LIBS
+  pkg-config  --atleast-version=$minversion $name
+  if [ $? = 0 ]; then
+    HAVE_LIB=1
+    echo "#define HAVE_$ID 1" >> $CONF_H
+    echo "$ID = 1" >> $CONF
+    echo "$ID_H = `pkg-config --cflags $name | sed \"$STRIPOPT\"`" >> $CONF
+    echo "$ID_LIBS = `pkg-config --libs $name | sed \"$STRIPOPT\"`" >> $CONF
+  else
+    l=$name
+    rm -f tests/libtest$EXEC_END
+    $CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS 
-L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 
2>/dev/null
+    if [ -f tests/libtest ]; then
+      HAVE_LIB=1
+      echo "#define HAVE_$ID 1" >> $CONF_H
+      echo "$ID = 1" >> $CONF
+      echo "$ID_H =" >> $CONF
+      echo "$ID_LIBS = -l$l" >> $CONF
+      rm tests/libtest$EXEC_END
+    fi
+  fi
+
+  # search for yajl_version.h header file
+    $CC $CFLAGS -I$includedir $ROOT_DIR/tests/yajl.c $LDFLAGS 
-L/usr/X11R6/lib$BARCH -l$l -o tests/yajl_test 2>/dev/null
+    if [ ! -f tests/yajl_test ]; then
+      $CC $CFLAGS -I$includedir $ROOT_DIR/tests/yajl.c $LDFLAGS 
-L/usr/X11R6/lib$BARCH -l$l -o tests/yajl_test >> $CONF_LOG
+      echo "YAJL_VERSION = -DYAJL_VERSION=10000" >> $CONF
+    fi
+
+  if [ $HAVE_LIB -ne 0 ]; then
+    if [ "$version" != "" ]; then
+      echo_="$name     $version                detected"; echo "$echo_" >> 
$CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
+    else
+      echo_="`tests/yajl_test$EXEC_END`          detected"; echo "$echo_" >> 
$CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
+    fi
+  else
+    if [ $YAJL -eq 1 ]; then
+      echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> 
$CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
+      ERROR=1
+    else
+      echo_="    Warning: no or too old $name found,"; echo "$echo_" >> 
$CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
+      WARNING=1
+    fi
+    echo_="  need at least version $minversion, download: $url"; echo "$echo_" 
>> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
+
+    rm tests/yajl_test$EXEC_END
+  fi
+fi
+
 if [ -n "$LCMS" ] && [ $LCMS -gt 0 ]; then
   name="lcms"
   libname=$name
@@ -544,8 +601,10 @@
     pc_package=xcm
     name="xcm"
     libname=$name
-    minversion=0.7
+    minversion=0.5
     ID=XCM
+    TESTER=$XCM
+    url="http://sf.net/projects/oyranos/files/libXcm";
 
     ID_H="$ID"_H
     ID_LIBS="$ID"_LIBS
@@ -571,8 +630,14 @@
         done
       fi
     elif [ $OSUNAME = "Linux" ]; then
-      echo_="X CM not found in"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" 
&& $ECHO "$echo_"
-      echo_="  $pc_package.pc"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && 
$ECHO "$echo_"
+      if [ $TESTER -eq 1 ]; then
+        echo_="!!! ERROR: no or too old $name found, !!!"; echo "$echo_" >> 
$CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
+        ERROR=1
+      else
+        echo_="    Warning: no or too old $name found,"; echo "$echo_" >> 
$CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
+        WARNING=1
+      fi
+      echo_="  need at least version $minversion, download: $url"; echo 
"$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
     fi
 fi
 
@@ -837,7 +902,7 @@
   if [ -n "$MAKEFILE_DIR" ]; then
     for i in $MAKEFILE_DIR; do
       test -f "$ROOT_DIR/$i/makefile".in && echo "X11_INCL=\$(XF86VMODE_INC) 
\$(XINERAMA_INC) \$(XRANDR_INC)" >> "$i/makefile"
-      test -f "$ROOT_DIR/$i/makefile".in && echo "X11_LIBS=\$(X11_LIB_PATH) 
-lX11 $X_ADD_LIBS \$(XCM_LIBS)" >> "$i/makefile"
+      test -f "$ROOT_DIR/$i/makefile".in && echo "X11_LIBS=\$(X11_LIB_PATH)  
\$(XCM_LIBS) $X_ADD_LIBS" >> "$i/makefile"
     done
   fi
 fi
@@ -912,6 +977,31 @@
   fi
 fi
 
+if [ -n "$FONTCONFIG" ] && [ $FONTCONFIG -gt 0 ]; then
+  l=fontconfig 
+  pkg-config $l
+  if [ $? = 0 ]; then
+    echo_="FONTCONFIG  `pkg-config --modversion $l`    detected"; echo 
"$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
+    echo "#define HAVE_FONTCONFIG 1" >> $CONF_H
+    echo "FONTCONFIG = 1" >> $CONF
+    echo "FONTCONFIG_H = `pkg-config --cflags $l | sed \"$STRIPOPT\"`" >> $CONF
+    echo "FONTCONFIG_LIBS = `pkg-config --libs $l | sed \"$STRIPOPT\"`" >> 
$CONF
+  else
+    rm -f tests/libtest$EXEC_END
+    $CXX $CFLAGS -I$includedir $ROOT_DIR/tests/lib_test.cxx $LDFLAGS 
-L/usr/X11R6/lib$BARCH -L/usr/lib$BARCH -L$libdir -l$l -o tests/libtest 
2>/dev/null
+    if [ -f tests/libtest ]; then
+      echo_="FONTCONFIG              detected"; echo "$echo_" >> $CONF_LOG; 
test -n "$ECHO" && $ECHO "$echo_"
+      echo "#define HAVE_FONTCONFIG 1" >> $CONF_H
+      echo "FONTCONFIG = 1" >> $CONF
+      echo "FONTCONFIG_H =" >> $CONF
+      echo "FONTCONFIG_LIBS = -l$l" >> $CONF
+      rm tests/libtest$EXEC_END
+    else
+      echo_="  no or too old FONTCONFIG found, need FONTCONFIG to render text 
in OpenGL"; echo "$echo_" >> $CONF_LOG; test -n "$ECHO" && $ECHO "$echo_"
+    fi
+  fi
+fi
+
 if [ -n "$FLTK" ] && [ $FLTK -gt 0 ]; then
   if [ -z "$fltkconfig" ]; then
     # add /usr/X11R6/bin to path for Fedora
@@ -1118,7 +1208,7 @@
     for i in $MAKEFILE_DIR; do
       if [ "$debug" -eq "1" ]; then
         if [ $OSUNAME = "Darwin" ] || [ $OSUNAME = "Windows" ]; then
-          DEBUG_="-Wall -g -DDEBUG"
+          DEBUG_="-Wall -g -DDEBUG -gdwarf-2"
         else
           DEBUG_="-Wall -g -DDEBUG --pedantic"
         fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/makefile.in new/xcm-0.5.0/makefile.in
--- old/xcm-0.4.2/makefile.in   2011-07-09 15:16:04.000000000 +0200
+++ new/xcm-0.5.0/makefile.in   2012-02-22 09:26:54.000000000 +0100
@@ -2,6 +2,11 @@
   TARGET_DDC = $(TARGET)ddc
 #endif
 
+#ifdef X11
+  TARGET_XCM = $(TARGET)
+  TARGET_XCMEV = $(TARGET)events
+#endif
+
 COLLECT = ar cru
 RANLIB = ranlib
 LNK = ln -s
@@ -29,8 +34,10 @@
 LDLIBS = $(LDFLAGS) -L$(libdir) -L. \
         $(OYRANOS_LIBS) $(c)
 
-CHEADERS = 
+TOP_CHEADERS = \
+       $(TARGET)_macros.h
 CFILES = \
+       $(XCM_CFILES) \
        $(XCMDDC_CFILES) \
        $(XCMEDID_CFILES) \
        $(XCMEVENTS_CFILES)
@@ -41,6 +48,8 @@
        src/$(TARGET_MINI)edid/$(TARGET_MINI)edid.c
 XCMDDC_CFILES = \
        src/$(TARGET_MINI)ddc/$(TARGET_MINI)ddc.c
+XCM_CFILES = \
+       src/$(TARGET_MINI)/$(TARGET_MINI).c
 
 UDEV_RULES = \
        scripts/90-xcm-i2c.rules
@@ -63,7 +72,7 @@
         COPYING \
         README
 MAN3_HAND =
-MAN1 =  xcmddc.1 xcmedid.1 xcmevents.1
+MAN1 =  xcm.1 xcmddc.1 xcmedid.1 xcmevents.1
 MAN3 =  $(MAN3_HAND) $(MAN3_GENERATED)
 
 TOP_SOURCES =
@@ -81,12 +90,14 @@
 XCMEVENTS_OBJECTS = $(XCMEVENTS_CFILES:.c=.o)
 XCMEDID_OBJECTS = $(XCMEDID_CFILES:.c=.o)
 XCMDDC_OBJECTS = $(XCMDDC_CFILES:.c=.o)
+XCM_OBJECTS = $(XCM_CFILES:.c=.o)
 
 CLEAN_OBJECTS = \
        $(OBJECTS) \
        $(XCMEVENTS_OBJECTS) \
        $(XCMEDID_OBJECTS) \
-       $(XCMDDC_OBJECTS)
+       $(XCMDDC_OBJECTS) \
+       $(XCM_OBJECTS)
 
 SUB_OBJECTS = \
        $(CFILES:.c=.o)
@@ -110,7 +121,7 @@
 
 # build all what is needed to run the libraries, helpers
 all:   config.log.h mkdepend \
-       $(TARGET_MINI)events $(TARGET_MINI)edid $(TARGET_DDC)
+       $(TARGET_XCM) $(TARGET_XCMEV) $(TARGET_MINI)edid $(TARGET_DDC)
        echo ... $@ done
 
 # get time stamp
@@ -160,15 +171,22 @@
        -o $@ $(XCMDDC_OBJECTS) $(m) \
        -L$(libdir) $(LDLIBS) $(m) $(X11_LIBS)
 
+$(TARGET_MINI):         $(XCM_OBJECTS)
+       echo Linking $@ ...
+       $(CC) -I./ $(CFLAGS_) \
+       -o $@ $(XCM_OBJECTS) $(m) \
+       -L$(libdir) $(LDLIBS) $(m) $(X11_LIBS)
+
 check: all
        echo current git version is:
        n=0; for i in `cd $(SRCDIR); git rev-list master`; do if [ $${n} -eq 0 
]; then echo git id:$${i}; fi; n=1; done
        oyranos-monitor -f edid -o edid.bin
-       ./$(TARGET_MINI)edid edid.bin
+       ./$(TARGET_MINI)edid --openicc edid.bin
        if [ `oyranos-monitor -l | wc -l` -gt 1 ]; then \
-         oyranos-monitor -x 2000 -f edid -o edid2.bin; \
-         ./$(TARGET_MINI)edid edid2.bin; \
+         oyranos-monitor -d 1 -f edid -o edid2.bin; \
+         ./$(TARGET_MINI)edid --openicc edid2.bin; \
        fi
+       ./$(TARGET_MINI) -l --window-name
 
 
 
@@ -178,9 +196,14 @@
 install_bin:   all
        echo Installing binaries ...
        mkdir -p $(DESTDIR)$(bindir)
+#ifdef X11
        $(INSTALL) -m 755 $(TARGET_MINI)events $(DESTDIR)$(bindir)
+       $(INSTALL) -m 755 $(TARGET_MINI) $(DESTDIR)$(bindir)
+#endif
        $(INSTALL) -m 755 $(TARGET_MINI)edid $(DESTDIR)$(bindir)
-       -$(INSTALL) -m 755 $(TARGET_MINI)ddc $(DESTDIR)$(bindir)
+#ifdef LINUX
+       $(INSTALL) -m 755 $(TARGET_MINI)ddc $(DESTDIR)$(bindir)
+#endif
        -mkdir -p $(DESTDIR)/lib/udev/rules.d/
        -$(INSTALL) -m 644 $(UDEV_RULES) $(DESTDIR)/lib/udev/rules.d/
        echo ... binary Installation finished
@@ -250,9 +273,14 @@
 uninstall-bin:
 uninstall_bin:
        echo Uninstalling binaries ...
+#ifdef X11
        $(RM) $(DESTDIR)$(bindir)/$(TARGET_MINI)events
+       $(RM) $(DESTDIR)$(bindir)/$(TARGET_MINI)
+#endif
        $(RM) $(DESTDIR)$(bindir)/$(TARGET_MINI)edid
-       -$(RM) $(DESTDIR)$(bindir)/$(TARGET_MINI)ddc
+#ifdef LINUX
+       $(RM) $(DESTDIR)$(bindir)/$(TARGET_MINI)ddc
+#endif
        echo ... done uninstalling binaries
        
 uninstall-docs:        uninstall_docu
@@ -281,6 +309,8 @@
        -$(RM) $(CLEAN_OBJECTS)
        $(RM) $(TARGET_MINI)events
        $(RM) $(TARGET_MINI)edid
+       $(RM) $(TARGET_MINI)ddc
+       $(RM) $(TARGET_MINI)
        -for lib in $(LIBRARIES); do \
           $(RM) $(LIB)$${lib}$(SO).$(VERSION)$(LIBEXT) \
                 $(LIB)$${lib}$(SO).$(VERSION_A)$(LIBEXT) \
@@ -386,6 +416,9 @@
        cd $(SRCDIR) && \
          $(COPY) -R $(ALL_FILES) $(DESTDIR)
        $(COPY) $(CONFIG_FILES) $(DESTDIR)
+       mkdir -p $(DESTDIR)/src/$(TARGET_MINI)
+       cd $(SRCDIR) && \
+         $(COPY) $(XCM_CFILES) $(DESTDIR)/src/$(TARGET_MINI)
        mkdir -p $(DESTDIR)/src/$(TARGET_MINI)events
        cd $(SRCDIR) && \
          $(COPY) $(XCMEVENTS_CFILES) $(DESTDIR)/src/$(TARGET_MINI)events
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/src/xcm/xcm.c new/xcm-0.5.0/src/xcm/xcm.c
--- old/xcm-0.4.2/src/xcm/xcm.c 1970-01-01 01:00:00.000000000 +0100
+++ new/xcm-0.5.0/src/xcm/xcm.c 2012-02-23 11:01:14.000000000 +0100
@@ -0,0 +1,461 @@
+/** xcm.c
+ *
+ *  A X Color Management specification compatible information tool for server 
+ *  based per window color management.
+ *
+ *  @par License: 
+ *             MIT <http://www.opensource.org/licenses/mit-license.php>
+ *  @par Copyright:
+ *             (c) 2011 - Kai-Uwe Behrmann <[email protected]>
+ *
+ *  gcc -Wall -g -I../.. xcm.c -o xcm `pkg-config --cflags --libs x11 xcm 
oyranos`
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h> /* sleep() */
+
+#include <X11/Xcm/Xcm.h>
+#include <X11/Xcm/XcmEvents.h>
+#include <X11/extensions/Xfixes.h> /* XserverRegion */
+#include <X11/Xcm/Xcm.h> /* XcolorRegion */
+
+#include "xcm_version.h"
+#include "xcm_macros.h"
+#define OY_DBG_FORMAT_ "%s:%d %s() "
+#define OY_DBG_ARGS_ 
__FILE__,__LINE__,strrchr(__func__,'/')?strrchr(__func__,'/')+1:__func__
+
+int XcolorRegionFind(XcolorRegion * old_regions, unsigned long old_regions_n, 
Display * dpy, Window win, XRectangle * rectangle);
+
+void printfHelp(int argc, char ** argv)
+{
+  fprintf( stderr, "\n");
+  fprintf( stderr, "%s %s\n",   argv[0],
+                                _("is a X11 color management client tool"));
+  fprintf( stderr, "  Xcm v%s config: %s devel period: %s\n",
+                  XCM_TOOLS_VERSION_NAME,
+                  XCM_TOOLS_CONFIG_DATE, XCM_TOOLS_DATE );
+  fprintf( stderr, "\n");
+  fprintf( stderr, "%s\n",                 _("Usage"));
+  fprintf( stderr, "  %s\n",               _("List available windows:"));
+  fprintf( stderr, "      %s -l [--window-name]\n",        argv[0]);
+  fprintf( stderr, "        --window-name   %s\n", _("show window name"));
+  fprintf( stderr, "\n");
+  fprintf( stderr, "  %s\n",               _("Print infos about a window:"));
+  fprintf( stderr, "      %s -p --id=window_id\n", argv[0]);
+  fprintf( stderr, "\n");
+  fprintf( stderr, "  %s\n",               _("Set window region:"));
+  fprintf( stderr, "      %s -r\n",argv[0]);
+  fprintf( stderr, "        [-x pos_x -y pos_y --width width --height 
height|\n"
+                   "         --geometry width_x_height_+_x_+_y]\n");
+  fprintf( stderr, "        --id=window_id [--profile filename.icc]\n");
+  fprintf( stderr, "\n");
+  fprintf( stderr, "  %s\n",               _("Delete window region:"));
+  fprintf( stderr, "      %s -d\n",argv[0]);
+  fprintf( stderr, "        [-x pos_x -y pos_y --width width --height 
height|\n"
+                   "         --geometry width_x_height_+_x_+_y]\n");
+  fprintf( stderr, "        --id=window_id\n");
+  fprintf( stderr, "\n");
+  fprintf( stderr, "  %s\n",               _("Print a help text:"));
+  fprintf( stderr, "      %s -h\n",        argv[0]);
+  fprintf( stderr, "\n");
+  fprintf( stderr, "  %s\n",               _("General options:"));
+  fprintf( stderr, "        --display=:0.0  %s\n", _("X11 display name"));
+  fprintf( stderr, "        -v              %s\n", _("verbose"));
+  fprintf( stderr, "\n");
+  fprintf( stderr, "\n");
+}
+
+
+int main(int argc, char ** argv)
+{
+  int id = 0;
+  int print = 0;
+  int print_window_name = 0;
+  int list_windows = 0;
+  int count = 0;
+  const char * display = NULL;
+  const char * geometry = NULL;
+
+  Display * dpy = NULL;
+  int screen = 0;
+  Window win = 0,
+         root;
+
+  int place_region = 0;
+  int delete_region = 0;
+  int x = 0, y = 0, width = 0, height = 0;
+  const char * profile_name = NULL;
+  int verbose = 0;
+  int result = 0;
+
+  XserverRegion reg = 0;
+  XcolorRegion region;
+  int error;
+  XRectangle rec[2] = { { 0,0,0,0 }, { 0,0,0,0 } };
+
+#ifdef HAVE_OY
+  char * blob = 0;
+  size_t size = 0;
+  oyProfile_s * p = 0;
+  XcolorProfile * profile = 0;
+#endif
+
+#ifdef USE_GETTEXT
+  setlocale(LC_ALL,"");
+#endif
+
+  if(argc >= 2)
+  {
+    int pos = 1, i;
+    char *wrong_arg = 0;
+    while(pos < argc)
+    {
+      switch(argv[pos][0])
+      {
+        case '-':
+            for(i = 1; pos < argc && i < strlen(argv[pos]); ++i)
+            switch (argv[pos][i])
+            {
+              case 'd': delete_region = 1; break;
+              case 'l': list_windows = 1; break;
+              case 'p': print = 1; break;
+              case 'r': place_region = 1; break;
+              case 'v': verbose += 1; break;
+              case 'x': OY_PARSE_INT_ARG( x ); break;
+              case 'y': OY_PARSE_INT_ARG( y ); break;
+              case 'h':
+              case '-':
+                        if(i == 1)
+                        {
+                             if(OY_IS_ARG("id"))
+                        { OY_PARSE_INT_ARG2( id, "id" ); break; }
+                        else if(OY_IS_ARG("width"))
+                        { OY_PARSE_INT_ARG2( width, "width" ); break; }
+                        else if(OY_IS_ARG("height"))
+                        { OY_PARSE_INT_ARG2( height, "height" ); break; }
+                        else if(OY_IS_ARG("profile"))
+                        { OY_PARSE_STRING_ARG2( profile_name, "profile" ); 
break; }
+                        else if(OY_IS_ARG("display"))
+                        { OY_PARSE_STRING_ARG2( display, "display" ); break; }
+                        else if(OY_IS_ARG("geometry"))
+                        { OY_PARSE_STRING_ARG2( geometry, "geometry" ); break; 
}
+                        else if(OY_IS_ARG("window-name"))
+                        { print_window_name = 1; i=100; break; }
+                        }
+              default:
+                        printfHelp(argc, argv);
+                        exit (0);
+                        break;
+            }
+            break;
+        default:
+                        printfHelp(argc, argv);
+                        exit (0);
+                        break;
+      }
+      if( wrong_arg )
+      {
+       fprintf(stderr, "%s %s\n", _("wrong argument to option:"), wrong_arg);
+       printfHelp(argc, argv);
+       exit(1);
+      }
+      ++pos;
+    }
+  } else
+  {
+                        printfHelp(argc, argv);
+                        exit (0);
+  }
+
+#ifdef HAVE_OY
+  XcmICCprofileFromMD5FuncSet( fromMD5 );
+  XcmICCprofileGetNameFuncSet( getName );
+#endif
+
+  dpy = XOpenDisplay( display );
+  if(!dpy)
+  {
+    fprintf( stderr, "%s %s\n", "unable to open display", display?display:"");
+    exit(1);
+  }
+
+  if(geometry)
+  {
+    int matches = sscanf( geometry, "%ix%i+%i+%i",
+                          &width, &height, &x, &y );
+    if(matches !=  4 && strcmp(geometry,"0x0+0+0") != 0)
+    {
+      fprintf( stderr, "%s: --geometry WIDTHxHEIGHT+XPOS+YPOS (%s)\n",
+               _("argument not recognised"), geometry);
+      exit(1);
+    }
+
+    rec[0].x = x;
+    rec[0].y = y;
+    rec[0].width = width;
+    rec[0].height = height;
+  }
+
+  win = (Window) id;
+  screen = DefaultScreen( dpy );
+  root = XRootWindow( dpy, screen );
+
+  if(list_windows)
+  {
+    Status status = 0;
+    if(!verbose)
+    {
+      {
+        Window root_return = 0,
+               parent_return = 0, 
+             * children_return = 0,
+             * wins = 0;
+        unsigned int nchildren_return = 0, wins_n = 0;
+        int i;
+        XWindowAttributes window_attributes_return;
+
+        XSync( dpy, 0 );
+        status = XQueryTree( dpy, root,
+                         &root_return, &parent_return,
+                         &children_return, &nchildren_return );
+        if(status == 0) fprintf( stderr, "%d: XQueryTree failed\n", __LINE__ );
+          
+        wins = (Window*)malloc(sizeof(Window) * nchildren_return );
+        memcpy( wins, children_return, sizeof(Window) * nchildren_return );
+        XFree( children_return );
+        children_return = wins; wins = 0;
+
+        for(i = nchildren_return - 1; i >= 0; --i)
+        {
+          root_return = 0;
+          status = XQueryTree( dpy, children_return[i],
+                           &root_return, &parent_return,
+                           &wins, &wins_n );
+          if(status == 0)fprintf( stderr, "%d: XQueryTree failed\n", __LINE__ 
);
+          status = XGetWindowAttributes( dpy, children_return[i],
+                                     &window_attributes_return );
+          if(status == 0)fprintf( stderr, "%d: XQueryTree failed\n", __LINE__ 
);
+          if(window_attributes_return.map_state == IsViewable &&
+             parent_return == root)
+          {
+            if(verbose)
+              fprintf( stdout, "%s",
+                       XcmePrintWindowRegions( dpy, children_return[i], 0 ));
+            fprintf( stdout, "%d", (int)children_return[i] );
+            if(print_window_name)
+              fprintf( stdout, "  %s",
+                       XcmePrintWindowName(dpy, children_return[i]) );
+            fprintf( stdout, "\n" );
+            ++count;
+          }
+
+          XFree( wins );
+        }
+
+        free( children_return );
+      }
+    } else
+    {
+      XcmeContext_s * c = XcmeContext_Create( display );
+      XcmeContext_Release( &c );
+    }
+
+  } else if(print)
+  {
+    if(!win)
+    {
+      fprintf( stderr, "%s\n", _("The integer window ID is missed. Use option: 
--id 12345"));
+      exit(1);
+    }
+    fprintf( stdout, "%s\n", XcmePrintWindowRegions( dpy, win, 1 ) );
+  } else if(place_region)
+  {
+    int need_wait = 1;
+#ifdef HAVE_OY
+    /* Upload a ICC profile to X11 root window */
+    if(profile_name)
+    {
+      p = oyProfile_FromFile( profile_name, 0,0 );
+      if(p)
+      {
+        blob = oyProfile_GetMem( p, &size, 0,0 );
+
+        if(blob && size)
+        {
+        /* Create a XcolorProfile object that will be uploaded to the 
display.*/
+          profile = malloc(sizeof(XcolorProfile) + size);
+
+          oyProfile_GetMD5(p, OY_FROM_PROFILE, (uint32_t*)profile->md5);
+
+          profile->length = htonl(size);
+          memcpy(profile + 1, blob, size);
+
+          result = XcolorProfileUpload( dpy, profile );
+          if(result)
+            printf("XcolorProfileUpload: %d\n", result);
+        }
+        oyProfile_Release( &p );
+      }
+    }
+#endif
+
+    reg = XFixesCreateRegion( dpy, rec, 1);
+
+    region.region = htonl(reg);
+#ifdef HAVE_OY
+    if(blob && size)
+      memcpy(region.md5, profile->md5, 16);
+    else
+#endif
+      memset( region.md5, 0, 16 );
+
+    if(rec[0].x || rec[0].y || rec[0].width || rec[0].height)
+    {
+
+      /* upload the new or changed region to the X server */
+      error = XcolorRegionInsert( dpy, win, 0, &region, 1 );
+      if(error)
+          printf( OY_DBG_FORMAT_
+                   "XcolorRegionInsert failed %d\n",
+                   OY_DBG_ARGS_, error );
+
+    } else
+    {
+      unsigned long nRegions = 0;
+      XcolorRegion * r = XcolorRegionFetch( dpy, win, &nRegions );
+      need_wait = 0;
+      if(nRegions && r)
+      {
+        error = XcolorRegionDelete( dpy, win, 0, nRegions );
+        fprintf(stderr, "deleted %lu region%c\n", nRegions, nRegions==1?' 
':'s');
+        XFree( r ); r = 0;
+      } else
+      {
+        fprintf(stderr, "no region to delete \n");
+      }
+    }
+
+    XFlush( dpy );
+
+    /** Closing the display object will destroy all XFixes regions 
automatically
+     *  by Xorg. Therefore we loop here to keep the XFixes regions alive. */
+    if(need_wait)
+      while(1) sleep(2);
+
+  } if(delete_region)
+  {
+    XcolorRegion *old_regions = 0;
+    unsigned long old_regions_n = 0;
+    int pos = -1;
+
+    /* get old regions */
+    old_regions = XcolorRegionFetch( dpy, win, &old_regions_n );
+    /* remove specified region */
+    pos = XcolorRegionFind( old_regions, old_regions_n, dpy, win, rec );
+    XFree( old_regions );
+    if(pos >= 0)
+    {
+      int undeleted_n = old_regions_n;
+      XcolorRegionDelete( dpy, win, pos, 1 );
+      old_regions = XcolorRegionFetch( dpy, win, &old_regions_n );
+      if(undeleted_n - old_regions_n != 1)
+        printf(  OY_DBG_FORMAT_"removed %d; have still %d\n", OY_DBG_ARGS_,
+                 pos, (int)old_regions_n );
+      else
+        fprintf( stderr, "removed position %d\n", pos );
+    } else
+      printf( "region not found: %s in %lu\n", geometry, old_regions_n );
+
+    XFlush( dpy );
+
+  }
+
+  XCloseDisplay( dpy );
+
+  return result;
+}
+
+int XcolorRegionFind(XcolorRegion * old_regions, unsigned long old_regions_n, 
Display * dpy, Window win, XRectangle * rectangle)
+{
+  XRectangle * rect = 0;
+  int nRect = 0;
+  int pos = -1;
+  int i, j;
+
+  /* get old regions */
+  old_regions = XcolorRegionFetch( dpy, win, &old_regions_n );
+  /* search region */
+  for(i = 0; i < old_regions_n; ++i)
+  {
+
+    if(!old_regions[i].region || pos >= 0)
+      break;
+
+    rect = XFixesFetchRegion( dpy, ntohl(old_regions[i].region),
+                              &nRect );
+
+    for(j = 0; j < nRect; ++j)
+    {
+#ifdef HAVE_OY
+      if(oy_debug)
+        printf( OY_DBG_FORMAT_
+                 "reg[%d]: %dx%d+%d+%d %dx%d+%d+%d\n",
+                   OY_DBG_ARGS_, i,
+                   rectangle->width, rectangle->height,
+                   rectangle->x, rectangle->y,
+                   rect[j].width, rect[j].height, rect[j].x, rect[j].y
+                  );
+#endif
+      if(rectangle->x == rect[j].x &&
+         rectangle->y == rect[j].y &&
+         rectangle->width == rect[j].width &&
+         rectangle->height == rect[j].height )
+      {
+        pos = i;
+        break;
+      }
+    }
+  }
+
+  return pos;
+}
+
+
+
+#ifdef HAVE_OY
+void * fromMD5                       ( const void        * md5_hash,
+                                       size_t            * size,
+                                       void              
*(allocate_func)(size_t) )
+{
+  void * data = 0;
+  oyProfile_s * p = oyProfile_FromMD5( (uint32_t*)md5_hash, 0 );
+  data = oyProfile_GetMem( p, size, 0, allocate_func );
+  oyProfile_Release( &p );
+  return data;
+}
+
+char * getName                       ( const void        * data,
+                                       size_t              size,
+                                       void              
*(allocate_func)(size_t),
+                                       int                 file_name )
+{
+  char * text = 0;
+  const char * t = 0;
+  oyProfile_s * p = oyProfile_FromMem( size, (void*)data, 0, 0 );
+  if(file_name)
+    t = oyProfile_GetFileName( p, -1 );
+  else
+    t = oyProfile_GetText( p, oyNAME_DESCRIPTION );
+
+  if(t && t[0])
+  {
+    text = (char*)allocate_func( strlen(t) + 1 );
+    strcpy( text, t );
+  }
+
+  oyProfile_Release( &p );
+  return text;
+}
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/src/xcmddc/xcmddc.c 
new/xcm-0.5.0/src/xcmddc/xcmddc.c
--- old/xcm-0.4.2/src/xcmddc/xcmddc.c   2010-12-30 17:43:50.000000000 +0100
+++ new/xcm-0.5.0/src/xcmddc/xcmddc.c   2012-02-22 09:23:19.000000000 +0100
@@ -9,15 +9,14 @@
  *
  */
 
-#include <X11/Xcm/XcmDDC.h>
-#include "xcm_version.h"
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 
-#ifndef USE_GETTEXT
-#define _(text) text
-#endif
+#include <X11/Xcm/XcmDDC.h>
+
+#include "xcm_version.h"
+#include "xcm_macros.h"
 
 void printfHelp(int argc, char ** argv)
 {
@@ -25,8 +24,8 @@
   fprintf( stderr, "%s %s\n",   argv[0],
                                 _("is a EDID from i2c tool"));
   fprintf( stderr, "  Xcm v%s config: %s devel period: %s\n",
-                  XCM_VERSION_NAME,
-                  XCM_CONFIG_DATE, XCM_DATE );
+                  XCM_TOOLS_VERSION_NAME,
+                  XCM_TOOLS_CONFIG_DATE, XCM_TOOLS_DATE );
   fprintf( stderr, "\n");
   fprintf( stderr, "%s\n",                 _("Usage"));
   fprintf( stderr, "  %s\n",               _("List available i2c->monitor 
devices:"));
@@ -47,51 +46,6 @@
   fprintf( stderr, "\n");
 }
 
-/* command line parsing macros */
-/* allow "-opt val" and "-opt=val" syntax */
-#define OY_PARSE_INT_ARG( opt ) \
-                        if( pos + 1 < argc && argv[pos][i+1] == 0 ) \
-                        { opt = atoi( argv[pos+1] ); \
-                          if( opt == 0 && strcmp(argv[pos+1],"0") ) \
-                            wrong_arg = "-" #opt; \
-                          ++pos; \
-                          i = 1000; \
-                        } else if(argv[pos][i+1] == '=') \
-                        { opt = atoi( &argv[pos][i+2] ); \
-                          if( opt == 0 && strcmp(&argv[pos][i+2],"0") ) \
-                            wrong_arg = "-" #opt; \
-                          i = 1000; \
-                        } else wrong_arg = "-" #opt; \
-                        if(oy_debug) fprintf(stderr,#opt "=%d\n",opt)
-#define OY_PARSE_STRING_ARG( opt ) \
-                        if( pos + 1 < argc && argv[pos][i+1] == 0 ) \
-                        { opt = argv[pos+1]; \
-                          if( opt == 0 && strcmp(argv[pos+1],"0") ) \
-                            wrong_arg = "-" #opt; \
-                          ++pos; \
-                          i = 1000; \
-                        } else if(argv[pos][i+1] == '=') \
-                        { opt = &argv[pos][i+2]; \
-                          if( opt == 0 && strcmp(&argv[pos][i+2],"0") ) \
-                            wrong_arg = "-" #opt; \
-                          i = 1000; \
-                        } else wrong_arg = "-" #opt; \
-                        if(oy_debug) fprintf(stderr, #opt "=%s\n",opt)
-#define OY_PARSE_STRING_ARG2( opt, arg ) \
-                        if( pos + 1 < argc && argv[pos][i+strlen(arg)+1] == 0 
) \
-                        { opt = argv[pos+1]; \
-                          ++pos; \
-                          i = 1000; \
-                        } else if(argv[pos][i+strlen(arg)+1] == '=') \
-                        { opt = &argv[pos][i+strlen(arg)+2]; \
-                          i = 1000; \
-                        } else wrong_arg = "-" arg; \
-                        if(oy_debug) fprintf(stderr,arg "=%s\n",opt)
-#define OY_IS_ARG( arg ) \
-                        (strlen(argv[pos])-2 >= strlen(arg) && \
-                         memcmp(&argv[pos][2],arg, strlen(arg)) == 0)
-
-#define verbose oy_debug
 
 int main(int argc, char ** argv)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/src/xcmedid/xcmedid.c 
new/xcm-0.5.0/src/xcmedid/xcmedid.c
--- old/xcm-0.4.2/src/xcmedid/xcmedid.c 2011-07-04 19:54:53.000000000 +0200
+++ new/xcm-0.5.0/src/xcmedid/xcmedid.c 2012-02-23 11:25:36.000000000 +0100
@@ -5,18 +5,49 @@
  *  @par License: 
  *             MIT <http://www.opensource.org/licenses/mit-license.php>
  *  @par Copyright:
- *             (c) 2009-2010 - Kai-Uwe Behrmann <[email protected]>
+ *             (c) 2009-2011 - Kai-Uwe Behrmann <[email protected]>
  *
  */
-#include <X11/Xcm/XcmEdidParse.h>
-#include "xcm_version.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#ifndef USE_GETTEXT
-#define _(text) text
-#endif
+#include <X11/Xcm/XcmEdidParse.h>
+
+#include "xcm_version.h"
+#include "xcm_macros.h"
+
+void printfHelp(int argc, char ** argv)
+{
+  fprintf( stderr, "\n");
+  fprintf( stderr, "%s %s\n",   argv[0],
+                                _("is a EDID parsing tool"));
+  fprintf( stderr, "  Xcm v%s config: %s devel period: %s\n",
+                  XCM_TOOLS_VERSION_NAME,
+                  XCM_TOOLS_CONFIG_DATE, XCM_TOOLS_DATE );
+  fprintf( stderr, "\n");
+  fprintf( stderr, "%s\n",                 _("Usage"));
+  fprintf( stderr, "      %s EDID.bin\n\n", argv[0]);
+  fprintf( stderr, "\n");
+
+
+  fprintf( stderr, "%s\n",                 _("Usage"));
+  fprintf( stderr, "  %s\n",               _("Print EDID values:"));
+  fprintf( stderr, "      %s EDID.bin\n\n", argv[0]);
+  fprintf( stderr, "      cat EDID.bin | %s\n", argv[0]);
+  fprintf( stderr, "        [--openicc|--ppmcie]\n");
+  fprintf( stderr, "\n");
+  fprintf( stderr, "  %s\n",               _("Print a help text:"));
+  fprintf( stderr, "      %s -h\n",        argv[0]);
+  fprintf( stderr, "\n");
+  fprintf( stderr, "  %s\n",               _("General options:"));
+  fprintf( stderr, "        --openicc       %s\n", _("use JSON"));
+  fprintf( stderr, "        --ppmcie        %s\n", _("ppcmcie compatible"));
+  fprintf( stderr, "        -v              %s\n", _("verbose"));
+  fprintf( stderr, "\n");
+  fprintf( stderr, "\n");
+}
 
 int main(int argc, char ** argv)
 {
@@ -24,20 +55,68 @@
   char * txt = 0;
   FILE * fp = 0;
   char * mem = 0;
-  size_t size = 0;
-  int s = 0;
+  size_t size = 0, s = 0;
   int min_args = 1;
-  int print_openicc_json = 0;
+  int print_openicc_json = 0,
+      print_ppmcie = 0;
+  const char * file_name = NULL;
+#ifndef HAVE_OY
+  int verbose = 0;
+#endif
 
-  if(argc > min_args)
+#ifdef USE_GETTEXT
+  setlocale(LC_ALL,"");
+#endif
+
+  if(argc > 1)
   {
-    if(strcmp( argv[min_args], "--openicc" ) == 0)
+    int pos = 1, i;
+    char *wrong_arg = 0;
+    while(pos < argc)
     {
-      print_openicc_json = 1;
-      ++min_args;
+      switch(argv[pos][0])
+      {
+        case '-':
+            for(i = 1; pos < argc && i < strlen(argv[pos]); ++i)
+            switch (argv[pos][i])
+            {
+              case 'v': verbose += 1; break;
+              case '-':
+                        if(i == 1)
+                        {
+                             if(OY_IS_ARG("openicc"))
+                        { print_openicc_json = 1; i=100; break; }
+                        else if(OY_IS_ARG("ppmcie"))
+                        { print_ppmcie = 1; i=100; break; }
+                        }
+                        printfHelp(argc, argv);
+                        exit (0);
+                        break;
+              case '?':
+              case 'h':
+              default:
+                        wrong_arg = argv[pos];
+                        break;
+            }
+            break;
+        default:
+                        if(!file_name)
+                        file_name = argv[pos];
+      }
+      if( wrong_arg )
+      {
+       fprintf(stderr, "%s %s\n", _("wrong argument to option:"), wrong_arg);
+       printfHelp(argc, argv);
+       exit(1);
+      }
+      ++pos;
     }
 
-    fp = fopen(argv[min_args],"rb");
+  } 
+
+  if(file_name)
+  {
+    fp = fopen(file_name,"rb");
     if(fp)
     {
       fseek(fp,0L,SEEK_END); 
@@ -45,6 +124,8 @@
       rewind(fp);
       mem = malloc(size);
       s = fread(mem, sizeof(char), size, fp);
+      if(s != size)
+        fprintf(stderr, "Error: fread %lu but should read %lu\n", s, size);
     } else
     {
       fprintf(stderr, "Error: Could not open file - \"%s\"\n", argv[min_args]);
@@ -60,17 +141,51 @@
       mem[size++] = c;
   }
 
+  if(verbose)
+  {
+    fprintf(stderr, "JSON=%d\n", print_openicc_json);
+  }
+
   if(mem && size)
   {
     if(print_openicc_json)
       err = XcmEdidPrintOpenIccJSON( mem, &txt, malloc );
+    else if(print_ppmcie)
+    {
+      XcmEdidKeyValue_s * list = 0;
+      int i = 0, count = 0;
+      err = XcmEdidParse( mem, &list, &count );
+      if(list && count)
+      {
+        fprintf(stderr, "ppmcie:");
+        for(i = 0; i < count; ++i)
+        {
+          if(strcmp(list[i].key,XCM_EDID_KEY_REDx) == 0)
+          { fprintf(stdout," -red %g", list[i].value.dbl); fflush(stdout); }
+          else if(strcmp(list[i].key,XCM_EDID_KEY_REDy) == 0)
+          { fprintf(stdout," %g", list[i].value.dbl); fflush(stdout); }
+          else if(strcmp(list[i].key,XCM_EDID_KEY_GREENx) == 0)
+          { fprintf(stdout," -green %g", list[i].value.dbl); fflush(stdout); }
+          else if(strcmp(list[i].key,XCM_EDID_KEY_GREENy) == 0)
+          { fprintf(stdout," %g", list[i].value.dbl); fflush(stdout); }
+          else if(strcmp(list[i].key,XCM_EDID_KEY_BLUEx) == 0)
+          { fprintf(stdout," -blue %g", list[i].value.dbl); fflush(stdout); }
+          else if(strcmp(list[i].key,XCM_EDID_KEY_BLUEy) == 0)
+          { fprintf(stdout," %g", list[i].value.dbl); fflush(stdout); }
+          else if(strcmp(list[i].key,XCM_EDID_KEY_WHITEx) == 0)
+          { fprintf(stdout," -white %g", list[i].value.dbl); fflush(stdout); }
+          else if(strcmp(list[i].key,XCM_EDID_KEY_WHITEy) == 0)
+          { fprintf(stdout," %g", list[i].value.dbl); fflush(stdout); }
+        }
+      }
+    }
     else
       err = XcmEdidPrintString( mem, &txt, malloc );
 
       if(err)
         fprintf( stderr, "Error: %s (%d)\n",
                  XcmEdidErrorToString(err), (int)size);
-      else
+      else if(txt)
       {
         fprintf(stdout, "%s\n", txt);
         free(txt);
@@ -80,18 +195,5 @@
   if(fp && fp != stdin)
     fclose (fp);
 
-  if(err)
-  {
-  fprintf( stderr, "\n");
-  fprintf( stderr, "%s %s\n",   argv[0],
-                                _("is a EDID parsing tool"));
-  fprintf( stderr, "  Xcm v%s config: %s devel period: %s\n",
-                  XCM_VERSION_NAME,
-                  XCM_CONFIG_DATE, XCM_DATE );
-  fprintf( stderr, "\n");
-  fprintf( stderr, "%s\n",                 _("Usage"));
-  fprintf(stderr, "      %s EDID.bin\n\n", argv[0]);
-  }
-
   return err;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/xcm.1 new/xcm-0.5.0/xcm.1
--- old/xcm-0.4.2/xcm.1 1970-01-01 01:00:00.000000000 +0100
+++ new/xcm-0.5.0/xcm.1 2012-01-14 10:31:56.000000000 +0100
@@ -0,0 +1,92 @@
+.TH xcm 1 "January 12, 2012" "User Commands"
+.SH NAME
+xcm \- window region handling
+.SH SYNOPSIS
+\fBxcm\fR -l [--window-name] [-v]
+.fi 
+\fBxcm\fR -p \fIWINDOW_ID\fR
+.fi 
+\fBxcm\fR -r --id \fIWINDOW_ID\fR [--geometry \fIWIDTHxHEIGHT+X+Y\fR] 
[--profile \fIFILENAME.ICC\fR]]
+.fi 
+\fBxcm\fR [-h]
+.fi 
+.SH DESCRIPTION
+The xcm tool handles per window regions and profiles following the X Color 
Management specification.
+.SH OPTIONS
+.TP
+.B \-l
+list windows.
+All windows are listed by ID.
+
+\fB--window-name\fR show each window name after the ID.
+.TP
+.B \-p \-\-id\fR=\fIWINDOW_ID\fR
+print window color region informations.
+
+\fB--id\fR the X11 window ID as integer.
+.TP
+\fB\-r \fB--id\fR \fIWINDOW_ID\fR \fB--geometry\fR \fIWxH+X+Y\fR 
\fB--profile\fR \fIPROFILE.ICC\fR
+set a window color region. The geometry will be added to the existing regions 
of the selected window. A geometry of 0x0+0+0 is a request to remove all 
regions. Overlapping regions are undefined. The ICC profile is optional.
+
+\fB--id\fR the X11 window ID as integer.
+
+\fB--geometry\fR the window geometry.
+
+\fB--profile\fR the region profile to upload.
+.TP
+\fB\-d \fB--id\fR \fIWINDOW_ID\fR \fB--geometry\fR \fIWxH+X+Y\fR 
\fB--profile\fR \fIPROFILE.ICC\fR
+delete a window color region. The geometry will be searched and removed in the 
existing regions of the selected window.
+
+\fB--id\fR the X11 window ID as integer.
+
+\fB--geometry\fR the window geometry.
+
+.SH GENERAL OPTIONS
+.TP
+.B \-v, \-\-verbose
+increase verbosity
+.SH EXAMPLES 
+.TP
+Show all windows and their names:
+.B xcm -l --window-name
+.PP 
+.TP
+Print a windows regions:
+.B xcm -p -id 12345
+.PP 
+.TP
+Set a windows region to a witdht of 100, a height of 150, 100 pixel from right 
and 10 pixels from top:
+.B xcm -r -id 12345 --geometry 100x150+100+10
+.PP 
+.TP
+Set a windows region with a ICC profile:
+.B xcm -r -id 12345 --geometry 100x150+100+10 --profile ./my_profile.icc
+.PP 
+.TP
+Set a windows region to a Oyranos ICC profile:
+.B xcm -r -id 12345 --geometry 100x150+100+10 --profile XYZ.icc
+.PP 
+.TP
+Unset all windows regions:
+.B xcm -r -id 12345 --geometry 0x0+0+0
+.PP 
+.TP
+Delete one window region:
+.B xcm -d -id 12345 --geometry 100x150+100+10
+.PP 
+.TP
+Print a help text:
+.B xcm -h
+.PP 
+.SH AUTHOR
+Kai-Uwe Behrmann (ku.b (at) gmx.de)
+.SH COPYRIGHT
+(c) 2011-2012, Kai-Uwe Behrmann
+.fi
+License: MIT <http://www.opensource.org/licenses/mit-license.php>
+.SH "SEE ALSO"
+xcmedid(1) xcmevents(1) xcmddc(1) libXcm(3) Xcm(3)
+.fi
+http://www.oyranos.org
+.SH "REPORTING BUGS"
+at: http://sourceforge.net/tracker/?group_id=177017&atid=879553
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/xcm.spec.in new/xcm-0.5.0/xcm.spec.in
--- old/xcm-0.4.2/xcm.spec.in   2011-07-09 15:17:01.000000000 +0200
+++ new/xcm-0.5.0/xcm.spec.in   2012-02-23 11:12:10.000000000 +0100
@@ -1,14 +1,11 @@
 Summary:        X Color Management tools
 Name:           xcm
 License:        MIT
-Group:          System/Tools
+Group:          System/X11/Utilities
 URL:            http://www.oyranos.org
 Vendor:         Kai-Uwe Behrmann
-#BuildArch: %{_arch}
-#%ifos linux
-#%endif 
-BuildRoot: %{_tmppath}/%{name}-root
-Prefix:    %{_prefix}
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+Prefix:         %{_prefix}
 
 BuildRequires:  udev
 
@@ -16,7 +13,7 @@
 BuildRequires:     gcc-c++ pkgconfig    xorg-x11-Mesa xorg-x11-Mesa-devel 
 %endif
 %if 0%{?suse_version} > 910
-BuildRequires:  bash bind-utils binutils bison bzip2 coreutils cpio cyrus-sasl 
diffutils e2fsprogs file filesystem findutils gcc gcc-c++ glibc glibc-devel 
grep groff gzip less make man mktemp patch perl pkgconfig popt readline rpm sed 
tar timezone unzip util-linux zlib zlib-devel
+BuildRequires:  bash bind-utils binutils bison bzip2 coreutils cpio cyrus-sasl 
diffutils e2fsprogs file filesystem findutils gcc gcc-c++ glibc glibc-devel 
grep groff gzip less libtool make man mktemp patch perl pkgconfig popt readline 
rpm sed tar timezone unzip util-linux zlib zlib-devel
 %endif
 %if 0%{?suse_version} > 1010
 BuildRequires:  Mesa Mesa-devel gcc-c++ pkgconfig xorg-x11 xorg-x11-devel 
xorg-x11-libX11 xorg-x11-libX11-devel xorg-x11-libXfixes 
xorg-x11-libXfixes-devel xorg-x11-libs xorg-x11-util-devel 
xorg-x11-libXmu-devel libXcm-devel liboyranos-alpha-devel 
@@ -26,7 +23,6 @@
 %endif
 %if 0%{?fedora_version} > 0
 BuildRequires:  Mesa Mesa-devel gcc-c++ xorg-x11-devel xorg-x11-Mesa-devel 
xdg-utils  libXfixes-devel xorg-x11-proto-devel xorg-x11-xtrans-devel 
libXcm-devel liboyranos-alpha-devel libXmu-devel elektra-devel 
libtool-ltdl-devel
-
 %endif
 %if 0%{?debian_version} > 0
 BuildRequires: gcc-c++ pkgconfig xorg-x11 xorg-x11-devel xorg-x11-Mesa-devel  
xdg-utils  liboyranos-alpha-devel
@@ -47,23 +43,19 @@
 make %{?_smp_mflags}
 
 %install
-make DESTDIR=%{buildroot} install
-make DESTDIR=%{buildroot} install_udev
+%make_install
 
 #Remove installed doc
 rm -fr %{buildroot}/%{_datadir}/doc/%{name}
 
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-
 %files
 %defattr(-, root, root)
 %{_bindir}/%{name}events
 %{_bindir}/%{name}edid
 %{_bindir}/%{name}ddc
+%{_bindir}/%{name}
+%{_mandir}/man1/%{name}.1*
 %{_mandir}/man1/%{name}ddc.1*
 %{_mandir}/man1/%{name}edid.1*
 %{_mandir}/man1/%{name}events.1*
@@ -72,6 +64,10 @@
 
 
 %changelog
+* Thu Sep 8 2011 Kai-Uwe Behrmann
+- add and install xcm window region tool
+- install xcm man page for xcm
+
 * Thu Dec 30 2010 Kai-Uwe Behrmann
 - install EDID from i2c tool
 - install man pages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/xcm_macros.h new/xcm-0.5.0/xcm_macros.h
--- old/xcm-0.4.2/xcm_macros.h  1970-01-01 01:00:00.000000000 +0100
+++ new/xcm-0.5.0/xcm_macros.h  2011-12-28 22:04:53.000000000 +0100
@@ -0,0 +1,83 @@
+/** xcm_macros.h
+ *
+ *  @par License: 
+ *             MIT <http://www.opensource.org/licenses/mit-license.php>
+ *  @par Copyright:
+ *             (c) 2011 - Kai-Uwe Behrmann <[email protected]>
+ */
+
+#ifndef USE_GETTEXT
+#define _(text) text
+#endif
+
+#include "config.h"
+
+#ifdef HAVE_OY
+#include <alpha/oyranos_alpha.h>
+void * fromMD5                       ( const void        * md5_hash,
+                                       size_t            * size,
+                                       void              
*(allocate_func)(size_t) );
+char * getName                       ( const void        * data,
+                                       size_t              size,
+                                       void              
*(allocate_func)(size_t),
+                                       int                 file_name );
+#define verbose oy_debug
+#else
+#define oy_debug verbose
+#endif
+
+/* command line parsing macros */
+/* allow "-opt val" and "-opt=val" syntax */
+#define OY_PARSE_INT_ARG( opt ) \
+                        if( pos + 1 < argc && argv[pos][i+1] == 0 ) \
+                        { opt = atoi( argv[pos+1] ); \
+                          if( opt == 0 && strcmp(argv[pos+1],"0") ) \
+                            wrong_arg = "-" #opt; \
+                          ++pos; \
+                          i = 1000; \
+                        } else if(argv[pos][i+1] == '=') \
+                        { opt = atoi( &argv[pos][i+2] ); \
+                          if( opt == 0 && strcmp(&argv[pos][i+2],"0") ) \
+                            wrong_arg = "-" #opt; \
+                          i = 1000; \
+                        } else wrong_arg = "-" #opt; \
+                        if(oy_debug) fprintf(stderr,#opt "=%d\n",opt)
+#define OY_PARSE_INT_ARG2( opt, arg ) \
+                        if( pos + 1 < argc && argv[pos][i+strlen(arg)+1] == 0 
) \
+                        { opt = atoi(argv[pos+1]); \
+                          ++pos; \
+                          i = 1000; \
+                        } else if(argv[pos][i+strlen(arg)+1] == '=') \
+                        { opt = atoi(&argv[pos][i+strlen(arg)+2]); \
+                          i = 1000; \
+                        } else wrong_arg = "-" arg; \
+                        if(oy_debug) fprintf(stderr,arg "=%d\n",opt)
+#define OY_PARSE_STRING_ARG( opt ) \
+                        if( pos + 1 < argc && argv[pos][i+1] == 0 ) \
+                        { opt = argv[pos+1]; \
+                          if( opt == 0 && strcmp(argv[pos+1],"0") ) \
+                            wrong_arg = "-" #opt; \
+                          ++pos; \
+                          i = 1000; \
+                        } else if(argv[pos][i+1] == '=') \
+                        { opt = &argv[pos][i+2]; \
+                          if( opt == 0 && strcmp(&argv[pos][i+2],"0") ) \
+                            wrong_arg = "-" #opt; \
+                          i = 1000; \
+                        } else wrong_arg = "-" #opt; \
+                        if(oy_debug) fprintf(stderr, #opt "=%s\n",opt)
+#define OY_PARSE_STRING_ARG2( opt, arg ) \
+                        if( pos + 1 < argc && argv[pos][i+strlen(arg)+1] == 0 
) \
+                        { opt = argv[pos+1]; \
+                          ++pos; \
+                          i = 1000; \
+                        } else if(argv[pos][i+strlen(arg)+1] == '=') \
+                        { opt = &argv[pos][i+strlen(arg)+2]; \
+                          i = 1000; \
+                        } else wrong_arg = "-" arg; \
+                        if(oy_debug) fprintf(stderr,arg "=%s\n",opt)
+#define OY_IS_ARG( arg ) \
+                        (strlen(argv[pos])-2 >= strlen(arg) && \
+                         memcmp(&argv[pos][2],arg, strlen(arg)) == 0)
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/xcmedid.1 new/xcm-0.5.0/xcmedid.1
--- old/xcm-0.4.2/xcmedid.1     2010-12-30 11:34:51.000000000 +0100
+++ new/xcm-0.5.0/xcmedid.1     2011-09-24 17:26:34.000000000 +0200
@@ -1,4 +1,4 @@
-.TH xcmedid 1 "December 30, 2010" "User Commands"
+.TH xcmedid 1 "September 24, 2011" "User Commands"
 .SH NAME
 xcmddc \- monitor EDID to key/value dumper
 .SH SYNOPSIS
@@ -21,6 +21,10 @@
 Fetch EDID over Oyranos and dump key/value pairs:
 .B oyranos-monitor -f edid -d 0 | xcmedid
 .PP 
+.TP
+Fetch EDID over Oyranos and show in ppmcie:
+.B ppmcie `oyranos-monitor -f edid -d 0 | xcmedid --ppmcie` > tmp.ppm; xli 
tmp.ppm
+.PP 
 .SH AUTHOR
 Kai-Uwe Behrmann (ku.b (at) gmx.de)
 .SH COPYRIGHT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xcm-0.4.2/xcmevents.1 new/xcm-0.5.0/xcmevents.1
--- old/xcm-0.4.2/xcmevents.1   2011-07-04 19:51:53.000000000 +0200
+++ new/xcm-0.5.0/xcmevents.1   2011-09-21 16:38:30.000000000 +0200
@@ -1,11 +1,11 @@
-.TH xcmedid 1 "July 04, 2011" "User Commands"
+.TH xcmevents 1 "July 04, 2011" "User Commands"
 .SH NAME
 xcmevents \- Xorg color management event observer
 .SH SYNOPSIS
 \fBxcmevents\fR
 .fi 
 .SH DESCRIPTION
-Xcmevents is a analysis to for observing and debugging color management events 
under X. It knows about _ICC_PROFILE in X, net-color spec and EDID events. 
Applications issuing such events are tools to configure the monitors ICC 
profile, viewers using the net-color spec and desktop color servers. The first 
lines of output will contain some status informatins and some important 
observed atom names. Following are the monitors with their geometry and a 
optional ICC profile. Dynamic events are show imediately.
+Xcmevents is a analysis tool for observing and debugging color management 
events under X. It knows about _ICC_PROFILE in X, X Color Management 
specification and EDID events. Applications issuing such events are tools to 
configure the monitors ICC profile, viewers using the X Color Management 
specification and desktop color servers. The first lines of output will contain 
some status informatins and some important observed atom names. Following are 
the monitors with their geometry and a optional ICC profile. Dynamic events are 
show imediately.
 .SH AUTHOR
 Kai-Uwe Behrmann (ku.b (at) gmx.de)
 .SH COPYRIGHT

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to