[Xfce4-commits] <thunarx-python:master> Added the get_dnd_actions method
Adam Plumb
noreply at xfce.org
Thu May 27 18:11:33 CEST 2010
Updating branch refs/heads/master
to ef3f80696bc762c8c00f64edcc332b812651cea1 (commit)
from fb5a7b8f2d8066ff0d1d8be7db5d77efaad10ded (commit)
commit ef3f80696bc762c8c00f64edcc332b812651cea1
Author: Adam Plumb <adamplumb at gmail.com>
Date: Tue Dec 15 09:39:09 2009 -0500
Added the get_dnd_actions method
src/thunarx-python-object.c | 40 +++++++++++++++++++++++++++++++++++++++-
src/thunarx-python-object.h | 6 +++++-
2 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/src/thunarx-python-object.c b/src/thunarx-python-object.c
index 5d42e05..0908ab2 100644
--- a/src/thunarx-python-object.c
+++ b/src/thunarx-python-object.c
@@ -91,7 +91,7 @@ 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;
+ iface->get_dnd_actions = thunarx_python_object_get_dnd_actions;
}
@@ -161,6 +161,44 @@ beach:
#undef METHOD_NAME
+
+#define METHOD_NAME "get_dnd_actions"
+static GList *
+thunarx_python_object_get_dnd_actions (ThunarxMenuProvider *provider,
+ GtkWidget *window,
+ ThunarxFileInfo *folder,
+ GList *files)
+{
+ ThunarxPythonObject *object = (ThunarxPythonObject*)provider;
+ GList *ret = NULL;
+ PyObject *py_ret = NULL, *py_files;
+ 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,
+ "(NN)",
+ pygobject_new((GObject *)window),
+ pygobject_new((GObject *)folder),
+ py_files);
+
+ HANDLE_RETVAL(py_ret);
+
+ HANDLE_LIST(py_ret, GtkAction, "gtk.Action");
+
+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)
diff --git a/src/thunarx-python-object.h b/src/thunarx-python-object.h
index 77de42c..0f093d7 100644
--- a/src/thunarx-python-object.h
+++ b/src/thunarx-python-object.h
@@ -50,7 +50,11 @@ 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);
More information about the Xfce4-commits
mailing list