From 3e81e7e05f888eadd81385768baa3ff0c1821452 Mon Sep 17 00:00:00 2001 From: neoraider Date: Fri, 11 Apr 2008 08:43:05 +0000 Subject: zoomedit: * Added Xml util class to remove dependency on SVN libxml++. --- configure | 27 ++- configure.ac | 11 +- src/Data/Triangle.cpp | 7 +- src/Makefile.am | 4 +- src/Makefile.in | 6 +- src/Util/Makefile.am | 4 + src/Util/Makefile.in | 446 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/Util/Xml.cpp | 42 +++++ src/Util/Xml.h | 39 +++++ 9 files changed, 552 insertions(+), 34 deletions(-) create mode 100644 src/Util/Makefile.am create mode 100644 src/Util/Makefile.in create mode 100644 src/Util/Xml.cpp create mode 100644 src/Util/Xml.h diff --git a/configure b/configure index 20ecf37..a19e11e 100755 --- a/configure +++ b/configure @@ -19554,7 +19554,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Checks for libraries. -#AC_CHECK_LIB(m, [sqrt]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then @@ -20087,12 +20086,12 @@ if test -n "$PKG_CONFIG"; then pkg_cv_libxml_CFLAGS="$libxml_CFLAGS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml++-2.6 >= 2.24\"") >&5 - ($PKG_CONFIG --exists --print-errors "libxml++-2.6 >= 2.24") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml++-2.6\"") >&5 + ($PKG_CONFIG --exists --print-errors "libxml++-2.6") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_libxml_CFLAGS=`$PKG_CONFIG --cflags "libxml++-2.6 >= 2.24" 2>/dev/null` + pkg_cv_libxml_CFLAGS=`$PKG_CONFIG --cflags "libxml++-2.6" 2>/dev/null` else pkg_failed=yes fi @@ -20105,12 +20104,12 @@ if test -n "$PKG_CONFIG"; then pkg_cv_libxml_LIBS="$libxml_LIBS" else if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml++-2.6 >= 2.24\"") >&5 - ($PKG_CONFIG --exists --print-errors "libxml++-2.6 >= 2.24") 2>&5 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml++-2.6\"") >&5 + ($PKG_CONFIG --exists --print-errors "libxml++-2.6") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - pkg_cv_libxml_LIBS=`$PKG_CONFIG --libs "libxml++-2.6 >= 2.24" 2>/dev/null` + pkg_cv_libxml_LIBS=`$PKG_CONFIG --libs "libxml++-2.6" 2>/dev/null` else pkg_failed=yes fi @@ -20129,9 +20128,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libxml_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libxml++-2.6 >= 2.24"` + libxml_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libxml++-2.6"` else - libxml_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml++-2.6 >= 2.24"` + libxml_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml++-2.6"` fi # Put the nasty error message in config.log where it belongs echo "$libxml_PKG_ERRORS" >&5 @@ -20155,19 +20154,12 @@ fi # Checks for header files. -#AC_HEADER_STDC -#AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) # Checks for typedefs, structures, and compiler characteristics. -#AC_HEADER_TIME # Checks for library functions. -#AC_FUNC_MALLOC -#AC_FUNC_REALLOC -#AC_CHECK_FUNCS([sqrtf], , AC_MSG_ERROR([required function sqrtf not found])) - -ac_config_files="$ac_config_files Makefile src/Makefile src/Data/Makefile src/Gui/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile src/Data/Makefile src/Gui/Makefile src/Util/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -20766,6 +20758,7 @@ do "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/Data/Makefile") CONFIG_FILES="$CONFIG_FILES src/Data/Makefile" ;; "src/Gui/Makefile") CONFIG_FILES="$CONFIG_FILES src/Gui/Makefile" ;; + "src/Util/Makefile") CONFIG_FILES="$CONFIG_FILES src/Util/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} diff --git a/configure.ac b/configure.ac index a79fafd..9fb2016 100644 --- a/configure.ac +++ b/configure.ac @@ -15,29 +15,22 @@ AM_PROG_CC_C_O AC_PROG_LIBTOOL # Checks for libraries. -#AC_CHECK_LIB(m, [sqrt]) PKG_CHECK_MODULES(glademm, glibmm-2.4 >= 2.16 libglademm-2.4, , AC_MSG_ERROR(Test for glibmm-2.4 >= 2.16 and libglademm-2.4 failed.)) AM_PATH_GTKGLEXT_1_0(1.0.0,,AC_MSG_ERROR(Test for GtkGLExt failed.)) -PKG_CHECK_MODULES(libxml, libxml++-2.6 >= 2.24, , AC_MSG_ERROR(Test for libxml++-2.6 failed.)) +PKG_CHECK_MODULES(libxml, libxml++-2.6, , AC_MSG_ERROR(Test for libxml++-2.6 failed.)) # Checks for header files. -#AC_HEADER_STDC -#AC_CHECK_HEADERS([stddef.h stdlib.h string.h]) # Checks for typedefs, structures, and compiler characteristics. -#AC_HEADER_TIME # Checks for library functions. -#AC_FUNC_MALLOC -#AC_FUNC_REALLOC - -#AC_CHECK_FUNCS([sqrtf], , AC_MSG_ERROR([required function sqrtf not found])) AC_CONFIG_FILES([ Makefile src/Makefile src/Data/Makefile src/Gui/Makefile + src/Util/Makefile ]) AC_OUTPUT diff --git a/src/Data/Triangle.cpp b/src/Data/Triangle.cpp index d334c12..a85d8ad 100644 --- a/src/Data/Triangle.cpp +++ b/src/Data/Triangle.cpp @@ -18,6 +18,7 @@ */ #include "Triangle.h" +#include "../Util/Xml.h" #include namespace ZoomEdit { @@ -121,7 +122,7 @@ void Triangle::setNormal(unsigned int i, const Vector &n) { normals[i] = n; if(!normalNodes[i]) - normalNodes[i] = triangleNode->add_child(static_cast(vertexNodes[i]), "normal"); + normalNodes[i] = Util::Xml::addSibling(static_cast(vertexNodes[i]), "normal"); normalNodes[i]->set_attribute("x", Glib::ustring::format(n.getX())); normalNodes[i]->set_attribute("y", Glib::ustring::format(n.getY())); @@ -133,9 +134,9 @@ void Triangle::setTexCoords(unsigned int i, const TexCoords &t) { if(!texCoordsNodes[i]) { if(normalNodes[i]) - texCoordsNodes[i] = triangleNode->add_child(static_cast(normalNodes[i]), "texcoords"); + texCoordsNodes[i] = Util::Xml::addSibling(static_cast(normalNodes[i]), "texcoords"); else - texCoordsNodes[i] = triangleNode->add_child(static_cast(vertexNodes[i]), "texcoords"); + texCoordsNodes[i] = Util::Xml::addSibling(static_cast(vertexNodes[i]), "texcoords"); } texCoordsNodes[i]->set_attribute("s", Glib::ustring::format(t.getS())); diff --git a/src/Makefile.am b/src/Makefile.am index 04b4a08..6b1c2c9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ -SUBDIRS = Data Gui +SUBDIRS = Data Gui Util bin_PROGRAMS = zoomedit zoomedit_SOURCES = zoomedit.cpp Instance.cpp zoomedit_CPPFLAGS = $(glademm_CFLAGS) $(GTKGLEXT_CFLAGS) $(libxml_CFLAGS) -zoomedit_LDADD = Data/libdata.la Gui/libgui.la $(glademm_LIBS) $(GTKGLEXT_LIBS) $(libxml_LIBS) +zoomedit_LDADD = Data/libdata.la Gui/libgui.la Util/libutil.la $(glademm_LIBS) $(GTKGLEXT_LIBS) $(libxml_LIBS) diff --git a/src/Makefile.in b/src/Makefile.in index 793286b..2154473 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -50,7 +50,7 @@ am_zoomedit_OBJECTS = zoomedit-zoomedit.$(OBJEXT) \ zoomedit-Instance.$(OBJEXT) zoomedit_OBJECTS = $(am_zoomedit_OBJECTS) am__DEPENDENCIES_1 = -zoomedit_DEPENDENCIES = Data/libdata.la Gui/libgui.la \ +zoomedit_DEPENDENCIES = Data/libdata.la Gui/libgui.la Util/libutil.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ @@ -194,10 +194,10 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = Data Gui +SUBDIRS = Data Gui Util zoomedit_SOURCES = zoomedit.cpp Instance.cpp zoomedit_CPPFLAGS = $(glademm_CFLAGS) $(GTKGLEXT_CFLAGS) $(libxml_CFLAGS) -zoomedit_LDADD = Data/libdata.la Gui/libgui.la $(glademm_LIBS) $(GTKGLEXT_LIBS) $(libxml_LIBS) +zoomedit_LDADD = Data/libdata.la Gui/libgui.la Util/libutil.la $(glademm_LIBS) $(GTKGLEXT_LIBS) $(libxml_LIBS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/src/Util/Makefile.am b/src/Util/Makefile.am new file mode 100644 index 0000000..021ae0b --- /dev/null +++ b/src/Util/Makefile.am @@ -0,0 +1,4 @@ +noinst_LTLIBRARIES = libutil.la + +libutil_la_SOURCES = Xml.cpp +libutil_la_CPPFLAGS = $(libxml_CFLAGS) diff --git a/src/Util/Makefile.in b/src/Util/Makefile.in new file mode 100644 index 0000000..7eb4e2b --- /dev/null +++ b/src/Util/Makefile.in @@ -0,0 +1,446 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/Util +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libutil_la_LIBADD = +am_libutil_la_OBJECTS = libutil_la-Xml.lo +libutil_la_OBJECTS = $(am_libutil_la_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libutil_la_SOURCES) +DIST_SOURCES = $(libutil_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@ +GTKGLEXT_LIBS = @GTKGLEXT_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +glademm_CFLAGS = @glademm_CFLAGS@ +glademm_LIBS = @glademm_LIBS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libxml_CFLAGS = @libxml_CFLAGS@ +libxml_LIBS = @libxml_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libutil.la +libutil_la_SOURCES = Xml.cpp +libutil_la_CPPFLAGS = $(libxml_CFLAGS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Util/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Util/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libutil.la: $(libutil_la_OBJECTS) $(libutil_la_DEPENDENCIES) + $(CXXLINK) $(libutil_la_OBJECTS) $(libutil_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutil_la-Xml.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libutil_la-Xml.lo: Xml.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libutil_la-Xml.lo -MD -MP -MF $(DEPDIR)/libutil_la-Xml.Tpo -c -o libutil_la-Xml.lo `test -f 'Xml.cpp' || echo '$(srcdir)/'`Xml.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libutil_la-Xml.Tpo $(DEPDIR)/libutil_la-Xml.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Xml.cpp' object='libutil_la-Xml.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libutil_la-Xml.lo `test -f 'Xml.cpp' || echo '$(srcdir)/'`Xml.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/Util/Xml.cpp b/src/Util/Xml.cpp new file mode 100644 index 0000000..5dac26a --- /dev/null +++ b/src/Util/Xml.cpp @@ -0,0 +1,42 @@ +/* + * Xml.cpp + * + * Copyright (C) 2008 Matthias Schiffer + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "Xml.h" +#include + +namespace ZoomEdit { +namespace Util { + +xmlpp::Element* Xml::addSibling(xmlpp::Node *previous, const Glib::ustring &name) { + if(!previous) + return NULL; + + xmlNodePtr child = xmlNewNode(NULL, (const xmlChar*)name.c_str()); + if(!child) + return NULL; + + xmlNodePtr node = xmlAddNextSibling(previous->cobj(), child); + if(!node) + return NULL; + + return static_cast(node->_private); +} + +} +} diff --git a/src/Util/Xml.h b/src/Util/Xml.h new file mode 100644 index 0000000..a956ae8 --- /dev/null +++ b/src/Util/Xml.h @@ -0,0 +1,39 @@ +/* + * Xml.h + * + * Copyright (C) 2008 Matthias Schiffer + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef ZOOMEDIT_DATA_XML_H_ +#define ZOOMEDIT_DATA_XML_H_ + +#include + +namespace ZoomEdit { +namespace Util { + +class Xml { + private: + Xml(); + + public: + static xmlpp::Element* addSibling(xmlpp::Node *previous, const Glib::ustring &name); +}; + +} +} + +#endif /*XML_H_*/ -- cgit v1.2.3