[Xfce4-commits] <thunarx-python:master> Moved around some function definitions

Adam Plumb noreply at xfce.org
Thu May 27 18:11:37 CEST 2010


Updating branch refs/heads/master
         to 9afec328d6dbcaf55bc624f4dea5e141a09749ea (commit)
       from e240c2d80c59e19d6cb5fff44cd6c7efc5342c16 (commit)

commit 9afec328d6dbcaf55bc624f4dea5e141a09749ea
Author: Adam Plumb <adamplumb at gmail.com>
Date:   Wed Dec 16 08:57:23 2009 -0500

    Moved around some function definitions

 src/thunarx-python-object.c |   81 +++++++++++++++++++++++++++++++++++++------
 src/thunarx-python-object.h |   24 -------------
 2 files changed, 70 insertions(+), 35 deletions(-)

diff --git a/src/thunarx-python-object.c b/src/thunarx-python-object.c
index 0908ab2..1e078aa 100644
--- a/src/thunarx-python-object.c
+++ b/src/thunarx-python-object.c
@@ -32,6 +32,34 @@
 
 static GObjectClass *parent_class;
 
+static void 
+thunarx_python_object_instance_init (ThunarxPythonObject *object);
+static void
+thunarx_python_object_finalize (GObject *object);
+static void
+thunarx_python_object_class_init (ThunarxPythonObjectClass *klass,
+								                  gpointer class_data);
+								                  
+								                  
+
+static void thunarx_python_object_menu_provider_iface_init      (ThunarxMenuProviderIface *iface);
+static GList *thunarx_python_object_get_file_actions            (ThunarxMenuProvider      *provider,
+                                                                 GtkWidget                *window,
+                                                                 GList                    *files);
+static GList *thunarx_python_object_get_folder_actions          (ThunarxMenuProvider      *provider,
+                              									                 GtkWidget                *window,
+	                         		 								                   ThunarxFileInfo          *folder);
+static GList *thunarx_python_object_get_dnd_actions             (ThunarxMenuProvider      *provider,
+                       		  									                   GtkWidget                *window,
+	                        										                   ThunarxFileInfo          *folder,
+	                        										                   GList                    *files);
+
+
+static void thunarx_python_object_property_page_provider_iface_init      (ThunarxPropertyPageProviderIface *iface);
+static GList *thunarx_python_object_get_property_pages          (ThunarxMenuProviderIface *provider,
+										                                             GList                    *files);
+
+
 /* These macros assumes the following things:
  *   a METHOD_NAME is defined with is a string
  *   a goto label called beach
@@ -86,16 +114,6 @@ static GObjectClass *parent_class;
     }
 
 
-static void
-thunarx_python_object_menu_provider_iface_init (ThunarxMenuProviderIface *iface)
-{
-	iface->get_file_actions = thunarx_python_object_get_file_actions;
-	iface->get_folder_actions = thunarx_python_object_get_folder_actions;
-	iface->get_dnd_actions = thunarx_python_object_get_dnd_actions;
-}
-
-
-
 #define METHOD_NAME "get_file_actions"
 static GList *
 thunarx_python_object_get_file_actions (ThunarxMenuProvider *provider,
@@ -199,7 +217,48 @@ beach:
 
 
 
+static void
+thunarx_python_object_menu_provider_iface_init (ThunarxMenuProviderIface *iface)
+{
+	iface->get_file_actions = thunarx_python_object_get_file_actions;
+	iface->get_folder_actions = thunarx_python_object_get_folder_actions;
+	iface->get_dnd_actions = thunarx_python_object_get_dnd_actions;
+}
+
 /*
+
+#define METHOD_NAME "get_property_pages"
+static GList *
+thunarx_python_object_get_property_pages (ThunarxMenuProviderIface *provider,
+										                      GList *files)
+{
+	ThunarxPythonObject *object = (ThunarxPythonObject*)provider;
+  PyObject *py_files, *py_ret = NULL;
+  GList *ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+	
+  debug_enter();
+
+	CHECK_METHOD_NAME(object->instance);
+
+	CONVERT_LIST(py_files, files);
+	
+  py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 "(N)", py_files);
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, ThunarxPropertyPage, "thunarx.PropertyPage");
+	
+beach:
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+  return ret;
+}
+#undef METHOD_NAME
+
+
+
+
 static void
 thunarx_python_object_property_page_provider_iface_init (ThunarxPropertyPageProviderIface *iface)
 {
@@ -281,7 +340,7 @@ thunarx_python_object_get_type (ThunarxProviderPlugin *plugin, PyObject *type)
 		NULL,
 		NULL
 	};
-	  
+
 	static const GInterfaceInfo property_page_provider_iface_info = {
 		(GInterfaceInitFunc) thunarx_python_object_property_page_provider_iface_init,
 		NULL,
diff --git a/src/thunarx-python-object.h b/src/thunarx-python-object.h
index 0f093d7..184ae1a 100644
--- a/src/thunarx-python-object.h
+++ b/src/thunarx-python-object.h
@@ -40,30 +40,6 @@ struct _ThunarxPythonObjectClass {
   PyObject *type;
 };
 
-static void
-thunarx_python_object_menu_provider_iface_init (ThunarxMenuProviderIface *iface);
-static GList *
-thunarx_python_object_get_file_actions (ThunarxMenuProvider *provider,
-                                        GtkWidget *window,
-                                        GList *files);
-static GList *
-thunarx_python_object_get_folder_actions (ThunarxMenuProvider *provider,
- 		  									                  GtkWidget *window,
-	  										                  ThunarxFileInfo *folder);
-static GList *
-thunarx_python_object_get_dnd_actions (ThunarxMenuProvider *provider,
- 		  									                  GtkWidget *window,
-	  										                  ThunarxFileInfo *folder,
-	  										                  GList *files);
-
-static void 
-thunarx_python_object_instance_init (ThunarxPythonObject *object);
-static void
-thunarx_python_object_finalize (GObject *object);
-static void
-thunarx_python_object_class_init (ThunarxPythonObjectClass *klass,
-								                  gpointer class_data);
-
 GType 
 thunarx_python_object_get_type (ThunarxProviderPlugin *plugin, PyObject *type);
 



More information about the Xfce4-commits mailing list