2007-04-24 Murray Cumming <murrayc@murrayc.com>
+ * Makefile.am:
+ * configure.ac:
+ * libmodest-dbus-client/Makefile.am:
+ * libmodest-dbus-client/libmodest-dbus-client.c:
+ * libmodest-dbus-client/libmodest-dbus-client.h:
+ * tests/dbus_api/Makefile.am:
+ * tests/dbus_api/test_hello.c: (main): Added directory structure for a C convenience library
+ for using the modest D-Bus API, and used that from the test. It is still just a helloworld.
+
+2007-04-24 Murray Cumming <murrayc@murrayc.com>
+
* src/maemo/easysetup/modest-easysetup-wizard.c:
(create_page_account_details):
* src/maemo/modest-account-settings-dialog.c:
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.b
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-SUBDIRS= src man po
+SUBDIRS= src libmodest-dbus-client man po
if BUILD_TESTS
SUBDIRS += tests
tests/dbus_api/Makefile
src/maemo/modest.desktop
src/maemo/modest.service
+libmodest-dbus-client/Makefile
+libmodest-dbus-client/libmodest-dbus-client-1.0.pc
])
--- /dev/null
+# Copyright (c) 2006,2007 Nokia Corporation
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the Nokia Corporation nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+INCLUDES=\
+ $(MODEST_GSTUFF_CFLAGS)\
+ $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS) \
+ $(MODEST_LIBTINYMAIL_MAEMO_CFLAGS) \
+ -I$(MODEST_PLATFORM) \
+ -DPREFIX=\"@prefix@\" \
+ -DMODEST_LOCALEDIR=\"$(MODEST_LOCALEDIR)\" \
+ -DMODEST_PLATFORM=\"$(MODEST_PLATFORM)\" \
+ -DMODEST_PLATFORM_ID=$(MODEST_PLATFORM_ID) \
+ -DPIXMAP_PREFIX=\"${datadir}/pixmaps/modest/\" \
+ -DMODEST_UIDIR=\"$(datadir)/modest/ui/\"
+
+lib_LTLIBRARIES = libmodest-dbus-client-1.0.la
+libmodest_dbus_client_1_0_la_SOURCES = libmodest-dbus-client.h libmodest-dbus-client.c
+
+library_includedir=$(includedir)/libmodest-dbus-client-1.0/libmodest-dbus-client
+library_include_HEADERS = libmodest-dbus-client.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libmodest-dbus-client-1.0.pc
+
+
--- /dev/null
+/* Copyright (c) 2007, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "libmodest-dbus-client.h"
+
+#define MODEST_DBUS_NAME "modestemail"
+#define MODEST_DBUS_EXAMPLE_MESSAGE "HelloWorld"
+
+gboolean
+libmodest_dbus_client_call_helloworld(osso_context_t *osso_context)
+{
+ osso_rpc_t retval;
+ const osso_return_t ret = osso_rpc_run_with_defaults(osso_context,
+ MODEST_DBUS_NAME,
+ MODEST_DBUS_EXAMPLE_MESSAGE, &retval, DBUS_TYPE_INVALID);
+
+ if (ret != OSSO_OK) {
+ printf("debug: osso_rpc_run() failed.\n");
+ return FALSE;
+ } else {
+ printf("debug: osso_rpc_run() succeeded.\n");
+ }
+
+ osso_rpc_free_val(&retval);
+
+ return TRUE;
+}
--- /dev/null
+/* Copyright (c) 2007, Nokia Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Nokia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __LIBMODEST_DBUS_CLIENT_H__
+#define __LIBMODEST_DBUS_CLIENT_H__
+
+#include <libosso.h>
+#include <stdio.h>
+
+gboolean
+libmodest_dbus_client_call_helloworld(osso_context_t *osso_context);
+
+#endif /* __LIBMODEST_DBUS_CLIENT_H__ */
$(MODEST_LIBTINYMAIL_MAEMO_CFLAGS) \
-I$(MODEST_PLATFORM) \
-I${top_srcdir}/src \
+ -I$(top_srcdir) \
-DPREFIX=\"@prefix@\" \
-DMODESTLOCALEDIR=\""$(modestlocaledir)"\"
@CHECK_LIBS@ \
$(MODEST_GSTUFF_LIBS) \
$(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS) \
- $(MODEST_LIBTINYMAIL_MAEMO_LIBS)
+ $(MODEST_LIBTINYMAIL_MAEMO_LIBS) \
+ ${top_srcdir}/libmodest-dbus-client/libmodest-dbus-client-1.0.la
noinst_PROGRAMS = test_hello
-#include <libosso.h>
+#include <libmodest-dbus-client/libmodest-dbus-client.h>
#include <stdio.h>
-#define MODEST_DBUS_NAME "modestemail"
-#define MODEST_DBUS_EXAMPLE_MESSAGE "HelloWorld"
-
-
-
int main(int argc, char *argv[])
{
/* Initialize maemo application */
return OSSO_ERROR;
}
- osso_rpc_t retval;
- osso_return_t ret = osso_rpc_run_with_defaults(osso_context,
- MODEST_DBUS_NAME,
- MODEST_DBUS_EXAMPLE_MESSAGE, &retval, DBUS_TYPE_INVALID);
- if (ret != OSSO_OK) {
- printf("osso_rpc_run() failed.\n");
+ /* Call the function in libmodest-dbus-client: */
+ const gboolean ret = libmodest_dbus_client_call_helloworld (osso_context);
+ if (!ret) {
+ printf("libmodest_dbus_client_call_helloworld() failed.\n");
return OSSO_ERROR;
} else {
- printf("osso_rpc_run() succeeded.\n");
+ printf("libmodest_dbus_client_call_helloworld() succeeded.\n");
}
- osso_rpc_free_val(&retval);
-
/* Exit */
return 0;
}