[maemo-commits] [maemo-commits] r15943 - in projects/haf/branches/hildon-thumbnail/daemonize/daemon: . plugins
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Sep 2 15:01:06 EEST 2008
- Previous message: [maemo-commits] r15942 - in projects/haf/trunk/sapwood: . src
- Next message: [maemo-commits] r15944 - projects/haf
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: pvanhoof Date: 2008-09-02 15:01:02 +0300 (Tue, 02 Sep 2008) New Revision: 15943 Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-daemon.c projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-plugin.c projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-plugin.h projects/haf/branches/hildon-thumbnail/daemonize/daemon/manager.c projects/haf/branches/hildon-thumbnail/daemonize/daemon/manager.h projects/haf/branches/hildon-thumbnail/daemonize/daemon/plugins/default.c projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.c projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.h Log: Bugfixes Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-daemon.c =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-daemon.c 2008-09-02 11:53:47 UTC (rev 15942) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-daemon.c 2008-09-02 12:01:02 UTC (rev 15943) @@ -51,6 +51,7 @@ GMainLoop *main_loop; GError *error = NULL; Manager *manager; + DBusGProxy *manager_proxy; /* TODO: dynamically load plugins, and detect when new ones get * dropped, and removed ones get removed (and therefore must @@ -60,8 +61,19 @@ thumbnailer_do_init (connection, manager, &error); module = hildon_thumbnail_plugin_load ("default"); - hildon_thumbnail_plugin_do_init (module, connection, &error); + manager_proxy = dbus_g_proxy_new_for_name (connection, + MANAGER_SERVICE, + MANAGER_PATH, + MANAGER_INTERFACE); + + hildon_thumbnail_plugin_do_init (module, + connection, + manager_proxy, + &error); + + g_object_unref (manager_proxy); + main_loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (main_loop); Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-plugin.c =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-plugin.c 2008-09-02 11:53:47 UTC (rev 15942) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-plugin.c 2008-09-02 12:01:02 UTC (rev 15943) @@ -29,15 +29,15 @@ return module; } -typedef void (*InitFunc) (DBusGConnection *connection, GError **error); +typedef void (*InitFunc) (DBusGConnection *connection, DBusGProxy *manager, GError **error); void -hildon_thumbnail_plugin_do_init (GModule *module, DBusGConnection *connection, GError **error) +hildon_thumbnail_plugin_do_init (GModule *module, DBusGConnection *connection, DBusGProxy *manager, GError **error) { InitFunc func; if (g_module_symbol (module, "hildon_thumbnail_plugin_init", (gpointer *) &func)) { - (func) (connection, error); + (func) (connection, manager, error); } } Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-plugin.h =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-plugin.h 2008-09-02 11:53:47 UTC (rev 15942) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/hildon-thumbnail-plugin.h 2008-09-02 12:01:02 UTC (rev 15943) @@ -34,6 +34,7 @@ GModule * hildon_thumbnail_plugin_load (const gchar *module_name); void hildon_thumbnail_plugin_do_init (GModule *module, DBusGConnection *connection, + DBusGProxy *manager, GError **error); void hildon_thumbnail_plugin_do_stop (GModule *module); Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/manager.c =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/manager.c 2008-09-02 11:53:47 UTC (rev 15942) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/manager.c 2008-09-02 12:01:02 UTC (rev 15943) @@ -5,11 +5,7 @@ #include "manager.h" #include "manager-glue.h" -#define MANAGER_SERVICE "org.freedesktop.thumbnailer.manager" -#define MANAGER_PATH "/org/freedesktop/thumbnailer/manager" -#define MANAGER_INTERFACE "org.freedesktop.thumbnailer.manager" - #define MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_MANAGER, ManagerPrivate)) G_DEFINE_TYPE (Manager, manager, G_TYPE_OBJECT) @@ -87,6 +83,10 @@ mime_type, mime_proxy); + g_print ("Register: %s\n", sender); + + g_free (sender); + g_signal_connect (mime_proxy, "destroy", G_CALLBACK (service_gone), object); Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/manager.h =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/manager.h 2008-09-02 11:53:47 UTC (rev 15942) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/manager.h 2008-09-02 12:01:02 UTC (rev 15943) @@ -1,6 +1,10 @@ #ifndef __MANAGER_H__ #define __MANAGER_H__ +#define MANAGER_SERVICE "org.freedesktop.thumbnailer.manager" +#define MANAGER_PATH "/org/freedesktop/thumbnailer/manager" +#define MANAGER_INTERFACE "org.freedesktop.thumbnailer.manager" + #define TYPE_MANAGER (manager_get_type()) #define MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_MANAGER, Manager)) #define MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TYPE_MANAGER, ManagerClass)) Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/plugins/default.c =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/plugins/default.c 2008-09-02 11:53:47 UTC (rev 15942) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/plugins/default.c 2008-09-02 12:01:02 UTC (rev 15943) @@ -8,13 +8,14 @@ G_DEFINE_TYPE (ImagePng, image_png, G_TYPE_OBJECT) -#define DEFAULT_PNG_SERVICE "org.freedesktop.thumbnailer.image-png" -#define DEFAULT_PNG_PATH "/org/freedesktop/thumbnailer/image-png" -#define DEFAULT_PNG_INTERFACE "org.freedesktop.thumbnailer.image-png" +#define DEFAULT_PNG_SERVICE "org.freedesktop.thumbnailer" +#define DEFAULT_PNG_PATH "/org/freedesktop/thumbnailer/png" +#define DEFAULT_PNG_INTERFACE "org.freedesktop.thumbnailer" void image_png_create (ImagePng *object, GStrv urls, DBusGMethodInvocation *context) { + g_print ("CREATE PNG\n"); } static void @@ -35,7 +36,7 @@ void -hildon_thumbnail_plugin_init (DBusGConnection *connection, GError **error) +hildon_thumbnail_plugin_init (DBusGConnection *connection, DBusGProxy *manager, GError **error) { guint result; DBusGProxy *proxy; @@ -59,4 +60,8 @@ DEFAULT_PNG_PATH, object); + g_print ("Do reg: image/png\n"); + dbus_g_proxy_call (manager, "Register", error, + G_TYPE_STRING, + "image/png"); } Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.c =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.c 2008-09-02 11:53:47 UTC (rev 15942) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.c 2008-09-02 12:01:02 UTC (rev 15943) @@ -5,11 +5,6 @@ #include "thumbnailer.h" #include "thumbnailer-glue.h" -#define THUMBNAILER_SERVICE "org.freedesktop.thumbnailer" -#define THUMBNAILER_PATH "/org/freedesktop/thumbnailer" -#define THUMBNAILER_INTERFACE "org.freedesktop.thumbnailer" - - #define THUMBNAILER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_THUMBNAILER, ThumbnailerPrivate)) G_DEFINE_TYPE (Thumbnailer, thumbnailer, G_TYPE_OBJECT) Modified: projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.h =================================================================== --- projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.h 2008-09-02 11:53:47 UTC (rev 15942) +++ projects/haf/branches/hildon-thumbnail/daemonize/daemon/thumbnailer.h 2008-09-02 12:01:02 UTC (rev 15943) @@ -3,6 +3,10 @@ #include "manager.h" +#define THUMBNAILER_SERVICE "org.freedesktop.thumbnailer" +#define THUMBNAILER_PATH "/org/freedesktop/thumbnailer" +#define THUMBNAILER_INTERFACE "org.freedesktop.thumbnailer" + #define TYPE_THUMBNAILER (thumbnailer_get_type()) #define THUMBNAILER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_THUMBNAILER, Thumbnailer)) #define THUMBNAILER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), TYPE_THUMBNAILER, ThumbnailerClass))
- Previous message: [maemo-commits] r15942 - in projects/haf/trunk/sapwood: . src
- Next message: [maemo-commits] r15944 - projects/haf
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]