[Xfce4-commits] r25292 - in squeeze/trunk: . libsqueeze src

Stephan Arts stephan at xfce.org
Sun Mar 25 16:33:55 CEST 2007


Author: stephan
Date: 2007-03-25 14:33:55 +0000 (Sun, 25 Mar 2007)
New Revision: 25292

Modified:
   squeeze/trunk/configure.in.in
   squeeze/trunk/libsqueeze/Makefile.am
   squeeze/trunk/libsqueeze/command-builder.c
   squeeze/trunk/libsqueeze/dbus-command.c
   squeeze/trunk/libsqueeze/dbus-command.h
   squeeze/trunk/libsqueeze/libsqueeze-module.h
   squeeze/trunk/src/Makefile.am
Log:
partially implemented dbus-command

Modified: squeeze/trunk/configure.in.in
===================================================================
--- squeeze/trunk/configure.in.in	2007-03-25 13:22:21 UTC (rev 25291)
+++ squeeze/trunk/configure.in.in	2007-03-25 14:33:55 UTC (rev 25292)
@@ -123,6 +123,7 @@
 XDT_CHECK_PACKAGE([GOBJECT], [gobject-2.0], [2.4.0])
 XDT_CHECK_PACKAGE([THUNAR_VFS], [thunar-vfs-1], [0.4.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99])
+XDT_CHECK_PACKAGE([DBUS], [dbus-glib-1], [0.34])
 
 AC_DEFINE([HAVE_LIBXFCE4UTIL], [1], [Define if we have libxfce4util (will become optional eventually)])
 AC_DEFINE([EXO_API_SUBJECT_TO_CHANGE], [1], [Define we understand libexo is subject to api churn])

Modified: squeeze/trunk/libsqueeze/Makefile.am
===================================================================
--- squeeze/trunk/libsqueeze/Makefile.am	2007-03-25 13:22:21 UTC (rev 25291)
+++ squeeze/trunk/libsqueeze/Makefile.am	2007-03-25 14:33:55 UTC (rev 25292)
@@ -25,6 +25,7 @@
 
 libsqueeze_1_la_CFLAGS = \
 	$(GLIB_CFLAGS)  \
+	$(DBUS_CFLAGS)  \
 	$(THUNAR_VFS_CFLAGS)
 
 libsqueeze_1_la_LIBADD =

Modified: squeeze/trunk/libsqueeze/command-builder.c
===================================================================
--- squeeze/trunk/libsqueeze/command-builder.c	2007-03-25 13:22:21 UTC (rev 25291)
+++ squeeze/trunk/libsqueeze/command-builder.c	2007-03-25 14:33:55 UTC (rev 25292)
@@ -124,8 +124,9 @@
 lsq_command_builder_build_open(LSQCommandBuilder *builder, LSQArchive *archive, GSList *files)
 {
 	LSQArchiveCommand *extract = builder->build_extract(builder, archive, lsq_tempfs_get_root_dir(archive), files);
-	LSQArchiveCommand *launch = lsq_dbus_command_new("Execute", archive);
+	LSQArchiveCommand *launch = lsq_dbus_command_new("Execute", archive, "org.xfce.FileManager", "/org/xfce/FileManager","org.xfce.FileManager", "Launch");
 	LSQArchiveCommand *macro = lsq_macro_command_new("Open", archive);
+
 	lsq_macro_command_append(LSQ_MACRO_COMMAND(macro), extract);
 	lsq_macro_command_append(LSQ_MACRO_COMMAND(macro), launch);
 

Modified: squeeze/trunk/libsqueeze/dbus-command.c
===================================================================
--- squeeze/trunk/libsqueeze/dbus-command.c	2007-03-25 13:22:21 UTC (rev 25291)
+++ squeeze/trunk/libsqueeze/dbus-command.c	2007-03-25 14:33:55 UTC (rev 25292)
@@ -22,6 +22,7 @@
 #include <signal.h>
 #include <sys/wait.h>
 #include <sys/types.h>
+#include <dbus/dbus-glib.h>
 #include <thunar-vfs/thunar-vfs.h>
 
 #include "libsqueeze-module.h"
@@ -124,18 +125,39 @@
  * Returns: a new LSQDBusCommand object
  */
 LSQArchiveCommand *
-lsq_dbus_command_new(const gchar *comment, LSQArchive *archive)
+lsq_dbus_command_new(const gchar *comment, LSQArchive *archive, const gchar *service, const gchar *path, const gchar *interface, const gchar *method)
 {
+	GError *error = NULL;
 	LSQArchiveCommand *archive_command;
 
 	archive_command = g_object_new(lsq_dbus_command_get_type(), NULL);
 
+	LSQDBusCommand    *dbus_command = LSQ_DBUS_COMMAND(archive_command);
+
+	dbus_command->connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+
+	dbus_command = LSQ_DBUS_COMMAND(archive_command);
+	dbus_command->proxy = dbus_g_proxy_new_for_name (dbus_command->connection, service, path, interface);
+	dbus_command->method_name = g_strdup(method);
+
+
+	archive_command->archive = archive;
+
 	return archive_command;
 }
 
+void
+lsq_dbus_command_set_args(LSQDBusCommand *command, ...)
+{
+}
+
 static gboolean
 lsq_dbus_command_execute(LSQArchiveCommand *command)
 {
-	g_critical("DBUS COMMAND NOT IMPLEMENTED");
-	return FALSE;
+	GError *error = NULL;
+	LSQDBusCommand *dbus_command = LSQ_DBUS_COMMAND(command);
+	
+	/* args */
+	dbus_g_proxy_call(dbus_command->proxy, dbus_command->method_name, &error, G_TYPE_STRING, "/home", G_TYPE_STRING, ":0.0", G_TYPE_INVALID);
+	return TRUE;
 }

Modified: squeeze/trunk/libsqueeze/dbus-command.h
===================================================================
--- squeeze/trunk/libsqueeze/dbus-command.h	2007-03-25 13:22:21 UTC (rev 25291)
+++ squeeze/trunk/libsqueeze/dbus-command.h	2007-03-25 14:33:55 UTC (rev 25292)
@@ -42,7 +42,10 @@
 struct _LSQDBusCommand
 {
 	LSQArchiveCommand  parent;
-	GSList *command_queue;
+	DBusGConnection *connection;
+	DBusGProxy      *proxy;
+	gchar *method_name;
+	gchar *filename;
 };
 
 typedef struct _LSQDBusCommandClass LSQDBusCommandClass;
@@ -52,8 +55,8 @@
 	LSQArchiveCommandClass parent;
 }; 
 
