aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-03-20 12:04:14 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-03-20 12:04:14 +0800
commitc0a1369297add5406a4bc554422e0dc1be2cbc56 (patch)
treec8857eb4cac84ffb993f9a1f55bdfd5bb9cf71b6
parentf0a79abc2cc5e1f7a7a3b8c71d47346e17de0fc1 (diff)
downloadgsoc2013-evolution-c0a1369297add5406a4bc554422e0dc1be2cbc56.tar
gsoc2013-evolution-c0a1369297add5406a4bc554422e0dc1be2cbc56.tar.gz
gsoc2013-evolution-c0a1369297add5406a4bc554422e0dc1be2cbc56.tar.bz2
gsoc2013-evolution-c0a1369297add5406a4bc554422e0dc1be2cbc56.tar.lz
gsoc2013-evolution-c0a1369297add5406a4bc554422e0dc1be2cbc56.tar.xz
gsoc2013-evolution-c0a1369297add5406a4bc554422e0dc1be2cbc56.tar.zst
gsoc2013-evolution-c0a1369297add5406a4bc554422e0dc1be2cbc56.zip
Added calls to the `EvolutionShellComponentClient' API to query the
DnD interfaces with caching. svn path=/trunk/; revision=8835
-rw-r--r--shell/ChangeLog12
-rw-r--r--shell/evolution-shell-component-client.c94
-rw-r--r--shell/evolution-shell-component-client.h7
3 files changed, 109 insertions, 4 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index b66d3aacf4..c3ae0600b6 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,17 @@
2001-03-19 Ettore Perazzoli <ettore@ximian.com>
+ * evolution-shell-component-client.c: New members
+ `dnd_source_folder_interface' and
+ `dnd_destination_folder_interface' in
+ `EvolutionShellCompoentClientPrivate'.
+ (init): Initialize.
+ (impl_destroy): Clean up.
+ (evolution_shell_component_client_get_dnd_source_interface): New.
+ (evolution_shell_component_client_get_dnd_destination_interface):
+ New.
+
+2001-03-19 Ettore Perazzoli <ettore@ximian.com>
+
* e-storage-set-view.c (init): Ooops. Initialize the
`drag_corba_source_context' member. correctly.
(table_drag_begin): Don't crash if queryInterface returns
diff --git a/shell/evolution-shell-component-client.c b/shell/evolution-shell-component-client.c
index 4717c5f23d..a3d1f1ea69 100644
--- a/shell/evolution-shell-component-client.c
+++ b/shell/evolution-shell-component-client.c
@@ -47,6 +47,9 @@ struct _EvolutionShellComponentClientPrivate {
GNOME_Evolution_ShellComponentListener listener_interface;
PortableServer_Servant listener_servant;
+
+ GNOME_Evolution_ShellComponentDnd_SourceFolder dnd_source_folder_interface;
+ GNOME_Evolution_ShellComponentDnd_DestinationFolder dnd_destination_folder_interface;
};
@@ -259,6 +262,7 @@ impl_destroy (GtkObject *object)
{
EvolutionShellComponentClient *shell_component_client;
EvolutionShellComponentClientPrivate *priv;
+ CORBA_Environment ev;
shell_component_client = EVOLUTION_SHELL_COMPONENT_CLIENT (object);
priv = shell_component_client->priv;
@@ -266,6 +270,20 @@ impl_destroy (GtkObject *object)
if (priv->callback != NULL)
dispatch_callback (shell_component_client, EVOLUTION_SHELL_COMPONENT_INTERRUPTED);
+ CORBA_exception_init (&ev);
+
+ if (priv->dnd_source_folder_interface != CORBA_OBJECT_NIL) {
+ Bonobo_Unknown_unref (priv->dnd_source_folder_interface, &ev);
+ CORBA_Object_release (priv->dnd_source_folder_interface, &ev);
+ }
+
+ if (priv->dnd_destination_folder_interface != CORBA_OBJECT_NIL) {
+ Bonobo_Unknown_unref (priv->dnd_destination_folder_interface, &ev);
+ CORBA_Object_release (priv->dnd_destination_folder_interface, &ev);
+ }
+
+ CORBA_exception_free (&ev);
+
g_free (priv);
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
@@ -289,10 +307,15 @@ init (EvolutionShellComponentClient *shell_component_client)
EvolutionShellComponentClientPrivate *priv;
priv = g_new (EvolutionShellComponentClientPrivate, 1);
- priv->listener_interface = CORBA_OBJECT_NIL;
- priv->listener_servant = NULL;
- priv->callback = NULL;
- priv->callback_data = NULL;
+
+ priv->listener_interface = CORBA_OBJECT_NIL;
+ priv->listener_servant = NULL;
+
+ priv->callback = NULL;
+ priv->callback_data = NULL;
+
+ priv->dnd_source_folder_interface = CORBA_OBJECT_NIL;
+ priv->dnd_destination_folder_interface = CORBA_OBJECT_NIL;
shell_component_client->priv = priv;
}
@@ -354,6 +377,69 @@ evolution_shell_component_client_new_for_objref (const GNOME_Evolution_ShellComp
}
+/* Querying DnD interfaces. */
+
+GNOME_Evolution_ShellComponentDnd_SourceFolder
+evolution_shell_component_client_get_dnd_source_interface (EvolutionShellComponentClient *shell_component_client)
+{
+ EvolutionShellComponentClientPrivate *priv;
+ GNOME_Evolution_ShellComponentDnd_SourceFolder interface;
+ CORBA_Environment ev;
+
+ g_return_val_if_fail (shell_component_client != NULL, CORBA_OBJECT_NIL);
+ g_return_val_if_fail (EVOLUTION_IS_SHELL_COMPONENT_CLIENT (shell_component_client), CORBA_OBJECT_NIL);
+
+ priv = shell_component_client->priv;
+
+ if (priv->dnd_source_folder_interface != CORBA_OBJECT_NIL)
+ return priv->dnd_source_folder_interface;
+
+ CORBA_exception_init (&ev);
+
+ interface = Bonobo_Unknown_queryInterface (bonobo_object_corba_objref (BONOBO_OBJECT (shell_component_client)),
+ "IDL:GNOME/Evolution/ShellComponentDnd/SourceFolder:1.0",
+ &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION)
+ interface = CORBA_OBJECT_NIL;
+
+ CORBA_exception_free (&ev);
+
+ priv->dnd_source_folder_interface = interface;
+ return interface;
+}
+
+GNOME_Evolution_ShellComponentDnd_DestinationFolder
+evolution_shell_component_client_get_dnd_destination_interface (EvolutionShellComponentClient *shell_component_client)
+{
+ EvolutionShellComponentClientPrivate *priv;
+ GNOME_Evolution_ShellComponentDnd_DestinationFolder interface;
+ CORBA_Environment ev;
+
+ g_return_val_if_fail (shell_component_client != NULL, CORBA_OBJECT_NIL);
+ g_return_val_if_fail (EVOLUTION_IS_SHELL_COMPONENT_CLIENT (shell_component_client), CORBA_OBJECT_NIL);
+
+ priv = shell_component_client->priv;
+
+ if (priv->dnd_destination_folder_interface != CORBA_OBJECT_NIL)
+ return priv->dnd_destination_folder_interface;
+
+ CORBA_exception_init (&ev);
+
+ interface = Bonobo_Unknown_queryInterface (bonobo_object_corba_objref (BONOBO_OBJECT (shell_component_client)),
+ "IDL:GNOME/Evolution/ShellComponentDnd/DestinationFolder:1.0",
+ &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION)
+ interface = CORBA_OBJECT_NIL;
+
+ CORBA_exception_free (&ev);
+
+ priv->dnd_destination_folder_interface = interface;
+ return interface;
+}
+
+
/* Synchronous operations. */
EvolutionShellComponentResult
diff --git a/shell/evolution-shell-component-client.h b/shell/evolution-shell-component-client.h
index 319902198f..59c6f284d5 100644
--- a/shell/evolution-shell-component-client.h
+++ b/shell/evolution-shell-component-client.h
@@ -66,6 +66,13 @@ void evolution_shell_component_client_construct
EvolutionShellComponentClient *evolution_shell_component_client_new (const char *id);
EvolutionShellComponentClient *evolution_shell_component_client_new_for_objref (const GNOME_Evolution_ShellComponent objref);
+/* Querying DnD interfaces. */
+
+GNOME_Evolution_ShellComponentDnd_SourceFolder
+evolution_shell_component_client_get_dnd_source_interface (EvolutionShellComponentClient *shell_component_client);
+GNOME_Evolution_ShellComponentDnd_DestinationFolder
+evolution_shell_component_client_get_dnd_destination_interface (EvolutionShellComponentClient *shell_component_client);
+
/* Synchronous operations. */
EvolutionShellComponentResult evolution_shell_component_client_set_owner (EvolutionShellComponentClient *shell_component_client,
GNOME_Evolution_Shell shell,