aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-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,