[anjal] Add Contacts support from Anerley.



commit a383d095cb9116f582790af555ed25ad2662dc4f
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Wed Jul 15 18:55:26 2009 +0530

    Add Contacts support from Anerley.

 configure.ac           |   16 +++
 src/Makefile.am        |    9 ++-
 src/mail-people-view.c |  267 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/mail-people-view.h |   59 +++++++++++
 src/mail-shell.c       |   26 ++++-
 src/mail-view.c        |   43 ++++++++-
 src/mail-view.h        |    4 +-
 src/main.c             |   15 +++
 8 files changed, 432 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 89e33f9..db2c9ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,6 +91,22 @@ else
    AM_CONDITIONAL(ENABLE_UNIQUE, false)
 fi
 
+AC_MSG_CHECKING([whether to build with Anerley])
+AC_ARG_WITH([anerley],
+	[AC_HELP_STRING([--with-anerley],
+	[Build with Anerley [default=no]])],
+	with_anerley="$withval", with_anerley="yes")
+AC_MSG_RESULT($with_anerley)
+
+if test "x$with_anerley" = "xyes"; then
+   PKG_CHECK_MODULES(ANERLEY, [anerley >= 0.0.10 clutter-gtk-0.9 >= 0.9.1 clutter-0.9 > 0.9.1 nbtk-1.0 >= 0.7.2 ])
+  	
+   AC_DEFINE(HAVE_ANERLEY, 1, [Anerley available])
+   AM_CONDITIONAL(ENABLE_ANERLEY, true)
+else
+   AC_DEFINE(HAVE_ANERLEY, 0, [Anerley not available])
+   AM_CONDITIONAL(ENABLE_ANERLEY, false)
+fi
 
 AC_OUTPUT([
 Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 52c452b..9596889 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,7 +11,8 @@ AM_CPPFLAGS = \
 	$(ANJAL_CFLAGS)	-I. \
 	$(MOZILLA_CFLAGS) \
 	$(WEBKIT_CFLAGS) \
-	$(UNIQUE_CFLAGS)
+	$(UNIQUE_CFLAGS) \
+	$(ANERLEY_CFLAGS)
 
 AM_CFLAGS =\
 	 -Wall\
@@ -79,6 +80,11 @@ else
 MOZ_ADD_LIBS = 
 endif
 
+if ENABLE_ANERLEY
+anjal_SOURCES += mail-people-view.c \
+		 mail-people-view.h
+endif
+
 anjal_LDFLAGS = \
 	-Wl,--export-dynamic
 
@@ -86,6 +92,7 @@ anjal_LDADD = $(ANJAL_LIBS) \
 	$(MOZILLA_LIBS) \
 	$(WEBKIT_LIBS) \
 	$(UNIQUE_LIBS) \
+	$(ANERLEY_LIBS) \
 	-lemiscwidgets \
 	-lfilter \
 	-lefilterbar \
diff --git a/src/mail-people-view.c b/src/mail-people-view.c
new file mode 100644
index 0000000..7e57f5a
--- /dev/null
+++ b/src/mail-people-view.c
@@ -0,0 +1,267 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ *
+ *
+ * Authors:
+ *		Srinivasa Ragavan <sragavan novell com>
+ *
+ * Copyright (C) 2009 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <glib/gi18n.h>
+#include "mail-people-view.h"
+#include "mail-component.h"
+#include <libedataserver/e-account-list.h>
+#include "mail-view.h"
+#include "mail/mail-config.h"
+
+#include <anerley/anerley-ebook-feed.h>
+#include <anerley/anerley-item.h>
+#include <anerley/anerley-simple-grid-view.h>
+#include <anerley/anerley-tile.h>
+#include <anerley/anerley-feed-model.h>
+
+#include <clutter/clutter.h>
+
+#include <glib.h>
+
+struct _MailPeopleViewPrivate {
+	GtkWidget *tab_str;
+  	EBook *book;
+	ClutterActor *table;
+};
+
+G_DEFINE_TYPE (MailPeopleView, mail_people_view, GTK_TYPE_VBOX)
+
+enum {
+	VIEW_CLOSE,
+	LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+static void
+mail_people_view_init (MailPeopleView  *shell)
+{
+	shell->priv = g_new0(MailPeopleViewPrivate, 1);
+}
+
+static void
+mail_people_view_finalize (GObject *object)
+{
+	/* MailPeopleView *shell = (MailPeopleView *)object; */
+
+	G_OBJECT_CLASS (mail_people_view_parent_class)->finalize (object);
+}
+
+static void
+mail_people_view_class_init (MailPeopleViewClass *klass)
+{
+	GObjectClass * object_class = G_OBJECT_CLASS (klass);
+
+	mail_people_view_parent_class = g_type_class_peek_parent (klass);
+	object_class->finalize = mail_people_view_finalize;
+
+	signals[VIEW_CLOSE] =
+		g_signal_new ("view-close",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (MailPeopleViewClass , view_close),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
+
+}
+
+#define PACK_BOX(w,s) box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start((GtkBox *)box, w, FALSE, FALSE, s); gtk_widget_show(box); gtk_widget_show(w); gtk_box_pack_start((GtkBox *)acview, box, FALSE, FALSE, 3);
+static void
+_entry_text_changed_cb (ClutterText  *text,
+                        ClutterModel *model)
+{
+  const gchar *str;
+  str = clutter_text_get_text (text);
+  g_debug ("foo: %s", str);
+
+  anerley_feed_model_set_filter_text ((AnerleyFeedModel *)model, str);
+}
+
+static void
+mpv_size_alloc (GtkWidget *widget, GtkAllocation *allocation, MailPeopleView *mpv)
+{
+	printf("%d %d\n", allocation->width, allocation->height);
+	clutter_actor_set_size (mpv->priv->table, allocation->width-10, allocation->height-6);
+}
+
+void
+mail_people_view_construct (MailPeopleView *acview)
+{
+	GtkWidget *box, *label, *tbox, *tlabel;
+	struct _EAccount *account = mail_config_get_default_account();
+	GError *error = NULL;
+  	AnerleyEBookFeed *feed;
+  	ClutterActor *stage;
+  	NbtkWidget *scroll_view;
+  	NbtkWidget *icon_view;
+  	ClutterModel *model;
+  	NbtkWidget *table, *entry;
+  	ClutterActor *tmp;
+	GtkWidget *embed; 
+
+	acview->priv->book = e_book_new_default_addressbook (&error);
+  	if (error) {
+    		g_warning (G_STRLOC ": Error getting default addressbook: %s",
+               		error->message);
+    		g_clear_error (&error);
+    		return 0;
+  	}
+
+  	feed = anerley_ebook_feed_new (acview->priv->book);
+  	model = anerley_feed_model_new (feed);
+  	icon_view = anerley_tile_view_new (model);
+
+	embed = gtk_clutter_embed_new ();
+	gtk_widget_show (embed);
+	stage = gtk_clutter_embed_get_stage (embed);
+
+  	table = nbtk_table_new ();
+  	entry = nbtk_entry_new (NULL);
+  	tmp = nbtk_entry_get_clutter_text (entry);
+  	g_signal_connect (tmp,
+        	            "text-changed",
+                	    _entry_text_changed_cb,
+                    	    model);
+
+	nbtk_table_add_actor_with_properties (NBTK_TABLE (table),
+                                        	entry,
+                                        	0,
+                                        	0,
+                                        	"x-fill",
+                                        	TRUE,
+                                        	"x-expand",
+                                        	TRUE,
+                                        	"y-expand",
+                                        	FALSE,
+                                        	NULL);
+
+  	scroll_view = nbtk_scroll_view_new ();
+  	clutter_container_add_actor (CLUTTER_CONTAINER (stage),
+                               	table);
+  	clutter_container_add_actor (CLUTTER_CONTAINER (scroll_view),
+                               	icon_view);
+  	clutter_actor_show_all (stage);
+  	nbtk_table_add_actor_with_properties (NBTK_TABLE (table),
+                                        	scroll_view,
+                                        	1,
+                                        	0,
+                                        	"x-fill",
+                                       		TRUE,
+                                        	"x-expand",
+                                        	TRUE,
+                                        	"y-expand",
+                                        	TRUE,
+                                        	"y-fill",
+                                        	TRUE,
+                                        	NULL);
+
+  	//clutter_actor_set_size (table, 640, 480);
+	gtk_box_pack_start (acview, embed, TRUE, TRUE, 6);
+	acview->priv->table = table;
+	g_signal_connect (acview, "size-allocate", G_CALLBACK(mpv_size_alloc), acview);
+}
+
+MailPeopleView *
+mail_people_view_new ()
+{
+	MailPeopleView *view = g_object_new (MAIL_PEOPLE_VIEW_TYPE, NULL);
+	view->type = MAIL_VIEW_PEOPLE;
+	view->uri = "people://";
+
+	mail_people_view_construct (view);
+	
+	return view;
+}
+
+static gboolean
+msv_btn_expose (GtkWidget *w, GdkEventExpose *event, MailPeopleView *mfv)
+{
+	GdkPixbuf *img = g_object_get_data ((GObject *)w, "pbuf");
+	cairo_t *cr = gdk_cairo_create (w->window);
+	cairo_save (cr);
+	gdk_cairo_set_source_pixbuf (cr, img, event->area.x-4, event->area.y-5);
+	cairo_paint(cr);
+	cairo_restore(cr);
+	cairo_destroy (cr);
+
+	return TRUE;
+}
+
+static void
+msv_close (GtkButton *w, MailPeopleView *mfv)
+{
+	g_signal_emit (mfv, signals[VIEW_CLOSE], 0);			
+}
+
+
+
+GtkWidget *
+mail_people_view_get_tab_widget(MailPeopleView *mcv)
+{
+	GdkPixbuf *pbuf = gtk_widget_render_icon ((GtkWidget *)mcv, "gtk-close", GTK_ICON_SIZE_MENU, NULL);
+
+	GtkWidget *tool, *box, *img;
+	int w=-1, h=-1;
+	GtkWidget *tab_label;
+
+	img = gtk_image_new_from_pixbuf (pbuf);
+	g_object_set_data ((GObject *)img, "pbuf", pbuf);
+	g_signal_connect (img, "expose-event", G_CALLBACK(msv_btn_expose), mcv);
+	
+	tool = gtk_button_new ();
+	gtk_button_set_relief((GtkButton *)tool, GTK_RELIEF_NONE);
+	gtk_button_set_focus_on_click ((GtkButton *)tool, FALSE);
+	gtk_widget_set_tooltip_text (tool, _("Close Tab"));
+	g_signal_connect (tool, "clicked", G_CALLBACK(msv_close), mcv);
+	
+	box = gtk_hbox_new (FALSE, 0);
+	gtk_box_pack_start ((GtkBox *)box, img, FALSE, FALSE, 0);
+	gtk_container_add ((GtkContainer *)tool, box);
+	gtk_widget_show_all (tool);
+	gtk_icon_size_lookup_for_settings (gtk_widget_get_settings(tool) , GTK_ICON_SIZE_MENU, &w, &h);
+	gtk_widget_set_size_request (tool, w+2, h+2);
+
+	box = gtk_label_new (_("Contacts"));
+	tab_label = gtk_hbox_new (FALSE, 0);
+	gtk_box_pack_start ((GtkBox *)tab_label, box, FALSE, FALSE, 0);
+	gtk_box_pack_start ((GtkBox *)tab_label, tool, FALSE, FALSE, 0);
+	gtk_widget_show_all (tab_label);
+
+	return tab_label;
+	
+}
+
+void
+mail_people_view_activate (MailPeopleView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, GtkWidget *slider, gboolean act)
+{
+	 if (!folder_tree || !check_mail || !sort_by)
+		  return;
+	 if (!GTK_WIDGET_VISIBLE(folder_tree))
+		 gtk_widget_show (slider);
+	 gtk_widget_set_sensitive (check_mail, act);
+	 gtk_widget_set_sensitive (sort_by, act);
+}
diff --git a/src/mail-people-view.h b/src/mail-people-view.h
new file mode 100644
index 0000000..1876e6f
--- /dev/null
+++ b/src/mail-people-view.h
@@ -0,0 +1,59 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ *
+ *
+ * Authors:
+ *		Srinivasa Ragavan <sragavan novell com>
+ *
+ * Copyright (C) 2009 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#ifndef _MAIL_PEOPLE_VIEW_H_
+#define _MAIL_PEOPLE_VIEW_H_
+
+#include <gtk/gtk.h>
+#include <webkit/webkit.h>
+#include "mail-view.h"
+
+#define MAIL_PEOPLE_VIEW_TYPE        (mail_people_view_get_type ())
+#define MAIL_PEOPLE_VIEW(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), MAIL_PEOPLE_VIEW_TYPE, MailFolderView))
+#define MAIL_PEOPLE_VIEW_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), MAIL_PEOPLE_VIEW_TYPE, MailFolderViewClass))
+#define IS_MAIL_PEOPLE_VIEW(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAIL_PEOPLE_VIEW_TYPE))
+#define IS_MAIL_PEOPLE_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAIL_PEOPLE_VIEW_TYPE))
+#define MAIL_PEOPLE_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MAIL_PEOPLE_VIEW_TYPE, MailFolderViewClass))
+
+
+typedef struct _MailPeopleViewPrivate MailPeopleViewPrivate;
+
+typedef struct _MailPeopleView {
+	GtkVBox parent;
+	int type;
+	char *uri;
+	MailViewFlags flags;
+	/* Base class of MailChildView ends */
+
+	MailPeopleViewPrivate *priv;
+} MailPeopleView;
+
+typedef struct _MailPeopleViewClass {
+	GtkVBoxClass parent_class;
+
+	void (* view_close) (MailPeopleView *);	
+} MailPeopleViewClass;
+
+MailPeopleView *mail_people_view_new (void);
+GtkWidget * mail_people_view_get_tab_widget(MailPeopleView *mcv);
+void mail_people_view_activate (MailPeopleView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, GtkWidget *slider, gboolean act);
+#endif
diff --git a/src/mail-shell.c b/src/mail-shell.c
index c5a2042..ecf700e 100644
--- a/src/mail-shell.c
+++ b/src/mail-shell.c
@@ -81,7 +81,8 @@ struct  _MailShellPrivate {
 	GtkWidget *settings;
 	GtkWidget *quit;	
 	GtkWidget *slider;
-
+	
+	MailViewChild *people;
 	char **args;
 };
 
@@ -91,6 +92,7 @@ static void
 mail_shell_init (MailShell  *shell)
 {
 	shell->priv = g_new0(MailShellPrivate, 1);
+	shell->priv->people = NULL;
 }
 
 static void
@@ -282,6 +284,23 @@ ms_check_new ()
 }
 
 static void
+ms_unlink_people (MailViewChild *mvc, MailShell *shell)
+{
+	shell->priv->people = NULL;
+}
+
+static void
+ms_show_people (GtkButton *button, MailShell *shell)
+{
+	if (!shell->priv->people) {
+		shell->priv->people = mail_view_add_page ((MailView *)shell->mail_component->mail_view, MAIL_VIEW_PEOPLE, NULL);
+		g_signal_connect(shell->priv->people, "view-close", G_CALLBACK(ms_unlink_people), shell);
+	} else {
+		mail_view_switch_to_people ((MailView *)shell->mail_component->mail_view, shell->priv->people);
+	}
+}
+
+static void
 ms_show_post_druid (MailViewChild *mfv, MailShell *shell)
 {
 	gtk_widget_show (((MailView *) shell->mail_component->mail_view)->folder_tree);
@@ -432,9 +451,8 @@ mail_shell_construct (MailShell *shell)
 	gtk_widget_show (priv->side_pane);
 	gtk_widget_show (tmp);
 
-	img = gtk_combo_box_new_text ();
-	gtk_combo_box_append_text ((GtkComboBox *)img, _("People"));
-	gtk_combo_box_set_active ((GtkComboBox *)img, 0);
+	img = gtk_button_new_with_label(_("Contacts"));
+	g_signal_connect (img, "clicked", G_CALLBACK(ms_show_people), shell);
 	gtk_widget_show (img);
 
 	gtk_paned_pack2 ((GtkPaned *)tmp, img, FALSE, FALSE);
diff --git a/src/mail-view.c b/src/mail-view.c
index d90c3ca..880242f 100644
--- a/src/mail-view.c
+++ b/src/mail-view.c
@@ -32,6 +32,7 @@
 #include "mail-composer-view.h"
 #include "mail-conv-view.h"
 #include "mail-settings-view.h"
+#include "mail-people-view.h"
 #include "mail-account-view.h"
 #include "mail-search.h"
 #include "mail/em-folder-tree.h"
@@ -128,6 +129,8 @@ mv_switch (GtkNotebook     *notebook,GtkNotebookPage *page, guint page_num, gpoi
 			mail_account_view_activate ((MailAccountView *)child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, FALSE);
 		else if (child->type == MAIL_VIEW_SETTINGS)
 			mail_settings_view_activate ((MailSettingsView *)child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, shell->slider, FALSE);
+		else if (child->type == MAIL_VIEW_PEOPLE)
+			mail_people_view_activate ((MailPeopleView *)child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, shell->slider, FALSE);
 
 		
 		
@@ -274,7 +277,9 @@ mv_close_mcv (MailViewChild *mfv, MailView *mv)
 		mail_account_view_activate ((MailAccountView *)child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
 	else if (child->type == MAIL_VIEW_SETTINGS)
 		mail_settings_view_activate ((MailSettingsView *)child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, FALSE);
-	
+	else if (child->type == MAIL_VIEW_PEOPLE)
+		mail_people_view_activate ((MailPeopleView *)child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, FALSE);
+
 }
 
 static void
@@ -406,6 +411,39 @@ mail_view_add_settings (MailView *mv, gpointer data, gboolean block)
 	return (MailViewChild *)msv;
 }
 
+void
+mail_view_switch_to_people (MailView* mv, MailViewChild *mpv)
+{
+	GList *tmp = mv->priv->children;
+	int position = 0;
+
+	position = g_list_index (tmp, mpv);
+	gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
+	mail_people_view_activate (mpv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, FALSE);
+}
+
+static MailViewChild *
+mail_view_add_people (MailView *mv, gpointer data, gboolean block)
+{
+	MailPeopleView *msv  = mail_people_view_new ();
+	gint position = 0;
+	
+	gtk_widget_show ((GtkWidget *)msv);
+	mv->priv->current_view = (MailViewChild *)msv;
+	mv->priv->children = g_list_append (mv->priv->children,  msv);
+	position = gtk_notebook_append_page ((GtkNotebook *)mv, (GtkWidget *)msv, mail_people_view_get_tab_widget(msv));
+	g_signal_connect (msv, "view-close", G_CALLBACK(mv_close_mcv), mv);
+	gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *)msv, FALSE);
+        gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *)msv, FALSE);
+	if (!block)
+		gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
+	gtk_notebook_set_tab_label_packing ((GtkNotebook *)mv, (GtkWidget *)msv, FALSE, FALSE, 0);
+	if(!block)
+		 mail_people_view_activate (msv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, FALSE);
+
+	return (MailViewChild *)msv;
+}
+
 static MailViewChild *
 mail_view_add_account (MailView *mv, gpointer data, gboolean block)
 {
@@ -453,6 +491,9 @@ mail_view_add_page (MailView *mv, guint16 type, gpointer data)
 	case MAIL_VIEW_SETTINGS:
 		 child = mail_view_add_settings (mv, data, block);
 		break;
+	case MAIL_VIEW_PEOPLE:
+		 child = mail_view_add_people (mv, data, block);
+		break;
 	case MAIL_VIEW_ACCOUNT:
 		 child = mail_view_add_account (mv, data, block);
 		break;	
diff --git a/src/mail-view.h b/src/mail-view.h
index 734f0f8..6529b54 100644
--- a/src/mail-view.h
+++ b/src/mail-view.h
@@ -37,7 +37,8 @@ enum {
 	MAIL_VIEW_COMPOSER,
 	MAIL_VIEW_MESSAGE,
 	MAIL_VIEW_ACCOUNT,
-	MAIL_VIEW_SETTINGS
+	MAIL_VIEW_SETTINGS,
+	MAIL_VIEW_PEOPLE
 };
 
 typedef struct _MailViewPrivate MailViewPrivate;
@@ -83,5 +84,6 @@ MailViewChild * mail_view_add_page (MailView *mv, guint16 type, gpointer data);
 void mail_view_set_search (MailView *view, const char *search, char *state, char *search_str);
 void mail_view_set_slider (MailView *mv, GtkWidget *slider);
 void mail_view_init_search (MailView *mv, GtkWidget *search);
+void mail_view_switch_to_people (MailView* mv, MailViewChild *mpv);
 
 #endif
diff --git a/src/main.c b/src/main.c
index a1cb018..208de6c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -48,6 +48,11 @@
 #include <unique/unique.h>
 #endif
 
+#if HAVE_ANERLEY
+#include <clutter-gtk/clutter-gtk.h>
+#include <nbtk/nbtk.h>
+#endif
+
 gboolean windowed = FALSE;
 gboolean default_app =  FALSE;
 GtkWidget *main_window;
@@ -216,10 +221,20 @@ main (int argc, char *argv[])
 
 	
 	gtk_set_locale ();
+
+#if HAVE_ANERLEY
+	if (!gtk_clutter_init_with_args (&argc, &argv, _("Anjal email client"), entries, NULL, &error)) {
+		g_error ("Unable to start Anjal: %s\n", error->message);
+		g_error_free(error);
+	}
+	nbtk_style_load_from_file (nbtk_style_get_default (), PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "anerley" G_DIR_SEPARATOR_S "style.css", NULL);
+
+#else
 	if (!gtk_init_with_args (&argc, &argv, _("Anjal email client"), entries, NULL, &error)) {
 		g_error ("Unable to start Anjal: %s\n", error->message);
 		g_error_free(error);
 	}
+#endif	
 	glade_init ();
 	e_cursors_init ();
 	e_passwords_init();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]