[evolution/express2-clutter] Clutterify Evolution.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/express2-clutter] Clutterify Evolution.
- Date: Tue, 6 Jul 2010 06:19:53 +0000 (UTC)
commit e480351d9c8fe651aec7433a307347c658ffe7a4
Author: Srinivasa Ragavan <sragavan gnome org>
Date: Tue Jul 6 11:36:57 2010 +0530
Clutterify Evolution.
configure.ac | 21 +++++++
mail/Makefile.am | 2 +
mail/e-mail-browser.c | 80 +++++++++++++++++++++++++
mail/e-mail-reader.c | 30 ++++++++-
mail/em-account-editor.c | 4 +-
mail/em-format-html.c | 4 +-
mail/message-list.c | 95 +++++++++++++++++++++++++++++-
modules/mail/Makefile.am | 2 +
modules/mail/e-mail-shell-content.c | 112 ++++++++++++++++++++++++++++++++++-
shell/Makefile.am | 4 +
shell/e-shell-window-private.c | 67 ++++++++++++++++++++-
shell/main.c | 11 ++++
12 files changed, 423 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 3d701a5..1d71c5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -564,6 +564,27 @@ if test x"$have_xfree" = "xyes" ; then
fi
dnl **************************************************
+dnl Clutter support.
+dnl **************************************************
+AC_MSG_CHECKING([whether to build with Clutter])
+AC_ARG_WITH([clutter],
+ [AC_HELP_STRING([--with-clutter],
+ [Build with Clutter [default=no]])],
+ with_clutter="$withval", with_clutter="no")
+AC_MSG_RESULT($with_clutter)
+
+if test "x$with_clutter" = "xyes"; then
+ PKG_CHECK_MODULES(CLUTTER, [mx-1.0 clutter-gtk-0.90 >= 0.90.0 clutter-1.0 >= 1.0.0])
+
+ AC_DEFINE(HAVE_CLUTTER, 1, [Clutter available])
+ AM_CONDITIONAL(ENABLE_CLUTTER, true)
+else
+ AC_DEFINE(HAVE_CLUTTER, 0, [Clutter not available])
+ AM_CONDITIONAL(ENABLE_CLUTTER, false)
+fi
+
+
+dnl **************************************************
dnl LDAP support.
dnl **************************************************
if test "$os_win32" != yes; then
diff --git a/mail/Makefile.am b/mail/Makefile.am
index ef4dcaa..93fa096 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -21,6 +21,7 @@ libevolution_mail_la_CPPFLAGS = \
$(EVOLUTION_MAIL_CFLAGS) \
$(CERT_UI_CFLAGS) \
$(CANBERRA_CFLAGS) \
+ $(CLUTTER_CFLAGS) \
-DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \
-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
@@ -168,6 +169,7 @@ libevolution_mail_la_LIBADD = \
$(EVOLUTION_MAIL_LIBS) \
$(CERT_UI_LIBS) \
$(CANBERRA_LIBS) \
+ $(CLUTTER_LIBS) \
$(GTKHTML_LIBS) \
$(E_WIDGETS_LIBS) \
$(SMIME_LIBS) \
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c
index aaf4f78..d6a996b 100644
--- a/mail/e-mail-browser.c
+++ b/mail/e-mail-browser.c
@@ -39,6 +39,12 @@
#include "mail/em-format-html-display.h"
#include "mail/message-list.h"
+#if HAVE_CLUTTER
+#include <clutter/clutter.h>
+#include <mx/mx.h>
+#include <clutter-gtk/clutter-gtk.h>
+#endif
+
#define E_MAIL_BROWSER_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_MAIL_BROWSER, EMailBrowserPrivate))
@@ -59,6 +65,12 @@ struct _EMailBrowserPrivate {
GtkWidget *statusbar;
guint show_deleted : 1;
+#if HAVE_CLUTTER
+ GtkWidget *embed;
+ ClutterActor *preview_stage;
+ ClutterActor *preview_actor;
+ ClutterAnimation *anim;
+#endif
};
enum {
@@ -270,6 +282,13 @@ mail_browser_message_selected_cb (EMailBrowser *browser,
GTK_WIDGET (((EMFormatHTML *) html_display)->html));
camel_folder_free_message_info (folder, info);
+#if HAVE_CLUTTER
+ clutter_actor_set_opacity (browser->priv->preview_actor, 0);
+ clutter_actor_animate (browser->priv->preview_actor, CLUTTER_EASE_OUT_SINE, 500,
+ "opacity", 255,
+ NULL);
+#endif
+
}
static gboolean
@@ -464,6 +483,59 @@ mail_browser_dispose (GObject *object)
G_OBJECT_CLASS (parent_class)->dispose (object);
}
+#if HAVE_CLUTTER
+
+static ClutterActor *
+create_gtk_actor (GtkWidget *vbox)
+{
+ GtkWidget *bin;
+ ClutterActor *gtk_actor;
+
+ gtk_actor = gtk_clutter_actor_new ();
+ bin = gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (gtk_actor));
+
+ gtk_container_add (GTK_CONTAINER (bin), vbox);
+
+ gtk_widget_show (bin);
+ gtk_widget_show(vbox);
+ return gtk_actor;
+}
+
+static void
+fix_clutter_embed_width (GtkWidget *widget, GtkAllocation *allocation, ClutterActor *actor)
+{
+ GtkWidget *embed = (GtkWidget *)g_object_get_data ((GObject *)actor, "embed");
+ clutter_actor_set_size (actor, allocation->width-1, embed->allocation.height);
+}
+
+static GtkWidget *
+create_under_clutter (GtkWidget *widget, GtkWidget *paned)
+{
+ GtkWidget *embed;
+ ClutterActor *stage, *actor;
+
+ embed = gtk_clutter_embed_new ();
+ gtk_widget_show (embed);
+
+ actor = create_gtk_actor (widget);
+ clutter_actor_show (actor);
+ stage = gtk_clutter_embed_get_stage ((GtkClutterEmbed *)embed);
+ clutter_container_add_actor ((ClutterContainer *)stage, actor);
+
+ g_object_set_data ((GObject *)actor, "embed", embed);
+ g_object_set_data ((GObject *)actor, "stage", stage);
+ g_object_set_data ((GObject *)actor, "widget", widget);
+ g_object_set_data ((GObject *)widget, "actor", actor);
+ g_object_set_data ((GObject *)embed, "actor", actor);
+
+ g_signal_connect (paned, "size-allocate", G_CALLBACK(fix_clutter_embed_width), actor);
+ clutter_actor_show(stage);
+
+ return embed;
+}
+
+#endif
+
static void
mail_browser_constructed (GObject *object)
{
@@ -598,7 +670,15 @@ mail_browser_constructed (GObject *object)
gtk_widget_show (GTK_WIDGET (web_view));
widget = e_preview_pane_new (web_view);
+#if HAVE_CLUTTER
+ priv->embed = create_under_clutter (widget, container);
+ gtk_box_pack_start (GTK_BOX (container), priv->embed, TRUE, TRUE, 0);
+ priv->preview_actor = g_object_get_data((GObject *)priv->embed, "actor");
+ priv->preview_stage = g_object_get_data((GObject *)priv->preview_actor, "stage");
+
+#else
gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+#endif
gtk_widget_show (widget);
search_bar = e_preview_pane_get_search_bar (E_PREVIEW_PANE (widget));
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index c3e1e5c..5eebc28 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -52,6 +52,14 @@
#include "mail/mail-vfolder.h"
#include "mail/message-list.h"
+
+#if HAVE_CLUTTER
+#include <clutter/clutter.h>
+#include <mx/mx.h>
+#include <clutter-gtk/clutter-gtk.h>
+#endif
+
+
#define E_MAIL_READER_GET_PRIVATE(obj) \
(mail_reader_get_private (G_OBJECT (obj)))
@@ -1942,8 +1950,9 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
string = g_strdup_printf (
_("Retrieving message '%s'"), cursor_uid);
}
-
- e_web_view_load_string (web_view, string);
+
+ if (!e_shell_get_express_mode(e_shell_get_default()))
+ e_web_view_load_string (web_view, string);
g_free (string);
camel_exception_clear (ex);
@@ -2002,7 +2011,8 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
string = g_strdup_printf (
_("Retrieving message '%s'"), cursor_uid);
- e_web_view_load_string (web_view, string);
+ if (!e_shell_get_express_mode(e_shell_get_default()))
+ e_web_view_load_string (web_view, string);
g_free (string);
store_async = folder->parent_store->flags & CAMEL_STORE_ASYNC;
@@ -2128,11 +2138,13 @@ mail_reader_set_folder (EMailReader *reader,
GtkWidget *message_list;
const gchar *previous_folder_uri;
gboolean outgoing;
+ EWebView *web_view;
priv = E_MAIL_READER_GET_PRIVATE (reader);
html_display = e_mail_reader_get_html_display (reader);
message_list = e_mail_reader_get_message_list (reader);
+ web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html);
previous_folder = e_mail_reader_get_folder (reader);
previous_folder_uri = e_mail_reader_get_folder_uri (reader);
@@ -2153,6 +2165,18 @@ mail_reader_set_folder (EMailReader *reader,
priv->folder_was_just_selected = (folder != NULL);
+#if HAVE_CLUTTER
+ {
+ ClutterActor *pane = g_object_get_data ((GObject *)web_view, "list-actor");
+ if (pane) {
+ clutter_actor_set_opacity (pane, 0);
+ clutter_actor_animate (pane, CLUTTER_LINEAR, 500,
+ "opacity", 255,
+ NULL);
+ }
+ }
+#endif
+
message_list_set_folder (
MESSAGE_LIST (message_list), folder, folder_uri, outgoing);
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 301bdd6..5f2ffb5 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -2142,8 +2142,8 @@ emae_identity_page (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget
GtkWidget *w;
GtkBuilder *builder;
- /*if (old)
- return old;*/
+ if (old && emae->type == EMAE_PAGES)
+ return old;
account = em_account_editor_get_modified_account (emae);
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 62e190f..d845549 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -80,6 +80,8 @@
#include "em-html-stream.h"
#include "em-utils.h"
+#include "shell/e-shell.h"
+
#define d(x)
#define EM_FORMAT_HTML_GET_PRIVATE(obj) \
@@ -352,7 +354,7 @@ efh_format_timeout(struct _format_msg *m)
} else {
efh->state = EM_FORMAT_HTML_STATE_RENDERING;
- if (p->last_part != m->message) {
+ if (p->last_part != m->message && !e_shell_get_express_mode(e_shell_get_default())) {
hstream = gtk_html_begin (efh->html);
gtk_html_stream_printf (hstream, "<h5>%s</h5>", _("Formatting Message..."));
gtk_html_stream_close (hstream, GTK_HTML_STREAM_OK);
diff --git a/mail/message-list.c b/mail/message-list.c
index 1082957..742cb45 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -55,6 +55,9 @@
#include "shell/e-shell.h"
#include "shell/e-shell-settings.h"
+#include "shell/e-shell-window.h"
+#include "shell/e-shell-content.h"
+#include "shell/e-shell-view.h"
#include "table/e-cell-checkbox.h"
#include "table/e-cell-hbox.h"
@@ -76,6 +79,12 @@
#include "mail-tools.h"
#include "message-list.h"
+#if HAVE_CLUTTER
+#include <clutter/clutter.h>
+#include <mx/mx.h>
+#include <clutter-gtk/clutter-gtk.h>
+#endif
+
/*#define TIMEIT */
#ifdef TIMEIT
@@ -119,6 +128,11 @@ struct _MessageListPrivate {
GtkTargetList *copy_target_list;
GtkTargetList *paste_target_list;
+
+#if HAVE_CLUTTER
+ ClutterActor *search_texture;
+ ClutterTimeline *timeline;
+#endif
};
enum {
@@ -2301,6 +2315,10 @@ message_list_init (MessageList *message_list)
message_list->priv = MESSAGE_LIST_GET_PRIVATE (message_list);
+#if HAVE_CLUTTER
+ message_list->priv->timeline = NULL;
+ message_list->priv->search_texture = NULL;
+#endif
message_list->normalised_hash = g_hash_table_new_full (
g_str_hash, g_str_equal,
(GDestroyNotify) NULL,
@@ -3972,9 +3990,63 @@ message_list_set_hidedeleted (MessageList *ml, gboolean hidedeleted)
}
}
+#if HAVE_CLUTTER
+static void
+on_timeline_started (ClutterTimeline *timeline, ClutterActor *actor)
+{
+ clutter_actor_show(actor);
+}
+
+static void
+on_timeline_stopped (ClutterTimeline *timeline, ClutterActor *actor)
+{
+ clutter_actor_hide(actor);
+}
+#endif
+
void
message_list_set_search (MessageList *ml, const gchar *search)
{
+#if HAVE_CLUTTER
+ if (ml->priv->timeline == NULL) {
+ ClutterActor *stage = g_object_get_data ((GObject *)ml, "list-stage");
+
+ if (stage) {
+ ClutterActor *texture;
+ ClutterPath *path;
+ ClutterBehaviour *behaviour;
+ ClutterAlpha *alpha;
+
+ texture = clutter_texture_new_from_file ("/tmp/search.png", NULL);
+ clutter_container_add_actor ((ClutterContainer *)stage, texture);
+ ml->priv->search_texture = texture;
+
+ ml->priv->timeline = clutter_timeline_new (2 * 1000);
+ alpha = clutter_alpha_new_full (ml->priv->timeline, CLUTTER_LINEAR);
+ path = clutter_path_new();
+ behaviour = clutter_behaviour_path_new (alpha, path);
+ clutter_actor_hide (texture);
+ clutter_path_clear (path);
+ clutter_path_add_move_to (path, 100, 50);
+ clutter_path_add_line_to (path, 200, 50);
+ clutter_path_add_line_to (path, 200, 100);
+ clutter_path_add_line_to (path, 100, 100);
+ clutter_path_add_line_to (path, 100, 50);
+
+ clutter_behaviour_apply (behaviour, texture);
+ clutter_timeline_set_loop (ml->priv->timeline, TRUE);
+
+ g_signal_connect(ml->priv->timeline, "started", G_CALLBACK(on_timeline_started), texture);
+ g_signal_connect(ml->priv->timeline, "paused", G_CALLBACK(on_timeline_stopped), texture);
+ //g_signal_connect(ml->priv->timeline, "completed", G_CALLBACK(on_timeline_stopped), texture);
+
+ clutter_timeline_pause (ml->priv->timeline);
+ clutter_timeline_stop (ml->priv->timeline);
+
+ }
+ }
+#endif
+
if (search == NULL || search[0] == '\0')
if (ml->search == NULL || ml->search[0] == '\0')
return;
@@ -3987,6 +4059,10 @@ message_list_set_search (MessageList *ml, const gchar *search)
ml->thread_tree = NULL;
}
+#if HAVE_CLUTTER
+ clutter_timeline_start (ml->priv->timeline);
+#endif
+
if (ml->frozen == 0)
mail_regen_list (ml, search, NULL, NULL);
else {
@@ -4767,14 +4843,31 @@ regen_list_done (struct _regen_list_msg *m)
e_tree_set_info_message (tree, _("There are only hidden messages in this folder. Use View->Show Hidden Messages to show them."));
else
e_tree_set_info_message (tree, _("There are no messages in this folder."));
- } else
+ } else {
e_tree_set_info_message (tree, NULL);
+ }
}
+
g_signal_handlers_unblock_by_func (e_tree_get_table_adapter (tree), ml_tree_sorting_changed, m->ml);
g_signal_emit (m->ml, message_list_signals[MESSAGE_LIST_BUILT], 0);
m->ml->priv->any_row_changed = FALSE;
+
+#if HAVE_CLUTTER
+ if (clutter_timeline_is_playing(m->ml->priv->timeline)) {
+ clutter_timeline_stop (m->ml->priv->timeline);
+ } else {
+ ClutterActor *pane = g_object_get_data ((GObject *)m->ml, "list-actor");
+
+ if (pane) {
+ clutter_actor_set_opacity (pane, 0);
+ clutter_actor_animate (pane, CLUTTER_EASE_OUT_SINE, 500,
+ "opacity", 255,
+ NULL);
+ }
+ }
+#endif
}
static void
diff --git a/modules/mail/Makefile.am b/modules/mail/Makefile.am
index 3238202..25d3c1f 100644
--- a/modules/mail/Makefile.am
+++ b/modules/mail/Makefile.am
@@ -8,6 +8,7 @@ libevolution_module_mail_la_CPPFLAGS = \
$(GNOME_PLATFORM_CFLAGS) \
$(EVOLUTION_MAIL_CFLAGS) \
$(CAMEL_CFLAGS) \
+ $(CLUTTER_CFLAGS) \
-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
-DEVOLUTION_UIDIR=\""$(uidir)"\" \
-DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \
@@ -68,6 +69,7 @@ libevolution_module_mail_la_LIBADD = \
$(top_builddir)/capplet/settings/libevolution-mail-settings.la \
$(EVOLUTION_MAIL_LIBS) \
$(CAMEL_LIBS) \
+ $(CLUTTER_LIBS) \
$(GTKHTML_LIBS) \
$(E_WIDGETS_LIBS) \
$(GNOME_PLATFORM_LIBS)
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index 79f001a..ba7992d 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -44,6 +44,12 @@
#include "e-mail-shell-backend.h"
#include "e-mail-shell-view-actions.h"
+#if HAVE_CLUTTER
+#include <clutter/clutter.h>
+#include <mx/mx.h>
+#include <clutter-gtk/clutter-gtk.h>
+#endif
+
#define E_MAIL_SHELL_CONTENT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
((obj), E_TYPE_MAIL_SHELL_CONTENT, EMailShellContentPrivate))
@@ -74,6 +80,14 @@ struct _EMailShellContentPrivate {
guint preview_visible : 1;
guint suppress_message_selection : 1;
guint show_deleted : 1;
+#if HAVE_CLUTTER
+ GtkWidget *list_embed;
+ GtkWidget *preview_embed;
+ ClutterActor *preview_stage;
+ ClutterActor *list_stage;
+ ClutterActor *list_actor;
+ ClutterActor *preview_actor;
+#endif
};
enum {
@@ -87,6 +101,59 @@ enum {
static gpointer parent_class;
static GType mail_shell_content_type;
+#if HAVE_CLUTTER
+
+static ClutterActor *
+create_gtk_actor (GtkWidget *vbox)
+{
+ GtkWidget *bin;
+ ClutterActor *gtk_actor;
+
+ gtk_actor = gtk_clutter_actor_new ();
+ bin = gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (gtk_actor));
+
+ gtk_container_add (GTK_CONTAINER (bin), vbox);
+
+ gtk_widget_show (bin);
+ gtk_widget_show(vbox);
+ return gtk_actor;
+}
+
+static void
+fix_clutter_embed_width (GtkWidget *widget, GtkAllocation *allocation, ClutterActor *actor)
+{
+ GtkWidget *embed = (GtkWidget *)g_object_get_data ((GObject *)actor, "embed");
+ clutter_actor_set_size (actor, allocation->width-1, embed->allocation.height);
+}
+
+static GtkWidget *
+create_under_clutter (GtkWidget *widget, GtkWidget *paned)
+{
+ GtkWidget *embed;
+ ClutterActor *stage, *actor;
+
+ embed = gtk_clutter_embed_new ();
+ gtk_widget_show (embed);
+
+ actor = create_gtk_actor (widget);
+ clutter_actor_show (actor);
+ stage = gtk_clutter_embed_get_stage ((GtkClutterEmbed *)embed);
+ clutter_container_add_actor ((ClutterContainer *)stage, actor);
+
+ g_object_set_data ((GObject *)actor, "embed", embed);
+ g_object_set_data ((GObject *)actor, "stage", stage);
+ g_object_set_data ((GObject *)actor, "widget", widget);
+ g_object_set_data ((GObject *)widget, "actor", actor);
+ g_object_set_data ((GObject *)embed, "actor", actor);
+
+ g_signal_connect (paned, "size-allocate", G_CALLBACK(fix_clutter_embed_width), actor);
+ clutter_actor_show(stage);
+
+ return embed;
+}
+
+#endif
+
static void
mail_shell_content_save_boolean (EMailShellContent *mail_shell_content,
const gchar *key,
@@ -200,6 +267,7 @@ mail_shell_content_message_selected_cb (EMailShellContent *mail_shell_content,
const gchar *folder_uri;
const gchar *key;
gchar *group_name;
+ EMailShellContentPrivate *priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE(mail_shell_content);
folder_uri = message_list->folder_uri;
@@ -223,6 +291,15 @@ mail_shell_content_message_selected_cb (EMailShellContent *mail_shell_content,
e_shell_view_set_state_dirty (shell_view);
g_free (group_name);
+
+#if HAVE_CLUTTER
+ clutter_actor_set_opacity (priv->preview_actor, 0);
+ clutter_actor_animate (priv->preview_actor, CLUTTER_EASE_OUT_SINE, 500,
+ "opacity", 255,
+ NULL);
+
+#endif
+
}
static GtkOrientation
@@ -405,9 +482,18 @@ mail_shell_content_constructed (GObject *object)
gtk_scrolled_window_set_shadow_type (
GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
priv->scrolled_window = g_object_ref (widget);
- gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, FALSE);
+#if HAVE_CLUTTER
+ priv->list_embed = create_under_clutter (widget, (GtkWidget *)container);
+ gtk_paned_pack1 (GTK_PANED (container), priv->list_embed, TRUE, FALSE);
gtk_widget_show (widget);
+ priv->list_actor = g_object_get_data((GObject *)priv->list_embed, "actor");
+ priv->list_stage = g_object_get_data((GObject *)priv->list_actor, "stage");
+
+#else
+ gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, FALSE);
+ gtk_widget_show (widget);
+#endif
container = widget;
widget = message_list_new (shell_backend);
@@ -420,8 +506,32 @@ mail_shell_content_constructed (GObject *object)
gtk_widget_show (GTK_WIDGET (web_view));
widget = e_preview_pane_new (web_view);
+#if HAVE_CLUTTER
+ priv->preview_embed = create_under_clutter (widget, container);
+ priv->preview_actor = g_object_get_data((GObject *)priv->preview_embed, "actor");
+ priv->preview_stage = g_object_get_data((GObject *)priv->preview_actor, "stage");
+
+ gtk_paned_pack2 (GTK_PANED (container), priv->preview_embed, FALSE, FALSE);
+ gtk_widget_show (widget);
+
+ e_binding_new (widget, "visible", priv->preview_actor, "visible");
+
+ g_object_set_data ((GObject *)web_view, "list-actor", (gpointer) priv->list_actor);
+ g_object_set_data ((GObject *)web_view, "list-stage", (gpointer) priv->list_stage);
+ g_object_set_data ((GObject *)web_view, "preview-stage", (gpointer) priv->preview_stage);
+
+ g_object_set_data ((GObject *)web_view, "preview-actor", (gpointer) priv->preview_actor);
+
+ g_object_set_data ((GObject *)priv->message_list, "list-actor", (gpointer) priv->list_actor);
+ g_object_set_data ((GObject *)priv->message_list, "list-stage", (gpointer) priv->list_stage);
+ g_object_set_data ((GObject *)priv->message_list, "preview-stage", (gpointer) priv->preview_stage);
+ g_object_set_data ((GObject *)priv->message_list, "preview-actor", (gpointer) priv->preview_actor);
+
+#else
+
gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE);
gtk_widget_show (widget);
+#endif
e_binding_new (object, "preview-visible", widget, "visible");
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 1241dd4..f630205 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -51,6 +51,7 @@ libeshell_la_CPPFLAGS = \
-DG_LOG_DOMAIN=\"evolution-shell\" \
$(GNOME_PLATFORM_CFLAGS) \
$(TZDIALOG_CFLAGS) \
+ $(CLUTTER_CFLAGS) \
$(SHELL_CFLAGS)
libeshell_la_SOURCES = \
@@ -84,6 +85,7 @@ libeshell_la_LIBADD = \
$(top_builddir)/widgets/misc/libemiscwidgets.la \
$(top_builddir)/widgets/menus/libmenus.la \
$(GNOME_PLATFORM_LIBS) \
+ $(CLUTTER_LIBS) \
$(SHELL_LIBS)
# Evolution executable
@@ -116,6 +118,7 @@ evolution_CPPFLAGS = \
-DLIBDIR=\""$(datadir)"\" \
$(GNOME_PLATFORM_CFLAGS) \
$(TZDIALOG_CFLAGS) \
+ $(CLUTTER_CFLAGS) \
$(SHELL_CFLAGS)
evolution_SOURCES = \
@@ -133,6 +136,7 @@ evolution_LDADD = \
$(TZDIALOG_LIBS) \
$(SHELL_LIBS) \
$(GNOME_PLATFORM_LIBS) \
+ $(CLUTTER_LIBS) \
$(EVOLUTIONICON)
if OS_WIN32
diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c
index 6878ff7..07e1b47 100644
--- a/shell/e-shell-window-private.c
+++ b/shell/e-shell-window-private.c
@@ -18,9 +18,15 @@
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
*/
-
+#include <config.h>
#include "e-shell-window-private.h"
+#if HAVE_CLUTTER
+#include <clutter/clutter.h>
+#include <mx/mx.h>
+#include <clutter-gtk/clutter-gtk.h>
+#endif
+
static void
shell_window_save_switcher_style_cb (GtkRadioAction *action,
GtkRadioAction *current,
@@ -255,6 +261,61 @@ e_shell_window_private_init (EShellWindow *shell_window)
G_CALLBACK (shell_window_connect_proxy_cb), shell_window);
}
+#if HAVE_CLUTTER
+
+static ClutterActor *
+create_gtk_actor (GtkWidget *vbox)
+{
+ GtkWidget *bin;
+ ClutterActor *gtk_actor;
+
+ gtk_actor = gtk_clutter_actor_new ();
+ bin = gtk_clutter_actor_get_widget (GTK_CLUTTER_ACTOR (gtk_actor));
+
+ gtk_container_add (GTK_CONTAINER (bin), vbox);
+
+ gtk_widget_show (bin);
+ gtk_widget_show(vbox);
+ return gtk_actor;
+}
+
+
+
+static void
+fix_clutter_embed_width (GtkWidget *widget, GtkAllocation *allocation, ClutterActor *actor)
+{
+ GtkWidget *embed = (GtkWidget *)g_object_get_data ((GObject *)actor, "embed");
+ clutter_actor_set_size (actor, allocation->width-1, embed->allocation.height);
+}
+
+static GtkWidget *
+create_under_clutter (GtkWidget *widget, GtkWidget *paned)
+{
+ GtkWidget *embed;
+ ClutterActor *stage, *actor;
+
+ embed = gtk_clutter_embed_new ();
+ gtk_widget_show (embed);
+
+ actor = create_gtk_actor (widget);
+ clutter_actor_show (actor);
+ stage = gtk_clutter_embed_get_stage ((GtkClutterEmbed *)embed);
+ clutter_container_add_actor ((ClutterContainer *)stage, actor);
+
+ g_object_set_data ((GObject *)actor, "embed", embed);
+ g_object_set_data ((GObject *)actor, "stage", stage);
+ g_object_set_data ((GObject *)actor, "widget", widget);
+ g_object_set_data ((GObject *)widget, "actor", actor);
+ g_object_set_data ((GObject *)embed, "actor", actor);
+
+ g_signal_connect (paned, "size-allocate", G_CALLBACK(fix_clutter_embed_width), actor);
+ clutter_actor_show(stage);
+
+ return embed;
+}
+
+#endif
+
void
e_shell_window_private_constructed (EShellWindow *shell_window)
{
@@ -327,7 +388,11 @@ e_shell_window_private_constructed (EShellWindow *shell_window)
paned = GTK_PANED (priv->content_pane);
+#if HAVE_CLUTTER
+ widget = create_under_clutter(shell_window_construct_sidebar (shell_window), (GtkWidget *)paned);
+#else
widget = shell_window_construct_sidebar (shell_window);
+#endif
if (widget != NULL)
gtk_paned_pack1 (paned, widget, FALSE, FALSE);
diff --git a/shell/main.c b/shell/main.c
index 41d3f95..2e89854 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -69,6 +69,10 @@
#include <sys/stat.h>
#include <unistd.h>
+#if HAVE_CLUTTER
+ #include <clutter-gtk/clutter-gtk.h>
+#endif
+
#define SKIP_WARNING_DIALOG_KEY \
"/apps/evolution/shell/skip_warning_dialog"
@@ -478,10 +482,17 @@ main (gint argc, gchar **argv)
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
+#if HAVE_CLUTTER
+ gtk_clutter_init_with_args (
+ &argc, &argv,
+ _("- The Evolution PIM and Email Client"),
+ entries, (gchar *) GETTEXT_PACKAGE, &error);
+#else
gtk_init_with_args (
&argc, &argv,
_("- The Evolution PIM and Email Client"),
entries, (gchar *) GETTEXT_PACKAGE, &error);
+#endif
if (error != NULL) {
g_printerr ("%s\n", error->message);
g_error_free (error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]