summaryrefslogtreecommitdiff
path: root/legacy/edbus
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-09-17 20:41:05 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2012-09-17 20:41:05 +0000
commit5934eb67887be0ca19c01f95525847734a7a1698 (patch)
treea2d2b7e791b6fbc0f684ae5e06ca53f493141847 /legacy/edbus
parentaeadf86ba6e32e5695666c7cb6bde117c5113c32 (diff)
Add new edbus library, aka e_dbus v2
SVN revision: 76775
Diffstat (limited to 'legacy/edbus')
-rw-r--r--legacy/edbus/.gitignore43
-rw-r--r--legacy/edbus/AUTHORS4
-rw-r--r--legacy/edbus/Makefile.am120
-rwxr-xr-xlegacy/edbus/autogen.sh7
-rw-r--r--legacy/edbus/configure.ac114
-rw-r--r--legacy/edbus/doc/Doxyfile.in227
-rw-r--r--legacy/edbus/doc/Makefile.am32
-rw-r--r--legacy/edbus/doc/e.css218
-rw-r--r--legacy/edbus/doc/examples.dox55
-rw-r--r--legacy/edbus/doc/foot.html19
-rw-r--r--legacy/edbus/doc/head.html67
-rw-r--r--legacy/edbus/doc/images/e.pngbin0 -> 3825 bytes
-rw-r--r--legacy/edbus/doc/images/edoxy.css483
-rw-r--r--legacy/edbus/doc/images/foot_bg.pngbin0 -> 173 bytes
-rw-r--r--legacy/edbus/doc/images/head_bg.pngbin0 -> 214 bytes
-rw-r--r--legacy/edbus/doc/images/menu_bg.pngbin0 -> 192 bytes
-rw-r--r--legacy/edbus/doc/images/menu_bg_current.pngbin0 -> 1200 bytes
-rw-r--r--legacy/edbus/doc/images/menu_bg_hover.pngbin0 -> 3278 bytes
-rw-r--r--legacy/edbus/doc/images/menu_bg_last.pngbin0 -> 637 bytes
-rw-r--r--legacy/edbus/doc/images/menu_bg_unsel.pngbin0 -> 1596 bytes
-rw-r--r--legacy/edbus/edbus.pc.in11
-rw-r--r--legacy/edbus/m4/ac_attribute.m447
-rw-r--r--legacy/edbus/m4/ac_valist.m448
-rw-r--r--legacy/edbus/m4/efl_compiler_flag.m424
-rw-r--r--legacy/edbus/m4/efl_doxygen.m494
-rw-r--r--legacy/edbus/src/examples/banshee.c293
-rw-r--r--legacy/edbus/src/examples/client.c255
-rw-r--r--legacy/edbus/src/examples/complex_types.c257
-rw-r--r--legacy/edbus/src/examples/complex_types_server.c351
-rw-r--r--legacy/edbus/src/examples/connman-list-services.c107
-rw-r--r--legacy/edbus/src/examples/ofono-dial.c85
-rw-r--r--legacy/edbus/src/examples/server.c236
-rw-r--r--legacy/edbus/src/lib/EDBus.h141
-rw-r--r--legacy/edbus/src/lib/edbus_connection.h144
-rw-r--r--legacy/edbus/src/lib/edbus_core.c1368
-rw-r--r--legacy/edbus/src/lib/edbus_freedesktop.c80
-rw-r--r--legacy/edbus/src/lib/edbus_freedesktop.h126
-rw-r--r--legacy/edbus/src/lib/edbus_message.c792
-rw-r--r--legacy/edbus/src/lib/edbus_message.h276
-rw-r--r--legacy/edbus/src/lib/edbus_object.c467
-rw-r--r--legacy/edbus/src/lib/edbus_object.h117
-rw-r--r--legacy/edbus/src/lib/edbus_pending.c260
-rw-r--r--legacy/edbus/src/lib/edbus_pending.h30
-rw-r--r--legacy/edbus/src/lib/edbus_private.h81
-rw-r--r--legacy/edbus/src/lib/edbus_private_types.h168
-rw-r--r--legacy/edbus/src/lib/edbus_proxy.c542
-rw-r--r--legacy/edbus/src/lib/edbus_proxy.h137
-rw-r--r--legacy/edbus/src/lib/edbus_service.c616
-rw-r--r--legacy/edbus/src/lib/edbus_service.h133
-rw-r--r--legacy/edbus/src/lib/edbus_signal_handler.c340
-rw-r--r--legacy/edbus/src/lib/edbus_signal_handler.h75
51 files changed, 9090 insertions, 0 deletions
diff --git a/legacy/edbus/.gitignore b/legacy/edbus/.gitignore
new file mode 100644
index 0000000000..9a1f4e2a60
--- /dev/null
+++ b/legacy/edbus/.gitignore
@@ -0,0 +1,43 @@
1*.o
2*.lo
3*~
4.libs
5.deps
6.dirstamp
7aclocal.m4
8autom4te.cache/
9compile
10config.guess
11config.h
12config.h.in
13config.log
14config.status
15config.sub
16configure
17depcomp
18install-sh
19libtool
20ltmain.sh
21m4/libtool.m4
22m4/ltoptions.m4
23m4/ltsugar.m4
24m4/ltversion.m4
25m4/lt~obsolete.m4
26Makefile
27Makefile.in
28missing
29stamp-h1
30edbus-*.tar.*
31edbus.pc
32libedbus.la
33src/examples/connman-list-services
34src/examples/ofono-dial
35src/examples/banshee
36src/examples/complex_types
37src/examples/complex_types_server
38src/examples/server
39src/examples/client
40doc/Doxyfile
41doc/html/
42doc/latex/
43doc/man/
diff --git a/legacy/edbus/AUTHORS b/legacy/edbus/AUTHORS
new file mode 100644
index 0000000000..0306d257ea
--- /dev/null
+++ b/legacy/edbus/AUTHORS
@@ -0,0 +1,4 @@
1Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
2José Roberto de Souza <zehortigoza@profusion.mobi>
3Leandro Pereira <leandro@profusion.mobi>
4Lucas De Marchi <lucas.demarchi@profusion.mobi>
diff --git a/legacy/edbus/Makefile.am b/legacy/edbus/Makefile.am
new file mode 100644
index 0000000000..6ff713c3fd
--- /dev/null
+++ b/legacy/edbus/Makefile.am
@@ -0,0 +1,120 @@
1ACLOCAL_AMFLAGS = -I m4
2CLEANFILES =
3MAINTAINERCLEANFILES =
4EXTRA_DIST =
5
6SUBDIRS = doc
7
8AM_MAKEFLAGS = --no-print-directory
9AM_CFLAGS = \
10 -include $(top_builddir)/config.h \
11 -I$(top_srcdir)/src/lib \
12 @ECORE_CFLAGS@ \
13 @DBUS_CFLAGS@
14
15AM_CPPFLAGS = -DEFL_EDBUS_BUILD=1
16
17includedir = @includedir@/edbus-@VMAJ@/
18
19SED_PROCESS = \
20 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
21 -e 's,@VERSION\@,$(VERSION),g' \
22 -e 's,@prefix\@,$(prefix),g' \
23 -e 's,@exec_prefix\@,$(exec_prefix),g' \
24 -e 's,@libdir\@,$(libdir),g' \
25 -e 's,@includedir\@,$(includedir),g' \
26 < $< > $@ || rm $@
27
28%.pc: %.pc.in Makefile
29 $(SED_PROCESS)
30
31pkgconfigdir = $(libdir)/pkgconfig
32pkgconfig_DATA = edbus.pc
33CLEANFILES += edbus.pc
34EXTRA_DIST += edbus.pc.in
35
36EXTRA_DIST += \
37 m4/efl_doxygen.m4 \
38 m4/efl_compiler_flag.m4
39
40
41MAINTAINERCLEANFILES += \
42 aclocal.m4 \
43 compile \
44 config.guess \
45 config.h.in \
46 config.sub \
47 configure \
48 depcomp \
49 install-sh \
50 ltmain.sh \
51 Makefile.in \
52 missing \
53 mkinstalldirs
54
55lib_LTLIBRARIES = libedbus.la
56
57include_HEADERS = \
58 src/lib/EDBus.h \
59 src/lib/edbus_connection.h \
60 src/lib/edbus_freedesktop.h \
61 src/lib/edbus_message.h \
62 src/lib/edbus_object.h \
63 src/lib/edbus_pending.h \
64 src/lib/edbus_proxy.h \
65 src/lib/edbus_service.h \
66 src/lib/edbus_signal_handler.h
67
68libedbus_la_LIBADD = @ECORE_LIBS@ @DBUS_LIBS@
69libedbus_la_SOURCES = \
70 src/lib/edbus_private.h \
71 src/lib/edbus_private_types.h \
72 src/lib/edbus_proxy.c \
73 src/lib/edbus_core.c \
74 src/lib/edbus_message.c \
75 src/lib/edbus_object.c \
76 src/lib/edbus_pending.c \
77 src/lib/edbus_freedesktop.c \
78 src/lib/edbus_service.c \
79 src/lib/edbus_signal_handler.c
80
81noinst_PROGRAMS = \
82 src/examples/connman-list-services \
83 src/examples/ofono-dial \
84 src/examples/banshee \
85 src/examples/complex_types \
86 src/examples/complex_types_server \
87 src/examples/server \
88 src/examples/client
89
90EXAMPLES_LIBS = libedbus.la @ECORE_LIBS@
91
92src_examples_connman_list_services_SOURCES = \
93 src/examples/connman-list-services.c
94src_examples_connman_list_services_LDADD = $(EXAMPLES_LIBS)
95
96src_examples_ofono_dial_SOURCES = src/examples/ofono-dial.c
97src_examples_ofono_dial_LDADD = $(EXAMPLES_LIBS)
98
99src_examples_banshee_SOURCES = src/examples/banshee.c
100src_examples_banshee_LDADD = $(EXAMPLES_LIBS)
101
102src_examples_complex_types_SOURCES = src/examples/complex_types.c
103src_examples_complex_types_LDADD = $(EXAMPLES_LIBS)
104
105src_examples_complex_types_server_SOURCES = src/examples/complex_types_server.c
106src_examples_complex_types_server_LDADD = $(EXAMPLES_LIBS)
107
108src_examples_server_SOURCES = src/examples/server.c
109src_examples_server_LDADD = $(EXAMPLES_LIBS)
110
111src_examples_client_SOURCES = src/examples/client.c
112src_examples_client_LDADD = $(EXAMPLES_LIBS)
113
114.PHONY: doc
115
116# Documentation
117
118doc:
119 @echo "entering doc/"
120 make -C doc doc
diff --git a/legacy/edbus/autogen.sh b/legacy/edbus/autogen.sh
new file mode 100755
index 0000000000..b43d1715ee
--- /dev/null
+++ b/legacy/edbus/autogen.sh
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3autoreconf -f -i
4
5if [ -z "$NOCONFIGURE" ]; then
6 ./configure "$@"
7fi
diff --git a/legacy/edbus/configure.ac b/legacy/edbus/configure.ac
new file mode 100644
index 0000000000..e203746353
--- /dev/null
+++ b/legacy/edbus/configure.ac
@@ -0,0 +1,114 @@
1##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3m4_define([v_maj], [1])
4m4_define([v_min], [7])
5m4_define([v_mic], [99])
6m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8##-- When released, remove the dnl on the below line
9dnl m4_undefine([v_rev])
10##-- When doing snapshots - change soname. remove dnl on below line
11dnl m4_define([relname], [ver-pre-svn-07])
12dnl m4_define([v_rel], [-release relname])
13##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
15[m4_define([v_ver], [v_maj.v_min.v_mic])])
16m4_define([lt_cur], m4_eval(v_maj + v_min))
17m4_define([lt_rev], v_mic)
18m4_define([lt_age], v_min)
19##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21
22AC_INIT([edbus], [v_ver], [enlightenment-devel@lists.sourceforge.net])
23AC_PREREQ([2.60])
24
25AM_INIT_AUTOMAKE([foreign subdir-objects])
26AM_CONFIG_HEADER([config.h])
27AC_CONFIG_MACRO_DIR([m4])
28
29m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
30
31PKG_PROG_PKG_CONFIG
32
33EFL_COMPILER_FLAG([-Wall])
34EFL_COMPILER_FLAG([-Wextra])
35EFL_COMPILER_FLAG([-Wshadow])
36EFL_COMPILER_FLAG([-Wno-unused-parameter])
37EFL_COMPILER_FLAG([-Wvla])
38EFL_COMPILER_FLAG([-Wundef])
39EFL_COMPILER_FLAG([-Wformat=2])
40EFL_COMPILER_FLAG([-Wlogical-op])
41EFL_COMPILER_FLAG([-Wsign-compare])
42EFL_COMPILER_FLAG([-Wformat-security])
43EFL_COMPILER_FLAG([-Wmissing-include-dirs])
44EFL_COMPILER_FLAG([-Wformat-nonliteral])
45EFL_COMPILER_FLAG([-Wold-style-definition])
46EFL_COMPILER_FLAG([-Wpointer-arith])
47EFL_COMPILER_FLAG([-Winit-self])
48EFL_COMPILER_FLAG([-Wdeclaration-after-statement])
49EFL_COMPILER_FLAG([-Wmissing-declarations])
50EFL_COMPILER_FLAG([-Wmissing-noreturn])
51EFL_COMPILER_FLAG([-Wendif-labels])
52EFL_COMPILER_FLAG([-Wstrict-aliasing=2])
53EFL_COMPILER_FLAG([-Wwrite-strings])
54EFL_COMPILER_FLAG([-Wno-long-long])
55EFL_COMPILER_FLAG([-Wno-overlength-strings])
56EFL_COMPILER_FLAG([-Wno-missing-field-initializers])
57EFL_COMPILER_FLAG([-Wno-nested-externs])
58EFL_COMPILER_FLAG([-Wchar-subscripts])
59EFL_COMPILER_FLAG([-Wtype-limits])
60EFL_COMPILER_FLAG([-Wuninitialized])
61
62AC_LANG_C
63
64AC_PROG_CC
65AC_PROG_MKDIR_P
66AM_PROG_CC_C_O
67AC_C___ATTRIBUTE__
68AC_C_VA_LIST_AS_ARRAY
69
70AC_DISABLE_STATIC
71define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
72define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
73AC_PROG_LIBTOOL
74
75# doxygen program for documentation building
76EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
77
78PKG_CHECK_MODULES([EINA], [eina >= 1.7.0])
79PKG_CHECK_MODULES([ECORE], [ecore])
80PKG_CHECK_MODULES([DBUS], [dbus-1])
81
82with_max_log_level="EINA_LOG_LEVEL_DBG"
83AC_ARG_WITH(maximum-log-level,
84 [AC_HELP_STRING([--with-maximum-log-level=NUMBER],
85 [limit log level, any call to EINA_LOG() with values greater than this will be compiled out, ignoring runtime settings, but saving function calls.])],
86 [with_max_log_level="${withval}"], [:])
87AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${with_max_log_level}, [if set, logging is limited to this amount.])
88
89##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
90##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
91m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
92m4_ifdef([v_rel], , [m4_define([v_rel], [])])
93AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
94AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
95AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
96AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
97version_info="lt_cur:lt_rev:lt_age"
98release_info="v_rel"
99AC_SUBST(version_info)
100AC_SUBST(release_info)
101##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
102##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
103VMAJ=v_maj
104VMIN=v_min
105AC_SUBST(VMAJ)
106AC_SUBST(VMIN)
107
108AC_CONFIG_FILES([
109Makefile
110doc/Makefile
111doc/Doxyfile
112])
113
114AC_OUTPUT
diff --git a/legacy/edbus/doc/Doxyfile.in b/legacy/edbus/doc/Doxyfile.in
new file mode 100644
index 0000000000..a5750e324f
--- /dev/null
+++ b/legacy/edbus/doc/Doxyfile.in
@@ -0,0 +1,227 @@
1DOXYFILE_ENCODING = UTF-8
2PROJECT_NAME = EDBus
3PROJECT_NUMBER =
4OUTPUT_DIRECTORY = .
5CREATE_SUBDIRS = NO
6OUTPUT_LANGUAGE = English
7BRIEF_MEMBER_DESC = YES
8REPEAT_BRIEF = YES
9ABBREVIATE_BRIEF =
10ALWAYS_DETAILED_SEC = NO
11INLINE_INHERITED_MEMB = NO
12FULL_PATH_NAMES = NO
13STRIP_FROM_PATH =
14STRIP_FROM_INC_PATH =
15SHORT_NAMES = NO
16JAVADOC_AUTOBRIEF = YES
17QT_AUTOBRIEF = NO
18MULTILINE_CPP_IS_BRIEF = NO
19INHERIT_DOCS = YES
20SEPARATE_MEMBER_PAGES = NO
21TAB_SIZE = 2
22ALIASES =
23OPTIMIZE_OUTPUT_FOR_C = YES
24OPTIMIZE_OUTPUT_JAVA = NO
25OPTIMIZE_FOR_FORTRAN = NO
26OPTIMIZE_OUTPUT_VHDL = NO
27EXTENSION_MAPPING =
28BUILTIN_STL_SUPPORT = NO
29CPP_CLI_SUPPORT = NO
30SIP_SUPPORT = NO
31IDL_PROPERTY_SUPPORT = YES
32DISTRIBUTE_GROUP_DOC = NO
33SUBGROUPING = YES
34TYPEDEF_HIDES_STRUCT = NO
35SYMBOL_CACHE_SIZE = 0
36EXTRACT_ALL = NO
37EXTRACT_PRIVATE = NO
38EXTRACT_STATIC = NO
39EXTRACT_LOCAL_CLASSES = NO
40EXTRACT_LOCAL_METHODS = NO
41EXTRACT_ANON_NSPACES = NO
42HIDE_UNDOC_MEMBERS = NO
43HIDE_UNDOC_CLASSES = YES
44HIDE_FRIEND_COMPOUNDS = YES
45HIDE_IN_BODY_DOCS = NO
46INTERNAL_DOCS = NO
47CASE_SENSE_NAMES = YES
48HIDE_SCOPE_NAMES = NO
49SHOW_INCLUDE_FILES = NO
50FORCE_LOCAL_INCLUDES = NO
51INLINE_INFO = YES
52SORT_MEMBER_DOCS = YES
53SORT_MEMBERS_CTORS_1ST = NO
54SORT_GROUP_NAMES = NO
55SORT_BY_SCOPE_NAME = NO
56GENERATE_TODOLIST = YES
57GENERATE_TESTLIST = YES
58GENERATE_BUGLIST = YES
59GENERATE_DEPRECATEDLIST= YES
60ENABLED_SECTIONS =
61MAX_INITIALIZER_LINES = 30
62SHOW_USED_FILES = NO
63SHOW_DIRECTORIES = NO
64SHOW_FILES = YES
65SHOW_NAMESPACES = YES
66FILE_VERSION_FILTER =
67LAYOUT_FILE =
68QUIET = YES
69WARNINGS = YES
70WARN_IF_UNDOCUMENTED = YES
71WARN_IF_DOC_ERROR = YES
72WARN_NO_PARAMDOC = YES
73WARN_FORMAT = "$file:$line: $text"
74WARN_LOGFILE =
75INPUT = ../src/lib \
76 ./examples.dox
77INPUT_ENCODING = UTF-8
78FILE_PATTERNS =
79RECURSIVE = YES
80EXCLUDE =
81EXCLUDE_SYMLINKS = NO
82EXCLUDE_PATTERNS =
83EXCLUDE_SYMBOLS =
84EXAMPLE_PATH = ../src/examples/
85EXAMPLE_PATTERNS =
86EXAMPLE_RECURSIVE = YES
87IMAGE_PATH = ../doc/images/
88INPUT_FILTER =
89FILTER_PATTERNS =
90FILTER_SOURCE_FILES = NO
91SOURCE_BROWSER = NO
92INLINE_SOURCES = NO
93STRIP_CODE_COMMENTS = YES
94REFERENCED_BY_RELATION = YES
95REFERENCES_RELATION = YES
96REFERENCES_LINK_SOURCE = YES
97USE_HTAGS = NO
98VERBATIM_HEADERS = NO
99ALPHABETICAL_INDEX = YES
100COLS_IN_ALPHA_INDEX = 2
101IGNORE_PREFIX = EDBUS_ edbus_
102GENERATE_HTML = YES
103HTML_OUTPUT = html
104HTML_FILE_EXTENSION = .html
105HTML_HEADER = ./head.html
106HTML_FOOTER = ./foot.html
107HTML_STYLESHEET = ./e.css
108HTML_COLORSTYLE_HUE = 220
109HTML_COLORSTYLE_SAT = 100
110HTML_COLORSTYLE_GAMMA = 80
111HTML_TIMESTAMP = YES
112HTML_ALIGN_MEMBERS = YES
113HTML_DYNAMIC_SECTIONS = NO
114GENERATE_DOCSET = NO
115DOCSET_FEEDNAME = "Doxygen generated docs"
116DOCSET_BUNDLE_ID = org.doxygen.Project
117DOCSET_PUBLISHER_ID = org.doxygen.Publisher
118DOCSET_PUBLISHER_NAME = Publisher
119GENERATE_HTMLHELP = NO
120CHM_FILE =
121HHC_LOCATION =
122GENERATE_CHI = NO
123CHM_INDEX_ENCODING =
124BINARY_TOC = NO
125TOC_EXPAND = NO
126GENERATE_QHP = NO
127QCH_FILE =
128QHP_NAMESPACE = org.doxygen.Project
129QHP_VIRTUAL_FOLDER = doc
130QHP_CUST_FILTER_NAME =
131QHP_CUST_FILTER_ATTRS =
132QHP_SECT_FILTER_ATTRS =
133QHG_LOCATION =
134GENERATE_ECLIPSEHELP = NO
135ECLIPSE_DOC_ID = org.doxygen.Project
136DISABLE_INDEX = YES
137ENUM_VALUES_PER_LINE = 1
138GENERATE_TREEVIEW = NO
139USE_INLINE_TREES = NO
140TREEVIEW_WIDTH = 250
141EXT_LINKS_IN_WINDOW = NO
142FORMULA_FONTSIZE = 10
143FORMULA_TRANSPARENT = YES
144SEARCHENGINE = NO
145SERVER_BASED_SEARCH = NO
146GENERATE_LATEX = YES
147LATEX_OUTPUT = latex
148LATEX_CMD_NAME = latex
149MAKEINDEX_CMD_NAME = makeindex
150COMPACT_LATEX = NO
151PAPER_TYPE = a4wide
152EXTRA_PACKAGES =
153LATEX_HEADER =
154PDF_HYPERLINKS = YES
155USE_PDFLATEX = NO
156LATEX_BATCHMODE = NO
157LATEX_HIDE_INDICES = NO
158LATEX_SOURCE_CODE = NO
159GENERATE_RTF = NO
160RTF_OUTPUT = rtf
161COMPACT_RTF = NO
162RTF_HYPERLINKS = NO
163RTF_STYLESHEET_FILE =
164RTF_EXTENSIONS_FILE =
165GENERATE_MAN = YES
166MAN_OUTPUT = man
167MAN_EXTENSION = .3
168MAN_LINKS = YES
169GENERATE_XML = NO
170XML_OUTPUT = xml
171XML_SCHEMA =
172XML_DTD =
173XML_PROGRAMLISTING = YES
174GENERATE_AUTOGEN_DEF = NO
175GENERATE_PERLMOD = NO
176PERLMOD_LATEX = NO
177PERLMOD_PRETTY = YES
178PERLMOD_MAKEVAR_PREFIX =
179ENABLE_PREPROCESSING = YES
180MACRO_EXPANSION = YES
181EXPAND_ONLY_PREDEF = YES
182SEARCH_INCLUDES = NO
183INCLUDE_PATH =
184INCLUDE_FILE_PATTERNS =
185PREDEFINED = EINA_MAGIC_DEBUG \
186 __UNUSED__= \
187 EINA_ARG_NONNULL()= \
188 EINA_MALLOC= \
189 EINA_WARN_UNUSED_RESULT= \
190 EAPI= \
191 EINA_PURE= \
192 EINA_CONST=
193EXPAND_AS_DEFINED =
194SKIP_FUNCTION_MACROS = YES
195TAGFILES =
196GENERATE_TAGFILE =
197ALLEXTERNALS = NO
198EXTERNAL_GROUPS = YES
199PERL_PATH = /usr/bin/perl
200CLASS_DIAGRAMS = NO
201MSCGEN_PATH =
202HIDE_UNDOC_RELATIONS = YES
203HAVE_DOT = NO
204DOT_NUM_THREADS = 0
205DOT_FONTNAME = FreeSans.ttf
206DOT_FONTSIZE = 10
207DOT_FONTPATH =
208CLASS_GRAPH = NO
209COLLABORATION_GRAPH = NO
210GROUP_GRAPHS = YES
211UML_LOOK = NO
212TEMPLATE_RELATIONS = NO
213INCLUDE_GRAPH = NO
214INCLUDED_BY_GRAPH = NO
215CALL_GRAPH = NO
216CALLER_GRAPH = NO
217GRAPHICAL_HIERARCHY = NO
218DIRECTORY_GRAPH = YES
219DOT_IMAGE_FORMAT = png
220DOT_PATH =
221DOTFILE_DIRS =
222DOT_GRAPH_MAX_NODES = 50
223MAX_DOT_GRAPH_DEPTH = 0
224DOT_TRANSPARENT = NO
225DOT_MULTI_TARGETS = NO
226GENERATE_LEGEND = YES
227DOT_CLEANUP = YES \ No newline at end of file
diff --git a/legacy/edbus/doc/Makefile.am b/legacy/edbus/doc/Makefile.am
new file mode 100644
index 0000000000..3c2eba92a6
--- /dev/null
+++ b/legacy/edbus/doc/Makefile.am
@@ -0,0 +1,32 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3.PHONY: doc
4
5PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc
6
7if EFL_BUILD_DOC
8
9doc-clean:
10 rm -rf html/ latex/ $(top_builddir)/$(PACKAGE_DOCNAME).tar*
11
12doc: all
13 $(efl_doxygen)
14 cp $(srcdir)/images/* html/
15 rm -rf $(PACKAGE_DOCNAME).tar*
16 mkdir -p $(PACKAGE_DOCNAME)/doc
17 cp -R html/ latex/ $(PACKAGE_DOCNAME)/doc
18 tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/
19 bzip2 -9 $(PACKAGE_DOCNAME).tar
20 rm -rf $(PACKAGE_DOCNAME)/
21 mv $(PACKAGE_DOCNAME).tar.bz2 $(top_builddir)
22
23clean-local: doc-clean
24
25else
26
27doc:
28 @echo "Documentation not built. Run ./configure --help"
29
30endif
31
32EXTRA_DIST = Doxyfile.in $(wildcard images/*.*) e.css head.html foot.html
diff --git a/legacy/edbus/doc/e.css b/legacy/edbus/doc/e.css
new file mode 100644
index 0000000000..8697a3a0be
--- /dev/null
+++ b/legacy/edbus/doc/e.css
@@ -0,0 +1,218 @@
1/*
2 Author:
3 Andres Blanc <andresblanc@gmail.com>
4 DaveMDS Andreoli <dave@gurumeditation.it>
5
6 Supported Browsers:
7 ie7, opera9, konqueror4 and firefox3
8
9 Please use a different file for ie6, ie5, etc. hacks.
10*/
11
12
13/* Necessary to place the footer at the bottom of the page */
14html, body {
15 height: 100%;
16 margin: 0px;
17 padding: 0px;
18}
19
20#container {
21 min-height: 100%;
22 height: auto !important;
23 height: 100%;
24 margin: 0 auto -53px;
25}
26
27#footer, #push {
28 height: 53px;
29}
30
31
32* html #container {
33 height: 100%;
34}
35
36/* Prevent floating elements overflowing containers */
37.clear {
38 clear: both;
39 width: 0px;
40 height: 0px;
41}
42
43/* Flexible & centered layout from 750 to 960 pixels */
44.layout {
45 max-width: 960px;
46 min-width: 760px;
47 margin-left: auto;
48 margin-right: auto;
49}
50
51body {
52 /*font-family: Lucida Grande, Helvetica, sans-serif;*/
53 font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif
54}
55
56/* Prevent design overflowing the viewport in small resolutions */
57#container {
58 padding-right: 17px;
59 padding-left: 17px;
60 background-image: url(head_bg.png);
61 background-repeat: repeat-x;
62}
63
64#header {
65 width: 100%;
66 height: 102px;
67}
68
69#header h1 {
70 width: 63px;
71 height: 63px;
72 background-image: url(e.png);
73 background-repeat: no-repeat;
74 position: absolute;
75 margin: 0px;
76}
77
78#header h1 span {
79 display: none;
80}
81
82#header h2 {
83 display: none;
84}
85
86/* .menu-container is used to set properties common to .menu and .submenu */
87#header .menu-container {
88}
89
90#header .menu-container ul {
91 list-style-type: none;
92 list-style-position: inside;
93 margin: 0;
94}
95
96#header .menu-container li {
97 display: block;
98 float: right;
99}
100
101#header .menu {
102 height: 63px;
103 display: block;
104 background-image: url(menu_bg.png);
105 background-repeat: repeat-x;
106}
107
108#header .menu ul {
109 height: 100%;
110 display: block;
111 background-image: url(menu_bg_last.png);
112 background-repeat: no-repeat;
113 background-position: top right;
114 padding-right: 17px;
115}
116
117#header .menu li {
118 height: 100%;
119 text-align: center;
120 background-image: url(menu_bg_unsel.png);
121 background-repeat: no-repeat;
122}
123
124#header .menu a {
125 height: 100%;
126 display: block;
127 color: #cdcdcd;
128 text-decoration: none;
129 font-size: 10pt;
130 line-height: 59px;
131 text-align: center;
132 padding: 0px 15px 0px 15px;
133}
134
135#header .menu li:hover {
136 background-image: url(menu_bg_hover.png);
137 background-repeat: no-repeat;
138}
139
140#header .menu li:hover a {
141 color: #FFFFFF;
142}
143
144#header .menu li.current {
145 background-image: url(menu_bg_current.png);
146 background-repeat: no-repeat;
147}
148
149#header .menu li.current a {
150 color: #646464;
151}
152
153
154/* Hide all the submenus but the current */
155#header .submenu ul {
156 display: none;
157}
158
159#header .submenu .current {
160 display: block;
161}
162
163#header .submenu {
164 font: bold 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
165 margin-top: 10px;
166}
167
168#header .submenu a {
169 color: #888888;
170 text-decoration: none;
171 font-size: 0.9em;
172 line-height: 15px;
173 padding:0px 5px 0px 5px;
174}
175
176#header .submenu a:hover {
177 color: #444444;
178}
179
180#header .submenu li {
181 border-left: 1px solid #DDDDDD;
182}
183
184#header .submenu li:last-child {
185 border-left: 0;
186}
187
188#header .doxytitle {
189 position: absolute;
190 font-size: 1.8em;
191 font-weight: bold;
192 color: #444444;
193 line-height: 35px;
194}
195
196#header small {
197 font-size: 0.4em;
198}
199
200#footer {
201 background-image: url(foot_bg.png);
202 width: 100%;
203}
204
205#footer table {
206 width: 100%;
207 text-align: center;
208 white-space: nowrap;
209 padding: 5px 30px 5px 30px;
210 font-size: 0.8em;
211 font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
212 color: #888888;
213}
214
215#footer td.copyright {
216 width: 100%;
217}
218
diff --git a/legacy/edbus/doc/examples.dox b/legacy/edbus/doc/examples.dox
new file mode 100644
index 0000000000..14b4ba343a
--- /dev/null
+++ b/legacy/edbus/doc/examples.dox
@@ -0,0 +1,55 @@
1/**
2 * @page Examples Examples
3 *
4 * Here is a page with some EDBus examples:
5 *
6 * @li @ref banshee
7 * @li @ref simple_dbus_client
8 * @li @ref simple_dbus_server
9 * @li @ref complex_types
10 * @li @ref complex_types_server
11 * @li @ref connman
12 * @li @ref ofono
13 */
14
15/**
16 * @page banshee Banshee dbus client
17 *
18 * @include banshee.c
19 */
20
21/**
22 * @page simple_dbus_client Simple dbus client
23 *
24 * @include client.c
25 */
26
27/**
28 * @page simple_dbus_server Simple dbus server
29 *
30 * @include server.c
31 */
32
33/**
34 * @page complex_types Handling with dbus complex types
35 *
36 * @include complex_types.c
37 */
38
39/**
40 * @page complex_types_server Handling with dbus complex types server side
41 *
42 * @include complex_types_server.c
43 */
44
45/**
46 * @page connman Connman
47 *
48 * @include connman-list-services.c
49 */
50
51/**
52 * @page ofono Ofono
53 *
54 * @include ofono-dial.c
55 */
diff --git a/legacy/edbus/doc/foot.html b/legacy/edbus/doc/foot.html
new file mode 100644
index 0000000000..78ef911c72
--- /dev/null
+++ b/legacy/edbus/doc/foot.html
@@ -0,0 +1,19 @@
1
2 <div id="push"></div>
3 </div> <!-- #content -->
4 </div> <!-- .layout -->
5
6 </div> <!-- #container -->
7
8
9 <div id="footer">
10 <table><tr>
11 <td class="poweredby"><img src="doxygen.png"></td>
12 <td class="copyright">Copyright &copy;$year Enlightenment</td>
13 <td class="generated">Docs generated $datetime</td>
14 </tr></table>
15 </div>
16
17
18</body>
19</html>
diff --git a/legacy/edbus/doc/head.html b/legacy/edbus/doc/head.html
new file mode 100644
index 0000000000..2d841f12c9
--- /dev/null
+++ b/legacy/edbus/doc/head.html
@@ -0,0 +1,67 @@
1<html>
2<head>
3 <title>$title</title>
4 <meta http-equiv="content-type" content="text/html;charset=UTF-8">
5 <meta name="author" content="Andres Blanc" >
6
7 <link rel="icon" href="images/favicon.png" type="image/x-icon">
8 <link rel="shortcut icon" href="images/favicon.png" type="image/x-icon">
9 <link rel="icon" href="images/favicon.png" type="image/ico">
10 <link rel="shortcut icon" href="images/favicon.png" type="image/ico">
11
12 <link rel="stylesheet" type="text/css" media="screen" href="e.css">
13 <link rel="stylesheet" type="text/css" media="screen" href="edoxy.css">
14</head>
15
16<body>
17
18<div id="container">
19
20<div id="header">
21<div class="layout">
22
23 <h1><span>Enlightenment</span></h1>
24 <h2><span>Beauty at your fingertips</span></h2>
25
26 <div class="menu-container">
27 <div class="menu">
28 <ul>
29 <li class="current"><a href="http://web.enlightenment.org/p.php?p=docs">Docs</a></li>
30 <li><a href="http://trac.enlightenment.org/e">Tracker</a></li>
31 <li><a href="http://www.enlightenment.org/p.php?p=contact">Contact</a></li>
32 <li><a href="http://www.enlightenment.org/p.php?p=contribute">Contribute</a></li>
33 <li><a href="http://www.enlightenment.org/p.php?p=support">Support</a></li>
34 <li><a href="http://www.enlightenment.org/p.php?p=download">Download</a></li>
35 <li><a href="http://www.enlightenment.org/p.php?p=about">About</a></li>
36 <li><a href="http://www.enlightenment.org/p.php?p=news">News</a></li>
37 <li><a href="http://www.enlightenment.org/">Home</a></li>
38 </ul>
39 </div>
40 </div>
41
42 <div class="doxytitle">
43 $projectname Documentation <small>at $date</small>
44 </div>
45
46 <div class="menu-container">
47 <!--<div class="submenu">
48 <ul class="current">
49 <li><a href="group__EUkit__Group.html">EUkit</a></li>
50 <li><a href="group__EOfono__Group.html">EOfono</a></li>
51 <li><a href="group__ENotify__Group.html">ENotify</a></li>
52 <li><a href="group__EHal__Group.html">EHal</a></li>
53 <li><a href="group__EConnman__Group.html">EConnman</a></li>
54 <li><a href="group__EBluez__Group.html">EBluez</a></li>
55 <li><a href="group__EDbus__Group.html">EDbus</a></li>
56 <li class="current"><a href="index.html">Main Page</a></li>
57 </ul>
58 </div>-->
59 </div>
60
61
62 <div class="clear"></div>
63</div>
64</div>
65
66<div id="content">
67<div class="layout">
diff --git a/legacy/edbus/doc/images/e.png b/legacy/edbus/doc/images/e.png
new file mode 100644
index 0000000000..b3884a5cbc
--- /dev/null
+++ b/legacy/edbus/doc/images/e.png
Binary files differ
diff --git a/legacy/edbus/doc/images/edoxy.css b/legacy/edbus/doc/images/edoxy.css
new file mode 100644
index 0000000000..3caf7a9736
--- /dev/null
+++ b/legacy/edbus/doc/images/edoxy.css
@@ -0,0 +1,483 @@
1/*
2 * This file contain a custom doxygen style to match e.org graphics
3 */
4
5
6
7/* BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
8 font-family: Geneva, Arial, Helvetica, sans-serif;
9}*/
10BODY, TD {
11 font-size: 12px;
12}
13H1 {
14 text-align: center;
15 font-size: 160%;
16}
17H2 {
18 font-size: 120%;
19}
20H3 {
21 font-size: 100%;
22}
23CAPTION {
24 font-weight: bold
25}
26DIV.qindex {
27 width: 100%;
28 background-color: #e8eef2;
29 border: 1px solid #84b0c7;
30 text-align: center;
31 margin: 2px;
32 padding: 2px;
33 line-height: 140%;
34}
35DIV.navpath {
36 width: 100%;
37 background-color: #e8eef2;
38 border: 1px solid #84b0c7;
39 text-align: center;
40 margin: 2px;
41 padding: 2px;
42 line-height: 140%;
43}
44DIV.navtab {
45 background-color: #e8eef2;
46 border: 1px solid #84b0c7;
47 text-align: center;
48 margin: 2px;
49 margin-right: 15px;
50 padding: 2px;
51}
52TD.navtab {
53 font-size: 70%;
54}
55A.qindex {
56 text-decoration: none;
57 font-weight: bold;
58 color: #1A419D;
59}
60A.qindex:visited {
61 text-decoration: none;
62 font-weight: bold;
63 color: #1A419D
64}
65A.qindex:hover {
66 text-decoration: none;
67 background-color: #ddddff;
68}
69A.qindexHL {
70 text-decoration: none;
71 font-weight: bold;
72 background-color: #6666cc;
73 color: #ffffff;
74 border: 1px double #9295C2;
75}
76A.qindexHL:hover {
77 text-decoration: none;
78 background-color: #6666cc;
79 color: #ffffff;
80}
81A.qindexHL:visited {
82 text-decoration: none;
83 background-color: #6666cc;
84 color: #ffffff
85}
86A.el {
87 text-decoration: none;
88 font-weight: bold
89}
90A.elRef {
91 font-weight: bold
92}
93A.code:link {
94 text-decoration: none;
95 font-weight: normal;
96 color: #0000FF
97}
98A.code:visited {
99 text-decoration: none;
100 font-weight: normal;
101 color: #0000FF
102}
103A.codeRef:link {
104 font-weight: normal;
105 color: #0000FF
106}
107A.codeRef:visited {
108 font-weight: normal;
109 color: #0000FF
110}
111A:hover, A:visited:hover {
112 text-decoration: none;
113 /* background-color: #f2f2ff; */
114 color: #000055;
115}
116A.anchor {
117 color: #000;
118}
119DL.el {
120 margin-left: -1cm
121}
122.fragment {
123 font-family: monospace, fixed;
124 font-size: 95%;
125}
126PRE.fragment {
127 border: 1px solid #CCCCCC;
128 background-color: #f5f5f5;
129 margin-top: 4px;
130 margin-bottom: 4px;
131 margin-left: 2px;
132 margin-right: 8px;
133 padding-left: 6px;
134 padding-right: 6px;
135 padding-top: 4px;
136 padding-bottom: 4px;
137}
138DIV.ah {
139 background-color: black;
140 font-weight: bold;
141 color: #ffffff;
142 margin-bottom: 3px;
143 margin-top: 3px
144}
145
146DIV.groupHeader {
147 margin-left: 16px;
148 margin-top: 12px;
149 margin-bottom: 6px;
150 font-weight: bold;
151}
152DIV.groupText {
153 margin-left: 16px;
154 font-style: italic;
155 font-size: 90%
156}
157/*BODY {
158 background: white;
159 color: black;
160 margin-right: 20px;
161 margin-left: 20px;
162}*/
163TD.indexkey {
164 background-color: #e8eef2;
165 font-weight: bold;
166 padding-right : 10px;
167 padding-top : 2px;
168 padding-left : 10px;
169 padding-bottom : 2px;
170 margin-left : 0px;
171 margin-right : 0px;
172 margin-top : 2px;
173 margin-bottom : 2px;
174 border: 1px solid #CCCCCC;
175}
176TD.indexvalue {
177 background-color: #e8eef2;
178 font-style: italic;
179 padding-right : 10px;
180 padding-top : 2px;
181 padding-left : 10px;
182 padding-bottom : 2px;
183 margin-left : 0px;
184 margin-right : 0px;
185 margin-top : 2px;
186 margin-bottom : 2px;
187 border: 1px solid #CCCCCC;
188}
189TR.memlist {
190 background-color: #f0f0f0;
191}
192P.formulaDsp {
193 text-align: center;
194}
195IMG.formulaDsp {
196}
197IMG.formulaInl {
198 vertical-align: middle;
199}
200SPAN.keyword { color: #008000 }
201SPAN.keywordtype { color: #604020 }
202SPAN.keywordflow { color: #e08000 }
203SPAN.comment { color: #800000 }
204SPAN.preprocessor { color: #806020 }
205SPAN.stringliteral { color: #002080 }
206SPAN.charliteral { color: #008080 }
207SPAN.vhdldigit { color: #ff00ff }
208SPAN.vhdlchar { color: #000000 }
209SPAN.vhdlkeyword { color: #700070 }
210SPAN.vhdllogic { color: #ff0000 }
211
212.mdescLeft {
213 padding: 0px 8px 4px 8px;
214 font-size: 80%;
215 font-style: italic;
216 background-color: #FAFAFA;
217 border-top: 1px none #E0E0E0;
218 border-right: 1px none #E0E0E0;
219 border-bottom: 1px none #E0E0E0;
220 border-left: 1px none #E0E0E0;
221 margin: 0px;
222}
223.mdescRight {
224 padding: 0px 8px 4px 8px;
225 font-size: 80%;
226 font-style: italic;
227 background-color: #FAFAFA;
228 border-top: 1px none #E0E0E0;
229 border-right: 1px none #E0E0E0;
230 border-bottom: 1px none #E0E0E0;
231 border-left: 1px none #E0E0E0;
232 margin: 0px;
233}
234.memItemLeft {
235 padding: 1px 0px 0px 8px;
236 margin: 4px;
237 border-top-width: 1px;
238 border-right-width: 1px;
239 border-bottom-width: 1px;
240 border-left-width: 1px;
241 border-top-color: #E0E0E0;
242 border-right-color: #E0E0E0;
243 border-bottom-color: #E0E0E0;
244 border-left-color: #E0E0E0;
245 border-top-style: solid;
246 border-right-style: none;
247 border-bottom-style: none;
248 border-left-style: none;
249 background-color: #FAFAFA;
250 font-size: 80%;
251}
252.memItemRight {
253 padding: 1px 8px 0px 8px;
254 margin: 4px;
255 border-top-width: 1px;
256 border-right-width: 1px;
257 border-bottom-width: 1px;
258 border-left-width: 1px;
259 border-top-color: #E0E0E0;
260 border-right-color: #E0E0E0;
261 border-bottom-color: #E0E0E0;
262 border-left-color: #E0E0E0;
263 border-top-style: solid;
264 border-right-style: none;
265 border-bottom-style: none;
266 border-left-style: none;
267 background-color: #FAFAFA;
268 font-size: 80%;
269}
270.memTemplItemLeft {
271 padding: 1px 0px 0px 8px;
272 margin: 4px;
273 border-top-width: 1px;
274 border-right-width: 1px;
275 border-bottom-width: 1px;
276 border-left-width: 1px;
277 border-top-color: #E0E0E0;
278 border-right-color: #E0E0E0;
279 border-bottom-color: #E0E0E0;
280 border-left-color: #E0E0E0;
281 border-top-style: none;
282 border-right-style: none;
283 border-bottom-style: none;
284 border-left-style: none;
285 background-color: #FAFAFA;
286 font-size: 80%;
287}
288.memTemplItemRight {
289 padding: 1px 8px 0px 8px;
290 margin: 4px;
291 border-top-width: 1px;
292 border-right-width: 1px;
293 border-bottom-width: 1px;
294 border-left-width: 1px;
295 border-top-color: #E0E0E0;
296 border-right-color: #E0E0E0;
297 border-bottom-color: #E0E0E0;
298 border-left-color: #E0E0E0;
299 border-top-style: none;
300 border-right-style: none;
301 border-bottom-style: none;
302 border-left-style: none;
303 background-color: #FAFAFA;
304 font-size: 80%;
305}
306.memTemplParams {
307 padding: 1px 0px 0px 8px;
308 margin: 4px;
309 border-top-width: 1px;
310 border-right-width: 1px;
311 border-bottom-width: 1px;
312 border-left-width: 1px;
313 border-top-color: #E0E0E0;
314 border-right-color: #E0E0E0;
315 border-bottom-color: #E0E0E0;
316 border-left-color: #E0E0E0;
317 border-top-style: solid;
318 border-right-style: none;
319 border-bottom-style: none;
320 border-left-style: none;
321 color: #606060;
322 background-color: #FAFAFA;
323 font-size: 80%;
324}
325.search {
326 color: #003399;
327 font-weight: bold;
328}
329FORM.search {
330 margin-bottom: 0px;
331 margin-top: 0px;
332}
333INPUT.search {
334 font-size: 75%;
335 color: #000080;
336 font-weight: normal;
337 background-color: #e8eef2;
338}
339TD.tiny {
340 font-size: 75%;
341}
342a {
343 color: #1A41A8;
344}
345a:visited {
346 color: #2A3798;
347}
348.dirtab {
349 padding: 4px;
350 border-collapse: collapse;
351 border: 1px solid #84b0c7;
352}
353TH.dirtab {
354 background: #e8eef2;
355 font-weight: bold;
356}
357HR {
358 height: 1px;
359 border: none;
360 border-top: 1px solid black;
361}
362
363/* Style for detailed member documentation */
364.memtemplate {
365 font-size: 80%;
366 color: #606060;
367 font-weight: normal;
368 margin-left: 3px;
369}
370.memnav {
371 background-color: #e8eef2;
372 border: 1px solid #84b0c7;
373 text-align: center;
374 margin: 2px;
375 margin-right: 15px;
376 padding: 2px;
377}
378.memitem {
379 padding: 4px;
380 background-color: #eef3f5;
381 border-width: 1px;
382 border-style: solid;
383 border-color: #dedeee;
384 -moz-border-radius: 8px 8px 8px 8px;
385}
386.memname {
387 white-space: nowrap;
388 font-weight: bold;
389}
390.memdoc{
391 padding-left: 10px;
392}
393.memproto {
394 background-color: #d5e1e8;
395 width: 100%;
396 border-width: 1px;
397 border-style: solid;
398 border-color: #84b0c7;
399 font-weight: bold;
400 -moz-border-radius: 8px 8px 8px 8px;
401}
402.paramkey {
403 text-align: right;
404}
405.paramtype {
406 white-space: nowrap;
407}
408.paramname {
409 color: #602020;
410 font-style: italic;
411 white-space: nowrap;
412}
413/* End Styling for detailed member documentation */
414
415/* for the tree view */
416.ftvtree {
417 font-family: sans-serif;
418 margin:0.5em;
419}
420/* these are for tree view when used as main index */
421.directory {
422 font-size: 9pt;
423 font-weight: bold;
424}
425.directory h3 {
426 margin: 0px;
427 margin-top: 1em;
428 font-size: 11pt;
429}
430
431/* The following two styles can be used to replace the root node title */
432/* with an image of your choice. Simply uncomment the next two styles, */
433/* specify the name of your image and be sure to set 'height' to the */
434/* proper pixel height of your image. */
435
436/* .directory h3.swap { */
437/* height: 61px; */
438/* background-repeat: no-repeat; */
439/* background-image: url("yourimage.gif"); */
440/* } */
441/* .directory h3.swap span { */
442/* display: none; */
443/* } */
444
445.directory > h3 {
446 margin-top: 0;
447}
448.directory p {
449 margin: 0px;
450 white-space: nowrap;
451}
452.directory div {
453 display: none;
454 margin: 0px;
455}
456.directory img {
457 vertical-align: -30%;
458}
459/* these are for tree view when not used as main index */
460.directory-alt {
461 font-size: 100%;
462 font-weight: bold;
463}
464.directory-alt h3 {
465 margin: 0px;
466 margin-top: 1em;
467 font-size: 11pt;
468}
469.directory-alt > h3 {
470 margin-top: 0;
471}
472.directory-alt p {
473 margin: 0px;
474 white-space: nowrap;
475}
476.directory-alt div {
477 display: none;
478 margin: 0px;
479}
480.directory-alt img {
481 vertical-align: -30%;
482}
483
diff --git a/legacy/edbus/doc/images/foot_bg.png b/legacy/edbus/doc/images/foot_bg.png
new file mode 100644
index 0000000000..b24f3a48b4
--- /dev/null
+++ b/legacy/edbus/doc/images/foot_bg.png
Binary files differ
diff --git a/legacy/edbus/doc/images/head_bg.png b/legacy/edbus/doc/images/head_bg.png
new file mode 100644
index 0000000000..081dc131e4
--- /dev/null
+++ b/legacy/edbus/doc/images/head_bg.png
Binary files differ
diff --git a/legacy/edbus/doc/images/menu_bg.png b/legacy/edbus/doc/images/menu_bg.png
new file mode 100644
index 0000000000..e978743651
--- /dev/null
+++ b/legacy/edbus/doc/images/menu_bg.png
Binary files differ
diff --git a/legacy/edbus/doc/images/menu_bg_current.png b/legacy/edbus/doc/images/menu_bg_current.png
new file mode 100644
index 0000000000..de97c9268e
--- /dev/null
+++ b/legacy/edbus/doc/images/menu_bg_current.png
Binary files differ
diff --git a/legacy/edbus/doc/images/menu_bg_hover.png b/legacy/edbus/doc/images/menu_bg_hover.png
new file mode 100644
index 0000000000..3fd851d075
--- /dev/null
+++ b/legacy/edbus/doc/images/menu_bg_hover.png
Binary files differ
diff --git a/legacy/edbus/doc/images/menu_bg_last.png b/legacy/edbus/doc/images/menu_bg_last.png
new file mode 100644
index 0000000000..88c116c8c8
--- /dev/null
+++ b/legacy/edbus/doc/images/menu_bg_last.png
Binary files differ
diff --git a/legacy/edbus/doc/images/menu_bg_unsel.png b/legacy/edbus/doc/images/menu_bg_unsel.png
new file mode 100644
index 0000000000..50e5fd8d3d
--- /dev/null
+++ b/legacy/edbus/doc/images/menu_bg_unsel.png
Binary files differ
diff --git a/legacy/edbus/edbus.pc.in b/legacy/edbus/edbus.pc.in
new file mode 100644
index 0000000000..7842ec8969
--- /dev/null
+++ b/legacy/edbus/edbus.pc.in
@@ -0,0 +1,11 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@
5
6Name: edbus
7Description: D-Bus access from Ecore
8Requires.private: ecore dbus-1
9Version: @VERSION@
10Libs: -L${libdir} -ledbus
11Cflags: -I${includedir}
diff --git a/legacy/edbus/m4/ac_attribute.m4 b/legacy/edbus/m4/ac_attribute.m4
new file mode 100644
index 0000000000..23479a92ac
--- /dev/null
+++ b/legacy/edbus/m4/ac_attribute.m4
@@ -0,0 +1,47 @@
1dnl Copyright (C) 2004-2008 Kim Woelders
2dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
3dnl That code is public domain and can be freely used or copied.
4dnl Originally snatched from somewhere...
5
6dnl Macro for checking if the compiler supports __attribute__
7
8dnl Usage: AC_C___ATTRIBUTE__
9dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
10dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
11dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
12dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
13dnl defined to nothing.
14
15AC_DEFUN([AC_C___ATTRIBUTE__],
16[
17
18AC_MSG_CHECKING([for __attribute__])
19
20AC_CACHE_VAL([ac_cv___attribute__],
21 [AC_TRY_COMPILE(
22 [
23#include <stdlib.h>
24
25int func(int x);
26int foo(int x __attribute__ ((unused)))
27{
28 exit(1);
29}
30 ],
31 [],
32 [ac_cv___attribute__="yes"],
33 [ac_cv___attribute__="no"]
34 )])
35
36AC_MSG_RESULT($ac_cv___attribute__)
37
38if test "x${ac_cv___attribute__}" = "xyes" ; then
39 AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
40 AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
41 else
42 AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
43fi
44
45])
46
47dnl End of ac_attribute.m4
diff --git a/legacy/edbus/m4/ac_valist.m4 b/legacy/edbus/m4/ac_valist.m4
new file mode 100644
index 0000000000..a4d6a24932
--- /dev/null
+++ b/legacy/edbus/m4/ac_valist.m4
@@ -0,0 +1,48 @@
1dnl That code is public domain and can be freely used or copied.
2dnl Originally snatched from somewhere...
3
4dnl Macro for checking if va_list is an array
5
6dnl Usage: AC_C_VA_LIST_AS_ARRAY
7dnl call AC_DEFINE for HAVE_VA_LIST_AS_ARRAY
8dnl if for this architecture va_list is defined as an array
9
10AC_DEFUN([AC_C_VA_LIST_AS_ARRAY],
11[
12
13AC_MSG_CHECKING([whether va_list is defined as an array])
14
15AC_CACHE_VAL([ac_cv_valistasarray],
16 [AC_TRY_RUN(
17 [
18#include <stdlib.h>
19#include <stdarg.h>
20void foo(int i, ...)
21{
22 va_list ap1, ap2;
23 va_start(ap1, i);
24 ap2 = ap1;
25 if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123)
26 exit(1);
27 va_end(ap1);
28}
29int main(void)
30{
31 foo(0, 123);
32 return(0);
33}
34 ],
35 [ac_cv_valistasarray="no"],
36 [ac_cv_valistasarray="yes"],
37 [ac_cv_valistasarray="no"]
38 )])
39
40AC_MSG_RESULT($ac_cv_valistasarray)
41
42if test "x${ac_cv_valistasarray}" = "xyes" ; then
43 AC_DEFINE([HAVE_VA_LIST_AS_ARRAY], [1], [Define to 1 if va_list is an array])
44fi
45
46])
47
48dnl End of ac_valist.m4
diff --git a/legacy/edbus/m4/efl_compiler_flag.m4 b/legacy/edbus/m4/efl_compiler_flag.m4
new file mode 100644
index 0000000000..e3fc8217b8
--- /dev/null
+++ b/legacy/edbus/m4/efl_compiler_flag.m4
@@ -0,0 +1,24 @@
1dnl Checks if a given compiler switch is supported.
2dnl If so, this macro adds the flag to the CFLAGS
3
4AC_DEFUN([EFL_COMPILER_FLAG],
5[
6
7CFLAGS_save="${CFLAGS}"
8CFLAGS="${CFLAGS} $1"
9
10AC_LANG_PUSH([C])
11AC_MSG_CHECKING([whether the compiler supports $1])
12
13AC_COMPILE_IFELSE(
14 [AC_LANG_PROGRAM([[]])],
15 [have_flag="yes"],
16 [have_flag="no"])
17AC_MSG_RESULT([${have_flag}])
18
19if test "x${have_flag}" = "xno" ; then
20 CFLAGS="${CFLAGS_save}"
21fi
22AC_LANG_POP([C])
23
24])
diff --git a/legacy/edbus/m4/efl_doxygen.m4 b/legacy/edbus/m4/efl_doxygen.m4
new file mode 100644
index 0000000000..7324af3e42
--- /dev/null
+++ b/legacy/edbus/m4/efl_doxygen.m4
@@ -0,0 +1,94 @@
1dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if doxygen is available or not.
5
6dnl EFL_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Test for the doxygen program
8dnl Defines efl_doxygen
9dnl Defines the automake conditionnal EFL_BUILD_DOC
10dnl
11AC_DEFUN([EFL_CHECK_DOXYGEN],
12[
13
14dnl
15dnl Disable the build of the documentation
16dnl
17AC_ARG_ENABLE([doc],
18 [AC_HELP_STRING(
19 [--disable-doc],
20 [Disable documentation build @<:@default=enabled@:>@])],
21 [
22 if test "x${enableval}" = "xyes" ; then
23 efl_enable_doc="yes"
24 else
25 efl_enable_doc="no"
26 fi
27 ],
28 [efl_enable_doc="yes"])
29
30AC_MSG_CHECKING([whether to build documentation])
31AC_MSG_RESULT([${efl_enable_doc}])
32
33if test "x${efl_enable_doc}" = "xyes" ; then
34
35dnl Specify the file name, without path
36
37 efl_doxygen="doxygen"
38
39 AC_ARG_WITH([doxygen],
40 [AC_HELP_STRING(
41 [--with-doxygen=FILE],
42 [doxygen program to use @<:@default=doxygen@:>@])],
43
44dnl Check the given doxygen program.
45
46 [efl_doxygen=${withval}
47 AC_CHECK_PROG([efl_have_doxygen],
48 [${efl_doxygen}],
49 [yes],
50 [no])
51 if test "x${efl_have_doxygen}" = "xno" ; then
52 echo "WARNING:"
53 echo "The doxygen program you specified:"
54 echo "${efl_doxygen}"
55 echo "was not found. Please check the path and make sure "
56 echo "the program exists and is executable."
57 AC_MSG_WARN([no doxygen detected. Documentation will not be built])
58 fi
59 ],
60 [AC_CHECK_PROG([efl_have_doxygen],
61 [${efl_doxygen}],
62 [yes],
63 [no])
64 if test "x${efl_have_doxygen}" = "xno" ; then
65 echo "WARNING:"
66 echo "The doxygen program was not found in your execute path."
67 echo "You may have doxygen installed somewhere not covered by your path."
68 echo ""
69 echo "If this is the case make sure you have the packages installed, AND"
70 echo "that the doxygen program is in your execute path (see your"
71 echo "shell manual page on setting the \$PATH environment variable), OR"
72 echo "alternatively, specify the program to use with --with-doxygen."
73 AC_MSG_WARN([no doxygen detected. Documentation will not be built])
74 fi
75 ])
76else
77 efl_have_doxygen="no"
78fi
79
80dnl
81dnl Substitution
82dnl
83AC_SUBST([efl_doxygen])
84
85if ! test "x${efl_have_doxygen}" = "xyes" ; then
86 efl_enable_doc="no"
87fi
88
89AM_CONDITIONAL(EFL_BUILD_DOC, test "x${efl_have_doxygen}" = "xyes")
90
91AS_IF([test "x$efl_have_doxygen" = "xyes"], [$1], [$2])
92])
93
94dnl End of efl_doxygen.m4
diff --git a/legacy/edbus/src/examples/banshee.c b/legacy/edbus/src/examples/banshee.c
new file mode 100644
index 0000000000..2134c26028
--- /dev/null
+++ b/legacy/edbus/src/examples/banshee.c
@@ -0,0 +1,293 @@
1#include "EDBus.h"
2#include <Ecore.h>
3
4static Eina_Bool
5_timer1_cb(void *data)
6{
7 printf("\n## ecore_main_loop_quit()\n");
8 ecore_main_loop_quit();
9 return EINA_TRUE;
10}
11
12EDBus_Connection *conn;
13EDBus_Signal_Handler *sh, *sh2, *sh3, *sh4;
14
15static void
16on_get_playlists(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
17{
18 const char *errname, *errmsg;
19 EDBus_Message_Iter *array, *struct_entry;
20 char *path, *name, *image;
21 int i = 0;
22
23 if (edbus_message_error_get(msg, &errname, &errmsg))
24 {
25 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
26 return;
27 }
28
29 if (!edbus_message_arguments_get(msg, "a(oss)", &array))
30 {
31 fprintf(stderr, "Error: could not get entry contents\n");
32 return;
33 }
34 printf("on_get_playlists() \n\n");
35 while (edbus_message_iter_get_and_next(array, 'r', &struct_entry))
36 {
37 if (! edbus_message_iter_arguments_get(struct_entry, "oss", &path, &name, &image))
38 {
39 printf("error on edbus_massage_iterator_arguments_get()");
40 return;
41 }
42 i++;
43 printf("%d - %s | %s | %s\n", i, path, name, image);
44 }
45 printf("end of on_get_playlists()\n\n");
46}
47
48static void
49on_introspect(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
50{
51 const char *errname, *errmsg, *string;
52
53 if (edbus_message_error_get(msg, &errname, &errmsg))
54 {
55 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
56 return;
57 }
58
59 if (!edbus_message_arguments_get(msg, "s", &string))
60 {
61 fprintf(stderr, "Error: could not get entry contents\n");
62 return;
63 }
64
65 printf("on_introspect() data=\n%s\n\n", string);
66}
67
68static void
69on_next(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
70{
71 const char *errname, *errmsg;
72
73 printf("on_next()\n");
74
75 if (edbus_message_error_get(msg, &errname, &errmsg))
76 {
77 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
78 }
79}
80
81static void
82on_pause(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
83{
84 const char *errname, *errmsg;
85
86 printf("on_pause()\n");
87
88 if (edbus_message_error_get(msg, &errname, &errmsg))
89 {
90 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
91 }
92}
93
94static void
95on_state_changed(void *data, const EDBus_Message *msg)
96{
97 char *status;
98 if (edbus_message_error_get(msg, NULL, NULL))
99 {
100 fprintf(stderr, "on_state_changed error\n");
101 return;
102 }
103
104 if (!edbus_message_arguments_get(msg, "s", &status))
105 {
106 fprintf(stderr, "Error: could not get entry contents\n");
107 return;
108 }
109
110 printf("on_state_changed = %s\n", status);
111}
112
113static void
114on_state_changed2(void *data, const EDBus_Message *msg)
115{
116 char *status;
117 if (edbus_message_error_get(msg, NULL, NULL))
118 {
119 fprintf(stderr, "on_state_changed error\n");
120 return;
121 }
122
123 if (!edbus_message_arguments_get(msg, "s", &status))
124 {
125 fprintf(stderr, "Error: could not get entry contents\n");
126 return;
127 }
128
129 printf("on_state_changed2 = %s\n", status);
130 edbus_signal_handler_unref(sh2);
131 sh2 = NULL;
132}
133
134static void
135on_name_owner_changed_by_id(void *data, const EDBus_Message *msg)
136{
137 char *bus, *older_id, *new_id;
138
139 if (edbus_message_error_get(msg, NULL, NULL))
140 return;
141 if (!edbus_message_arguments_get(msg, "sss", &bus, &older_id, &new_id))
142 printf("Error getting arguments from NameOwnerChanged");
143
144 printf("on_name_owner_changed_by_id bus = %s older=%s new=%s\n\n",
145 bus, older_id, new_id);
146
147 if (!new_id[0])
148 edbus_signal_handler_unref(sh3);
149}
150
151static void
152on_name_owner_changed(void *data, const EDBus_Message *msg)
153{
154 char *bus, *older_id, *new_id;
155 const char *name, *text;
156
157 if (edbus_message_error_get(msg, &name, &text))
158 printf("NameOwnerChanged name=%s text=%s", name, text);
159 if (!edbus_message_arguments_get(msg, "sss", &bus, &older_id, &new_id))
160 printf("Error getting arguments from NameOwnerChanged");
161
162 printf("bus = %s older=%s new=%s\n\n", bus, older_id, new_id);
163
164 if (new_id[0])
165 {
166 sh4 = edbus_signal_handler_add(conn,
167 EDBUS_FDO_BUS,
168 EDBUS_FDO_PATH,
169 EDBUS_FDO_INTERFACE,
170 "NameOwnerChanged",
171 on_name_owner_changed_by_id,
172 NULL);
173 edbus_signal_handler_match_extra_set(sh4, "arg1", new_id, NULL);
174 }
175}
176
177int
178main(void)
179{
180 EDBus_Object *player_engine_obj, *playback_controller_obj, *mediaplayer2_obj;
181 EDBus_Proxy *player_engine, *playback_controler, *introspectable, *playlists;
182 EDBus_Pending *pending;
183 unsigned int bool2 = 1;
184 unsigned int playlist_index = 0;
185 unsigned int playlist_max_count = 30;
186 unsigned int playlist_reverse_order = 0;
187 const char *playlist_order = "asc";
188
189 ecore_init();
190 edbus_init();
191
192 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
193
194 player_engine_obj = edbus_object_get(conn, "org.bansheeproject.Banshee",
195 "/org/bansheeproject/Banshee/PlayerEngine");
196 if (!player_engine_obj)
197 {
198 fprintf(stderr, "Error: could not get object\n");
199 return EXIT_FAILURE;
200 }
201
202 playback_controller_obj = edbus_object_get(conn, "org.bansheeproject.Banshee",
203 "/org/bansheeproject/Banshee/PlaybackController");
204
205 mediaplayer2_obj = edbus_object_get(conn, "org.bansheeproject.Banshee",
206 "/org/mpris/MediaPlayer2");
207
208 player_engine = edbus_proxy_get(player_engine_obj,
209 "org.bansheeproject.Banshee.PlayerEngine");
210 if (!player_engine)
211 {
212 fprintf(stderr, "Error: could not get binding\n");
213 return EXIT_FAILURE;
214 }
215
216 introspectable = edbus_proxy_get(player_engine_obj,
217 "org.freedesktop.DBus.Introspectable");
218 if (!introspectable)
219 {
220 fprintf(stderr, "Error: could not get binding\n");
221 return EXIT_FAILURE;
222 }
223
224 playback_controler = edbus_proxy_get(playback_controller_obj,
225 "org.bansheeproject.Banshee.PlaybackController");
226 if (!playback_controler)
227 {
228 fprintf(stderr, "Error: could not get binding\n");
229 return EXIT_FAILURE;
230 }
231 edbus_proxy_signal_handler_add(player_engine, "StateChanged", on_state_changed, NULL);
232
233 playlists = edbus_proxy_get(mediaplayer2_obj, "org.mpris.MediaPlayer2.Playlists");
234
235 pending = edbus_proxy_call(introspectable, "Introspect", on_introspect, NULL, -1, "");
236 if (!pending)
237 {
238 fprintf(stderr, "Error: could not call\n");
239 return EXIT_FAILURE;
240 }
241
242 pending = edbus_proxy_call(player_engine, "Pause", on_pause, NULL, -1, "");
243 if (!pending)
244 {
245 fprintf(stderr, "Error: could not call\n");
246 return EXIT_FAILURE;
247 }
248
249 pending = edbus_proxy_call(playback_controler, "Next", on_next, NULL, -1, "b", bool2);
250 if (!pending)
251 {
252 fprintf(stderr, "Error: could not call\n");
253 return EXIT_FAILURE;
254 }
255
256 edbus_proxy_call(playlists, "GetPlaylists", on_get_playlists, NULL, -1,
257 "uusb", playlist_index, playlist_max_count,
258 playlist_order, playlist_reverse_order);
259
260 sh = edbus_signal_handler_add(conn, "org.bansheeproject.Banshee",
261 "/org/bansheeproject/Banshee/PlayerEngine",
262 "org.bansheeproject.Banshee.PlayerEngine",
263 "StateChanged", on_state_changed, NULL);
264
265 sh2 = edbus_signal_handler_add(conn, "org.bansheeproject.Banshee",
266 "/org/bansheeproject/Banshee/PlayerEngine",
267 "org.bansheeproject.Banshee.PlayerEngine",
268 "StateChanged", on_state_changed2, NULL);
269
270 sh3 = edbus_signal_handler_add(conn,
271 EDBUS_FDO_BUS,
272 EDBUS_FDO_PATH,
273 EDBUS_FDO_INTERFACE,
274 "NameOwnerChanged",
275 on_name_owner_changed,
276 NULL);
277 edbus_signal_handler_match_extra_set(sh3, "arg0", "org.bansheeproject.Banshee", NULL);
278
279 ecore_timer_add(50, _timer1_cb, NULL);
280
281 ecore_main_loop_begin();
282
283 edbus_signal_handler_unref(sh);
284 edbus_proxy_unref(playback_controler);
285 edbus_proxy_unref(introspectable);
286 edbus_object_unref(player_engine_obj);
287 edbus_connection_unref(conn);
288
289 edbus_shutdown();
290 ecore_shutdown();
291 return 0;
292}
293
diff --git a/legacy/edbus/src/examples/client.c b/legacy/edbus/src/examples/client.c
new file mode 100644
index 0000000000..80ae728e72
--- /dev/null
+++ b/legacy/edbus/src/examples/client.c
@@ -0,0 +1,255 @@
1#include "EDBus.h"
2#include <Ecore.h>
3
4#define BUS "org.Enlightenment"
5#define PATH "/org/enlightenment"
6#define INTERFACE "org.enlightenment.Test"
7#define NTESTS 7
8
9static int i = 0;
10static EDBus_Signal_Handler *sh;
11
12static void
13_on_alive(void *context, const EDBus_Message *msg)
14{
15 printf("Alive\n\n");
16}
17
18static void
19_on_alive2(void *context, const EDBus_Message *msg)
20{
21 printf("Alive2\n\n");
22 i++;
23 if (i == 2)
24 edbus_signal_handler_unref(sh);
25}
26
27static void
28_on_hello(void *context, const EDBus_Message *msg)
29{
30 char *txt;
31
32 if (edbus_message_arguments_get(msg, "s", &txt))
33 printf("%s\n", txt);
34}
35
36#define bool_value EINA_TRUE
37#define byte_value 0xAA
38#define uint32_value 0xFFFFFFFF
39#define int32_value 0xFFFFFFFF
40#define int16_value 0x0000FFFF
41#define double_value 3.1415926
42#define string_value "test"
43
44static void
45test(void)
46{
47 static int n = 0;
48
49 n++;
50 if (n == NTESTS)
51 printf("Passed in all tests\n");
52}
53
54static void
55_on_send_bool(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
56{
57 const char *errname, *errmsg;
58 Eina_Bool bool;
59 if (edbus_message_error_get(msg, &errname, &errmsg))
60 {
61 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
62 return;
63 }
64
65 if (!edbus_message_arguments_get(msg, "b", &bool))
66 {
67 fprintf(stderr, "Error: could not get entry contents\n");
68 return;
69 }
70
71 if (bool != bool_value) printf("Error on bool\n");
72 else test();
73}
74
75static void
76_on_send_byte(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
77{
78 const char *errname, *errmsg;
79 unsigned char byte;
80 if (edbus_message_error_get(msg, &errname, &errmsg))
81 {
82 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
83 return;
84 }
85
86 if (!edbus_message_arguments_get(msg, "y", &byte))
87 {
88 fprintf(stderr, "Error: could not get entry contents\n");
89 return;
90 }
91
92 if (byte != byte_value) printf("Error on byte\n");
93 else test();
94}
95
96static void
97_on_send_uint32(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
98{
99 const char *errname, *errmsg;
100 unsigned int uint32;
101 if (edbus_message_error_get(msg, &errname, &errmsg))
102 {
103 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
104 return;
105 }
106
107 if (!edbus_message_arguments_get(msg, "u", &uint32))
108 {
109 fprintf(stderr, "Error: could not get entry contents\n");
110 return;
111 }
112
113 if (uint32 != uint32_value) printf("Error on uint32\n");
114 else test();
115}
116
117static void
118_on_send_int32(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
119{
120 const char *errname, *errmsg;
121 int int32;
122 if (edbus_message_error_get(msg, &errname, &errmsg))
123 {
124 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
125 return;
126 }
127
128 if (!edbus_message_arguments_get(msg, "i", &int32))
129 {
130 fprintf(stderr, "Error: could not get entry contents\n");
131 return;
132 }
133
134 if (int32 != (int)int32_value) printf("Error on int32\n");
135 else test();
136}
137
138static void
139_on_send_int16(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
140{
141 const char *errname, *errmsg;
142 short int int16;
143 if (edbus_message_error_get(msg, &errname, &errmsg))
144 {
145 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
146 return;
147 }
148
149 if (!edbus_message_arguments_get(msg, "n", &int16))
150 {
151 fprintf(stderr, "Error: could not get entry contents\n");
152 return;
153 }
154
155 if (int16 != (short int)int16_value) printf("Error on int16\n");
156 else test();
157}
158
159static void
160_on_send_double(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
161{
162 const char *errname, *errmsg;
163 double d;
164 if (edbus_message_error_get(msg, &errname, &errmsg))
165 {
166 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
167 return;
168 }
169
170 if (!edbus_message_arguments_get(msg, "d", &d))
171 {
172 fprintf(stderr, "Error: could not get entry contents\n");
173 return;
174 }
175
176 if (d != double_value) printf("Error on double\n");
177 else test();
178}
179
180static void
181_on_send_string(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
182{
183 const char *errname, *errmsg;
184 char *str;
185 if (edbus_message_error_get(msg, &errname, &errmsg))
186 {
187 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
188 return;
189 }
190
191 if (!edbus_message_arguments_get(msg, "s", &str))
192 {
193 fprintf(stderr, "Error: could not get entry contents\n");
194 return;
195 }
196
197 if (strcmp(str, string_value)) printf("Error on string\n");
198 else test();
199}
200
201static void
202_on_async_test(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
203{
204 const char *errname, *errmsg;
205 char *str;
206 if (edbus_message_error_get(msg, &errname, &errmsg))
207 {
208 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
209 return;
210 }
211
212 if (!edbus_message_arguments_get(msg, "s", &str))
213 {
214 fprintf(stderr, "Error: could not get entry contents\n");
215 return;
216 }
217
218 printf("%s\n", str);
219}
220
221int
222main(void)
223{
224 EDBus_Connection *conn;
225 EDBus_Object *obj;
226 EDBus_Proxy *proxy;
227
228 ecore_init();
229 edbus_init();
230
231 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
232
233 obj = edbus_object_get(conn, BUS, PATH);
234 proxy = edbus_proxy_get(obj, INTERFACE);
235 edbus_proxy_signal_handler_add(proxy, "Alive", _on_alive, NULL);
236 sh = edbus_proxy_signal_handler_add(proxy, "Alive", _on_alive2, NULL);
237 edbus_proxy_signal_handler_add(proxy, "Hello", _on_hello, NULL);
238
239 edbus_proxy_call(proxy, "SendBool", _on_send_bool, NULL, -1, "b", bool_value);
240 edbus_proxy_call(proxy, "SendByte", _on_send_byte, NULL, -1, "y", byte_value);
241 edbus_proxy_call(proxy, "SendUint32", _on_send_uint32, NULL, -1, "u", uint32_value);
242 edbus_proxy_call(proxy, "SendInt32", _on_send_int32, NULL, -1, "i", int32_value);
243 edbus_proxy_call(proxy, "SendInt16", _on_send_int16, NULL, -1, "n", int16_value);
244 edbus_proxy_call(proxy, "SendDouble", _on_send_double, NULL, -1, "d", double_value);
245 edbus_proxy_call(proxy, "SendString", _on_send_string, NULL, -1, "s", string_value);
246 edbus_proxy_call(proxy, "AsyncTest", _on_async_test, NULL, -1, "");
247
248 ecore_main_loop_begin();
249
250 edbus_connection_unref(conn);
251
252 edbus_shutdown();
253 ecore_shutdown();
254 return 0;
255}
diff --git a/legacy/edbus/src/examples/complex_types.c b/legacy/edbus/src/examples/complex_types.c
new file mode 100644
index 0000000000..4cdcf211d7
--- /dev/null
+++ b/legacy/edbus/src/examples/complex_types.c
@@ -0,0 +1,257 @@
1#include "EDBus.h"
2#include <Ecore.h>
3
4#define BUS "com.profusion"
5#define PATH "/com/profusion/Test"
6#define IFACE "com.profusion.Test"
7
8EDBus_Connection *conn;
9
10static Eina_Bool
11_timer1_cb(void *data)
12{
13 printf("\n## ecore_main_loop_quit()\n");
14 ecore_main_loop_quit();
15 return EINA_TRUE;
16}
17
18static void
19on_plus_one(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
20{
21 int num2 = 0;
22
23 if (edbus_message_error_get(msg, NULL, NULL))
24 {
25 printf("Message error\n\n");
26 return;
27 }
28 if (!edbus_message_arguments_get(msg, "i", &num2))
29 {
30 printf("Error getting arguments.");
31 return;
32 }
33
34 printf("on_plus_one() %d\n", num2);
35}
36
37static void
38set_property_resp2(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
39{
40 const char *errname;
41 const char *errmsg;
42
43 printf("set_property_resp2()\n");
44 if (edbus_message_error_get(msg, &errname, &errmsg))
45 {
46 printf("Message error %s - %s\n\n", errname, errmsg);
47 return;
48 }
49}
50
51static void
52get_property_resp2(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
53{
54 EDBus_Proxy *proxy = data;
55 EDBus_Message_Iter *variant = NULL;
56 char *type;
57 char *resp2;
58 const char *errname;
59 const char *errmsg;
60
61 printf("get_property_resp2()\n");
62 if (edbus_message_error_get(msg, &errname, &errmsg))
63 {
64 printf("Message error %s - %s\n\n", errname, errmsg);
65 return;
66 }
67 if (!edbus_message_arguments_get(msg, "v", &variant))
68 {
69 printf("Error getting arguments.");
70 return;
71 }
72
73 type = edbus_message_iter_signature_get(variant);
74 if (type[1])
75 {
76 printf("It is a complex type, not handle yet.\n\n");
77 return;
78 }
79 if (type[0] != 's')
80 {
81 printf("Expected type is string.\n\n");
82 return;
83 }
84 if (!edbus_message_iter_arguments_get(variant, "s", &resp2))
85 {
86 printf("error in edbus_message_iter_arguments_get()\n\n");
87 return;
88 }
89 printf("resp2=%s\n", resp2);
90 free(type);
91
92 edbus_proxy_property_set(proxy, "Resp2", 's', "lalala", set_property_resp2, NULL);
93}
94
95static void
96on_send_array_int(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
97{
98 EDBus_Message_Iter *array = NULL;
99 int num;
100
101 printf("on_send_array_int()\n");
102 if (edbus_message_error_get(msg, NULL, NULL))
103 {
104 printf("Message error\n\n");
105 return;
106 }
107 if (!edbus_message_arguments_get(msg, "ai", &array))
108 {
109 printf("Error getting arguments.");
110 return;
111 }
112
113 while (edbus_message_iter_get_and_next(array, 'i', &num))
114 {
115 printf("%d\n", num);
116 }
117}
118
119static void
120on_send_array(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
121{
122 EDBus_Message_Iter *array = NULL;
123 char *txt = NULL;
124 char *string[10];
125 int i = 0;
126 int z;
127
128 printf("on_send_array()\n");
129 if (edbus_message_error_get(msg, NULL, NULL))
130 {
131 printf("Message error\n\n");
132 return;
133 }
134 if (!edbus_message_arguments_get(msg, "as", &array))
135 {
136 printf("Error getting arguments.");
137 return;
138 }
139
140 while (edbus_message_iter_get_and_next(array, 's', &txt))
141 {
142 string[i] = txt;
143 i++;
144 }
145
146 for (z = 0; z < i; z++)
147 printf("string = %s\n", string[z]);
148}
149
150static void
151on_receive_array_with_size(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
152{
153 const char *errname;
154 const char *errmsg;
155
156 printf("on_receive_array_with_size()\n");
157 if (edbus_message_error_get(msg, &errname, &errmsg))
158 {
159 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
160 }
161}
162
163static void
164on_send_variant(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
165{
166 printf("on_send_variant()\n\n");
167}
168
169static void
170on_receive_array(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
171{
172 const char *errname;
173 const char *errmsg;
174
175 printf("on_receive_array()\n");
176 if (edbus_message_error_get(msg, &errname, &errmsg))
177 {
178 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
179 }
180}
181
182int
183main(void)
184{
185 EDBus_Object *test2_obj;
186 EDBus_Proxy *test2_proxy;
187 EDBus_Pending *pending;
188 EDBus_Message_Iter *iter, *array_of_string, *variant;
189 EDBus_Message *msg;
190 int size_of_array = 5;
191 const char *array[5] = { "aaaa", "bbbb", "cccc", "dddd", "eeee" };
192 int i;
193 int plus_one = 24;
194
195 ecore_init();
196 edbus_init();
197
198 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
199
200 test2_obj = edbus_object_get(conn, BUS, PATH);
201 test2_proxy = edbus_proxy_get(test2_obj, IFACE);
202
203 msg = edbus_proxy_method_call_new(test2_proxy, "ReceiveArray");
204 iter = edbus_message_iter_get(msg);
205 array_of_string = edbus_message_iter_container_new(iter, 'a',"s");
206 if (!array_of_string) printf("array_of_string == NULL\n\n");
207 for (i = 0; i < 5; i++)
208 edbus_message_iter_append_basic(array_of_string, 's', array[i]);
209 edbus_message_iter_container_close(iter, array_of_string);
210 pending = edbus_proxy_send(test2_proxy, msg, on_receive_array, NULL, -1);
211 if (!pending) printf("Error in edbus_proxy_send()\n\n");
212 edbus_message_unref(msg);
213
214 msg = edbus_proxy_method_call_new(test2_proxy, "ReceiveArrayOfStringIntWithSize");
215 iter = edbus_message_iter_get(msg);
216 if (!edbus_message_iter_arguments_set(iter, "ia(si)", size_of_array, &array_of_string))
217 printf("error on edbus_massage_iterator_arguments_set()\n\n");
218 for (i = 0; i < size_of_array; i++)
219 {
220 EDBus_Message_Iter *struct_of_si;
221 edbus_message_iter_arguments_set(array_of_string, "(si)", &struct_of_si);
222 edbus_message_iter_arguments_set(struct_of_si, "si", array[i], i);
223 edbus_message_iter_container_close(array_of_string, struct_of_si);
224 }
225 edbus_message_iter_container_close(iter, array_of_string);
226 pending = edbus_proxy_send(test2_proxy, msg, on_receive_array_with_size, NULL, -1);
227 edbus_message_unref(msg);
228
229 msg = edbus_proxy_method_call_new(test2_proxy, "SendVariantData");
230 iter = edbus_message_iter_get(msg);
231 variant = edbus_message_iter_container_new(iter, 'v', "s");
232 edbus_message_iter_append_basic(variant, 's', "test");
233 edbus_message_iter_container_close(iter, variant);
234 pending = edbus_proxy_send(test2_proxy, msg, on_send_variant, NULL, -1);
235 edbus_message_unref(msg);
236
237 pending = edbus_proxy_call(test2_proxy, "SendArrayInt", on_send_array_int, NULL,
238 -1 , "");
239
240 pending = edbus_proxy_call(test2_proxy, "SendArray", on_send_array, NULL,
241 -1 , "");
242
243 pending = edbus_proxy_call(test2_proxy, "PlusOne", on_plus_one, NULL,
244 -1 , "i", plus_one);
245
246 pending = edbus_proxy_property_get(test2_proxy, "Resp2", get_property_resp2, test2_proxy);
247
248 ecore_timer_add(5, _timer1_cb, NULL);
249
250 ecore_main_loop_begin();
251
252 edbus_connection_unref(conn);
253
254 edbus_shutdown();
255 ecore_shutdown();
256 return 0;
257}
diff --git a/legacy/edbus/src/examples/complex_types_server.c b/legacy/edbus/src/examples/complex_types_server.c
new file mode 100644
index 0000000000..5acd50e52f
--- /dev/null
+++ b/legacy/edbus/src/examples/complex_types_server.c
@@ -0,0 +1,351 @@
1#include "EDBus.h"
2#include <Ecore.h>
3
4#define BUS "com.profusion"
5#define PATH "/com/profusion/Test"
6#define IFACE "com.profusion.Test"
7
8char *resp2;
9
10static EDBus_Message *
11_receive_array(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
12{
13 EDBus_Message *reply = edbus_message_method_return_new(msg);
14 EDBus_Message_Iter *array;
15 char *txt;
16
17 printf("receiveArray\n");
18 if (!edbus_message_arguments_get(msg, "as", &array))
19 {
20 printf("Error on edbus_message_arguments_get()\n");
21 return reply;
22 }
23
24 while (edbus_message_iter_get_and_next(array, 's', &txt))
25 printf("%s\n", txt);
26
27 printf("\n");
28
29 return reply;
30}
31
32static EDBus_Message *
33_receive_array_of_string_int_with_size(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
34{
35 EDBus_Message *reply = edbus_message_method_return_new(msg);
36 EDBus_Message_Iter *array;
37 EDBus_Message_Iter *struct_si;
38 int size, i = 0;
39
40 printf("receiveArrayOfStringIntWithSize\n");
41 if (!edbus_message_arguments_get(msg, "ia(si)", &size, &array))
42 {
43 printf("Error on edbus_message_arguments_get()\n");
44 return reply;
45 }
46
47 while (edbus_message_iter_get_and_next(array, 'r', &struct_si))
48 {
49 char *txt;
50 char num;
51
52 if (!edbus_message_iter_arguments_get(struct_si, "si", &txt, &num))
53 {
54 printf("Error on edbus_message_arguments_get()\n");
55 return reply;
56 }
57 printf("%s | %d\n", txt, num);
58 i++;
59 }
60 printf("size in msg %d | size read %d\n", size, i);
61 printf("\n");
62
63 return reply;
64}
65
66static EDBus_Message *
67_send_variant(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
68{
69 EDBus_Message *reply = edbus_message_method_return_new(msg);
70 EDBus_Message_Iter *variant;
71 char *type;
72
73 printf("sendVariantData\n");
74 if (!edbus_message_arguments_get(msg, "v", &variant))
75 {
76 printf("Error on edbus_message_arguments_get()\n");
77 return reply;
78 }
79
80 type = edbus_message_iter_signature_get(variant);
81 if (type[1] || type[0] == 'v')
82 {
83 printf("It is a complex type, not handle yet.\n");
84 free(type);
85 return reply;
86 }
87
88 switch (type[0])
89 {
90 case 's':
91 case 'o':
92 {
93 char *txt;
94 edbus_message_iter_arguments_get(variant, type, &txt);
95 printf("type = %c value = %s\n", type[0], txt);
96 break;
97 }
98 case 'i':
99 {
100 int num;
101 edbus_message_iter_arguments_get(variant, type, &num);
102 printf("type = %c value = %d\n", type[0], num);
103 break;
104 }
105 default:
106 {
107 printf("Unhandled type\n");
108 }
109 }
110
111 printf("\n");
112
113 free(type);
114 return reply;
115}
116
117static EDBus_Message *
118_send_array_int(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
119{
120 EDBus_Message *reply = edbus_message_method_return_new(msg);
121 EDBus_Message_Iter *iter, *array;
122 int i;
123
124 printf("sendArrayInt\n\n");
125
126 iter = edbus_message_iter_get(reply);
127 array = edbus_message_iter_container_new(iter, 'a', "i");
128 for (i = 0; i < 5; i++)
129 edbus_message_iter_arguments_set(array, "i", i);
130 edbus_message_iter_container_close(iter, array);
131
132 return reply;
133}
134
135static EDBus_Message *
136_send_array(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
137{
138 EDBus_Message *reply = edbus_message_method_return_new(msg);
139 EDBus_Message_Iter *iter, *array;
140 const char *array_string[5] = {"qqqq", "wwwww", "eeeeee", "rrrrr", "ttttt"};
141 int i;
142
143 printf("sendArray\n\n");
144
145 iter = edbus_message_iter_get(reply);
146 array = edbus_message_iter_container_new(iter, 'a', "s");
147 for (i = 0; i < 5; i++)
148 edbus_message_iter_arguments_set(array, "s", array_string[i]);
149 edbus_message_iter_container_close(iter, array);
150
151 return reply;
152}
153
154static EDBus_Message *
155_plus_one(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
156{
157 EDBus_Message *reply = edbus_message_method_return_new(msg);
158 int num;
159
160 printf("plusOne\n\n");
161 if (!edbus_message_arguments_get(msg, "i", &num))
162 {
163 printf("Error on edbus_message_arguments_get()\n");
164 return reply;
165 }
166 num++;
167 edbus_message_arguments_set(reply, "i", num);
168
169 return reply;
170}
171
172static EDBus_Message *
173_properties_get(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
174{
175 EDBus_Message *reply;
176 char *interface, *property;
177 EDBus_Message_Iter *variant, *iter;
178
179 if (!edbus_message_arguments_get(msg, "ss", &interface, &property))
180 {
181 printf("Error on edbus_message_arguments_get()\n");
182 return NULL;
183 }
184
185 if (strcmp(interface, IFACE))
186 {
187 reply = edbus_message_error_new(msg,
188 "org.freedesktop.DBus.Error.UnknownInterface",
189 "Interface not found.");
190 return reply;
191 }
192
193 if (strcmp(property, "Resp2"))
194 {
195 reply = edbus_message_error_new(msg,
196 "org.freedesktop.DBus.Error.UnknownProperty",
197 "Property not found.");
198 return reply;
199 }
200
201 reply = edbus_message_method_return_new(msg);
202 iter = edbus_message_iter_get(reply);
203 variant = edbus_message_iter_container_new(iter, 'v', "s");
204 edbus_message_iter_append_basic(variant, 's', resp2);
205 printf("get %s\n", resp2);
206 edbus_message_iter_container_close(iter, variant);
207
208 return reply;
209}
210
211static EDBus_Message *
212_properties_set(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
213{
214 EDBus_Message *reply;
215 char *interface, *property, *type, *txt;
216 EDBus_Message_Iter *variant;
217
218 if (!edbus_message_arguments_get(msg, "ssv", &interface, &property, &variant))
219 {
220 printf("Error on edbus_message_arguments_get()\n");
221 return NULL;
222 }
223
224 if (strcmp(interface, IFACE))
225 {
226 reply = edbus_message_error_new(msg,
227 "org.freedesktop.DBus.Error.UnknownInterface",
228 "Interface not found.");
229 return reply;
230 }
231
232 if (strcmp(property, "Resp2"))
233 {
234 reply = edbus_message_error_new(msg,
235 "org.freedesktop.DBus.Error.UnknownProperty",
236 "Property not found.");
237 return reply;
238 }
239
240 type = edbus_message_iter_signature_get(variant);
241
242 if (type[0] != 's')
243 {
244 reply = edbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidSignature",
245 "Invalid type.");
246 free(type);
247 return reply;
248 }
249
250 reply = edbus_message_method_return_new(msg);
251 edbus_message_iter_arguments_get(variant, "s", &txt);
252 free(type);
253 free(resp2);
254 resp2 = strdup(txt);
255
256 return reply;
257}
258
259static const EDBus_Method methods[] = {
260 {
261 "ReceiveArray", EDBUS_ARGS({"as", "array_of_strings"}),
262 EDBUS_ARGS({"", ""}), _receive_array, 0
263 },
264 {
265 "ReceiveArrayOfStringIntWithSize",
266 EDBUS_ARGS({"i", "size_of_array"}, {"a(si)", "array"}),
267 EDBUS_ARGS({"", ""}), _receive_array_of_string_int_with_size, 0
268 },
269 {
270 "SendVariantData", EDBUS_ARGS({"v", "variant_data"}),
271 EDBUS_ARGS({"", ""}), _send_variant, 0
272 },
273 {
274 "SendArrayInt", EDBUS_ARGS({"", ""}),
275 EDBUS_ARGS({"ai", "array_of_int"}), _send_array_int, 0
276 },
277 {
278 "SendArray", EDBUS_ARGS({"", ""}), EDBUS_ARGS({"as", "array_string"}),
279 _send_array, 0
280 },
281 {
282 "PlusOne", EDBUS_ARGS({"i", "integer"}),
283 EDBUS_ARGS({"i", "integer_plus_one"}), _plus_one, 0
284 },
285 { }
286};
287
288static const EDBus_Method properties_methods[] = {
289 {
290 "Get", EDBUS_ARGS({"s", "interface"}, {"s", "property"}),
291 EDBUS_ARGS({"v", "value"}), _properties_get, 0
292 },
293 {
294 "Set", EDBUS_ARGS({"s", "interface"}, {"s", "property"}, {"v", "value"}),
295 EDBUS_ARGS({"", ""}), _properties_set, 0
296 },
297 { }
298};
299
300static void
301on_name_request(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
302{
303 EDBus_Connection *conn = data;
304 unsigned int flag;
305
306 resp2 = malloc(sizeof(char) * 5);
307 strcpy(resp2, "test");
308
309 if (edbus_message_error_get(msg, NULL, NULL))
310 {
311 printf("error on on_name_request\n");
312 return;
313 }
314
315 if (!edbus_message_arguments_get(msg, "u", &flag))
316 {
317 printf("error geting arguments on on_name_request\n");
318 return;
319 }
320
321 if (!(flag & EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER))
322 {
323 printf("error name already in use\n");
324 return;
325 }
326
327 edbus_service_interface_register(conn, PATH, IFACE, methods, NULL);
328 edbus_service_interface_register(conn, PATH, EDBUS_FDO_INTERFACE_PROPERTIES, properties_methods, NULL);
329}
330
331int
332main(void)
333{
334 EDBus_Connection *conn;
335
336 ecore_init();
337 edbus_init();
338
339 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
340
341 edbus_name_request(conn, BUS, EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE, on_name_request, conn);
342
343 ecore_main_loop_begin();
344
345 free(resp2);
346 edbus_connection_unref(conn);
347
348 edbus_shutdown();
349 ecore_shutdown();
350 return 0;
351}
diff --git a/legacy/edbus/src/examples/connman-list-services.c b/legacy/edbus/src/examples/connman-list-services.c
new file mode 100644
index 0000000000..a192d8b506
--- /dev/null
+++ b/legacy/edbus/src/examples/connman-list-services.c
@@ -0,0 +1,107 @@
1#include "EDBus.h"
2#include <Ecore.h>
3
4static void
5on_services_get(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
6{
7 EDBus_Message_Iter *array, *entry;
8 const char *errname, *errmsg;
9
10 if (edbus_message_error_get(msg, &errname, &errmsg))
11 {
12 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
13 return;
14 }
15
16 if (!edbus_message_arguments_get(msg, "a(oa{sv})", &array))
17 {
18 fprintf(stderr, "Error: could not get array\n");
19 return;
20 }
21
22 while (edbus_message_iter_get_and_next(array, 'r', &entry))
23 {
24 EDBus_Message_Iter *properties, *dict_entry;
25 const char *path;
26
27 if (!edbus_message_iter_arguments_get(entry, "oa{sv}", &path, &properties))
28 {
29 fprintf(stderr, "Error: could not get entry contents\n");
30 return;
31 }
32
33 printf("service: %s\n", path);
34
35 while (edbus_message_iter_get_and_next(properties, 'e', &dict_entry))
36 {
37 EDBus_Message_Iter *variant;
38 const char *key;
39
40 if (!edbus_message_iter_arguments_get(dict_entry, "sv", &key,
41 &variant))
42 {
43 fprintf(stderr,
44 "Error: could not get property contents\n");
45 return;
46 }
47
48 printf("\t%s: type %s\n", key,
49 edbus_message_iter_signature_get(variant));
50
51 /* TODO: get the value from variant */
52 }
53 }
54}
55
56int
57main(void)
58{
59 EDBus_Connection *conn;
60 EDBus_Object *obj;
61 EDBus_Proxy *manager;
62 EDBus_Pending *pending;
63
64 ecore_init();
65 edbus_init();
66
67 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM);
68 if (!conn)
69 {
70 fprintf(stderr, "Error: could not get system bus\n");
71 return EXIT_FAILURE;
72 }
73
74 obj = edbus_object_get(conn, "net.connman", "/");
75 if (!obj)
76 {
77 fprintf(stderr, "Error: could not get object\n");
78 return EXIT_FAILURE;
79 }
80
81 manager = edbus_proxy_get(obj, "net.connman.Manager");
82 if (!manager)
83 {
84 fprintf(stderr, "Error: could not get proxy\n");
85 return EXIT_FAILURE;
86 }
87
88 pending = edbus_proxy_call(manager, "GetServices", on_services_get, NULL,
89 -1, "");
90
91 if (!pending)
92 {
93 fprintf(stderr, "Error: could not call\n");
94 return EXIT_FAILURE;
95 }
96
97 ecore_main_loop_begin();
98
99 edbus_proxy_unref(manager);
100 edbus_object_unref(obj);
101 edbus_connection_unref(conn);
102
103 edbus_shutdown();
104 ecore_shutdown();
105 return 0;
106}
107
diff --git a/legacy/edbus/src/examples/ofono-dial.c b/legacy/edbus/src/examples/ofono-dial.c
new file mode 100644
index 0000000000..5e833ddc4b
--- /dev/null
+++ b/legacy/edbus/src/examples/ofono-dial.c
@@ -0,0 +1,85 @@
1#include "EDBus.h"
2#include <Ecore.h>
3
4static void
5on_dial(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
6{
7 const char *errname, *errmsg;
8 const char *call_path;
9
10 if (edbus_message_error_get(msg, &errname, &errmsg))
11 {
12 fprintf(stderr, "Error: %s %s\n", errname, errmsg);
13 return;
14 }
15
16 if (!edbus_message_arguments_get(msg, "o", &call_path))
17 {
18 fprintf(stderr, "Error: could not get call path\n");
19 return;
20 }
21
22 printf("dialed! call path: %s\n", call_path);
23}
24
25int
26main(int argc, char *argv[])
27{
28 EDBus_Connection *conn;
29 EDBus_Object *obj;
30 EDBus_Proxy *manager;
31 EDBus_Pending *pending;
32 const char *number, *hide_callerid;
33
34 if (argc < 2)
35 {
36 fprintf(stderr, "Usage:\n\t%s <number> [hide_callerid]\n", argv[0]);
37 return EXIT_FAILURE;
38 }
39
40 number = argv[1];
41 hide_callerid = (argc > 2) ? argv[2] : "";
42
43 ecore_init();
44 edbus_init();
45
46 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SYSTEM);
47 if (!conn)
48 {
49 fprintf(stderr, "Error: could not get system bus\n");
50 return EXIT_FAILURE;
51 }
52
53 obj = edbus_object_get(conn, "org.ofono", "/");
54 if (!obj)
55 {
56 fprintf(stderr, "Error: could not get object\n");
57 return EXIT_FAILURE;
58 }
59
60 manager = edbus_proxy_get(obj, "org.ofono.Manager");
61 if (!manager)
62 {
63 fprintf(stderr, "Error: could not get proxy\n");
64 return EXIT_FAILURE;
65 }
66
67 pending = edbus_proxy_call(manager, "Dial", on_dial, NULL,
68 -1, "ss", number, hide_callerid);
69 if (!pending)
70 {
71 fprintf(stderr, "Error: could not call\n");
72 return EXIT_FAILURE;
73 }
74
75 ecore_main_loop_begin();
76
77 edbus_proxy_unref(manager);
78 edbus_object_unref(obj);
79 edbus_connection_unref(conn);
80
81 edbus_shutdown();
82 ecore_shutdown();
83 return 0;
84}
85
diff --git a/legacy/edbus/src/examples/server.c b/legacy/edbus/src/examples/server.c
new file mode 100644
index 0000000000..06424b393a
--- /dev/null
+++ b/legacy/edbus/src/examples/server.c
@@ -0,0 +1,236 @@
1#include "EDBus.h"
2#include <Ecore.h>
3
4#define BUS "org.Enlightenment"
5#define PATH "/org/enlightenment"
6#define INTERFACE "org.enlightenment.Test"
7
8EDBus_Connection *conn;
9
10static EDBus_Message *
11_hello(const EDBus_Service_Interface *iface, const EDBus_Message *message)
12{
13 EDBus_Message *reply = edbus_message_method_return_new(message);
14 edbus_message_arguments_set(reply, "s", "Hello World");
15 printf("Hello\n");
16 return reply;
17}
18
19static EDBus_Message *
20_quit(const EDBus_Service_Interface *iface, const EDBus_Message *message)
21{
22 printf("Quit\n");
23 ecore_main_loop_quit();
24 return edbus_message_method_return_new(message);
25}
26
27enum
28{
29 TEST_SIGNAL_ALIVE = 0,
30 TEST_SIGNAL_HELLO
31};
32
33static Eina_Bool
34send_signal_alive(void *data)
35{
36 EDBus_Service_Interface *iface = data;
37 edbus_service_signal_emit(iface, TEST_SIGNAL_ALIVE);
38 return ECORE_CALLBACK_RENEW;
39}
40
41static Eina_Bool
42send_signal_hello(void *data)
43{
44 EDBus_Service_Interface *iface = data;
45 edbus_service_signal_emit(iface, TEST_SIGNAL_HELLO, "Hello World");
46 return ECORE_CALLBACK_RENEW;
47}
48
49static EDBus_Message *
50_send_bool(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
51{
52 EDBus_Message *reply = edbus_message_method_return_new(msg);
53 Eina_Bool bool;
54 if (!edbus_message_arguments_get(msg, "b", &bool))
55 printf("edbus_message_arguments_get() error\n");
56 edbus_message_arguments_set(reply, "b", bool);
57 return reply;
58}
59
60static EDBus_Message *
61_send_byte(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
62{
63 EDBus_Message *reply = edbus_message_method_return_new(msg);
64 unsigned char byte;
65 if (!edbus_message_arguments_get(msg, "y", &byte))
66 printf("edbus_message_arguments_get() error\n");
67 edbus_message_arguments_set(reply, "y", byte);
68 return reply;
69}
70
71static EDBus_Message *
72_send_uint32(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
73{
74 EDBus_Message *reply = edbus_message_method_return_new(msg);
75 unsigned int uint32;
76 if (!edbus_message_arguments_get(msg, "u", &uint32))
77 printf("edbus_message_arguments_get() error\n");
78 edbus_message_arguments_set(reply, "u", uint32);
79 return reply;
80}
81
82static EDBus_Message *
83_send_int32(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
84{
85 EDBus_Message *reply = edbus_message_method_return_new(msg);
86 int int32;
87 if (!edbus_message_arguments_get(msg, "i", &int32))
88 printf("edbus_message_arguments_get() error\n");
89 edbus_message_arguments_set(reply, "i", int32);
90 return reply;
91}
92
93static EDBus_Message *
94_send_int16(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
95{
96 EDBus_Message *reply = edbus_message_method_return_new(msg);
97 short int int16;
98 if (!edbus_message_arguments_get(msg, "n", &int16))
99 printf("edbus_message_arguments_get() error\n");
100 edbus_message_arguments_set(reply, "n", int16);
101 return reply;
102}
103
104static EDBus_Message *
105_send_double(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
106{
107 EDBus_Message *reply = edbus_message_method_return_new(msg);
108 double d;
109 if (!edbus_message_arguments_get(msg, "d", &d))
110 printf("edbus_message_arguments_get() error\n");
111 edbus_message_arguments_set(reply, "d", d);
112 return reply;
113}
114
115static EDBus_Message *
116_send_string(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
117{
118 EDBus_Message *reply = edbus_message_method_return_new(msg);
119 char *txt;
120 if (!edbus_message_arguments_get(msg, "s", &txt))
121 printf("edbus_message_arguments_get() error\n");
122 edbus_message_arguments_set(reply, "s", txt);
123 return reply;
124}
125
126static Eina_Bool
127_resp_async(void *data)
128{
129 EDBus_Message *msg = data;
130 edbus_message_arguments_set(msg, "s", "Async test ok");
131 edbus_connection_send(conn, msg, NULL, NULL, -1);
132 edbus_message_unref(msg);
133 return ECORE_CALLBACK_CANCEL;
134}
135
136static EDBus_Message *
137_async_test(const EDBus_Service_Interface *iface, const EDBus_Message *msg)
138{
139 EDBus_Message *reply = edbus_message_method_return_new(msg);
140 printf("Received a call to AsyncTest.\n");
141 printf("Response will be send in 5 seconds.\n");
142 ecore_timer_add (5, _resp_async, reply);
143 return NULL;
144}
145
146static const EDBus_Signal signals[] = {
147 [TEST_SIGNAL_ALIVE] = {"Alive", EDBUS_ARGS({ NULL, NULL }), 0},
148 [TEST_SIGNAL_HELLO] = {"Hello", EDBUS_ARGS({ "s", "message" }), 0},
149 { }
150};
151
152static const EDBus_Method methods[] = {
153 {
154 "Hello", EDBUS_ARGS({"", ""}), EDBUS_ARGS({"s", "message"}),
155 _hello, 0
156 },
157 {
158 "Quit", EDBUS_ARGS({"", ""}), EDBUS_ARGS({"", ""}),
159 _quit, EDBUS_METHOD_FLAG_DEPRECATED
160 },
161 { "SendBool", EDBUS_ARGS({"b", "bool"}), EDBUS_ARGS({"b", "bool"}),
162 _send_bool, 0
163 },
164 { "SendByte", EDBUS_ARGS({"y", "byte"}), EDBUS_ARGS({"y", "byte"}),
165 _send_byte, 0
166 },
167 { "SendUint32", EDBUS_ARGS({"u", "uint32"}), EDBUS_ARGS({"u", "uint32"}),
168 _send_uint32, 0
169 },
170 { "SendInt32", EDBUS_ARGS({"i", "int32"}), EDBUS_ARGS({"i", "int32"}),
171 _send_int32, 0
172 },
173 { "SendInt16", EDBUS_ARGS({"n", "int16"}), EDBUS_ARGS({"n", "int16"}),
174 _send_int16, 0
175 },
176 { "SendDouble", EDBUS_ARGS({"d", "double"}), EDBUS_ARGS({"d", "double"}),
177 _send_double, 0
178 },
179 { "SendString", EDBUS_ARGS({"s", "string"}), EDBUS_ARGS({"s", "string"}),
180 _send_string, 0
181 },
182 { "AsyncTest", EDBUS_ARGS({"", ""}), EDBUS_ARGS({"s", "text"}),
183 _async_test, 0
184 },
185 { }
186};
187
188static void
189on_name_request(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
190{
191 EDBus_Service_Interface *iface;
192 unsigned int flag;
193
194 if (edbus_message_error_get(msg, NULL, NULL))
195 {
196 printf("error on on_name_request\n");
197 return;
198 }
199
200 if (!edbus_message_arguments_get(msg, "u", &flag))
201 {
202 printf("error geting arguments on on_name_request\n");
203 return;
204 }
205
206 if (!(flag & EDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER))
207 {
208 printf("error name already in use\n");
209 return;
210 }
211
212 iface = edbus_service_interface_register(conn, PATH, INTERFACE, methods,
213 signals);
214 ecore_timer_add(5, send_signal_alive, iface);
215 ecore_timer_add(6, send_signal_hello, iface);
216}
217
218int
219main(void)
220{
221 ecore_init();
222 edbus_init();
223
224 conn = edbus_connection_get(EDBUS_CONNECTION_TYPE_SESSION);
225
226 edbus_name_request(conn, BUS, EDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE,
227 on_name_request, NULL);
228
229 ecore_main_loop_begin();
230
231 edbus_connection_unref(conn);
232
233 edbus_shutdown();
234 ecore_shutdown();
235 return 0;
236}
diff --git a/legacy/edbus/src/lib/EDBus.h b/legacy/edbus/src/lib/EDBus.h
new file mode 100644
index 0000000000..66b5320390
--- /dev/null
+++ b/legacy/edbus/src/lib/EDBus.h
@@ -0,0 +1,141 @@
1#ifndef EDBUS_H
2#define EDBUS_H
3
4#include <Eina.h>
5#include <stdarg.h>
6
7#ifdef EAPI
8# undef EAPI
9#endif
10
11#ifdef _WIN32
12# ifdef EFL_EDBUS_BUILD
13# ifdef DLL_EXPORT
14# define EAPI __declspec(dllexport)
15# else
16# define EAPI
17# endif /* ! DLL_EXPORT */
18# else
19# define EAPI __declspec(dllimport)
20# endif /* ! EFL_EDBUS_BUILD */
21#else
22# ifdef __GNUC__
23# if __GNUC__ >= 4
24# define EAPI __attribute__ ((visibility("default")))
25# else
26# define EAPI
27# endif
28# else
29# define EAPI
30# endif
31#endif
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/**
38 * @defgroup EDBus_Core Core
39 *
40 * @{
41 */
42#define EDBUS_VERSION_MAJOR 1
43#define EDBUS_VERSION_MINOR 6
44
45#define EDBUS_FDO_BUS "org.freedesktop.DBus"
46#define EDBUS_FDO_PATH "/org/freedesktop/DBus"
47#define EDBUS_FDO_INTERFACE EDBUS_FDO_BUS
48#define EDBUS_FDO_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
49
50typedef struct _EDBus_Version
51{
52 int major;
53 int minor;
54 int micro;
55 int revision;
56} EDBus_Version;
57
58EAPI extern const EDBus_Version * edbus_version;
59
60/**
61 * @brief Initialize edbus.
62 *
63 * @return 1 or greater on success, 0 otherwise
64 */
65EAPI int edbus_init(void);
66/**
67 * @brief Shutdown edbus.
68 *
69 * @return 0 if e_dbus shuts down, greater than 0 otherwise.
70 */
71EAPI int edbus_shutdown(void);
72
73typedef void (*EDBus_Free_Cb)(void *data, const void *deadptr);
74
75/**
76 * @typedef EDBus_Connection
77 *
78 * Represents a connection of one the type of connection with the DBus daemon.
79 */
80typedef struct _EDBus_Connection EDBus_Connection;
81/**
82 * @typedef EDBus_Object
83 *
84 * Represents a object path already attach with bus name or unique id.
85 */
86typedef struct _EDBus_Object EDBus_Object;
87/**
88 * @typedef EDBus_Proxy
89 *
90 * Represents a interface of a object path.
91 */
92typedef struct _EDBus_Proxy EDBus_Proxy;
93/**
94 * @typedef EDBus_Message
95 *
96 * Represents the way of how the data is send and received in DBus.
97 */
98typedef struct _EDBus_Message EDBus_Message;
99/**
100 * @typedef EDBus_Message_Iter
101 *
102 * Represents an iterator over a complex message type (array, dict, struct,
103 * or variant). Its life is bound to the message that contains
104 * it. The same applies to the returned data.
105 */
106typedef struct _EDBus_Message_Iter EDBus_Message_Iter;
107/**
108 * @typedef EDBus_Pending
109 *
110 * Represents a message that was been sent but has not yet reached its
111 * destination.
112 */
113typedef struct _EDBus_Pending EDBus_Pending;
114/**
115 * @typedef EDBus_Signal_Handler
116 *
117 * Represents a listener that will listen for signals emitted by other
118 * applications.
119 */
120typedef struct _EDBus_Signal_Handler EDBus_Signal_Handler;
121
122typedef void (*EDBus_Message_Cb)(void *data, const EDBus_Message *msg, EDBus_Pending *pending);
123typedef void (*EDBus_Signal_Cb)(void *data, const EDBus_Message *msg);
124/**
125 * @}
126 */
127
128#include "edbus_connection.h"
129#include "edbus_message.h"
130#include "edbus_signal_handler.h"
131#include "edbus_pending.h"
132#include "edbus_object.h"
133#include "edbus_proxy.h"
134#include "edbus_freedesktop.h"
135#include "edbus_service.h"
136
137#ifdef __cplusplus
138}
139#endif
140
141#endif
diff --git a/legacy/edbus/src/lib/edbus_connection.h b/legacy/edbus/src/lib/edbus_connection.h
new file mode 100644
index 0000000000..955ffd7f09
--- /dev/null
+++ b/legacy/edbus/src/lib/edbus_connection.h
@@ -0,0 +1,144 @@
1#ifndef EDBUS_CONNECTION_H
2#define EDBUS_CONNECTION_H 1
3
4/**
5 * @defgroup EDBus_Conneciton Connection
6 *
7 * @{
8 */
9typedef enum
10{
11 EDBUS_CONNECTION_TYPE_UNKNOWN = 0, /**< sentinel, not a real type */
12 EDBUS_CONNECTION_TYPE_SESSION,
13 EDBUS_CONNECTION_TYPE_SYSTEM,
14 EDBUS_CONNECTION_TYPE_STARTER,
15 EDBUS_CONNECTION_TYPE_LAST /**< sentinel, not a real type */
16} EDBus_Connection_Type;
17
18#define EDBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
19
20/**
21 * @brief Establish a connection to bus and integrate it with the ecore main
22 * loop.
23 *
24 * @param type type of connection e.g EDBUS_CONNECTION_TYPE_SESSION,
25 * EDBUS_CONNECTION_TYPE_SYSTEM or EDBUS_CONNECTION_TYPE_STARTER
26 *
27 * @return connection with bus
28 */
29EAPI EDBus_Connection *edbus_connection_get(EDBus_Connection_Type type);
30
31/**
32 * @brief Increment connection reference count.
33 *
34 * @param conn The given EDBus_Connection object to reference
35 */
36EAPI EDBus_Connection *edbus_connection_ref(EDBus_Connection *conn) EINA_ARG_NONNULL(1);
37
38/**
39 * @brief Decrement object reference count.
40 *
41 * If reference count reaches 0, the connection to bus will be dropped and all
42 * its children will be invalidated.
43 */
44EAPI void edbus_connection_unref(EDBus_Connection *conn) EINA_ARG_NONNULL(1);
45
46/**
47 * @brief Add a callback function to be called when connection is freed
48 *
49 * @param conn The connection object to add the callback to.
50 * @param cb callback to be called
51 * @param data passed to callback
52 */
53EAPI void edbus_connection_cb_free_add(EDBus_Connection *conn, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
54
55/**
56 * @brief Remove callback registered in edbus_connection_cb_free_add().
57 */
58EAPI void edbus_connection_cb_free_del(EDBus_Connection *conn, EDBus_Free_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2);
59
60/**
61 * @brief Set an attached data pointer to an object with a given string key.
62 *
63 * @param conn The connection object to store data to
64 * @param key to identify data
65 * @param data data that will be stored
66 */
67EAPI void edbus_connection_data_set(EDBus_Connection *conn, const char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3);
68
69/**
70 * @brief Get data stored in connection.
71 *
72 * @param conn connection where data are stored
73 * @param key that identify data
74 *
75 * @return pointer to data if found otherwise NULL
76 */
77EAPI void *edbus_connection_data_get(const EDBus_Connection *conn, const char *key) EINA_ARG_NONNULL(1, 2);
78
79/**
80 * @brief Del data stored in connection.
81 *
82 * @param conn connection where data are stored
83 * @param key that identify data
84 *
85 * @return pointer to data if found otherwise NULL
86 */
87EAPI void *edbus_connection_data_del(EDBus_Connection *conn, const char *key) EINA_ARG_NONNULL(1, 2);
88
89typedef enum
90{
91 EDBUS_CONNECTION_EVENT_OBJECT_ADDED = 0,
92 EDBUS_CONNECTION_EVENT_OBJECT_REMOVED,
93 //EDBUS_CONNECTION_EVENT_NAME_OWNER_CHANGED,
94 EDBUS_CONNECTION_EVENT_DEL,
95 EDBUS_CONNECTION_EVENT_LAST /**< sentinel, not a real event type */
96} EDBus_Connection_Event_Type;
97
98typedef struct _EDBus_Connection_Event_Object_Added
99{
100 const char *path;
101 EDBus_Object *object;
102} EDBus_Connection_Event_Object_Added;
103
104typedef struct _EDBus_Connection_Event_Object_Removed
105{
106 const char *path;
107} EDBus_Connection_Event_Object_Removed;
108
109typedef struct _EDBus_Connection_Event_Name_Owner_Changed
110{
111 const char *name;
112 const char *old_id;
113 const char *new_id;
114} EDBus_Connection_Event_Name_Owner_Changed;
115
116typedef void (*EDBus_Connection_Event_Cb)(void *data, EDBus_Connection *conn, void *event_info);
117
118/**
119 * @brief Add a callback function to be called when occurs a event of the
120 * type passed.
121 */
122EAPI void edbus_connection_event_callback_add(EDBus_Connection *conn, EDBus_Connection_Event_Type type, EDBus_Connection_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
123
124/**
125 * @brief Remove callback registered in edbus_connection_event_callback_add().
126 */
127EAPI void edbus_connection_event_callback_del(EDBus_Connection *conn, EDBus_Connection_Event_Type type, EDBus_Connection_Event_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3);
128
129/**
130 * @brief Send a message.
131 *
132 * @param conn the connection where the message will be send
133 * @param msg message that will be send
134 * @param cb if msg is a method call a callback should be passed
135 * to be execute when response arrive
136 * @param cb_data data passed to callback
137 * @param timeout timeout in milliseconds, -1 to default internal value or
138 * EDBUS_TIMEOUT_INFINITE for no timeout
139 */
140EAPI EDBus_Pending *edbus_connection_send(EDBus_Connection *conn, EDBus_Message *msg, EDBus_Message_Cb cb, const void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2);
141/**
142 * @}
143 */
144#endif
diff --git a/legacy/edbus/src/lib/edbus_core.c b/legacy/edbus/src/lib/edbus_core.c
new file mode 100644
index 0000000000..4fec737dbd
--- /dev/null
+++ b/legacy/edbus/src/lib/edbus_core.c
@@ -0,0 +1,1368 @@
1#include "edbus_private.h"
2#include "edbus_private_types.h"
3#include <dbus/dbus.h>
4
5#include <Ecore.h>
6
7#define NAME_OWNER_MATCH "type='signal',sender='org.freedesktop.DBus',\
8 path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',\
9 member='NameOwnerChanged',arg0='%s'"
10
11#define EDBUS_CONNECTION_CHECK(conn) \
12 do \
13 { \
14 EINA_SAFETY_ON_NULL_RETURN(conn); \
15 if (!EINA_MAGIC_CHECK(conn, EDBUS_CONNECTION_MAGIC)) \
16 { \
17 EINA_MAGIC_FAIL(conn, EDBUS_CONNECTION_MAGIC); \
18 return; \
19 } \
20 EINA_SAFETY_ON_TRUE_RETURN(conn->refcount <= 0); \
21 } \
22 while (0)
23
24#define EDBUS_CONNECTION_CHECK_RETVAL(conn, retval) \
25 do \
26 { \
27 EINA_SAFETY_ON_NULL_RETURN_VAL(conn, retval); \
28 if (!EINA_MAGIC_CHECK(conn, EDBUS_CONNECTION_MAGIC)) \
29 { \
30 EINA_MAGIC_FAIL(conn, EDBUS_CONNECTION_MAGIC); \
31 return retval; \
32 } \
33 EINA_SAFETY_ON_TRUE_RETURN_VAL(conn->refcount <= 0, retval); \
34 } \
35 while (0)
36
37typedef struct _EDBus_Connection_Context_Event_Cb
38{
39 EINA_INLIST;
40 EDBus_Connection_Event_Cb cb;
41 const void *cb_data;
42 Eina_Bool deleted : 1;
43} EDBus_Connection_Context_Event_Cb;
44
45typedef struct _EDBus_Connection_Context_NOC_Cb
46{
47 EINA_INLIST;
48 EDBus_Name_Owner_Changed_Cb cb;
49 const void *cb_data;
50 Eina_Bool deleted : 1;
51} EDBus_Connection_Context_NOC_Cb;
52
53typedef struct _EDBus_Handler_Data
54{
55 EINA_INLIST;
56 int fd;
57 Ecore_Fd_Handler *fd_handler;
58 EDBus_Connection *conn;
59 DBusWatch *watch;
60 int enabled;
61} EDBus_Handler_Data;
62
63typedef struct _EDBus_Timeout_Data
64{
65 EINA_INLIST;
66 Ecore_Timer *handler;
67 DBusTimeout *timeout;
68 EDBus_Connection *conn;
69 int interval;
70} EDBus_Timeout_Data;
71
72static const EDBus_Version _version = {VMAJ, VMIN, VMIC, VREV};
73EAPI const EDBus_Version * edbus_version = &_version;
74
75static int _edbus_init_count = 0;
76int _edbus_log_dom = -1;
77
78static EDBus_Connection *shared_connections[3];
79
80static void _edbus_connection_event_callback_call(EDBus_Connection *conn, EDBus_Connection_Event_Type type, const void *event_info);
81static void _edbus_connection_context_event_cb_del(EDBus_Connection_Context_Event *ce, EDBus_Connection_Context_Event_Cb *ctx);
82static void edbus_dispatch_name_owner_change(EDBus_Connection_Name *cn, const char *old_id);
83
84EAPI int
85edbus_init(void)
86{
87 if (_edbus_init_count > 0)
88 return ++_edbus_init_count;
89
90 if (!eina_init())
91 {
92 fputs("EDBus: Enable to initialize eina\n", stderr);
93 return 0;
94 }
95
96 _edbus_log_dom = eina_log_domain_register("edbus", EINA_COLOR_BLUE);
97 if (_edbus_log_dom < 0)
98 {
99 EINA_LOG_ERR("Unable to create an 'edbus' log domain");
100 eina_shutdown();
101 return 0;
102 }
103
104 if (!ecore_init())
105 {
106 ERR("Unable to initialize ecore");
107 eina_log_domain_unregister(_edbus_log_dom);
108 _edbus_log_dom = -1;
109 eina_shutdown();
110 return 0;
111 }
112
113 eina_magic_string_set(EDBUS_CONNECTION_MAGIC, "EDBus_Connection");
114 eina_magic_string_set(EDBUS_MESSAGE_MAGIC, "EDBus_Message");
115 eina_magic_string_set(EDBUS_SIGNAL_HANDLER_MAGIC, "EDBus_Signal_Handler");
116 eina_magic_string_set(EDBUS_PENDING_MAGIC, "EDBus_Pending");
117 eina_magic_string_set(EDBUS_OBJECT_MAGIC, "EDBus_Object");
118 eina_magic_string_set(EDBUS_PROXY_MAGIC, "EDBus_Proxy");
119
120 if (!edbus_message_init()) goto message_failed;
121 if (!edbus_signal_handler_init()) goto signal_handler_failed;
122 if (!edbus_pending_init()) goto pending_failed;
123 if (!edbus_object_init()) goto object_failed;
124 if (!edbus_proxy_init()) goto proxy_failed;
125 if (!edbus_service_init()) goto service_failed;
126
127 return ++_edbus_init_count;
128
129service_failed:
130 edbus_proxy_shutdown();
131proxy_failed:
132 edbus_object_shutdown();
133object_failed:
134 edbus_pending_shutdown();
135pending_failed:
136 edbus_signal_handler_shutdown();
137signal_handler_failed:
138 edbus_message_shutdown();
139message_failed:
140 ecore_shutdown();
141 eina_log_domain_unregister(_edbus_log_dom);
142 _edbus_log_dom = -1;
143 eina_shutdown();
144
145 return 0;
146}
147
148static void
149print_live_connection(EDBus_Connection *conn)
150{
151 if (!conn->names)
152 ERR("conn=%p has no alive objects", conn);
153 else
154 {
155 Eina_Iterator *iter = eina_hash_iterator_data_new(conn->names);
156 EDBus_Connection_Name *name;
157 EINA_ITERATOR_FOREACH(iter, name)
158 {
159 EDBus_Object *obj;
160 Eina_Iterator *inner_itr;
161 if (!name->objects) continue;
162
163 inner_itr = eina_hash_iterator_data_new(name->objects);
164 EINA_ITERATOR_FOREACH(inner_itr, obj)
165 ERR("conn=%p alive object=%p %s of bus=%s", conn, obj,
166 obj->name, name->name);
167 eina_iterator_free(inner_itr);
168 }
169 eina_iterator_free(iter);
170 }
171
172 if (!conn->pendings)
173 ERR("conn=%p has no alive pending calls", conn);
174 else
175 {
176 EDBus_Pending *p;
177 EINA_INLIST_FOREACH (conn->pendings, p)
178 ERR("conn=%p alive pending call=%p dest=%s path=%s %s.%s()",
179 conn, p,
180 edbus_pending_destination_get(p),
181 edbus_pending_path_get(p),
182 edbus_pending_interface_get(p),
183 edbus_pending_method_get(p));
184 }
185}
186
187EAPI int
188edbus_shutdown(void)
189{
190 if (_edbus_init_count <= 0)
191 {
192 ERR("Init count not greater than 0 in shutdown.");
193 _edbus_init_count = 0;
194 return 0;
195 }
196 if (--_edbus_init_count)
197 return _edbus_init_count;
198
199 if (shared_connections[EDBUS_CONNECTION_TYPE_SESSION - 1])
200 {
201 CRITICAL("Alive TYPE_SESSION connection");
202 print_live_connection(shared_connections[EDBUS_CONNECTION_TYPE_SESSION - 1]);
203 }
204 if (shared_connections[EDBUS_CONNECTION_TYPE_SYSTEM - 1])
205 {
206 CRITICAL("Alive TYPE_SYSTEM connection");
207 print_live_connection(shared_connections[EDBUS_CONNECTION_TYPE_SYSTEM - 1]);
208 }
209 if (shared_connections[EDBUS_CONNECTION_TYPE_STARTER - 1])
210 {
211 CRITICAL("Alive TYPE_STARTER connection");
212 print_live_connection(shared_connections[EDBUS_CONNECTION_TYPE_STARTER - 1]);
213 }
214