diff options
author | nobody <nobody@localhost> | 2001-06-23 13:14:10 +0800 |
---|---|---|
committer | nobody <nobody@localhost> | 2001-06-23 13:14:10 +0800 |
commit | 8bd35373e6112a09f522d21747dcc9e90b859333 (patch) | |
tree | a4eb5e010ba601de261dc3f9da4dd4b86fcc46fe /executive-summary | |
parent | 72ca61d74b9942040638b628a6f1358e02d23d42 (diff) | |
download | gsoc2013-evolution-GNOME_UTILS_1_4_0_2.tar gsoc2013-evolution-GNOME_UTILS_1_4_0_2.tar.gz gsoc2013-evolution-GNOME_UTILS_1_4_0_2.tar.bz2 gsoc2013-evolution-GNOME_UTILS_1_4_0_2.tar.lz gsoc2013-evolution-GNOME_UTILS_1_4_0_2.tar.xz gsoc2013-evolution-GNOME_UTILS_1_4_0_2.tar.zst gsoc2013-evolution-GNOME_UTILS_1_4_0_2.zip |
This commit was manufactured by cvs2svn to create tagGNOME_UTILS_1_4_0_2
'GNOME_UTILS_1_4_0_2'.
svn path=/tags/GNOME_UTILS_1_4_0_2/; revision=10419
Diffstat (limited to 'executive-summary')
65 files changed, 0 insertions, 10213 deletions
diff --git a/executive-summary/.cvsignore b/executive-summary/.cvsignore deleted file mode 100644 index a098ff204f..0000000000 --- a/executive-summary/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -core -Makefile.in -Makefile -GNOME_Evolution_Summary.oaf diff --git a/executive-summary/ChangeLog b/executive-summary/ChangeLog deleted file mode 100644 index 36b3381c14..0000000000 --- a/executive-summary/ChangeLog +++ /dev/null @@ -1,893 +0,0 @@ -2001-06-18 Dan Winship <danw@ximian.com> - - * test-service/Makefile.am (test_service_LDADD): Remove DB3_LDADD - - * component/Makefile.am (evolution_executive_summary_LDADD): - Remove DB3_LDADD - -2001-06-04 Ettore Perazzoli <ettore@ximian.com> - - * component/Makefile.am (evolution_executive_summary_LDADD): Move - `libevolution-services.la' on top. - -2001-06-03 Ettore Perazzoli <ettore@ximian.com> - - * test-service/Makefile.am (rdf_summary_LDADD): Move - `$(DB3_LDADD)' before the shared libraries. - - * component/Makefile.am (evolution_executive_summary_LDADD): Move - `$(DB3_LDADD)' before libeutil. - -2001-06-01 Ettore Perazzoli <ettore@ximian.com> - - * component/Makefile.am (evolution_executive_summary_LDADD): Add - `$(DB3_LDADD)'. - * test-service/Makefile.am (test_service_LDADD): Likewise. - (rdf_summary_LDADD): Likewise. - -2001-05-27 Dan Winship <danw@ximian.com> - - * component/e-summary-factory.c: #include - "evolution-shell-component-utils.h" rather than "e-gui-utils.h" - for e_pixmaps_update. - - * component/Makefile.am (evolution_executive_summary_LDADD): Use - libeshell.la, not libeshell.a (Did Peter forget to commit this?) - -2001-05-25 Peter Williams <peterw@ximian.com> - - * component/Makefile.am: Reference libeshell.la instead of libeshell.a. - -2001-05-23 Kjartan Maraas <kmaraas@gnome.org> - - * component/e-summary-url.c: Mark a string for translation. - -2001-05-10 Iain Holmes <iain@ximian.com> - - * test-service/rdf-summary.c (load_from_stream): Set the time, not the - timeout id. (duh!) - (summary_to_string): Get the time, not the timeout id. (DUH!) - (property_control): Connect the spin button to the item_changed callback. - -2001-05-10 Iain Holmes <iain@ximian.com> - - * test-service/rdf-summary.c (property_control): Don't let the spinner - be set to 0 - -2001-05-10 Iain Holmes <iain@ximian.com> - - * test-service/rdf-summary.c (download_cb): Proxy clicked events to - download. - (property_control): Connect the Update Now button to the download_cb - instead of download to prevent a crash. - -2001-05-05 Gediminas Paulauskas <menesis@delfi.lt> - - * component/Makefile.am, evolution-services/Makefile.am: no need of - -DEVOLUTION_VERSION - - * component/e-summary-callbacks.c: translate window title. - - * component/e-summary-url.c (e_summary_url_describe): contents are in - utf-8, convert to locale. - - * test-service/Makefile.am: define EVOLUTION_LOCALEDIR. - - * test-service/rdf-summary.c: init gettext. - -2001-05-02 Gediminas Paulauskas <menesis@delfi.lt> - - * component/e-summary.c: set default content type of html to - "text/html; charset=utf-8". - -2001-04-25 Dan Winship <danw@ximian.com> - - * idl/Makefile.am (INCLUDES): Remove this section, which doesn't - apply to anything since there are no targets in this directory. - - * test-service/Makefile.am: - * evolution-services/Makefile.am: - * component/Makefile.am: Remove UNICODE_LIBS/UNICODE_CFLAGS - -2001-04-14 Michael Meeks <michael@ximian.com> - - * idl/Makefile.am: Remove stale build cruftiness. - -2001-04-10 Gediminas Paulauskas <menesis@delfi.lt> - - * widgets/e-summary-subwindow.c: added some missing includes. - * widgets/e-summary-title-button.h: same. - -2001-04-04 Gediminas Paulauskas <menesis@delfi.lt> - - * component/component-factory.c: last time I've broken shortcut view. - renamed icons properly. - -2001-04-01 Gediminas Paulauskas <menesis@delfi.lt> - - * component/component-factory.c: Changed folder type icon to tiny - executive summary icon. - * component/e-summary-factory.c: replaced set_pixmap with new EPixmap - cache. - -2001-03-29 Kjartan Maraas <kmaraas@gnome.org> - - * *.*: Clean up includes. Remove/replace <gnome.h>, <bonobo.h> - and <gtk/gtk.h>. - -2001-03-08 Ettore Perazzoli <ettore@ximian.com> - - * component/component-factory.c (factory_fn): Specify a NULL - `EvolutionShellComponentGetDndSelectionFn'. - -2001-02-14 Iain Holmes <iain@ximian.com> - - * component/e-summary-url.c (e_summary_url_click): Remove the new - OTHER uri stuff. - -2001-02-14 Christopher James Lahey <clahey@ximian.com> - - * component/component-factory.c (component_destroy_cb): Removed - this unused function. - - * evolution-services/executive-summary-html-view.c - (impl_GNOME_Evolution_Summary_HTMLView_handleURI): Changed the - declaration of this function to match the signature in the - generated header file. - - * test-service/rdf-summary.c (property_control): Added a cast here. - -2001-02-14 Iain Holmes <iain@ximian.com> - - * evolution-services/executive-summary-html-view.c - (executive_summary_html_view_destroy): Don't unref the event source. - (impl_GNOME_Evolution_Summary_HTMLView_handleURI): Emit the signal. - (corba_class_init): Hook up the handleURI method. - (executive_summary_html_view_class_init): Create the signal. - - * idl/HTMLView.idl: Add the handleURI method. - -2001-02-13 Iain Holmes <iain@ximian.com> - - * test-service/rdf-summary.c (property_control): Add an update now button. - -2001-02-12 Iain Holmes <iain@ximian.com> - - * test-service/rdf-summary.c (property_control): Add a "Update" spinner. - (property_action): Only download a new RDF if the URL changed. Use a cached - version otherwise. - -2001-02-08 Iain Holmes <iain@ximian.com> - - * component/e-summary-url.c (e_summary_url_click): Close and remove the - window on an idle, so that the whole desktop isn't locked by a - GNOME-VFS bug. - -2001-02-13 Kjartan Maraas <kmaraas@gnome.org> - - * Makefile.am: xml-i18n-tools setup for .oaf.in files. - * GNOME_Evolution_Summary.oaf.in: Mark strings for translation. - * test-service/Makefile.am: xml-i18n-tools setup for .oaf.in files. - * test-service/*.oaf.in: Mark strings for translation. - -2001-01-23 Iain Holmes <iain@ximian.com> - - * component/e-summary.c (e_summary_load_page): Don't strdup the NULL. - -2001-01-20 Iain Holmes <iain@ximian.com> - - * component/e-summary.c (e_summary_display_window): Free the html - variable and the header too. - -2001-01-22 Christopher James Lahey <clahey@helixcode.com> - - * component/e-summary-url.c: Change the callbacks in this file to - match the callback function types. Fixes warnings. - -2001-01-12 Ettore Perazzoli <ettore@helixcode.com> - - * component/component-factory.c (factory_fn): Pass NULL as the - @copy_folder_fn arg to `evolution_shell_component_new()'. - - * evolution-services/executive-summary-component.c - (executive_summary_component_destroy): Remove unused variable. - -2001-01-12 Iain Holmes <iain@ximian.com> - - * component/e-summary-util.c (e_summary_rm_dir): If base == NULL return; - Closes bug #37077 - -2000-12-30 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_rebuild_page): The number of columns - is no longer hardcoded. - - * component/e-summary-prefs.[ch]: Add a columns member, and all the - necessary code to support it. - - * component/e-summary-callbacks.c: Set the columns member. - - * test-service/rdf-summary.c: Add a "Show title" button for turning off - the title if it is taking up too much room. - -2000-12-29 Iain Holmes <iain@helixcode.com> - - * test-service/rdf-summary.c (view_destroyed): Cancel all pending - async downloads. - (load_from_stream): Check if the XML was correctly loaded. - (read_callback): - (close_callback): - (open_callback): Add a cast to remove warnings - - * component/e-summary.c (listener_event): Check for the correct event names. - -2000-12-28 Iain Holmes <iain@helixcode.com> - - * test-service/rdf-summary.c (create_view): Aggregate a - Bonobo::PersistStream interface. - (load_from_stream): - (summary_to_string): - (save_to_stream): - (content_types): Functions to load and save an XML document. - -2000-12-26 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (make_control_html): Neatened the code. - (e_summary_add_service): Get the event source that is shared - between everything. - - * component/e-summary-url.c (e_summary_url_click): Use the shared - event source. - - * test-service/rdf-summary.c (create_view): Use the EventSource when - creating the BonoboPropertyBag. - - * test-service/main.c (create_view): Create a shared BonoboEventSource. - -2000-12-21 Iain Holmes <iain@helixcode.com> - - * test-service/rdf-summary.c (download): Split this function into - many callbacks, for async action. - - * component/e-summary-url.c (e_summary_url_request): Split this - into async callbacks too. - -2000-12-13 Christopher James Lahey <clahey@helixcode.com> - - * component/e-summary-callbacks.c (configure_summary): Added a - cast. - -2000-12-13 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_rebuild_page): Display all the windows - correctly. - (e_summary_save_state): Remove the whole of the Executive-Summary dir. - - * component/e-summary-util.[ch]: Add e_summary_rm_dir, a function to reove - everything in the path. RC people have a function to do it too, but I can't - remember how to get RC :) - - * component/e-summary-callbacks.c: (configure_summary): Put an HTML - explanation into the configure dialog. - -2000-12-13 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_rebuild_page): Count the number - of rows correctly. - -2000-12-12 Christopher James Lahey <clahey@helixcode.com> - - * component/e-summary-callbacks.c: Added #include - <e-summary-callbacks.h>. - (destroy_prefs_cb): Added a cast. - (configure_summary): Added a cast. - - * component/e-summary-callbacks.h: Added #include "e-summary.h" - - * component/e-summary-url.c (e_summary_url_click): Removed an - unused variable. - - * component/e-summary-util.c: Added #include <e-summary-util.h> - - * component/e-summary.c: Added #include <gtkhtml/htmlselection.h>. - (e_summary_queue_rebuild): Added a cast. - - * component/main.c: Added #include <glade/glade.h>. - - * test-service/main.c: Changed some variable types to make casting - easier. - - * test-service/rdf-summary.c: Changed some variable types to make - casting easier. - -2000-12-12 Dan Winship <danw@helixcode.com> - - * Makefile.am (EXTRA_DIST): Add stuff. (From campd.) - -2000-12-11 Iain Holmes <iain@helixcode.com> - - * evolution-services/executive-summary-html-view.h: Add a define - for the "html_changed" signal to name space it. Change the - function declarations to fit with the below change too. - - * evolution-services/executive-summary-html-view.c - (executive_summary_html_view_new): Create a default BonoboEventSource - and use the new _full function. - (executive_summary_html_view_new_full): Creates a new HtmlView with - the given BonoboEventSource. - (executive_summary_html_view_get_event_source): Returns the - BonoboEventSource for the view. - (executive_summary_html_view_set_html): Use the new #define for the event - name. - - * test-service/rdf-summary.c (create_view): Share the BonoboEventSource - between the HtmlView and the BonoboPropertyControl. - - * component/e-summary.c (html_event): Use the name spaced #define. - (e_summary_start_load): Add a new hack to set the border width of the - GtkHTML widget to 0. - (e_summary_rebuild_page): Redid the way the tables are drawn. Made the - title icon be constrained to 48. - - * evolution-services/executive-summary-component.c - (impl_GNOME_Evolution_Summary_ComponentFactory_createViw): Fixed a warning. - - * component/e-summary-util (e_pixmap_file): Free the edir. - -2000-12-08 Iain Holmes <iain@helixcode.com> - - * summary.html: Don't hardcode the image paths. - -2000-12-08 JP Rosevear <jpr@helixcode.com> - - * component/Makefile.am (evolution-executive-summary.pure): Add purify - options for the build - -2000-12-08 JP Rosevear <jpr@helixcode.com> - - * Makefile.am: Remove files from extra_dist since they are already - listed - -2000-12-07 Iain Holmes <iain@helixcode.com> - - * summary.html: Prettier HTML summary. - - * Makefile.am: Install the new summary.html - - * component/e-summary.c (load_component): Free corba_subdir and - corba_stream. - (save_component): Free corba stuff. - - -2000-12-06 Iain Holmes <iain@helixcode.com> - - * e-summary-callbacks.c (new_mail): Update COMPOSER_IID to the new - style IIDs. - (configure_summary): Set up to do stuff when preferences are changed. - - * e-summary-prefs.c (e_summary_prefs_save): Sync and drop the config file - so that changes are written to disk. - - * e-summary.c (e_summary_reconfigure): Change the summary to the new - preferences. - -2000-12-04 Iain Holmes <iain@helixcode.com> - - * test-service/rdf-summary.c (entry_changed): Add a NULL for opt_ev. - - * idl/HtmlView.idl: Inherit from Bonobo::Unknown and not - Bonobo::EventSource. - - * evolution-services/executive-summary-html-view.[ch]: Change - implementation of the EventSource so that it is aggregated onto - the HtmlView object and not inherited. - - * component/e-summary.c (e_summary_window_free): Free the event_source. - (e_summary_add_service): query for the EventSource interface. - -2000-12-01 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_load_state): Fix memory leak. - (everywhere): Fixed memory leaks, and unref problems. - -2000-11-30 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_window_free): remove the - event listener before destruction. - - * component/e-summary-url.c (e_summary_url_click): Handle the - new PropertyControl api. Add a listener to detect when the page - is changed, and adjust the property box accordingly. - - * test-service/main.c (create_view): Increment running view. - -2000-11-29 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c: Big memory leak cleanup. - -2000-11-28 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_display_window): If the HTML - control dies, then just close the open tags. - - * component/e-summary-url (e_summary_url_click): Put the control - into a GnomePropertyBox. - - * evolution-services/executive-summary-component.c - (impl_GNOME_Evolution_Summary_ComponentFactory_createView): - Duplicate the component. - -2000-11-27 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_window_free): Free all the - interfaces and the component. - (e_summary_load_state): Fix typos. - - * component/e-summary-prefs.c: Fix some typos. - - * component/e-summary-url.c: If configure is pressed, retrieve - the control and embed it in a window. - - * test-services/main.c (component_destroyed): assign ud from data - not from ud! - - * test-services/rdf-summary.c (view_destroyed): Connect this - callback and free the summary. - (property_control): Made a simple configuration dialog. - -2000-11-25 Iain Holmes <iain@helixcode.com> - - * component/e-summary-prefs.[ch]: New files to handle loading, - saving, copying and freeing preferences. - - * component/e-summary.c (e_summary_save_state): Use the new - prefs stuff to save. - (e_summary_load_state): Use the new prefs stuff to load. - - * component/e-summary-factory.c (set_pixmap): Use e_pixmap_file - to find the pixbuf. - -2000-11-24 Iain Holmes <iain@helixcode.com> - - * idl/SummaryComponent.idl: Removed the setOwner and unsetOwner - methods from the Component interface. - - * evolution-services/executive-summary.[ch] - evolution-services/executive-summary-client.[ch] - evolution-services/executive-summary-component-client.[ch] - evolution-services/executive-summary-component-view.[ch]: - Removed. - - * component/main.c (main): Stopped ignoring the signals. - - * component/executive-summary-config.glade: Glade file for the - prefs dialog. - -2000-11-23 Iain Holmes <iain@helixcode.com> - - * component/e-summary-factory.c (embed-service): Moved to - e-summary-callbacks.c. - (e_summary_factory_embed_from_id): Moved to e-summary.c and renamed - e_summary_embed_from_id. - Added a New Mail button. - - * component/e-summary-callbacks.c: New file. - -2000-11-22 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_save_state): removed the #if 0s - and changed the save type to fs. - -2000-11-21 Iain Holmes <iain@helixcode.com> - - * test-services/rdf-summary.c: Rewrote to use the new services code. - - * idl/HtmlView.idl: Inherit from Bonobo::EventSource instead of - Bonobo::Unknown. - -2000-11-20 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_save_state): #if 0'd out the - PersistStream code till it is fixed. - (e_summary_window_free): Only Bonobo_Unknown_unref the component, - not all the other interfaces. - (e_summary_remove_window): Function to remove the window from the - window list and free it. - (make_control_html): Make "id" the address of the window structure. - - * component/e-summary-url.c: Reimplemented all the functions that the - Executive Summary had before the big code change. - -2000-11-18 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_save_state): Use Persist stream to - save the state of all the components. - (e_summary_load_state): Use Persist stream to load the components again. - (e_summary_add_service): Add a Property Listener to the property bag to - be notified of changes to the title or icon. - -2000-12-07 Dave Camp <dave@helixcode.com> - - * evolution-services/evolution-summary-component.c: Don't include - executive-summary-client.h. - -2000-12-07 Dave Camp <dave@helixcode.com> - - * idl/Makefile.am (IDLS): Include HtmlView.idl - -2000-11-29 Dan Winship <danw@helixcode.com> - - * component/main.c (main): Remove no-longer-needed e_unicode_init. - -2000-17-10 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (make_control_html): Set the configure button - active if there is a Bonobo_PropertyControl object associated with the - window. - - * Makefile.am: Remove the widgets subdirectory. - -2000-16-10 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_display_window): Use the property - bag to get the window title and icon. - - * test-service/main.c: (create_view): Add a PropertyBag to the object. - (set_property): Set the properties. - (get_property): Get the properties. - -2000-15-10 Iain Holmes <iain@helixcode.com> - - * evolution-services/executive-summary-component-factory-client.[ch]: - A client for the factory stuff. - -2000-14-10 Iain Holmes <iain@helixcode.com> - - * evolution-services/executive-summary-html-view.[ch]: Implementation - of the HtmlView interface. - - * component/e-summary-factory.c - (e_summary_factory_embed_service_from_id): Rewrote to use the new - component_factory. - - * component/e-summary.c (e_summary_add_service): Rewrote to use - the new component stuff. Lots of queryInterfaces :) - (e_summary_window_free): Rewrote. - - * test-service/main.c: Rewrote completely as an example of the - new services. - -2000-13-10 Iain Holmes <iain@helixcode.com> - - * evolution-services/executive-summary-component.c: - Created the ExecutiveSummaryComponentFactory type, that implements - GNOME/Evolution/Summary/ComponentFactory. Changed the way - GNOME/Evolution/Summary/Component is implemented. - - * idl/SummaryComponent.idl: Removed all methods from Component - execpt setOwner and unsetOwner. Added ComponentFactory interface - with a createView method. - - * idl/HtmlView.idl: New interface for HTML services. One method - getHtml. - -2000-11-10 Iain Holmes <iain@helixcode.com> - - * evolution-services/executive-summary-component-view.c - (executive_summary_component_view_set_title): Removed the - "wrong side" warning. - - * component/e-summary-factory.c (set_icon): Change the view's - icon. - (e_summary_factory_embed_service_from_id): Connect to the set_icon - signal. - -2000-11-09 Iain Holmes <iain@helixcode.com> - - * test-service/rdf-summary.c: Made Alan Cox's rdf-engine.c from - Portaloo into a summary component. - -2000-11-08 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_window_free): Remove the view - from the id_to_view hash table. - (make_control_html): Fix the bottom row comparison. - -2000-11-07 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_load_state): Load the HTML - page for the background. - (load_html_page): Use GnomeVFS to load this page, and split it - into a header and footer. - (e_summary_rebuild_page): If a header and footer exist, use them - otherwise just load the default. - -2000-11-06 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (on_object_requested): Load a bonobo - service and try to get it to display (Not working yet). - -2000-11-04 Iain Holmes <iain@helixcode.com> - - * test-service/test-bonobo.c: New file to test Bonobo control - based services. - - * test-service/test-service.oafinfo: Added the details for the - test-bonobo service. - -2000-11-03 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (make_control_html): Make a neater - function to create the window controls. Check if a window can - be moved in a certain direction before making a link. - - * evolution-services/executive-summary-component-view.c: Added a - GtkWidget to the private structure to store the control's widget. - -2000-11-03 Iain Holmes <iain@helixcode.com> - - * evolution-services/executive-summary-component-view.c: - (executive_summary_component_view_class_init): Add a "configure" - signal. - - * evolution-services/executive-summary-component-view.h: Add the - default handler in the class type. - - * idl/SummaryComponent.idl: Add an id to the configure method. - - * evolution-services/executive-summary-component-client.[ch]: - executive_summary_component_client_configure: Takes a View param. - - * component/e-summary-factory.c: Connect to the configure signal - of the created view and call the configure method. - - * component/e-summary-url.c: When the [?] is clicked, emit the - configure signal. - - * test-service/main.c: Connect the configure signal to something. - -2000-11-21 Radek Doulik <rodo@helixcode.com> - - * component/e-summary.c (e_summary_rebuild_page): use html_engine_is_selection_active - added some includes - -2000-11-11 Matt Bissiri <bissiri@eecs.umich.edu> - - * component/e-summary-factory.c: (control_activate_cb), - (embed_service): - * evolution-executive-summary.oafinfo: - * test-service/test-service.oafinfo: - Update the remaining "IDL:Evolution*" to "IDL:GNOME/Evolution*" - to sync up with yesterday's IDL re-scoping. - -2000-11-10 Matt Bissiri <bissiri@eecs.umich.edu> - - * component/Makefile.am: Regenerate the idl-generated files - if composer idl changes. - -2000-11-03 Federico Mena Quintero <federico@helixcode.com> - - * evolution-services/Makefile.am: Clean the idl-generated files - properly. - -2000-11-01 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c: - component/e-summary-factory.c: - component/e-summary-url.c: Warning's cleanup. - -2000-11-01 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_rebuild_page): Requeue the redraw - if there is a selection on the widget. - -2000-11-01 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_display_window): Draw the window - controls to move, close and configure the window. - (e_summary_window_move_(left|right|up|down)): Move the window around the - window list. - - * component/e-summary-url.c (e_summary_url_click): Add handlers for the - window control URIs (close:// configure:// up:// down:// left:// and - right://). - (get_protocol): Add support for the new protocols. - (parse_uri): Ditto. - (e_summary_url_describe): ditto. - -2000-10-30 Iain Holmes <iain@helixcode.com> - - * component/e-summary-factory.c (embed_service): Generate the uid here - and pass it into the create_view method. - - * evolution-services/executive-summary-component-client.c - (executive_summary_component_client_create_view): Use the passed in UID - to generate a view. - - * evolution-services/executive-summary-component.c - (impl_Evolution_SummaryComponent_create_view): Don't generate the id here - but use the passed in one instead. - - * idl/SummaryComponent.idl: create_view now takes an ID parameter. - -2000-10-26 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (load_default): Neaten the Report bug link. - (e_summary_end_load): Put in a <hr> and a mailto to me. - (e_summary_new): Create an EvolutionShellClient from the Evolution_Shell. - (e_summary_get_shell_client): Retrieve the shell-client. - - * component/e-summary-url.c (e_summary_url_click): On a PROTOCOL_VIEW - change the current view to the one specified in the URL. - -2000-10-28 Ettore Perazzoli <ettore@helixcode.com> - - * component/Makefile.am (INCLUDES): Add - `-I$(top_builddir)/executive-summary/evolution-services' and - `-I$(top_srcdir)/executive-summary/evolution-services'. - -2000-10-25 Iain Holmes <iain@helixcode.com> - - * component/e-summary-url.c (e_summary_url_exec): Execute a program - specified in the format "exec://program args". - (e_summary_url_mail_compose): Run the mail composer when a mailto: - URL is clicked. - -2000-10-25 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (e_summary_start_load): Add a hack to stop the - GtkHTML widget returning to the top when it is redrawn. - - * component/e-summary-url.[ch] - * component/e-summary-util.[ch]: Split some functions out of e-summary.c - - * component/Makefile.am: Added the new files, and run orbit-idl on the - mail composer idl. - -2000-10-25 <jpr@helixcode.com> - - * component/e-summary-factory.c (control_activate): User - bonobo_control_get_remote_uid_container, not the old version - -2000-10-25 Iain Holmes <iain@helixcode.com> - - * test-service/main.c: Store each individual views data with the view. - Add comments to explain everything. - - * evolution-services/executive-summary-component.c - (impl_Evolution_SummaryComponent_create_view): Only try to create a - control if the returned control != NULL. - -2000-10-25 Iain Holmes <iain@helixcode.com> - - * evolution-services/executive-summary-component.c - (impl_Evolution_SummaryComponent_create_view): Set the UID of the view - before passing it to the create_view method. - -2000-10-25 Iain Holmes <iain@helixcode.com> - - * idl/Summary.idl: Added set_icon method, and changed update_html_component - to update_component. Made all methods take a long ID instead of an - SummaryComponent. - - * idl/SummaryComponent.idl: Combined the create_bonobo_view and - create_html_view into create_view. - Added a destroy_view method. - - * evolution-services/Makefile.am: Added the 2 new files. - - * evolution-services/executive-summary-component-view.[ch]: New - files implementing a view of an ExecutiveSummaryComponent. - - * evolution-services/executive-summary.[ch] - * evolution-services/executive-summary-client.[ch] - * evolution-services/executive-summary-component.[ch] - * evolution-services/executive-summary-component-client.[ch]: - * component/e-summary-factory.c - * component/e-summary.c - * test-service/main.c: - Updated to use new methods and the new ExecutiveSummaryComponentView - object. - -2000-10-16 Iain Holmes <iain@helixcode.com> - - * evolution-services/executive-summary.c (executive_summary_class_init): - Implement the update, set_title and flash functionality as signals - instead of methods. - (impl_Evolution_Summary_set_title): Emit signal. - (impl_Evolution_Summary_flash): Emit signal. - (impl_Evolution_Summary_update_html_component): Emit signal. - (executive_summary_new): Don't need the methods anymore. - (executive_summary_construct): Same. - (executive_summary_init): Remove the private initialisation. - -2000-10-23 Dan Winship <danw@helixcode.com> - - * idl/Makefile.am (INCLUDES): - * evolution-services/Makefile.am (INCLUDES): - * component/Makefile.am (INCLUDES): Update EVOLUTION_LOCALEDIR - -2000-10-14 Ettore Perazzoli <ettore@helixcode.com> - - * evolution-executive-summary.oafinfo: Added - "evolution:shell-component-icon" property. - -2000-10-10 Jacob "Ulysses" Berkman <jacob@helixcode.com> - - * evolution-services/Makefile.am (IDLS): make the built sources - depend on the idl files - -2000-10-09 Iain Holmes <iain@helixcode.com> - - * idl/SummaryComponent.idl: Added an icon parameter to the - create_view methods. - - * evolution-services/executive-summary-component.c: Implement - the icon parameter. - - * evolution-services/executive-summary-component-client.c: Ditto - - * component/e-summary.c: Draw the specified icon. - - * component/e-summary-factory.c: Use the icon parameter. - -2000-10-09 Iain Holmes <iain@helixcode.com> - - * evolution-services/Makefile.am: Added $(EXTRA_GNOME_CFLAGS) to - find gnomesupport.h - -2000-10-06 Iain Holmes <iain@helixcode.com> - - * component/e-summary.c (request_cb): Use gnome-vfs to retrieve - the requested files. Allows services to specify remote urls. - (load_default, e_summary_display_window, e_summary_rebuild_page): - Change the html to match TigerT's lovely design. - (e_summary_add_html_service, e_summary_add_html_service): Add - the client argument so we can destroy it when we've quit. - (e_summary_window_update): Only do an update if there isn't one - pending. - - * component/e-summary-factory.c (embed_service): upd. - - * test-service/main.c: Made the test service be really silly and count - the number of seconds since it was started. - -2000-10-06 Ettore Perazzoli <ettore@helixcode.com> - - * component/Makefile.am (INCLUDES): Fix builddir != srcdir. - -2000-10-05 Chris Toshok <toshok@helixcode.com> - - * widgets/.cvsignore: ignore more stuff. - - * .cvsignore: ignore more stuff. - - * idl/.cvsignore: ignore more stuff. - - * evolution-services/.cvsignore: ignore more stuff. - - * component/.cvsignore: ignore more stuff. - - * .cvsignore: add Makefile - -2000-10-05 Chris Toshok <toshok@helixcode.com> - - * component/component-factory.c: include - <gal/widgets/e-gui-utils.h> instead of "e-util/e-gui-utils.h" to - clear up e_notice declaration, and #include <gnome.h> to get "_". - -2000-10-05 Michael Meeks <michael@helixcode.com> - - * component/e-summary-factory.c (control_activate): upd. - (set_pixmap): upd. (update_pixmaps): upd. - (control_activate_cb): upd. - (control_deactivate): upd. - -2000-10-04 Iain Holmes <iain@helixcode.com> - - * idl/SummaryComponent.idl: Added a title argument to the - create_view methods. - -2000-09-13 Iain Holmes <iain@helixcode.com> - - * Started the Executive Summary diff --git a/executive-summary/GNOME_Evolution_Summary.oaf.in b/executive-summary/GNOME_Evolution_Summary.oaf.in deleted file mode 100644 index eeffbe28c0..0000000000 --- a/executive-summary/GNOME_Evolution_Summary.oaf.in +++ /dev/null @@ -1,29 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:GNOME_Evolution_Summary_ShellComponentFactory" - type="exe" - location="evolution-executive-summary"> - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="Factory for the Evolution executive summary component."/> -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_Summary_ShellComponent" - type="factory" - location="OAFIID:GNOME_Evolution_Summary_ShellComponentFactory"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/ShellComponent:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="Evolution component for the executive summary."/> - - <oaf_attribute name="evolution:shell-component-icon" type="string" - value="evolution-today.png"/> -</oaf_server> - -</oaf_info> diff --git a/executive-summary/Makefile.am b/executive-summary/Makefile.am deleted file mode 100644 index 6d9aa83a17..0000000000 --- a/executive-summary/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -SUBDIRS = idl evolution-services component test-service - -oafdir = $(datadir)/oaf -oaf_in_files = GNOME_Evolution_Summary.oaf.in -oaf_DATA = $(oaf_in_files:.oaf.in=.oaf) - -@XML_I18N_MERGE_OAF_RULE@ - -htmldir = $(datadir)/evolution -html_DATA = summary.html - -EXTRA_DIST = $(oaf_in_files) $(oaf_DATA) $(html_DATA) diff --git a/executive-summary/component/.cvsignore b/executive-summary/component/.cvsignore deleted file mode 100644 index 75f1a012f2..0000000000 --- a/executive-summary/component/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -core -Makefile.in -Makefile -.deps -.libs -evolution-executive-summary -Composer-common.c -Composer.h -Composer-stubs.c -Composer-skels.c
\ No newline at end of file diff --git a/executive-summary/component/Makefile.am b/executive-summary/component/Makefile.am deleted file mode 100644 index 1db01fed36..0000000000 --- a/executive-summary/component/Makefile.am +++ /dev/null @@ -1,88 +0,0 @@ -bin_PROGRAMS = evolution-executive-summary - -INCLUDES = \ - -I$(top_srcdir)/widgets \ - -I$(top_srcdir)/widgets/e-text \ - -I$(top_srcdir) \ - -I$(top_builddir)/shell \ - -I$(top_srcdir)/shell \ - -I$(top_builddir)/executive-summary \ - -I$(top_srcdir)/executive-summary \ - -I$(top_builddir)/executive-summary/evolution-services \ - -I$(top_srcdir)/executive-summary/evolution-services \ - $(EXTRA_GNOME_CFLAGS) \ - $(GNOME_VFS_CFLAGS) \ - $(GTKHTML_CFLAGS) \ - -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ - -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ - -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ - -DEVOLUTION_DATADIR=\""$(datadir)"\" \ - -DG_LOG_DOMAIN=\"evolution-executive-summary\" - -COMPOSER_GENERATED = \ - Composer.h \ - Composer-common.c \ - Composer-skels.c \ - Composer-stubs.c - -Composer-impl.o: Composer.h - -selectnamesdir = $(top_srcdir)/addressbook/gui/component/select-names - -IDLS = \ - $(selectnamesdir)/Evolution-Addressbook-SelectNames.idl \ - $(top_srcdir)/composer/Evolution-Composer.idl \ - $(top_srcdir)/composer/Composer.idl - -$(COMPOSER_GENERATED): $(IDLS) - $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \ - $(top_srcdir)/composer/Composer.idl - -evolution_executive_summary_SOURCES = \ - $(COMPOSER_GENERATED) \ - component-factory.c \ - component-factory.h \ - e-summary.c \ - e-summary.h \ - e-summary-callbacks.c \ - e-summary-callbacks.h \ - e-summary-factory.c \ - e-summary-factory.h \ - e-summary-prefs.c \ - e-summary-prefs.h \ - e-summary-url.c \ - e-summary-url.h \ - e-summary-util.c \ - e-summary-util.h \ - main.c - -evolution_executive_summary_LDADD = \ - $(top_builddir)/executive-summary/evolution-services/libevolution-services.la \ - $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.a \ - $(top_builddir)/e-util/libeutil.la \ - $(BONOBO_VFS_GNOME_LIBS) \ - $(EXTRA_GNOME_LIBS) \ - -lgal \ - $(GTKHTML_LIBS) - -gladedir = $(datadir)/evolution/glade -glade_DATA = executive-summary-config.glade - -if ENABLE_PURIFY -PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ - -all-local: evolution-executive-summary.pure - -evolution-executive-summary.pure: evolution-executive-summary - @rm -f evolution-executive-summary.pure - $(PLINK) $(evolution_executive_summary_OBJECTS) $(evolution_executive_summary_LDADD) $(LIBS) - -endif - -EXTRA_DIST = $(glade_DATA) -CLEANFILES += $(COMPOSER_GENERATED) -BUILT_SOURCES = $(COMPOSER_GENERATED) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) diff --git a/executive-summary/component/component-factory.c b/executive-summary/component/component-factory.c deleted file mode 100644 index 8036b7b346..0000000000 --- a/executive-summary/component/component-factory.c +++ /dev/null @@ -1,155 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* component-factory.c - * - * Authors: Ettore Perazzoli <ettore@helixcode.com> - * Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> - -#include "Evolution.h" -#include "evolution-storage.h" - -#include "evolution-shell-component.h" -#include <gal/widgets/e-gui-utils.h> - -#include "component-factory.h" -#include "e-summary-factory.h" - -#define COMPONENT_FACTORY_IID "OAFIID:GNOME_Evolution_Summary_ShellComponentFactory" - -static BonoboGenericFactory *factory = NULL; -static gint running_objects = 0; - -static const EvolutionShellComponentFolderType folder_types[] = { - { "executive-summary", "evolution-today.png" }, - { NULL, NULL } -}; - -char *evolution_dir; - -/* EvolutionShellComponent methods and signals */ - -static EvolutionShellComponentResult -create_view (EvolutionShellComponent *shell_component, - const char *physical_uri, - const char *folder_type, - BonoboControl **control_return, - void *closure) -{ - EvolutionShellClient *shell_client; - GNOME_Evolution_Shell corba_shell; - BonoboControl *control; - - if (g_strcasecmp (folder_type, "executive-summary") != 0) - return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE; - - shell_client = evolution_shell_component_get_owner (shell_component); - corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); - - control = e_summary_factory_new_control (physical_uri, corba_shell); - if (!control) - return EVOLUTION_SHELL_COMPONENT_NOTFOUND; - - *control_return = control; - - return EVOLUTION_SHELL_COMPONENT_OK; -} - -static void -owner_set_cb (EvolutionShellComponent *shell_component, - EvolutionShellClient *shell_client, - const char *evolution_homedir, - gpointer user_data) -{ - GNOME_Evolution_Shell corba_shell; - - evolution_dir = g_strdup (evolution_homedir); - - corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); -} - -static void -owner_unset_cb (EvolutionShellComponent *shell_component, - gpointer user_data) -{ - gtk_main_quit (); -} - -static void -factory_destroy (BonoboObject *component, - gpointer dummy) -{ - running_objects--; - - if (running_objects > 0) - return; - - if (factory) - bonobo_object_unref (BONOBO_OBJECT (factory)); - else - g_warning ("Serious ref counting error"); - factory = NULL; - - gtk_main_quit (); -} - -static BonoboObject * -factory_fn (BonoboGenericFactory *factory, - void *closure) -{ - EvolutionShellComponent *shell_component; - - running_objects++; - - shell_component = evolution_shell_component_new (folder_types, - create_view, - NULL, NULL, NULL, NULL, NULL, - NULL); - gtk_signal_connect (GTK_OBJECT (shell_component), "destroy", - GTK_SIGNAL_FUNC (factory_destroy), NULL); - gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set", - GTK_SIGNAL_FUNC (owner_set_cb), NULL); - gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset", - GTK_SIGNAL_FUNC (owner_unset_cb), NULL); - - return BONOBO_OBJECT (shell_component); -} - -void -component_factory_init (void) -{ - if (factory != NULL) - return; - - factory = bonobo_generic_factory_new (COMPONENT_FACTORY_IID, - factory_fn, NULL); - - if (factory == NULL) { - e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, - _("Cannot initialize Evolution's Executive Summary component.")); - exit (1); - } -} diff --git a/executive-summary/component/component-factory.h b/executive-summary/component/component-factory.h deleted file mode 100644 index 65e4ad1d56..0000000000 --- a/executive-summary/component/component-factory.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* component-factory.h - * - * 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 - */ - -#ifndef COMPONENT_FACTORY_H -#define COMPONENT_FACTORY_H - -void component_factory_init (void); - -#endif - - diff --git a/executive-summary/component/e-summary-callbacks.c b/executive-summary/component/e-summary-callbacks.c deleted file mode 100644 index 216d28c30f..0000000000 --- a/executive-summary/component/e-summary-callbacks.c +++ /dev/null @@ -1,321 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-callbacks.c - * - * Author: - * Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <libgnomeui/gnome-propertybox.h> -#include <libgnomeui/gnome-file-entry.h> -#include <libgnome/gnome-i18n.h> - -#include <bonobo/bonobo-selector.h> - -#include <stdlib.h> /* For atoi */ - -#include <liboaf/liboaf.h> -#include <glade/glade.h> -#include <gtkhtml/gtkhtml.h> -#include <e-util/e-html-utils.h> - -#include "e-summary.h" -#include "e-summary-callbacks.h" - -#include "Composer.h" - -#define COMPOSER_IID "OAFIID:GNOME_Evolution_Mail_Composer" -typedef struct _PropertyData { - ESummary *esummary; - GnomePropertyBox *box; - GladeXML *xml; -} PropertyData; - -/* HTML helper functions from mail/mail-config-gui.c */ -static void -html_size_req (GtkWidget *widget, - GtkRequisition *requisition) -{ - requisition->height = GTK_LAYOUT (widget)->height; -} - -/* Returns a GtkHTML which is already inside a GtkScrolledWindow. If - * @white is TRUE, the GtkScrolledWindow will be inside a GtkFrame. - */ -static GtkWidget * -html_new (gboolean white) -{ - GtkWidget *html, *scrolled, *frame; - GtkStyle *style; - - html = gtk_html_new (); - GTK_LAYOUT (html)->height = 0; - gtk_signal_connect (GTK_OBJECT (html), "size_request", - GTK_SIGNAL_FUNC (html_size_req), NULL); - gtk_html_set_editable (GTK_HTML (html), FALSE); - style = gtk_rc_get_style (html); - - if (style) { - gtk_html_set_default_background_color (GTK_HTML (html), - white ? &style->white: - &style->bg[0]); - } - - gtk_widget_set_sensitive (html, FALSE); - scrolled = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), - GTK_POLICY_NEVER, GTK_POLICY_NEVER); - gtk_container_add (GTK_CONTAINER (scrolled), html); - if (white) { - frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (frame), - GTK_SHADOW_ETCHED_IN); - gtk_container_add (GTK_CONTAINER (frame), scrolled); - gtk_widget_show_all (frame); - } else { - gtk_widget_show_all (scrolled); - } - - return html; -} - -static void -put_html (GtkHTML *html, - const char *text) -{ - GtkHTMLStream *handle; - char *htmltext; - - htmltext = e_text_to_html (text, E_TEXT_TO_HTML_CONVERT_NL); - handle = gtk_html_begin (html); - gtk_html_write (html, handle, "<HTML><BODY>", 12); - gtk_html_write (html, handle, text, strlen (text)); - gtk_html_write (html, handle, "</BODY></HTML>", 14); - g_free (htmltext); - gtk_html_end (html, handle, GTK_HTML_STREAM_OK); -} - -void -embed_service (GtkWidget *widget, - ESummary *esummary) -{ - char *required_interfaces[2] = {"IDL:GNOME/Evolution:Summary:ComponentFactory:1.0", - NULL}; - char *obj_id; - - obj_id = bonobo_selector_select_id (_("Select a service"), - (const char **) required_interfaces); - if (obj_id == NULL) - return; - - e_summary_embed_service_from_id (esummary, obj_id); -} - -void -new_mail (GtkWidget *widget, - ESummary *esummary) -{ - GNOME_Evolution_Composer_RecipientList *to, *cc, *bcc; - CORBA_char *subject; - CORBA_Object composer; - CORBA_Environment ev; - - CORBA_exception_init (&ev); - composer = oaf_activate_from_id ((char *)COMPOSER_IID, 0, NULL, &ev); - if (ev._major != CORBA_NO_EXCEPTION || composer == NULL) { - CORBA_exception_free (&ev); - g_warning ("Unable to start composer component!"); - return; - } - CORBA_exception_free (&ev); - - to = GNOME_Evolution_Composer_RecipientList__alloc (); - to->_length = 0; - to->_maximum = 0; - to->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (0); - - cc = GNOME_Evolution_Composer_RecipientList__alloc (); - cc->_length = 0; - cc->_maximum = 0; - cc->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (0); - - bcc = GNOME_Evolution_Composer_RecipientList__alloc (); - bcc->_length = 0; - bcc->_maximum = 0; - bcc->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (0); - - subject = CORBA_string_dup (""); - - CORBA_exception_init (&ev); - GNOME_Evolution_Composer_setHeaders (composer, to, cc, - bcc, subject, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - CORBA_free (to); - CORBA_free (cc); - CORBA_free (bcc); - CORBA_free (subject); - - g_warning ("Error setting headers!"); - return; - } - - CORBA_free (to); - CORBA_free (cc); - CORBA_free (bcc); - CORBA_free (subject); - - GNOME_Evolution_Composer_show (composer, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - g_warning ("Error showing composer"); - return; - } - - CORBA_exception_free (&ev); - return; -} - -static void -destroy_prefs_cb (GtkObject *object, - PropertyData *data) -{ - gtk_object_unref (GTK_OBJECT(data->xml)); - g_free (data); -} - -static void -html_page_changed_cb (GtkEntry *entry, - PropertyData *data) -{ - ESummaryPrefs *prefs; - - /* Change the tmp prefs so that we can restore if the user cancels */ - prefs = data->esummary->tmp_prefs; - - if (prefs->page) - g_free (prefs->page); - - prefs->page = g_strdup (gtk_entry_get_text (entry)); - - gnome_property_box_changed (data->box); -} - -static void -column_spinner_changed_cb (GtkEntry *entry, - PropertyData *data) -{ - ESummaryPrefs *prefs; - char *value; - - prefs = data->esummary->tmp_prefs; - - gnome_property_box_changed (data->box); - value = gtk_entry_get_text (entry); - if (value == NULL || *value == '\0') - return; - - prefs->columns = atoi (value); -} - -static void -apply_prefs_cb (GnomePropertyBox *property_box, - int page, - ESummary *esummary) -{ - g_print ("Applying\n"); - - if (page != -1) - return; - - esummary->prefs = e_summary_prefs_copy (esummary->tmp_prefs); - - e_summary_reconfigure (esummary); -} - -void -configure_summary (GtkWidget *widget, - ESummary *esummary) -{ - static GtkWidget *prefs = NULL; - PropertyData *data; - GtkWidget *html_page; - GtkWidget *vbox, *html, *spinner; - char *tmp; - - if (prefs != NULL) { - g_assert (GTK_WIDGET_REALIZED (prefs)); - gdk_window_show (prefs->window); - gdk_window_raise (prefs->window); - return; - } - - data = g_new (PropertyData, 1); - data->esummary = esummary; - - if (esummary->tmp_prefs != NULL) { - e_summary_prefs_free (esummary->tmp_prefs); - } - - esummary->tmp_prefs = e_summary_prefs_copy (esummary->prefs); - - data->xml = glade_xml_new (EVOLUTION_GLADEDIR - "/executive-summary-config.glade", NULL); - prefs = glade_xml_get_widget (data->xml, "summaryprefs"); - data->box = GNOME_PROPERTY_BOX(prefs); - - vbox = glade_xml_get_widget (data->xml, "vbox"); - html = html_new (TRUE); - put_html (GTK_HTML(html), - _("You can select a different HTML page for the background " - "of the Executive Summary.\n\nJust leave it blank for the " - "default")); - gtk_box_pack_start (GTK_BOX (vbox), html->parent->parent, TRUE, TRUE, 0); - gtk_box_reorder_child (GTK_BOX (vbox), html->parent->parent, 0); - - html_page = glade_xml_get_widget (data->xml, "htmlpage"); - - if (esummary->prefs->page != NULL) - gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (html_page))), esummary->prefs->page); - - gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (html_page))), - "changed", GTK_SIGNAL_FUNC (html_page_changed_cb), - data); - - spinner = glade_xml_get_widget (data->xml, "columnspinner"); - - tmp = g_strdup_printf ("%d", esummary->prefs->columns); - gtk_entry_set_text (GTK_ENTRY (spinner), tmp); - g_free (tmp); - gtk_signal_connect (GTK_OBJECT (spinner), "changed", - GTK_SIGNAL_FUNC (column_spinner_changed_cb), data); - - gtk_signal_connect (GTK_OBJECT (prefs), "apply", - GTK_SIGNAL_FUNC (apply_prefs_cb), esummary); - - gtk_signal_connect (GTK_OBJECT (prefs), "destroy", - GTK_SIGNAL_FUNC (destroy_prefs_cb), data); - gtk_signal_connect (GTK_OBJECT (prefs), "destroy", - GTK_SIGNAL_FUNC (gtk_widget_destroyed), &prefs); -} - diff --git a/executive-summary/component/e-summary-callbacks.h b/executive-summary/component/e-summary-callbacks.h deleted file mode 100644 index 6b908d694c..0000000000 --- a/executive-summary/component/e-summary-callbacks.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __E_SUMMARY_CALLBACKS_H__ -#define __E_SUMMARY_CALLBACKS_H__ - -#include "e-summary.h" - -void embed_service (GtkWidget *widget, - ESummary *esummary); -void new_mail (GtkWidget *widget, - ESummary *esummary); -void configure_summary (GtkWidget *widget, - ESummary *esummary); -#endif diff --git a/executive-summary/component/e-summary-factory.c b/executive-summary/component/e-summary-factory.c deleted file mode 100644 index 9952c42fb7..0000000000 --- a/executive-summary/component/e-summary-factory.c +++ /dev/null @@ -1,186 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-factory.c - * - * Authors: Ettore Perazzoli <ettore@helixcode.com> - * Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <bonobo/bonobo-control.h> -#include <bonobo/bonobo-main.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-ui-util.h> - -#include <liboaf/liboaf.h> - -#include <gdk-pixbuf/gdk-pixbuf.h> -#include <gal/util/e-util.h> -#include "evolution-shell-component-utils.h" - -#include "e-summary-factory.h" - -#include "e-summary.h" -#include "e-summary-util.h" -#include "e-summary-callbacks.h" -#include "Evolution.h" - -#include <evolution-services/Executive-Summary.h> -#include <evolution-services/executive-summary-component.h> -#include <evolution-services/executive-summary-component-factory-client.h> - -static GList *control_list = NULL; - -BonoboUIVerb verbs[] = { - BONOBO_UI_UNSAFE_VERB ("AddService", embed_service), - BONOBO_UI_UNSAFE_VERB ("NewMail", new_mail), - BONOBO_UI_UNSAFE_VERB ("ESummarySettings", configure_summary), - BONOBO_UI_VERB_END -}; - -static EPixmap pixmaps [] = { - E_PIXMAP ("/Toolbar/AddService", "buttons/add-service.png"), - E_PIXMAP ("/Toolbar/NewMail", "buttons/compose-message.png"), - E_PIXMAP_END -}; - -static void -control_activate (BonoboControl *control, - BonoboUIComponent *ui_component, - ESummary *esummary) -{ - Bonobo_UIContainer container; - - container = bonobo_control_get_remote_ui_container (control); - bonobo_ui_component_set_container (ui_component, container); - bonobo_object_release_unref (container, NULL); - - bonobo_ui_component_add_verb_list_with_data (ui_component, verbs, esummary); - - bonobo_ui_component_freeze (ui_component, NULL); - - bonobo_ui_util_set_ui (ui_component, EVOLUTION_DATADIR, - "evolution-executive-summary.xml", - "evolution-executive-summary"); - - e_pixmaps_update (ui_component, pixmaps); - - bonobo_ui_component_thaw (ui_component, NULL); -} - -static void -control_deactivate (BonoboControl *control, - BonoboUIComponent *ui_component, - ESummary *esummary) -{ - e_summary_unset_message (esummary); - bonobo_ui_component_unset_container (ui_component); -} - -static void -control_activate_cb (BonoboControl *control, - gboolean activate, - gpointer user_data) -{ - ESummary *summary; - BonoboUIComponent *ui_component; - Bonobo_ControlFrame control_frame; - GNOME_Evolution_ShellView shell_view_interface; - CORBA_Environment ev; - - ui_component = bonobo_control_get_ui_component (control); - g_assert (ui_component != NULL); - - if (gtk_object_get_data (GTK_OBJECT (control), "shell_view_interface") == NULL) { - control_frame = bonobo_control_get_control_frame (control); - if (control_frame == NULL) { - goto out; - } - - CORBA_exception_init (&ev); - shell_view_interface = Bonobo_Unknown_queryInterface (control_frame, - "IDL:GNOME/Evolution/ShellView:1.0", - &ev); - CORBA_exception_free (&ev); - - if (shell_view_interface != CORBA_OBJECT_NIL) { - gtk_object_set_data (GTK_OBJECT (control), - "shell_view_interface", - shell_view_interface); - } else { - g_warning ("Control frame doesn't have Evolution/ShellView."); - } - - summary = E_SUMMARY (user_data); - e_summary_set_shell_view_interface (summary, - shell_view_interface); - } - - out: - if (activate) - control_activate (control, ui_component, user_data); - else - control_deactivate (control, ui_component, user_data); -} - -static void -control_destroy_cb (BonoboControl *control, - gpointer user_data) -{ - GtkWidget *esummary = user_data; - - control_list = g_list_remove (control_list, control); - - gtk_object_destroy (GTK_OBJECT (esummary)); -} - -BonoboControl * -e_summary_factory_new_control (const char *uri, - const GNOME_Evolution_Shell shell) -{ - BonoboControl *control; - GtkWidget *esummary; - - esummary = e_summary_new (shell); - if (esummary == NULL) - return NULL; - - gtk_widget_show (esummary); - - control = bonobo_control_new (esummary); - - if (control == NULL) { - gtk_object_destroy (GTK_OBJECT (esummary)); - return NULL; - } - - gtk_signal_connect (GTK_OBJECT (control), "activate", - control_activate_cb, esummary); - - gtk_signal_connect (GTK_OBJECT (control), "destroy", - control_destroy_cb, esummary); - - control_list = g_list_prepend (control_list, control); - - return control; -} diff --git a/executive-summary/component/e-summary-factory.h b/executive-summary/component/e-summary-factory.h deleted file mode 100644 index a9489d06a4..0000000000 --- a/executive-summary/component/e-summary-factory.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-factory.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _E_SUMMARY_FACTORY_H__ -#define _E_SUMMARY_FACTORY_H__ - -#include <Evolution.h> -#include "e-summary.h" - -BonoboControl *e_summary_factory_new_control (const char *uri, - const GNOME_Evolution_Shell shell); -ESummaryWindow *e_summary_factory_embed_service_from_id (ESummary *esummary, - const char *obj_id); - -#endif diff --git a/executive-summary/component/e-summary-prefs.c b/executive-summary/component/e-summary-prefs.c deleted file mode 100644 index 5ed9876cf4..0000000000 --- a/executive-summary/component/e-summary-prefs.c +++ /dev/null @@ -1,123 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-prefs.c: Preference handling routines. - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdio.h> -#include <libgnome/gnome-defs.h> -#include <libgnome/gnome-config.h> -#include "e-summary-prefs.h" -#include "e-summary.h" - -void -e_summary_prefs_free (ESummaryPrefs *prefs) -{ - g_return_if_fail (prefs != NULL); - - g_free (prefs->page); - g_free (prefs); -} - -ESummaryPrefs * -e_summary_prefs_new (void) -{ - ESummaryPrefs *prefs; - - prefs = g_new0 (ESummaryPrefs, 1); - return prefs; -} - -ESummaryPrefs * -e_summary_prefs_copy (ESummaryPrefs *prefs) -{ - ESummaryPrefs *copy; - - g_return_val_if_fail (prefs != NULL, NULL); - - copy = e_summary_prefs_new (); - copy->page = g_strdup (prefs->page); - copy->columns = prefs->columns; - - return copy; -} - -gboolean -e_summary_prefs_compare (ESummaryPrefs *p1, - ESummaryPrefs *p2) -{ - if (p1 == p2) - return TRUE; - - if (strcmp (p1->page, p2->page) == 0) - return TRUE; - - if (p1->columns == p2->columns) - return TRUE; - - return FALSE; -} - -ESummaryPrefs * -e_summary_prefs_load (const char *path) -{ - ESummaryPrefs *prefs; - char *item; - - g_return_val_if_fail (path != NULL, NULL); - g_return_val_if_fail (*path != '\0', NULL); - - prefs = e_summary_prefs_new (); - - item = g_strdup_printf ("=%s/e-summary=/executive-summary/page", path); - prefs->page = gnome_config_get_string (item); - g_free (item); - - item = g_strdup_printf ("=%s/e-summary=/executive-summary/columns=3", path); - prefs->columns = gnome_config_get_int (item); - g_free (item); - return prefs; -} - -void -e_summary_prefs_save (ESummaryPrefs *prefs, - const char *path) -{ - char *item; - - g_return_if_fail (prefs != NULL); - g_return_if_fail (path != NULL); - g_return_if_fail (*path != '\0'); - - item = g_strdup_printf ("=%s/e-summary=/executive-summary/page", path); - gnome_config_set_string (item, prefs->page); - g_free (item); - - item = g_strdup_printf ("=%s/e-summary=/executive-summary/columns", path); - gnome_config_set_int (item, prefs->columns); - g_free (item); - - gnome_config_sync (); - gnome_config_drop_all (); -} diff --git a/executive-summary/component/e-summary-prefs.h b/executive-summary/component/e-summary-prefs.h deleted file mode 100644 index 9dc7b09404..0000000000 --- a/executive-summary/component/e-summary-prefs.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-prefs.h: Preference handling routines. - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef __E_SUMMARY_PREFS_H__ -#define __E_SUMMARY_PREFS_H__ - -typedef struct _ESummaryPrefs ESummaryPrefs; -struct _ESummaryPrefs { - char *page; /* Background HTML page URL */ - int columns; /* Number of components per row (Default = 3) */ - - /* If anything is added here, don't forget to add - copy, compare, load and save routines to the appropriate - functions. */ -}; - -ESummaryPrefs *e_summary_prefs_new (void); -void e_summary_prefs_free (ESummaryPrefs *prefs); -ESummaryPrefs *e_summary_prefs_copy (ESummaryPrefs *prefs); -gboolean e_summary_prefs_compare (ESummaryPrefs *p1, - ESummaryPrefs *p2); -ESummaryPrefs *e_summary_prefs_load (const char *path); -void e_summary_prefs_save (ESummaryPrefs *prefs, - const char *path); - -#endif diff --git a/executive-summary/component/e-summary-url.c b/executive-summary/component/e-summary-url.c deleted file mode 100644 index 4a7a630303..0000000000 --- a/executive-summary/component/e-summary-url.c +++ /dev/null @@ -1,852 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-url.c - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <bonobo/bonobo-property-control.h> -#include <bonobo/bonobo-event-source.h> -#include <bonobo/bonobo-widget.h> - -#include <libgnome/gnome-i18n.h> -#include <libgnome/gnome-url.h> -#include <libgnome/gnome-exec.h> -#include <libgnomeui/gnome-propertybox.h> - -#include <stdlib.h> - -#include <gtkhtml/gtkhtml.h> -#include <gtkhtml/gtkhtml-stream.h> -#include <gal/util/e-util.h> -#include <gal/widgets/e-unicode.h> - -#include <liboaf/liboaf.h> - -#include <libgnomevfs/gnome-vfs.h> -#include "e-summary.h" -#include "e-summary-url.h" -#include "e-summary-util.h" - -#include "Composer.h" - -typedef enum _ESummaryProtocol { - PROTOCOL_NONE, - PROTOCOL_HTTP, - PROTOCOL_MAILTO, - PROTOCOL_VIEW, - PROTOCOL_EXEC, - PROTOCOL_FILE, - PROTOCOL_CLOSE, - PROTOCOL_LEFT, - PROTOCOL_RIGHT, - PROTOCOL_UP, - PROTOCOL_DOWN, - PROTOCOL_CONFIGURE, - PROTOCOL_OTHER -} ESummaryProtocol; - -static char *descriptions[] = { - N_("Open %s with the default GNOME application"), - N_("Open %s with the default GNOME web browser"), - N_("Send an email to %s"), - N_("Change the view to %s"), - N_("Run %s"), - N_("Open %s with the default GNOME application"), - N_("Close %s"), - N_("Move %s to the left"), - N_("Move %s to the right"), - N_("Move %s into the previous row"), - N_("Move %s into the next row"), - N_("Configure %s"), - N_("Open %s with the default GNOME application") -}; - -typedef struct _PropertyDialog { - BonoboListener *listener; - int listener_id; - - Bonobo_EventSource eventsource; - GtkWidget *dialog; -} PropertyDialog; -#define COMPOSER_IID "OAFIID:GNOME_Evolution_Mail_Composer" - -#if HAVECACHE -static ESummaryCache *image_cache = NULL; -#endif - -gboolean e_summary_url_mail_compose (ESummary *esummary, - const char *url); -gboolean e_summary_url_exec (const char *exec); - -struct _DownloadInfo { - GtkHTMLStream *stream; - char *uri; - char *buffer; - - gboolean error; -}; -typedef struct _DownloadInfo DownloadInfo; - -static void -close_callback (GnomeVFSAsyncHandle *handle, - GnomeVFSResult result, - gpointer data) -{ - DownloadInfo *info = data; - if (info->error) { - gtk_html_stream_close (info->stream, GTK_HTML_STREAM_ERROR); - } else { - gtk_html_stream_close (info->stream, GTK_HTML_STREAM_OK); - } - - g_free (info->uri); - g_free (info->buffer); - g_free (info); -} - -static void -read_callback (GnomeVFSAsyncHandle *handle, - GnomeVFSResult result, - gpointer buffer, - GnomeVFSFileSize bytes_requested, - GnomeVFSFileSize bytes_read, - gpointer data) -{ - DownloadInfo *info = data; - if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) { - g_warning ("Read error"); - info->error = TRUE; - gnome_vfs_async_close (handle, close_callback, info); - } - - if (bytes_read == 0) { - info->error = FALSE; - gnome_vfs_async_close (handle, close_callback, info); - } else { - gtk_html_stream_write (info->stream, buffer, bytes_read); - gnome_vfs_async_read (handle, buffer, 4095, read_callback, - info); - } -} - -static void -open_callback (GnomeVFSAsyncHandle *handle, - GnomeVFSResult result, - DownloadInfo *info) -{ - if (result != GNOME_VFS_OK) { - gtk_html_stream_close (info->stream, GTK_HTML_STREAM_ERROR); - g_free (info->uri); - g_free (info); - return; - } - - info->buffer = g_new (char, 4096); - gnome_vfs_async_read (handle, info->buffer, 4095, read_callback, info); -} - -void -e_summary_url_request (GtkHTML *html, - const gchar *url, - GtkHTMLStream *stream) -{ - char *filename; - GnomeVFSAsyncHandle *handle; - DownloadInfo *info; - - g_print ("url: %s\n", url); - if (strncasecmp (url, "file:", 5) == 0) { - url += 5; - filename = e_pixmap_file (url); - } else if (strchr (url, ':') >= strchr (url, '/')) { - filename = e_pixmap_file (url); - } else - filename = g_strdup (url); - - if (filename == NULL) { - gtk_html_stream_close (stream, GTK_HTML_STREAM_ERROR); - return; - } - - g_print ("Filename: %s\n", filename); - - info = g_new (DownloadInfo, 1); - info->stream = stream; - info->uri = filename; - info->error = FALSE; - - gnome_vfs_async_open (&handle, filename, GNOME_VFS_OPEN_READ, - (GnomeVFSAsyncOpenCallback) open_callback, info); -} - -static char * -parse_uri (const char *uri, - ESummaryProtocol protocol, - ESummary *esummary) -{ - char *parsed; - char *p; - int address; - ESummaryWindow *window; - - switch (protocol) { - - case PROTOCOL_HTTP: - /* "http://" == 7 */ - parsed = g_strdup (uri + 7); - break; - - case PROTOCOL_EXEC: - /* "exec://" == 7 */ - parsed = g_strdup (uri + 7); - break; - - case PROTOCOL_VIEW: - /* "view://" == 7 */ - parsed = g_strdup (uri + 7); - break; - - case PROTOCOL_MAILTO: - /* Fun. Mailto's might be "mailto:" or "mailto://" */ - if (strstr (uri, "mailto://") == NULL) { - parsed = (char *) (uri + 7); - } else { - parsed = (char *) (uri + 9); - } - - /* Now strip anything after a question mark, - as it is a parameter (that we ignore for the time being) */ - if ( (p = strchr (parsed, '?')) != NULL) { - parsed = g_strndup (parsed, p - parsed); - } else { - parsed = g_strdup (parsed); - } - - break; - - case PROTOCOL_CLOSE: - address = atoi (uri + 8); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - parsed = g_strdup (window->title); - break; - - case PROTOCOL_LEFT: - address = atoi (uri + 7); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - parsed = g_strdup (window->title); - break; - - case PROTOCOL_RIGHT: - address = atoi (uri + 8); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - parsed = g_strdup (window->title); - break; - - case PROTOCOL_UP: - address = atoi (uri + 5); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - parsed = g_strdup (window->title); - break; - - case PROTOCOL_DOWN: - address = atoi (uri + 7); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - parsed = g_strdup (window->title); - break; - - case PROTOCOL_CONFIGURE: - address = atoi (uri + 12); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - parsed = g_strdup (window->title); - break; - - case PROTOCOL_NONE: - case PROTOCOL_OTHER: - default: - /* Just return the uneditted uri. */ - parsed = g_strdup (uri); - break; - } - - return parsed; -} - -static ESummaryProtocol -get_protocol (const char *url) -{ - char *lowerurl; - ESummaryProtocol protocol = PROTOCOL_OTHER; - - lowerurl = g_strdup (url); - g_strdown (lowerurl); - - /* Check for no :/ */ - if (strstr (lowerurl, "://") == NULL) { - - /* Annoying alternative for mailto URLs */ - if (strncmp (lowerurl, "mailto:", 6) != 0) { - g_free (lowerurl); - return PROTOCOL_NONE; - } else { - g_free (lowerurl); - return PROTOCOL_MAILTO; - } - } - - switch (lowerurl[0]) { - case 'c': - switch (lowerurl[1]) { - case 'l': - if (strncmp (lowerurl + 2, "ose", 3) == 0) - protocol = PROTOCOL_CLOSE; - break; - case 'o': - if (strncmp (lowerurl + 2, "nfigure", 7) == 0) - protocol = PROTOCOL_CONFIGURE; - break; - } - - case 'd': - if (strncmp (lowerurl + 1, "own", 3) == 0) - protocol = PROTOCOL_DOWN; - break; - - case 'e': - if (strncmp (lowerurl + 1, "xec", 3) == 0) - protocol = PROTOCOL_EXEC; - break; - - case 'f': - if (strncmp (lowerurl + 1, "ile", 3) == 0) - protocol = PROTOCOL_FILE; - break; - - case 'h': - if (strncmp (lowerurl + 1, "ttp", 3) == 0) - protocol = PROTOCOL_HTTP; - break; - - case 'l': - if (strncmp (lowerurl + 1, "eft", 3) == 0) - protocol = PROTOCOL_LEFT; - break; - - case 'm': - if (strncmp (lowerurl + 1, "ailto", 5) == 0) - protocol = PROTOCOL_MAILTO; - break; - - case 'r': - if (strncmp (lowerurl + 1, "ight", 4) == 0) - protocol = PROTOCOL_RIGHT; - break; - - case 'u': - if (lowerurl[1] == 'p') - protocol = PROTOCOL_UP; - break; - - case 'v': - if (strncmp (lowerurl + 1, "iew", 3) == 0) - protocol = PROTOCOL_VIEW; - break; - - default: - break; - } - - g_free (lowerurl); - - return protocol; -} - -static void -property_apply (GnomePropertyBox *propertybox, - gint page_num, - Bonobo_PropertyControl control) -{ - CORBA_Environment ev; - - g_print ("page_num: %d\n", page_num); - - CORBA_exception_init (&ev); - Bonobo_PropertyControl_notifyAction (control, page_num, Bonobo_PropertyControl_APPLY, &ev); - CORBA_exception_free (&ev); -} - -static void -property_help (GnomePropertyBox *propertybox, - gint page_num, - Bonobo_PropertyControl control) -{ - CORBA_Environment ev; - - CORBA_exception_init (&ev); - Bonobo_PropertyControl_notifyAction (control, page_num, Bonobo_PropertyControl_HELP, &ev); - CORBA_exception_free (&ev); -} - -static void -property_event (BonoboListener *listener, - char *event_name, - CORBA_any *any, - CORBA_Environment *ev, - gpointer user_data) -{ - PropertyDialog *data = (PropertyDialog *) user_data; - if (strcmp (event_name, BONOBO_PROPERTY_CONTROL_CHANGED) == 0) { - gnome_property_box_changed (GNOME_PROPERTY_BOX (data->dialog)); - return; - } -} - -static void -dialog_destroyed (GtkObject *object, - PropertyDialog *dialog) -{ - CORBA_Environment ev; - - CORBA_exception_init (&ev); - Bonobo_EventSource_removeListener (dialog->eventsource, - dialog->listener_id, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error: %s", CORBA_exception_id (&ev)); - } - - bonobo_object_unref (BONOBO_OBJECT (dialog->listener)); - CORBA_exception_free (&ev); - g_free (dialog); -} - -struct _idle_data { - ESummary *esummary; - ESummaryWindow *window; -}; - -static gboolean -idle_remove_window (gpointer data) -{ - struct _idle_data *id = data; - - e_summary_remove_window (id->esummary, id->window); - e_summary_queue_rebuild (id->esummary); - g_free (id); - - return FALSE; -} - -void -e_summary_url_click (GtkWidget *widget, - const char *url, - ESummary *esummary) -{ - ESummaryProtocol protocol; - char *parsed; - int address; - ESummaryWindow *window; - struct _idle_data *id; - Bonobo_Control control; - Bonobo_Listener corba_listener; - GtkWidget *prefsbox, *control_widget; - CORBA_Environment ev; - PropertyDialog *data; - int num_pages, i; - - protocol = get_protocol (url); - - parsed = parse_uri (url, protocol, esummary); - - switch (protocol) { - case PROTOCOL_MAILTO: - /* Open a composer window */ - e_summary_url_mail_compose (esummary, parsed); - break; - - case PROTOCOL_VIEW: - /* Change the EShellView's current uri */ - e_summary_change_current_view (esummary, parsed); - break; - - case PROTOCOL_EXEC: - /* Execute the rest of the url */ - e_summary_url_exec (parsed); - break; - - case PROTOCOL_CLOSE: - /* Close the window. */ - address = atoi (url + 8); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - if (window->iid == NULL) - break; - - id = g_new (struct _idle_data, 1); - id->window = window; - id->esummary = esummary; - - /* Close the window on an idle to work around a bug in - gnome-vfs which locks the e_summary_remove_window function - and as gtkhtml has a pointer grab on, this locks the whole - display. GAH! */ - g_idle_add (idle_remove_window, id); - break; - - case PROTOCOL_CONFIGURE: - /* Configure the window. . . */ - address = atoi (url + 12); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - if (window->iid == NULL) - break; - - data = g_new (PropertyDialog, 1); - /* Create the property box */ - prefsbox = gnome_property_box_new (); - data->dialog = prefsbox; - - CORBA_exception_init (&ev); - data->eventsource = window->event_source; - data->listener = bonobo_listener_new (property_event, data); - corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (data->listener)); - data->listener_id = Bonobo_EventSource_addListener (data->eventsource, - corba_listener, &ev); - - gtk_signal_connect (GTK_OBJECT (prefsbox), "apply", - GTK_SIGNAL_FUNC (property_apply), - window->propertycontrol); - gtk_signal_connect (GTK_OBJECT (prefsbox), "help", - GTK_SIGNAL_FUNC (property_help), - window->propertycontrol); - gtk_signal_connect (GTK_OBJECT (prefsbox), "destroy", - GTK_SIGNAL_FUNC (dialog_destroyed), data); - - num_pages = Bonobo_PropertyControl__get_pageCount (window->propertycontrol, &ev); - for (i = 0; i < num_pages; i++) { - control = Bonobo_PropertyControl_getControl (window->propertycontrol, i, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Unable to get property control."); - CORBA_exception_free (&ev); - break; - } - control_widget = bonobo_widget_new_control_from_objref (control, - CORBA_OBJECT_NIL); - gnome_property_box_append_page (GNOME_PROPERTY_BOX (prefsbox), - control_widget, - gtk_label_new (_("page"))); - } - - gtk_widget_show_all (prefsbox); - - break; - - case PROTOCOL_LEFT: - /* Window left */ - address = atoi (url + 7); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - if (window->iid == NULL) - break; - - e_summary_window_move_left (esummary, window); - e_summary_queue_rebuild (esummary); - break; - - case PROTOCOL_RIGHT: - address = atoi (url + 8); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - if (window->iid == NULL) - break; - - e_summary_window_move_right (esummary, window); - e_summary_queue_rebuild (esummary); - break; - - case PROTOCOL_UP: - address = atoi (url + 5); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - if (window->iid == NULL) - break; - - e_summary_window_move_up (esummary, window); - e_summary_queue_rebuild (esummary); - break; - - case PROTOCOL_DOWN: - address = atoi (url + 7); - window = (ESummaryWindow *) GINT_TO_POINTER (address); - if (window->iid == NULL) - break; - - e_summary_window_move_down (esummary, window); - e_summary_queue_rebuild (esummary); - break; - - case PROTOCOL_OTHER: - case PROTOCOL_NONE: - case PROTOCOL_HTTP: - case PROTOCOL_FILE: - default: - /* Let browser handle it */ - gnome_url_show (url); - break; - - } - - g_free (parsed); -} - -static void -parse_mail_url (char *url, - GList **cc, - GList **bcc, - char **subject) -{ - char **options; - int i = 0; - - options = g_strsplit (url, "&", 0); - while (options[i] != NULL) { - char **params; - - params = g_strsplit (options[i], "=", 2); - if (strcmp (params[0], "subject") == 0) { - *subject = g_strdup (params[1]); - } else if (strcmp (params[0], "cc") == 0) { - *cc = g_list_prepend (*cc, g_strdup (params[1])); - } else if (strcmp (params[1], "bcc") == 0) { - *bcc = g_list_prepend (*bcc, g_strdup (params[1])); - } - - g_strfreev (params); - i++; - } - - g_strfreev (options); - /* Reverse the list so it's in the correct order */ - *cc = g_list_reverse (*cc); - *bcc = g_list_reverse (*bcc); -} - -static void -recipients_from_list (GNOME_Evolution_Composer_RecipientList *recipients, - GList *list) -{ - GList *t; - int i; - - for (i = 0, t = list; t; i++, t = t->next) { - GNOME_Evolution_Composer_Recipient *recipient; - char *address = (char *)t->data; - - recipient = recipients->_buffer + i; - recipient->name = CORBA_string_dup (""); - recipient->address = CORBA_string_dup (address ? address : ""); - } -} - -static void -free_list (GList *list) -{ - for (; list; list = list->next) { - g_free (list->data); - } -} - -gboolean -e_summary_url_mail_compose (ESummary *esummary, - const char *url) -{ - CORBA_Object composer; - CORBA_Environment ev; - char *full_address, *address, *proto, *q; - GNOME_Evolution_Composer_RecipientList *to, *cc, *bcc; - GNOME_Evolution_Composer_Recipient *recipient; - CORBA_char *subject; - GList *gcc = NULL, *gbcc = NULL; - char *gsubject = NULL; - - CORBA_exception_init (&ev); - - /* FIXME: Query for IIDs? */ - composer = oaf_activate_from_id ((char *)COMPOSER_IID, 0, NULL, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - g_warning ("Unable to start composer component!"); - return FALSE; - } - - if ( (proto = strstr (url, "://")) != NULL){ - full_address = proto + 3; - } else { - if (strncmp (url, "mailto:", 7) == 0) - full_address = (char *) (url + 7); - else - full_address = (char *) url; - } - - q = strchr (full_address, '?'); - if (q != NULL) { - address = g_strndup (full_address, q - full_address); - parse_mail_url (q + 1, &gcc, &gbcc, &gsubject); - } else { - address = g_strdup (full_address); - } - - to = GNOME_Evolution_Composer_RecipientList__alloc (); - to->_length = 1; - to->_maximum = 1; - to->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (to->_maximum); - - recipient = to->_buffer; - recipient->name = CORBA_string_dup (""); - recipient->address = CORBA_string_dup (address?address:""); - g_free (address); - - /* FIXME: Get these out of the URL */ - cc = GNOME_Evolution_Composer_RecipientList__alloc (); - cc->_length = g_list_length (gcc); - cc->_maximum = cc->_length; - cc->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (cc->_maximum); - - recipients_from_list (cc, gcc); - free_list (gcc); - g_list_free (gcc); - - bcc = GNOME_Evolution_Composer_RecipientList__alloc (); - bcc->_length = g_list_length (gbcc); - bcc->_maximum = bcc->_length; - bcc->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (bcc->_maximum); - - recipients_from_list (bcc, gbcc); - free_list (gbcc); - g_list_free (gbcc); - - subject = CORBA_string_dup (gsubject ? gsubject : ""); - g_free (gsubject); - - CORBA_exception_init (&ev); - GNOME_Evolution_Composer_setHeaders (composer, to, cc, bcc, subject, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - CORBA_free (to); - CORBA_free (cc); - CORBA_free (bcc); - CORBA_free (subject); - - g_warning ("%s(%d): Error setting headers", __FUNCTION__, __LINE__); - return FALSE; - } - - CORBA_free (to); - CORBA_free (cc); - CORBA_free (bcc); - CORBA_free (subject); - - CORBA_exception_init (&ev); - GNOME_Evolution_Composer_show (composer, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - g_warning ("%s(%d): Error showing composer", __FUNCTION__, __LINE__); - return FALSE; - } - - CORBA_exception_free (&ev); - - /* FIXME: Free the composer? */ - - return TRUE; -} - -gboolean -e_summary_url_exec (const char *exec) -{ - gchar **exec_array; - int argc; - - exec_array = g_strsplit (exec, " ", 0); - - argc = 0; - while (exec_array[argc] != NULL) { - argc++; - } - - gnome_execute_async (NULL, argc, exec_array); - - g_strfreev (exec_array); - return TRUE; -} - -static char * -e_summary_url_describe (const char *uri, - ESummary *esummary) -{ - ESummaryProtocol protocol; - char *contents, *description, *tmp; - - protocol = get_protocol (uri); - contents = parse_uri (uri, protocol, esummary); - tmp = e_utf8_to_locale_string (contents); - - description = g_strdup_printf (_(descriptions[protocol]), tmp); - g_free (tmp); - g_free (contents); - - return description; -} - -void -e_summary_url_over (GtkHTML *html, - const char *uri, - ESummary *esummary) -{ - char *description; - - if (uri != NULL) { - description = e_summary_url_describe (uri, esummary); - e_summary_set_message (esummary, description, FALSE); - g_free (description); - } else { - e_summary_unset_message (esummary); - } -} - -/* Cache stuff */ -#if HAVECACHE -void -e_summary_url_init_cache (void) -{ - if (image_cache != NULL) - return; - - image_cache = e_summary_cache_new (); -} - -void -e_summary_url_cache_destroy (void) -{ - if (image_cache == NULL) - return; - - gtk_object_unref (GTK_OBJECT (image_cache)); - - image_cache = NULL; -} -#endif diff --git a/executive-summary/component/e-summary-url.h b/executive-summary/component/e-summary-url.h deleted file mode 100644 index 9844d384e0..0000000000 --- a/executive-summary/component/e-summary-url.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-url.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _E_SUMMARY_URL_H__ -#define _E_SUMMARY_URL_H__ - -void e_summary_url_request (GtkHTML *html, - const gchar *url, - GtkHTMLStream *stream); -void e_summary_url_click (GtkWidget *widget, - const char *url, - ESummary *esummary); -void e_summary_url_over (GtkHTML *html, - const char *uri, - ESummary *esummary); - -#endif diff --git a/executive-summary/component/e-summary-util.c b/executive-summary/component/e-summary-util.c deleted file mode 100644 index 53dcea9488..0000000000 --- a/executive-summary/component/e-summary-util.c +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-url.c - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#include <e-summary-util.h> - -#include <string.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <dirent.h> - -#include <glib.h> -#include <libgnome/gnome-defs.h> -#include <libgnome/gnome-util.h> - -/** - * e_pixmap_file: - * @filename: Filename of pixmap. - * - * Finds @filename in the Evolution or GNOME installation dir. - * - * Returns: A newly allocated absolute path to @filename, or NULL - * if it cannot be found. - */ -char * -e_pixmap_file (const char *filename) -{ - char *ret; - char *edir; - - if (g_file_exists (filename)) { - ret = g_strdup (filename); - - return ret; - } - - /* Try the evolution images dir */ - edir = g_concat_dir_and_file (EVOLUTION_DATADIR "/images/evolution", - filename); - - if (g_file_exists (edir)) { - ret = g_strdup (edir); - g_free (edir); - - return ret; - } - g_free (edir); - - /* Try the evolution button images dir */ - edir = g_concat_dir_and_file (EVOLUTION_DATADIR "/images/evolution/buttons", - filename); - - if (g_file_exists (edir)) { - ret = g_strdup (edir); - g_free (edir); - - return ret; - } - g_free (edir); - - /* Fall back to the gnome_pixmap_file */ - return gnome_pixmap_file (filename); -} - -/** - * e_summary_rm_dir: - * @path: Full path to the directory or file to be removed. - * - * Deletes everything in fullpath. - */ -void -e_summary_rm_dir (const char *path) -{ - DIR *base; - struct stat statbuf; - struct dirent *contents; - - stat (path, &statbuf); - if (!S_ISDIR (statbuf.st_mode)) { - /* Not a directory */ - g_warning ("Removing: %s", path); - unlink (path); - return; - } else { - g_warning ("Opening: %s", path); - base = opendir (path); - - if (base == NULL) - return; - - contents = readdir (base); - while (contents != NULL) { - char *fullpath; - - if (strcmp (contents->d_name, ".") == 0|| - strcmp (contents->d_name, "..") ==0) { - contents = readdir (base); - continue; - } - - fullpath = g_concat_dir_and_file (path, contents->d_name); - e_summary_rm_dir (fullpath); - g_free (fullpath); - - contents = readdir (base); - } - - closedir (base); - rmdir (path); - } -} - diff --git a/executive-summary/component/e-summary-util.h b/executive-summary/component/e-summary-util.h deleted file mode 100644 index 63799a324a..0000000000 --- a/executive-summary/component/e-summary-util.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-util.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _E_SUMMARY_UTIL_H__ -#define _E_SUMMARY_UTIL_H__ - -char *e_pixmap_file (const char *filename); -void e_summary_rm_dir (const char *filename); - -#endif diff --git a/executive-summary/component/e-summary.c b/executive-summary/component/e-summary.c deleted file mode 100644 index a667c0c9f2..0000000000 --- a/executive-summary/component/e-summary.c +++ /dev/null @@ -1,1341 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary.c - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <glib.h> -#include <libgnome/gnome-defs.h> -#include <libgnome/gnome-i18n.h> -#include <libgnome/gnome-util.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-event-source.h> -#include <bonobo/bonobo-listener.h> -#include <bonobo/bonobo-property-bag.h> -#include <bonobo/bonobo-property-control.h> -#include <bonobo/bonobo-storage.h> -#include <bonobo/bonobo-stream-client.h> - -#include <gtkhtml/gtkhtml.h> -#include <gtkhtml/gtkhtml-embedded.h> -#include <gtkhtml/gtkhtml-stream.h> -#include <gtkhtml/htmlengine.h> -#include <gtkhtml/htmlselection.h> - -#include <gal/util/e-util.h> -#include <gal/widgets/e-gui-utils.h> -#include <libgnomevfs/gnome-vfs.h> - -#include "e-summary.h" -#include "e-summary-factory.h" -#include "e-summary-util.h" -#include "e-summary-url.h" - -#include <evolution-services/executive-summary-component.h> -#include <evolution-services/executive-summary-component-factory-client.h> -#include <evolution-services/executive-summary-html-view.h> - -#define PARENT_TYPE (gtk_vbox_get_type ()) - -#define STORAGE_TYPE "fs" -#define IID_FILE "oaf.id" -#define DATA_FILE "data" - -/* From component-factory.c */ -extern char *evolution_dir; - -static GtkObjectClass *e_summary_parent_class; - -struct _ESummaryPrivate { - GNOME_Evolution_Shell shell; - GNOME_Evolution_ShellView shell_view_interface; - - GtkWidget *html_scroller; - GtkWidget *html; - - guint idle; - - GtkHTMLStream *stream; - gboolean grabbed; - - GList *window_list; - - char *header; - int header_len; - char *footer; - int footer_len; -}; - -static gboolean on_object_requested (GtkHTML *html, - GtkHTMLEmbedded *eb, - ESummary *summary); -static void e_summary_save_state (ESummary *esummary, - const char *path); -static void e_summary_load_state (ESummary *esummary, - const char *path); - -/* GtkObject methods */ - -static void -e_summary_destroy (GtkObject *object) -{ - ESummary *esummary = E_SUMMARY (object); - ESummaryPrivate *priv; - GList *l; - char *prefix; - - priv = esummary->private; - if (priv == NULL) - return; - - prefix = g_concat_dir_and_file (evolution_dir, "config/"); - e_summary_save_state (esummary, prefix); - g_free (prefix); - - e_summary_prefs_free (esummary->prefs); - for (l = priv->window_list; l; l = l->next) - e_summary_window_free (l->data); - g_list_free (priv->window_list); - - g_free (priv->header); - g_free (priv->footer); - g_free (esummary->private); - esummary->private = NULL; - - e_summary_parent_class->destroy (object); -} - -static void -e_summary_class_init (GtkObjectClass *object_class) -{ - object_class->destroy = e_summary_destroy; - - e_summary_parent_class = gtk_type_class (PARENT_TYPE); -} - -static void -e_summary_start_load (ESummary *esummary) -{ - ESummaryPrivate *priv; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - - priv->stream = gtk_html_begin (GTK_HTML (priv->html)); - - /* HTML hacks */ - /* Hack to stop page returning to the top */ - GTK_HTML (priv->html)->engine->newPage = FALSE; - /* Hack to make the border width of the page 0 */ - GTK_HTML (priv->html)->engine->leftBorder = 0; - GTK_HTML (priv->html)->engine->rightBorder = 0; - GTK_HTML (priv->html)->engine->topBorder = 0; - GTK_HTML (priv->html)->engine->bottomBorder = 0; -} - -static void -load_default_header (ESummary *esummary) -{ - ESummaryPrivate *priv; - char *def = "<html><body bgcolor=\"#ffffff\">" - "<table width=\"100%\"><tr><td align=\"right\">" - "<img src=\"ccsplash.png\"></td></tr></table>" - "<table><tr><td><a href=\"exec://bug-buddy\"><img src=\"file://gnome-spider.png\" width=\"24\" height=\"24\" border=\"0\">" - "</a></td><td><a href=\"exec://bug-buddy\">Submit a bug report" - "</a></td></tr></table><hr>"; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - - g_return_if_fail (priv->stream != NULL); - - gtk_html_write (GTK_HTML (priv->html), priv->stream, def, strlen (def)); -} -static void -load_default_footer (ESummary *esummary) -{ - ESummaryPrivate *priv; - char *footer = "<hr><p align=\"right\">All Executive Summary comments to <a href=\"mailto:iain@helixcode.com\">Iain Holmes (iain@helixcode.com)</a></p></body></html>"; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - gtk_html_write (GTK_HTML (priv->html), priv->stream, - footer, strlen (footer)); -} - -static void -e_summary_end_load (ESummary *esummary) -{ - ESummaryPrivate *priv; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - gtk_html_end (GTK_HTML (priv->html), priv->stream, GTK_HTML_STREAM_OK); - - priv->stream = NULL; -} - -static void -e_summary_init (ESummary *esummary) -{ - GdkColor bgcolour = {0, 0xdfff, 0xdfff, 0xffff}; - ESummaryPrivate *priv; - - esummary->prefs = NULL; - esummary->tmp_prefs = NULL; - esummary->private = g_new0 (ESummaryPrivate, 1); - priv = esummary->private; - - priv->window_list = NULL; - priv->idle = 0; - - /* HTML widget */ - priv->html_scroller = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->html_scroller), - GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - priv->html = gtk_html_new (); - gtk_html_set_editable (GTK_HTML (priv->html), FALSE); - gtk_html_set_default_content_type (GTK_HTML (priv->html), - "text/html; charset=utf-8"); - gtk_html_set_default_background_color (GTK_HTML (priv->html), &bgcolour); - gtk_signal_connect (GTK_OBJECT (priv->html), "url-requested", - GTK_SIGNAL_FUNC (e_summary_url_request), esummary); - gtk_signal_connect (GTK_OBJECT (priv->html), "object-requested", - GTK_SIGNAL_FUNC (on_object_requested), esummary); - gtk_signal_connect (GTK_OBJECT (priv->html), "link-clicked", - GTK_SIGNAL_FUNC (e_summary_url_click), esummary); - gtk_signal_connect (GTK_OBJECT (priv->html), "on-url", - GTK_SIGNAL_FUNC (e_summary_url_over), esummary); - - gtk_container_add (GTK_CONTAINER (priv->html_scroller), priv->html); - gtk_widget_show_all (priv->html_scroller); - - e_summary_queue_rebuild (esummary); - - /* Pack stuff */ - gtk_box_pack_start (GTK_BOX (esummary), priv->html_scroller, - TRUE, TRUE, 0); -} - -E_MAKE_TYPE (e_summary, "ESummary", ESummary, e_summary_class_init, - e_summary_init, PARENT_TYPE); - -GtkWidget * -e_summary_new (const GNOME_Evolution_Shell shell) -{ - ESummary *esummary; - ESummaryPrivate *priv; - char *path; - - esummary = gtk_type_new (e_summary_get_type ()); - priv = esummary->private; - - priv->shell = shell; - - /* Restore services */ - path = g_concat_dir_and_file (evolution_dir, - "config"); - e_summary_load_state (esummary, path); - g_free (path); - - return GTK_WIDGET (esummary); -} - -#if 0 -static void -control_unrealize (GtkHTMLEmbedded *eb, - GtkWidget *widget) -{ - g_print ("Removing\n"); -} - -static void -being_unrealized (GtkWidget *widget, - GtkHTMLEmbedded *eb) -{ - g_warning ("Widget is being unrealized"); - gtk_container_remove (GTK_CONTAINER (eb), widget); -} - -static void -being_realized (GtkWidget *widget, - gpointer user_data) -{ - gdk_window_ref (widget->window); -} -#endif - -static gboolean -on_object_requested (GtkHTML *html, - GtkHTMLEmbedded *eb, - ESummary *esummary) -{ -#if 0 - static GtkWidget *widget = NULL; - int id; - - if (sscanf (eb->classid, "cid:%d", &id) != 1) { - g_warning ("Could not get the view id: eb->classid = %s", - eb->classid); - return FALSE; - } - - if (widget == NULL || !GTK_IS_WIDGET (widget)) { - g_print ("Create new\n"); - widget = executive_summary_component_view_get_widget (view); -/* widget = gtk_button_new_with_label ("Hello?"); */ - gtk_signal_connect (GTK_OBJECT (widget), "realize", - GTK_SIGNAL_FUNC (being_realized), NULL); - gtk_signal_connect (GTK_OBJECT (widget), "unrealize", - GTK_SIGNAL_FUNC (being_unrealized), eb); - g_print ("New widget: %p\n", GTK_BIN (widget)->child); - } else { - g_print ("No new\n"); - } - - if (widget == NULL) { - g_warning ("View %d has no GtkWidget.", id); - return FALSE; - } - - gtk_signal_connect (GTK_OBJECT (eb), "unrealize", - GTK_SIGNAL_FUNC (control_unrealize), widget); - gtk_widget_show_all (widget); - gtk_widget_ref (widget); - - if (widget->parent == NULL) - gtk_container_add (GTK_CONTAINER (eb), widget); - -#endif - return TRUE; -} - -/* Generates the window controls and works out - if they should be disabled or not */ -static char * -make_control_html (ESummaryWindow *window, - int row, - int col, - int numwindows) -{ - char *html, *tmp; - int id = GPOINTER_TO_INT (window); - gboolean config; - - config = TRUE; - - if (window->propertycontrol == CORBA_OBJECT_NIL) - config = FALSE; - - html = g_strdup_printf ("<table><tr><td><a href=\"close://%d\">" - "<img src=\"service-close.png\" border=\"0\">" - "</a></td></tr><tr><td>", id); - - tmp = html; - if (!config) { - html = g_strdup_printf ("%s<img src=\"service-configure.png\">" - "</td></tr></table>", tmp); - } else { - html = g_strdup_printf ("%s<a href=\"configure://%d\">" - "<img src=\"service-configure.png\" border=\"0\">" - "</a></td></tr></table>", tmp, id); - } - g_free (tmp); - - return html; -} - -static void -e_summary_display_window_title (ESummary *esummary, - ESummaryWindow *window, - int row, - int col, - int numwindows) -{ - ESummaryPrivate *priv; - char *title_html; - char *control_html; - char *title_colour[2] = {"bac1b6", - "cdd1c7"}; - - priv = esummary->private; - - control_html = make_control_html (window, row, col, numwindows); - title_html = g_strdup_printf ("<td bgcolor=\"#%s\">" - "<table width=\"100%%\" height=\"100%%\"><tr><td>" - "<img src=\"%s\" height=\"48\"></td>" - "<td nowrap align=\"center\" width=\"100%%\">" - "<b>%s</b></td><td>%s</td></tr></table></td>", - title_colour[col % 2], window->icon, - window->title, control_html); - g_free (control_html); - - gtk_html_write (GTK_HTML (priv->html), priv->stream, title_html, - strlen (title_html)); - g_free (title_html); -} - -static void -e_summary_display_window (ESummary *esummary, - ESummaryWindow *window, - int row, - int col, - int numwindows) -{ - ESummaryPrivate *priv; - char *footer = "</td>"; - char *header; - char *colour[2] = {"e6e8e4", - "edeeeb"}; - - priv = esummary->private; - - header = g_strdup_printf ("<td bgcolor=\"%s\" valign=\"top\">", colour[col % 2]); - gtk_html_write (GTK_HTML (priv->html), priv->stream, header, strlen (header)); - g_free (header); - - if (window->html != CORBA_OBJECT_NIL) { - char *html = NULL; - CORBA_Environment ev; - - CORBA_exception_init (&ev); - html = GNOME_Evolution_Summary_HTMLView_getHtml (window->html, - &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - g_warning ("Cannot get HTML."); - if (html) - CORBA_free (html); - } else { - CORBA_exception_free (&ev); - - gtk_html_write (GTK_HTML (priv->html), priv->stream, - html, strlen (html)); - CORBA_free (html); - } - } else { -#if 0 - char *body_cid; - - body_cid = g_strdup_printf ("<object classid=\"cid:%d\"></object>", id); - gtk_html_write (GTK_HTML (priv->html), priv->stream, - body_cid, strlen (body_cid)); - g_free (body_cid); -#endif - } - - gtk_html_write (GTK_HTML (priv->html), priv->stream, - footer, strlen (footer)); -} - -static int -e_summary_rebuild_page (ESummary *esummary) -{ - ESummaryPrivate *priv; - GList *windows; - char *service_table = "<table numcols=\"%d\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" height=\"100%%\" width=\"100%%\">"; - char *tmp; - int numwindows, numrows; - int i, j, k; - int columns; - - g_return_val_if_fail (esummary != NULL, FALSE); - g_return_val_if_fail (IS_E_SUMMARY (esummary), FALSE); - - priv = esummary->private; - - if (priv->idle == 0) { - g_warning ("esummary->private->idle == 0! This means that " - "e_summary_rebuild_page was called by itself and " - "not queued. You should use e_summary_queue_rebuild " - "instead."); - return FALSE; - } - - /* If there is a selection, don't redraw the page so that the selection - isn't cleared */ - if (GTK_HTML (priv->html)->in_selection == TRUE || - html_engine_is_selection_active (GTK_HTML (priv->html)->engine) == TRUE) - return FALSE; - - gtk_layout_freeze (GTK_LAYOUT (priv->html)); - e_summary_start_load (esummary); - - if (priv->header == NULL || *priv->header == '\0') { - load_default_header (esummary); - } else { - gtk_html_write (GTK_HTML (priv->html), priv->stream, - priv->header, priv->header_len); - } - - /* Load the start of the services */ - tmp = g_strdup_printf (service_table, esummary->prefs->columns); - gtk_html_write (GTK_HTML (priv->html), priv->stream, tmp, strlen (tmp)); - g_free (tmp); - /* Load each of the services */ - numwindows = g_list_length (priv->window_list); - - columns = esummary->prefs->columns; - - windows = priv->window_list; - if (numwindows % columns == 0) - numrows = numwindows / columns; - else - numrows = numwindows / columns + 1; - - for (i = 0; i < numrows; i++) { - GList *window = windows; - - /* Do the same row twice: - Once for the title, once for the contents */ - for (j = 0; j < 2; j++) { - int limit; - - gtk_html_write (GTK_HTML (priv->html), priv->stream, - "<tr>", 4); - /* For each window on row i */ - limit = MIN (columns, (numwindows - (i * columns))); - for (k = 0; k < limit; k++) { - - if (window == NULL) - break; - - if (j == 0) { - e_summary_display_window_title (esummary, - window->data, - k, k, - numwindows); - } else { - e_summary_display_window (esummary, - window->data, - k, k, - numwindows); - } - - if (window != NULL) - window = window->next; - - if (window == NULL) - break; - } - - gtk_html_write (GTK_HTML (priv->html), priv->stream, - "</tr>", 5); - if (j == 0) - window = windows; - else { - if (window) - windows = window; - else - break; - } - } - } - gtk_html_write (GTK_HTML (priv->html), priv->stream, "</tr></table>", 13); - - if (priv->footer == NULL || *priv->footer == '\0') { - load_default_footer (esummary); - } else { - gtk_html_write (GTK_HTML (priv->html), priv->stream, - priv->footer, priv->footer_len); - } - - e_summary_end_load (esummary); - gtk_layout_thaw (GTK_LAYOUT (priv->html)); - - priv->idle = 0; - return FALSE; -} - -/* This is the function that should be called instead of - e_summary_queue_rebuild. This prevents multiple - rebuilds happening together. */ -void -e_summary_queue_rebuild (ESummary *esummary) -{ - ESummaryPrivate *priv; - - priv = esummary->private; - if (priv->idle != 0) - return; - - priv->idle = g_idle_add ((GSourceFunc) e_summary_rebuild_page, esummary); -} - -static void -listener_event (BonoboListener *listener, - char *event_name, - BonoboArg *event_data, - CORBA_Environment *ev, - gpointer user_data) -{ - ESummaryWindow *window = (ESummaryWindow *) user_data; - - if (strcmp (event_name, "Bonobo/Property:change:window_title") == 0) { - if (window->title != NULL) - g_free (window->title); - - window->title = g_strdup (BONOBO_ARG_GET_STRING (event_data)); - e_summary_queue_rebuild (window->esummary); - } else if (strcmp (event_name, "Bonobo/Property:change:window_icon") == 0) { - if (window->icon != NULL) - g_free (window->icon); - - window->icon = g_strdup (BONOBO_ARG_GET_STRING (event_data)); - e_summary_queue_rebuild (window->esummary); - } else if (strcmp (event_name, EXECUTIVE_SUMMARY_HTML_VIEW_HTML_CHANGED) == 0) { - e_summary_queue_rebuild (window->esummary); - } - - return; -} - -ESummaryWindow * -e_summary_add_service (ESummary *esummary, - GNOME_Evolution_Summary_Component component, - const char *iid) -{ - ESummaryWindow *window; - ESummaryPrivate *priv; - Bonobo_Unknown unknown = CORBA_OBJECT_NIL; - Bonobo_Listener listener; - CORBA_Environment ev; - - g_return_val_if_fail (esummary != NULL, NULL); - g_return_val_if_fail (IS_E_SUMMARY (esummary), NULL); - g_return_val_if_fail (component != CORBA_OBJECT_NIL, NULL); - - priv = esummary->private; - - window = g_new0 (ESummaryWindow, 1); - window->component = component; - window->iid = g_strdup (iid); - window->esummary = esummary; - - /* See what interfaces our component supports */ - CORBA_exception_init (&ev); - unknown = Bonobo_Unknown_queryInterface (component, - "IDL:Bonobo/Control:1.0", &ev); - window->control = (Bonobo_Control) unknown; - - unknown = Bonobo_Unknown_queryInterface (component, - "IDL:GNOME/Evolution/Summary/HTMLView:1.0", - &ev); - window->html = (GNOME_Evolution_Summary_HTMLView) unknown; - - /* Check at least one of the above interfaces was supported */ - if (window->html == CORBA_OBJECT_NIL && - window->control == CORBA_OBJECT_NIL) { - CORBA_Environment ev2; - g_warning ("This component does not support either" - "Bonobo/Control:1.0 or GNOME/Evolution/Summary/HTMLView:1.0"); - - CORBA_exception_init (&ev2); - CORBA_Object_release (component, &ev2); - CORBA_exception_free (&ev2); - - g_free (window); - return NULL; - } - - unknown = Bonobo_Unknown_queryInterface (component, - "IDL:Bonobo/PropertyBag:1.0", - &ev); - window->propertybag = (Bonobo_PropertyBag) unknown; - - window->event_source = Bonobo_Unknown_queryInterface(window->propertybag, - "IDL:Bonobo/EventSource:1.0", &ev); - if (window->event_source == CORBA_OBJECT_NIL) { - g_warning ("There is no Bonobo::EventSource interface"); - - /* FIXME: Free whatever objects exist */ - g_free (window); - return NULL; - } - - window->listener = bonobo_listener_new (NULL, NULL); - gtk_signal_connect (GTK_OBJECT (window->listener), "event_notify", - GTK_SIGNAL_FUNC (listener_event), window); - listener = bonobo_object_corba_objref (BONOBO_OBJECT (window->listener)); - window->listener_id = Bonobo_EventSource_addListener (window->event_source, listener, &ev); - - unknown = Bonobo_Unknown_queryInterface (component, - "IDL:Bonobo/PersistStream:1.0", - &ev); - window->persiststream = (Bonobo_PersistStream) unknown; - - unknown = Bonobo_Unknown_queryInterface (component, - "IDL:Bonobo/PropertyControl:1.0", - &ev); - window->propertycontrol = (Bonobo_PropertyControl) unknown; - - /* Cache the title and icon */ - window->title = bonobo_property_bag_client_get_value_string (window->propertybag, - "window_title", - NULL); - g_print ("title: %s\n", window->title); - window->icon = bonobo_property_bag_client_get_value_string (window->propertybag, - "window_icon", NULL); - g_print ("icon: %s\n", window->icon); - - CORBA_exception_free (&ev); - priv->window_list = g_list_append (priv->window_list, window); - - return window; -} - - -ESummaryWindow * -e_summary_embed_service_from_id (ESummary *esummary, - const char *obj_id) -{ - GNOME_Evolution_Summary_Component component; - ExecutiveSummaryComponentFactoryClient *client; - ESummaryWindow *window; - - client = executive_summary_component_factory_client_new (obj_id); - - component = executive_summary_component_factory_client_create_view (client); - - /* Don't need the client any more */ - bonobo_object_unref (BONOBO_OBJECT (client)); - - window = e_summary_add_service (esummary, component, obj_id); - e_summary_queue_rebuild (esummary); - - return window; -} - -void -e_summary_window_free (ESummaryWindow *window) -{ - CORBA_Environment ev; - - g_return_if_fail (window != NULL); - - g_free (window->iid); - g_free (window->icon); - g_free (window->title); - - CORBA_exception_init (&ev); - - if (window->control != CORBA_OBJECT_NIL) { - bonobo_object_release_unref (window->control, &ev); - } - - if (window->event_source != CORBA_OBJECT_NIL) { - Bonobo_EventSource_removeListener (window->event_source, - window->listener_id, - &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("CORBA ERROR: %s", CORBA_exception_id (&ev)); - } - bonobo_object_release_unref (window->event_source, &ev); - } - - bonobo_object_release_unref (window->propertybag, &ev); - bonobo_object_release_unref (window->persiststream, &ev); - bonobo_object_release_unref (window->propertycontrol, &ev); - bonobo_object_unref (BONOBO_OBJECT (window->listener)); - bonobo_object_release_unref (window->html, &ev); - - bonobo_object_release_unref (window->component, &ev); - CORBA_exception_free (&ev); - g_free (window); -} - -void -e_summary_remove_window (ESummary *esummary, - ESummaryWindow *window) -{ - ESummaryPrivate *priv; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - g_return_if_fail (window != NULL); - - priv = esummary->private; - priv->window_list = g_list_remove (priv->window_list, window); - e_summary_window_free (window); -} - -void -e_summary_set_shell_view_interface (ESummary *esummary, - GNOME_Evolution_ShellView svi) -{ - ESummaryPrivate *priv; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - g_return_if_fail (svi != CORBA_OBJECT_NIL); - - priv = esummary->private; - priv->shell_view_interface = svi; -} - -/* Wrappers for GNOME_Evolution_ShellView */ -void -e_summary_set_message (ESummary *esummary, - const char *message, - gboolean busy) -{ - ESummaryPrivate *priv; - GNOME_Evolution_ShellView svi; - CORBA_Environment ev; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - - svi = priv->shell_view_interface; - if (svi == NULL) - return; - - CORBA_exception_init (&ev); - if (message != NULL) - GNOME_Evolution_ShellView_setMessage (svi, message, busy, &ev); - else - GNOME_Evolution_ShellView_setMessage (svi, "", busy, &ev); - CORBA_exception_free (&ev); -} - -void -e_summary_unset_message (ESummary *esummary) -{ - ESummaryPrivate *priv; - GNOME_Evolution_ShellView svi; - CORBA_Environment ev; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - - svi = priv->shell_view_interface; - if (svi == NULL) - return; - - CORBA_exception_init (&ev); - GNOME_Evolution_ShellView_unsetMessage (svi, &ev); - CORBA_exception_free (&ev); -} - -void -e_summary_change_current_view (ESummary *esummary, - const char *uri) -{ - ESummaryPrivate *priv; - GNOME_Evolution_ShellView svi; - CORBA_Environment ev; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - - svi = priv->shell_view_interface; - if (svi == NULL) - return; - - CORBA_exception_init (&ev); - GNOME_Evolution_ShellView_changeCurrentView (svi, uri, &ev); - CORBA_exception_free (&ev); -} - -void -e_summary_set_title (ESummary *esummary, - const char *title) -{ - ESummaryPrivate *priv; - GNOME_Evolution_ShellView svi; - CORBA_Environment ev; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - - svi = priv->shell_view_interface; - if (svi == NULL) - return; - - CORBA_exception_init (&ev); - GNOME_Evolution_ShellView_setTitle (svi, title, &ev); - CORBA_exception_free (&ev); -} - -static void -e_summary_load_page (ESummary *esummary) -{ - ESummaryPrivate *priv; - GnomeVFSHandle *handle = NULL; - GnomeVFSResult result; - GtkWidget *toplevel; - GString *string; - char *str, *comment; - char *filename; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - - /* Pass NULL to reset the page to the default */ - if ((esummary->prefs->page) == NULL || - *(esummary->prefs->page) == '\0') { - filename = g_concat_dir_and_file (EVOLUTION_DATADIR, "/evolution/summary.html"); - } else { - filename = g_strdup (esummary->prefs->page); - } - - toplevel = gtk_widget_get_toplevel (GTK_WIDGET (esummary)); - string = g_string_new (""); - result = gnome_vfs_open (&handle, filename, GNOME_VFS_OPEN_READ); - if (result != GNOME_VFS_OK) { - e_notice (GTK_WINDOW (toplevel), GNOME_MESSAGE_BOX_WARNING, - _("Cannot open the HTML file:\n%s"), filename); - g_free (filename); - return; - } - - g_free (filename); - while (1) { - char buffer[4096]; - GnomeVFSFileSize size; - - memset (buffer, 0x00, 4096); - result = gnome_vfs_read (handle, buffer, 4096, &size); - if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) { - e_notice (GTK_WINDOW (toplevel), GNOME_MESSAGE_BOX_WARNING, - _("Error reading data:\n%s"), - gnome_vfs_result_to_string (result)); - gnome_vfs_close (handle); - return; - } - if (size == 0) - break; /* EOF */ - - string = g_string_append (string, buffer); - } - - gnome_vfs_close (handle); - str = string->str; - g_string_free (string, FALSE); - - comment = strstr (str, "<!-- EVOLUTION EXECUTIVE SUMMARY SERVICES DO NOT REMOVE -->"); - if (comment == NULL) { - e_notice (NULL, GNOME_MESSAGE_BOX_WARNING, - _("File does not have a place for the services.\n")); - g_free (str); - return; - } - - if (priv->header != NULL) - g_free (priv->header); - priv->header = g_strndup (str, comment - str); - priv->header_len = strlen (priv->header); - - if (priv->footer != NULL) - g_free (priv->footer); - priv->footer = g_strdup (comment); - priv->footer_len = strlen (priv->footer); - g_free (str); -} - -static char * -load_component_id_stream_read (Bonobo_Stream stream, - CORBA_Environment *ev) -{ - Bonobo_Stream_iobuf *buffer; - GString *str; - char *ans; - - str = g_string_sized_new (256); -#define READ_CHUNK_SIZE 65536 - do { - int i; - Bonobo_Stream_read (stream, READ_CHUNK_SIZE, &buffer, ev); - if (ev->_major != CORBA_NO_EXCEPTION) - return NULL; - - /* FIXME: make better PLEASE!!!*/ - for (i = 0; i < buffer->_length; i++) - g_string_append_c (str, buffer->_buffer[i]); - - if (buffer->_length <= 0) - break; - CORBA_free (buffer); - } while (1); -#undef READ_CHUNK_SIZE - CORBA_free (buffer); - - ans = str->str; - g_string_free (str, FALSE); - - return ans; -} - -static char * -load_component_id (Bonobo_Storage corba_storage, - CORBA_Environment *ev) -{ - Bonobo_Stream corba_stream; - char *iid; - - corba_stream = Bonobo_Storage_openStream (corba_storage, IID_FILE, - Bonobo_Storage_READ, ev); - if (ev->_major != CORBA_NO_EXCEPTION) - return NULL; - - if (corba_stream) { - iid = load_component_id_stream_read (corba_stream, ev); - Bonobo_Unknown_unref (corba_stream, ev); - CORBA_Object_release (corba_stream, ev); - } else { - g_warning ("Cannot find `%s'", IID_FILE); - return NULL; - } - - return iid; -} - -static void -load_component (ESummary *esummary, - BonoboStorage *storage, - int index) -{ - char *curdir; - char *iid; - Bonobo_Storage corba_subdir; - Bonobo_Storage corba_storage; - ESummaryWindow *window; - CORBA_Environment ev; - - curdir = g_strdup_printf ("%08d", index); - corba_storage = bonobo_object_corba_objref (BONOBO_OBJECT (storage)); - CORBA_exception_init (&ev); - - corba_subdir = Bonobo_Storage_openStorage (corba_storage, curdir, - Bonobo_Storage_READ, &ev); - if (corba_subdir == CORBA_OBJECT_NIL) { - g_free (curdir); - return; - } - - iid = load_component_id (corba_subdir, &ev); - - if (iid) { - Bonobo_Stream corba_stream; - - window = e_summary_embed_service_from_id (esummary, iid); - if (window) { - if (window->persiststream) { - corba_stream = Bonobo_Storage_openStream - (corba_subdir, - DATA_FILE, - Bonobo_Storage_READ | - Bonobo_Storage_CREATE, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_print ("Gah"); - return; - } - - Bonobo_PersistStream_load (window->persiststream, - corba_stream, - "", &ev); - if (ev._major != CORBA_NO_EXCEPTION) - g_warning ("Could not load `%s'", iid); - - bonobo_object_release_unref (corba_stream, &ev); - } - } - - g_free (iid); - } - - bonobo_object_release_unref (corba_subdir, &ev); - CORBA_exception_free (&ev); - g_free (curdir); -} - -void -e_summary_reconfigure (ESummary *esummary) -{ - e_summary_load_page (esummary); - e_summary_queue_rebuild (esummary); -} - -static void -e_summary_load_state (ESummary *esummary, - const char *path) -{ - char *fullpath; - BonoboStorage *storage; - Bonobo_Storage corba_storage; - Bonobo_Storage_DirectoryList *list; - CORBA_Environment ev; - int i; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - fullpath = g_strdup_printf ("%s/Executive-Summary", path); - storage = bonobo_storage_open (STORAGE_TYPE, fullpath, - Bonobo_Storage_READ | - Bonobo_Storage_WRITE, - 0664); - if (storage != NULL) { - CORBA_exception_init (&ev); - - corba_storage = bonobo_object_corba_objref (BONOBO_OBJECT (storage)); - list = Bonobo_Storage_listContents (corba_storage, "/", 0, &ev); - if (list) { - for (i = 0; i < list->_length; i++) - load_component (esummary, storage, i); - - CORBA_free (list); - } - - bonobo_object_unref (BONOBO_OBJECT (storage)); - CORBA_exception_free (&ev); - } - - g_free (fullpath); - - /* Load the preferences */ - if (esummary->prefs != NULL) - e_summary_prefs_free (esummary->prefs); - - esummary->prefs = e_summary_prefs_load (path); - e_summary_reconfigure (esummary); -} - -static void -save_component (BonoboStorage *storage, - ESummaryWindow *window, - int index) -{ - char *curdir = g_strdup_printf ("%08d", index); - Bonobo_Storage corba_storage; - Bonobo_Storage corba_subdir; - CORBA_Environment ev; - - corba_storage = bonobo_object_corba_objref (BONOBO_OBJECT (storage)); - CORBA_exception_init (&ev); - - corba_subdir = Bonobo_Storage_openStorage (corba_storage, curdir, - Bonobo_Storage_CREATE| - Bonobo_Storage_WRITE| - Bonobo_Storage_READ, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Cannot create '%s'", curdir); - g_free (curdir); - } else { - Bonobo_Stream corba_stream; - - g_free (curdir); - corba_stream = Bonobo_Storage_openStream - (corba_subdir, IID_FILE, - Bonobo_Storage_CREATE| - Bonobo_Storage_READ| - Bonobo_Storage_WRITE, &ev); - - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("EEK: %s", CORBA_exception_id (&ev)); - if (corba_subdir != CORBA_OBJECT_NIL) - bonobo_object_release_unref (corba_subdir, &ev); - CORBA_exception_free (&ev); - return; - } - - bonobo_stream_client_write_string (corba_stream, - window->iid, TRUE, &ev); - bonobo_object_release_unref (corba_stream, &ev); - - corba_stream = Bonobo_Storage_openStream (corba_subdir, DATA_FILE, - Bonobo_Storage_CREATE, - &ev); - if (window->persiststream != CORBA_OBJECT_NIL) { - Bonobo_PersistStream_save (window->persiststream, - corba_stream, "", &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Unable to save %s", window->iid); - } - } - - bonobo_object_release_unref (corba_stream, &ev); - } - - if (corba_subdir != CORBA_OBJECT_NIL) - bonobo_object_release_unref (corba_subdir, &ev); - CORBA_exception_free (&ev); -} - -static void -e_summary_save_state (ESummary *esummary, - const char *path) -{ - ESummaryPrivate *priv; - BonoboStorage *storage; - Bonobo_Storage corba_storage; - CORBA_Environment ev; - GList *windows; - char *fullpath; - int i; - - g_return_if_fail (esummary != NULL); - g_return_if_fail (IS_E_SUMMARY (esummary)); - - priv = esummary->private; - - fullpath = g_strdup_printf("%s/Executive-Summary", path); - g_print ("fullpath: %s\n", fullpath); - - e_summary_rm_dir (fullpath); - - storage = bonobo_storage_open (STORAGE_TYPE, fullpath, - Bonobo_Storage_READ | - Bonobo_Storage_WRITE | - Bonobo_Storage_CREATE, 0660); - g_return_if_fail (storage); - - CORBA_exception_init (&ev); - corba_storage = bonobo_object_corba_objref (BONOBO_OBJECT (storage)); - - i = 0; - for (windows = priv->window_list; windows; windows = windows->next) { - save_component (storage, windows->data, i); - g_print ("IID: %s\n", ((ESummaryWindow *)windows->data)->iid); - i++; - } - - Bonobo_Storage_commit (corba_storage, &ev); - CORBA_exception_free (&ev); - bonobo_object_unref (BONOBO_OBJECT (storage)); - - e_summary_prefs_save (esummary->prefs, path); - g_free (fullpath); -} - -void -e_summary_window_move_left (ESummary *esummary, - ESummaryWindow *window) -{ - ESummaryPrivate *priv; - GList *win_item, *grandparent; - int position; - - priv = esummary->private; - - /* Need to cache this location */ - win_item = g_list_find (priv->window_list, window); - - /* Find the item 2 previous. */ - if (win_item->prev == NULL) - return; /* Item was first, can't be moved left */ - - grandparent = win_item->prev->prev; - - /* Remove it from the list */ - priv->window_list = g_list_remove_link (priv->window_list, win_item); - - /* Insert it after the grandparent */ - position = g_list_position (priv->window_list, grandparent); - priv->window_list = g_list_insert (priv->window_list, win_item->data, - position + 1); - g_list_free_1 (win_item); -} - -void -e_summary_window_move_right (ESummary *esummary, - ESummaryWindow *window) -{ - ESummaryPrivate *priv; - GList *win_item, *child; - int position; - - priv = esummary->private; - - win_item = g_list_find (priv->window_list, window); - - if (win_item->next == NULL) - return; - - child = win_item->next; - - priv->window_list = g_list_remove_link (priv->window_list, win_item); - - position = g_list_position (priv->window_list, child); - priv->window_list = g_list_insert (priv->window_list, win_item->data, - position + 1); - g_list_free_1 (win_item); -} - -void -e_summary_window_move_up (ESummary *esummary, - ESummaryWindow *window) -{ - ESummaryPrivate *priv; - GList *win_item; - int position; - - priv = esummary->private; - - win_item = g_list_find (priv->window_list, window); - - position = g_list_position (priv->window_list, win_item); - priv->window_list = g_list_remove_link (priv->window_list, win_item); - - priv->window_list = g_list_insert (priv->window_list, win_item->data, - position - 3); - g_list_free_1 (win_item); -} - -void -e_summary_window_move_down (ESummary *esummary, - ESummaryWindow *window) -{ - ESummaryPrivate *priv; - GList *win_item; - int position; - - priv = esummary->private; - - win_item = g_list_find (priv->window_list, window); - - position = g_list_position (priv->window_list, win_item); - priv->window_list = g_list_remove_link (priv->window_list, win_item); - - priv->window_list = g_list_insert (priv->window_list, win_item->data, - position + 3); -} diff --git a/executive-summary/component/e-summary.h b/executive-summary/component/e-summary.h deleted file mode 100644 index 36a9be6ed3..0000000000 --- a/executive-summary/component/e-summary.h +++ /dev/null @@ -1,116 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _E_SUMMARY_H__ -#define _E_SUMMARY_H__ - -#include <gtk/gtkvbox.h> - -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-listener.h> -#include <bonobo/bonobo-event-source.h> -#include <Evolution.h> -#include <evolution-services/Executive-Summary.h> - -#include "e-summary-prefs.h" - -#define E_SUMMARY_TYPE (e_summary_get_type ()) -#define E_SUMMARY(obj) (GTK_CHECK_CAST ((obj), E_SUMMARY_TYPE, ESummary)) -#define E_SUMMARY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_SUMMARY_TYPE, ESummaryClass)) -#define IS_E_SUMMARY(obj) (GTK_CHECK_TYPE ((obj), E_SUMMARY_TYPE)) -#define IS_E_SUMMARY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_SUMMARY_TYPE)) - -typedef struct _ESummaryPrivate ESummaryPrivate; -typedef struct _ESummary ESummary; -typedef struct _ESummaryClass ESummaryClass; -typedef struct _ESummaryWindow ESummaryWindow; - -struct _ESummaryWindow { - GNOME_Evolution_Summary_Component component; - - Bonobo_Control control; - GNOME_Evolution_Summary_HTMLView html; - - Bonobo_PersistStream persiststream; - Bonobo_PropertyBag propertybag; - Bonobo_PropertyControl propertycontrol; - Bonobo_EventSource event_source; - - /* Listener for the event_source */ - BonoboListener *listener; - int listener_id; - - char *iid; - char *title; - char *icon; - - ESummary *esummary; -}; - -struct _ESummary { - GtkVBox parent; - - ESummaryPrefs *prefs; - ESummaryPrefs *tmp_prefs; - ESummaryPrivate *private; -}; - -struct _ESummaryClass { - GtkVBoxClass parent_class; -}; - -GtkType e_summary_get_type (void); -GtkWidget *e_summary_new (const GNOME_Evolution_Shell shell); -void e_summary_queue_rebuild (ESummary *esummary); - -void e_summary_window_free (ESummaryWindow *window); -void e_summary_remove_window (ESummary *esummary, - ESummaryWindow *window); -ESummaryWindow *e_summary_add_service (ESummary *esummary, - GNOME_Evolution_Summary_Component component, - const char *iid); -ESummaryWindow * e_summary_embed_service_from_id (ESummary *esummary, - const char *obj_id); - -void e_summary_set_shell_view_interface (ESummary *summary, - GNOME_Evolution_ShellView svi); -void e_summary_set_message (ESummary *esummary, - const char *message, - gboolean busy); -void e_summary_unset_message (ESummary *esummary); -void e_summary_change_current_view (ESummary *esummary, - const char *uri); -void e_summary_set_title (ESummary *esummary, - const char *title); - -void e_summary_window_move_left (ESummary *esummary, - ESummaryWindow *window); -void e_summary_window_move_right (ESummary *esummary, - ESummaryWindow *window); -void e_summary_window_move_up (ESummary *esummary, - ESummaryWindow *window); -void e_summary_window_move_down (ESummary *esummary, - ESummaryWindow *window); -void e_summary_reconfigure (ESummary *esummary); - -#endif diff --git a/executive-summary/component/executive-summary-config.glade b/executive-summary/component/executive-summary-config.glade deleted file mode 100644 index 17fd9b0e69..0000000000 --- a/executive-summary/component/executive-summary-config.glade +++ /dev/null @@ -1,223 +0,0 @@ -<?xml version="1.0"?> -<GTK-Interface> - -<project> - <name>Project1</name> - <program_name>project1</program_name> - <directory></directory> - <source_directory>src</source_directory> - <pixmaps_directory>pixmaps</pixmaps_directory> - <language>C</language> - <gnome_support>True</gnome_support> - <gettext_support>True</gettext_support> - <use_widget_names>False</use_widget_names> - <output_main_file>True</output_main_file> - <output_support_files>True</output_support_files> - <output_build_files>True</output_build_files> - <backup_source_files>True</backup_source_files> - <main_source_file>interface.c</main_source_file> - <main_header_file>interface.h</main_header_file> - <handler_source_file>callbacks.c</handler_source_file> - <handler_header_file>callbacks.h</handler_header_file> - <support_source_file>support.c</support_source_file> - <support_header_file>support.h</support_header_file> - <translatable_strings_file></translatable_strings_file> -</project> - -<widget> - <class>GnomePropertyBox</class> - <name>summaryprefs</name> - <cxx_use_heap>True</cxx_use_heap> - - <widget> - <class>GtkNotebook</class> - <child_name>GnomePropertyBox:notebook</child_name> - <name>notebook1</name> - <border_width>2</border_width> - <cxx_use_heap>True</cxx_use_heap> - <can_focus>True</can_focus> - <show_tabs>True</show_tabs> - <show_border>True</show_border> - <tab_pos>GTK_POS_TOP</tab_pos> - <scrollable>False</scrollable> - <tab_hborder>2</tab_hborder> - <tab_vborder>2</tab_vborder> - <popup_enable>False</popup_enable> - <child> - <padding>0</padding> - <expand>True</expand> - <fill>True</fill> - </child> - - <widget> - <class>GtkVBox</class> - <name>vbox</name> - <border_width>2</border_width> - <cxx_use_heap>True</cxx_use_heap> - <homogeneous>False</homogeneous> - <spacing>8</spacing> - - <widget> - <class>Placeholder</class> - </widget> - - <widget> - <class>GtkFrame</class> - <name>frame1</name> - <border_width>2</border_width> - <cxx_use_heap>True</cxx_use_heap> - <label>Appearance</label> - <label_xalign>0</label_xalign> - <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> - <child> - <padding>0</padding> - <expand>True</expand> - <fill>True</fill> - </child> - - <widget> - <class>GtkVBox</class> - <name>vbox2</name> - <border_width>2</border_width> - <cxx_use_heap>True</cxx_use_heap> - <homogeneous>False</homogeneous> - <spacing>5</spacing> - - <widget> - <class>GtkHBox</class> - <name>hbox1</name> - <border_width>2</border_width> - <cxx_use_heap>True</cxx_use_heap> - <homogeneous>False</homogeneous> - <spacing>5</spacing> - <child> - <padding>0</padding> - <expand>True</expand> - <fill>True</fill> - </child> - - <widget> - <class>GtkLabel</class> - <name>label2</name> - <cxx_use_heap>True</cxx_use_heap> - <label>Background:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0.5</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <child> - <padding>0</padding> - <expand>False</expand> - <fill>False</fill> - </child> - </widget> - - <widget> - <class>GnomeFileEntry</class> - <name>htmlpage</name> - <cxx_use_heap>True</cxx_use_heap> - <max_saved>10</max_saved> - <directory>False</directory> - <modal>False</modal> - <child> - <padding>0</padding> - <expand>True</expand> - <fill>True</fill> - </child> - - <widget> - <class>GtkEntry</class> - <child_name>GnomeEntry:entry</child_name> - <name>combo-entry1</name> - <cxx_use_heap>True</cxx_use_heap> - <can_focus>True</can_focus> - <editable>True</editable> - <text_visible>True</text_visible> - <text_max_length>0</text_max_length> - <text></text> - </widget> - </widget> - </widget> - - <widget> - <class>GtkHBox</class> - <name>hbox2</name> - <border_width>2</border_width> - <cxx_use_heap>True</cxx_use_heap> - <homogeneous>False</homogeneous> - <spacing>5</spacing> - <child> - <padding>0</padding> - <expand>True</expand> - <fill>True</fill> - </child> - - <widget> - <class>GtkLabel</class> - <name>label3</name> - <cxx_use_heap>True</cxx_use_heap> - <label>Number of columns:</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0.5</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - <child> - <padding>0</padding> - <expand>False</expand> - <fill>False</fill> - </child> - </widget> - - <widget> - <class>GtkSpinButton</class> - <name>columnspinner</name> - <cxx_use_heap>True</cxx_use_heap> - <can_focus>True</can_focus> - <climb_rate>1</climb_rate> - <digits>0</digits> - <numeric>True</numeric> - <update_policy>GTK_UPDATE_ALWAYS</update_policy> - <snap>False</snap> - <wrap>False</wrap> - <value>1</value> - <lower>1</lower> - <upper>100</upper> - <step>1</step> - <page>10</page> - <page_size>10</page_size> - <child> - <padding>0</padding> - <expand>True</expand> - <fill>True</fill> - </child> - </widget> - </widget> - </widget> - </widget> - - <widget> - <class>Placeholder</class> - </widget> - </widget> - - <widget> - <class>GtkLabel</class> - <child_name>Notebook:tab</child_name> - <name>Label</name> - <cxx_use_heap>True</cxx_use_heap> - <label>General</label> - <justify>GTK_JUSTIFY_CENTER</justify> - <wrap>False</wrap> - <xalign>0.5</xalign> - <yalign>0.5</yalign> - <xpad>0</xpad> - <ypad>0</ypad> - </widget> - </widget> -</widget> - -</GTK-Interface> diff --git a/executive-summary/component/executive-summary.png b/executive-summary/component/executive-summary.png Binary files differdeleted file mode 100644 index 10a122f39e..0000000000 --- a/executive-summary/component/executive-summary.png +++ /dev/null diff --git a/executive-summary/component/main.c b/executive-summary/component/main.c deleted file mode 100644 index e5e45632f1..0000000000 --- a/executive-summary/component/main.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * main.c: The core of the executive summary component. - * - * 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: Iain Holmes <iain@helixcode.com> - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <glib.h> -#include <libgnome/gnome-defs.h> -#include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-init.h> -#include <bonobo/bonobo-main.h> -#include <liboaf/liboaf.h> -#include <glade/glade.h> - -#ifdef GTKHTML_HAVE_GCONF -#include <gconf/gconf.h> -#endif - -#include "gal/widgets/e-gui-utils.h" -#include "gal/widgets/e-cursors.h" - -#include <libgnomevfs/gnome-vfs.h> -#include "component-factory.h" - -int -main (int argc, - char **argv) -{ - CORBA_ORB orb; - - bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR); - textdomain (PACKAGE); - - gnome_init_with_popt_table ("evolution-executive-summary", VERSION, - argc, argv, oaf_popt_options, 0, NULL); - orb = oaf_init (argc, argv); - - gdk_rgb_init (); - glade_gnome_init (); - if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) { - g_error (_("Executive summary component could not initialize Bonobo.\n" - "If there was a warning message about the " - "RootPOA, it probably means\nyou compiled " - "Bonobo against GOAD instead of OAF.")); - } - -#ifdef GTKHTML_HAVE_GCONF - gconf_init (argc, argv, NULL); -#endif - - e_cursors_init (); - - component_factory_init (); - - gnome_vfs_init (); - bonobo_main (); - - return 0; -} diff --git a/executive-summary/default-header.html b/executive-summary/default-header.html deleted file mode 100644 index 64fc119ea6..0000000000 --- a/executive-summary/default-header.html +++ /dev/null @@ -1,14 +0,0 @@ -<html> -<head> -<title>Evolution - Executive Summary</title> -</head> - -<body bgcolor="#ffffff"> -<table> -<tr valign="center"> -<td align="right"><img src="executive-summary.png"></td> -</tr> -</table> -</body> -</html> - diff --git a/executive-summary/evolution-services/.cvsignore b/executive-summary/evolution-services/.cvsignore deleted file mode 100644 index d9807cd94f..0000000000 --- a/executive-summary/evolution-services/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -Executive-Summary.h -Executive-Summary-common.c -Executive-Summary-skels.c -Executive-Summary-stubs.c -Makefile.in -Makefile -core -.deps -.libs -*.lo -*.la
\ No newline at end of file diff --git a/executive-summary/evolution-services/Makefile.am b/executive-summary/evolution-services/Makefile.am deleted file mode 100644 index 5ffc39d70d..0000000000 --- a/executive-summary/evolution-services/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -lib_LTLIBRARIES = libevolution-services.la - -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_builddir)/shell \ - -I$(top_srcdir)/shell \ - -I$(top_srcdir)/executive-summary \ - -I$(top_builddir)/executive-summary \ - $(EXTRA_GNOME_CFLAGS) \ - $(GNOME_VFS_CFLAGS) \ - $(GTKHTML_CFLAGS) \ - -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ - -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ - -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ - -DEVOLUTION_DATADIR=\""$(datadir)"\" \ - -DG_LOG_DOMAIN=\"evolution-services\" - -IDL_GENERATED = \ - Executive-Summary.h \ - Executive-Summary-common.c \ - Executive-Summary-skels.c \ - Executive-Summary-stubs.c - -Executive-Summary-impl.o: Executive-Summary.h - -IDLS = \ - $(srcdir)/../idl/Executive-Summary.idl \ - $(srcdir)/../idl/Summary.idl \ - $(srcdir)/../idl/SummaryComponent.idl \ - $(srcdir)/../idl/HtmlView.idl - -$(IDL_GENERATED): $(IDLS) - $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \ - $(srcdir)/../idl/Executive-Summary.idl - -libevolution_services_la_SOURCES = \ - $(IDL_GENERATED) \ - executive-summary-component.c \ - executive-summary-component.h \ - executive-summary-component-factory-client.c \ - executive-summary-component-factory-client.h \ - executive-summary-html-view.c \ - executive-summary-html-view.h - -libevolution_services_la_LIBADD = \ - $(top_builddir)/e-util/libeutil.la \ - $(BONOBO_VFS_GNOME_LIBS) \ - $(EXTRA_GNOME_LIBS) \ - $(GTKHTML_LIBS) - -BUILT_SOURCES = $(IDL_GENERATED) -CLEANFILES += $(BUILT_SOURCES) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) diff --git a/executive-summary/evolution-services/executive-summary-client.c b/executive-summary/evolution-services/executive-summary-client.c deleted file mode 100644 index b28fbc38ad..0000000000 --- a/executive-summary/evolution-services/executive-summary-client.c +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-client.c - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gal/util/e-util.h> - -#include "Executive-Summary.h" -#include "executive-summary-client.h" -#include "executive-summary-component.h" - -#define PARENT_TYPE BONOBO_OBJECT_CLIENT_TYPE -static BonoboObjectClass *parent_class = NULL; - -struct _ExecutiveSummaryClientPrivate { - int dummy; -}; - -static void -executive_summary_client_destroy (GtkObject *object) -{ - ExecutiveSummaryClient *client; - ExecutiveSummaryClientPrivate *priv; - - client = EXECUTIVE_SUMMARY_CLIENT (object); - priv = client->private; - - if (priv == NULL) - return; - - g_free (priv); - client->private = NULL; - - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} - -static void -executive_summary_client_init (ExecutiveSummaryClient *client) -{ - ExecutiveSummaryClientPrivate *priv; - - priv = g_new0 (ExecutiveSummaryClientPrivate, 1); - client->private = priv; -} - -static void -executive_summary_client_class_init (ExecutiveSummaryClientClass *client) -{ - GtkObjectClass *object_class; - - object_class = GTK_OBJECT_CLASS (client); - parent_class = gtk_type_class (PARENT_TYPE); - - object_class->destroy = executive_summary_client_destroy; -} - -void -executive_summary_client_construct (ExecutiveSummaryClient *client, - CORBA_Object corba_object) -{ - g_return_if_fail (client != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_CLIENT (client)); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - - bonobo_object_client_construct (BONOBO_OBJECT_CLIENT (client), corba_object); -} - -E_MAKE_TYPE (executive_summary_client, "ExecutiveSummaryClient", - ExecutiveSummaryClient, executive_summary_client_class_init, - executive_summary_client_init, PARENT_TYPE); - -void -executive_summary_client_set_title (ExecutiveSummaryClient *client, - int id, - const char *title) -{ - GNOME_Evolution_Summary_ViewFrame summary; - CORBA_Environment ev; - - CORBA_exception_init (&ev); - summary = bonobo_object_corba_objref (BONOBO_OBJECT (client)); - - GNOME_Evolution_Summary_ViewFrame_setTitle (summary, id, title, &ev); - - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error setting title to %s:%s", title, CORBA_exception_id (&ev)); - } - - CORBA_exception_free (&ev); -} - -void -executive_summary_client_set_icon (ExecutiveSummaryClient *client, - int id, - const char *icon) -{ - GNOME_Evolution_Summary_ViewFrame summary; - CORBA_Environment ev; - - CORBA_exception_init (&ev); - summary = bonobo_object_corba_objref (BONOBO_OBJECT (client)); - - GNOME_Evolution_Summary_ViewFrame_setIcon (summary, id, icon, &ev); - - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error setting icon to %s:%s", icon, CORBA_exception_id (&ev)); - } - - CORBA_exception_free (&ev); -} - -void -executive_summary_client_flash (ExecutiveSummaryClient *client, - int id) -{ - GNOME_Evolution_Summary_ViewFrame summary; - CORBA_Environment ev; - - CORBA_exception_init (&ev); - summary = bonobo_object_corba_objref (BONOBO_OBJECT (client)); - - GNOME_Evolution_Summary_ViewFrame_flash (summary, id, &ev); - - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error flashing"); - } - - CORBA_exception_free (&ev); -} - -void -executive_summary_client_update (ExecutiveSummaryClient *client, - int id, - const char *html) -{ - GNOME_Evolution_Summary_ViewFrame summary; - CORBA_Environment ev; - - CORBA_exception_init (&ev); - summary = bonobo_object_corba_objref (BONOBO_OBJECT (client)); - - GNOME_Evolution_Summary_ViewFrame_updateComponent (summary, id, html, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error updating the component"); - } - - CORBA_exception_free (&ev); -} - - diff --git a/executive-summary/evolution-services/executive-summary-client.h b/executive-summary/evolution-services/executive-summary-client.h deleted file mode 100644 index da43a560bf..0000000000 --- a/executive-summary/evolution-services/executive-summary-client.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-client.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _EXECUTIVE_SUMMARY_CLIENT_H__ -#define _EXECUTIVE_SUMMARY_CLIENT_H__ - -#include <bonobo/bonobo-object.h> -#include <evolution-services/executive-summary-component.h> - -#define EXECUTIVE_SUMMARY_CLIENT_TYPE (executive_summary_client_get_type ()) -#define EXECUTIVE_SUMMARY_CLIENT(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_CLIENT_TYPE, ExecutiveSummaryClient)) -#define EXECUTIVE_SUMMARY_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_CLIENT_TYPE, ExecutiveSummaryClientClass)) -#define IS_EXECUTIVE_SUMMARY_CLIENT(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_CLIENT_TYPE)) -#define IS_EXECUTIVE_SUMMARY_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_CLIENT_TYPE)) - -typedef struct _ExecutiveSummaryClientPrivate ExecutiveSummaryClientPrivate; -typedef struct _ExecutiveSummaryClient ExecutiveSummaryClient; -typedef struct _ExecutiveSummaryClientClass ExecutiveSummaryClientClass; - -struct _ExecutiveSummaryClient { - BonoboObjectClient parent; - - ExecutiveSummaryClientPrivate *private; -}; - -struct _ExecutiveSummaryClientClass { - BonoboObjectClientClass parent_class; -}; - -GtkType executive_summary_client_get_type (void); -void executive_summary_client_construct (ExecutiveSummaryClient *client, - CORBA_Object object); -void executive_summary_client_set_title (ExecutiveSummaryClient *client, - int id, - const char *title); -void executive_summary_client_set_icon (ExecutiveSummaryClient *client, - int id, - const char *icon); -void executive_summary_client_flash (ExecutiveSummaryClient *client, - int id); -void executive_summary_client_update (ExecutiveSummaryClient *client, - int id, - const char *html); - -#endif diff --git a/executive-summary/evolution-services/executive-summary-component-client.c b/executive-summary/evolution-services/executive-summary-component-client.c deleted file mode 100644 index ecd4c0d1e9..0000000000 --- a/executive-summary/evolution-services/executive-summary-component-client.c +++ /dev/null @@ -1,178 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-component-client.c - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gal/util/e-util.h> - -#include <liboaf/liboaf.h> - -#include <Executive-Summary.h> -#include "executive-summary-component-client.h" -#include "executive-summary.h" - -#define PARENT_TYPE BONOBO_OBJECT_CLIENT_TYPE -static BonoboObjectClass *parent_class = NULL; - -struct _ExecutiveSummaryComponentClientPrivate { - int dummy; -}; - -static void -executive_summary_component_client_destroy (GtkObject *object) -{ - ExecutiveSummaryComponentClient *client; - ExecutiveSummaryComponentClientPrivate *priv; - - client = EXECUTIVE_SUMMARY_COMPONENT_CLIENT (object); - priv = client->private; - - if (priv == NULL) - return; - - g_free (priv); - client->private = NULL; - - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} - -static void -executive_summary_component_client_init (ExecutiveSummaryComponentClient *client) -{ - ExecutiveSummaryComponentClientPrivate *priv; - - priv = g_new0 (ExecutiveSummaryComponentClientPrivate, 1); - client->private = priv; -} - -static void -executive_summary_component_client_class_init (ExecutiveSummaryComponentClientClass *klass) -{ - GtkObjectClass *object_class; - - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = executive_summary_component_client_destroy; - - parent_class = gtk_type_class (PARENT_TYPE); -} - -void -executive_summary_component_client_construct (ExecutiveSummaryComponentClient *client, - CORBA_Object corba_object) -{ - g_return_if_fail (client != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT (client)); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - - bonobo_object_client_construct (BONOBO_OBJECT_CLIENT (client), corba_object); -} - -ExecutiveSummaryComponentClient* -executive_summary_component_client_new (const char *id) -{ - ExecutiveSummaryComponentClient *client; - CORBA_Environment ev; - CORBA_Object corba_object; - - g_return_val_if_fail (id != NULL, NULL); - - CORBA_exception_init (&ev); - - corba_object = oaf_activate_from_id ((char *)id, 0, NULL, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - g_warning ("Could not start %s\n", id); - return NULL; - } - - CORBA_exception_free (&ev); - - if (corba_object == CORBA_OBJECT_NIL) { - g_warning ("Could not activate %s\n", id); - return NULL; - } - - client = gtk_type_new (executive_summary_component_client_get_type ()); - executive_summary_component_client_construct (client, corba_object); - - return client; -} - -/* External API */ -void -executive_summary_component_client_set_owner (ExecutiveSummaryComponentClient *client, - ExecutiveSummary *summary) -{ - GNOME_Evolution_Summary_Component component; - GNOME_Evolution_Summary_ViewFrame corba_object; - CORBA_Environment ev; - - g_return_if_fail (client != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT (client)); - g_return_if_fail (summary != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY (summary)); - - CORBA_exception_init (&ev); - component = bonobo_object_corba_objref (BONOBO_OBJECT (client)); - corba_object = bonobo_object_corba_objref (BONOBO_OBJECT (summary)); - - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - GNOME_Evolution_Summary_Component_setOwner (component, corba_object, &ev); - - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error setting owner"); - } - - CORBA_exception_free (&ev); - return; -} - -void -executive_summary_component_client_unset_owner (ExecutiveSummaryComponentClient *client) -{ - GNOME_Evolution_Summary_Component component; - CORBA_Environment ev; - - g_return_if_fail (client != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT (client)); - - CORBA_exception_init (&ev); - component = bonobo_object_corba_objref (BONOBO_OBJECT (client)); - - GNOME_Evolution_Summary_Component_unsetOwner (component, &ev); - - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error unsetting owner"); - } - - CORBA_exception_free (&ev); - return; -} - -E_MAKE_TYPE (executive_summary_component_client, - "ExecutiveSummaryComponentClient", - ExecutiveSummaryComponentClient, - executive_summary_component_client_class_init, - executive_summary_component_client_init, PARENT_TYPE) diff --git a/executive-summary/evolution-services/executive-summary-component-client.h b/executive-summary/evolution-services/executive-summary-component-client.h deleted file mode 100644 index 5f1f702550..0000000000 --- a/executive-summary/evolution-services/executive-summary-component-client.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-component-client.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _EXECUTIVE_SUMMARY_COMPONENT_CLIENT_H__ -#define _EXECUTIVE_SUMMARY_COMPONENT_CLIENT_H__ - -#include <bonobo/bonobo-object.h> -#include <evolution-services/executive-summary.h> -#include <evolution-services/executive-summary-component-view.h> - -#define EXECUTIVE_SUMMARY_COMPONENT_CLIENT_TYPE (executive_summary_component_client_get_type ()) -#define EXECUTIVE_SUMMARY_COMPONENT_CLIENT(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_COMPONENT_CLIENT_TYPE, ExecutiveSummaryComponentClient)) -#define EXECUTIVE_SUMMARY_COMPONENT_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_COMPONENT_CLIENT_TYPE, ExecutiveSummaryComponentClientClass)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_CLIENT_TYPE)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_CLIENT_TYPE)) - -typedef struct _ExecutiveSummaryComponentClientPrivate ExecutiveSummaryComponentClientPrivate; -typedef struct _ExecutiveSummaryComponentClient ExecutiveSummaryComponentClient; -typedef struct _ExecutiveSummaryComponentClientClass ExecutiveSummaryComponentClientClass; - -struct _ExecutiveSummaryComponentClient { - BonoboObjectClient parent; - - ExecutiveSummaryComponentClientPrivate *private; -}; - -struct _ExecutiveSummaryComponentClientClass { - BonoboObjectClientClass parent_class; -}; - -GtkType executive_summary_component_client_get_type (void); -ExecutiveSummaryComponentClient *executive_summary_component_client_new (const char *id); - -void executive_summary_component_client_set_owner (ExecutiveSummaryComponentClient *client, - ExecutiveSummary *summary); -void executive_summary_component_client_unset_owner (ExecutiveSummaryComponentClient *client); - -void executive_summary_component_client_supports (ExecutiveSummaryComponentClient *client, - gboolean *bonobo, - gboolean *html); - -void executive_summary_component_client_configure (ExecutiveSummaryComponentClient *client, - ExecutiveSummaryComponentView *view); -void executive_summary_component_client_destroy_view (ExecutiveSummaryComponentClient *client, - ExecutiveSummaryComponentView *view); - -#endif - diff --git a/executive-summary/evolution-services/executive-summary-component-factory-client.c b/executive-summary/evolution-services/executive-summary-component-factory-client.c deleted file mode 100644 index 5b10f9ed1a..0000000000 --- a/executive-summary/evolution-services/executive-summary-component-factory-client.c +++ /dev/null @@ -1,178 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-component-factory-client.c - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gal/util/e-util.h> - -#include <liboaf/liboaf.h> - -#include <Executive-Summary.h> -#include "executive-summary-component-factory-client.h" - -#define PARENT_TYPE BONOBO_OBJECT_CLIENT_TYPE -static BonoboObjectClass *parent_class = NULL; - -struct _ExecutiveSummaryComponentFactoryClientPrivate { - int dummy; -}; - -static void -executive_summary_component_factory_client_destroy (GtkObject *object) -{ - ExecutiveSummaryComponentFactoryClient *client; - ExecutiveSummaryComponentFactoryClientPrivate *priv; - - client = EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT (object); - priv = client->private; - - if (priv == NULL) - return; - - g_free (priv); - client->private = NULL; - - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} - -static void -executive_summary_component_factory_client_init (ExecutiveSummaryComponentFactoryClient *client) -{ - ExecutiveSummaryComponentFactoryClientPrivate *priv; - - priv = g_new0 (ExecutiveSummaryComponentFactoryClientPrivate, 1); - client->private = priv; -} - -static void -executive_summary_component_factory_client_class_init (ExecutiveSummaryComponentFactoryClientClass *klass) -{ - GtkObjectClass *object_class; - - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = executive_summary_component_factory_client_destroy; - - parent_class = gtk_type_class (PARENT_TYPE); -} - -E_MAKE_TYPE (executive_summary_component_factory_client, - "ExecutiveSummaryComponentFactoryClient", - ExecutiveSummaryComponentFactoryClient, - executive_summary_component_factory_client_class_init, - executive_summary_component_factory_client_init, PARENT_TYPE) - - -/*** Public API ***/ -/** - * executive_summary_component_factory_client_construct: - * @client: The ExecutiveSummaryComponentFactoryClient to construct. - * @corba_object: The CORBA_Object to construct it from. - * - * Constructs a client from the given CORBA_Object. - */ -void -executive_summary_component_factory_client_construct (ExecutiveSummaryComponentFactoryClient *client, - CORBA_Object corba_object) -{ - g_return_if_fail (client != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT (client)); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - - bonobo_object_client_construct (BONOBO_OBJECT_CLIENT (client), corba_object); -} - -/** - * executive_summary_component_factory_client_new: - * @id: The OAFIID of the component to activate. - * - * Activates the component specified by @id, and creates a server side client - * for that object. - * - * Returns: A pointer to an ExecutiveSummaryComponentFactoryClient object. - */ -ExecutiveSummaryComponentFactoryClient * -executive_summary_component_factory_client_new (const char *id) -{ - ExecutiveSummaryComponentFactoryClient *client; - CORBA_Environment ev; - CORBA_Object corba_object; - - g_return_val_if_fail (id != NULL, NULL); - - CORBA_exception_init (&ev); - - corba_object = oaf_activate_from_id ((char *)id, 0, NULL, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - CORBA_exception_free (&ev); - g_warning ("Could not start %s\n", id); - return NULL; - } - - CORBA_exception_free (&ev); - - if (corba_object == CORBA_OBJECT_NIL) { - g_warning ("Could not activate %s\n", id); - return NULL; - } - - client = gtk_type_new (executive_summary_component_factory_client_get_type ()); - executive_summary_component_factory_client_construct (client, - corba_object); - - return client; -} - -/** - * executive_summary_component_factory_client_create_view: - * @client: The client on which to create the view. - * - * Creates a new view of a remote component. - * - * Returns: A GNOME_Evolution_Summary_Component. - */ -GNOME_Evolution_Summary_Component -executive_summary_component_factory_client_create_view (ExecutiveSummaryComponentFactoryClient *client) -{ - GNOME_Evolution_Summary_ComponentFactory factory; - GNOME_Evolution_Summary_Component component; - CORBA_Environment ev; - - g_return_val_if_fail (client != NULL, CORBA_OBJECT_NIL); - g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT (client), - CORBA_OBJECT_NIL); - - CORBA_exception_init (&ev); - factory = bonobo_object_corba_objref (BONOBO_OBJECT (client)); - - component = GNOME_Evolution_Summary_ComponentFactory_createView (factory, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Error creating view: %s", CORBA_exception_id (&ev)); - CORBA_exception_free (&ev); - return CORBA_OBJECT_NIL; - } - - CORBA_exception_free (&ev); - return component; -} diff --git a/executive-summary/evolution-services/executive-summary-component-factory-client.h b/executive-summary/evolution-services/executive-summary-component-factory-client.h deleted file mode 100644 index 80b4400c82..0000000000 --- a/executive-summary/evolution-services/executive-summary-component-factory-client.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-component-factory-client.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_H__ -#define _EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_H__ - -#include <bonobo/bonobo-object-client.h> - -#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE (executive_summary_component_factory_client_get_type ()) -#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE, ExecutiveSummaryComponentFactoryClient)) -#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE, ExecutiveSummaryComponentFactoryClientClass)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLIENT_TYPE)) - -typedef struct _ExecutiveSummaryComponentFactoryClientPrivate ExecutiveSummaryComponentFactoryClientPrivate; -typedef struct _ExecutiveSummaryComponentFactoryClient ExecutiveSummaryComponentFactoryClient; -typedef struct _ExecutiveSummaryComponentFactoryClientClass ExecutiveSummaryComponentFactoryClientClass; - -struct _ExecutiveSummaryComponentFactoryClient { - BonoboObjectClient parent; - - ExecutiveSummaryComponentFactoryClientPrivate *private; -}; - -struct _ExecutiveSummaryComponentFactoryClientClass { - BonoboObjectClientClass parent_class; -}; - -GtkType executive_summary_component_factory_client_get_type (void); - -void executive_summary_component_factory_client_construct (ExecutiveSummaryComponentFactoryClient *client, - CORBA_Object corba_object); -ExecutiveSummaryComponentFactoryClient *executive_summary_component_factory_client_new (const char *id); -CORBA_Object executive_summary_component_factory_client_create_view (ExecutiveSummaryComponentFactoryClient *client); - -#endif - diff --git a/executive-summary/evolution-services/executive-summary-component-view.c b/executive-summary/evolution-services/executive-summary-component-view.c deleted file mode 100644 index a5600caf6d..0000000000 --- a/executive-summary/evolution-services/executive-summary-component-view.c +++ /dev/null @@ -1,401 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-component.c - Bonobo implementation of - * SummaryComponent.idl - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gal/util/e-util.h> - -#include <evolution-services/executive-summary-component.h> -#include <evolution-services/executive-summary-component-view.h> - -struct _ExecutiveSummaryComponentViewPrivate { - ExecutiveSummaryComponent *component; - - BonoboControl *control; - Bonobo_Control objref; - - char *html; - - char *title; - char *icon; - - int id; -}; - -static GtkObjectClass *parent_class = NULL; -#define PARENT_TYPE (gtk_object_get_type ()) - -enum { - CONFIGURE, - LAST_SIGNAL -}; - -static gint32 view_signals[LAST_SIGNAL] = { 0 }; - -static void -executive_summary_component_view_destroy (GtkObject *object) -{ - ExecutiveSummaryComponentView *view; - ExecutiveSummaryComponentViewPrivate *priv; - - view = EXECUTIVE_SUMMARY_COMPONENT_VIEW (object); - priv = view->private; - if (priv == NULL) - return; - - if (priv->component) - bonobo_object_unref (BONOBO_OBJECT (priv->component)); - - if (priv->control) - bonobo_object_unref (BONOBO_OBJECT (priv->control)); - - g_free (priv->html); - g_free (priv->title); - g_free (priv->icon); - - g_free (priv); - view->private = NULL; - - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} - -static void -executive_summary_component_view_class_init (ExecutiveSummaryComponentViewClass *view_class) -{ - GtkObjectClass *object_class; - - object_class = GTK_OBJECT_CLASS (view_class); - - object_class->destroy = executive_summary_component_view_destroy; - - view_signals[CONFIGURE] = gtk_signal_new ("configure", - GTK_RUN_FIRST, - object_class->type, - GTK_SIGNAL_OFFSET (ExecutiveSummaryComponentViewClass, configure), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - gtk_object_class_add_signals (object_class, view_signals, LAST_SIGNAL); - - parent_class = gtk_type_class (PARENT_TYPE); -} - -static void -executive_summary_component_view_init (ExecutiveSummaryComponentView *view) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - priv = g_new (ExecutiveSummaryComponentViewPrivate, 1); - view->private = priv; - - priv->control = NULL; - priv->objref = NULL; - priv->html = NULL; - priv->title = NULL; - priv->icon = NULL; - priv->id = -1; -} - -E_MAKE_TYPE (executive_summary_component_view, "ExecutiveSummaryComponentView", - ExecutiveSummaryComponentView, - executive_summary_component_view_class_init, - executive_summary_component_view_init, PARENT_TYPE); - -void -executive_summary_component_view_construct (ExecutiveSummaryComponentView *view, - ExecutiveSummaryComponent *component, - BonoboControl *control, - const char *html, - const char *title, - const char *icon) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - g_return_if_fail (view != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - g_return_if_fail (control != NULL || html != NULL); - - priv = view->private; - - if (component != NULL) { - bonobo_object_ref (BONOBO_OBJECT (component)); - priv->component = component; - } else { - priv->component = NULL; - } - - if (control != NULL) { - bonobo_object_ref (BONOBO_OBJECT (control)); - priv->control = control; - } else { - priv->control = NULL; - } - - if (html) { - priv->html = g_strdup (html); - } else { - priv->html = NULL; - } - - if (title) { - priv->title = g_strdup (title); - } else { - priv->title = NULL; - } - - if (icon) { - priv->icon = g_strdup (icon); - } else { - priv->icon = NULL; - } -} - -ExecutiveSummaryComponentView * -executive_summary_component_view_new (ExecutiveSummaryComponent *component, - BonoboControl *control, - const char *html, - const char *title, - const char *icon) -{ - ExecutiveSummaryComponentView *view; - - g_return_val_if_fail (control != NULL || html != NULL, NULL); - - view = gtk_type_new (executive_summary_component_view_get_type ()); - executive_summary_component_view_construct (view, component, control, - html, title, icon); - - return view; -} - -void -executive_summary_component_view_set_title (ExecutiveSummaryComponentView *view, - const char *title) -{ - ExecutiveSummaryComponentViewPrivate *priv; - ExecutiveSummaryComponent *component; - - g_return_if_fail (view != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - - priv = view->private; - if (priv->title) - g_free (priv->title); - priv->title = g_strdup (title); - - component = priv->component; - if (component == NULL) { - return; - } - - executive_summary_component_set_title (component, view); -} - -const char * -executive_summary_component_view_get_title (ExecutiveSummaryComponentView *view) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - g_return_val_if_fail (view != NULL, NULL); - g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view), NULL); - - priv = view->private; - - return priv->title; -} - -void -executive_summary_component_view_set_icon (ExecutiveSummaryComponentView *view, - const char *icon) -{ - ExecutiveSummaryComponentViewPrivate *priv; - ExecutiveSummaryComponent *component; - - g_return_if_fail (view != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - - priv = view->private; - if (priv->icon) - g_free (priv->icon); - priv->icon = g_strdup (icon); - - component = priv->component; - if (component == NULL) { - return; - } - - executive_summary_component_set_icon (component, view); -} - -const char * -executive_summary_component_view_get_icon (ExecutiveSummaryComponentView *view) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - g_return_val_if_fail (view != NULL, NULL); - g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view), NULL); - - priv = view->private; - - return priv->icon; -} - -void -executive_summary_component_view_flash (ExecutiveSummaryComponentView *view) -{ - ExecutiveSummaryComponentViewPrivate *priv; - ExecutiveSummaryComponent *component; - - g_return_if_fail (view != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - - priv = view->private; - component = priv->component; - if (component == NULL) { - g_warning ("Calling %s from the wrong side of the CORBA interface", __FUNCTION__); - return; - } - - executive_summary_component_flash (component, view); -} - -void -executive_summary_component_view_set_html (ExecutiveSummaryComponentView *view, - const char *html) -{ - ExecutiveSummaryComponentViewPrivate *priv; - ExecutiveSummaryComponent *component; - - g_return_if_fail (view != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - - priv = view->private; - if (priv->html) - g_free (priv->html); - - priv->html = g_strdup (html); - - component = priv->component; - if (component == NULL) { - return; - } - - executive_summary_component_update (component, view); -} - -void -executive_summary_component_view_configure (ExecutiveSummaryComponentView *view) -{ - gtk_signal_emit (GTK_OBJECT (view), view_signals[CONFIGURE]); -} - -const char * -executive_summary_component_view_get_html (ExecutiveSummaryComponentView *view) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - g_return_val_if_fail (view != NULL, NULL); - g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view), NULL); - - priv = view->private; - - return priv->html; -} - -BonoboObject * -executive_summary_component_view_get_control (ExecutiveSummaryComponentView *view) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - g_return_val_if_fail (view != NULL, NULL); - g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view), NULL); - - priv = view->private; - - return (BonoboObject *)priv->control; -} - -void -executive_summary_component_view_set_id (ExecutiveSummaryComponentView *view, - int id) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - g_return_if_fail (view != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - - priv = view->private; - - priv->id = id; -} - -int -executive_summary_component_view_get_id (ExecutiveSummaryComponentView *view) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - g_return_val_if_fail (view != NULL, -1); - g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view), -1); - - priv = view->private; - - return priv->id; -} - -void -executive_summary_component_view_set_objref (ExecutiveSummaryComponentView *view, - Bonobo_Control objref) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - g_return_if_fail (view != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view)); - - priv = view->private; - - if (priv->objref) { - g_warning ("View already has an objref."); - return; - } - - priv->objref = objref; -} - -GtkWidget * -executive_summary_component_view_get_widget (ExecutiveSummaryComponentView *view) -{ - ExecutiveSummaryComponentViewPrivate *priv; - - g_return_val_if_fail (view != NULL, NULL); - g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW (view), NULL); - - priv = view->private; - if (priv->objref == NULL) { - g_warning ("View has no objref."); - return NULL; - } - - return bonobo_widget_new_control_from_objref (priv->objref, NULL); -} diff --git a/executive-summary/evolution-services/executive-summary-component-view.h b/executive-summary/evolution-services/executive-summary-component-view.h deleted file mode 100644 index c18f77dcf4..0000000000 --- a/executive-summary/evolution-services/executive-summary-component-view.h +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-component.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef __EXECUTIVE_SUMMARY_COMPONENT_VIEW_H__ -#define __EXECUTIVE_SUMMARY_COMPONENT_VIEW_H__ - -#include <bonobo/bonobo-control.h> -#include <evolution-services/executive-summary-component.h> - -#define EXECUTIVE_SUMMARY_COMPONENT_VIEW_TYPE (executive_summary_component_view_get_type ()) -#define EXECUTIVE_SUMMARY_COMPONENT_VIEW(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_COMPONENT_VIEW_TYPE, ExecutiveSummaryComponentView)) -#define EXECUTIVE_SUMMARY_COMPONENT_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_COMPONENT_VIEW_TYPE, ExecutiveSummaryComponentClass)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_VIEW_TYPE)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_VIEW_CLASS_TYPE)) - -typedef struct _ExecutiveSummaryComponentViewPrivate ExecutiveSummaryComponentViewPrivate; -typedef struct _ExecutiveSummaryComponentView ExecutiveSummaryComponentView; -typedef struct _ExecutiveSummaryComponentViewClass ExecutiveSummaryComponentViewClass; - -struct _ExecutiveSummaryComponentView { - GtkObject object; - - ExecutiveSummaryComponentViewPrivate *private; -}; - -struct _ExecutiveSummaryComponentViewClass { - GtkObjectClass parent_class; - - /* Signals */ - void (* configure) (ExecutiveSummaryComponentView *view); -}; - -GtkType executive_summary_component_view_get_type (void); -void -executive_summary_component_view_construct (ExecutiveSummaryComponentView *view, - ExecutiveSummaryComponent *component, - BonoboControl *control, - const char *html, - const char *title, - const char *icon); -ExecutiveSummaryComponentView * -executive_summary_component_view_new (ExecutiveSummaryComponent *component, - BonoboControl *control, - const char *html, - const char *title, - const char *icon); - -void executive_summary_component_view_set_title (ExecutiveSummaryComponentView *view, - const char *title); -const char *executive_summary_component_view_get_title (ExecutiveSummaryComponentView *view); - -void executive_summary_component_view_set_icon (ExecutiveSummaryComponentView *view, - const char *icon); -const char *executive_summary_component_view_get_icon (ExecutiveSummaryComponentView *view); - -void executive_summary_component_view_flash (ExecutiveSummaryComponentView *view); - -void executive_summary_component_view_set_html (ExecutiveSummaryComponentView *view, - const char *html); -const char *executive_summary_component_view_get_html (ExecutiveSummaryComponentView *view); -BonoboObject *executive_summary_component_view_get_control (ExecutiveSummaryComponentView *view); - -int executive_summary_component_view_get_id (ExecutiveSummaryComponentView *view); -void executive_summary_component_view_set_id (ExecutiveSummaryComponentView *view, - int id); -void executive_summary_component_view_configure (ExecutiveSummaryComponentView *view); -void executive_summary_component_view_set_objref (ExecutiveSummaryComponentView *view, - Bonobo_Control objref); -GtkWidget *executive_summary_component_view_get_widget (ExecutiveSummaryComponentView *view); - -#endif - - diff --git a/executive-summary/evolution-services/executive-summary-component.c b/executive-summary/evolution-services/executive-summary-component.c deleted file mode 100644 index c1fbf4f02b..0000000000 --- a/executive-summary/evolution-services/executive-summary-component.c +++ /dev/null @@ -1,354 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-component.c - Bonobo implementation of - * SummaryComponent.idl - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gal/util/e-util.h> - -#include "Executive-Summary.h" -#include "executive-summary-component.h" - -static void executive_summary_component_destroy (GtkObject *object); -static void executive_summary_component_init (ExecutiveSummaryComponent *component); -static void executive_summary_component_class_init (ExecutiveSummaryComponentClass *esc_class); - -#define PARENT_TYPE (bonobo_object_get_type ()) -#define FACTORY_PARENT_TYPE (bonobo_object_get_type ()) - -static BonoboObjectClass *parent_class; -static BonoboObjectClass *factory_parent_class; - -struct _ExecutiveSummaryComponentPrivate { - int dummy; -}; - -struct _ExecutiveSummaryComponentFactoryPrivate { - EvolutionServicesCreateViewFn create_view; - void *closure; -}; - -/* CORBA interface */ -static POA_GNOME_Evolution_Summary_Component__vepv SummaryComponent_vepv; -static POA_GNOME_Evolution_Summary_ComponentFactory__vepv ComponentFactory_vepv; - -static POA_GNOME_Evolution_Summary_Component * -create_servant (void) -{ - POA_GNOME_Evolution_Summary_Component *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_Summary_Component *)g_new0 (BonoboObjectServant, 1); - servant->vepv = &SummaryComponent_vepv; - - CORBA_exception_init (&ev); - POA_GNOME_Evolution_Summary_Component__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - return servant; -} - -static void -executive_summary_component_destroy (GtkObject *object) -{ - ExecutiveSummaryComponent *component; - ExecutiveSummaryComponentPrivate *priv; - - component = EXECUTIVE_SUMMARY_COMPONENT (object); - priv = component->private; - - if (priv == NULL) - return; - - g_free (priv); - component->private = NULL; - - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} - -/* Init */ -static void -corba_class_init (void) -{ - POA_GNOME_Evolution_Summary_Component__vepv *vepv; - POA_GNOME_Evolution_Summary_Component__epv *epv; - PortableServer_ServantBase__epv *base_epv; - - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; - - epv = g_new0 (POA_GNOME_Evolution_Summary_Component__epv, 1); - - vepv = &SummaryComponent_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_Summary_Component_epv = epv; -} - -static void -executive_summary_component_class_init (ExecutiveSummaryComponentClass *klass) -{ - GtkObjectClass *object_class; - - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = executive_summary_component_destroy; - - parent_class = gtk_type_class (PARENT_TYPE); - - corba_class_init (); -} - -static void -executive_summary_component_init (ExecutiveSummaryComponent *component) -{ - ExecutiveSummaryComponentPrivate *priv; - - priv = g_new (ExecutiveSummaryComponentPrivate, 1); - - component->private = priv; -} - -E_MAKE_TYPE (executive_summary_component, "ExecutiveSummaryComponent", - ExecutiveSummaryComponent, executive_summary_component_class_init, - executive_summary_component_init, PARENT_TYPE); - - -static void -executive_summary_component_construct (ExecutiveSummaryComponent *component, - GNOME_Evolution_Summary_Component corba_object) -{ - g_return_if_fail (component != NULL); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - - bonobo_object_construct (BONOBO_OBJECT (component), corba_object); -} - - -/*** Public API ***/ -/** - * executive_summary_component_new: - * - * Creates a BonoboObject that implements the Summary::Component interface. - * - * Returns: A pointer to a BonoboObject. - */ -BonoboObject * -executive_summary_component_new (void) -{ - ExecutiveSummaryComponent *component; - POA_GNOME_Evolution_Summary_Component *servant; - GNOME_Evolution_Summary_Component corba_object; - - servant = create_servant (); - if (servant == NULL) - return NULL; - - component = gtk_type_new (executive_summary_component_get_type ()); - corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (component), - servant); - - executive_summary_component_construct (component, corba_object); - - return BONOBO_OBJECT (component); -} - - -/**** ComponentFactory implementation ****/ - -static POA_GNOME_Evolution_Summary_ComponentFactory * -create_factory_servant (void) -{ - POA_GNOME_Evolution_Summary_ComponentFactory *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_Summary_ComponentFactory *)g_new0 (BonoboObjectServant, 1); - servant->vepv = &ComponentFactory_vepv; - - CORBA_exception_init (&ev); - POA_GNOME_Evolution_Summary_ComponentFactory__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - return servant; -} - -static GNOME_Evolution_Summary_Component -impl_GNOME_Evolution_Summary_ComponentFactory_createView (PortableServer_Servant servant, - CORBA_Environment *ev) -{ - BonoboObject *bonobo_object; - BonoboObject *view; - ExecutiveSummaryComponentFactory *factory; - ExecutiveSummaryComponentFactoryPrivate *priv; - GNOME_Evolution_Summary_Component component, component_dup; - - bonobo_object = bonobo_object_from_servant (servant); - factory = EXECUTIVE_SUMMARY_COMPONENT_FACTORY (bonobo_object); - priv = factory->private; - - view = (* priv->create_view) (factory, priv->closure); - g_return_val_if_fail (view != NULL, CORBA_OBJECT_NIL); - - component = bonobo_object_corba_objref (BONOBO_OBJECT (view)); - - component_dup = CORBA_Object_duplicate (component, ev); - - return component_dup; -} - -static void -corba_factory_init (void) -{ - POA_GNOME_Evolution_Summary_ComponentFactory__vepv *vepv; - POA_GNOME_Evolution_Summary_ComponentFactory__epv *epv; - PortableServer_ServantBase__epv *base_epv; - - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; - - epv = g_new0 (POA_GNOME_Evolution_Summary_ComponentFactory__epv, 1); - epv->createView = impl_GNOME_Evolution_Summary_ComponentFactory_createView; - - vepv = &ComponentFactory_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_Summary_ComponentFactory_epv = epv; -} - -/* GtkObject methods */ -static void -executive_summary_component_factory_destroy (GtkObject *object) -{ - ExecutiveSummaryComponentFactory *factory; - ExecutiveSummaryComponentFactoryPrivate *priv; - - factory = EXECUTIVE_SUMMARY_COMPONENT_FACTORY (object); - priv = factory->private; - - if (priv == NULL) - return; - - g_free (priv); - factory->private = NULL; - - (* GTK_OBJECT_CLASS (factory_parent_class)->destroy) (object); -} - -static void -executive_summary_component_factory_class_init (ExecutiveSummaryComponentFactoryClass *klass) -{ - GtkObjectClass *object_class; - - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = executive_summary_component_factory_destroy; - - factory_parent_class = gtk_type_class (FACTORY_PARENT_TYPE); - corba_factory_init (); -} - -static void -executive_summary_component_factory_init (ExecutiveSummaryComponentFactory *factory) -{ - ExecutiveSummaryComponentFactoryPrivate *priv; - - priv = g_new (ExecutiveSummaryComponentFactoryPrivate, 1); - - priv->create_view = NULL; - priv->closure = NULL; - factory->private = priv; -} - -E_MAKE_TYPE (executive_summary_component_factory, - "ExecutiveSummaryComponentFactory", - ExecutiveSummaryComponentFactory, - executive_summary_component_factory_class_init, - executive_summary_component_factory_init, FACTORY_PARENT_TYPE); - -static void -executive_summary_component_factory_construct (ExecutiveSummaryComponentFactory *factory, - GNOME_Evolution_Summary_ComponentFactory corba_object, - EvolutionServicesCreateViewFn create_view, - void *closure) -{ - ExecutiveSummaryComponentFactoryPrivate *priv; - - g_return_if_fail (factory != NULL); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - - bonobo_object_construct (BONOBO_OBJECT (factory), corba_object); - priv = factory->private; - - priv->create_view = create_view; - priv->closure = closure; -} - - -/*** Public API ***/ -/** - * executive_summary_component_factory_new: - * @create_view: A pointer to the function to create a new view. - * @closure: The data to be passed to the @create_view function when it is - * called. - * - * Creates a BonoboObject that implements the Summary::ComponentFactory - * interface. - * - * Returns: A pointer to a BonoboObject. - */ -BonoboObject * -executive_summary_component_factory_new (EvolutionServicesCreateViewFn create_view, - void *closure) -{ - ExecutiveSummaryComponentFactory *factory; - POA_GNOME_Evolution_Summary_ComponentFactory *servant; - GNOME_Evolution_Summary_ComponentFactory corba_object; - - servant = create_factory_servant (); - if (servant == NULL) - return NULL; - - factory = gtk_type_new (executive_summary_component_factory_get_type ()); - corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (factory), - servant); - executive_summary_component_factory_construct (factory, corba_object, - create_view, closure); - return BONOBO_OBJECT (factory); -} - diff --git a/executive-summary/evolution-services/executive-summary-component.h b/executive-summary/evolution-services/executive-summary-component.h deleted file mode 100644 index 8db4c1d9b8..0000000000 --- a/executive-summary/evolution-services/executive-summary-component.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-component.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _EXECUTIVE_SUMMARY_COMPONENT_H__ -#define _EXECUTIVE_SUMMARY_COMPONENT_H__ - -#include <gtk/gtksignal.h> -#include <bonobo/bonobo-object.h> - -#define EXECUTIVE_SUMMARY_COMPONENT_TYPE (executive_summary_component_get_type ()) -#define EXECUTIVE_SUMMARY_COMPONENT(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_COMPONENT_TYPE, ExecutiveSummaryComponent)) -#define EXECUTIVE_SUMMARY_COMPONENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_COMPONENT_TYPE, ExecutiveSummaryComponentClass)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_TYPE)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_TYPE)) - -typedef struct _ExecutiveSummaryComponentPrivate ExecutiveSummaryComponentPrivate; -typedef struct _ExecutiveSummaryComponent ExecutiveSummaryComponent; -typedef struct _ExecutiveSummaryComponentClass ExecutiveSummaryComponentClass; - -struct _ExecutiveSummaryComponent { - BonoboObject parent; - - ExecutiveSummaryComponentPrivate *private; -}; - -struct _ExecutiveSummaryComponentClass { - BonoboObjectClass parent_class; -}; - -GtkType executive_summary_component_get_type (void); - -BonoboObject *executive_summary_component_new (void); - - -/* Factory */ - -#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE (executive_summary_component_factory_get_type ()) -#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE, ExecutiveSummaryComponentFactory)) -#define EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE, ExecutiveSummaryComponentFactoryClass)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE)) -#define IS_EXECUTIVE_SUMMARY_COMPONENT_FACTORY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_COMPONENT_FACTORY_TYPE)) - -typedef struct _ExecutiveSummaryComponentFactoryPrivate ExecutiveSummaryComponentFactoryPrivate; -typedef struct _ExecutiveSummaryComponentFactory ExecutiveSummaryComponentFactory; -typedef struct _ExecutiveSummaryComponentFactoryClass ExecutiveSummaryComponentFactoryClass; - -typedef BonoboObject *(* EvolutionServicesCreateViewFn) (ExecutiveSummaryComponentFactory *factory, - void *closure); - -struct _ExecutiveSummaryComponentFactory { - BonoboObject parent; - - ExecutiveSummaryComponentFactoryPrivate *private; -}; - -struct _ExecutiveSummaryComponentFactoryClass { - BonoboObjectClass parent_class; -}; - -GtkType executive_summary_component_factory_get_type (void); - -BonoboObject *executive_summary_component_factory_new (EvolutionServicesCreateViewFn create_view, - void *closure); -#endif diff --git a/executive-summary/evolution-services/executive-summary-html-view.c b/executive-summary/evolution-services/executive-summary-html-view.c deleted file mode 100644 index d5ddb54244..0000000000 --- a/executive-summary/evolution-services/executive-summary-html-view.c +++ /dev/null @@ -1,341 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-html-view.c - Bonobo implementation of - * HtmlView.idl - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gtk/gtksignal.h> -#include <bonobo/bonobo-event-source.h> -#include <gal/util/e-util.h> - -#include "Executive-Summary.h" -#include "executive-summary-html-view.h" - -static void executive_summary_html_view_destroy (GtkObject *object); -static void executive_summary_html_view_init (ExecutiveSummaryHtmlView *component); -static void executive_summary_html_view_class_init (ExecutiveSummaryHtmlViewClass *klass); - -#define PARENT_TYPE (bonobo_object_get_type ()) - -static BonoboObjectClass *parent_class; - -enum { - HANDLE_URI, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -struct _ExecutiveSummaryHtmlViewPrivate { - BonoboEventSource *event_source; - - char *html; -}; - -/* CORBA interface */ -static POA_GNOME_Evolution_Summary_HTMLView__vepv HTMLView_vepv; - -static POA_GNOME_Evolution_Summary_HTMLView * -create_servant (void) -{ - POA_GNOME_Evolution_Summary_HTMLView *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_Summary_HTMLView *)g_new0 (BonoboObjectServant, 1); - servant->vepv = &HTMLView_vepv; - - CORBA_exception_init (&ev); - POA_GNOME_Evolution_Summary_HTMLView__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - return servant; -} - -static CORBA_char * -impl_GNOME_Evolution_Summary_HTMLView_getHtml (PortableServer_Servant servant, - CORBA_Environment *ev) -{ - BonoboObject *bonobo_object; - ExecutiveSummaryHtmlView *view; - ExecutiveSummaryHtmlViewPrivate *priv; - - bonobo_object = bonobo_object_from_servant (servant); - view = EXECUTIVE_SUMMARY_HTML_VIEW (bonobo_object); - priv = view->private; - - return CORBA_string_dup (priv->html? priv->html: ""); -} - -static void -impl_GNOME_Evolution_Summary_HTMLView_handleURI (PortableServer_Servant servant, - const CORBA_char *uri, - CORBA_Environment *ev) -{ - BonoboObject *bonobo_object; - - bonobo_object = bonobo_object_from_servant (servant); - - gtk_signal_emit (GTK_OBJECT (bonobo_object), signals[HANDLE_URI], uri); -} - -/* GtkObject methods */ -static void -executive_summary_html_view_destroy (GtkObject *object) -{ - ExecutiveSummaryHtmlView *view; - ExecutiveSummaryHtmlViewPrivate *priv; - - g_print ("BANG!"); - view = EXECUTIVE_SUMMARY_HTML_VIEW (object); - priv = view->private; - - if (priv == NULL) - return; - - g_free (priv->html); - g_free (priv); - - view->private = NULL; - - GTK_OBJECT_CLASS (parent_class)->destroy (object); -} - -static void -corba_class_init (void) -{ - POA_GNOME_Evolution_Summary_HTMLView__vepv *vepv; - POA_GNOME_Evolution_Summary_HTMLView__epv *epv; - PortableServer_ServantBase__epv *base_epv; - - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; - - epv = g_new0 (POA_GNOME_Evolution_Summary_HTMLView__epv, 1); - epv->getHtml = impl_GNOME_Evolution_Summary_HTMLView_getHtml; - epv->handleURI = impl_GNOME_Evolution_Summary_HTMLView_handleURI; - - vepv = &HTMLView_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_Summary_HTMLView_epv = epv; -} - -static void -executive_summary_html_view_class_init (ExecutiveSummaryHtmlViewClass *klass) -{ - GtkObjectClass *object_class; - - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = executive_summary_html_view_destroy; - - signals[HANDLE_URI] = gtk_signal_new ("handle_uri", GTK_RUN_FIRST, - object_class->type, - GTK_SIGNAL_OFFSET (ExecutiveSummaryHtmlViewClass, handle_uri), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, - GTK_TYPE_POINTER); - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); - - parent_class = gtk_type_class (PARENT_TYPE); - - corba_class_init (); -} - -static void -executive_summary_html_view_init (ExecutiveSummaryHtmlView *view) -{ - ExecutiveSummaryHtmlViewPrivate *priv; - - priv = g_new (ExecutiveSummaryHtmlViewPrivate, 1); - priv->html = NULL; - priv->event_source = NULL; - - view->private = priv; -} - -E_MAKE_TYPE (executive_summary_html_view, "ExecutiveSummaryHtmlView", - ExecutiveSummaryHtmlView, executive_summary_html_view_class_init, - executive_summary_html_view_init, PARENT_TYPE); - -static void -executive_summary_html_view_construct (ExecutiveSummaryHtmlView *view, - BonoboEventSource *event_source, - GNOME_Evolution_Summary_HTMLView corba_object) -{ - ExecutiveSummaryHtmlViewPrivate *priv; - - g_return_if_fail (view != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_HTML_VIEW (view)); - g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - - priv = view->private; - - priv->event_source = event_source; - bonobo_object_add_interface (BONOBO_OBJECT (view), - BONOBO_OBJECT (priv->event_source)); - - bonobo_object_construct (BONOBO_OBJECT (view), corba_object); -} - -/*** Public API ***/ -/** - * executive_summary_html_view_new_full: - * @event_source: A BonoboEventSource that will be aggregated onto the - * interface. - * - * Creates a new BonoboObject that implements - * the HTMLView.idl interface. - * - * Returns: A BonoboObject. - */ -BonoboObject * -executive_summary_html_view_new_full (BonoboEventSource *event_source) -{ - ExecutiveSummaryHtmlView *view; - POA_GNOME_Evolution_Summary_HTMLView *servant; - GNOME_Evolution_Summary_HTMLView corba_object; - - g_return_val_if_fail (event_source != NULL, NULL); - g_return_val_if_fail (BONOBO_IS_EVENT_SOURCE (event_source), NULL); - - servant = create_servant (); - if (servant == NULL) - return NULL; - - view = gtk_type_new (executive_summary_html_view_get_type ()); - corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (view), - servant); - - executive_summary_html_view_construct (view, event_source, corba_object); - - return BONOBO_OBJECT (view); -} - -/** - * executive_summary_html_view_new: - * - * Creates a new BonoboObject that implements - * the HTMLView.idl interface. - * Creates a default Bonobo::EventSource interface that will be aggregated onto - * the interface. - * - * Returns: A BonoboObject. - */ -BonoboObject * -executive_summary_html_view_new (void) -{ - BonoboEventSource *event_source; - - event_source = bonobo_event_source_new (); - return executive_summary_html_view_new_full (event_source); -} - -/** - * executive_summary_html_view_set_html: - * @view: The ExecutiveSummaryHtmlView to operate on, - * @html: The HTML as a string. - * - * Sets the HTML string in @view to @html. @html is copied into @view, - * so after this call you are free to do what you want with @html. - */ -void -executive_summary_html_view_set_html (ExecutiveSummaryHtmlView *view, - const char *html) -{ - ExecutiveSummaryHtmlViewPrivate *priv; - CORBA_any any; - CORBA_short s; - - g_return_if_fail (view != NULL); - g_return_if_fail (IS_EXECUTIVE_SUMMARY_HTML_VIEW (view)); - - priv = view->private; - if (priv->html) - g_free (priv->html); - - if (html != NULL) - priv->html = g_strdup (html); - else - priv->html = NULL; - - /* Notify any listeners */ - s = 0; - - any._type = (CORBA_TypeCode) TC_short; - any._value = &s; - - bonobo_event_source_notify_listeners (BONOBO_EVENT_SOURCE (priv->event_source), - EXECUTIVE_SUMMARY_HTML_VIEW_HTML_CHANGED, - &any, NULL); -} - -/** - * executive_summary_html_view_get_html: - * @view: The ExecutiveSummaryHtmlView to operate on. - * - * Retrieves the HTML stored in @view. This return value is not duplicated - * before returning, so you should not free it. Instead, if you want to free - * the HTML stored in @view, you should use - * executive_summary_html_view_set_html (view, NULL);. - * - * Returns: A pointer to the HTML stored in @view. - */ -const char * -executive_summary_html_view_get_html (ExecutiveSummaryHtmlView *view) -{ - ExecutiveSummaryHtmlViewPrivate *priv; - - g_return_val_if_fail (view != NULL, NULL); - g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_HTML_VIEW (view), NULL); - - priv = view->private; - return priv->html; -} - -/** - * executive_summary_html_view_get_event_source: - * @view: The ExecutiveSummaryHtmlView to operate on. - * - * Retrieves the BonoboEventSource that is used in this view. - * - * Returns: A BonoboEventSource pointer. - */ -BonoboEventSource * -executive_summary_html_view_get_event_source (ExecutiveSummaryHtmlView *view) -{ - g_return_val_if_fail (view != NULL, NULL); - g_return_val_if_fail (IS_EXECUTIVE_SUMMARY_HTML_VIEW (view), NULL); - - return view->private->event_source; -} diff --git a/executive-summary/evolution-services/executive-summary-html-view.h b/executive-summary/evolution-services/executive-summary-html-view.h deleted file mode 100644 index c09962a619..0000000000 --- a/executive-summary/evolution-services/executive-summary-html-view.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary-html-view.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _EXECUTIVE_SUMMARY_HTML_VIEW_H__ -#define _EXECUTIVE_SUMMARY_HTML_VIEW_H__ - -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-event-source.h> - -#define EXECUTIVE_SUMMARY_HTML_VIEW_HTML_CHANGED "GNOME:Evolution:Summary:HTMLView:html_changed" - -#define EXECUTIVE_SUMMARY_HTML_VIEW_TYPE (executive_summary_html_view_get_type ()) -#define EXECUTIVE_SUMMARY_HTML_VIEW(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_HTML_VIEW_TYPE, ExecutiveSummaryHtmlView)) -#define EXECUTIVE_SUMMARY_HTML_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_HTML_VIEW_TYPE, ExecutiveSummaryHtmlViewClass)) -#define IS_EXECUTIVE_SUMMARY_HTML_VIEW(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_HTML_VIEW_TYPE)) -#define IS_EXECUTIVE_SUMMARY_HTML_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_HTML_VIEW_TYPE)) - -typedef struct _ExecutiveSummaryHtmlViewPrivate ExecutiveSummaryHtmlViewPrivate; -typedef struct _ExecutiveSummaryHtmlView ExecutiveSummaryHtmlView; -typedef struct _ExecutiveSummaryHtmlViewClass ExecutiveSummaryHtmlViewClass; - -struct _ExecutiveSummaryHtmlView { - BonoboObject parent; - - ExecutiveSummaryHtmlViewPrivate *private; -}; - -struct _ExecutiveSummaryHtmlViewClass { - BonoboObjectClass parent_class; - - void (* handle_uri) (ExecutiveSummaryHtmlView *view, - char *uri); -}; - -GtkType executive_summary_html_view_get_type (void); -BonoboObject *executive_summary_html_view_new_full (BonoboEventSource *event_source); -BonoboObject *executive_summary_html_view_new (void); - -void executive_summary_html_view_set_html (ExecutiveSummaryHtmlView *view, - const char *html); -const char *executive_summary_html_view_get_html (ExecutiveSummaryHtmlView *view); -BonoboEventSource *executive_summary_html_view_get_event_source (ExecutiveSummaryHtmlView *view); - -#endif - diff --git a/executive-summary/evolution-services/executive-summary.c b/executive-summary/evolution-services/executive-summary.c deleted file mode 100644 index 89731ea69e..0000000000 --- a/executive-summary/evolution-services/executive-summary.c +++ /dev/null @@ -1,267 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary.c - Bonobo implementation of Summary.idl - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gal/util/e-util.h> - -#include "Executive-Summary.h" -#include "executive-summary.h" - -static void executive_summary_destroy (GtkObject *object); -static void executive_summary_class_init (ExecutiveSummaryClass *es_class); -static void executive_summary_init (ExecutiveSummary *es); - -#define PARENT_TYPE (bonobo_object_get_type ()) - -enum { - UPDATE, - SET_TITLE, - SET_ICON, - FLASH, - LAST_SIGNAL -}; - -static guint32 summary_signals [LAST_SIGNAL] = { 0 }; -static BonoboObjectClass *parent_class; - -struct _ExecutiveSummaryPrivate { - int dummy; -}; - -/* CORBA interface implementation */ -static POA_GNOME_Evolution_Summary_ViewFrame__vepv Summary_vepv; - -static POA_GNOME_Evolution_Summary_ViewFrame * -create_servant (void) -{ - POA_GNOME_Evolution_Summary_ViewFrame *servant; - CORBA_Environment ev; - - servant = (POA_GNOME_Evolution_Summary_ViewFrame *)g_new0 (BonoboObjectServant, 1); - servant->vepv = &Summary_vepv; - - CORBA_exception_init (&ev); - - POA_GNOME_Evolution_Summary_ViewFrame__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_free (servant); - CORBA_exception_free (&ev); - return NULL; - } - - CORBA_exception_free (&ev); - - return servant; -} - -#if 0 -static void -impl_GNOME_Evolution_Summary_ViewFrame_setTitle (PortableServer_Servant servant, - CORBA_long id, - const CORBA_char *title, - CORBA_Environment *ev) -{ - BonoboObject *bonobo_object; - ExecutiveSummary *summary; - - bonobo_object = bonobo_object_from_servant (servant); - summary = EXECUTIVE_SUMMARY (bonobo_object); - - gtk_signal_emit (GTK_OBJECT (summary), summary_signals[SET_TITLE], - id, title); -} - -static void -impl_GNOME_Evolution_Summary_ViewFrame_setIcon (PortableServer_Servant servant, - CORBA_long id, - const CORBA_char *title, - CORBA_Environment *ev) -{ - BonoboObject *bonobo_object; - ExecutiveSummary *summary; - - bonobo_object = bonobo_object_from_servant (servant); - summary = EXECUTIVE_SUMMARY (bonobo_object); - - gtk_signal_emit (GTK_OBJECT (summary), summary_signals[SET_ICON], - id, title); -} - -static void -impl_GNOME_Evolution_Summary_ViewFrame_flash (PortableServer_Servant servant, - CORBA_long id, - CORBA_Environment *ev) -{ - BonoboObject *bonobo_object; - ExecutiveSummary *summary; - - bonobo_object = bonobo_object_from_servant (servant); - summary = EXECUTIVE_SUMMARY (bonobo_object); - - gtk_signal_emit (GTK_OBJECT (summary), summary_signals[FLASH], id); -} - -static void -impl_GNOME_Evolution_Summary_ViewFrame_updateComponent (PortableServer_Servant servant, - const CORBA_long id, - const CORBA_char *html, - CORBA_Environment *ev) -{ - BonoboObject *bonobo_object; - ExecutiveSummary *summary; - - bonobo_object = bonobo_object_from_servant (servant); - summary = EXECUTIVE_SUMMARY (bonobo_object); - - gtk_signal_emit (GTK_OBJECT (summary), summary_signals[UPDATE], - id, html); -} -#endif - -/* GtkObject methods */ -static void -executive_summary_destroy (GtkObject *object) -{ - ExecutiveSummary *es; - ExecutiveSummaryPrivate *priv; - - es = EXECUTIVE_SUMMARY (object); - priv = es->private; - - if (priv == NULL) - return; - - g_free (priv); - es->private = NULL; -} - -/* Initialisation */ - -static void -corba_class_init (void) -{ - POA_GNOME_Evolution_Summary_ViewFrame__vepv *vepv; - POA_GNOME_Evolution_Summary_ViewFrame__epv *epv; - PortableServer_ServantBase__epv *base_epv; - - base_epv = g_new0 (PortableServer_ServantBase__epv, 1); - base_epv->_private = NULL; - base_epv->finalize = NULL; - base_epv->default_POA = NULL; - - epv = g_new0 (POA_GNOME_Evolution_Summary_ViewFrame__epv, 1); - - vepv = &Summary_vepv; - vepv->_base_epv = base_epv; - vepv->Bonobo_Unknown_epv = bonobo_object_get_epv (); - vepv->GNOME_Evolution_Summary_ViewFrame_epv = epv; -} - -static void -executive_summary_class_init (ExecutiveSummaryClass *es_class) -{ - GtkObjectClass *object_class; - - object_class = (GtkObjectClass *) es_class; - - object_class->destroy = executive_summary_destroy; - - parent_class = gtk_type_class (PARENT_TYPE); - - summary_signals[UPDATE] = gtk_signal_new ("update", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (ExecutiveSummaryClass, update), - gtk_marshal_NONE__POINTER_POINTER, - GTK_TYPE_NONE, 2, - GTK_TYPE_POINTER, - GTK_TYPE_POINTER); - summary_signals[SET_TITLE] = gtk_signal_new ("set_title", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (ExecutiveSummaryClass, set_title), - gtk_marshal_NONE__POINTER_POINTER, - GTK_TYPE_NONE, 2, - GTK_TYPE_POINTER, - GTK_TYPE_POINTER); - summary_signals[SET_ICON] = gtk_signal_new ("set_icon", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (ExecutiveSummaryClass, set_icon), - gtk_marshal_NONE__POINTER_POINTER, - GTK_TYPE_NONE, 2, - GTK_TYPE_POINTER, - GTK_TYPE_POINTER); - summary_signals[FLASH] = gtk_signal_new ("flash", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (ExecutiveSummaryClass, flash), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, - GTK_TYPE_POINTER); - gtk_object_class_add_signals (object_class, summary_signals, LAST_SIGNAL); - - corba_class_init (); -} - -static void -executive_summary_init (ExecutiveSummary *es) -{ - ExecutiveSummaryPrivate *priv; - - priv = g_new (ExecutiveSummaryPrivate, 1); - es->private = priv; -} - -E_MAKE_TYPE (executive_summary, "ExecutiveSummary", ExecutiveSummary, - executive_summary_class_init, executive_summary_init, PARENT_TYPE); - -void -executive_summary_construct (ExecutiveSummary *es, - GNOME_Evolution_Summary_ViewFrame corba_object) -{ - bonobo_object_construct (BONOBO_OBJECT (es), corba_object); -} - -BonoboObject * -executive_summary_new (void) -{ - POA_GNOME_Evolution_Summary_ViewFrame *servant; - GNOME_Evolution_Summary_ViewFrame corba_object; - ExecutiveSummary *es; - - servant = create_servant (); - if (servant == NULL) - return NULL; - - es = gtk_type_new (executive_summary_get_type ()); - - corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (es), - servant); - executive_summary_construct (es, corba_object); - - return BONOBO_OBJECT (es); -} diff --git a/executive-summary/evolution-services/executive-summary.h b/executive-summary/evolution-services/executive-summary.h deleted file mode 100644 index ad5a07149d..0000000000 --- a/executive-summary/evolution-services/executive-summary.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* executive-summary.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _EXECUTIVE_SUMMARY_H__ -#define _EXECUTIVE_SUMMARY_H__ - -#include <gtk/gtksignal.h> -#include <bonobo.h> -#include "Executive-Summary.h" - -#define EXECUTIVE_SUMMARY_TYPE (executive_summary_get_type ()) -#define EXECUTIVE_SUMMARY(obj) (GTK_CHECK_CAST ((obj), EXECUTIVE_SUMMARY_TYPE, ExecutiveSummary)) -#define EXECUTIVE_SUMMARY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXECUTIVE_SUMMARY_TYPE, ExecutiveSummaryClass)) -#define IS_EXECUTIVE_SUMMARY(obj) (GTK_CHECK_TYPE ((obj), EXECUTIVE_SUMMARY_TYPE)) -#define IS_EXECUTIVE_SUMMARY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EXECUTIVE_SUMMARY_TYPE)) - -typedef struct _ExecutiveSummaryPrivate ExecutiveSummaryPrivate; -typedef struct _ExecutiveSummary ExecutiveSummary; -typedef struct _ExecutiveSummaryClass ExecutiveSummaryClass; - -struct _ExecutiveSummary { - BonoboObject parent; - - ExecutiveSummaryPrivate *private; -}; - -struct _ExecutiveSummaryClass { - BonoboObjectClass parent_class; - - void (* update) (ExecutiveSummary *summary, - const GNOME_Evolution_Summary_Component component, - const char *html); - void (* set_title) (ExecutiveSummary *summary, - const GNOME_Evolution_Summary_Component component, - const char *title); - void (* set_icon) (ExecutiveSummary *summary, - const GNOME_Evolution_Summary_Component component, - const char *icon); - void (* flash) (ExecutiveSummary *summary, - const GNOME_Evolution_Summary_Component component); -}; - -GtkType executive_summary_get_type (void); -void executive_summary_construct (ExecutiveSummary *es, - GNOME_Evolution_Summary_ViewFrame corba_object); -BonoboObject *executive_summary_new (void); -#endif - diff --git a/executive-summary/idl/.cvsignore b/executive-summary/idl/.cvsignore deleted file mode 100644 index b840c21800..0000000000 --- a/executive-summary/idl/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile
\ No newline at end of file diff --git a/executive-summary/idl/Executive-Summary.idl b/executive-summary/idl/Executive-Summary.idl deleted file mode 100644 index a564e90fe6..0000000000 --- a/executive-summary/idl/Executive-Summary.idl +++ /dev/null @@ -1,4 +0,0 @@ -#include <Bonobo.idl> -#include <SummaryComponent.idl> -#include <Summary.idl> -#include <HtmlView.idl> diff --git a/executive-summary/idl/HtmlView.idl b/executive-summary/idl/HtmlView.idl deleted file mode 100644 index 25ec63de9b..0000000000 --- a/executive-summary/idl/HtmlView.idl +++ /dev/null @@ -1,25 +0,0 @@ -/*-*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * CORBA interface for an HTML view. - * - * Authors: - * Iain Holmes <iain@helixcode.com> - * - * Copyright (C) 2000 Helix Code, Inc. - */ - -#include <Bonobo.idl> - -module GNOME { -module Evolution { -module Summary { - - interface HTMLView : Bonobo::Unknown { - string getHtml (); - - void handleURI (in string uri); - }; -}; -}; -}; - diff --git a/executive-summary/idl/Makefile.am b/executive-summary/idl/Makefile.am deleted file mode 100644 index 29a35f43cf..0000000000 --- a/executive-summary/idl/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -EXTRA_DIST = $(IDLS) - -IDLS = \ - Executive-Summary.idl \ - HtmlView.idl \ - Summary.idl \ - SummaryComponent.idl
\ No newline at end of file diff --git a/executive-summary/idl/Summary.idl b/executive-summary/idl/Summary.idl deleted file mode 100644 index 118a0788d9..0000000000 --- a/executive-summary/idl/Summary.idl +++ /dev/null @@ -1,20 +0,0 @@ -/*-*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * CORBA interface for the Evolution shell. - * - * Authors: - * Iain Holmes <iain@helixcode.com> - * - * Copyright (C) 2000 Helix Code, Inc. - */ - -#include <Bonobo.idl> - -module GNOME { -module Evolution { -module Summary { - interface ViewFrame: Bonobo::Unknown { - }; -}; -}; -}; diff --git a/executive-summary/idl/SummaryComponent.idl b/executive-summary/idl/SummaryComponent.idl deleted file mode 100644 index fefc8e518d..0000000000 --- a/executive-summary/idl/SummaryComponent.idl +++ /dev/null @@ -1,36 +0,0 @@ -/*-*- Mode: IDL; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * CORBA interface for the Evolution Executive Summary Components. - * - * Authors: - * Iain Holmes <iain@helixcode.com> - * - * Copyright (C) 2000 Helix Code, Inc. - */ - -/* TODO: Needs Exceptions */ - -#include <Bonobo.idl> -#include <oaf-factory.idl> - -module GNOME { -module Evolution { -module Summary { - interface ViewFrame; - - interface Component: Bonobo::Unknown { - }; - - interface ComponentFactory: Bonobo::Unknown { - /** - * createView: - * - * Creates a new Component object. - * - * Returns: A Component object. - **/ - Component createView (); - }; -}; -}; -}; diff --git a/executive-summary/summary.html b/executive-summary/summary.html deleted file mode 100644 index 16602da2a6..0000000000 --- a/executive-summary/summary.html +++ /dev/null @@ -1,45 +0,0 @@ -<html> -<head> -<Title>Evolution Executive Summary</title> -</head> - -<body bgcolor="#ffffff" background="executive-summary-bg.png"> -<table cellpadding="0" cellspacing="0" numcols="3" width="100%" height="100%" border="0"> -<tr> -<td bgcolor="#9aadbf" height="102"> -<img src="butterfly.png"></td> -<td width="100%" colspan="2" align="middle" bgcolor="#9aadbf"> -E V O L U T I O N -</td></tr> -<!-- Hmmmm. -<tr><td bgcolor="#9aadbf"> </td> -<td valign="top" width="100"><img src="executive-summary-curve.png"></td> -<td width="95%"> - -<table border="0" align="middle"> -<tr> -<td align="left"> - <form method="get" action="/search" name="f"> - <b>Search On Google</b> - <input type="text" size="15" name=q> - <input type="submit" name"submit"> - </form> -</td> -</tr> ---> -<tr> -<td colspan="2"> -<!-- EVOLUTION EXECUTIVE SUMMARY SERVICES DO NOT REMOVE --> -</td> -</tr> - -</table> - -</td> -</tr> - -</table> -</body> -</html> - - diff --git a/executive-summary/test-service/.cvsignore b/executive-summary/test-service/.cvsignore deleted file mode 100644 index e9a7d4280b..0000000000 --- a/executive-summary/test-service/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile.in -Makefile -core -.deps -.libs -test-service -rdf-summary -GNOME_Evolution_Summary_test.oaf -GNOME_Evolution_Summary_rdf.oaf diff --git a/executive-summary/test-service/GNOME_Evolution_Summary_rdf.oaf.in b/executive-summary/test-service/GNOME_Evolution_Summary_rdf.oaf.in deleted file mode 100644 index decd499293..0000000000 --- a/executive-summary/test-service/GNOME_Evolution_Summary_rdf.oaf.in +++ /dev/null @@ -1,27 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:GNOME_Evolution_Summary_rdf_SummaryComponentFactory" - type="exe" - location="rdf-summary"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME:GenericFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="Factory for the RDF summary."/> -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_Summary_rdf_SummaryComponent" - type="factory" - location="OAFIID:GNOME_Evolution_Summary_rdf_SummaryComponentFactory"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution:Summary:ComponentFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="RDF Summary"/> -</oaf_server> - -</oaf_info> diff --git a/executive-summary/test-service/GNOME_Evolution_Summary_test.oaf.in b/executive-summary/test-service/GNOME_Evolution_Summary_test.oaf.in deleted file mode 100644 index b0c9e8f0d6..0000000000 --- a/executive-summary/test-service/GNOME_Evolution_Summary_test.oaf.in +++ /dev/null @@ -1,53 +0,0 @@ -<oaf_info> - -<oaf_server iid="OAFIID:GNOME_Evolution_Summary_test_ComponentFactory" - type="exe" - location="test-service"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/GenericFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="Factory for the test component."/> -</oaf_server> - -<oaf_server iid="OAFIID:GNOME_Evolution_Summary_test_Component" - type="factory" - location="OAFIID:GNOME_Evolution_Summary_test_ComponentFactory"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution:Summary:ComponentFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="Test service"/> -</oaf_server> - -<!-- This does not work -<oaf_server iid="OAFIID:evolution-summary-component-factory:test-bonobo-service:b6da2ad2-1fbb-4539-93f9-038b1702810e" - type="exe" - location="test-bonobo-service"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME:GenericFactory:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="Factory for the test bonobo component."/> -</oaf_server> - -<oaf_server iid="OAFIID:evolution-summary-component:test-bonobo-service:d3cb3ed6-a654-4337-8aa0-f443751d6d1b" - type="factory" - location="OAFIID:evolution-summary-component-factory:test-bonobo-service:b6da2ad2-1fbb-4539-93f9-038b1702810e"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:Evolution:SummaryComponent:1.0"/> - </oaf_attribute> - - <oaf_attribute name="description" type="string" - _value="Test bonobo service"/> -</oaf_server> - ---> -</oaf_info> diff --git a/executive-summary/test-service/Makefile.am b/executive-summary/test-service/Makefile.am deleted file mode 100644 index 458b015c1e..0000000000 --- a/executive-summary/test-service/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -bin_PROGRAMS = test-service rdf-summary - -CFLAGS += -g -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/executive-summary \ - $(EXTRA_GNOME_CFLAGS) \ - $(BONOBO_HTML_GNOME_CFLAGS) \ - -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" - -test_service_SOURCES = \ - main.c - -test_service_LDADD = \ - $(top_builddir)/executive-summary/evolution-services/libevolution-services.la \ - $(BONOBO_VFS_GNOME_LIBS) \ - $(EXTRA_GNOME_LIBS) - -#test_bonobo_service_SOURCES = \ -# test-bonobo.c - -#test_bonobo_service_LDADD = \ -# $(top_builddir)/executive-summary/evolution-services/libevolution-services.la \ -# $(BONOBO_VFS_GNOME_LIBS) \ -# $(EXTRA_GNOME_LIBS) - -rdf_summary_SOURCES = \ - rdf-summary.c - -rdf_summary_LDADD = \ - $(top_builddir)/executive-summary/evolution-services/libevolution-services.la \ - $(BONOBO_VFS_GNOME_LIBS) \ - $(EXTRA_GNOME_LIBS) - -oafdir = $(datadir)/oaf -oaf_in_files = \ - GNOME_Evolution_Summary_test.oaf.in \ - GNOME_Evolution_Summary_rdf.oaf.in -oaf_DATA = $(oaf_in_files:.oaf.in=.oaf) - -@XML_I18N_MERGE_OAF_RULE@ - -EXTRA_DIST = $(oaf_in_files) $(oaf_DATA) diff --git a/executive-summary/test-service/main.c b/executive-summary/test-service/main.c deleted file mode 100644 index e0ea671ce8..0000000000 --- a/executive-summary/test-service/main.c +++ /dev/null @@ -1,297 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* main.c - * Test Service that counts the number of seconds since it was started. - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-persist-stream.h> -#include <bonobo/bonobo-property-bag.h> -#include <evolution-services/executive-summary-component.h> -#include <evolution-services/executive-summary-html-view.h> - -#include <liboaf/liboaf.h> - -enum { - PROPERTY_TITLE, - PROPERTY_ICON -}; - -struct _UserData { - char *title; - char *icon; -}; -typedef struct _UserData UserData; - -static int running_views = 0; - -#define TEST_SERVICE_ID "OAFIID:GNOME_Evolution_Summary_test_ComponentFactory" - -static BonoboGenericFactory *factory = NULL; - -/* PersistStream callbacks */ -static void -load_from_stream (BonoboPersistStream *ps, - Bonobo_Stream stream, - Bonobo_Persist_ContentType type, - gpointer data, - CORBA_Environment *ev) -{ - char *str; - - if (*type && g_strcasecmp (type, "application/x-test-service") != 0) { - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_Bonobo_Persist_WrongDataType, NULL); - return; - } - - bonobo_stream_client_read_string (stream, &str, ev); - if (ev->_major != CORBA_NO_EXCEPTION || str == NULL) { - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_Bonobo_Persist_WrongDataType, NULL); - return; - } - - g_print ("Restoring with :%s\n", str); - g_free (str); -} - -static void -save_to_stream (BonoboPersistStream *ps, - const Bonobo_Stream stream, - Bonobo_Persist_ContentType type, - gpointer data, - CORBA_Environment *ev) -{ - - if (*type && g_strcasecmp (type, "application/x-test-service") != 0) { - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_Bonobo_Persist_WrongDataType, NULL); - return; - } - - bonobo_stream_client_printf (stream, TRUE, ev, "Yo yo yo"); - if (ev->_major != CORBA_NO_EXCEPTION) - return; -} - -static Bonobo_Persist_ContentTypeList * -content_types (BonoboPersistStream *ps, - void *closure, - CORBA_Environment *ev) -{ - return bonobo_persist_generate_content_types (1, "application/x-test-service"); -} - -/* PropertyControl callback */ - -/* Propertybag set/get functions */ -static void -set_property (BonoboPropertyBag *bag, - const BonoboArg *arg, - guint arg_id, - CORBA_Environment *ev, - gpointer user_data) -{ - switch (arg_id) { - case PROPERTY_TITLE: - g_print ("Setting title.\n"); - break; - - case PROPERTY_ICON: - g_print ("Setting icon.\n"); - break; - - default: - break; - } -} - -static void -get_property (BonoboPropertyBag *bag, - BonoboArg *arg, - guint arg_id, - CORBA_Environment *ev, - gpointer user_data) -{ - UserData *ud = (UserData *) user_data; - - switch (arg_id) { - case PROPERTY_TITLE: - BONOBO_ARG_SET_STRING (arg, ud->title); - break; - - case PROPERTY_ICON: - BONOBO_ARG_SET_STRING (arg, ud->icon); - break; - - default: - break; - } -} - -static void -component_destroyed (GtkObject *object, - gpointer data) -{ - UserData *ud = (UserData *) data; - /* Free the UserData structure */ - g_free (ud->title); - g_free (ud->icon); - g_free (ud); - - running_views--; - - g_print ("Destroy!\n"); - if (running_views <= 0) { - bonobo_object_unref (BONOBO_OBJECT (factory)); - gtk_main_quit (); - } -} - -static BonoboObject * -create_view (ExecutiveSummaryComponentFactory *_factory, - void *closure) -{ - BonoboObject *component, *view; - BonoboPersistStream *stream; - BonoboPropertyBag *bag; - BonoboEventSource *event_source; - UserData *ud; - - /* Create the component object */ - component = executive_summary_component_new (); - - /* Create the UserData structure and fill it */ - ud = g_new (UserData, 1); - ud->title = g_strdup ("Hello World!"); - ud->icon = g_strdup ("apple-red.png"); - - gtk_signal_connect (GTK_OBJECT (component), "destroy", - GTK_SIGNAL_FUNC (component_destroyed), ud); - - /* Now create the aggregate objects. For a "service" - either a Summary::HTMLView or Bonobo::Control are required. - Other supported agreggate objects are - PersistStream: For saving and restoring the component. - PropertyBag: To set the icon and title and other properties - PropertyControl: To produce a control to configure the service. - - To aggregate the objects - i) Create the objects using their creation functions - ii) Use bonobo_object_add_interface (). - */ - - /* Create an event source to share with all the interfaces, - as we can only aggregate one onto the ExecutiveSummaryComponent */ - event_source = bonobo_event_source_new (); - - /* The Summary::HTMLView interface */ - view = executive_summary_html_view_new_full (event_source); - /* Set the default HTML */ - executive_summary_html_view_set_html (EXECUTIVE_SUMMARY_HTML_VIEW (view), - "<B>Hello World</b>"); - - bonobo_object_add_interface (component, view); - - /* Add the Bonobo::PropertyBag interface */ - bag = bonobo_property_bag_new_full (get_property, set_property, - event_source, ud); - /* Add the properties. There should be 2: - window_title: For the window title. - window_icon: For the window icon. - */ - bonobo_property_bag_add (bag, - "window_title", PROPERTY_TITLE, - BONOBO_ARG_STRING, - NULL, - "The title of this components window", 0); - bonobo_property_bag_add (bag, - "window_icon", PROPERTY_ICON, - BONOBO_ARG_STRING, - NULL, - "The icon for this component's window", 0); - - /* Now add the interface */ - bonobo_object_add_interface (component, BONOBO_OBJECT(bag)); - - /* Add the Bonobo::PersistStream interface */ - stream = bonobo_persist_stream_new (load_from_stream, save_to_stream, - NULL, content_types, NULL); - bonobo_object_add_interface (component, BONOBO_OBJECT(stream)); - - running_views++; - /* Return the ExecutiveSummaryComponent object */ - return component; -} - -static BonoboObject * -factory_fn (BonoboGenericFactory *generic_factory, - void *closure) -{ - BonoboObject *_factory; - - /* Create an executive summary component factory */ - _factory = executive_summary_component_factory_new (create_view, NULL); - return _factory; -} - -void -test_service_factory_init (void) -{ - if (factory != NULL) - return; - - /* Register the factory creation function and the IID */ - factory = bonobo_generic_factory_new (TEST_SERVICE_ID, factory_fn, NULL); - if (factory == NULL) { - g_warning ("Cannot initialize test service"); - exit (0); - } -} - -int -main (int argc, char **argv) -{ - CORBA_ORB orb; - - /* Init GNOME, oaf and bonobo */ - gnome_init_with_popt_table ("Test service", VERSION, - argc, argv, oaf_popt_options, 0, NULL); - orb = oaf_init (argc, argv); - - if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) { - g_error ("Could not initialize Bonobo"); - } - - /* Register the factory */ - test_service_factory_init (); - - /* Enter main */ - bonobo_main (); - - return 0; -} - diff --git a/executive-summary/test-service/rdf-summary.c b/executive-summary/test-service/rdf-summary.c deleted file mode 100644 index 1024b57662..0000000000 --- a/executive-summary/test-service/rdf-summary.c +++ /dev/null @@ -1,984 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* RDF viewer Evolution Executive Summary Component. - * Bonoboised by Iain Holmes <iain@ximian.com> - * Copyright (C) 2000 Ximian, Inc. - * - * Based on code from Portaloo - * Channel retrieval tool - * - * (C) 1998 Alan Cox. - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <glib.h> -#include <gnome-xml/parser.h> -#include <gnome-xml/xmlmemory.h> - -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-persist-stream.h> -#include <bonobo/bonobo-property.h> -#include <bonobo/bonobo-property-bag.h> -#include <bonobo/bonobo-property-control.h> -#include <evolution-services/executive-summary-component.h> -#include <evolution-services/executive-summary-html-view.h> -#include <liboaf/liboaf.h> -#include <libgnomevfs/gnome-vfs.h> - -int xmlSubstituteEntitiesDefaultValue = 1; /* DV thinks of everything */ - -static int wipe_trackers = FALSE; -static int running_views = 0; - -static BonoboGenericFactory *factory = NULL; -#define RDF_SUMMARY_ID "OAFIID:GNOME_Evolution_Summary_rdf_SummaryComponentFactory" - -enum { - PROPERTY_TITLE, - PROPERTY_ICON -}; - -struct _RdfSummary { - BonoboObject *component; - BonoboObject *view; - BonoboPropertyBag *bag; - BonoboPropertyControl *property_control; - - GtkWidget *rdf; - GtkWidget *g_limit; - GtkWidget *g_title; - GtkWidget *g_update; - GtkWidget *g_update_container; - GtkAdjustment *adjustment; - - char *title; - char *icon; - char *location; - int limit; - gboolean showtitle; - - gboolean usetimer; - int time; - int timer; - - GString *str; - char *buffer; - - GnomeVFSAsyncHandle *handle; - - xmlDocPtr cache; -}; -typedef struct _RdfSummary RdfSummary; - -/************ RDF Parser *******************/ - -static char * -layer_find (xmlNodePtr node, - char *match, - char *fail) -{ - while (node!=NULL) { -#ifdef RDF_DEBUG - xmlDebugDumpNode (stdout, node, 32); - printf("%s.\n", node->name); -#endif - if (strcasecmp (node->name, match)==0) { - if (node->childs != NULL && node->childs->content != NULL) { - return node->childs->content; - } else { - return fail; - } - } - node = node->next; - } - return fail; -} - -static char * -layer_find_url (xmlNodePtr node, - char *match, - char *fail) -{ - char *p = layer_find (node, match, fail); - char *r = p; - static char *wb = NULL; - char *w; - - if (wb) { - free (wb); - } - - wb = w = malloc (3 * strlen (p)); - - if (w == NULL) { - fprintf(stderr, "Out of memory\n"); - exit(1); - } - - if (*r == ' ') r++; /* Fix UF bug */ - - while (*r) { - if (memcmp (r, "&", 5) == 0) { - *w++ = '&'; - r += 5; - continue; - } - if (memcmp (r, "<", 4) == 0) { - *w++ = '<'; - r += 4; - continue; - } - if (memcmp (r, ">", 4) == 0) { - *w++ = '>'; - r += 4; - continue; - } - if (*r == '"' || *r == ' '){ - *w++ = '%'; - *w++ = "0123456789ABCDEF"[*r/16]; - *w++ = "0123456789ABCDEF"[*r&15]; - r++; - continue; - } - *w++ = *r++; - } - *w = 0; - return wb; -} - -static void -tree_walk (xmlNodePtr root, - RdfSummary *summary, - GString *html) -{ - BonoboArg *arg; - xmlNodePtr walk; - xmlNodePtr rewalk = root; - xmlNodePtr channel = NULL; - xmlNodePtr image = NULL; - xmlNodePtr item[16]; - int items = 0; - int limit = summary->limit; - int i; - char *t; - char n[512]; - char *tmp; - - do { - walk = rewalk; - rewalk = NULL; - - while (walk!=NULL){ -#ifdef RDF_DEBUG - printf ("%p, %s\n", walk, walk->name); -#endif - if (strcasecmp (walk->name, "rdf") == 0) { - rewalk = walk->childs; - walk = walk->next; - continue; - } - if (strcasecmp (walk->name, "rss") == 0){ - rewalk = walk->childs; - walk = walk->next; - continue; - } - /* This is the channel top level */ -#ifdef RDF_DEBUG - printf ("Top level '%s'.\n", walk->name); -#endif - if (strcasecmp (walk->name, "channel") == 0) { - channel = walk; - rewalk = channel->childs; - } - if (strcasecmp (walk->name, "image") == 0) { - image = walk; - g_print ("Image\n"); - } - if (strcasecmp (walk->name, "item") == 0 && items < 16) { - item[items++] = walk; - } - walk = walk->next; - } - } - while (rewalk); - - if (channel == NULL) { - fprintf(stderr, "No channel definition.\n"); - exit(1); - } - - t = layer_find(channel->childs, "title", "No title"); - - arg = bonobo_arg_new (BONOBO_ARG_STRING); - - if (summary->showtitle) { - BONOBO_ARG_SET_STRING (arg, t); - } else { - BONOBO_ARG_SET_STRING (arg, ""); - } - - bonobo_property_bag_set_value (summary->bag, - "window_title", - (const BonoboArg *) arg, NULL); - bonobo_arg_release (arg); - - if (image && !wipe_trackers) { - char *icon; - - icon = layer_find_url (image->childs, "url", "apple-red.png"); - arg = bonobo_arg_new (BONOBO_ARG_STRING); - BONOBO_ARG_SET_STRING (arg, icon); - bonobo_property_bag_set_value (summary->bag, - "window_icon", - (const BonoboArg *) arg, NULL); - bonobo_arg_release (arg); - - } - - g_string_append (html, "<br clear=all><FONT size=\"-1\" face=\"helvetica\"><P><UL>\n"); - - items = MIN (limit, items); - for (i = 0; i < items; i++) { - char *p = layer_find (item[i]->childs, "title", "No information"); - - if (wipe_trackers) { - char *p = layer_find_url (item[i]->childs, "link", ""); - char *x = strchr (p, '?'); - unsigned char *r, *w; - int n; - if (x == NULL) - continue; - x++; - r = x; - w = x; - while (*r) { - if (*r == '+') { - *w++ = ' '; - } else if (*r == '%') { - sscanf (r+1, "%02x", &n); - *w++ = n; - r += 2; - } else { - *w++ = *r; - } - r++; - } - *w = 0; - tmp = g_strdup_printf ("<LI><A href=\"%s\">\n", x+4); - g_string_append (html, tmp); - g_free (tmp); - } - else { - tmp = g_strdup_printf ("<LI><A href=\"%s\">\n", layer_find_url(item[i]->childs, "link", "")); - g_string_append (html, tmp); - g_free (tmp); - } - - tmp = g_strdup_printf ("%s\n</A>\n", p); - g_string_append (html, tmp); - g_free (tmp); - } - g_string_append (html, "</UL></FONT>\n"); -} - -/********* ExecutiveSummaryComponent section **************/ -static void -view_destroyed (GtkObject *object, - gpointer data) -{ - RdfSummary *summary = (RdfSummary *) data; - - g_warning ("RDF: Point 1"); - if (summary->handle) - gnome_vfs_async_cancel (summary->handle); - - g_warning ("RDF: Point 2"); - - if (summary->cache != NULL) - xmlFreeDoc (summary->cache); - - g_free (summary->title); - g_free (summary->icon); - g_free (summary); - - running_views--; - g_print ("Running_views: %d\n", running_views); - if (running_views <= 0) { - gtk_main_quit (); - } - g_warning ("RDF: Point 3"); -} - -/* PersistStream callbacks */ -static void -load_from_stream (BonoboPersistStream *ps, - Bonobo_Stream stream, - Bonobo_Persist_ContentType type, - gpointer data, - CORBA_Environment *ev) -{ - RdfSummary *summary = (RdfSummary *) data; - char *str; - xmlChar *xml_str; - xmlDocPtr doc; - xmlNodePtr root, children; - - if (*type && g_strcasecmp (type, "application/x-rdf-summary") != 0) { - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_Bonobo_Persist_WrongDataType, NULL); - return; - } - - bonobo_stream_client_read_string (stream, &str, ev); - if (ev->_major != CORBA_NO_EXCEPTION || str == NULL) { - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_Bonobo_Persist_WrongDataType, NULL); - return; - } - - doc = xmlParseDoc ((xmlChar *) str); - - if (doc == NULL) { - g_warning ("Bad data: %s!", str); - g_free (str); - return; - } - - g_free (str); - - root = doc->root; - children = root->childs; - while (children) { - if (strcasecmp (children->name, "location") == 0) { - xml_str = xmlNodeListGetString (doc, children->childs, 1); - summary->location = g_strdup (xml_str); - xmlFree (xml_str); - - children = children->next; - continue; - } - - if (strcasecmp (children->name, "limit") == 0) { - xml_str = xmlNodeListGetString (doc, children->childs, 1); - summary->limit = atoi (xml_str); - xmlFree (xml_str); - - children = children->next; - continue; - } - - if (strcasecmp (children->name, "showtitle") == 0) { - xml_str = xmlNodeListGetString (doc, children->childs, 1); - summary->showtitle = atoi (xml_str); - xmlFree (xml_str); - - children = children->next; - continue; - } - - if (strcasecmp (children->name, "usetimer") == 0) { - xml_str = xmlNodeListGetString (doc, children->childs, 1); - summary->usetimer = atoi (xml_str); - xmlFree (xml_str); - - children = children->next; - continue; - } - - if (strcasecmp (children->name, "timer") == 0) { - xml_str = xmlNodeListGetString (doc, children->childs, 1); - summary->time = atoi (xml_str); - xmlFree (xml_str); - - children = children->next; - continue; - } - - g_print ("Unknown name: %s\n", children->name); - children = children->next; - } - xmlFreeDoc (doc); -} - -static char * -summary_to_string (RdfSummary *summary) -{ - xmlChar *out_str; - int out_len = 0; - xmlDocPtr doc; - xmlNodePtr root; - xmlNsPtr ns; - char *tmp_str; - - doc = xmlNewDoc ("1.0"); - ns = xmlNewGlobalNs (doc, "http://www.ximian.com", "rdf"); - - doc->root = xmlNewDocNode (doc, ns, "rdf-summary", NULL); - - xmlNewChild (doc->root, ns, "location", summary->location); - tmp_str = g_strdup_printf ("%d", summary->limit); - xmlNewChild (doc->root, ns, "limit", tmp_str); - g_free (tmp_str); - - tmp_str = g_strdup_printf ("%d", summary->showtitle); - xmlNewChild (doc->root, ns, "showtitle", tmp_str); - g_free (tmp_str); - - tmp_str = g_strdup_printf ("%d", summary->usetimer); - xmlNewChild (doc->root, ns, "usetimer", tmp_str); - g_free (tmp_str); - - tmp_str = g_strdup_printf ("%d", summary->time); - xmlNewChild (doc->root, ns, "timer", tmp_str); - g_free (tmp_str); - - xmlDocDumpMemory (doc, &out_str, &out_len); - - return out_str; -} - -static void -save_to_stream (BonoboPersistStream *ps, - const Bonobo_Stream stream, - Bonobo_Persist_ContentType type, - gpointer data, - CORBA_Environment *ev) -{ - RdfSummary *summary = (RdfSummary *) data; - char *str; - - if (*type && g_strcasecmp (type, "application/x-rdf-summary") != 0) { - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_Bonobo_Persist_WrongDataType, NULL); - return; - } - - str = summary_to_string (summary); - if (str) - bonobo_stream_client_printf (stream, TRUE, ev, str); - xmlFree (str); - - return; -} - -static Bonobo_Persist_ContentTypeList * -content_types (BonoboPersistStream *ps, - void *closure, - CORBA_Environment *ev) -{ - return bonobo_persist_generate_content_types (1, "application/x-rdf-summary"); -} - -static void -display_doc (RdfSummary *summary) -{ - GString *html; - - html = g_string_new (""); - - tree_walk (summary->cache->root, summary, html); - executive_summary_html_view_set_html (EXECUTIVE_SUMMARY_HTML_VIEW (summary->view), html->str); - g_string_free (html, TRUE); -} - -static void -close_callback (GnomeVFSAsyncHandle *handle, - GnomeVFSResult result, - RdfSummary *summary) -{ - xmlDocPtr doc; - char *xml; - - if (summary == NULL) - return; - - summary->handle = NULL; - g_free (summary->buffer); - xml = summary->str->str; - g_string_free (summary->str, FALSE); - - if (summary->cache != NULL) - xmlFreeDoc (summary->cache); - - doc = xmlParseMemory (xml, strlen (xml)); - if (doc == NULL) { - char *emsg; - BonoboArg *arg; - - arg = bonobo_arg_new (BONOBO_ARG_STRING); - BONOBO_ARG_SET_STRING (arg, _("Error")); - bonobo_property_bag_set_value (summary->bag, - "window_title", - (const BonoboArg *) arg, - NULL); - bonobo_arg_release (arg); - - emsg = g_strdup_printf ("<b>Cannot open location:<br>%s</b>", - summary->location); - executive_summary_html_view_set_html (EXECUTIVE_SUMMARY_HTML_VIEW (summary->view), emsg); - g_free (emsg); - g_free (xml); - return; - } - - g_free (xml); - - /* Cache it for later */ - summary->cache = doc; - - /* Draw it */ - display_doc (summary); -} - -static void -read_callback (GnomeVFSAsyncHandle *handle, - GnomeVFSResult result, - gpointer buffer, - GnomeVFSFileSize bytes_requested, - GnomeVFSFileSize bytes_read, - RdfSummary *summary) -{ - if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) { - char *emsg; - BonoboArg *arg; - - arg = bonobo_arg_new (BONOBO_ARG_STRING); - BONOBO_ARG_SET_STRING (arg, _("Error")); - bonobo_property_bag_set_value (summary->bag, - "window_title", - (const BonoboArg *) arg, - NULL); - bonobo_arg_release (arg); - - emsg = g_strdup_printf ("<b>Cannot open location:<br>%s</b>", - summary->location); - executive_summary_html_view_set_html (EXECUTIVE_SUMMARY_HTML_VIEW (summary->view), emsg); - g_free (emsg); - gnome_vfs_async_close (handle, - (GnomeVFSAsyncCloseCallback) close_callback, - NULL); - g_print ("NULLING\n"); - summary->handle = NULL; - } - - if (bytes_read == 0) { - /* EOF */ - gnome_vfs_async_close (handle, - (GnomeVFSAsyncCloseCallback) close_callback, - summary); - } else { - *((char *) buffer + bytes_read) = 0; - g_string_append (summary->str, (const char *) buffer); - gnome_vfs_async_read (handle, buffer, 4095, - (GnomeVFSAsyncReadCallback) read_callback, - summary); - } -} - -static void -open_callback (GnomeVFSAsyncHandle *handle, - GnomeVFSResult result, - RdfSummary *summary) -{ - GList *uri; - char *buffer; - - if (result != GNOME_VFS_OK) { - char *emsg; - BonoboArg *arg; - - arg = bonobo_arg_new (BONOBO_ARG_STRING); - BONOBO_ARG_SET_STRING (arg, _("Error")); - bonobo_property_bag_set_value (summary->bag, - "window_title", - (const BonoboArg *) arg, - NULL); - bonobo_arg_release (arg); - - emsg = g_strdup_printf ("<b>Cannot open location:<br>%s</b>", - summary->location); - executive_summary_html_view_set_html (EXECUTIVE_SUMMARY_HTML_VIEW (summary->view), emsg); - g_free (emsg); - summary->handle = NULL; - return; - } - - summary->str = g_string_new (""); - summary->buffer = g_new (char, 4096); - - gnome_vfs_async_read (handle, summary->buffer, 4095, - (GnomeVFSAsyncReadCallback) read_callback, - summary); -} - -static int -download (RdfSummary *summary) -{ - GnomeVFSAsyncHandle *handle; - char *html = "<b>Loading RDF file. . .<br>Please wait</b>"; - - executive_summary_html_view_set_html (EXECUTIVE_SUMMARY_HTML_VIEW (summary->view), - html); - - gnome_vfs_async_open (&handle, summary->location, GNOME_VFS_OPEN_READ, - (GnomeVFSAsyncOpenCallback) open_callback, - summary); - - summary->handle = handle; - return FALSE; -} - -static void -download_cb (GtkWidget *w, - RdfSummary *summary) -{ - download (summary); -} - -static void -get_prop (BonoboPropertyBag *bag, - BonoboArg *arg, - guint arg_id, - CORBA_Environment *ev, - gpointer user_data) -{ - RdfSummary *summary = (RdfSummary *) user_data; - - switch (arg_id) { - case PROPERTY_TITLE: - BONOBO_ARG_SET_STRING (arg, summary->title); - break; - - case PROPERTY_ICON: - BONOBO_ARG_SET_STRING (arg, summary->icon); - break; - - default: - break; - } -} - -static void -set_prop (BonoboPropertyBag *bag, - const BonoboArg *arg, - guint arg_id, - CORBA_Environment *ev, - gpointer user_data) -{ - RdfSummary *summary = (RdfSummary *) user_data; - - switch (arg_id) { - case PROPERTY_TITLE: - if (summary->title) - g_free (summary->title); - - summary->title = g_strdup (BONOBO_ARG_GET_STRING (arg)); - g_print ("Notify listener!\n"); - bonobo_property_bag_notify_listeners (bag, "window_title", - arg, NULL); - break; - - case PROPERTY_ICON: - if (summary->icon) - g_free (summary->icon); - - summary->icon = g_strdup (BONOBO_ARG_GET_STRING (arg)); - g_print ("Notify listener 2\n"); - bonobo_property_bag_notify_listeners (bag, "window_icon", - arg, NULL); - break; - - default: - break; - } -} - -static void -item_changed (GtkWidget *widget, - RdfSummary *summary) -{ - if (widget == summary->g_update) { - summary->usetimer = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - gtk_widget_set_sensitive (summary->g_update_container, - summary->usetimer); - } - - bonobo_property_control_changed (summary->property_control, NULL); -} - -static BonoboControl * -property_control (BonoboPropertyControl *property_control, - int page_num, - gpointer user_data) -{ - BonoboControl *control; - RdfSummary *summary = (RdfSummary *) user_data; - GtkWidget *container, *label, *hbox, *spinner, *button; - char *climit; - - container = gtk_vbox_new (FALSE, 2); - gtk_container_set_border_width (GTK_CONTAINER (container), 2); - hbox = gtk_hbox_new (FALSE, 2); - - label = gtk_label_new ("Location:"); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - - summary->rdf = gtk_entry_new (); - if (summary->location) - gtk_entry_set_text (GTK_ENTRY (summary->rdf), summary->location); - - gtk_signal_connect (GTK_OBJECT (summary->rdf), "changed", - GTK_SIGNAL_FUNC (item_changed), summary); - - gtk_box_pack_start (GTK_BOX (hbox), summary->rdf, TRUE, TRUE, 0); - - gtk_box_pack_start (GTK_BOX (container), hbox, FALSE, FALSE, 0); - - hbox = gtk_hbox_new (FALSE, 2); - - label = gtk_label_new ("Maximum number of entries:"); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - - summary->g_limit = gtk_entry_new (); - climit = g_strdup_printf ("%d", summary->limit); - gtk_entry_set_text (GTK_ENTRY (summary->g_limit), climit); - g_free (climit); - - gtk_signal_connect (GTK_OBJECT (summary->g_limit), "changed", - GTK_SIGNAL_FUNC (item_changed), summary); - - gtk_box_pack_start (GTK_BOX (hbox), summary->g_limit, TRUE, TRUE, 0); - - hbox = gtk_hbox_new (FALSE, 2); - - /* FIXME: Do this better? */ - label = gtk_label_new ("Show window title"); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - - summary->g_title = gtk_check_button_new (); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (summary->g_title), - summary->showtitle); - - gtk_signal_connect (GTK_OBJECT (summary->g_title), "toggled", - GTK_SIGNAL_FUNC (item_changed), summary); - - gtk_box_pack_start (GTK_BOX (hbox), summary->g_title, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (container), hbox, FALSE, FALSE, 0); - - hbox = gtk_hbox_new (FALSE, 2); - - /* Update */ - hbox = gtk_hbox_new (FALSE, 2); - label = gtk_label_new (_("Update automatically")); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - summary->g_update = gtk_check_button_new (); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (summary->g_update), - summary->usetimer); - - gtk_signal_connect (GTK_OBJECT (summary->g_update), "toggled", - GTK_SIGNAL_FUNC (item_changed), summary); - gtk_box_pack_start (GTK_BOX (hbox), summary->g_update, TRUE, TRUE, 0); - - button = gtk_button_new_with_label (_("Update now")); - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (download_cb), summary); - gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (container), hbox, FALSE, FALSE, 0); - - /* Timer */ - hbox = gtk_hbox_new (FALSE, 2); - summary->g_update_container = hbox; - - label = gtk_label_new (_("Update every ")); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - - summary->adjustment = GTK_ADJUSTMENT(gtk_adjustment_new (summary->time / 1000 / 60, - 1.0, 1000.0, 1.0, 10.0, 1.0)); - spinner = gtk_spin_button_new (summary->adjustment, 1.0, 0); - gtk_signal_connect (GTK_OBJECT (spinner), "changed", - GTK_SIGNAL_FUNC (item_changed), summary); - - gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0); - - label = gtk_label_new (_("minutes")); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - - gtk_box_pack_start (GTK_BOX (container), hbox, FALSE, FALSE, 0); - gtk_widget_set_sensitive (hbox, summary->usetimer); - - gtk_widget_show_all (container); - - control = bonobo_control_new (container); - return control; -} - -static void -property_action (GtkObject *property_control, - int page_num, - Bonobo_PropertyControl_Action action, - RdfSummary *summary) -{ - gboolean changed = FALSE; - char *old_location; - - switch (action) { - case Bonobo_PropertyControl_APPLY: - old_location = summary->location; - summary->showtitle = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (summary->g_title)); - summary->location = g_strdup (gtk_entry_get_text (GTK_ENTRY (summary->rdf))); - if (strcmp (old_location, summary->location) != 0) - changed = TRUE; - - summary->limit = atoi (gtk_entry_get_text (GTK_ENTRY (summary->g_limit))); - summary->time = summary->adjustment->value * 60 * 1000; - if (summary->timer) - gtk_timeout_remove (summary->timer); - summary->timer = gtk_timeout_add (summary->time, - (GSourceFunc)download, summary); - - if (changed) - g_idle_add ((GSourceFunc) download, summary); - else - g_idle_add ((GSourceFunc) display_doc, summary); - - g_free (old_location); - break; - - case Bonobo_PropertyControl_HELP: - g_print ("HELP: Page %d!\n", page_num); - break; - - default: - break; - } -} - -static BonoboObject * -create_view (ExecutiveSummaryComponentFactory *_factory, - void *closure) -{ - RdfSummary *summary; - BonoboObject *component, *view; - BonoboEventSource *event_source; - BonoboPersistStream *stream; - BonoboPropertyBag *bag; - BonoboPropertyControl *property; - - summary = g_new (RdfSummary, 1); - summary->icon = g_strdup ("apple-green.png"); - summary->title = g_strdup ("Downloading..."); - summary->location = g_strdup ("http://news.gnome.org/gnome-news/rdf"); - summary->limit = 10; - summary->showtitle = TRUE; - - summary->cache = NULL; - - summary->usetimer = TRUE; - summary->time = 600000; /* 10 minutes */ - summary->timer = gtk_timeout_add (summary->time, (GSourceFunc) download, - summary); - - component = executive_summary_component_new (); - gtk_signal_connect (GTK_OBJECT (component), "destroy", - GTK_SIGNAL_FUNC (view_destroyed), summary); - - summary->component = component; - - /* Share the event source between the ExecutiveSummaryHtmlView and the - BonoboPropertyControl as we can only have one Bonobo::EventSource - interface aggregated */ - event_source = bonobo_event_source_new (); - - /* Summary::HtmlView */ - view = executive_summary_html_view_new_full (event_source); - - summary->view = view; - bonobo_object_add_interface (component, view); - - /* Bonobo::PropertyBag */ - bag = bonobo_property_bag_new_full (get_prop, set_prop, - event_source, summary); - - summary->bag = bag; - bonobo_property_bag_add (bag, - "window_title", PROPERTY_TITLE, - BONOBO_ARG_STRING, NULL, - "The title of this component's window", 0); - bonobo_property_bag_add (bag, - "window_icon", PROPERTY_ICON, - BONOBO_ARG_STRING, NULL, - "The icon for this component's window", 0); - bonobo_object_add_interface (component, BONOBO_OBJECT(bag)); - - /* Bonobo::PropertyControl */ - property = bonobo_property_control_new_full (property_control, 1, - event_source, - summary); - summary->property_control = property; - - gtk_signal_connect (GTK_OBJECT (property), "action", - GTK_SIGNAL_FUNC (property_action), summary); - - bonobo_object_add_interface (component, BONOBO_OBJECT(property)); - - /* Bonobo::PersistStream */ - stream = bonobo_persist_stream_new (load_from_stream, save_to_stream, - NULL, content_types, summary); - bonobo_object_add_interface (component, BONOBO_OBJECT (stream)); - - running_views++; - gtk_idle_add ((GSourceFunc) download, summary); - - return component; -} - -static BonoboObject * -factory_fn (BonoboGenericFactory *_factory, - void *closure) -{ - BonoboObject *component_factory; - - component_factory = executive_summary_component_factory_new (create_view, NULL); - return component_factory; -} - -static void -factory_init (void) -{ - if (factory != NULL) { - return; - } - - factory = bonobo_generic_factory_new (RDF_SUMMARY_ID, factory_fn, NULL); - if (factory == NULL) { - g_error ("Cannot initialize factory"); - } -} - -int -main (int argc, - char *argv[]) -{ - CORBA_ORB orb; - - bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR); - textdomain (PACKAGE); - - gnome_init_with_popt_table ("RDF-Summary", VERSION, - argc, argv, oaf_popt_options, 0, NULL); - orb = oaf_init (argc, argv); - gnome_vfs_init (); - - if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) { - g_error ("Could not initialize Bonobo"); - } - - factory_init (); - bonobo_main (); - - return 0; -} - diff --git a/executive-summary/widgets/.cvsignore b/executive-summary/widgets/.cvsignore deleted file mode 100644 index ddca354b6d..0000000000 --- a/executive-summary/widgets/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile.in -Makefile -.deps -.libs -esummary-window-test
\ No newline at end of file diff --git a/executive-summary/widgets/Makefile.am b/executive-summary/widgets/Makefile.am deleted file mode 100644 index f83d956d63..0000000000 --- a/executive-summary/widgets/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -INCLUDES = \ - -I$(top_srcdir) \ - -I$(includedir) \ - $(GNOME_INCLUDEDIR) \ - -DG_LOG_DOMAIN=\"Executive-Summary-Widgets\" \ - -g \ - -Wall \ - -Wmissing-prototypes \ - -Wmissing-declarations - -noinst_LIBRARIES = libesummary-widgets.a - -libesummary_widgets_a_SOURCES = \ - e-summary-subwindow.c \ - e-summary-subwindow.h \ - e-summary-titlebar.c \ - e-summary-titlebar.h \ - e-summary-title-button.c \ - e-summary-title-button.h - -noinst_PROGRAMS = \ - esummary-window-test - -esummary_window_test_SOURCES = \ - esummary-window-test.c - -esummary_window_test_LDADD = \ - $(EXTRA_GNOME_LIBS) \ - libesummary-widgets.a \ - $(BONOBO_GNOME_LIBS) \ - $(top_builddir)/e-util/libeutil.la - diff --git a/executive-summary/widgets/e-summary-subwindow.c b/executive-summary/widgets/e-summary-subwindow.c deleted file mode 100644 index d93e170690..0000000000 --- a/executive-summary/widgets/e-summary-subwindow.c +++ /dev/null @@ -1,301 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary.c - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gtk/gtkframe.h> -#include <gal/util/e-util.h> -#include <gal/widgets/e-font.h> -#include <gal/e-text/e-text.h> -#include <libgnomeui/gnome-canvas.h> -#include <libgnomeui/gnome-canvas-widget.h> - -#include "e-summary-subwindow.h" -#include "e-summary-titlebar.h" - -#define PARENT_TYPE (gnome_canvas_group_get_type ()) -#define TITLEBAR_BORDER_WIDTH 2 - -static void e_summary_subwindow_destroy (GtkObject *object); -static void e_summary_subwindow_class_init (GtkObjectClass *object_class); -static void e_summary_subwindow_init (GtkObject *object); - -static GnomeCanvasGroupClass *parent_class; - -struct _ESummarySubwindowPrivate { - GnomeCanvasItem *titlebar; - GnomeCanvasItem *contents; - - GtkWidget *container; - - char *title; -}; - -enum { - ARG_0, - ARG_X, - ARG_Y, - ARG_WIDTH, - ARG_HEIGHT, - ARG_STATE -}; - -enum { - CLOSE_CLICKED, - SHADE_CLICKED, - EDIT_CLICKED, - LAST_SIGNAL -}; - -static guint32 e_summary_subwindow_signals[LAST_SIGNAL] = { 0 }; - -static void -e_summary_subwindow_destroy (GtkObject *object) -{ - ESummarySubwindow *subwindow = E_SUMMARY_SUBWINDOW (object); - ESummarySubwindowPrivate *priv; - - priv = subwindow->private; - - if (priv == NULL) - return; - - if (priv->container) { - gtk_widget_destroy (priv->container); - priv->container = NULL; - } - - if (priv->title) { - g_free (priv->title); - priv->title = NULL; - } - - g_free (subwindow->private); - subwindow->private = NULL; - - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} - -static void -e_summary_subwindow_realize (GnomeCanvasItem *item) -{ - if (GNOME_CANVAS_ITEM_CLASS (parent_class)->realize) - (* GNOME_CANVAS_ITEM_CLASS (parent_class)->realize) (item); -} - -static void -e_summary_subwindow_unrealize (GnomeCanvasItem *item) -{ - if (GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize) - (* GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize) (item); -} - -static void -e_summary_subwindow_class_init (GtkObjectClass *object_class) -{ - GnomeCanvasItemClass *item_class; - - item_class = (GnomeCanvasItemClass *) object_class; - - object_class->destroy = e_summary_subwindow_destroy; - - item_class->realize = e_summary_subwindow_realize; - item_class->unrealize = e_summary_subwindow_unrealize; - - parent_class = gtk_type_class (PARENT_TYPE); -} - -static void -e_summary_subwindow_init (GtkObject *object) -{ - ESummarySubwindow *subwindow = E_SUMMARY_SUBWINDOW (object); - ESummarySubwindowPrivate *priv; - - subwindow->private = g_new0 (ESummarySubwindowPrivate, 1); - priv = subwindow->private; - - priv->title = NULL; -} - -E_MAKE_TYPE (e_summary_subwindow, "ESummarySubwindow", ESummarySubwindow, - e_summary_subwindow_class_init, e_summary_subwindow_init, - PARENT_TYPE); - -static void -container_size_allocate (GtkWidget *widget, - GtkAllocation *allocation, - ESummarySubwindow *subwindow) -{ - ESummarySubwindowPrivate *priv; - - g_return_if_fail (subwindow != NULL); - g_return_if_fail (IS_E_SUMMARY_SUBWINDOW (subwindow)); - - priv = subwindow->private; - - gnome_canvas_item_set (priv->titlebar, - "width", (double) allocation->width - 1, - NULL); - -} - -static void -edit_cb (GnomeCanvasItem *item, - ESummarySubwindow *subwindow) -{ - g_print ("EDIT!\n"); -} - -static void -shade_cb (GnomeCanvasItem *item, - ESummarySubwindow *subwindow) -{ - g_print ("SHADE!\n"); -} - -static void -close_cb (GnomeCanvasItem *item, - ESummarySubwindow *subwindow) -{ - g_print ("CLOSE!\n"); - gtk_object_destroy (GTK_OBJECT (subwindow)); -} - -void -e_summary_subwindow_construct (GnomeCanvasItem *item) -{ - GnomeCanvasGroup *group; - ESummarySubwindow *subwindow; - ESummarySubwindowPrivate *priv; - EFont *font; - int titlebar_height; - - g_return_if_fail (item != NULL); - g_return_if_fail (IS_E_SUMMARY_SUBWINDOW (item)); - - subwindow = E_SUMMARY_SUBWINDOW (item); - priv = subwindow->private; - - group = GNOME_CANVAS_GROUP (item); - - font = e_font_from_gdk_font ( ((GtkWidget *) item->canvas)->style->font); - - titlebar_height = 18 + 2 * TITLEBAR_BORDER_WIDTH; /* FIXME: Not hardcoded */ - - priv->titlebar = gnome_canvas_item_new (group, - e_summary_titlebar_get_type (), - "text", "Titlebar", - "width", 100.0, - NULL); - gtk_signal_connect (GTK_OBJECT (priv->titlebar), "edit", - GTK_SIGNAL_FUNC (edit_cb), subwindow); - gtk_signal_connect (GTK_OBJECT (priv->titlebar), "shade", - GTK_SIGNAL_FUNC (shade_cb), subwindow); - gtk_signal_connect (GTK_OBJECT (priv->titlebar), "close", - GTK_SIGNAL_FUNC (close_cb), subwindow); - - priv->container = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (priv->container), GTK_SHADOW_ETCHED_IN); - gtk_widget_show (priv->container); - - priv->contents = gnome_canvas_item_new (group, - gnome_canvas_widget_get_type (), - "x", (double) 0, - "y", (double) titlebar_height + 1, - "widget", priv->container, - NULL); - gtk_signal_connect (GTK_OBJECT (priv->container), "size_allocate", - GTK_SIGNAL_FUNC (container_size_allocate), subwindow); - -} - -GnomeCanvasItem * -e_summary_subwindow_new (GnomeCanvasGroup *parent, - double x, - double y) -{ - GnomeCanvasItem *item; - - item = gnome_canvas_item_new (parent, e_summary_subwindow_get_type (), - "x", x, - "y", y, - NULL); - e_summary_subwindow_construct (item); - - return item; -} - -/* These functions mimic the GtkContainer methods */ - -void -e_summary_subwindow_add (ESummarySubwindow *subwindow, - GtkWidget *widget) -{ - ESummarySubwindowPrivate *priv; - - g_return_if_fail (subwindow != NULL); - g_return_if_fail (IS_E_SUMMARY_SUBWINDOW (subwindow)); - g_return_if_fail (widget != NULL); - g_return_if_fail (GTK_IS_WIDGET (widget)); - - priv = subwindow->private; - - gtk_container_add (GTK_CONTAINER (priv->container), widget); - -} - -void -e_summary_subwindow_remove (ESummarySubwindow *subwindow, - GtkWidget *widget) -{ - ESummarySubwindowPrivate *priv; - - g_return_if_fail (subwindow != NULL); - g_return_if_fail (IS_E_SUMMARY_SUBWINDOW (subwindow)); - g_return_if_fail (widget != NULL); - g_return_if_fail (GTK_IS_WIDGET (widget)); - - priv = subwindow->private; - - gtk_container_remove (GTK_CONTAINER (priv->container), widget); -} - -void -e_summary_subwindow_set_title (ESummarySubwindow *subwindow, - const char *title) -{ - ESummarySubwindowPrivate *priv; - - g_return_if_fail (subwindow != NULL); - g_return_if_fail (IS_E_SUMMARY_SUBWINDOW (subwindow)); - g_return_if_fail (title != NULL); - - priv = subwindow->private; - if (priv->title) - g_free (priv->title); - - priv->title = g_strdup (title); -} diff --git a/executive-summary/widgets/e-summary-subwindow.h b/executive-summary/widgets/e-summary-subwindow.h deleted file mode 100644 index daad080a9c..0000000000 --- a/executive-summary/widgets/e-summary-subwindow.h +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-subwindow.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _E_SUMMARY_SUBWINDOW_H__ -#define _E_SUMMARY_SUBWINDIW_H__ - -#include <gtk/gtksignal.h> -#include <libgnomeui/gnome-canvas.h> - -#define E_SUMMARY_SUBWINDOW_TYPE (e_summary_subwindow_get_type ()) -#define E_SUMMARY_SUBWINDOW(obj) (GTK_CHECK_CAST ((obj), E_SUMMARY_SUBWINDOW_TYPE, ESummarySubwindow)) -#define E_SUMMARY_SUBWINDOW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_SUMMARY_SUBWINDOW_TYPE, ESummarySubwindowClass)) -#define IS_E_SUMMARY_SUBWINDOW(obj) (GTK_CHECK_TYPE ((obj), E_SUMMARY_SUBWINDOW_TYPE)) -#define IS_E_SUMMARY_SUBWINDOW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_SUMMARY_SUBWINDOW_TYPE)) - -typedef struct _ESummarySubwindowPrivate ESummarySubwindowPrivate; -typedef struct _ESummarySubwindow ESummarySubwindow; -typedef struct _ESummarySubwindowClass ESummarySubwindowClass; - -struct _ESummarySubwindow { - GnomeCanvasGroup parent; - - ESummarySubwindowPrivate *private; -}; - -struct _ESummarySubwindowClass { - GnomeCanvasGroupClass parent_class; - - void (*close_clicked) (ESummarySubwindow *window); - void (*shade_clicked) (ESummarySubwindow *window); - void (*edit_clicked) (ESummarySubwindow *window); -}; - -GtkType e_summary_subwindow_get_type (void); - -void e_summary_subwindow_construct (GnomeCanvasItem *subwindow); -GnomeCanvasItem *e_summary_subwindow_new (GnomeCanvasGroup *parent, - double x, - double y); - -void e_summary_subwindow_add (ESummarySubwindow *subwindow, - GtkWidget *widget); -void e_summary_subwindow_remove (ESummarySubwindow *subwindow, - GtkWidget *widget); -void e_summary_subwindow_set_title (ESummarySubwindow *subwindow, - const char *title); - -#endif diff --git a/executive-summary/widgets/e-summary-title-button.c b/executive-summary/widgets/e-summary-title-button.c deleted file mode 100644 index 6a1992c6df..0000000000 --- a/executive-summary/widgets/e-summary-title-button.c +++ /dev/null @@ -1,403 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-title-buttons.c - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <libgnomeui/gnome-canvas-rect-ellipse.h> -#include <gal/util/e-util.h> - -#include <gdk-pixbuf/gdk-pixbuf.h> - -#include "e-summary-title-button.h" - -#define PARENT_TYPE (gnome_canvas_rect_get_type ()) - -enum { - ARG_0, - ARG_PIXBUF, - ARG_X, - ARG_Y -}; - -enum { - CLICKED, - LAST_SIGNAL -}; - -static void e_summary_title_button_destroy (GtkObject *object); -static void e_summary_title_button_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void e_summary_title_button_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void e_summary_title_button_class_init (ESummaryTitleButtonClass *estb_class); -static void e_summary_title_button_init (ESummaryTitleButton *estb); -static double e_summary_title_button_point (GnomeCanvasItem *item, - double x, - double y, - int cx, - int cy, - GnomeCanvasItem **actual_item); -static void e_summary_title_button_update (GnomeCanvasItem *item, - double affine[6], - ArtSVP *clip_path, - gint flags); -static void e_summary_title_button_draw (GnomeCanvasItem *item, - GdkDrawable *drawable, - int x, int y, - int width, int height); -static gint e_summary_title_button_event (GnomeCanvasItem *item, - GdkEvent *event); - -static GnomeCanvasRectClass *parent_class; -static guint estb_signals[LAST_SIGNAL] = { 0 }; - -struct _ESummaryTitleButtonPrivate { - GdkPixbuf *pixbuf; - double x, y; - int width, height; - - int in_button : 1; - int button_down : 1; -}; - -static void -e_summary_title_button_destroy (GtkObject *object) -{ - ESummaryTitleButton *estb; - ESummaryTitleButtonPrivate *priv; - - estb = E_SUMMARY_TITLE_BUTTON (object); - priv = estb->private; - - if (priv == NULL) - return; - - gdk_pixbuf_unref (priv->pixbuf); - - g_free (priv); - estb->private = NULL; - - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} - -static void -e_summary_title_button_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - ESummaryTitleButton *estb; - ESummaryTitleButtonPrivate *priv; - gboolean update = FALSE; - - estb = E_SUMMARY_TITLE_BUTTON (object); - priv = estb->private; - - switch (arg_id) { - case ARG_PIXBUF: - if (priv->pixbuf) - gdk_pixbuf_unref (priv->pixbuf); - - priv->pixbuf = GTK_VALUE_POINTER (*arg); - gdk_pixbuf_ref (priv->pixbuf); - - priv->width = gdk_pixbuf_get_width (priv->pixbuf); - priv->height = gdk_pixbuf_get_height (priv->pixbuf); - - update = TRUE; - break; - - case ARG_X: - priv->x = GTK_VALUE_DOUBLE (*arg); - break; - - case ARG_Y: - priv->y = GTK_VALUE_DOUBLE (*arg); - break; - - default: - break; - - } - - if (update) - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (estb)); - -} - -static void -e_summary_title_button_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - ESummaryTitleButton *estb; - ESummaryTitleButtonPrivate *priv; - - estb = E_SUMMARY_TITLE_BUTTON (object); - priv = estb->private; - - switch (arg_id) { - case ARG_PIXBUF: - GTK_VALUE_POINTER (*arg) = priv->pixbuf; - break; - - case ARG_X: - GTK_VALUE_DOUBLE (*arg) = priv->x; - break; - - case ARG_Y: - GTK_VALUE_DOUBLE (*arg) = priv->y; - break; - - default: - arg->type = GTK_TYPE_INVALID; - break; - - } -} - -static void -e_summary_title_button_init (ESummaryTitleButton *estb) -{ - estb->private = g_new0 (ESummaryTitleButtonPrivate, 1); -} - -static void -e_summary_title_button_class_init (ESummaryTitleButtonClass *estb_class) -{ - GtkObjectClass *object_class; - GnomeCanvasItemClass *item_class; - - object_class = (GtkObjectClass *) estb_class; - item_class = (GnomeCanvasItemClass *) estb_class; - - object_class->destroy = e_summary_title_button_destroy; - object_class->set_arg = e_summary_title_button_set_arg; - object_class->get_arg = e_summary_title_button_get_arg; - - item_class->draw = e_summary_title_button_draw; - item_class->point = e_summary_title_button_point; - item_class->update = e_summary_title_button_update; - item_class->event = e_summary_title_button_event; - - gtk_object_add_arg_type ("ESummaryTitleButton::pixbuf", - GTK_TYPE_POINTER, - GTK_ARG_READWRITE, - ARG_PIXBUF); - gtk_object_add_arg_type ("ESummaryTitleButton::x", - GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, - ARG_X); - gtk_object_add_arg_type ("ESummaryTitleButton::y", - GTK_TYPE_DOUBLE, - GTK_ARG_READWRITE, - ARG_Y); - estb_signals[CLICKED] = gtk_signal_new ("clicked", GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (ESummaryTitleButtonClass, - clicked), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - gtk_object_class_add_signals (object_class, estb_signals, LAST_SIGNAL); - - parent_class = gtk_type_class (PARENT_TYPE); -} - -E_MAKE_TYPE (e_summary_title_button, "ESummaryTitleButton", - ESummaryTitleButton, e_summary_title_button_class_init, - e_summary_title_button_init, PARENT_TYPE); - -static double -e_summary_title_button_point (GnomeCanvasItem *item, - double x, - double y, - int cx, - int cy, - GnomeCanvasItem **actual_item) -{ - ESummaryTitleButton *estb; - ESummaryTitleButtonPrivate *priv; - double d = 1.0; - - estb = E_SUMMARY_TITLE_BUTTON (item); - priv = estb->private; - - if (x >= priv->x && x <= priv->x + gdk_pixbuf_get_width (priv->pixbuf) - && y >= priv->y && y <= priv->y + gdk_pixbuf_get_height (priv->pixbuf)) { - d = 0.0; - *actual_item = item; - } - - return d; -} - -static void -get_bounds (ESummaryTitleButton *estb, - double *px1, double *py1, - double *px2, double *py2) -{ - GnomeCanvasItem *item; - ESummaryTitleButtonPrivate *priv; - double x1, y1, x2, y2; - int cx1, cy1, cx2, cy2; - - item = GNOME_CANVAS_ITEM (estb); - priv = estb->private; - - x1 = priv->x; - y1 = priv->y; - x2 = x1 + priv->width; - y2 = y1 + priv->height; - - gnome_canvas_item_i2w (item, &x1, &y1); - gnome_canvas_item_i2w (item, &x2, &x2); - gnome_canvas_w2c (item->canvas, x1, y1, &cx1, &cy1); - gnome_canvas_w2c (item->canvas, x2, y2, &cx2, &cy2); - - *px1 = cx1; - *py1 = cy1; - *px2 = cx2; - *py2 = cy2; -} - -static void -e_summary_title_button_update (GnomeCanvasItem *item, - double affine[6], - ArtSVP *clip_path, - gint flags) -{ - ESummaryTitleButton *estb; - ESummaryTitleButtonPrivate *priv; - double x1, y1, x2, y2; - - estb = E_SUMMARY_TITLE_BUTTON (item); - priv = estb->private; - - get_bounds (estb, &x1, &y1, &x2, &y2); - gnome_canvas_update_bbox (item, (int) x1, (int) y1, (int) x2, (int) y2); -} - -static void -e_summary_title_button_draw (GnomeCanvasItem *item, - GdkDrawable *drawable, - int x, int y, - int width, int height) -{ - ESummaryTitleButton *estb; - ESummaryTitleButtonPrivate *priv; - double i2w[6], w2c[6], i2c[6]; - int x1, x2, y1, y2; - ArtPoint i1, i2; - ArtPoint c1, c2; - GdkGC *gc; - - estb = E_SUMMARY_TITLE_BUTTON (item); - priv = estb->private; - - if (GNOME_CANVAS_ITEM_CLASS (parent_class)->draw) - (* GNOME_CANVAS_ITEM_CLASS (parent_class)->draw) (item, drawable, x, y, width, height); - - gnome_canvas_item_i2w_affine (item, i2w); - gnome_canvas_w2c_affine (item->canvas, w2c); - art_affine_multiply (i2c, i2w, w2c); - - i1.x = priv->x; - i1.y = priv->y; - i2.x = i1.x + priv->width + 4; - i2.y = i1.y + priv->height + 4; - art_affine_point (&c1, &i1, i2c); - art_affine_point (&c2, &i2, i2c); - x1 = c1.x; - y1 = c1.y; - x2 = c2.x; - y2 = c2.y; - - gc = gdk_gc_new (item->canvas->layout.bin_window); - gdk_draw_rectangle (drawable, gc, - FALSE, x1 - x, - y1 - y, - x2 - x1, - y2 - y1); - gdk_gc_unref (gc); - - gdk_pixbuf_render_to_drawable_alpha (priv->pixbuf, - drawable, - 0, 0, - x1 + 2, y1 + 2, - priv->width, priv->height, - GDK_PIXBUF_ALPHA_BILEVEL, - 127, - GDK_RGB_DITHER_NORMAL, - 0, 0); -} - -static gint -e_summary_title_button_event (GnomeCanvasItem *item, - GdkEvent *event) -{ - ESummaryTitleButton *estb; - ESummaryTitleButtonPrivate *priv; - - estb = E_SUMMARY_TITLE_BUTTON (item); - priv = estb->private; - - switch (event->type) { - case GDK_ENTER_NOTIFY: - priv->in_button = TRUE; - break; - - case GDK_LEAVE_NOTIFY: - priv->in_button = FALSE; - break; - - case GDK_BUTTON_PRESS: - if (priv->in_button) { - priv->button_down = TRUE; - gnome_canvas_item_grab (item, - GDK_LEAVE_NOTIFY_MASK | - GDK_ENTER_NOTIFY_MASK | - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_RELEASE_MASK, - NULL, event->button.time); - } - break; - - case GDK_BUTTON_RELEASE: - priv->button_down = FALSE; - gnome_canvas_item_ungrab (item, event->button.time); - - if (priv->in_button) { - gtk_signal_emit (GTK_OBJECT (estb), estb_signals[CLICKED]); - } - break; - - default: - return TRUE; - } - - return FALSE; -} diff --git a/executive-summary/widgets/e-summary-title-button.h b/executive-summary/widgets/e-summary-title-button.h deleted file mode 100644 index f79f986d07..0000000000 --- a/executive-summary/widgets/e-summary-title-button.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-title-button.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _E_SUMMARY_TITLE_BUTTON_H__ -#define _E_SUMMARY_TITLE_BUTTON_H__ - -#include <gtk/gtksignal.h> -#include <libgnomeui/gnome-canvas.h> -#include <libgnomeui/gnome-canvas-rect-ellipse.h> - -#define E_SUMMARY_TITLE_BUTTON_TYPE (e_summary_title_button_get_type ()) -#define E_SUMMARY_TITLE_BUTTON(obj) (GTK_CHECK_CAST ((obj), E_SUMMARY_TITLE_BUTTON_TYPE, ESummaryTitleButton)) -#define E_SUMMARY_TITLE_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_SUMMARY_TITLE_BUTTON_TYPE, ESummaryTitleButtonClass)) -#define IS_E_SUMMARY_TITLE_BUTTON(obj) (GTK_CHECK_TYPE ((obj), E_SUMMARY_TITLE_BUTTON_TYPE)) -#define IS_E_SUMMARY_TITLE_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_SUMMARY_TITLE_BUTTON_TYPE)) - -typedef struct _ESummaryTitleButtonPrivate ESummaryTitleButtonPrivate; -typedef struct _ESummaryTitleButton ESummaryTitleButton; -typedef struct _ESummaryTitleButtonClass ESummaryTitleButtonClass; - -struct _ESummaryTitleButton { - GnomeCanvasRect parent; - - ESummaryTitleButtonPrivate *private; -}; - -struct _ESummaryTitleButtonClass { - GnomeCanvasRectClass parent_class; - - void (*clicked) (ESummaryTitleButton *estb); -}; - -GtkType e_summary_title_button_get_type (void); - -#endif diff --git a/executive-summary/widgets/e-summary-titlebar.c b/executive-summary/widgets/e-summary-titlebar.c deleted file mode 100644 index b79e0dc8c7..0000000000 --- a/executive-summary/widgets/e-summary-titlebar.c +++ /dev/null @@ -1,412 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-titlebar.c - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gal/util/e-util.h> -#include <gal/widgets/e-font.h> - -#include <gal/e-text/e-text.h> - -#include <gdk-pixbuf/gdk-pixbuf.h> - -#include "e-summary-titlebar.h" -#include "e-summary-title-button.h" - -/* XPMS */ -#include "edit.xpm" -#include "x.xpm" -#include "shade.xpm" - -#define PARENT_TYPE (gnome_canvas_group_get_type ()) -#define TITLEBAR_BORDER_WIDTH 2 - -enum { - ARG_0, - ARG_TEXT, - ARG_WIDTH, - ARG_HEIGHT -}; - -enum { - EDIT, - SHADE, - CLOSE, - LAST_SIGNAL -}; - -static void e_summary_titlebar_destroy (GtkObject *object); -static void e_summary_titlebar_class_init (GtkObjectClass *object_class); -static void e_summary_titlebar_init (GtkObject *object); - -static GnomeCanvasGroupClass *parent_class; -static guint titlebar_signals[LAST_SIGNAL] = { 0 }; - -struct _ESummaryTitlebarPrivate { - GnomeCanvasItem *rect; - GnomeCanvasItem *titletext; - - GnomeCanvasItem *edit; - GnomeCanvasItem *shade; - GnomeCanvasItem *close; - - char *text; - double width, height; -}; - -static void -e_summary_titlebar_destroy (GtkObject *object) -{ - ESummaryTitlebar *titlebar; - ESummaryTitlebarPrivate *priv; - - titlebar = E_SUMMARY_TITLEBAR (object); - priv = titlebar->private; - - if (priv == NULL) - return; - - g_free (priv); - titlebar->private = NULL; - - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); -} - -static void -edit_cb (GnomeCanvasItem *item, - ESummaryTitlebar *titlebar) -{ - gtk_signal_emit (GTK_OBJECT (titlebar), titlebar_signals[EDIT]); -} - -static void -shade_cb (GnomeCanvasItem *item, - ESummaryTitlebar *titlebar) -{ - gtk_signal_emit (GTK_OBJECT (titlebar), titlebar_signals[SHADE]); -} - -static void -close_cb (GnomeCanvasItem *item, - ESummaryTitlebar *titlebar) -{ - gtk_signal_emit (GTK_OBJECT (titlebar), titlebar_signals[CLOSE]); -} - -static void -e_summary_titlebar_realize (GnomeCanvasItem *item) -{ - GnomeCanvasGroup *group; - ESummaryTitlebar *titlebar; - ESummaryTitlebarPrivate *priv; - GdkPixbuf *pb; - EFont *font; - int font_height; - - group = GNOME_CANVAS_GROUP (item); - titlebar = E_SUMMARY_TITLEBAR (item); - priv = titlebar->private; - - font = e_font_from_gdk_font (GTK_WIDGET (item->canvas)->style->font); - font_height = e_font_height (font); - priv->height = 18 + 2 * TITLEBAR_BORDER_WIDTH; /* FIXME: Not hardcoded */ - - priv->rect = gnome_canvas_item_new (group, - gnome_canvas_rect_get_type (), - "x1", 0.0, - "y1", 0.0, - "y2", (double) priv->height, - "x2", priv->width, - "fill_color_rgba", 0x88AAFFFF, - NULL); - - pb = gdk_pixbuf_new_from_xpm_data ((const char**) x_xpm); - priv->close = gnome_canvas_item_new (group, - e_summary_title_button_get_type (), - "x", (double) priv->width - TITLEBAR_BORDER_WIDTH - 18, - "y", (double) TITLEBAR_BORDER_WIDTH, - "pixbuf", pb, - NULL); - gdk_pixbuf_unref (pb); - gtk_signal_connect (GTK_OBJECT (priv->close), "clicked", - GTK_SIGNAL_FUNC (close_cb), titlebar); - - pb = gdk_pixbuf_new_from_xpm_data ((const char**) shade_xpm); - priv->shade = gnome_canvas_item_new (group, - e_summary_title_button_get_type (), - "x", (double) priv->width - (TITLEBAR_BORDER_WIDTH * 2) - 36, - "y", (double) TITLEBAR_BORDER_WIDTH, - "pixbuf", pb, - NULL); - gdk_pixbuf_unref (pb); - gtk_signal_connect (GTK_OBJECT (priv->shade), "clicked", - GTK_SIGNAL_FUNC (shade_cb), titlebar); - - pb = gdk_pixbuf_new_from_xpm_data ((const char**) edit_xpm); - priv->edit = gnome_canvas_item_new (group, - e_summary_title_button_get_type (), - "x", (double) priv->width - (TITLEBAR_BORDER_WIDTH * 3) - 54, - "y", (double) TITLEBAR_BORDER_WIDTH, - "pixbuf", pb, - NULL); - gdk_pixbuf_unref (pb); - gtk_signal_connect (GTK_OBJECT (priv->edit), "clicked", - GTK_SIGNAL_FUNC (edit_cb), titlebar); - - priv->titletext = gnome_canvas_item_new (group, - e_text_get_type (), - "text", priv->text, - "font_gdk", GTK_WIDGET (item->canvas)->style->font, - "clip_width", (double) priv->width - - (TITLEBAR_BORDER_WIDTH*4)- 50, - "clip_height", (double) e_font_height (font), - - "clip", TRUE, - "use_ellipsis", TRUE, - "fill_color", "black", - "anchor", GTK_ANCHOR_NW, - "draw_background", FALSE, - NULL); - gnome_canvas_item_move (priv->titletext, TITLEBAR_BORDER_WIDTH, - (priv->height - font_height) / 2); - - if (GNOME_CANVAS_ITEM_CLASS (parent_class)->realize) - (* GNOME_CANVAS_ITEM_CLASS (parent_class)->realize) (item); -} - -static void -e_summary_titlebar_unrealize (GnomeCanvasItem *item) -{ - if (GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize) - (* GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize) (item); -} - -static void -e_summary_titlebar_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - ESummaryTitlebar *titlebar; - ESummaryTitlebarPrivate *priv; - - titlebar = E_SUMMARY_TITLEBAR (object); - priv = titlebar->private; - - switch (arg_id) { - case ARG_TEXT: - if (priv->text) - g_free (priv->text); - - priv->text = g_strdup (GTK_VALUE_STRING (*arg)); - - if (priv->titletext) - gnome_canvas_item_set (priv->titletext, - "text", priv->text, - NULL); - break; - - case ARG_WIDTH: - priv->width = GTK_VALUE_DOUBLE (*arg); - - if (priv->rect) - gnome_canvas_item_set (priv->rect, - "x2", priv->width, - NULL); - if (priv->titletext) - gnome_canvas_item_set (priv->titletext, - "clip_width", priv->width - - (TITLEBAR_BORDER_WIDTH* 4) - 42, - NULL); - break; - - default: - break; - } -} - -static void -e_summary_titlebar_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - ESummaryTitlebar *titlebar; - ESummaryTitlebarPrivate *priv; - - titlebar = E_SUMMARY_TITLEBAR (object); - priv = titlebar->private; - - switch (arg_id) { - case ARG_TEXT: - GTK_VALUE_STRING (*arg) = priv->text; - break; - - case ARG_WIDTH: - GTK_VALUE_DOUBLE (*arg) = priv->width; - break; - - case ARG_HEIGHT: - GTK_VALUE_DOUBLE (*arg) = priv->height; - break; - - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -static gint -e_summary_titlebar_event (GnomeCanvasItem *item, - GdkEvent *event) -{ - if (event->type == GDK_2BUTTON_PRESS && - event->button.button == 1) { - gtk_signal_emit (GTK_OBJECT (item), titlebar_signals[SHADE]); - return FALSE; - } else { - return TRUE; - } -} - -static double -e_summary_titlebar_point (GnomeCanvasItem *item, - double x, - double y, - int cx, - int cy, - GnomeCanvasItem **actual_item) -{ - ESummaryTitlebar *est; - ESummaryTitlebarPrivate *priv; - GnomeCanvasItem *ret_item; - double d; - - est = E_SUMMARY_TITLEBAR (item); - priv = est->private; - - d = (* GNOME_CANVAS_ITEM_CLASS - (GTK_OBJECT (priv->edit)->klass)->point) (priv->edit, - x, y, - cx, cy, - &ret_item); - if (d == 0.0) { - *actual_item = ret_item; - return 0.0; - } - - d = (* GNOME_CANVAS_ITEM_CLASS - (GTK_OBJECT (priv->shade)->klass)->point) (priv->shade, - x, y, - cx, cy, - &ret_item); - if (d == 0.0) { - *actual_item = ret_item; - return 0.0; - } - - d = (* GNOME_CANVAS_ITEM_CLASS - (GTK_OBJECT (priv->close)->klass)->point) (priv->close, - x, y, - cx, cy, - &ret_item); - if (d == 0.0) { - *actual_item = ret_item; - return 0.0; - } - - *actual_item = item; - return 0.0; -} - -static void -e_summary_titlebar_class_init (GtkObjectClass *object_class) -{ - GnomeCanvasItemClass *item_class; - - item_class = (GnomeCanvasItemClass *) object_class; - - object_class->destroy = e_summary_titlebar_destroy; - object_class->set_arg = e_summary_titlebar_set_arg; - object_class->get_arg = e_summary_titlebar_get_arg; - - item_class->realize = e_summary_titlebar_realize; - item_class->unrealize = e_summary_titlebar_unrealize; - item_class->event = e_summary_titlebar_event; - item_class->point = e_summary_titlebar_point; - - gtk_object_add_arg_type ("ESummaryTitlebar::text", - GTK_TYPE_STRING, GTK_ARG_READWRITE, - ARG_TEXT); - gtk_object_add_arg_type ("ESummaryTitlebar::width", - GTK_TYPE_DOUBLE, GTK_ARG_READWRITE, - ARG_WIDTH); - gtk_object_add_arg_type ("ESummaryTitlebar::height", - GTK_TYPE_DOUBLE, GTK_ARG_READABLE, - ARG_HEIGHT); - - titlebar_signals[EDIT] = gtk_signal_new ("edit", GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (ESummaryTitlebarClass, - edit), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - titlebar_signals[SHADE] = gtk_signal_new ("shade", GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (ESummaryTitlebarClass, - shade), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - titlebar_signals[CLOSE] = gtk_signal_new ("close", GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (ESummaryTitlebarClass, - close), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, 0); - gtk_object_class_add_signals (object_class, titlebar_signals, - LAST_SIGNAL); - - parent_class = gtk_type_class (PARENT_TYPE); -} - -static void -e_summary_titlebar_init (GtkObject *object) -{ - ESummaryTitlebar *titlebar; - ESummaryTitlebarPrivate *priv; - - titlebar = E_SUMMARY_TITLEBAR (object); - titlebar->private = g_new0 (ESummaryTitlebarPrivate, 1); - priv = titlebar->private; - - priv->width = 100.0; - priv->text = NULL; - - gdk_rgb_init (); -} - -E_MAKE_TYPE (e_summary_titlebar, "ESummaryTitlebar", ESummaryTitlebar, - e_summary_titlebar_class_init, e_summary_titlebar_init, - PARENT_TYPE); - diff --git a/executive-summary/widgets/e-summary-titlebar.h b/executive-summary/widgets/e-summary-titlebar.h deleted file mode 100644 index b748a4dc8b..0000000000 --- a/executive-summary/widgets/e-summary-titlebar.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-summary-titlebar.h - * - * Authors: Iain Holmes <iain@helixcode.com> - * - * 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. - */ - -#ifndef _E_SUMMARY_TITLEBAR_H__ -#define _E_SUMMARY_TITLEBAR_H__ - -#include <gtk/gtksignal.h> -#include <libgnomeui/gnome-canvas.h> - -#define E_SUMMARY_TITLEBAR_TYPE (e_summary_titlebar_get_type ()) -#define E_SUMMARY_TITLEBAR(obj) (GTK_CHECK_CAST ((obj), E_SUMMARY_TITLEBAR_TYPE, ESummaryTitlebar)) -#define E_SUMMARY_TITLEBAR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_SUMMARY_TITLEBAR_TYPE, ESummaryTitlebarClass)) -#define IS_E_SUMMARY_TITLEBAR(obj) (GTK_CHECK_TYPE ((obj), E_SUMMARY_TITLEBAR_TYPE)) -#define IS_E_SUMMARY_TITLEBAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_SUMMARY_TITLEBAR_TYPE)) - -typedef struct _ESummaryTitlebarPrivate ESummaryTitlebarPrivate; -typedef struct _ESummaryTitlebar ESummaryTitlebar; -typedef struct _ESummaryTitlebarClass ESummaryTitlebarClass; - -struct _ESummaryTitlebar { - GnomeCanvasGroup parent; - - ESummaryTitlebarPrivate *private; -}; - -struct _ESummaryTitlebarClass { - GnomeCanvasGroupClass parent_class; - - void (*close) (ESummaryTitlebar *window); - void (*shade) (ESummaryTitlebar *window); - void (*edit) (ESummaryTitlebar *window); -}; - -GtkType e_summary_titlebar_get_type (void); - -#endif diff --git a/executive-summary/widgets/edit.xpm b/executive-summary/widgets/edit.xpm deleted file mode 100644 index 7f2deb1525..0000000000 --- a/executive-summary/widgets/edit.xpm +++ /dev/null @@ -1,19 +0,0 @@ -/* XPM */ -static char * edit_xpm[] = { -"14 14 2 1", -" g None", -". g #000000", -" ", -" ", -" ... ", -" . . ", -" . . ", -" . ", -" . ", -" .. ", -" .. ", -" .. ", -" ", -" .. ", -" .. ", -" "}; diff --git a/executive-summary/widgets/esummary-window-test.c b/executive-summary/widgets/esummary-window-test.c deleted file mode 100644 index 7928e8b6f9..0000000000 --- a/executive-summary/widgets/esummary-window-test.c +++ /dev/null @@ -1,45 +0,0 @@ -#include <gal/widgets/e-canvas.h> -#include "e-summary-subwindow.h" -#include "e-summary-titlebar.h" - - -void close_test (GtkWidget *widget, gpointer data); - -void -close_test (GtkWidget *widget, - gpointer data) -{ - gtk_main_quit (); -} - -int -main (int argc, - char **argv) -{ - GtkWidget *window, *canvas; - ESummarySubwindow *subwindow; - GtkWidget *control; - - gnome_init ("Executive Summary Subwindow Test", "1.0", argc, argv); - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_signal_connect (GTK_OBJECT (window), "destroy", - GTK_SIGNAL_FUNC (close_test), NULL); - - canvas = e_canvas_new (); - - subwindow = e_summary_subwindow_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (canvas)->root), 100, 100); - - control = gtk_button_new_with_label ("A big button"); - gtk_widget_set_usize (control, 400, 200); - - e_summary_subwindow_add (subwindow, control); - gtk_widget_show (control); - - gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0.0, 0.0, 1000.0, 1300.0); - gtk_container_add (GTK_CONTAINER (window), canvas); - gtk_widget_show_all (window); - - gtk_main (); - - exit(0); -} diff --git a/executive-summary/widgets/shade.xpm b/executive-summary/widgets/shade.xpm deleted file mode 100644 index 349212e906..0000000000 --- a/executive-summary/widgets/shade.xpm +++ /dev/null @@ -1,19 +0,0 @@ -/* XPM */ -static char * shade_xpm[] = { -"14 14 2 1", -" g None", -". g #000000", -" ", -" ............ ", -" ............ ", -" ............ ", -" ............ ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" . . ", -" ............ ", -" "}; diff --git a/executive-summary/widgets/x.xpm b/executive-summary/widgets/x.xpm deleted file mode 100644 index ce9e9f19dc..0000000000 --- a/executive-summary/widgets/x.xpm +++ /dev/null @@ -1,19 +0,0 @@ -/* XPM */ -static char * x_xpm[] = { -"14 14 2 1", -" g None", -". g #000000", -" ", -" .. .. ", -" ... ... ", -" ... ... ", -" ... ... ", -" ...... ", -" .... ", -" .... ", -" ...... ", -" ... ... ", -" ... ... ", -" ... ... ", -" .. .. ", -" "}; |