changeset 202:75ec0124202a

Commit merged between 200 and 201
author wycc@wycc-desktop
date Tue, 09 Dec 2008 23:34:05 +0800
parents 31933f9ee70e (diff) c234ee745ceb (current diff)
children 1d485bf96480
files examples/drag/Makefile.in src/observer.c src/shape_path.c
diffstat 20 files changed, 2236 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Tue Dec 09 17:34:10 2008 +0800
+++ b/configure.ac	Tue Dec 09 23:34:05 2008 +0800
@@ -40,6 +40,8 @@
                  examples/calculator/Makefile
                  examples/svg2code_ex/Makefile
                  examples/tank/Makefile
+                 examples/drag/Makefile
+                 examples/dynamic/Makefile
                  src/Makefile
                  include/Makefile
                  tools/Makefile])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/drag/Makefile.am	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,21 @@
+include $(top_srcdir)/config.mk
+
+noinst_PROGRAMS = ex1
+EXTRA_DIST = menu.svg
+
+ex1_SOURCES = main.c
+nodist_ex1_SOURCES = menu.c menu.h
+ex1_CPPFLAGS = @cairo_CFLAGS@ -I$(top_srcdir)
+ex1_LDFLAGS = @cairo_LIBS@ 
+ex1_LDADD = $(top_builddir)/src/libmbfly.la
+BUILT_SOURCES = menu.c menu.h menu.mb
+CLEANFILES = menu.c menu.h menu.mb
+
+menu.mb: $(srcdir)/menu.svg
+	$(top_srcdir)/tools/svg2code.py $? $@
+
+menu.h: menu.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $@
+
+menu.c: menu.mb
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/drag/Makefile.in	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,491 @@
+# 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@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/config.mk
+noinst_PROGRAMS = ex1$(EXEEXT)
+subdir = examples/drag
+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)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_ex1_OBJECTS = ex1-main.$(OBJEXT)
+nodist_ex1_OBJECTS = ex1-menu.$(OBJEXT)
+ex1_OBJECTS = $(am_ex1_OBJECTS) $(nodist_ex1_OBJECTS)
+ex1_DEPENDENCIES = $(top_builddir)/src/libmbfly.la
+ex1_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ex1_LDFLAGS) \
+	$(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(ex1_SOURCES) $(nodist_ex1_SOURCES)
+DIST_SOURCES = $(ex1_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@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+XMKMF = @XMKMF@
+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_DUMPBIN = @ac_ct_DUMPBIN@
+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@
+cairo_CFLAGS = @cairo_CFLAGS@
+cairo_LIBS = @cairo_LIBS@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+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@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+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@
+INCLUDES = -I$(top_srcdir)/include
+EXTRA_DIST = menu.svg
+ex1_SOURCES = main.c
+nodist_ex1_SOURCES = menu.c menu.h
+ex1_CPPFLAGS = @cairo_CFLAGS@ -I$(top_srcdir)
+ex1_LDFLAGS = @cairo_LIBS@ 
+ex1_LDADD = $(top_builddir)/src/libmbfly.la
+BUILT_SOURCES = menu.c menu.h menu.mb
+CLEANFILES = menu.c menu.h menu.mb
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config.mk $(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) --foreign  examples/drag/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  examples/drag/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:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+ex1$(EXEEXT): $(ex1_OBJECTS) $(ex1_DEPENDENCIES) 
+	@rm -f ex1$(EXEEXT)
+	$(ex1_LINK) $(ex1_OBJECTS) $(ex1_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ex1-main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ex1-menu.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+ex1-main.o: main.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ex1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ex1-main.o -MD -MP -MF $(DEPDIR)/ex1-main.Tpo -c -o ex1-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/ex1-main.Tpo $(DEPDIR)/ex1-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='main.c' object='ex1-main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ex1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ex1-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+
+ex1-main.obj: main.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ex1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ex1-main.obj -MD -MP -MF $(DEPDIR)/ex1-main.Tpo -c -o ex1-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/ex1-main.Tpo $(DEPDIR)/ex1-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='main.c' object='ex1-main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ex1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ex1-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+
+ex1-menu.o: menu.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ex1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ex1-menu.o -MD -MP -MF $(DEPDIR)/ex1-menu.Tpo -c -o ex1-menu.o `test -f 'menu.c' || echo '$(srcdir)/'`menu.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/ex1-menu.Tpo $(DEPDIR)/ex1-menu.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='menu.c' object='ex1-menu.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ex1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ex1-menu.o `test -f 'menu.c' || echo '$(srcdir)/'`menu.c
+
+ex1-menu.obj: menu.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ex1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ex1-menu.obj -MD -MP -MF $(DEPDIR)/ex1-menu.Tpo -c -o ex1-menu.obj `if test -f 'menu.c'; then $(CYGPATH_W) 'menu.c'; else $(CYGPATH_W) '$(srcdir)/menu.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/ex1-menu.Tpo $(DEPDIR)/ex1-menu.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='menu.c' object='ex1-menu.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ex1_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ex1-menu.obj `if test -f 'menu.c'; then $(CYGPATH_W) 'menu.c'; else $(CYGPATH_W) '$(srcdir)/menu.c'; fi`
+
+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: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) 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:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+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."
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	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-noinstPROGRAMS 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
+
+
+menu.mb: $(srcdir)/menu.svg
+	$(top_srcdir)/tools/svg2code.py $? $@
+
+menu.h: menu.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $@
+
+menu.c: menu.mb
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $@
+# 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:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/drag/main.c	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,109 @@
+/*! \file
+ *
+ * svg2code_ex is an example that show programmers how to create a
+ * menu with MadButterfly.
+ *
+ */
+#include <stdio.h>
+#include <mb.h>
+#include "menu.h"
+
+typedef struct _engine engine_t;
+struct _engine {
+    X_MB_runtime_t *rt;
+    redraw_man_t *rdman;
+    menu_t *menu;
+    int state;
+    co_aix orx,ory;
+    int start_x,start_y;
+};
+engine_t *engine_init()
+{
+
+    X_MB_runtime_t *rt;
+    rt = X_MB_new(":0.0", 800, 600);
+    engine_t *en = (engine_t *) malloc(sizeof(engine_t));
+
+    en->rt = rt;
+    en->rdman =  X_MB_rdman(rt);
+    return en;
+}
+void engine_close(engine_t *en)
+{
+    /*
+     * Start handle connections, includes one to X server.
+     * User start to interact with the application.
+     */
+    X_MB_handle_connection(en->rt);
+
+    /*
+     * Clean
+     */
+    menu_free(en->menu);
+    X_MB_free(en->rt);
+    free(en);
+}
+#define COORD_SHOW(group) coord_show(group);rdman_coord_changed(X_MB_rdman(ex_rt->rt), group)
+#define COORD_HIDE(group) coord_hide(group);rdman_coord_changed(X_MB_rdman(ex_rt->rt), group)
+
+
+void coord_move(coord_t *c, co_aix x, co_aix y)
+{
+    c->matrix[2] = x;
+    c->matrix[5] = y;
+}
+
+
+static void cursor_press_handler(event_t *evt, void *arg) {
+    engine_t *en = (engine_t *) arg;
+    mouse_event_t *mev = (mouse_event_t *) evt;
+
+    en->start_x = mev->x;
+    en->start_y = mev->y;
+    en->orx = en->menu->cursor->matrix[2];
+    en->ory = en->menu->cursor->matrix[5];
+    printf("pressed %g %g\n",en->orx,en->ory);
+    en->state = 1;
+}
+
+static void cursor_release_handler(event_t *evt, void *arg) {
+    engine_t *en = (engine_t *) arg;
+    printf("up\n");
+    en->state = 0;
+}
+
+static void cursor_move_handler(event_t *evt, void *arg) {
+    engine_t *en = (engine_t *) arg;
+    mouse_event_t *mev = (mouse_event_t *) evt;
+
+    if (en->state) {
+        printf("move to (%d %d)\n", mev->x,mev->y);
+        coord_move(en->menu->cursor,en->orx + (mev->x-en->start_x),en->ory + (mev->y-en->start_y));
+        rdman_coord_changed(en->rdman, en->menu->cursor);
+        /* Update changed part to UI. */
+        rdman_redraw_changed(en->rdman);
+    }
+}
+
+int main(int argc, char * const argv[]) {
+    subject_t *subject;
+    engine_t *en;
+
+    en = engine_init();
+    en->menu = menu_new(en->rdman, en->rdman->root_coord);
+
+    /*
+     * Register observers to subjects of events for objects.
+     */
+    subject = coord_get_mouse_event(en->menu->cursor);
+    subject_add_event_observer(subject,  EVT_MOUSE_BUT_PRESS, cursor_press_handler, en);
+    subject_add_event_observer(subject,  EVT_MOUSE_BUT_RELEASE, cursor_release_handler, en);
+    subject_add_event_observer(subject,  EVT_MOUSE_MOVE, cursor_move_handler, en);
+
+
+    engine_close(en);
+
+    return 0;
+}
+
+/* vim: set ts=4 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/drag/menu.svg	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="menu.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="375"
+     inkscape:cy="520"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="645"
+     inkscape:window-height="725"
+     inkscape:window-x="450"
+     inkscape:window-y="154" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <g
+       id="cursor"
+       inkscape:label="#g2382">
+      <path
+         transform="translate(-257.14286,-237.14286)"
+         inkscape:label="#path2383"
+         d="M 291.42856,309.50504 L 269.44241,294.96605 L 245.00125,304.83533 L 252.03456,279.43246 L 235.09558,259.23731 L 261.42856,258.07647 L 275.40086,235.7259 L 284.64222,260.41133 L 310.21655,266.79307 L 289.59505,283.21034 L 291.42856,309.50504 z"
+         inkscape:randomized="0"
+         inkscape:rounded="0"
+         inkscape:flatsided="false"
+         sodipodi:arg2="1.6710404"
+         sodipodi:arg1="1.0427219"
+         sodipodi:r2="19.84635"
+         sodipodi:r1="39.692696"
+         sodipodi:cy="275.21933"
+         sodipodi:cx="271.42856"
+         sodipodi:sides="5"
+         id="c1"
+         style="fill:#ffff00;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         sodipodi:type="star"
+         inkscape:transform-center-x="-38.060483"
+         inkscape:transform-center-y="37.389571" />
+    </g>
+  </g>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/dynamic/Makefile.am	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,30 @@
+include $(top_srcdir)/config.mk
+
+noinst_PROGRAMS = dynamic
+EXTRA_DIST = menu.svg button.svg
+
+dynamic_SOURCES = main.c
+nodist_dynamic_SOURCES = menu.c menu.h button.c button.h
+dynamic_CPPFLAGS = @cairo_CFLAGS@ -I$(top_srcdir)
+dynamic_LDFLAGS = @cairo_LIBS@ 
+dynamic_LDADD = $(top_builddir)/src/libmbfly.la
+BUILT_SOURCES = menu.c menu.h menu.mb
+CLEANFILES = menu.c menu.h menu.mb
+
+menu.mb: $(srcdir)/menu.svg
+	$(top_srcdir)/tools/svg2code.py $? $@
+
+menu.h: menu.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $@
+
+menu.c: menu.mb
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $@
+
+button.mb: $(srcdir)/button.svg
+	$(top_srcdir)/tools/svg2code.py $? $@
+
+button.h: button.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $@
+
+button.c: button.mb
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/dynamic/Makefile.in	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,516 @@
+# 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@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/config.mk
+noinst_PROGRAMS = dynamic$(EXEEXT)
+subdir = examples/dynamic
+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)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_dynamic_OBJECTS = dynamic-main.$(OBJEXT)
+nodist_dynamic_OBJECTS = dynamic-menu.$(OBJEXT) \
+	dynamic-button.$(OBJEXT)
+dynamic_OBJECTS = $(am_dynamic_OBJECTS) $(nodist_dynamic_OBJECTS)
+dynamic_DEPENDENCIES = $(top_builddir)/src/libmbfly.la
+dynamic_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(dynamic_LDFLAGS) \
+	$(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(dynamic_SOURCES) $(nodist_dynamic_SOURCES)
+DIST_SOURCES = $(dynamic_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@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+XMKMF = @XMKMF@
+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_DUMPBIN = @ac_ct_DUMPBIN@
+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@
+cairo_CFLAGS = @cairo_CFLAGS@
+cairo_LIBS = @cairo_LIBS@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+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@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+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@
+INCLUDES = -I$(top_srcdir)/include
+EXTRA_DIST = menu.svg button.svg
+dynamic_SOURCES = main.c
+nodist_dynamic_SOURCES = menu.c menu.h button.c button.h
+dynamic_CPPFLAGS = @cairo_CFLAGS@ -I$(top_srcdir)
+dynamic_LDFLAGS = @cairo_LIBS@ 
+dynamic_LDADD = $(top_builddir)/src/libmbfly.la
+BUILT_SOURCES = menu.c menu.h menu.mb
+CLEANFILES = menu.c menu.h menu.mb
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/config.mk $(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) --foreign  examples/dynamic/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  examples/dynamic/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:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
+	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  echo " rm -f $$p $$f"; \
+	  rm -f $$p $$f ; \
+	done
+dynamic$(EXEEXT): $(dynamic_OBJECTS) $(dynamic_DEPENDENCIES) 
+	@rm -f dynamic$(EXEEXT)
+	$(dynamic_LINK) $(dynamic_OBJECTS) $(dynamic_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynamic-button.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynamic-main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynamic-menu.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+dynamic-main.o: main.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynamic-main.o -MD -MP -MF $(DEPDIR)/dynamic-main.Tpo -c -o dynamic-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/dynamic-main.Tpo $(DEPDIR)/dynamic-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='main.c' object='dynamic-main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dynamic-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+
+dynamic-main.obj: main.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynamic-main.obj -MD -MP -MF $(DEPDIR)/dynamic-main.Tpo -c -o dynamic-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/dynamic-main.Tpo $(DEPDIR)/dynamic-main.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='main.c' object='dynamic-main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dynamic-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+
+dynamic-menu.o: menu.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynamic-menu.o -MD -MP -MF $(DEPDIR)/dynamic-menu.Tpo -c -o dynamic-menu.o `test -f 'menu.c' || echo '$(srcdir)/'`menu.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/dynamic-menu.Tpo $(DEPDIR)/dynamic-menu.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='menu.c' object='dynamic-menu.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dynamic-menu.o `test -f 'menu.c' || echo '$(srcdir)/'`menu.c
+
+dynamic-menu.obj: menu.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynamic-menu.obj -MD -MP -MF $(DEPDIR)/dynamic-menu.Tpo -c -o dynamic-menu.obj `if test -f 'menu.c'; then $(CYGPATH_W) 'menu.c'; else $(CYGPATH_W) '$(srcdir)/menu.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/dynamic-menu.Tpo $(DEPDIR)/dynamic-menu.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='menu.c' object='dynamic-menu.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dynamic-menu.obj `if test -f 'menu.c'; then $(CYGPATH_W) 'menu.c'; else $(CYGPATH_W) '$(srcdir)/menu.c'; fi`
+
+dynamic-button.o: button.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynamic-button.o -MD -MP -MF $(DEPDIR)/dynamic-button.Tpo -c -o dynamic-button.o `test -f 'button.c' || echo '$(srcdir)/'`button.c
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/dynamic-button.Tpo $(DEPDIR)/dynamic-button.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='button.c' object='dynamic-button.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dynamic-button.o `test -f 'button.c' || echo '$(srcdir)/'`button.c
+
+dynamic-button.obj: button.c
+@am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynamic-button.obj -MD -MP -MF $(DEPDIR)/dynamic-button.Tpo -c -o dynamic-button.obj `if test -f 'button.c'; then $(CYGPATH_W) 'button.c'; else $(CYGPATH_W) '$(srcdir)/button.c'; fi`
+@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/dynamic-button.Tpo $(DEPDIR)/dynamic-button.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='button.c' object='dynamic-button.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dynamic_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dynamic-button.obj `if test -f 'button.c'; then $(CYGPATH_W) 'button.c'; else $(CYGPATH_W) '$(srcdir)/button.c'; fi`
+
+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: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) 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:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+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."
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	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-noinstPROGRAMS 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
+
+
+menu.mb: $(srcdir)/menu.svg
+	$(top_srcdir)/tools/svg2code.py $? $@
+
+menu.h: menu.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $@
+
+menu.c: menu.mb
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $@
+
+button.mb: $(srcdir)/button.svg
+	$(top_srcdir)/tools/svg2code.py $? $@
+
+button.h: button.mb
+	m4 -I $(top_srcdir)/tools mb_c_header.m4 $< > $@
+
+button.c: button.mb
+	m4 -I $(top_srcdir)/tools mb_c_source.m4 $< > $@
+# 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:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/dynamic/button.c	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,190 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <mb_types.h>
+#include <mb_redraw_man.h>
+#include <mb_shapes.h>
+#include <mb_paint.h>
+#include "button.h"
+
+button_t *button_new(redraw_man_t *rdman, coord_t *parent_coord) {
+    button_t *obj;
+    grad_stop_t *stops = NULL;
+    static const int n_linearGradient4066_stops = 2;
+    static const grad_stop_t linearGradient4066_stops[] = {
+	{0.000000,0.000000,0.000000,0.000000,0.000000},
+	{1.000000,0.000000,0.000000,0.000000,1.000000}};
+    static const int n_linearGradient4026_stops = 2;
+    static const grad_stop_t linearGradient4026_stops[] = {
+	{0.000000,0.000000,0.000000,0.000000,1.000000},
+	{1.000000,1.000000,1.000000,1.000000,0.000000}};
+    static const int n_linearGradient4018_stops = 2;
+    static const grad_stop_t linearGradient4018_stops[] = {
+	{0.000000,0.000000,0.000000,0.000000,1.000000},
+	{1.000000,0.000000,0.000000,1.000000,0.000000}};
+
+    obj = (button_t *)malloc(sizeof(button_t));
+    if(obj == NULL) return NULL;
+    obj->rdman = rdman;
+
+    obj->root_coord = rdman_coord_new(rdman, parent_coord);
+
+    obj->linearGradient4066 = rdman_paint_linear_new(rdman, 0.000000, 0.000000, 0.000000, 0.000000);
+    stops = (grad_stop_t *)malloc(sizeof(grad_stop_t) * n_linearGradient4066_stops);
+    memcpy(stops, linearGradient4066_stops, sizeof(grad_stop_t) * n_linearGradient4066_stops);
+    paint_linear_stops(obj->linearGradient4066, n_linearGradient4066_stops, stops);
+
+    obj->linearGradient4026 = rdman_paint_linear_new(rdman, 0.000000, 0.000000, 0.000000, 0.000000);
+    stops = (grad_stop_t *)malloc(sizeof(grad_stop_t) * n_linearGradient4026_stops);
+    memcpy(stops, linearGradient4026_stops, sizeof(grad_stop_t) * n_linearGradient4026_stops);
+    paint_linear_stops(obj->linearGradient4026, n_linearGradient4026_stops, stops);
+
+    obj->linearGradient4018 = rdman_paint_linear_new(rdman, 0.000000, 0.000000, 0.000000, 0.000000);
+    stops = (grad_stop_t *)malloc(sizeof(grad_stop_t) * n_linearGradient4018_stops);
+    memcpy(stops, linearGradient4018_stops, sizeof(grad_stop_t) * n_linearGradient4018_stops);
+    paint_linear_stops(obj->linearGradient4018, n_linearGradient4018_stops, stops);
+
+    obj->layer1 = rdman_coord_new(rdman, obj->root_coord);
+
+    obj->normal = rdman_coord_new(rdman, obj->layer1);
+    memset(obj->normal->matrix, 0, sizeof(obj->normal->matrix));
+    obj->normal->matrix[0] = 1;
+    obj->normal->matrix[2] = 460.000000;
+    obj->normal->matrix[4] = 1;
+    obj->normal->matrix[5] = 87.142857;
+    rdman_coord_changed(rdman, obj->normal);
+
+    obj->rect6048_coord = rdman_coord_new(rdman, obj->normal);
+    obj->rect6048_coord->matrix[0] = 0.374016;
+    obj->rect6048_coord->matrix[3] = 0.000000;
+    obj->rect6048_coord->matrix[1] = 0.000000;
+    obj->rect6048_coord->matrix[4] = 0.534091;
+    obj->rect6048_coord->matrix[2] = -66.074260;
+    obj->rect6048_coord->matrix[5] = -121.975700;
+    rdman_coord_changed(rdman, obj->rect6048_coord);
+
+    obj->rect6048 = rdman_shape_rect_new(rdman, 181.428570, 235.933610, 360.000000, 118.571430, 16.000000, 16.000000);
+
+    rdman_add_shape(rdman, obj->rect6048, obj->rect6048_coord);
+    obj->rect6048_fill = rdman_paint_color_new(rdman, 0.000000, 0.560784, 1.000000, 1.000000);
+    rdman_paint_fill(rdman, obj->rect6048_fill, obj->rect6048);
+
+    obj->rect6050 = rdman_shape_rect_new(rdman, 1.248565, 0.600819, 134.645690, 63.327908, 5.984253, 8.545453);
+
+    rdman_add_shape(rdman, obj->rect6050, obj->normal);
+    obj->rect6050_fill = rdman_paint_color_new(rdman, 0.000000, 0.560784, 1.000000, 1.000000);
+    rdman_paint_fill(rdman, obj->rect6050_fill, obj->rect6050);
+
+    obj->rect6052 = rdman_shape_rect_new(rdman, 0.714294, 0.219334, 134.645690, 63.327908, 5.984253, 8.545453);
+
+    rdman_add_shape(rdman, obj->rect6052, obj->normal);
+    obj->rect6052_fill = rdman_paint_color_new(rdman, 0.000000, 0.560784, 1.000000, 1.000000);
+    rdman_paint_fill(rdman, obj->rect6052_fill, obj->rect6052);
+
+    obj->tspan6056 = rdman_shape_text_new(rdman, "Line", 26.428562, 48.076523, 40.000000,
+    	      				  cairo_get_font_face(rdman->cr));
+    rdman_add_shape(rdman, obj->tspan6056, obj->normal);
+    obj->tspan6056_fill = rdman_paint_color_new(rdman, 1.000000, 1.000000, 1.000000, 1.000000);
+    rdman_paint_fill(rdman, obj->tspan6056_fill, obj->tspan6056);
+    obj->tspan6056->stroke_width = 1.000000;
+
+    obj->active = rdman_coord_new(rdman, obj->layer1);
+    memset(obj->active->matrix, 0, sizeof(obj->active->matrix));
+    obj->active->matrix[0] = 1;
+    obj->active->matrix[2] = 102.857140;
+    obj->active->matrix[4] = 1;
+    obj->active->matrix[5] = 85.714284;
+    rdman_coord_changed(rdman, obj->active);
+
+    obj->rect4074_coord = rdman_coord_new(rdman, obj->active);
+    obj->rect4074_coord->matrix[0] = 0.374016;
+    obj->rect4074_coord->matrix[3] = 0.000000;
+    obj->rect4074_coord->matrix[1] = 0.000000;
+    obj->rect4074_coord->matrix[4] = 0.534091;
+    obj->rect4074_coord->matrix[2] = -66.788541;
+    obj->rect4074_coord->matrix[5] = -122.689990;
+    rdman_coord_changed(rdman, obj->rect4074_coord);
+
+    obj->rect4074 = rdman_shape_rect_new(rdman, 181.428570, 235.933610, 360.000000, 118.571430, 16.000000, 16.000000);
+
+    rdman_add_shape(rdman, obj->rect4074, obj->rect4074_coord);
+    obj->rect4074_fill = rdman_paint_color_new(rdman, 0.000000, 0.000000, 1.000000, 1.000000);
+    rdman_paint_fill(rdman, obj->rect4074_fill, obj->rect4074);
+
+    obj->rect3240 = rdman_shape_rect_new(rdman, 0.534297, -0.113462, 134.645690, 63.327908, 5.984253, 8.545453);
+
+    rdman_add_shape(rdman, obj->rect3240, obj->active);
+    obj->rect3240_fill = rdman_paint_color_new(rdman, 0.000000, 0.000000, 1.000000, 1.000000);
+    rdman_paint_fill(rdman, obj->rect3240_fill, obj->rect3240);
+
+    obj->rect3242 = rdman_shape_rect_new(rdman, -0.000000, -0.494952, 134.645690, 63.327908, 5.984253, 8.545453);
+
+    rdman_add_shape(rdman, obj->rect3242, obj->active);
+    obj->rect3242_fill = rdman_paint_color_new(rdman, 0.000000, 0.000000, 1.000000, 1.000000);
+    rdman_paint_fill(rdman, obj->rect3242_fill, obj->rect3242);
+
+    obj->tspan4387 = rdman_shape_text_new(rdman, "Line", 25.714287, 47.362209, 40.000000,
+    	      				  cairo_get_font_face(rdman->cr));
+    rdman_add_shape(rdman, obj->tspan4387, obj->active);
+    obj->tspan4387_fill = rdman_paint_color_new(rdman, 1.000000, 1.000000, 1.000000, 1.000000);
+    rdman_paint_fill(rdman, obj->tspan4387_fill, obj->tspan4387);
+    obj->tspan4387->stroke_width = 1.000000;
+
+    obj->layer2 = rdman_coord_new(rdman, obj->root_coord);
+
+    return obj;
+}
+
+void button_free(button_t *obj) {
+    grad_stop_t *stops = NULL;
+    redraw_man_t *rdman;
+
+    rdman = obj->rdman;
+
+    rdman_paint_free(rdman, obj->tspan4387_fill);
+
+    rdman_shape_free(rdman, obj->tspan4387);
+
+    rdman_paint_free(rdman, obj->rect3242_fill);
+
+    rdman_shape_free(rdman, obj->rect3242);
+
+    rdman_paint_free(rdman, obj->rect3240_fill);
+
+    rdman_shape_free(rdman, obj->rect3240);
+
+    rdman_paint_free(rdman, obj->rect4074_fill);
+
+    rdman_shape_free(rdman, obj->rect4074);
+
+    rdman_paint_free(rdman, obj->tspan6056_fill);
+
+    rdman_shape_free(rdman, obj->tspan6056);
+
+    rdman_paint_free(rdman, obj->rect6052_fill);
+
+    rdman_shape_free(rdman, obj->rect6052);
+
+    rdman_paint_free(rdman, obj->rect6050_fill);
+
+    rdman_shape_free(rdman, obj->rect6050);
+
+    rdman_paint_free(rdman, obj->rect6048_fill);
+
+    rdman_shape_free(rdman, obj->rect6048);
+
+    stops = paint_linear_stops(obj->linearGradient4018, 0, NULL);
+    free(stops);
+    rdman_paint_free(rdman, obj->linearGradient4018);
+
+    stops = paint_linear_stops(obj->linearGradient4026, 0, NULL);
+    free(stops);
+    rdman_paint_free(rdman, obj->linearGradient4026);
+
+    stops = paint_linear_stops(obj->linearGradient4066, 0, NULL);
+    free(stops);
+    rdman_paint_free(rdman, obj->linearGradient4066);
+
+    rdman_coord_subtree_free(rdman, obj->root_coord);
+    free(obj);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/dynamic/button.h	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,64 @@
+#ifndef __button_H_
+#define __button_H_
+
+typedef struct button button_t;
+
+struct button {
+    redraw_man_t *rdman;
+    coord_t *root_coord;
+
+    paint_t *linearGradient4066;
+
+    paint_t *linearGradient4026;
+
+    paint_t *linearGradient4018;
+
+    coord_t *layer1;
+
+    coord_t *normal;
+
+    coord_t *rect6048_coord;
+
+    shape_t *rect6048;
+
+    paint_t *rect6048_fill;
+
+    shape_t *rect6050;
+
+    paint_t *rect6050_fill;
+
+    shape_t *rect6052;
+
+    paint_t *rect6052_fill;
+
+    shape_t *tspan6056;
+
+    paint_t *tspan6056_fill;
+
+    coord_t *active;
+
+    coord_t *rect4074_coord;
+
+    shape_t *rect4074;
+
+    paint_t *rect4074_fill;
+
+    shape_t *rect3240;
+
+    paint_t *rect3240_fill;
+
+    shape_t *rect3242;
+
+    paint_t *rect3242_fill;
+
+    shape_t *tspan4387;
+
+    paint_t *tspan4387_fill;
+
+    coord_t *layer2;
+};
+
+extern button_t *button_new(redraw_man_t *rdman, coord_t *parent_coord);
+extern void button_free(button_t *obj);
+
+#endif /* __button_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/dynamic/button.mb	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,59 @@
+MADBUTTERFLY([button],[dnl
+ADD_LINEAR_PAINT([linearGradient4066], 0.000000, 0.000000, 0.000000, 0.000000, [
+[COLOR_STOP([linearGradient4066], 0.000000, 0.000000, 0.000000, 0.000000, 0.000000)], [COLOR_STOP([linearGradient4066], 0.000000, 0.000000, 0.000000, 1.000000, 1.000000)]dnl
+])dnl
+ADD_LINEAR_PAINT([linearGradient4026], 0.000000, 0.000000, 0.000000, 0.000000, [
+[COLOR_STOP([linearGradient4026], 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)], [COLOR_STOP([linearGradient4026], 1.000000, 1.000000, 1.000000, 0.000000, 1.000000)]dnl
+])dnl
+ADD_LINEAR_PAINT([linearGradient4018], 0.000000, 0.000000, 0.000000, 0.000000, [
+[COLOR_STOP([linearGradient4018], 0.000000, 0.000000, 0.000000, 1.000000, 0.000000)], [COLOR_STOP([linearGradient4018], 0.000000, 0.000000, 1.000000, 0.000000, 1.000000)]dnl
+])dnl
+dnl
+ADD_COORD([layer1], [root_coord])dnl
+define([MB_FONT_SZ], 30.000000)dnl
+define([MB_FONT_SZ], 30.000000)dnl
+dnl
+ADD_COORD([normal], [layer1])dnl
+COORD_TRANSLATE([normal], 460.000000, 87.142857)dnl
+dnl
+ADD_COORD([rect6048_coord], [normal])dnl
+SHAPE_MATRIX([rect6048_coord], 0.374016, 0.000000, 0.000000, 0.534091, -66.074260, -121.975700)dnl
+dnl
+ADD_RECT([rect6048], 181.428570, 235.933610, 360.000000, 118.571430, 16.000000, 16.000000, [rect6048_coord])dnl
+FILL_SHAPE([rect6048], 0.000000, 0.560784, 1.000000, 1.000000)dnl
+dnl
+ADD_RECT([rect6050], 1.248565, 0.600819, 134.645690, 63.327908, 5.984253, 8.545453, [normal])dnl
+FILL_SHAPE([rect6050], 0.000000, 0.560784, 1.000000, 1.000000)dnl
+dnl
+ADD_RECT([rect6052], 0.714294, 0.219334, 134.645690, 63.327908, 5.984253, 8.545453, [normal])dnl
+FILL_SHAPE([rect6052], 0.000000, 0.560784, 1.000000, 1.000000)dnl
+define([MB_FONT_SZ], 40.000000)dnl
+define([MB_FONT_SZ], 40.000000)dnl
+dnl
+ADD_TEXT([tspan6056], [Line], 26.428562, 48.076523, MB_FONT_SZ, [normal])dnl
+FILL_SHAPE([tspan6056], 1.000000, 1.000000, 1.000000, 1.000000)dnl
+STROKE_WIDTH([tspan6056], 1.000000)dnl
+dnl
+ADD_COORD([active], [layer1])dnl
+COORD_TRANSLATE([active], 102.857140, 85.714284)dnl
+dnl
+ADD_COORD([rect4074_coord], [active])dnl
+SHAPE_MATRIX([rect4074_coord], 0.374016, 0.000000, 0.000000, 0.534091, -66.788541, -122.689990)dnl
+dnl
+ADD_RECT([rect4074], 181.428570, 235.933610, 360.000000, 118.571430, 16.000000, 16.000000, [rect4074_coord])dnl
+FILL_SHAPE([rect4074], 0.000000, 0.000000, 1.000000, 1.000000)dnl
+dnl
+ADD_RECT([rect3240], 0.534297, -0.113462, 134.645690, 63.327908, 5.984253, 8.545453, [active])dnl
+FILL_SHAPE([rect3240], 0.000000, 0.000000, 1.000000, 1.000000)dnl
+dnl
+ADD_RECT([rect3242], -0.000000, -0.494952, 134.645690, 63.327908, 5.984253, 8.545453, [active])dnl
+FILL_SHAPE([rect3242], 0.000000, 0.000000, 1.000000, 1.000000)dnl
+define([MB_FONT_SZ], 40.000000)dnl
+define([MB_FONT_SZ], 40.000000)dnl
+dnl
+ADD_TEXT([tspan4387], [Line], 25.714287, 47.362209, MB_FONT_SZ, [active])dnl
+FILL_SHAPE([tspan4387], 1.000000, 1.000000, 1.000000, 1.000000)dnl
+STROKE_WIDTH([tspan4387], 1.000000)dnl
+dnl
+ADD_COORD([layer2], [root_coord])dnl
+])dnl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/dynamic/button.svg	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="button.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.7"
+     inkscape:cx="239.91999"
+     inkscape:cy="667.92389"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1400"
+     inkscape:window-height="978"
+     inkscape:window-x="0"
+     inkscape:window-y="25" />
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient4066">
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="0"
+         id="stop4068" />
+      <stop
+         style="stop-color:#000000;stop-opacity:1"
+         offset="1"
+         id="stop4070" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient4026">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop4028" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop4030" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient4018">
+      <stop
+         style="stop-color:#000000;stop-opacity:1;"
+         offset="0"
+         id="stop4020" />
+      <stop
+         style="stop-color:#0000ff;stop-opacity:0;"
+         offset="1"
+         id="stop4022" />
+    </linearGradient>
+    <inkscape:perspective
+       id="perspective10"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <filter
+       inkscape:collect="always"
+       id="filter4376"
+       x="-0.035928786"
+       width="1.0718576"
+       y="-0.10908499"
+       height="1.21817">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="5.3893179"
+         id="feGaussianBlur4378" />
+    </filter>
+    <filter
+       inkscape:collect="always"
+       id="filter4833">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="1.0722832"
+         id="feGaussianBlur4835" />
+    </filter>
+  </defs>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>Image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:groupmode="layer"
+     inkscape:label="bg"
+     style="display:inline">
+    <text
+       xml:space="preserve"
+       style="font-size:30px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="235.71429"
+       y="282.36218"
+       id="text4380"><tspan
+         sodipodi:role="line"
+         id="tspan4382"
+         x="235.71429"
+         y="282.36218" /></text>
+    <g
+       id="normal"
+       inkscape:label="#g6113"
+       transform="translate(460,87.142857)">
+      <rect
+         transform="matrix(0.3740158,0,0,0.5340908,-66.07426,-121.9757)"
+         ry="16"
+         rx="16"
+         y="235.93361"
+         x="181.42857"
+         height="118.57143"
+         width="360"
+         id="rect6048"
+         style="fill:#008fff;fill-opacity:1;filter:url(#filter4376)" />
+      <rect
+         ry="8.5454531"
+         rx="5.9842529"
+         y="0.60081911"
+         x="1.2485654"
+         height="63.327908"
+         width="134.64569"
+         id="rect6050"
+         style="fill:#008fff;fill-opacity:1" />
+      <rect
+         ry="8.5454531"
+         rx="5.9842529"
+         y="0.21933411"
+         x="0.7142942"
+         height="63.327908"
+         width="134.64569"
+         id="rect6052"
+         style="fill:#008fff;fill-opacity:1" />
+      <text
+         inkscape:label="#text4385"
+         id="text6054"
+         y="48.076523"
+         x="26.428562"
+         style="font-size:40px;font-style:normal;font-weight:normal;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;filter:url(#filter4833);font-family:Bitstream Vera Sans"
+         xml:space="preserve"><tspan
+           y="48.076523"
+           x="26.428562"
+           id="tspan6056"
+           sodipodi:role="line">Line</tspan></text>
+    </g>
+    <g
+       id="active"
+       inkscape:label="#g6103"
+       transform="translate(102.85714,85.714284)">
+      <rect
+         transform="matrix(0.3740158,0,0,0.5340908,-66.788541,-122.68999)"
+         ry="16"
+         rx="16"
+         y="235.93361"
+         x="181.42857"
+         height="118.57143"
+         width="360"
+         id="rect4074"
+         style="fill:#0000ff;filter:url(#filter4376)" />
+      <rect
+         ry="8.5454531"
+         rx="5.9842529"
+         y="-0.11346204"
+         x="0.53429729"
+         height="63.327908"
+         width="134.64569"
+         id="rect3240"
+         style="fill:#0000ff" />
+      <rect
+         ry="8.5454531"
+         rx="5.9842529"
+         y="-0.49495196"
+         x="-3.9397582e-07"
+         height="63.327908"
+         width="134.64569"
+         id="rect3242"
+         style="fill:#0000ff;fill-opacity:1" />
+      <text
+         inkscape:label="#text4385"
+         id="title"
+         y="47.362209"
+         x="25.714287"
+         style="font-size:40px;font-style:normal;font-weight:normal;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter4833);font-family:Bitstream Vera Sans"
+         xml:space="preserve"><tspan
+           y="47.362209"
+           x="25.714287"
+           id="tspan4387"
+           sodipodi:role="line">Line</tspan></text>
+    </g>
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="text"
+     style="display:inline" />
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/dynamic/main.c	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,201 @@
+/*! \file
+ *
+ * svg2code_ex is an example that show programmers how to create a
+ * menu with MadButterfly.
+ *
+ */
+#include <stdio.h>
+#include <mb.h>
+#include "menu.h"
+#include "button.h"
+
+
+typedef struct _engine engine_t;
+struct _engine {
+    X_MB_runtime_t *rt;
+    redraw_man_t *rdman;
+    menu_t *menu;
+    button_t *button;
+    int state;
+    co_aix orx,ory;
+    int start_x,start_y;
+    observer_t *obs1,*obs2;
+    shape_t *rect;
+    co_aix rx,ry;
+};
+engine_t *engine_init()
+{
+
+    X_MB_runtime_t *rt;
+    rt = X_MB_new(":0.0", 800, 600);
+    engine_t *en = (engine_t *) malloc(sizeof(engine_t));
+
+    en->rt = rt;
+    en->rdman =  X_MB_rdman(rt);
+    return en;
+}
+
+void engine_close(engine_t *en)
+{
+    /*
+     * Start handle connections, includes one to X server.
+     * User start to interact with the application.
+     */
+    X_MB_handle_connection(en->rt);
+
+    /*
+     * Clean
+     */
+    menu_free(en->menu);
+    X_MB_free(en->rt);
+    free(en);
+}
+#define COORD_SHOW(group) coord_show(group);rdman_coord_changed(en->rdman, group)
+#define COORD_HIDE(group) coord_hide(group);rdman_coord_changed(en->rdman, group)
+
+#define CMOUSE(e) (coord_get_mouse_event(e))
+
+
+
+static void button_move(event_t *evt, void *arg) 
+{
+    engine_t *en = (engine_t *) arg;
+
+    
+    printf("Mouse move\n");
+    COORD_SHOW(en->button->active);
+    rdman_coord_changed(en->rdman,en->button->root_coord);
+    rdman_redraw_changed(en->rdman);
+}
+static void button_out(event_t *evt, void *arg) 
+{
+    engine_t *en = (engine_t *) arg;
+
+    printf("mouse out\n");
+    COORD_HIDE(en->button->active);
+    rdman_coord_changed(en->rdman,en->button->root_coord);
+    rdman_redraw_changed(en->rdman);
+}
+
+void button_pressed(event_t *evt, void *arg)
+{
+	printf("Pressed\n");
+}
+
+void engine_add_button(engine_t *en, coord_t *normal, coord_t *active, void (*func)())
+{
+    active->matrix[2] = 200;
+    active->matrix[5] = 200;
+    normal->matrix[2] = 200;
+    normal->matrix[5] = 200;
+    COORD_HIDE(en->button->active);
+    rdman_coord_changed(en->rdman,en->button->root_coord);
+    rdman_redraw_changed(en->rdman);
+    subject_add_event_observer(CMOUSE(normal), EVT_MOUSE_MOVE, button_move,en);
+    subject_add_event_observer(CMOUSE(active), EVT_MOUSE_OUT, button_out,en);
+    subject_add_event_observer(CMOUSE(active), EVT_MOUSE_BUT_RELEASE, button_pressed,en);
+}
+
+
+void coord_move(coord_t *c, co_aix x, co_aix y)
+{
+    c->matrix[2] = x;
+    c->matrix[5] = y;
+}
+
+
+
+static void add_rect_move(event_t *evt, void *arg) 
+{
+    engine_t *en = (engine_t *) arg;
+    mouse_event_t *mev = (mouse_event_t *) evt;
+
+    printf("resize rectangle\n");
+    sh_rect_set(en->rect, en->start_x, en->start_y, mev->x - en->start_x, mev->y-en->start_y,en->rx,en->ry);
+    rdman_shape_changed(en->rdman,en->rect);
+    rdman_redraw_changed(en->rdman);
+}
+
+static void add_rect_release(event_t *evt, void *arg) 
+{
+    engine_t *en = (engine_t *) arg;
+    mouse_event_t *mev = (mouse_event_t *) evt;
+
+    printf("rectangle done\n");
+    subject_remove_observer(CMOUSE(en->rdman->root_coord), en->obs1);
+    subject_remove_observer(CMOUSE(en->rdman->root_coord), en->obs2);
+}
+
+static void add_rect_2(event_t *evt, void *arg) 
+{
+    engine_t *en = (engine_t *) arg;
+    mouse_event_t *mev = (mouse_event_t *) evt;
+    paint_t *color;
+
+    printf("select first point\n");
+    // Add an rect path 
+
+    en->start_x = mev->x;
+    en->start_y = mev->y;
+    subject_remove_observer(CMOUSE(en->rdman->root_coord), en->obs1);
+    subject_remove_observer(CMOUSE(en->rdman->root_coord), en->obs2);
+    en->obs1 = subject_add_event_observer(CMOUSE(en->rdman->root_coord), EVT_MOUSE_MOVE, add_rect_move, en);
+    en->obs2 = subject_add_event_observer(CMOUSE(en->rdman->root_coord), EVT_MOUSE_BUT_RELEASE, add_rect_release, en);
+}
+
+static void add_rect_2_move(event_t *evt, void *arg) 
+{
+    engine_t *en = (engine_t *) arg;
+    mouse_event_t *mev = (mouse_event_t *) evt;
+
+    sh_rect_set(en->rect, mev->x, mev->y, 50,50,en->rx,en->ry);
+    rdman_shape_changed(en->rdman,en->rect);
+    rdman_redraw_changed(en->rdman);
+}
+
+static void add_rect(event_t *evt, void *arg) 
+{
+    engine_t *en = (engine_t *) arg;
+    mouse_event_t *mev = (mouse_event_t *) evt;
+    paint_t *color;
+
+    printf("menut selected\n");
+    en->obs1 = subject_add_event_observer(CMOUSE(en->rdman->root_coord), EVT_MOUSE_BUT_PRESS, add_rect_2, en);
+    en->obs2 = subject_add_event_observer(CMOUSE(en->rdman->root_coord), EVT_MOUSE_MOVE, add_rect_2_move, en);
+    en->rect = rdman_shape_rect_new(en->rdman, mev->x, mev->y, 50 , 50, en->rx, en->ry);
+    // Paint it with color
+    color = rdman_paint_color_new(en->rdman, 0.800000, 0.800000, 0.400000, 1.000000);
+    rdman_paint_fill(en->rdman, color, en->rect);
+    // Add to the stage
+    rdman_add_shape(en->rdman, en->rect, en->menu->root_coord);
+}
+
+
+
+
+
+int main(int argc, char * const argv[]) {
+    subject_t *subject;
+    engine_t *en;
+
+    en = engine_init();
+    en->menu = menu_new(en->rdman, en->rdman->root_coord);
+    en->button = button_new(en->rdman, en->rdman->root_coord);
+    engine_add_button(en, en->button->normal, en->button->active, button_pressed);
+
+    en->rx = 0;
+    en->ry = 0;
+
+    /*
+     * Register observers to subjects of events for objects.
+     */
+    subject = coord_get_mouse_event(en->menu->rect);
+    subject_add_event_observer(subject,  EVT_MOUSE_BUT_RELEASE, add_rect, en);
+
+
+    engine_close(en);
+
+    return 0;
+}
+
+/* vim: set ts=4 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/dynamic/menu.svg	Tue Dec 09 23:34:05 2008 +0800
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="640"
+   height="480"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="menu.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.7"
+     inkscape:cx="375"
+     inkscape:cy="226.6652"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="645"
+     inkscape:window-height="725"
+     inkscape:window-x="428"
+     inkscape:window-y="176" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <rect
+       style="fill:#cccccc"
+       id="rect2384"
+       width="617.14288"
+       height="460"
+       x="10"
+       y="5.7142859"
+       rx="5.4543843"
+       ry="7.1427469" />
+    <g
+       id="rect"
+       inkscape:label="#g2389">
+      <rect
+         ry="7.1427469"
+         rx="5.4543843"
+         y="13.049243"
+         x="40.192101"
+         height="52.472942"
+         width="118.18723"
+         id="rect2383"
+         style="fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1.38420188px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <text
+         id="text2385"
+         y="50"
+         x="55.714287"
+         style="font-size:40px;font-style:normal;font-weight:normal;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+         xml:space="preserve"><tspan
+           y="50"
+           x="55.714287"
+           id="tspan2387"
+           sodipodi:role="line">rect</tspan></text>
+    </g>
+  </g>
+</svg>
--- a/examples/svg2code_ex/main.c	Tue Dec 09 17:34:10 2008 +0800
+++ b/examples/svg2code_ex/main.c	Tue Dec 09 23:34:05 2008 +0800
@@ -14,34 +14,23 @@
     svg2code_ex_t *code;
 };
 
+#define COORD_SHOW(group) coord_show(group);rdman_coord_changed(X_MB_rdman(ex_rt->rt), group)
+#define COORD_HIDE(group) coord_hide(group);rdman_coord_changed(X_MB_rdman(ex_rt->rt), group)
+
 static void file_button_handler(event_t *evt, void *arg) {
     ex_rt_t *ex_rt = (ex_rt_t *)arg;
 
-    switch(evt->type) {
-    case EVT_MOUSE_BUT_PRESS:
-	coord_show(ex_rt->code->file_menu);
-	/* Tell redraw manager that a coord (group) is chagned. */
-	rdman_coord_changed(X_MB_rdman(ex_rt->rt), ex_rt->code->file_menu);
-	/* Update changed part to UI. */
-	rdman_redraw_changed(X_MB_rdman(ex_rt->rt));
-	break;
-    }
+    COORD_SHOW(ex_rt->code->file_menu);
+    /* Update changed part to UI. */
+    rdman_redraw_changed(X_MB_rdman(ex_rt->rt));
 }
 
 static void file_menu_handler(event_t *evt, void *arg) {
     ex_rt_t *ex_rt = (ex_rt_t *)arg;
-    redraw_man_t *rdman;
 
-    rdman = X_MB_rdman(ex_rt->rt);
-    switch(evt->type) {
-    case EVT_MOUSE_BUT_PRESS:
-	coord_hide(ex_rt->code->file_menu);
-	/* Tell redraw manager that a coord (group) is chagned. */
-	rdman_coord_changed(rdman, ex_rt->code->file_menu);
-	/* Update changed part to UI. */
-	rdman_redraw_changed(rdman);
-	break;
-    }
+    COORD_HIDE(ex_rt->code->file_menu);
+    /* Update changed part to UI. */
+    rdman_redraw_changed(X_MB_rdman(ex_rt->rt));
 }
 
 int main(int argc, char * const argv[]) {
@@ -68,9 +57,9 @@
     subject = coord_get_mouse_event(svg2code->file_button);
     ex_rt.rt = rt;
     ex_rt.code = svg2code;
-    subject_add_observer(subject, file_button_handler, &ex_rt);
+    subject_add_event_observer(subject,  EVT_MOUSE_BUT_PRESS, file_button_handler, &ex_rt);
     subject = coord_get_mouse_event(svg2code->file_menu);
-    subject_add_observer(subject, file_menu_handler, &ex_rt);
+    subject_add_event_observer(subject,  EVT_MOUSE_BUT_PRESS,  file_menu_handler, &ex_rt);
 
     /*
      * Start handle connections, includes one to X server.
--- a/include/mb_observer.h	Tue Dec 09 17:34:10 2008 +0800
+++ b/include/mb_observer.h	Tue Dec 09 23:34:05 2008 +0800
@@ -20,6 +20,7 @@
  * A target for receiving events.
  */
 struct _observer {
+    int type;
     evt_handler hdr;
     void *arg;
     observer_t *next;
@@ -71,7 +72,7 @@
 				     subject_t *cur_subject);
 };
 
-enum {EVT_MOUSE_OVER, EVT_MOUSE_OUT, EVT_MOUSE_MOVE,
+enum {EVT_ANY,EVT_MOUSE_OVER, EVT_MOUSE_OUT, EVT_MOUSE_MOVE,
       EVT_MOUSE_BUT_PRESS, EVT_MOUSE_BUT_RELEASE,
       EVT_KB_PRESS, EVT_KB_RELEASE, EVT_PROGM_COMPLETE,
       EVT_RDMAN_REDRAW };
--- a/include/mb_shapes.h	Tue Dec 09 17:34:10 2008 +0800
+++ b/include/mb_shapes.h	Tue Dec 09 23:34:05 2008 +0800
@@ -39,6 +39,7 @@
  * @{
  */
 extern shape_t *rdman_shape_path_new(redraw_man_t *rdman, char *data);
+extern shape_t *rdman_shape_path_new_from_binary(redraw_man_t *rdman, char *commands, co_aix *arg,int  arg_cnt,int *fix_arg,int fix_arg_cnt);
 extern void sh_path_transform(shape_t *shape);
 extern void sh_path_draw(shape_t *shape, cairo_t *cr);
 /* @} */
--- a/src/observer.c	Tue Dec 09 17:34:10 2008 +0800
+++ b/src/observer.c	Tue Dec 09 23:34:05 2008 +0800
@@ -66,7 +66,8 @@
 	for(observer = STAILQ_HEAD(subject->observers);
 	    observer != NULL;
 	    observer = STAILQ_NEXT(observer_t, next, observer)) {
-	    observer->hdr(evt, observer->arg);
+	    if (observer->type == EVT_ANY || observer->type == evt->type)
+		    observer->hdr(evt, observer->arg);
 	}
 
 	subject->flags &= ~SUBF_BUSY;
@@ -92,6 +93,24 @@
 	return NULL;
     observer->hdr = hdr;
     observer->arg = arg;
+    observer->type = EVT_ANY;
+
+    STAILQ_INS_TAIL(subject->observers, observer_t, next, observer);
+
+    return observer;
+}
+
+observer_t *subject_add_event_observer(subject_t *subject, int type,
+				 evt_handler hdr, void *arg) {
+    ob_factory_t *factory = subject->factory;
+    observer_t *observer;
+
+    observer = factory->observer_alloc(factory);
+    if(observer == NULL)
+	return NULL;
+    observer->hdr = hdr;
+    observer->arg = arg;
+    observer->type = type;
 
     STAILQ_INS_TAIL(subject->observers, observer_t, next, observer);
 
--- a/src/shape_path.c	Tue Dec 09 17:34:10 2008 +0800
+++ b/src/shape_path.c	Tue Dec 09 23:34:05 2008 +0800
@@ -713,6 +713,42 @@
     return (shape_t *)path;
 }
 
+shape_t *rdman_shape_path_new_from_binary(redraw_man_t *rdman, char *commands, co_aix *arg,int  arg_cnt,int *fix_arg,int fix_arg_cnt) {
+    sh_path_t *path;
+    int msz;
+    int cmd_cnt = strlen(commands);
+
+    /*! \todo Use elmpool to manage sh_path_t objects. */
+    path = (sh_path_t *)malloc(sizeof(sh_path_t));
+    /*! \todo Remove this memset()? */
+    memset(&path->shape, 0, sizeof(shape_t));
+    MBO_TYPE(path) = MBO_PATH;
+    path->cmd_len = strlen(commands);
+    path->arg_len = arg_cnt;
+    path->fix_arg_len = fix_arg_cnt;
+    msz = cmd_cnt + sizeof(co_aix) * arg_cnt + sizeof(int) * fix_arg_cnt;
+    path->user_data = (char *)malloc(msz * 2);
+    if(path->user_data == NULL) {
+	free(path);
+	return NULL;
+    }
+
+    path->dev_data = path->user_data + msz;
+    memcpy(path->user_data,commands,cmd_cnt);
+    memcpy(path->user_data+cmd_cnt,arg, sizeof(co_aix)*arg_cnt);
+    memcpy(path->user_data+cmd_cnt+arg_cnt*sizeof(co_aix),fix_arg, sizeof(int)*fix_arg_cnt);
+    memcpy(path->dev_data, path->user_data, msz);
+
+    path->shape.free = sh_path_free;
+
+#ifndef UNITTEST
+    rdman_shape_man(rdman, (shape_t *)path);
+#endif
+
+    return (shape_t *)path;
+}
+
+
 /*! \brief Transform a path from user space to device space.
  *
  */
--- a/tools/mb_c_source.m4	Tue Dec 09 17:34:10 2008 +0800
+++ b/tools/mb_c_source.m4	Tue Dec 09 23:34:05 2008 +0800
@@ -86,12 +86,18 @@
 
 define([S_ADD_RECT],[[
     obj->$1 = rdman_shape_rect_new(rdman, $2, $3, $4, $5, $6, $7);
+
     rdman_add_shape(rdman, obj->$1, obj->$8);
 ]])
 
 define([S_ADD_PATH],[[
-    obj->$1 = rdman_shape_path_new(rdman, "$2");
-    rdman_add_shape(rdman, obj->$1, obj->$3);
+    {
+        char _cmds[] = "$3";
+        float _args[] = {$4};
+        int _fix_args[] = {$6};
+        obj->$1 = rdman_shape_path_new_from_binary(rdman, _cmds,_args,$5,_fix_args,$7);
+        rdman_add_shape(rdman, obj->$1, obj->$2);
+    }
 ]])
 
 define([S_ADD_COORD],[[
--- a/tools/svg2code.py	Tue Dec 09 17:34:10 2008 +0800
+++ b/tools/svg2code.py	Tue Dec 09 23:34:05 2008 +0800
@@ -210,13 +210,82 @@
         pass
     return coord_id
 
+# M x y             : Move to (x,y)
+# Z                 : close path
+# L x y             : lineto (x,y)
+# H x               : horizontal line to x
+# V y               : Vertical line to y
+# C x1 y1 x2 y2 x y : Draw a segment of bezier curve
+# S x2 y2 x t       : Draw a segment of bezier curve from the last control point
+# Q x1 y1 x y       : Draw a segment of quadratic curve
+# T x y             : Draw a segment of quadratic curve from the last control pint
+# A x y r f s x y   : Draw an arc
+# translate the path data into two arrays. The first is an integer whose upper 8
+# bits are the command type The second array hold all arguments.
+
+command_length={'M': 2, 'm':2,
+                'Z': 0, 'z':0,
+                'L': 2, 'l':2,
+                'H': 1, 'h':1,
+                'V': 1, 'v':1,
+                'C': 6, 'c':6,
+                'S': 4, 's':4,
+                'Q': 4, 'q':4,
+                'T': 2, 't':2}
+
+
+def translate_path_data(data,codefo):
+    temp = data.split()
+    fields=[]
+    for f in temp:
+        for s in f.split(','):
+            if s != '':
+                fields.append(s)
+    cmd = ''
+    commands=''
+    args=[]
+    fix_args=[]
+    for f in fields:
+        if cmd == 'A' or cmd == 'a':
+            try:
+                d = int(f)
+                fix_args.append(d)
+                if (narg % 7) == 0:
+                    commands = commands + cmd
+                narg = narg + 1
+            except:
+	        pass
+        else:
+            try:
+	        d = float(f)
+            	args.append(d)
+            	if (narg % command_length[cmd]) == 0:
+                    commands = commands + cmd
+            	narg = narg + 1
+            	continue
+            except:
+                pass
+        cmd = f
+        narg=0
+    pass
+    return [commands,args,fix_args]
+
 def translate_path(path, coord_id, codefo, doc):
     coord_id = translate_shape_transform(path, coord_id, codefo)
 
     path_id = path.getAttribute('id')
     d = path.getAttribute('d')
+    (commands,args,fix_args) = translate_path_data(d,codefo)
     print >> codefo, 'dnl'
-    print >> codefo, 'ADD_PATH([%s], [%s], [%s])dnl' % (path_id, d, coord_id)
+    #print >> codefo, 'ADD_PATH([%s], [%s], [%s])dnl' % (path_id, d, coord_id)
+    sarg=''
+    for c in args:
+        sarg = sarg + "%f," % c
+    s_fix_arg=''
+    for c in fix_args:
+        s_fix_arg = s_fix_arg + ("%d," % c)
+
+    print >> codefo, 'ADD_PATH([%s], [%s],[%s],[%s],[%d],[%s],[%d])dnl' % (path_id, coord_id,commands,sarg,len(args),s_fix_arg,len(fix_args))
 
     translate_style(path, coord_id, codefo, doc, 'PATH_')
     pass