aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-03-19 20:25:35 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-03-19 20:25:35 +0800
commit32543a84d58c6e882783b3acb02c7d55d88718b8 (patch)
tree830074460d0ed90d5468272d91335bf0ed6b9c0c
parent5a469caab6a79486e7865339b1a23689f9c600a2 (diff)
downloadgsoc2013-evolution-32543a84d58c6e882783b3acb02c7d55d88718b8.tar
gsoc2013-evolution-32543a84d58c6e882783b3acb02c7d55d88718b8.tar.gz
gsoc2013-evolution-32543a84d58c6e882783b3acb02c7d55d88718b8.tar.bz2
gsoc2013-evolution-32543a84d58c6e882783b3acb02c7d55d88718b8.tar.lz
gsoc2013-evolution-32543a84d58c6e882783b3acb02c7d55d88718b8.tar.xz
gsoc2013-evolution-32543a84d58c6e882783b3acb02c7d55d88718b8.tar.zst
gsoc2013-evolution-32543a84d58c6e882783b3acb02c7d55d88718b8.zip
Initial step for refactoring of the DnD API for ShellComponents.
svn path=/trunk/; revision=8820
-rw-r--r--shell/ChangeLog19
-rw-r--r--shell/Evolution-ShellComponent.idl8
-rw-r--r--shell/Evolution-ShellComponentDnd.idl92
-rw-r--r--shell/Evolution.idl1
-rw-r--r--shell/Makefile.am1
-rw-r--r--shell/e-storage-set-view.c2
-rw-r--r--shell/evolution-shell-component-client.c50
-rw-r--r--shell/evolution-shell-component-client.h8
-rw-r--r--shell/evolution-shell-component.c48
9 files changed, 114 insertions, 115 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 9c8ae7bb51..db55da8345 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,4 +1,21 @@
-2001-03-15 Pablo Saratxaga <pabloàmandrakesoft.com>
+2001-03-19 Ettore Perazzoli <ettore@ximian.com>
+
+ * e-storage-set-view.c (table_drag_data_get): Don't get the
+ selection through
+ `evolution_shell_component_client_get_dnd_selection()'.
+
+ * evolution-shell-component.c
+ (impl_ShellComponent_getDndSelection): Removed.
+ (class_init): Don't install.
+
+ * evolution-shell-component-client.c
+ (evolution_shell_component_client_get_dnd_selection): Removed.
+
+ * Evolution-ShellComponentDnd.idl: New file with the DnD stuff.
+
+ * Evolution-ShellComponent.idl: Removed the dnd stuff.
+
+2001-03-15 Pablo Saratxaga <pablo@mandrakesoft.com>
* main.c: fixed a no-c-format tag
diff --git a/shell/Evolution-ShellComponent.idl b/shell/Evolution-ShellComponent.idl
index 1e1b32eeeb..9c491a1b42 100644
--- a/shell/Evolution-ShellComponent.idl
+++ b/shell/Evolution-ShellComponent.idl
@@ -69,14 +69,6 @@ module Evolution {
void populateFolderContextMenu (in Bonobo::UIContainer uih,
in string physical_uri,
in string type);
-
- typedef sequence<octet> Selection;
- exception NoSelection {};
-
- void getDndSelection (in string physical_uri, in short type,
- out short format,
- out Selection selection)
- raises (NoSelection);
};
interface ShellComponentListener {
diff --git a/shell/Evolution-ShellComponentDnd.idl b/shell/Evolution-ShellComponentDnd.idl
new file mode 100644
index 0000000000..766bff2b33
--- /dev/null
+++ b/shell/Evolution-ShellComponentDnd.idl
@@ -0,0 +1,92 @@
+/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Interface for the Evolution components.
+ *
+ * Authors:
+ * Ettore Perazzoli <ettore@helixcode.com>
+ *
+ * Copyright (C) 2001 Ximian, Inc.
+ */
+
+#include <Bonobo.h>
+
+module GNOME {
+module Evolution {
+module ShellComponentDnd {
+ typedef short Action;
+ const Action ACTION_DEFAULT = 0;
+ const Action ACTION_COPY = 1 << 1;
+ const Action ACTION_MOVE = 1 << 2;
+ const Action ACTION_LINK = 1 << 3;
+ const Action ACTION_ASK = 1 << 4;
+ const Action ACTION_ANY = ACTION_COPY | ACTION_MOVE | ACTION_LINK | ACTION_ASK;
+
+ typedef Action ActionSet; // For readability.
+
+ struct Data {
+ short format;
+ short info;
+ sequence <octet> bytes;
+ };
+
+ exception NoData {};
+
+ interface SourceFolder {
+ struct Context {
+ string physical_uri;
+ string folder_type;
+ ActionSet possible_actions;
+ Action suggested_action;
+ };
+
+ /* The user started a drag from this object. If the component
+ receives this while still in the middle of an existing drag
+ operation, it should stop the existing drag operation and
+ start a new one. */
+ void beginDrag (in string physical_uri,
+ in string folder_type,
+ out ActionSet possible_actions,
+ out Action suggested_action);
+
+ /* User released the mouse button and dropped the object
+ somewhere, so we now want to get the data for the current
+ context. */
+ void getData (in Context source_context,
+ in Action action,
+ in string dnd_type,
+ out Data data)
+ raises (NoData);
+
+ /* The target has finished processing the data, so we can
+ delete it. */
+ void deleteData (in Context source_context);
+
+ /* The drag is over. */
+ void endDrag (in Context source_context);
+ };
+
+ interface DestinationFolder {
+ struct Context {
+ string dnd_type;
+ ActionSet possible_actions;
+ Action suggested_action;
+ };
+
+ /* The user is moving a dragged object over our folder. This
+ will return %FALSE if the specified object cannot be
+ dropped; otherwise, it will return %TRUE and then set the
+ @action we want to be performed when the drop happens. */
+ boolean handleMotion (in Context destination_context,
+ out Action default_action,
+ out Action non_default_action);
+
+ /* Data is dropped. We are given the data for the dropped
+ object, and we are supposed to perform the operation
+ requested. */
+ boolean handleDrop (in Context destination_context,
+ in Action action,
+ in Data data);
+ };
+};
+};
+};
diff --git a/shell/Evolution.idl b/shell/Evolution.idl
index 71ae040684..8acee9f76b 100644
--- a/shell/Evolution.idl
+++ b/shell/Evolution.idl
@@ -12,6 +12,7 @@
#include <Evolution-Session.idl>
#include <Evolution-ShellComponent.idl>
+#include <Evolution-ShellComponentDnd.idl>
#include <Evolution-ShellView.idl>
#include <Evolution-Storage.idl>
#include <Evolution-StorageSetView.idl>
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 699e137496..d52972c02a 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -22,6 +22,7 @@ IDLS = \
Evolution-Session.idl \
Evolution-Shell.idl \
Evolution-ShellComponent.idl \
+ Evolution-ShellComponentDnd.idl \
Evolution-ShellView.idl \
Evolution-Storage.idl \
Evolution-StorageSetView.idl \
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index ccab7502f2..8c1a81ca25 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -699,12 +699,14 @@ table_drag_data_get (ETable *etable,
e_folder_get_type_string (folder));
g_assert (component_client != NULL);
+#if 0
evolution_shell_component_client_get_dnd_selection (component_client,
e_folder_get_physical_uri (folder),
info,
&format, &selection, &selection_length);
if (selection == NULL)
return;
+#endif
gtk_selection_data_set (selection_data, selection_data->target,
format, selection, selection_length);
diff --git a/shell/evolution-shell-component-client.c b/shell/evolution-shell-component-client.c
index 2a35c0c56b..4717c5f23d 100644
--- a/shell/evolution-shell-component-client.c
+++ b/shell/evolution-shell-component-client.c
@@ -533,55 +533,5 @@ 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)
diff --git a/shell/evolution-shell-component-client.h b/shell/evolution-shell-component-client.h
index 03a76a7d31..319902198f 100644
--- a/shell/evolution-shell-component-client.h
+++ b/shell/evolution-shell-component-client.h
@@ -94,14 +94,6 @@ void evolution_shell_component_client_populate_folder_context_menu (EvolutionS
const char *physical_uri,
const char *type);
-/* DND stuff. */
-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);
-
#ifdef cplusplus
}
#endif /* cplusplus */
diff --git a/shell/evolution-shell-component.c b/shell/evolution-shell-component.c
index f076daf431..70b7423ece 100644
--- a/shell/evolution-shell-component.c
+++ b/shell/evolution-shell-component.c
@@ -367,53 +367,6 @@ impl_ShellComponent_populate_folder_context_menu (PortableServer_Servant servant
bonobo_object_unref (BONOBO_OBJECT (uic));
}
-static void
-impl_ShellComponent_getDndSelection (PortableServer_Servant servant,
- const CORBA_char *physical_uri,
- const CORBA_short type,
- CORBA_short *format_return,
- GNOME_Evolution_ShellComponent_Selection **selection_return,
- CORBA_Environment *ev)
-{
- BonoboObject *bonobo_object;
- EvolutionShellComponent *shell_component;
- EvolutionShellComponentPrivate *priv;
- const char *selection;
- int selection_length;
- int format;
-
- bonobo_object = bonobo_object_from_servant (servant);
- shell_component = EVOLUTION_SHELL_COMPONENT (bonobo_object);
- priv = shell_component->priv;
-
- if (priv->get_dnd_selection_fn == NULL) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_ShellComponent_NoSelection, NULL);
- return;
- }
-
- (* priv->get_dnd_selection_fn) (shell_component, physical_uri, type,
- &format, &selection, &selection_length,
- priv->closure);
-
- if (selection == NULL) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_ShellComponent_NoSelection, NULL);
- } else {
- *format_return = format;
-
- *selection_return = GNOME_Evolution_ShellComponent_Selection__alloc ();
-
- (* selection_return)->_buffer = CORBA_octet_allocbuf (selection_length);
- memcpy ((* selection_return)->_buffer, selection, selection_length);
-
- (* selection_return)->_length = selection_length;
- (* selection_return)->_maximum = selection_length;
-
- CORBA_sequence_set_release (*selection_return, TRUE);
- }
-}
-
/* GtkObject methods. */
@@ -495,7 +448,6 @@ class_init (EvolutionShellComponentClass *klass)
epv->createFolderAsync = impl_ShellComponent_async_create_folder;
epv->removeFolderAsync = impl_ShellComponent_async_remove_folder;
epv->populateFolderContextMenu = impl_ShellComponent_populate_folder_context_menu;
- epv->getDndSelection = impl_ShellComponent_getDndSelection;
}
static void