Author: jannis Date: 2009-05-14 20:04:43 +0000 (Thu, 14 May 2009) New Revision: 29959
Added: libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-marshal.list Modified: libexo/branches/exo-thumbnailers/ChangeLog libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-generic-thumbnailer.c libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-generic-thumbnailer.h libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-service-dbus.xml libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-service.c Log: * exo-thumbnailers/Makefile.am, exo-thumbnailers/exo-generic-thumbnailer.{c,h}, exo-thumbnailers/exo-thumbnailer-marshal.list, exo-thumbnailers/exo-thumbnailer-service-dbus.xml, exo-thumbnailers/exo-thumbnailer-service.c, exo-thumbnailers/org.xfce.ExoThumbnailer.service.in: Add exo-thumbnailer-marshal.list. Implement the Generic API of the thumbnail management D-Bus specification in the generic thumbnailer. It doesn't do anything yet but at least it is properly recognized as a service now and responds to all D-Bus methods defined in the spec. Modified: libexo/branches/exo-thumbnailers/ChangeLog =================================================================== --- libexo/branches/exo-thumbnailers/ChangeLog 2009-05-14 14:59:24 UTC (rev 29958) +++ libexo/branches/exo-thumbnailers/ChangeLog 2009-05-14 20:04:43 UTC (rev 29959) @@ -1,5 +1,18 @@ 2009-05-14 Jannis Pohlmann <jan...@xfce.org> + * exo-thumbnailers/Makefile.am, + exo-thumbnailers/exo-generic-thumbnailer.{c,h}, + exo-thumbnailers/exo-thumbnailer-marshal.list, + exo-thumbnailers/exo-thumbnailer-service-dbus.xml, + exo-thumbnailers/exo-thumbnailer-service.c, + exo-thumbnailers/org.xfce.ExoThumbnailer.service.in: Add + exo-thumbnailer-marshal.list. Implement the Generic API of the + thumbnail management D-Bus specification in the generic thumbnailer. + It doesn't do anything yet but at least it is properly recognized as + a service now and responds to all D-Bus methods defined in the spec. + +2009-05-14 Jannis Pohlmann <jan...@xfce.org> + * configure.in.in, Makefile.am, exo-thumbnailers/Makefile.am, exo-thumbnailers/exo-generic-thumbnailer.{c,h}, exo-thumbnailers/exo-thumbnailer-service-dbus.xml, Modified: libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-generic-thumbnailer.c =================================================================== --- libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-generic-thumbnailer.c 2009-05-14 14:59:24 UTC (rev 29958) +++ libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-generic-thumbnailer.c 2009-05-14 20:04:43 UTC (rev 29959) @@ -25,6 +25,8 @@ #include <glib.h> #include <glib-object.h> +#include <exo/exo-private.h> +#include <exo-thumbnailers/exo-thumbnailer-marshal.h> #include <exo-thumbnailers/exo-generic-thumbnailer.h> #include <exo-thumbnailers/exo-generic-thumbnailer-dbus-bindings.h> @@ -34,6 +36,18 @@ +/* Signal identifiers */ +enum +{ + READY, + STARTED, + FINISHED, + ERROR, + LAST_SIGNAL, +}; + + + /* Property identifiers */ enum { @@ -60,6 +74,18 @@ struct _ExoGenericThumbnailerClass { GObjectClass __parent__; + + void (*ready) (ExoGenericThumbnailer *thumbnailer, + const gchar **uris); + void (*started) (ExoGenericThumbnailer *thumbnailer, + guint32 handle); + void (*finished) (ExoGenericThumbnailer *thumbnailer, + guint32 handle); + void (*error) (ExoGenericThumbnailer *thumbnailer, + guint32 handle, + const gchar **failed_uris, + gint error_code, + const gchar *message); }; struct _ExoGenericThumbnailer @@ -77,6 +103,7 @@ static GObjectClass *exo_generic_thumbnailer_parent_class = NULL; +static gint thumbnailer_signals[LAST_SIGNAL]; @@ -117,6 +144,48 @@ gobject_class->get_property = exo_generic_thumbnailer_get_property; gobject_class->set_property = exo_generic_thumbnailer_set_property; + thumbnailer_signals[READY] = g_signal_new ("ready", + EXO_TYPE_GENERIC_THUMBNAILER, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ExoGenericThumbnailerClass, ready), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, + 1, + G_TYPE_STRV); + + thumbnailer_signals[STARTED] = g_signal_new ("started", + EXO_TYPE_GENERIC_THUMBNAILER, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ExoGenericThumbnailerClass, started), + NULL, NULL, g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, + 1, + G_TYPE_UINT); + + thumbnailer_signals[FINISHED] = g_signal_new ("finished", + EXO_TYPE_GENERIC_THUMBNAILER, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ExoGenericThumbnailerClass, finished), + NULL, NULL, + g_cclosure_marshal_VOID__UINT, + G_TYPE_NONE, + 1, + G_TYPE_UINT); + + thumbnailer_signals[ERROR] = g_signal_new ("error", + EXO_TYPE_GENERIC_THUMBNAILER, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ExoGenericThumbnailerClass, error), + NULL, NULL, + _exo_thumbnailer_marshal_VOID__UINT_BOXED_INT_STRING, + G_TYPE_NONE, + 4, + G_TYPE_UINT, + G_TYPE_STRV, + G_TYPE_INT, + G_TYPE_STRING); + dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), &dbus_glib_exo_generic_thumbnailer_object_info); } @@ -206,29 +275,82 @@ guint32 *handle, GError **error) { - gint n; + _exo_return_val_if_fail (EXO_IS_GENERIC_THUMBNAILER (thumbnailer), FALSE); + _exo_return_val_if_fail (uris != NULL, FALSE); + _exo_return_val_if_fail (error == NULL || *error == NULL, FALSE); - g_debug ("exo_generic_thumbnailer_queue:"); + return TRUE; +} + + +gboolean +exo_generic_thumbnailer_unqueue (ExoGenericThumbnailer *thumbnailer, + guint32 handle, + GError **error) +{ + _exo_return_val_if_fail (EXO_IS_GENERIC_THUMBNAILER (thumbnailer), FALSE); + _exo_return_val_if_fail (error == NULL || *error == NULL, FALSE); + return TRUE; +} - g_debug (" uris = "); - for (n = 0; uris[n] != NULL; ++n) - g_debug (" %s", uris[n]); - g_debug (" mime_hints = "); - for (n = 0; mime_hints[n] != NULL; ++n) - g_debug (" %s", mime_hints[n]); +gboolean +exo_generic_thumbnailer_move (ExoGenericThumbnailer *thumbnailer, + const gchar **from_uris, + const gchar **to_uris, + GError **error) +{ + _exo_return_val_if_fail (EXO_IS_GENERIC_THUMBNAILER (thumbnailer), FALSE); + _exo_return_val_if_fail (from_uris != NULL, FALSE); + _exo_return_val_if_fail (to_uris != NULL, FALSE); + _exo_return_val_if_fail (error == NULL || *error == NULL, FALSE); + return TRUE; } -gboolean -exo_generic_thumbnailer_test (ExoGenericThumbnailer *thumbnailer, +gboolean +exo_generic_thumbnailer_copy (ExoGenericThumbnailer *thumbnailer, + const gchar **from_uris, + const gchar **to_uris, GError **error) { - g_debug ("Test"); + _exo_return_val_if_fail (EXO_IS_GENERIC_THUMBNAILER (thumbnailer), FALSE); + _exo_return_val_if_fail (from_uris != NULL, FALSE); + _exo_return_val_if_fail (to_uris != NULL, FALSE); + _exo_return_val_if_fail (error == NULL || *error == NULL, FALSE); + return TRUE; } + + + +gboolean +exo_generic_thumbnailer_delete (ExoGenericThumbnailer *thumbnailer, + const gchar **uris, + GError **error) +{ + _exo_return_val_if_fail (EXO_IS_GENERIC_THUMBNAILER (thumbnailer), FALSE); + _exo_return_val_if_fail (uris != NULL, FALSE); + _exo_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + return TRUE; +} + + + +gboolean +exo_generic_thumbnailer_cleanup (ExoGenericThumbnailer *thumbnailer, + const gchar *uri_prefix, + guint32 since, + GError **error) +{ + _exo_return_val_if_fail (EXO_IS_GENERIC_THUMBNAILER (thumbnailer), FALSE); + _exo_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + return TRUE; +} Modified: libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-generic-thumbnailer.h =================================================================== --- libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-generic-thumbnailer.h 2009-05-14 14:59:24 UTC (rev 29958) +++ libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-generic-thumbnailer.h 2009-05-14 20:04:43 UTC (rev 29959) @@ -42,11 +42,27 @@ gboolean exo_generic_thumbnailer_queue (ExoGenericThumbnailer *thumbnailer, const gchar **uris, const gchar **mime_hints, - guint32 unqueue_handle, + guint32 handle_to_unqueue, guint32 *handle, GError **error); -gboolean exo_generic_thumbnailer_test (ExoGenericThumbnailer *thumbnailer, +gboolean exo_generic_thumbnailer_unqueue (ExoGenericThumbnailer *thumbnailer, + guint32 handle, GError **error); +gboolean exo_generic_thumbnailer_move (ExoGenericThumbnailer *thumbnailer, + const gchar **from_uris, + const gchar **to_uris, + GError **error); +gboolean exo_generic_thumbnailer_copy (ExoGenericThumbnailer *thumbnailer, + const gchar **from_uris, + const gchar **to_uris, + GError **error); +gboolean exo_generic_thumbnailer_delete (ExoGenericThumbnailer *thumbnailer, + const gchar **uris, + GError **error); +gboolean exo_generic_thumbnailer_cleanup (ExoGenericThumbnailer *thumbnailer, + const gchar *uri_prefix, + guint32 since, + GError **error); G_END_DECLS; Added: libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-marshal.list =================================================================== --- libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-marshal.list (rev 0) +++ libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-marshal.list 2009-05-14 20:04:43 UTC (rev 29959) @@ -0,0 +1 @@ +VOID:UINT,BOXED,INT,STRING Modified: libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-service-dbus.xml =================================================================== --- libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-service-dbus.xml 2009-05-14 14:59:24 UTC (rev 29958) +++ libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-service-dbus.xml 2009-05-14 20:04:43 UTC (rev 29959) @@ -12,7 +12,48 @@ <arg type="u" name="handle" direction="out" /> </method> - <method name="Test"> + <method name="Unqueue"> + <arg type="u" name="handle" direction="in" /> </method> + + <method name="Move"> + <arg type="as" name="from_uris" direction="in" /> + <arg type="as" name="to_uris" direction="in" /> + </method> + + <method name="Copy"> + <arg type="as" name="from_uris" direction="in" /> + <arg type="as" name="to_uris" direction="in" /> + </method> + + <method name="Delete"> + <arg type="as" name="uris" direction="in" /> + </method> + + <method name="Cleanup"> + <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> + <arg type="s" name="uri_prefix" direction="in" /> + <arg type="u" name="since" direction="in" /> + </method> + + <signal name="Ready"> + <arg type="as" name="uris" /> + </signal> + + <signal name="Started"> + <arg type="u" name="handle" /> + </signal> + + <signal name="Finished"> + <arg type="u" name="handle" /> + </signal> + + <signal name="Error"> + <arg type="u" name="handle" /> + <arg type="as" name="failed_uris" /> + <arg type="i" name="error_code" /> + <arg type="s" name="message" /> + </signal> + </interface> </node> Modified: libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-service.c =================================================================== --- libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-service.c 2009-05-14 14:59:24 UTC (rev 29958) +++ libexo/branches/exo-thumbnailers/exo-thumbnailers/exo-thumbnailer-service.c 2009-05-14 20:04:43 UTC (rev 29959) @@ -234,7 +234,7 @@ else if (error != NULL) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_FAILED, - _("Another org.freedesktop.thumbnailer.Generic is already running")); + _("Another generic freedesktop.org thumbnailer is already running")); } return FALSE; _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits