aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-shell-component-client.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-03-08 20:55:05 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-03-08 20:55:05 +0800
commit9618cd2cb63840bd9138519bc52a3afad07590fa (patch)
tree259fda93de990254e0c3a108be88e584b2646b7f /shell/evolution-shell-component-client.c
parent698fc6235d8b59e89369c5220ad6b15cc0c74b81 (diff)
downloadgsoc2013-evolution-9618cd2cb63840bd9138519bc52a3afad07590fa.tar.gz
gsoc2013-evolution-9618cd2cb63840bd9138519bc52a3afad07590fa.tar.zst
gsoc2013-evolution-9618cd2cb63840bd9138519bc52a3afad07590fa.zip
Added a ShellComponent method to retrieve the selection for drag and
drop and support for it in the shell. Untested. svn path=/trunk/; revision=8594
Diffstat (limited to 'shell/evolution-shell-component-client.c')
-rw-r--r--shell/evolution-shell-component-client.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/shell/evolution-shell-component-client.c b/shell/evolution-shell-component-client.c
index 4717c5f23d..2a35c0c56b 100644
--- a/shell/evolution-shell-component-client.c
+++ b/shell/evolution-shell-component-client.c
@@ -533,5 +533,55 @@ evolution_shell_component_client_populate_folder_context_menu (EvolutionShellCom
}
+void
+evolution_shell_component_client_get_dnd_selection (EvolutionShellComponentClient *shell_component_client,
+ const char *physical_uri,
+ int type,
+ int *format_return,
+ char **selection_return,
+ int *selection_length_return)
+{
+ EvolutionShellComponentClientPrivate *priv;
+ GNOME_Evolution_ShellComponent corba_shell_component;
+ CORBA_Environment ev;
+ GNOME_Evolution_ShellComponent_Selection *corba_selection;
+ CORBA_short format;
+
+ g_return_if_fail (shell_component_client != NULL);
+ g_return_if_fail (EVOLUTION_IS_SHELL_COMPONENT_CLIENT (shell_component_client));
+ g_return_if_fail (physical_uri != NULL);
+
+ priv = shell_component_client->priv;
+
+ CORBA_exception_init (&ev);
+
+ corba_shell_component = bonobo_object_corba_objref (BONOBO_OBJECT (shell_component_client));
+
+ GNOME_Evolution_ShellComponent_getDndSelection (corba_shell_component,
+ physical_uri, type,
+ &format, &corba_selection,
+ &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ *format_return = 0;
+ *selection_return = NULL;
+ *selection_length_return = 0;
+ return;
+ }
+
+ CORBA_exception_free (&ev);
+
+ *format_return = format;
+
+ /* We have to re-allocate the CORBA data using GLib because we cannot
+ mix g_ memory management with CORBA_ memory management. Yes, this
+ does suck. */
+ *selection_return = g_malloc (corba_selection->_length);
+ memcpy (*selection_return, corba_selection->_buffer, corba_selection->_length);
+ *selection_length_return = corba_selection->_length;
+
+ CORBA_free (corba_selection);
+}
+
+
E_MAKE_TYPE (evolution_shell_component_client, "EvolutionShellComponentClient",
EvolutionShellComponentClient, class_init, init, PARENT_TYPE)