imported D-Bus C++ library
git-svn-id: http://dev.openwengo.org/svn/openwengo/wengophone-ng/branches/wengophone-dbus-api/libs/dbus@7382 30a43799-04e7-0310-8b2b-ea0d24f86d0e
This commit is contained in:
commit
acfeb85b87
89 changed files with 92818 additions and 0 deletions
10
tools/Makefile.am
Normal file
10
tools/Makefile.am
Normal file
|
@ -0,0 +1,10 @@
|
|||
INCLUDES = $(dbus_CFLAGS) -I$(top_srcdir)/include
|
||||
AM_CPPFLAGS = -DDBUS_API_SUBJECT_TO_CHANGE
|
||||
|
||||
bin_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect
|
||||
|
||||
dbusxx_xml2cpp_SOURCES = xml2cpp.h xml2cpp.cpp
|
||||
dbusxx_xml2cpp_LDADD = $(dbus_LIBS) $(top_builddir)/src/libdbus-c++-0.3.la
|
||||
|
||||
dbusxx_introspect_SOURCES = introspect.h introspect.cpp
|
||||
dbusxx_introspect_LDADD = $(top_builddir)/src/libdbus-c++-0.3.la
|
475
tools/Makefile.in
Normal file
475
tools/Makefile.in
Normal file
|
@ -0,0 +1,475 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 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@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
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@
|
||||
bin_PROGRAMS = dbusxx-xml2cpp$(EXEEXT) dbusxx-introspect$(EXEEXT)
|
||||
subdir = tools
|
||||
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 = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/dbus-c++/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_dbusxx_introspect_OBJECTS = introspect.$(OBJEXT)
|
||||
dbusxx_introspect_OBJECTS = $(am_dbusxx_introspect_OBJECTS)
|
||||
dbusxx_introspect_DEPENDENCIES = \
|
||||
$(top_builddir)/src/libdbus-c++-0.3.la
|
||||
am_dbusxx_xml2cpp_OBJECTS = xml2cpp.$(OBJEXT)
|
||||
dbusxx_xml2cpp_OBJECTS = $(am_dbusxx_xml2cpp_OBJECTS)
|
||||
am__DEPENDENCIES_1 =
|
||||
dbusxx_xml2cpp_DEPENDENCIES = $(am__DEPENDENCIES_1) \
|
||||
$(top_builddir)/src/libdbus-c++-0.3.la
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include/dbus-c++
|
||||
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 --mode=compile $(CXX) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
|
||||
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(dbusxx_introspect_SOURCES) $(dbusxx_xml2cpp_SOURCES)
|
||||
DIST_SOURCES = $(dbusxx_introspect_SOURCES) $(dbusxx_xml2cpp_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
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@
|
||||
DBUS_DOXYGEN_DOCS_ENABLED_FALSE = @DBUS_DOXYGEN_DOCS_ENABLED_FALSE@
|
||||
DBUS_DOXYGEN_DOCS_ENABLED_TRUE = @DBUS_DOXYGEN_DOCS_ENABLED_TRUE@
|
||||
DEBUG_FLAGS = @DEBUG_FLAGS@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
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@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
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@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
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@
|
||||
datadir = @datadir@
|
||||
dbus_CFLAGS = @dbus_CFLAGS@
|
||||
dbus_LIBS = @dbus_LIBS@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
xml_CFLAGS = @xml_CFLAGS@
|
||||
xml_LIBS = @xml_LIBS@
|
||||
INCLUDES = $(dbus_CFLAGS) -I$(top_srcdir)/include
|
||||
AM_CPPFLAGS = -DDBUS_API_SUBJECT_TO_CHANGE
|
||||
dbusxx_xml2cpp_SOURCES = xml2cpp.h xml2cpp.cpp
|
||||
dbusxx_xml2cpp_LDADD = $(dbus_LIBS) $(top_builddir)/src/libdbus-c++-0.3.la
|
||||
dbusxx_introspect_SOURCES = introspect.h introspect.cpp
|
||||
dbusxx_introspect_LDADD = $(top_builddir)/src/libdbus-c++-0.3.la
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(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 tools/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu tools/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
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
|| test -f $$p1 \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
dbusxx-introspect$(EXEEXT): $(dbusxx_introspect_OBJECTS) $(dbusxx_introspect_DEPENDENCIES)
|
||||
@rm -f dbusxx-introspect$(EXEEXT)
|
||||
$(CXXLINK) $(dbusxx_introspect_LDFLAGS) $(dbusxx_introspect_OBJECTS) $(dbusxx_introspect_LDADD) $(LIBS)
|
||||
dbusxx-xml2cpp$(EXEEXT): $(dbusxx_xml2cpp_OBJECTS) $(dbusxx_xml2cpp_DEPENDENCIES)
|
||||
@rm -f dbusxx-xml2cpp$(EXEEXT)
|
||||
$(CXXLINK) $(dbusxx_xml2cpp_LDFLAGS) $(dbusxx_xml2cpp_OBJECTS) $(dbusxx_xml2cpp_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/introspect.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml2cpp.Po@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@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@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@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@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@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 $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
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; } \
|
||||
END { 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; } \
|
||||
END { 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=; \
|
||||
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; } \
|
||||
END { 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)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
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 $(PROGRAMS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
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-binPROGRAMS clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
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: uninstall-binPROGRAMS uninstall-info-am
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic clean-libtool ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-binPROGRAMS install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
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 \
|
||||
uninstall-binPROGRAMS uninstall-info-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:
|
67
tools/introspect.cpp
Normal file
67
tools/introspect.cpp
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
*
|
||||
* D-Bus++ - C++ bindings for DBus
|
||||
*
|
||||
* Copyright (C) 2005-2006 Paolo Durante <shackan@gmail.com>
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include "introspect.h"
|
||||
|
||||
DBus::BusDispatcher dispatcher;
|
||||
static char* path;
|
||||
static char* service;
|
||||
|
||||
void niam( int sig )
|
||||
{
|
||||
DBus::Connection conn = DBus::Connection::SessionBus();
|
||||
|
||||
IntrospectedObject io(conn, path, service);
|
||||
|
||||
std::cout << io.Introspect();
|
||||
|
||||
dispatcher.leave();
|
||||
}
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
signal(SIGTERM, niam);
|
||||
signal(SIGINT, niam);
|
||||
signal(SIGALRM, niam);
|
||||
|
||||
if(argc == 1)
|
||||
{
|
||||
std::cerr << std::endl << "Usage: " << argv[0] << " <object_path> [<destination>]" << std::endl << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
path = argv[1];
|
||||
service = argc > 1 ? argv[2] : 0;
|
||||
|
||||
DBus::default_dispatcher = &dispatcher;
|
||||
|
||||
alarm(1);
|
||||
|
||||
dispatcher.enter();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
40
tools/introspect.h
Normal file
40
tools/introspect.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
*
|
||||
* D-Bus++ - C++ bindings for DBus
|
||||
*
|
||||
* Copyright (C) 2005-2006 Paolo Durante <shackan@gmail.com>
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __DBUSXX_TOOLS_INTROSPECT_H
|
||||
#define __DBUSXX_TOOLS_INTROSPECT_H
|
||||
|
||||
#include <dbus-c++/dbus-c++.h>
|
||||
#include <string>
|
||||
|
||||
class IntrospectedObject : public DBus::IntrospectableProxy, public DBus::ObjectProxy
|
||||
{
|
||||
public:
|
||||
|
||||
IntrospectedObject( DBus::Connection& conn, const char* path, const char* service )
|
||||
: DBus::ObjectProxy(conn, path, service)
|
||||
{}
|
||||
};
|
||||
|
||||
#endif//__DBUSXX_TOOLS_INTROSPECT_H
|
742
tools/xml2cpp.cpp
Normal file
742
tools/xml2cpp.cpp
Normal file
|
@ -0,0 +1,742 @@
|
|||
/*
|
||||
*
|
||||
* D-Bus++ - C++ bindings for DBus
|
||||
*
|
||||
* Copyright (C) 2005-2006 Paolo Durante <shackan@gmail.com>
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "xml2cpp.h"
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
using namespace std;
|
||||
using namespace DBus;
|
||||
|
||||
static const char* tab = " ";
|
||||
|
||||
static const char* header = "\n\
|
||||
/* This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT! */\n\
|
||||
\n\
|
||||
";
|
||||
|
||||
static const char* dbus_includes = "\n\
|
||||
#include <dbus-c++/dbus-c++.h>\n\
|
||||
\n\
|
||||
";
|
||||
|
||||
typedef map<string,string> TypeCache;
|
||||
|
||||
void usage( const char* argv0 )
|
||||
{
|
||||
cerr << endl << "Usage: " << argv0 << " <xmlfile> [ --client=<outfile.h> ] [ --adaptor=<outfile.h> ]"
|
||||
<< endl << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
void underscorize( std::string& str )
|
||||
{
|
||||
for(unsigned int i = 0; i < str.length(); ++i)
|
||||
{
|
||||
if(!isalpha(str[i])) str[i] = '_';
|
||||
}
|
||||
}
|
||||
|
||||
std::string stub_name( std::string name )
|
||||
{
|
||||
underscorize(name);
|
||||
|
||||
return "_" + name + "_stub";
|
||||
}
|
||||
|
||||
int char_to_atomic_type( char t )
|
||||
{
|
||||
if(strchr("ybnqiuxtdsgavre", t))
|
||||
return t;
|
||||
|
||||
return DBUS_TYPE_INVALID;
|
||||
}
|
||||
|
||||
const char* atomic_type_to_string( char t )
|
||||
{
|
||||
static struct { char type; char* name; } atos[] =
|
||||
{
|
||||
{ 'y', "DBus::Byte" },
|
||||
{ 'b', "DBus::Bool" },
|
||||
{ 'n', "DBus::Int16" },
|
||||
{ 'q', "DBus::UInt16" },
|
||||
{ 'i', "DBus::Int32" },
|
||||
{ 'u', "DBus::UInt32" },
|
||||
{ 'x', "DBus::Int64" },
|
||||
{ 't', "DBus::UInt64" },
|
||||
{ 'd', "DBus::Double" },
|
||||
{ 's', "DBus::String" },
|
||||
{ 'o', "DBus::Path" },
|
||||
{ 'g', "DBus::Signature" },
|
||||
{ 'v', "DBus::Variant" },
|
||||
{ '\0', "" }
|
||||
};
|
||||
int i;
|
||||
|
||||
for(i = 0; atos[i].type; ++i)
|
||||
{
|
||||
if(atos[i].type == t) break;
|
||||
}
|
||||
return atos[i].name;
|
||||
}
|
||||
|
||||
bool is_atomic_type( const std::string& type )
|
||||
{
|
||||
return type.length() == 1 && char_to_atomic_type(type[0]) != DBUS_TYPE_INVALID;
|
||||
}
|
||||
|
||||
void _parse_signature( const std::string& signature, std::string& type, size_t& i )
|
||||
{
|
||||
for(; i < signature.length(); ++i)
|
||||
{
|
||||
switch(signature[i])
|
||||
{
|
||||
case 'a':
|
||||
{
|
||||
switch(signature[++i])
|
||||
{
|
||||
case '{':
|
||||
{
|
||||
type += "DBus::Dict< ";
|
||||
|
||||
const char* atom = atomic_type_to_string(signature[++i]);
|
||||
if(!atom)
|
||||
{
|
||||
cerr << "invalid signature" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
type += atom;
|
||||
type += ", ";
|
||||
++i;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
type += "DBus::Array< ";
|
||||
break;
|
||||
}
|
||||
}
|
||||
_parse_signature(signature, type, i);
|
||||
type += " >";
|
||||
continue;
|
||||
}
|
||||
case '(':
|
||||
{
|
||||
type += "DBus::Struct< ";
|
||||
++i;
|
||||
_parse_signature(signature, type, i);
|
||||
type += " >";
|
||||
continue;
|
||||
}
|
||||
case ')':
|
||||
case '}':
|
||||
{
|
||||
return;
|
||||
}
|
||||
default:
|
||||
{
|
||||
const char* atom = atomic_type_to_string(signature[i]);
|
||||
if(!atom)
|
||||
{
|
||||
cerr << "invalid signature" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
type += atom;
|
||||
|
||||
if(signature[i+1] != ')' && signature[i+1] != '}' && i+1 < signature.length())
|
||||
{
|
||||
type += ", ";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string signature_to_type( const std::string& signature )
|
||||
{
|
||||
std::string type;
|
||||
size_t i = 0;
|
||||
_parse_signature(signature, type, i);
|
||||
return type;
|
||||
}
|
||||
|
||||
void generate_client( Xml::Document& doc, const char* filename )
|
||||
{
|
||||
cerr << "writing " << filename << endl;
|
||||
|
||||
ofstream file(filename);
|
||||
if(file.bad())
|
||||
{
|
||||
cerr << "unable to write file " << filename << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
file << header;
|
||||
std::string filestring = filename;
|
||||
underscorize(filestring);
|
||||
|
||||
std::string cond_comp = "__dbusxx__" + filestring + "__CLIENT_MARSHAL_H";
|
||||
|
||||
file << "#ifndef " << cond_comp << endl;
|
||||
file << "#define " << cond_comp << endl;
|
||||
|
||||
file << dbus_includes;
|
||||
#if 0
|
||||
Xml::Node& root = *(doc.root);
|
||||
Xml::Nodes interfaces = root["interface"];
|
||||
|
||||
for(Xml::Nodes::iterator i = interfaces.begin(); i != interfaces.end(); ++i)
|
||||
{
|
||||
Xml::Node& iface = **i;
|
||||
Xml::Nodes methods = iface["method"];
|
||||
Xml::Nodes signals = iface["signal"];
|
||||
|
||||
std::string ifacename = iface.get("name");
|
||||
std::string ifaceclass = ifacename;
|
||||
underscorize(ifaceclass);
|
||||
|
||||
cerr << "generating code for interface " << ifacename << "..." << endl;
|
||||
|
||||
file << "class " << ifaceclass << " : public DBus::InterfaceProxy" << endl
|
||||
<< "{" << endl
|
||||
<< "public:" << endl
|
||||
<< endl
|
||||
<< tab << ifaceclass << "()" << endl
|
||||
<< tab << ": DBus::InterfaceProxy(\"" << ifacename << "\")" << endl
|
||||
<< tab << "{" << endl;
|
||||
|
||||
for(Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si)
|
||||
{
|
||||
Xml::Node& signal = **si;
|
||||
|
||||
std::string marshname = "_" + signal.get("name") + "_stub";
|
||||
|
||||
file << tab << tab << "connect_signal(" << ifaceclass << ", " << marshname << ");" << endl;
|
||||
}
|
||||
|
||||
file << tab << "}" << endl
|
||||
<< endl;
|
||||
|
||||
for(Xml::Nodes::iterator j = methods.begin(); j != methods.end(); ++j)
|
||||
{
|
||||
Xml::Node& method = **j;
|
||||
std::string methodname = method.get("name");
|
||||
std::string marshname = "_" + methodname + "_stub";
|
||||
|
||||
Xml::Nodes args = method["arg"];
|
||||
Xml::Nodes args_in = args.select("direction","in");
|
||||
Xml::Nodes args_out = args.select("direction","out");
|
||||
|
||||
file << endl;
|
||||
|
||||
if(args_out.size() == 1)
|
||||
{
|
||||
std::string ret_type = args_out.front()->get("type");
|
||||
std::string ret_sig;
|
||||
|
||||
if(is_atomic_type(ret_type))
|
||||
{
|
||||
ret_sig = atomic_type_to_string(ret_type[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
file << tab << ret_sig << " " << methodname << "( ";
|
||||
|
||||
for(Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai)
|
||||
{
|
||||
Xml::Node& a = **ai;
|
||||
|
||||
file << "const ";
|
||||
|
||||
if(is_atomic_type(a.get("type")))
|
||||
{
|
||||
file << atomic_type_to_string(a.get("type")[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
file << "& " << a.get("name") << ( ai+1 != args_in.end() ? ", " : " " );
|
||||
}
|
||||
|
||||
file << ")" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
file << tab << "void " << methodname << "( args )" << endl;
|
||||
}
|
||||
|
||||
file << tab << "{" << endl
|
||||
<< tab << tab << "DBus::CallMessage call;" << endl
|
||||
<< tab << tab << "DBus::MessageIter wi = call.w_iter();" << endl
|
||||
<< endl;
|
||||
|
||||
for(Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai)
|
||||
{
|
||||
Xml::Node& arg = **ai;
|
||||
}
|
||||
|
||||
file << tab << tab << "call.member(\"" << methodname << "\");" << endl
|
||||
<< tab << tab << "DBus::Message ret = invoke_method(call);" << endl
|
||||
<< tab << tab << "DBus::MessageIter ri = ret.r_iter();" << endl
|
||||
<< endl;
|
||||
|
||||
file << tab << "}" << endl
|
||||
<< endl;
|
||||
|
||||
}
|
||||
|
||||
file << "};" << endl
|
||||
<< endl;
|
||||
}
|
||||
#endif
|
||||
file << "#endif//" << cond_comp << endl;
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
void generate_adaptor( Xml::Document& doc, const char* filename )
|
||||
{
|
||||
cerr << "writing " << filename << endl;
|
||||
|
||||
ofstream file(filename);
|
||||
if(file.bad())
|
||||
{
|
||||
cerr << "unable to write file " << filename << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
file << header;
|
||||
std::string filestring = filename;
|
||||
underscorize(filestring);
|
||||
|
||||
std::string cond_comp = "__dbusxx__" + filestring + "__ADAPTOR_MARSHAL_H";
|
||||
|
||||
file << "#ifndef " << cond_comp << endl
|
||||
<< "#define " << cond_comp << endl;
|
||||
|
||||
file << dbus_includes;
|
||||
|
||||
Xml::Node& root = *(doc.root);
|
||||
Xml::Nodes interfaces = root["interface"];
|
||||
|
||||
for(Xml::Nodes::iterator i = interfaces.begin(); i != interfaces.end(); ++i)
|
||||
{
|
||||
Xml::Node& iface = **i;
|
||||
Xml::Nodes methods = iface["method"];
|
||||
Xml::Nodes signals = iface["signal"];
|
||||
Xml::Nodes ms;
|
||||
ms.insert(ms.end(), methods.begin(), methods.end());
|
||||
ms.insert(ms.end(), signals.begin(), signals.end());
|
||||
|
||||
std::string ifacename = iface.get("name");
|
||||
if(ifacename.find("org.freedesktop.DBus") == 0)
|
||||
{
|
||||
cerr << "skipping interface " << ifacename << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
std::istringstream ss(ifacename);
|
||||
string nspace;
|
||||
size_t nspaces = 0;
|
||||
|
||||
while(ss.str().find('.', ss.tellg()) != string::npos)
|
||||
{
|
||||
getline(ss, nspace, '.');
|
||||
|
||||
file << "namespace " << nspace << " {" << endl;
|
||||
|
||||
++nspaces;
|
||||
}
|
||||
file << endl;
|
||||
|
||||
std::string ifaceclass;
|
||||
|
||||
getline(ss, ifaceclass);
|
||||
|
||||
cerr << "generating code for interface " << ifacename << "..." << endl;
|
||||
|
||||
file << "class " << ifaceclass << " : public DBus::InterfaceAdaptor" << endl
|
||||
<< "{" << endl
|
||||
<< "public:" << endl
|
||||
<< endl
|
||||
<< tab << ifaceclass << "()" << endl
|
||||
<< tab << ": DBus::InterfaceAdaptor(\"" << ifacename << "\")" << endl
|
||||
<< tab << "{" << endl;
|
||||
|
||||
for(Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi)
|
||||
{
|
||||
Xml::Node& method = **mi;
|
||||
|
||||
file << tab << tab << "register_method("
|
||||
<< ifaceclass << ", " << method.get("name") << ", "<< stub_name(method.get("name"))
|
||||
<< ");" << endl;
|
||||
}
|
||||
|
||||
file << tab << "}" << endl
|
||||
<< endl;
|
||||
|
||||
file << tab << "DBus::IntrospectedInterface* const introspect() const " << endl
|
||||
<< tab << "{" << endl;
|
||||
|
||||
for(Xml::Nodes::iterator mi = ms.begin(); mi != ms.end(); ++mi)
|
||||
{
|
||||
Xml::Node& method = **mi;
|
||||
Xml::Nodes args = method["arg"];
|
||||
|
||||
file << tab << tab << "static DBus::IntrospectedArgument " << method.get("name") << "_args[] = " << endl
|
||||
<< tab << tab << "{" << endl;
|
||||
|
||||
for(Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai)
|
||||
{
|
||||
Xml::Node& arg = **ai;
|
||||
|
||||
file << tab << tab << tab << "{ ";
|
||||
|
||||
if(arg.get("name").length())
|
||||
{
|
||||
file << "\"" << arg.get("name") << "\", ";
|
||||
}
|
||||
else
|
||||
{
|
||||
file << "0, ";
|
||||
}
|
||||
file << "\"" << arg.get("type") << "\", "
|
||||
<< ( arg.get("direction") == "in" ? "true" : "false" )
|
||||
<< " }," << endl;
|
||||
}
|
||||
file << tab << tab << tab << "{ 0, 0, 0 }" << endl
|
||||
<< tab << tab << "};" << endl;
|
||||
}
|
||||
|
||||
file << tab << tab << "static DBus::IntrospectedMethod " << ifaceclass << "_methods[] = " << endl
|
||||
<< tab << tab << "{" << endl;
|
||||
|
||||
for(Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi)
|
||||
{
|
||||
Xml::Node& method = **mi;
|
||||
|
||||
file << tab << tab << tab << "{ \"" << method.get("name") << "\", " << method.get("name") << "_args }," << endl;
|
||||
}
|
||||
|
||||
file << tab << tab << tab << "{ 0, 0 }" << endl
|
||||
<< tab << tab << "};" << endl;
|
||||
|
||||
file << tab << tab << "static DBus::IntrospectedMethod " << ifaceclass << "_signals[] = " << endl
|
||||
<< tab << tab << "{" << endl;
|
||||
|
||||
for(Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si)
|
||||
{
|
||||
Xml::Node& method = **si;
|
||||
|
||||
file << tab << tab << tab << "{ \"" << method.get("name") << "\", " << method.get("name") << "_args }," << endl;
|
||||
}
|
||||
|
||||
file << tab << tab << tab << "{ 0, 0 }" << endl
|
||||
<< tab << tab << "};" << endl;
|
||||
|
||||
file << tab << tab << "static DBus::IntrospectedInterface " << ifaceclass << "_interface = " << endl
|
||||
<< tab << tab << "{" << endl
|
||||
<< tab << tab << tab << "\"" << ifacename << "\"," << endl
|
||||
<< tab << tab << tab << ifaceclass << "_methods," << endl
|
||||
<< tab << tab << tab << ifaceclass << "_signals," << endl
|
||||
<< tab << tab << "};" << endl
|
||||
<< tab << tab << "return &" << ifaceclass << "_interface;" << endl
|
||||
<< tab << "}" << endl
|
||||
<< endl;
|
||||
|
||||
file << "public:" << endl
|
||||
<< endl
|
||||
<< tab << "/* methods exported by this interface," << endl
|
||||
<< tab << " * you will have to implement them in your ObjectAdaptor" << endl
|
||||
<< tab << " */" << endl;
|
||||
|
||||
for(Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi)
|
||||
{
|
||||
Xml::Node& method = **mi;
|
||||
Xml::Nodes args = method["arg"];
|
||||
Xml::Nodes args_in = args.select("direction","in");
|
||||
Xml::Nodes args_out = args.select("direction","out");
|
||||
|
||||
file << tab << "virtual ";
|
||||
|
||||
if(args_out.size() == 0 || args_out.size() > 1 )
|
||||
{
|
||||
file << "void ";
|
||||
}
|
||||
else if(args_out.size() == 1)
|
||||
{
|
||||
file << signature_to_type(args_out.front()->get("type")) << " ";
|
||||
}
|
||||
|
||||
file << method.get("name") << "( ";
|
||||
|
||||
unsigned int i = 0;
|
||||
for(Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i)
|
||||
{
|
||||
Xml::Node& arg = **ai;
|
||||
file << "const " << signature_to_type(arg.get("type")) << "& ";
|
||||
|
||||
std::string arg_name = arg.get("name");
|
||||
if(arg_name.length())
|
||||
file << arg_name;
|
||||
|
||||
if((i+1 != args_in.size() || args_out.size() > 1))
|
||||
file << ", ";
|
||||
}
|
||||
|
||||
if(args_out.size() > 1)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
for(Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i)
|
||||
{
|
||||
Xml::Node& arg = **ao;
|
||||
file << signature_to_type(arg.get("type")) << "&";
|
||||
|
||||
std::string arg_name = arg.get("name");
|
||||
if(arg_name.length())
|
||||
file << " " << arg_name;
|
||||
|
||||
if(i+1 != args_out.size())
|
||||
file << ", ";
|
||||
}
|
||||
}
|
||||
file << " ) = 0;" << endl;
|
||||
}
|
||||
|
||||
file << endl
|
||||
<< "protected:" << endl
|
||||
<< endl
|
||||
<< tab << "/* signals emitted by this interface" << endl
|
||||
<< tab << " */" << endl;
|
||||
|
||||
for(Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si)
|
||||
{
|
||||
Xml::Node& signal = **si;
|
||||
Xml::Nodes args = signal["arg"];
|
||||
|
||||
file << tab << "void " << signal.get("name") << "( ";
|
||||
|
||||
unsigned int i = 0;
|
||||
for(Xml::Nodes::iterator a = args.begin(); a != args.end(); ++a, ++i)
|
||||
{
|
||||
Xml::Node& arg = **a;
|
||||
|
||||
file << "const " << signature_to_type(arg.get("type")) << "& arg" << i+1;
|
||||
|
||||
if(i+1 != args.size())
|
||||
file << ", ";
|
||||
}
|
||||
|
||||
file << " )" << endl
|
||||
<< tab << "{" << endl
|
||||
<< tab << tab << "DBus::SignalMessage sig(\"" << signal.get("name") <<"\");" << endl;;
|
||||
|
||||
|
||||
if(args.size() > 0)
|
||||
{
|
||||
file << tab << tab << "DBus::MessageIter wi = sig.w_iter();" << endl;
|
||||
|
||||
for(unsigned int i = 0; i < args.size(); ++i)
|
||||
{
|
||||
file << tab << tab << "wi << arg" << i+1 << ";" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
file << tab << tab << "emit_signal(sig);" << endl
|
||||
<< tab << "}" << endl;
|
||||
}
|
||||
|
||||
file << endl
|
||||
<< "private:" << endl
|
||||
<< endl
|
||||
<< tab << "/* marshalers (to unpack the DBus message before calling the actual interface method)" << endl
|
||||
<< tab << " */" << endl;
|
||||
|
||||
for(Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi)
|
||||
{
|
||||
Xml::Node& method = **mi;
|
||||
Xml::Nodes args = method["arg"];
|
||||
Xml::Nodes args_in = args.select("direction","in");
|
||||
Xml::Nodes args_out = args.select("direction","out");
|
||||
|
||||
file << tab << "DBus::Message " << stub_name(method.get("name")) << "( const DBus::CallMessage& call )" << endl
|
||||
<< tab << "{" << endl
|
||||
<< tab << tab << "DBus::MessageIter ri = call.r_iter();" << endl
|
||||
<< endl;
|
||||
|
||||
unsigned int i = 1;
|
||||
for(Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i)
|
||||
{
|
||||
Xml::Node& arg = **ai;
|
||||
file << tab << tab << signature_to_type(arg.get("type")) << " argin" << i << ";"
|
||||
<< " ri >> argin" << i << ";" << endl;
|
||||
}
|
||||
|
||||
if(args_out.size() == 0)
|
||||
{
|
||||
file << tab << tab;
|
||||
}
|
||||
else if(args_out.size() == 1)
|
||||
{
|
||||
file << tab << tab << signature_to_type(args_out.front()->get("type")) << " argout1 = ";
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int i = 1;
|
||||
for(Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i)
|
||||
{
|
||||
Xml::Node& arg = **ao;
|
||||
file << tab << tab << signature_to_type(arg.get("type")) << " argout" << i << ";" << endl;
|
||||
}
|
||||
file << tab << tab;
|
||||
}
|
||||
|
||||
file << method.get("name") << "(";
|
||||
|
||||
for(unsigned int i = 0; i < args_in.size(); ++i)
|
||||
{
|
||||
file << "argin" << i+1;
|
||||
|
||||
if((i+1 != args_in.size() || args_out.size() > 1))
|
||||
file << ", ";
|
||||
}
|
||||
|
||||
if(args_out.size() > 1)
|
||||
for(unsigned int i = 0; i < args_out.size(); ++i)
|
||||
{
|
||||
file << "argout" << i+1;
|
||||
|
||||
if(i+1 != args_out.size())
|
||||
file << ", ";
|
||||
}
|
||||
|
||||
file << ");" << endl;
|
||||
|
||||
file << tab << tab << "DBus::ReturnMessage reply(call);" << endl;
|
||||
|
||||
if(args_out.size() > 0)
|
||||
{
|
||||
file << tab << tab << "DBus::MessageIter wi = reply.w_iter();" << endl;
|
||||
|
||||
for(unsigned int i = 0; i < args_out.size(); ++i)
|
||||
{
|
||||
file << tab << tab << "wi << argout" << i+1 << ";" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
file << tab << tab << "return reply;" << endl;
|
||||
|
||||
file << tab << "}" << endl;
|
||||
}
|
||||
|
||||
file << "};" << endl
|
||||
<< endl;
|
||||
|
||||
for(size_t i = 0; i < nspaces; ++i)
|
||||
{
|
||||
file << "} ";
|
||||
}
|
||||
file << endl;
|
||||
}
|
||||
|
||||
file << "#endif//" << cond_comp << endl;
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
if(argc < 2)
|
||||
{
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
||||
bool client_mode, adaptor_mode;
|
||||
char *client, *adaptor;
|
||||
|
||||
client_mode = false;
|
||||
client = 0;
|
||||
|
||||
adaptor_mode = false;
|
||||
adaptor = 0;
|
||||
|
||||
for(int a = 1; a < argc; ++a)
|
||||
{
|
||||
if(!strncmp(argv[a], "--client=", 9))
|
||||
{
|
||||
client_mode = true;
|
||||
client = argv[a] +9;
|
||||
}
|
||||
else
|
||||
if(!strncmp(argv[a], "--adaptor=", 10))
|
||||
{
|
||||
adaptor_mode = true;
|
||||
adaptor = argv[a] +10;
|
||||
}
|
||||
}
|
||||
|
||||
if(!client_mode && !adaptor_mode) usage(argv[0]);
|
||||
|
||||
ifstream xmlfile(argv[1]);
|
||||
|
||||
if(xmlfile.bad())
|
||||
{
|
||||
cerr << "unable to open file " << argv[1] << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
Xml::Document doc;
|
||||
|
||||
try
|
||||
{
|
||||
xmlfile >> doc;
|
||||
//cout << doc.to_xml();
|
||||
}
|
||||
catch(Xml::Error& e)
|
||||
{
|
||||
cerr << "error parsing " << argv[1] << ": " << e.what() << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!doc.root)
|
||||
{
|
||||
cerr << "empty document" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(client_mode) generate_client(doc, client);
|
||||
if(adaptor_mode) generate_adaptor(doc, adaptor);
|
||||
|
||||
return 0;
|
||||
}
|
31
tools/xml2cpp.h
Normal file
31
tools/xml2cpp.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
*
|
||||
* D-Bus++ - C++ bindings for DBus
|
||||
*
|
||||
* Copyright (C) 2005-2006 Paolo Durante <shackan@gmail.com>
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __DBUSXX_TOOLS_XML2CPP_H
|
||||
#define __DBUSXX_TOOLS_XML2CPP_H
|
||||
|
||||
#include <dbus-c++/dbus-c++.h>
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
#endif//__DBUSXX_TOOLS_XML2CPP_H
|
Loading…
Add table
Add a link
Reference in a new issue