aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-shell-component-client.c
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 /shell/evolution-shell-component-client.c
parentf0a79abc2cc5e1f7a7a3b8c71d47346e17de0fc1 (diff)
downloadgsoc2013-evolution-c0a1369297add5406a4bc554422e0dc1be2cbc56.tar.gz
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
Diffstat (limited to 'shell/evolution-shell-component-client.c')
-rw-r--r--shell/evolution-shell-component-client.c94
1 files changed, 90 insertions, 4 deletions
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