-LSQArchiveCommand * lsq_dbus_command_new(const gchar *comment, LSQArchive *archive);
-void lsq_dbus_command_append(LSQDBusCommand *command, LSQArchiveCommand *sub_command);
+LSQArchiveCommand * lsq_dbus_command_new(const gchar *comment, LSQArchive *archive, const gchar *, const gchar *, const gchar *, const gchar *);
+void                lsq_dbus_command_set_args(LSQDBusCommand *command, ...);
 
 G_END_DECLS
 #endif /* __LIBSQUEEZE_DBUS_COMMAND_H__ */

Modified: squeeze/trunk/libsqueeze/libsqueeze-module.h
===================================================================
--- squeeze/trunk/libsqueeze/libsqueeze-module.h	2007-03-25 13:22:21 UTC (rev 25291)
+++ squeeze/trunk/libsqueeze/libsqueeze-module.h	2007-03-25 14:33:55 UTC (rev 25292)
@@ -16,6 +16,7 @@
 #ifndef __LIBSQUEEZE_MODULE_H__
 #define __LIBSQUEEZE_MODULE_H__ 
 
+#include <dbus/dbus-glib.h>
 #include <libsqueeze/libsqueeze-archive.h>
 #include <libsqueeze/libsqueeze-command.h>
 #include <libsqueeze/archive-command.h>

Modified: squeeze/trunk/src/Makefile.am
===================================================================
--- squeeze/trunk/src/Makefile.am	2007-03-25 13:22:21 UTC (rev 25291)
+++ squeeze/trunk/src/Makefile.am	2007-03-25 14:33:55 UTC (rev 25292)
@@ -32,6 +32,7 @@
 squeeze_CFLAGS = \
 	@GTK_CFLAGS@ \
 	@GLIB_CFLAGS@ \
+	@DBUS_CFLAGS@ \
 	$(THUNAR_VFS_CFLAGS) \
 	$(XFCE4UTIL_CFLAGS) \
 	-DDATADIR=\"$(datadir)\" \
@@ -42,6 +43,7 @@
 	$(top_srcdir)/libsqueeze/libsqueeze-1.la \
 	@GTK_LIBS@ \
 	@GLIB_LIBS@ \
+	@DBUS_LIBS@ \
 	@THUNAR_VFS_LIBS@
 
 squeeze_LDFLAGS = -static



More information about the Xfce4-commits mailing list