/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* evolution-shell-client.c * * Copyright (C) 2000 Helix Code, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Author: Ettore Perazzoli */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "evolution-shell-client.h" struct _EvolutionShellClientPrivate { int dummy; }; #define PARENT_TYPE bonobo_object_client_get_type () static BonoboObjectClientClass *parent_class = NULL; /* Easy-to-use wrapper for Evolution::user_select_folder. */ static PortableServer_ServantBase__epv FolderSelectionListener_base_epv; static POA_GNOME_Evolution_FolderSelectionListener__epv FolderSelectionListener_epv; static POA_GNOME_Evolution_FolderSelectionListener__vepv FolderSelectionListener_vepv; static gboolean FolderSelectionListener_vtables_initialized = FALSE; struct _FolderSelectionListenerServant { POA_GNOME_Evolution_FolderSelectionListener servant; char **uri_return; char **physical_uri_return; }; typedef struct _FolderSelectionListenerServant FolderSelectionListenerServant; static void impl_FolderSelectionListener_selected (PortableServer_Servant servant, const CORBA_char *uri, const CORBA_char *physical_uri, CORBA_Environment *ev) { FolderSelectionListenerServant *listener_servant; listener_servant = (FolderSelectionListenerServant *) servant; if (listener_servant->uri_return != NULL) * (listener_servant->uri_return) = g_strdup (uri); if (listener_servant->physical_uri_return != NULL) * (listener_servant->physical_uri_return) = g_strdup (physical_uri); gtk_main_quit (); } static void impl_FolderSelectionListener_cancel (PortableServer_Servant servant, CORBA_Environment *ev) { FolderSelectionListenerServant *listener_servant; listener_servant = (FolderSelectionListenerServant *) servant; if (listener_servant->uri_return != NULL) * (listener_servant->uri_return) = NULL; if (listener_servant->physical_uri_return != NULL) * (listener_servant->physical_uri_return) = NULL; gtk_main_quit (); } static void init_FolderSelectionListener_vtables (void) { FolderSelectionListener_base_epv._private = NULL; FolderSelectionListener_base_epv.finalize = NULL; FolderSelectionListener_base_epv.default_POA = NULL; FolderSelectionListener_epv.notifySelected = impl_FolderSelectionListener_selected; FolderSelectionListener_epv.notifyCanceled = impl_FolderSelectionListener_cancel; FolderSelectionListener_vepv._base_epv = &FolderSelectionListener_base_epv; FolderSelectionListener_vepv.GNOME_Evolution_FolderSelectionListener_epv = &FolderSelectionListener_epv; FolderSelectionListener_vtables_initialized = TRUE; } static GNOME_Evolution_FolderSelectionListener create_folder_selection_listener_interface (char **result, char **uri_return, char **physical_uri_return) { GNOME_Evolution_FolderSelectionListener corba_interface; CORBA_Environment ev; FolderSelectionListenerServant *servant; PortableServer_Servant listener_servant; if (! FolderSelectionListener_vtables_initialized) init_FolderSelectionListener_vtables (); servant = g_new0 (FolderSelectionListenerServant, 1); servant->servant.vepv = &FolderSelectionListener_vepv; servant->uri_return = uri_return; servant->physical_uri_return = physical_uri_return; listener_servant = (PortableServer_Servant) servant; CORBA_exception_init (&ev); POA_GNOME_Evolution_FolderSelectionListener__init (listener_servant, &ev); if (ev._major != CORBA_NO_EXCEPTION) { g_free(servant); return CORBA_OBJECT_NIL; } CORBA_free (PortableServer_POA_activate_object (bonobo_poa (), listener_servant, &ev)); corba_interface = PortableServer_POA_servant_to_reference (bonobo_poa (), listener_servant, &ev); if (ev._major != CORBA_NO_EXCEPTION) corba_interface = CORBA_OBJECT_NIL; CORBA_exception_free (&ev); return corba_interface; } static int count_string_items (const char *list[]) { int i; if (list == NULL) return 0; for (i = 0; list[i] != NULL; i++) ; return i; } static void user_select_folder (EvolutionShellClient *shell_client, const char *title, const char *default_folder, const char *possible_types[], char **uri_return, char **physical_uri_return) { GNOME_Evolution_FolderSelectionListener listener_interface; GNOME_Evolution_Shell corba_shell; CORBA_Environment ev; GNOME_Evolution_Shell_FolderTypeList corba_type_list; int num_possible_types; char *result; result = NULL; if (uri_return != NULL) *uri_return = NULL; if (physical_uri_return != NULL) *physical_uri_return = NULL; listener_interface = create_folder_selection_listener_interface (&result, uri_return, physical_uri_return); if (listener_interface == CORBA_OBJECT_NIL) return; CORBA_exception_init (&ev); corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); num_possible_types = count_string_items (possible_types); corba_type_list._length = num_possible_types; corba_type_list._maximum = num_possible_types; corba_type_list._buffer = (CORBA_char **) possible_types; GNOME_Evolution_Shell_selectUserFolder (corba_shell, listener_interface, title, default_folder, &corba_type_list, &ev); if (ev._major != CORBA_NO_EXCEPTION) { CORBA_exception_free (&ev); return; } gtk_main(); CORBA_Object_release (listener_interface, &ev); CORBA_exception_free (&ev); } /* GtkObject methods. */ static void destroy (GtkObject *object) { EvolutionShellClient *shell_client; EvolutionShellClientPrivate *priv; shell_client = EVOLUTION_SHELL_CLIENT (object); priv = shell_client->priv; /* Nothing to do here. */ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } static void class_init (EvolutionShellClientClass *klass) { GtkObjectClass *object_class; parent_class = gtk_type_class (bonobo_object_get_type ()); object_class = GTK_OBJECT_CLASS (klass); object_class->destroy = destroy; } static void init (EvolutionShellClient *shell_client) { EvolutionShellClientPrivate *priv; priv = g_new (EvolutionShellClientPrivate, 1); priv->dummy = 0; shell_client->priv = priv; } /** * evolution_shell_client_construct: * @shell_client: * @corba_shell: * * Construct @shell_client associating it to @corba_shell. **/ void evolution_shell_client_construct (EvolutionShellClient *shell_client, GNOME_Evolution_Shell corba_shell) { g_return_if_fail (shell_client != NULL); g_return_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client)); g_return_if_fail (corba_shell != CORBA_OBJECT_NIL); bonobo_object_construct (BONOBO_OBJECT (shell_client), (CORBA_Object) corba_shell); } /** * evolution_shell_client_new: * @corba_shell: A pointer to the CORBA Evolution::Shell interface. * * Create a new client object for @corba_shell. * * Return value: A pointer to the Evolution::Shell client BonoboObject. **/ EvolutionShellClient * evolution_shell_client_new (GNOME_Evolution_Shell corba_shell) { EvolutionShellClient *shell_client; shell_client = gtk_type_new (evolution_shell_client_get_type ()); evolution_shell_client_construct (shell_client, corba_shell); if (bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)) == CORBA_OBJECT_NIL) { bonobo_object_unref (BONOBO_OBJECT (shell_client)); return NULL; } return shell_client; } /** * evolution_shell_client_user_select_folder: * @shell_client: A EvolutionShellClient object * @title: The title for the folder selection dialog * @default_folder: URI (physical or evolution:) of the folder initially selected on the dialog * @uri_return: * @physical_uri_return: * * Pop up the shell's folder selection dialog with the specified @title and * @default_folder as the initially selected folder. On return, set *@uri and * *@physical_uri to the evolution: URI and the physical URI of the selected * folder (or %NULL if the user cancelled the dialog). (The dialog is modal.) **/ void evolution_shell_client_user_select_folder (EvolutionShellClient *shell_client, const char *title, const char *default_folder, const char *possible_types[], char **uri_return, char **physical_uri_return) { g_return_if_fail (shell_client != NULL); g_return_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client)); g_return_if_fail (title != NULL); g_return_if_fail (default_folder != NULL); user_select_folder (shell_client, title, default_folder, possible_types, uri_return, physical_uri_return); } /** * evolution_shell_client_get_local_storage: * @shell_client: An EvolutionShellClient object * * Retrieve the local storage interface for this shell. * * Return value: a pointer to the CORBA object implementing the local storage * in the shell associated with @shell_client. **/ GNOME_Evolution_LocalStorage evolution_shell_client_get_local_storage (EvolutionShellClient *shell_client) { GNOME_Evolution_Shell corba_shell; GNOME_Evolution_LocalStorage corba_local_storage; CORBA_Environment ev; g_return_val_if_fail (shell_client != NULL, CORBA_OBJECT_NIL); g_return_val_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client), CORBA_OBJECT_NIL); CORBA_exception_init (&ev); corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); if (corba_shell == CORBA_OBJECT_NIL) return CORBA_OBJECT_NIL; corba_local_storage = GNOME_Evolution_Shell_getLocalStorage (corba_shell, &ev); if (ev._major != CORBA_NO_EXCEPTION) { CORBA_exception_free (&ev); return CORBA_OBJECT_NIL; } CORBA_exception_free (&ev); return corba_local_storage; } E_MAKE_TYPE (evolution_shell_client, "EvolutionShellClient", EvolutionShellClient, class_init, init, PARENT_TYPE) c81c45d73e4156bb9e16c0e1be7401e73'>java/intellij: Update to version 2017.2.3.bsam2017-08-313-14/+14 * . Update to 8u144.glewis2017-08-286-729/+804 * Require at least Gradle 4.0 for building java/openjfx8-develtobik2017-08-261-1/+1 * java/openjfx8-develtobik2017-08-253-0/+27 * java/intellij-pycharm -> devel/pycharm-ce: Disconnect the former and connect ...bsam2017-08-241-1/+0 * java/intellij-pycharm -> devel/pycharm-ce: Rename to reflect upstream andbsam2017-08-247-2328/+0 * Update to version 1.58eugen2017-08-232-4/+4 * java/intellij: Update to version 2017.2.2.bsam2017-08-193-15/+17 * java/intellij-pycharm: Update to version 2017.2.1.bsam2017-08-142-4/+4 * Update to 8u144.jkim2017-08-114-10/+10 * Fixup GH_TAGNAME usage, and minor cleanup.mat2017-08-102-5/+5 * Update to 1.5.6 release.ale2017-08-093-9/+11 * java/intellij: Update to version 2017.2.1.bsam2017-08-033-13/+13 * java/intellij-pycharm: Update to version 2017.2.bsam2017-07-293-12/+157 * java/intellij: Update to version 2017.2.bsam2017-07-263-420/+106 * java/openjfx8-devel: Update to a more recent snapshottobik2017-07-238-68/+108 * java/intellij-pycharm: Update to version 2017.1.5.bsam2017-07-183-5/+6 * Fix build of java/openjfx8-devel with Gradle 4.0tobik2017-07-131-2/+6 * Remove an unnecessary runtime dependency for NPAPI plugin support.jkim2017-07-121-2/+3 * Add missing Pango symbolstobik2017-07-112-1/+12 * Fix build of java/bouncycastle15 on armv6:eugen2017-07-112-0/+42 * java/intellij: Update to 2017.1.5.bsam2017-07-102-5/+5 * Add a new ALSA default option to make it possible to disable ALSAtobik2017-06-271-5/+10 * Scrub mention of armv6hf from ARCHS. It was never in a released version.linimon2017-06-272-2/+2 * Fix WWWsunpoet2017-06-271-1/+1 * Fix WWWsunpoet2017-06-271-1/+1 * qa: add check for NO_ARCHdbn2017-06-191-0/+2 * java/intellij-pycharm: Update to version 2017.1.4bsam2017-06-142-4/+4 * java/intellij: Update to version 2017.1.4bsam2017-06-072-5/+5 * java/intellij-pycharm: Update to version 2017.1.3bsam2017-05-312-4/+4 * Fix compilation with Clang 4.0.jkim2017-05-311-0/+11 * Fix compilation with Clang 4.0.jkim2017-05-311-0/+11 * . Update to b43.glewis2017-05-302-6/+13 * . Update to 7u141.glewis2017-05-303-927/+808 * . Update to 7u131.glewis2017-05-295-2692/+2533 * . Update to the 8u131 docs.glewis2017-05-272-4/+4 * Mark some ports failing on armv6, for errors classified as "???".linimon2017-05-273-0/+6 * Mark some ports failing on armv6. In cases where the error messagelinimon2017-05-263-2/+8 * java/intellij: Update to version 2017.1.3bsam2017-05-253-6/+10 * Revision bump of all ports with USE_GL after consolidation of mesa-libsrezny2017-05-234-3/+4 * Update java/bouncycastle15 upto 1.57eugen2017-05-212-4/+4 * Mark some ports failing on power64. In cases where the error messagelinimon2017-05-211-0/+1 * Mark some ports failing on power64. In cases where the error messagelinimon2017-05-141-0/+2 * java/intellij: Update Idea 171.4249.32 -> 171.4249.39bsam2017-05-112-4/+5 * Pass maintainership to submittersunpoet2017-05-101-1/+1 * java/intellij-pycharm: Update to version 2017.1.2.bsam2017-05-053-4/+6 * Provide error messages for some ports failing on aarch64, and, in alinimon2017-05-021-0/+3 * Chase ffmpeg 3.3 update (ABI changes)riggs2017-04-251-0/+1 * java/intellij: Update to version 2017.1.2.bsam2017-04-233-13/+14 * Update to 8u131.glewis2017-04-196-1469/+1094 * . Update to 8u131glewis2017-04-192-4/+4 * . Update to 8u131.glewis2017-04-192-6/+6 * java/intellij: Update to version 2017.1.1, use no-jdk distfile.bsam2017-04-143-15/+15 * java/intellij-pycharm: Update to version 2017.1.1.bsam2017-04-143-132/+79 * Merge fixes for JDK-6900441 and JDK-8029453 from Linux sources.jkim2017-04-143-1/+303 * Merge fix for JDK-6900441 from Linux source.jkim2017-04-143-0/+309 * Update to 5.3.3 release.ale2017-04-132-4/+4 * java/java-checkstyle: Update version 7.0=>7.6bofh2017-04-122-4/+4 * - Remove obsolete OSVERSION conditionamdmi32017-04-121-5/+1 * Make defining both PORTVERSION and DISTVERSION a DEV_ERROR.mat2017-04-111-6/+6 * new port: java/lightweight-java-profilerjmd2017-04-029-0/+158 * Bump PORTREVISIONs for ports depending on the canonical version of GCC andgerald2017-04-013-3/+3 * java/intellij-pycharm: Update to version 2017.1.bsam2017-03-283-11/+974 * java/intellij: Update to version 2017.1.bsam2017-03-283-34/+56 * java/intellij-pycharm: Update to version 2016.3.3.bsam2017-03-272-4/+4 * . Update to 2017b.glewis2017-03-273-4/+5 * java/intellij: Update to version 2016.3.5.bsam2017-03-152-5/+5 * Update to 1.4.vanilla2017-03-142-3/+6 * Switch MAINTAINER to my new account for my ports.eugen2017-03-121-1/+1 * . Update to 2017a.glewis2017-03-022-4/+4 * Remove expired ports:rene2017-02-28