Commit f69d5ec1 authored by Iain Holmes's avatar Iain Holmes

Big patch. Evolution-services rewrite, services updated for new system,

Big patch.
Evolution-services rewrite, services updated for new system, Fixes to
Executive Summary and other things. See some changelogs

svn path=/trunk/; revision=6644
parent 615a467b
......@@ -21,9 +21,13 @@ images_DATA = \
service-close.png \
service-configure.png \
service-down.png \
service-down-disabled.png \
service-left.png \
service-left-disabled.png \
service-right.png \
service-right-disabled.png \
service-up.png \
service-up-disabled.png \
splash.png
buttonsdir = $(datadir)/images/evolution/buttons
......
2000-11-03 Iain Holmes <iain@helixcode.com>
* e-msg-composer-attachment-bar.c (update): Pass NULL
instead of icon_name to the e_icon_list_append_pixbuf
function.
(init) Take the font size into account when setting the
height of the bar.
2000-11-02 Iain Holmes <iain@helixcode.com>
* e-msg-composer-attachment-bar.c (update): Use the
pixbuf_for_mime_type function to get the icon.
(pixbuf_for_mime_type): Functino that searches nautilus/
and mc/ for icon files.
2000-11-15 Radek Doulik <rodo@helixcode.com>
* e-msg-composer.c (prepare_engine): update namespace
......
......@@ -179,6 +179,44 @@ remove_attachment (EMsgComposerAttachmentBar *bar,
/* Icon list contents handling. */
static GdkPixbuf *
pixbuf_for_mime_type (const char *mime_type)
{
const char *icon_name;
char *filename = NULL;
GdkPixbuf *pixbuf;
icon_name = gnome_vfs_mime_get_value (mime_type, "icon-filename");
if (icon_name) {
if (*icon_name == '/') {
pixbuf = gdk_pixbuf_new_from_file (icon_name);
if (pixbuf)
return pixbuf;
}
filename = gnome_pixmap_file (icon_name);
if (!filename) {
char *fm_icon;
fm_icon = g_strdup_printf ("nautilus/%s", icon_name);
filename = gnome_pixmap_file (fm_icon);
if (!filename) {
fm_icon = g_strdup_printf ("mc/%s", icon_name);
filename = gnome_pixmap_file (fm_icon);
}
g_free (fm_icon);
}
}
if (!filename)
filename = gnome_pixmap_file ("gnome-unknown.png");
pixbuf = gdk_pixbuf_new_from_file (filename);
g_free (filename);
return pixbuf;
}
static void
update (EMsgComposerAttachmentBar *bar)
{
......@@ -196,7 +234,7 @@ update (EMsgComposerAttachmentBar *bar)
/* FIXME could be faster, but we don't care. */
for (p = priv->attachments; p != NULL; p = p->next) {
EMsgComposerAttachment *attachment;
const gchar *icon_name, *desc;
const gchar *desc;
gchar *size_string, *label, *mime_type;
GMimeContentField *content_type;
GdkPixbuf *pixbuf;
......@@ -207,14 +245,6 @@ update (EMsgComposerAttachmentBar *bar)
mime_type = g_strdup_printf ("%s/%s", content_type->type,
content_type->subtype);
icon_name = gnome_vfs_mime_get_value (mime_type,
"icon-filename");
g_free (mime_type);
/* FIXME we need some better default icon. */
if (icon_name == NULL)
icon_name = gnome_vfs_mime_get_value ("text/plain",
"icon-filename");
/* Get the image out of the attachment
and create a thumbnail for it */
......@@ -308,26 +338,16 @@ update (EMsgComposerAttachmentBar *bar)
label = g_strdup (desc);
if (image) {
e_icon_list_append_pixbuf (icon_list, attachment->pixbuf_cache, icon_name, label);
e_icon_list_append_pixbuf (icon_list, attachment->pixbuf_cache, NULL, label);
} else {
if (icon_name)
pixbuf = gdk_pixbuf_new_from_file (icon_name);
else
pixbuf = NULL;
/* Get the default */
if (pixbuf == NULL) {
icon_name = gnome_vfs_mime_get_value ("text/plain",
"icon-filename");
if (icon_name != NULL)
pixbuf = gdk_pixbuf_new_from_file (icon_name);
}
pixbuf = pixbuf_for_mime_type (mime_type);
e_icon_list_append_pixbuf (icon_list, pixbuf,
icon_name, label);
NULL, label);
if (pixbuf)
gdk_pixbuf_unref (pixbuf);
}
g_free (mime_type);
g_free (label);
}
......@@ -586,7 +606,8 @@ static void
init (EMsgComposerAttachmentBar *bar)
{
EMsgComposerAttachmentBarPrivate *priv;
guint icon_size;
guint icon_size, icon_height;
GdkFont *font;
priv = g_new (EMsgComposerAttachmentBarPrivate, 1);
......@@ -601,9 +622,12 @@ init (EMsgComposerAttachmentBar *bar)
/* FIXME partly hardcoded. We should compute height from the font, and
allow at least 2 lines for every item. */
icon_size = ICON_WIDTH + ICON_SPACING + ICON_BORDER + ICON_TEXT_SPACING;
icon_size += 24;
gtk_widget_set_usize (GTK_WIDGET (bar), icon_size * 4, icon_size);
font = GTK_WIDGET (bar)->style->font;
icon_height = icon_size + ((font->ascent + font->descent) * 2);
icon_size += 24;
gtk_widget_set_usize (GTK_WIDGET (bar), icon_size * 4, icon_height);
}
......
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
......@@ -17,6 +144,7 @@
* component/Makefile.am: Regenerate the idl-generated files
if composer idl changes.
>>>>>>> 1.18
2000-11-03 Federico Mena Quintero <federico@helixcode.com>
* evolution-services/Makefile.am: Clean the idl-generated files
......
SUBDIRS = idl widgets evolution-services component test-service
SUBDIRS = idl evolution-services component test-service
oafdir = $(datadir)/oaf
oaf_DATA = evolution-executive-summary.oafinfo
......
......@@ -61,7 +61,6 @@ evolution_executive_summary_LDADD = \
$(top_builddir)/widgets/misc/libemiscwidgets.a \
$(top_builddir)/e-util/libeutil.la \
$(top_builddir)/executive-summary/evolution-services/libevolution-services.la \
$(top_builddir)/executive-summary/widgets/libesummary-widgets.a \
$(BONOBO_VFS_GNOME_LIBS) \
$(EXTRA_GNOME_LIBS) \
$(GTKHTML_LIBS) \
......
......@@ -42,11 +42,9 @@
#include "e-summary.h"
#include "Evolution.h"
#include <evolution-services/executive-summary-component-client.h>
#include <evolution-services/Executive-Summary.h>
#include <evolution-services/executive-summary.h>
#include <evolution-services/executive-summary-component.h>
#include <evolution-services/executive-summary-component-view.h>
#include <evolution-services/executive-summary-component-factory-client.h>
static GList *control_list = NULL;
......@@ -170,51 +168,6 @@ control_destroy_cb (BonoboControl *control,
gtk_object_destroy (GTK_OBJECT (esummary));
}
static void
update (ExecutiveSummary *summary,
int id,
const char *html,
ESummary *esummary)
{
ExecutiveSummaryComponentView *view;
view = e_summary_view_from_id (esummary, id);
executive_summary_component_view_set_html (view, html);
e_summary_update_window (esummary, summary, html);
}
static void
set_title (ExecutiveSummary *summary,
int id,
const char *title,
ESummary *esummary)
{
ExecutiveSummaryComponentView *view;
view = e_summary_view_from_id (esummary, id);
executive_summary_component_view_set_title (view, title);
}
static void
flash (ExecutiveSummary *summary,
int id,
gpointer user_data)
{
g_print ("FLASH!\n");
}
static void
view_destroyed (ExecutiveSummaryComponentView *view,
ExecutiveSummaryComponentClient *client)
{
int id;
g_print ("%s\n", __FUNCTION__);
id = executive_summary_component_view_get_id (view);
g_print ("%d\n", id);
executive_summary_component_client_destroy_view (client, view);
}
/* A ********very********
temporary function to embed something
*/
......@@ -222,7 +175,7 @@ void
embed_service (GtkWidget *widget,
ESummary *esummary)
{
char *required_interfaces[2] = {"IDL:GNOME/Evolution:SummaryComponent:1.0",
char *required_interfaces[2] = {"IDL:GNOME/Evolution:Summary:ComponentFactory:1.0",
NULL};
char *obj_id;
......@@ -234,37 +187,23 @@ embed_service (GtkWidget *widget,
e_summary_factory_embed_service_from_id (esummary, obj_id);
}
void
ESummaryWindow *
e_summary_factory_embed_service_from_id (ESummary *esummary,
const char *obj_id)
{
ExecutiveSummaryComponentClient *client;
ExecutiveSummary *summary;
ExecutiveSummaryComponentView *view;
int id;
client = executive_summary_component_client_new (obj_id);
GNOME_Evolution_Summary_Component component;
ExecutiveSummaryComponentFactoryClient *client;
ESummaryWindow *window;
CORBA_Environment ev;
client = executive_summary_component_factory_client_new (obj_id);
component = executive_summary_component_factory_client_create_view (client);
g_return_if_fail (client != NULL);
/* Set the owner */
summary = EXECUTIVE_SUMMARY (executive_summary_new ());
executive_summary_component_client_set_owner (client, summary);
gtk_signal_connect (GTK_OBJECT (summary), "flash",
GTK_SIGNAL_FUNC (flash), esummary);
gtk_signal_connect (GTK_OBJECT (summary), "set_title",
GTK_SIGNAL_FUNC (set_title), esummary);
gtk_signal_connect (GTK_OBJECT (summary), "update",
GTK_SIGNAL_FUNC (update), esummary);
/* Create view */
id = executive_summary_component_create_unique_id ();
view = executive_summary_component_client_create_view (client, id);
gtk_signal_connect (GTK_OBJECT (view), "destroy",
GTK_SIGNAL_FUNC (view_destroyed), client);
e_summary_add_service (esummary, summary, view, obj_id);
window = e_summary_add_service (esummary, component, obj_id);
e_summary_rebuild_page (esummary);
return window;
}
BonoboControl *
......
......@@ -29,7 +29,7 @@
BonoboControl *e_summary_factory_new_control (const char *uri,
const GNOME_Evolution_Shell shell);
void e_summary_factory_embed_service_from_id (ESummary *esummary,
const char *obj_id);
ESummaryWindow *e_summary_factory_embed_service_from_id (ESummary *esummary,
const char *obj_id);
#endif
......@@ -39,7 +39,6 @@
#include "e-summary-url.h"
#include "e-summary-util.h"
#include <evolution-services/executive-summary-component-view.h>
#include "Composer.h"
typedef enum _ESummaryProtocol {
......@@ -101,7 +100,8 @@ e_summary_url_request (GtkHTML *html,
gtk_html_stream_close (stream, GTK_HTML_STREAM_ERROR);
return;
}
g_print ("Filename: %s\n", filename);
result = gnome_vfs_open (&handle, filename, GNOME_VFS_OPEN_READ);
if (result != GNOME_VFS_OK) {
......@@ -143,10 +143,10 @@ parse_uri (const char *uri,
ESummaryProtocol protocol,
ESummary *esummary)
{
ExecutiveSummaryComponentView *view;
char *parsed;
char *p;
int id;
int address;
ESummaryWindow *window;
switch (protocol) {
......@@ -184,39 +184,39 @@ parse_uri (const char *uri,
break;
case PROTOCOL_CLOSE:
id = atoi (uri + 8);
view = e_summary_view_from_id (esummary, id);
parsed = g_strdup (executive_summary_component_view_get_title (view));
address = atoi (uri + 8);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
parsed = g_strdup (window->title);
break;
case PROTOCOL_LEFT:
id = atoi (uri + 7);
view = e_summary_view_from_id (esummary, id);
parsed = g_strdup (executive_summary_component_view_get_title (view));
address = atoi (uri + 7);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
parsed = g_strdup (window->title);
break;
case PROTOCOL_RIGHT:
id = atoi (uri + 8);
view = e_summary_view_from_id (esummary, id);
parsed = g_strdup (executive_summary_component_view_get_title (view));
address = atoi (uri + 8);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
parsed = g_strdup (window->title);
break;
case PROTOCOL_UP:
id = atoi (uri + 5);
view = e_summary_view_from_id (esummary, id);
parsed = g_strdup (executive_summary_component_view_get_title (view));
address = atoi (uri + 5);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
parsed = g_strdup (window->title);
break;
case PROTOCOL_DOWN:
id = atoi (uri + 7);
view = e_summary_view_from_id (esummary, id);
parsed = g_strdup (executive_summary_component_view_get_title (view));
address = atoi (uri + 7);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
parsed = g_strdup (window->title);
break;
case PROTOCOL_CONFIGURE:
id = atoi (uri + 12);
view = e_summary_view_from_id (esummary, id);
parsed = g_strdup (executive_summary_component_view_get_title (view));
address = atoi (uri + 12);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
parsed = g_strdup (window->title);
break;
case PROTOCOL_NONE:
......@@ -325,10 +325,9 @@ e_summary_url_click (GtkWidget *widget,
ESummary *esummary)
{
ESummaryProtocol protocol;
ExecutiveSummaryComponentView *view;
gpointer window; /* FIXME */
char *parsed;
int id;
int address;
ESummaryWindow *window;
protocol = get_protocol (url);
......@@ -352,22 +351,20 @@ e_summary_url_click (GtkWidget *widget,
case PROTOCOL_CLOSE:
/* Close the window. */
id = atoi (url + 8);
view = e_summary_view_from_id (esummary, id);
if (view == NULL)
address = atoi (url + 8);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
if (window->iid == NULL)
return;
window = e_summary_window_from_view (esummary, view);
e_summary_window_remove_from_ht (window, esummary);
e_summary_window_free (window, esummary);
e_summary_remove_window (esummary, window);
e_summary_rebuild_page (esummary);
break;
case PROTOCOL_CONFIGURE:
/* Configure the window. . . */
id = atoi (url + 12);
view = e_summary_view_from_id (esummary, id);
if (view == NULL)
address = atoi (url + 12);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
if (window->iid == NULL)
return;
/* Issue the configure command some how :) */
......@@ -375,50 +372,41 @@ e_summary_url_click (GtkWidget *widget,
case PROTOCOL_LEFT:
/* Window left */
id = atoi (url + 7);
view = e_summary_view_from_id (esummary, id);
if (view == NULL)
address = atoi (url + 7);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
if (window->iid == NULL)
return;
window = e_summary_window_from_view (esummary, view);
e_summary_window_move_left (esummary, window);
e_summary_rebuild_page (esummary);
break;
case PROTOCOL_RIGHT:
id = atoi (url + 8);
view = e_summary_view_from_id (esummary, id);
if (view == NULL)
address = atoi (url + 8);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
if (window->iid == NULL)
return;
window = e_summary_window_from_view (esummary, view);
e_summary_window_move_right (esummary, window);
e_summary_rebuild_page (esummary);
break;
case PROTOCOL_UP:
id = atoi (url + 5);
view = e_summary_view_from_id (esummary, id);
if (view == NULL)
address = atoi (url + 5);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
if (window->iid == NULL)
return;
window = e_summary_window_from_view (esummary, view);
e_summary_window_move_up (esummary, window);
e_summary_rebuild_page (esummary);
break;
case PROTOCOL_DOWN:
id = atoi (url + 7);
view = e_summary_view_from_id (esummary, id);
if (view == NULL)
address = atoi (url + 7);
window = (ESummaryWindow *) GINT_TO_POINTER (address);
if (window->iid == NULL)
return;
window = e_summary_window_from_view (esummary, view);
e_summary_window_move_down (esummary, window);
e_summary_rebuild_page (esummary);
break;
......@@ -437,16 +425,75 @@ e_summary_url_click (GtkWidget *widget,
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