From c9a5d09432355b1c28357f7fffa7d9b559f6fd6f Mon Sep 17 00:00:00 2001
From: Jonas Fonseca <fonseca@diku.dk>
Date: Mon, 28 Jun 2010 22:33:43 -0400
Subject: [PATCH] im

Signed-off-by: Jonas Fonseca <jonas.fonseca@savoirfairelinux.com>
---
 .gitignore                                    |   1 +
 sflphone-client-gnome/Makefile.am             |   2 +-
 sflphone-client-gnome/configure.ac            |   2 +
 sflphone-client-gnome/src/Makefile.am         |   1 +
 sflphone-client-gnome/src/callable_obj.h      |   3 +
 .../src/icons/icon_factory.c                  |   1 +
 .../src/icons/icon_factory.h                  |   1 +
 sflphone-client-gnome/src/icons/pixmap_data.h |  98 +++++++++++++
 sflphone-client-gnome/src/imwindow.c          | 134 ++++++++++++++++++
 sflphone-client-gnome/src/imwindow.h          |  59 ++++++++
 sflphone-client-gnome/src/sflphone_const.h    |   4 +
 sflphone-client-gnome/src/ui.xml              |   1 +
 sflphone-client-gnome/src/uimanager.c         |  41 ++++++
 sflphone-client-gnome/src/widget/Makefile.am  |   3 +-
 sflphone-client-gnome/src/widget/imwidget.c   | 132 +++++++++++++++++
 sflphone-client-gnome/src/widget/imwidget.h   |  70 +++++++++
 sflphone-client-gnome/src/widget/webwidget.c  |  87 ++++++++++++
 sflphone-client-gnome/src/widget/webwidget.h  |  68 +++++++++
 sflphone-client-gnome/webkit/Makefile.am      |   8 ++
 sflphone-client-gnome/webkit/im/im.css        |   6 +
 sflphone-client-gnome/webkit/im/im.html       |  11 ++
 sflphone-client-gnome/webkit/im/im.js         |   4 +
 22 files changed, 735 insertions(+), 2 deletions(-)
 create mode 100644 sflphone-client-gnome/src/imwindow.c
 create mode 100644 sflphone-client-gnome/src/imwindow.h
 create mode 100644 sflphone-client-gnome/src/widget/imwidget.c
 create mode 100644 sflphone-client-gnome/src/widget/imwidget.h
 create mode 100644 sflphone-client-gnome/src/widget/webwidget.c
 create mode 100644 sflphone-client-gnome/src/widget/webwidget.h
 create mode 100644 sflphone-client-gnome/webkit/Makefile.am
 create mode 100644 sflphone-client-gnome/webkit/im/im.css
 create mode 100644 sflphone-client-gnome/webkit/im/im.html
 create mode 100644 sflphone-client-gnome/webkit/im/im.js

diff --git a/.gitignore b/.gitignore
index 0fbd7f9d1f..84abb7e3ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -98,6 +98,7 @@ sflphone-client-gnome/stamp-h1
 /sflphone-client-gnome/src/widget/Makefile
 /sflphone-client-gnome/doc/Makefile
 /sflphone-client-gnome/po/Makefile
+/sflphone-client-gnome/webkit/Makefile
 
 
 # Ignore sflphone-client-gnome stuff
diff --git a/sflphone-client-gnome/Makefile.am b/sflphone-client-gnome/Makefile.am
index 7b944d2331..5a51abcf58 100644
--- a/sflphone-client-gnome/Makefile.am
+++ b/sflphone-client-gnome/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = src pixmaps tests man po doc
+SUBDIRS = src pixmaps webkit tests man po doc
 
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/sflphone-client-gnome/configure.ac b/sflphone-client-gnome/configure.ac
index 44f118f539..f55e2b5308 100644
--- a/sflphone-client-gnome/configure.ac
+++ b/sflphone-client-gnome/configure.ac
@@ -64,6 +64,7 @@ PKG_CHECK_MODULES(DEPS,     \
     libnotify >= 0.4        \
     gtk+-2.0 >= 2.2         \
     glib-2.0 >= 2.2         \
+    webkit-1.0              \
     libebook-1.2 >= 2.22	\
 	libgnomeui-2.0			\
 	gnome-doc-utils
@@ -90,6 +91,7 @@ src/contacts/addressbook/Makefile
 src/widget/Makefile
 src/icons/Makefile
 pixmaps/Makefile
+webkit/Makefile
 sflphone.desktop
 tests/Makefile
 man/Makefile
diff --git a/sflphone-client-gnome/src/Makefile.am b/sflphone-client-gnome/src/Makefile.am
index 3ce309ce5a..8157802a91 100644
--- a/sflphone-client-gnome/src/Makefile.am
+++ b/sflphone-client-gnome/src/Makefile.am
@@ -16,6 +16,7 @@ sflphone_client_gnome_SOURCES = \
   uimanager.c \
   sflnotify.c \
   mainwindow.c \
+  imwindow.c \
   dialpad.c \
   callable_obj.c \
   conference_obj.c \
diff --git a/sflphone-client-gnome/src/callable_obj.h b/sflphone-client-gnome/src/callable_obj.h
index 61acd6ce9a..a3d4f252ee 100644
--- a/sflphone-client-gnome/src/callable_obj.h
+++ b/sflphone-client-gnome/src/callable_obj.h
@@ -149,6 +149,9 @@ typedef struct  {
     /* The audio codec used for this call, if applicable */
     gchar *_audio_codec;
 
+    /* Associated IM widget */
+    GtkWidget *_im_widget;
+
 } callable_obj_t;
 
 void create_new_call (callable_type_t, call_state_t, gchar*, gchar*, gchar*, gchar*, callable_obj_t **);
diff --git a/sflphone-client-gnome/src/icons/icon_factory.c b/sflphone-client-gnome/src/icons/icon_factory.c
index c18e038b0a..c7af1ce806 100644
--- a/sflphone-client-gnome/src/icons/icon_factory.c
+++ b/sflphone-client-gnome/src/icons/icon_factory.c
@@ -67,6 +67,7 @@ void register_sflphone_stock_icons (GtkIconFactory *factory)
 	add_icon (factory, GTK_STOCK_TRANSFER, gnome_stock_transfer, GTK_ICON_SIZE_SMALL_TOOLBAR);	
 	add_icon (factory, GTK_STOCK_ONHOLD, gnome_stock_onhold, GTK_ICON_SIZE_SMALL_TOOLBAR);	
 	add_icon (factory, GTK_STOCK_OFFHOLD, gnome_stock_offhold, GTK_ICON_SIZE_SMALL_TOOLBAR);	
+	add_icon (factory, GTK_STOCK_IM, gnome_stock_im, GTK_ICON_SIZE_SMALL_TOOLBAR);	
 	add_icon (factory, GTK_STOCK_CALL_CURRENT, gnome_stock_call_current, GTK_ICON_SIZE_SMALL_TOOLBAR);	
 	add_icon (factory, GTK_STOCK_ADDRESSBOOK, gnome_stock_addressbook, GTK_ICON_SIZE_SMALL_TOOLBAR);	
 	add_icon (factory, GTK_STOCK_CALLS, gnome_stock_calls, GTK_ICON_SIZE_SMALL_TOOLBAR);	
diff --git a/sflphone-client-gnome/src/icons/icon_factory.h b/sflphone-client-gnome/src/icons/icon_factory.h
index 6392832ac6..4130b02b91 100644
--- a/sflphone-client-gnome/src/icons/icon_factory.h
+++ b/sflphone-client-gnome/src/icons/icon_factory.h
@@ -41,6 +41,7 @@ G_BEGIN_DECLS
 #define GTK_STOCK_HANGUP				"gnome-stock-hangup"
 #define GTK_STOCK_ONHOLD				"gnome-stock-onhold"
 #define GTK_STOCK_OFFHOLD				"gnome-stock-offhold"
+#define GTK_STOCK_IM					"gnome-stock-im"
 #define GTK_STOCK_TRANSFER				"gnome-stock-transfer"
 #define GTK_STOCK_DIAL					"gnome-stock-dial"
 #define GTK_STOCK_CALL_CURRENT			"gnome-stock-call-current"
diff --git a/sflphone-client-gnome/src/icons/pixmap_data.h b/sflphone-client-gnome/src/icons/pixmap_data.h
index ce8fcc648c..676dbe4110 100644
--- a/sflphone-client-gnome/src/icons/pixmap_data.h
+++ b/sflphone-client-gnome/src/icons/pixmap_data.h
@@ -660,6 +660,104 @@ static const guint8 gnome_stock_offhold[] =
   "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0lrU\0mt\267\0lt\254\0js<\0\0\0\0"};
 
 
+/* GdkPixbuf RGBA C-Source image dump */
+
+#ifdef __SUNPRO_C
+#pragma align 4 (gnome_stock_im)
+#endif
+#ifdef __GNUC__
+static const guint8 gnome_stock_im[] __attribute__ ((__aligned__ (4))) = 
+#else
+static const guint8 gnome_stock_im[] = 
+#endif
+{ ""
+  /* Pixbuf magic (0x47646b50) */
+  "GdkP"
+  /* length: header (24) + pixel_data (2304) */
+  "\0\0\11\30"
+  /* pixdata_type (0x1010002) */
+  "\1\1\0\2"
+  /* rowstride (96) */
+  "\0\0\0`"
+  /* width (24) */
+  "\0\0\0\30"
+  /* height (24) */
+  "\0\0\0\30"
+  /* pixel_data: */
+  "\0\0\0\0\0ix\21\0mss\0mr\210\0lt@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "3ff\5\14kqV\14lr\250\0lr}\0mv\34\0\0\0\0\0ht\26\0ls\343\0ls\377\0ls\377"
+  "\0ls\377\0ms\242\0\200\200\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\34qq\11\33mm/\32kqX\33ms\205\26lq\320\17ou\377\22kp"
+  "\377\0ls\377\0ls\364\0lq-\0ks\212\0ls\377\0ls\377\0ls\377\0ls\377\0l"
+  "s\377\0ks\253\0ff\5\0\0\0\0\0\0\0\0\40`p\20\34mm6\35nta\33ms\214\34k"
+  "p\235\26tz\230\16\202\212\237\5\206\216\324\1\207\217\377\1\205\216\377"
+  "\21lq\377\0ls\377\0ls\377\0ks\262\0lr\256\0ls\377\0ls\377\0ls\377\0l"
+  "s\377\0ls\377\3lr\377\11lr\300\32mtn\34ns\222\34lq\234\26y\200\230\15"
+  "\207\217\240\6\222\233\241\0\233\245\241\0\232\245\241\0\216\226\324"
+  "\4\201\211\377\10z\200\377\2\203\213\377\21lq\377\0ls\377\0ls\377\0l"
+  "t\326\0lsv\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\22lq\377\16sy\377"
+  "\11\202\212\341\5\226\241\243\0\236\251\241\0\236\250\241\2\232\245\241"
+  "\6\217\230\241\16\202\212\237\20qy\321\21lq\377\17ls\377\22kp\377\2\201"
+  "\211\377\21kq\377\0ls\377\0ls\377\0ks\235\0\200\200\6\0ls\377\0ls\377"
+  "\0ls\377\0ls\377\0ls\377\17ls\377\3\210\220\377\1\212\223\377\6\205\215"
+  "\342\16\201\211\240\27rw\230\35ko\236\33lt\206\15lq\266\6ls\377\1ls\377"
+  "\0ls\377\21lq\377\2\177\207\377\21kq\377\0ls\377\0lr\341\0ju\30\0\0\0"
+  "\0\0pp\20\0ms\312\0ls\377\0ls\377\0ls\377\17ls\377\3\207\216\377\22k"
+  "p\377\15ms\377\13mr\314\26ot.$mm\7\0lr\223\0ls\377\0ls\377\0ls\377\0"
+  "ls\377\21lq\377\2~\206\377\21kq\377\0ls\340\0lt!\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0fw\17\0ls\307\0ls\377\0ls\377\17ls\377\3\205\216\377\22kp\377\0"
+  "ls\377\0ls\377\0ls\266\0kr\230\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377"
+  "\21lq\377\2}\204\377\22kq\362\0pp\40\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0fw\17\0ks\305\0ls\377\17ls\377\3\204\214\377\22kp\377\0ls\377"
+  "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\21l"
+  "q\377\2|\204\362\32ko\247\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0mm\16\0lr\304\17ls\377\3\202\213\377\22kp\377\0ls\377\0"
+  "ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\22lp\361"
+  "\3~\210\254\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0vv\15\21ls\345\3\201\211\377\22kp\377\0ls\377\0ls\377"
+  "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\332\32lo\247\3\177"
+  "\210\241\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\32mr\224\3\201\211\351\22kp\377\0ls\377\0ls\377"
+  "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\377\0mt\332\0hq\33\34lo\234\3}\205"
+  "\241\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\33lq\220\3\201\211\335\22kp\377\0ls\377\0ls\377\0ls"
+  "\377\0ls\377\0ls\377\0ls\377\0ls\377\0ms\305\0f\200\12\34lo\234\3z\203"
+  "\241\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0UU\3\22lr\326\3}\205\377\22kp\377\0ls\377\0ls\377\0ls\377\0"
+  "ls\377\0ls\377\0ls\377\4ls\377\12lr\377\17mq\337\34ko\245\3x\200\241"
+  "\34kp\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U"
+  "U\3\0ks\244\17lr\377\3|\204\377\22kp\377\0ls\377\0ls\377\0ls\377\0ls"
+  "\377\3ls\377\16lq\377\17lr\377\11rx\377\5sz\377\7rx\351\3w\177\245\35"
+  "ko\236\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0UU\3\0ls\246"
+  "\0ls\377\17kr\377\3{\202\377\22kp\377\0ls\377\0ls\377\0ls\377\2ls\377"
+  "\20lq\377\10rx\377\0v}\377\0u}\377\0t{\377\0sz\377\3rx\351\34jo\246\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\4\3ls\257\10lr\377\13"
+  "lr\377\22kp\377\3y\201\377\22kp\377\0ls\377\0ls\377\0ls\324\16lr\333"
+  "\10ry\377\0v}\377\0t|\377\0t{\377\0sz\377\0ry\377\6nv\377\16kr\337\0"
+  "fw\17\0\0\0\0\0\0\0\0\0\0\0\0\22mm\16\16lr\315\21lr\377\13qx\377\6v}"
+  "\377\10u{\377\2y\201\377\22kp\377\0ls\377\0ls\317\0ht\26\35kp\240\1u"
+  "|\344\0t{\377\0sz\377\0ry\377\0qx\377\4ov\377\20kq\377\3ls\377\0ls\307"
+  "\0fw\17\0\0\0\0\40\200\200\10\22lr\331\13qy\377\1}\204\377\0|\204\377"
+  "\0{\202\377\0z\202\377\1x\177\377\22kp\377\0ls\316\0ky\23\0\0\0\0\35"
+  "kp\217\13sy\242\1t|\343\0qx\377\4pv\377\13mt\377\20kp\377\4kr\377\0l"
+  "s\377\0ls\377\0ls\377\0\200\200\6\17mr\233\12ry\377\0}\204\377\0{\203"
+  "\377\0{\202\377\0y\201\377\0y\200\377\4u|\377\17lq\347\0qq\22\0\0\0\0"
+  "\0\0\0\0\34hq\33\32lp\200\34kp\235\23kp\341\17lq\377\11lr\377\1ks\377"
+  "\0ls\377\0ls\377\0ls\377\0ls\377\0lt\213\23kr\333\3y\201\377\0{\202\377"
+  "\0z\201\377\0y\200\377\0x\177\377\3v|\377\21jr\353\23mv6\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\6\0mr\260\0ls\377\0ls"
+  "\377\0ls\377\0ls\377\0ls\377\0ls\377\0ls\322\22lr\313\10s{\377\0y\200"
+  "\377\0x\200\377\2v}\377\11qw\377\21kq\353\27koL\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\6\0ls\255\0ls\377"
+  "\0ls\377\0ls\377\0ls\377\0ls\377\0ls\273\14jnA\17lq\370\21kq\377\20k"
+  "r\377\20lq\377\15kr\335\24bo'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ff\5\0lt\252\0ls\377\0ls\377"
+  "\0ls\377\0ls\374\0ksE\0\0\0\0\0lq-\2ms\242\1ls\275\0lrt\0tt\13\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0lrU\0mt\267\0lt\254\0js<\0\0\0\0"};
+
+
 /* GdkPixbuf RGBA C-Source image dump */
 
 #ifdef __SUNPRO_C
diff --git a/sflphone-client-gnome/src/imwindow.c b/sflphone-client-gnome/src/imwindow.c
new file mode 100644
index 0000000000..fbbeb50a59
--- /dev/null
+++ b/sflphone-client-gnome/src/imwindow.c
@@ -0,0 +1,134 @@
+/*
+ *  Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
+ *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
+ *  Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
+ *  Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>
+ *
+ *  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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Additional permission under GNU GPL version 3 section 7:
+ *
+ *  If you modify this program, or any covered work, by linking or
+ *  combining it with the OpenSSL project's OpenSSL library (or a
+ *  modified version of that library), containing parts covered by the
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  grants you additional permission to convey the resulting work.
+ *  Corresponding Source for a non-source form of such a combination
+ *  shall include the source code for the parts of OpenSSL used as well
+ *  as that of the covered work.
+ */
+
+#include <config.h>
+#include <gtk/gtk.h>
+#include <eel-gconf-extensions.h>
+#include <sflphone_const.h>
+
+#include <imwindow.h>
+
+/** Local variables */
+GtkWidget *im_window = NULL;
+GtkWidget *im_vbox = NULL;
+
+static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) {
+	int pos_x, pos_y;
+
+	eel_gconf_set_integer (CONF_IM_WINDOW_WIDTH, event->width);
+	eel_gconf_set_integer (CONF_IM_WINDOW_HEIGHT, event->height);
+
+	gtk_window_get_position (GTK_WINDOW (im_window_get()), &pos_x, &pos_y);
+	eel_gconf_set_integer (CONF_IM_WINDOW_POSITION_X, pos_x);
+	eel_gconf_set_integer (CONF_IM_WINDOW_POSITION_Y, pos_y);
+
+	return FALSE;
+}
+
+/**
+ * Minimize the main window.
+ */
+static gboolean
+on_delete(GtkWidget * widget UNUSED, gpointer data UNUSED)
+{
+	gtk_widget_hide(GTK_WIDGET(im_window_get()));
+	return TRUE;
+}
+
+static void
+im_window_init()
+{
+	const char *window_title = "SFLphone VoIP Client";
+	gchar *path;
+	GError *error = NULL;
+	gboolean ret;
+	int width, height, position_x, position_y;
+
+	// Get configuration stored in gconf
+	width = eel_gconf_get_integer(CONF_IM_WINDOW_WIDTH);
+	if (width <= 0)
+		width = 400;
+	height = eel_gconf_get_integer(CONF_IM_WINDOW_HEIGHT);
+	if (height <= 0)
+		height = 500;
+	position_x = eel_gconf_get_integer(CONF_IM_WINDOW_POSITION_X);
+	position_y = eel_gconf_get_integer(CONF_IM_WINDOW_POSITION_Y);
+
+	im_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+	gtk_container_set_border_width(GTK_CONTAINER(im_window), 0);
+	gtk_window_set_title(GTK_WINDOW(im_window), window_title);
+	gtk_window_set_default_size(GTK_WINDOW (im_window), width, height);
+	gtk_window_set_default_icon_from_file(LOGO, NULL);
+	gtk_window_set_position(GTK_WINDOW(im_window), GTK_WIN_POS_MOUSE);
+
+	gtk_widget_set_name(im_window, "imwindow");
+
+	g_signal_connect (G_OBJECT (im_window), "delete-event",
+		G_CALLBACK (on_delete), NULL);
+
+	g_signal_connect_object (G_OBJECT (im_window), "configure-event",
+		G_CALLBACK (window_configure_cb), NULL, 0);
+
+	im_vbox = gtk_vbox_new (FALSE /*homogeneous*/, 0 /*spacing*/);
+
+	gtk_container_add (GTK_CONTAINER (im_window), im_vbox);
+
+	/* make sure that everything is visible */
+	gtk_widget_show_all (im_window);
+
+	// Restore position according to the configuration stored in gconf
+	gtk_window_move (GTK_WINDOW (im_window), position_x, position_y);
+}
+
+GtkWidget *
+im_window_get()
+{
+	if (im_window == NULL)
+		im_window_init();
+	return im_window;
+}
+
+void
+im_window_add(GtkWidget *widget)
+{
+	if (im_window_get()) {
+		gtk_box_pack_start (GTK_BOX (im_vbox), widget, TRUE /*expand*/,
+			TRUE /*fill*/, 0 /*padding*/);
+		gtk_widget_show_all (im_window);
+	}
+}
+
+void
+im_window_remove(GtkWidget *widget)
+{
+	// TODO(jonas) remove widget from the window
+}
diff --git a/sflphone-client-gnome/src/imwindow.h b/sflphone-client-gnome/src/imwindow.h
new file mode 100644
index 0000000000..61128a415f
--- /dev/null
+++ b/sflphone-client-gnome/src/imwindow.h
@@ -0,0 +1,59 @@
+/*
+ *  Copyright (C) 2010 Savoir-Faire Linux 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Additional permission under GNU GPL version 3 section 7:
+ *
+ *  If you modify this program, or any covered work, by linking or
+ *  combining it with the OpenSSL project's OpenSSL library (or a
+ *  modified version of that library), containing parts covered by the
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  grants you additional permission to convey the resulting work.
+ *  Corresponding Source for a non-source form of such a combination
+ *  shall include the source code for the parts of OpenSSL used as well
+ *  as that of the covered work.
+ */
+
+#ifndef __IMWINDOW_H__
+#define __IMWINDOW_H__
+
+#include <gtk/gtk.h>
+#include <gtk/gtk.h>
+
+#define IM_WINDOW_WIDTH 280
+#define IM_WINDOW_HEIGHT 320
+
+/** @file imwindow.h
+  * @brief The IM window of the client.
+  */
+
+/**
+ * Display the IM window
+ * @return GtkWidget* The IM window
+ */
+GtkWidget *im_window_get();
+
+/**
+ * Add IM widget to the IM window
+ */
+void im_window_add(GtkWidget *widget);
+
+/**
+ * Remove IM widget from the IM window
+ */
+void im_window_remove(GtkWidget *widget);
+
+#endif
diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h
index 250a8c5673..6f27125dc0 100644
--- a/sflphone-client-gnome/src/sflphone_const.h
+++ b/sflphone-client-gnome/src/sflphone_const.h
@@ -185,6 +185,10 @@ log4c_category_t* log4c_sfl_gtk_category;
 #define CONF_MAIN_WINDOW_HEIGHT		CONF_PREFIX "/state/window_height"
 #define CONF_MAIN_WINDOW_POSITION_X		CONF_PREFIX "/state/window_position_x"
 #define CONF_MAIN_WINDOW_POSITION_Y		CONF_PREFIX "/state/window_position_y"
+#define CONF_IM_WINDOW_WIDTH		CONF_PREFIX "/state/im_width"
+#define CONF_IM_WINDOW_HEIGHT		CONF_PREFIX "/state/im_height"
+#define CONF_IM_WINDOW_POSITION_X		CONF_PREFIX "/state/im_position_x"
+#define CONF_IM_WINDOW_POSITION_Y		CONF_PREFIX "/state/im_position_y"
 /** Show/Hide the dialpad */
 #define CONF_SHOW_DIALPAD			CONF_PREFIX "/state/dialpad"	
 #define SHOW_VOLUME_CONTROLS		CONF_PREFIX "/state/volume_controls"	
diff --git a/sflphone-client-gnome/src/ui.xml b/sflphone-client-gnome/src/ui.xml
index 449e67b0bf..7e6045f021 100644
--- a/sflphone-client-gnome/src/ui.xml
+++ b/sflphone-client-gnome/src/ui.xml
@@ -7,6 +7,7 @@
       <menuitem action="PickUp"/>
       <menuitem action="HangUp"/>
       <menuitem name="OnHoldMenu" action="OnHold"/>
+      <menuitem action="InstantMessaging"/>
       <menuitem action="Record"/>
       <separator/>
       <menuitem action="AccountAssistant"/>
diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c
index 8f3a41ca1e..ebc44c113d 100644
--- a/sflphone-client-gnome/src/uimanager.c
+++ b/sflphone-client-gnome/src/uimanager.c
@@ -39,6 +39,7 @@
 #include <libgnome/gnome-help.h>
 #include <uimanager.h>
 #include <statusicon.h>
+#include <widget/imwidget.h>
 
 static GtkWidget *toolbar;
 static GtkWidget *toolbarWindows;
@@ -504,6 +505,26 @@ call_hold(void* foo UNUSED)
     }
 }
 
+static void
+call_im(void* foo UNUSED)
+{
+  callable_obj_t * selectedCall = calltab_get_selected_call(current_calls);
+
+  static GtkWidget *im = NULL;
+  if (!im) {
+	  im = im_widget_new();
+	  im_window_add(im);
+  } else {
+	  im_widget_add_message(im, "hello from call_im");
+  }
+
+  if (selectedCall)
+    {
+       printf("Call IM with call\n");
+       selectedCall->_im_widget = im_widget_new();
+    }
+}
+
 static void
 conference_hold(void* foo UNUSED)
 {
@@ -839,6 +860,8 @@ static const GtkActionEntry menu_entries[] =
             N_("Place the call on hold"), G_CALLBACK (call_hold) },
         { "OffHold", GTK_STOCK_OFFHOLD, N_("O_ff hold"), "<control>P",
             N_("Place the call off hold"), G_CALLBACK (call_hold) },
+        { "InstantMessaging", GTK_STOCK_IM, N_("Send _message"), "<control>M",
+            N_("Send message"), G_CALLBACK (call_im) },
         { "AccountAssistant", NULL, N_("Configuration _Assistant"), NULL,
             N_("Run the configuration assistant"),
             G_CALLBACK (call_configuration_assistant) },
@@ -1012,6 +1035,7 @@ show_popup_menu(GtkWidget *my_widget, GdkEventButton *event)
   gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record =
       FALSE, detach = FALSE;
   gboolean accounts = FALSE;
+  gboolean im = FALSE;
 
   // conference type boolean
   gboolean hangup_conf = FALSE, hold_conf = FALSE;
@@ -1054,6 +1078,7 @@ show_popup_menu(GtkWidget *my_widget, GdkEventButton *event)
             hold = TRUE;
             record = TRUE;
             detach = TRUE;
+	    im = TRUE;
             break;
           case CALL_STATE_BUSY:
           case CALL_STATE_FAILURE:
@@ -1182,6 +1207,22 @@ show_popup_menu(GtkWidget *my_widget, GdkEventButton *event)
           gtk_widget_show(menu_items);
         }
 
+      if (im)
+        {
+          menu_items = gtk_separator_menu_item_new();
+          gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items);
+          gtk_widget_show(menu_items);
+
+          menu_items = gtk_image_menu_item_new_with_mnemonic(_("Send _message"));
+          image = gtk_image_new_from_stock(GTK_STOCK_IM, GTK_ICON_SIZE_MENU);
+          gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image);
+          gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items);
+          g_signal_connect (G_OBJECT (menu_items), "activate",
+              G_CALLBACK (call_im),
+              NULL);
+          gtk_widget_show(menu_items);
+        }
+
     }
   else
     {
diff --git a/sflphone-client-gnome/src/widget/Makefile.am b/sflphone-client-gnome/src/widget/Makefile.am
index da7632ae94..487e4d7355 100644
--- a/sflphone-client-gnome/src/widget/Makefile.am
+++ b/sflphone-client-gnome/src/widget/Makefile.am
@@ -4,7 +4,8 @@ noinst_LTLIBRARIES = libwidget.la
 
 libwidget_la_SOURCES = \
 		gtkscrollbook.c \
-		minidialog.c
+		minidialog.c \
+		imwidget.c
 
 libwidget_la_LDFLAGS = @DEPS_LDFLAGS@
 					  
diff --git a/sflphone-client-gnome/src/widget/imwidget.c b/sflphone-client-gnome/src/widget/imwidget.c
new file mode 100644
index 0000000000..856497321f
--- /dev/null
+++ b/sflphone-client-gnome/src/widget/imwidget.c
@@ -0,0 +1,132 @@
+/*
+ *  Copyright (C) 2010 Savoir-Faire Linux 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Additional permission under GNU GPL version 3 section 7:
+ *
+ *  If you modify this program, or any covered work, by linking or
+ *  combining it with the OpenSSL project's OpenSSL library (or a
+ *  modified version of that library), containing parts covered by the
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  grants you additional permission to convey the resulting work.
+ *  Corresponding Source for a non-source form of such a combination
+ *  shall include the source code for the parts of OpenSSL used as well
+ *  as that of the covered work.
+ */
+
+#include "imwidget.h"
+#include <JavaScriptCore/JavaScript.h>
+
+#define WEBKIT_DIR "file://" DATA_DIR "/webkit/"
+
+void
+im_widget_add_message(GtkWidget *widget, const gchar *message)
+{
+	IMWidget *im = IM_WIDGET(widget);
+	gchar *script = g_strdup_printf("add_message('%s');", message);
+
+	webkit_web_view_execute_script(WEBKIT_WEB_VIEW(im->web_view), script);
+	g_free(script);
+}
+
+static gboolean
+web_view_nav_requested_cb(
+	WebKitWebView             *web_view,
+	WebKitWebFrame            *frame,
+	WebKitNetworkRequest      *request,
+	WebKitWebNavigationAction *navigation_action,
+	WebKitWebPolicyDecision   *policy_decision,
+	gpointer                   user_data)
+{
+	const gchar *uri = webkit_network_request_get_uri(request);
+
+	/* Always allow files we are serving ourselves. */
+	if (!strncmp(uri, WEBKIT_DIR, sizeof(WEBKIT_DIR) - 1)) {
+		webkit_web_policy_decision_use(policy_decision);
+	} else {
+		printf("FIXME(jonas) open URL in browser: %s\n", uri);
+		webkit_web_policy_decision_ignore(policy_decision);
+	}
+	return TRUE;
+}
+
+static void
+im_widget_class_init(IMWidgetClass *klass)
+{
+}
+
+static void
+im_widget_init(IMWidget *im)
+{
+	im->textarea = gtk_text_view_new();
+	gtk_text_view_set_editable(GTK_TEXT_VIEW(im->textarea), TRUE);
+	GtkWidget *textscrollwin = gtk_scrolled_window_new(NULL, NULL);
+	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(textscrollwin),
+		GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+	gtk_container_add(GTK_CONTAINER(textscrollwin), im->textarea);
+
+	im->web_view = webkit_web_view_new();
+	GtkWidget *webscrollwin = gtk_scrolled_window_new(NULL, NULL);
+	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(webscrollwin),
+		GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+	gtk_container_add(GTK_CONTAINER(webscrollwin), im->web_view);
+
+	g_signal_connect(im->web_view, "navigation-policy-decision-requested",
+		G_CALLBACK (web_view_nav_requested_cb), NULL);
+
+	gtk_box_pack_start(GTK_BOX(im), webscrollwin, TRUE, TRUE, 5);
+	gtk_box_pack_end(GTK_BOX(im), textscrollwin, TRUE, TRUE, 5);
+
+	im->web_frame = webkit_web_view_get_main_frame(WEBKIT_WEB_VIEW(im->web_view));
+	im->js_context = webkit_web_frame_get_global_context(im->web_frame);
+	im->js_global = JSContextGetGlobalObject(im->js_context);
+	webkit_web_view_open(WEBKIT_WEB_VIEW(im->web_view), "file://" DATA_DIR "/webkit/im/im.html");
+}
+
+GtkWidget *
+im_widget_new()
+{
+	return GTK_WIDGET(g_object_new(IM_WIDGET_TYPE, NULL));
+}
+
+GType
+im_widget_get_type(void)
+{
+	static GType im_widget_type = 0;
+
+	if (!im_widget_type) {
+		static const GTypeInfo im_widget_info = {
+			sizeof (IMWidgetClass),
+			NULL, /* base_init */
+			NULL, /* base_finalize */
+			(GClassInitFunc) im_widget_class_init,
+			NULL, /* class_finalize */
+			NULL, /* class_data */
+			sizeof (IMWidget),
+			0,
+			(GInstanceInitFunc) im_widget_init,
+			NULL  /* value_table */
+		};
+
+		im_widget_type = g_type_register_static(
+			GTK_TYPE_VBOX,
+			"IMWidget",
+			&im_widget_info,
+			0);
+	}
+
+	return im_widget_type;
+}
diff --git a/sflphone-client-gnome/src/widget/imwidget.h b/sflphone-client-gnome/src/widget/imwidget.h
new file mode 100644
index 0000000000..39684c9d3c
--- /dev/null
+++ b/sflphone-client-gnome/src/widget/imwidget.h
@@ -0,0 +1,70 @@
+/*
+ *  Copyright (C) 2010 Savoir-Faire Linux 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Additional permission under GNU GPL version 3 section 7:
+ *
+ *  If you modify this program, or any covered work, by linking or
+ *  combining it with the OpenSSL project's OpenSSL library (or a
+ *  modified version of that library), containing parts covered by the
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  grants you additional permission to convey the resulting work.
+ *  Corresponding Source for a non-source form of such a combination
+ *  shall include the source code for the parts of OpenSSL used as well
+ *  as that of the covered work.
+ */
+
+
+#ifndef __IM_WIDGET_H__
+#define __IM_WIDGET_H__
+
+#include <gtk/gtk.h>
+#include <webkit/webkit.h>
+
+G_BEGIN_DECLS
+
+#define IM_WIDGET_TYPE             (im_widget_get_type())
+#define IM_WIDGET(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), IM_WIDGET_TYPE, IMWidget))
+#define IM_WIDGET_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST((vtable), IM_WIDGET_TYPE, IMWidgetClass))
+#define IS_IM_WIDGET(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), IM_WIDGET_TYPE))
+#define IS_IM_WIDGET_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE((vtable), IM_WIDGET_TYPE))
+#define IM_WIDGET_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS((inst), IM_WIDGET_TYPE, IMWidgetClass))
+
+typedef struct _IMWidget      IMWidget;
+typedef struct _IMWidgetClass IMWidgetClass;
+
+struct _IMWidget {
+	GtkVBox parent_instance;
+
+	/* Private */
+	GtkWidget *textarea;
+	GtkWidget *web_view;
+	WebKitWebFrame *web_frame;      // Our web frame
+	JSGlobalContextRef js_context;  // The frame's global JS context
+	JSObjectRef js_global;          // The frame's global context JS object
+};
+
+struct _IMWidgetClass {
+	GtkContainerClass parent_class;
+};
+
+GType im_widget_get_type(void) G_GNUC_CONST;
+GtkWidget *im_widget_new(void);
+void im_widget_add_message(GtkWidget *im, const gchar *message);
+
+G_END_DECLS
+
+#endif  /* __IM_WIDGET_H__ */
diff --git a/sflphone-client-gnome/src/widget/webwidget.c b/sflphone-client-gnome/src/widget/webwidget.c
new file mode 100644
index 0000000000..ae6dbf5fe2
--- /dev/null
+++ b/sflphone-client-gnome/src/widget/webwidget.c
@@ -0,0 +1,87 @@
+/*
+ *  Copyright (C) 2010 Savoir-Faire Linux 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Additional permission under GNU GPL version 3 section 7:
+ *
+ *  If you modify this program, or any covered work, by linking or
+ *  combining it with the OpenSSL project's OpenSSL library (or a
+ *  modified version of that library), containing parts covered by the
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  grants you additional permission to convey the resulting work.
+ *  Corresponding Source for a non-source form of such a combination
+ *  shall include the source code for the parts of OpenSSL used as well
+ *  as that of the covered work.
+ */
+
+#include "imwidget.h"
+#include <JavaScriptCore/JavaScript.h>
+
+
+static void im_widget_init(IMWidget *im);
+static void im_widget_class_init(IMWidgetClass *klass);
+
+GType
+im_widget_get_type (void)
+{
+	static GType im_widget_type = 0;
+
+	if (!im_widget_type) {
+		static const GTypeInfo im_widget_info = {
+			sizeof (IMWidgetClass),
+			NULL, /* base_init */
+			NULL, /* base_finalize */
+			(GClassInitFunc) im_widget_class_init,
+			NULL, /* class_finalize */
+			NULL, /* class_data */
+			sizeof (IMWidget),
+			0,
+			(GInstanceInitFunc) im_widget_init,
+			NULL  /* value_table */
+		};
+
+		im_widget_type = g_type_register_static(
+			WEBKIT_TYPE_WEB_VIEW,
+			"IMWidget",
+			&im_widget_info,
+			0);
+	}
+
+	return im_widget_type;
+}
+
+static void
+im_widget_class_init (IMWidgetClass *klass)
+{
+}
+
+static void
+im_widget_init (IMWidget *im)
+{
+	/* Load our initial webpage on startup */
+	webkit_web_view_open(WEBKIT_WEB_VIEW(im), "file://" DATA_DIR "/webkit/im.html");
+
+	/* Instantiate our local webkit related variables */
+	im->web_frame = webkit_web_view_get_main_frame(WEBKIT_WEB_VIEW(im));
+	im->js_context = webkit_web_frame_get_global_context(im->web_frame);
+	im->js_global = JSContextGetGlobalObject(im->js_context);
+}
+
+GtkWidget *
+im_widget_new()
+{
+	return GTK_WIDGET(g_object_new(IM_WIDGET_TYPE, NULL));
+}
diff --git a/sflphone-client-gnome/src/widget/webwidget.h b/sflphone-client-gnome/src/widget/webwidget.h
new file mode 100644
index 0000000000..d6fbb0987c
--- /dev/null
+++ b/sflphone-client-gnome/src/widget/webwidget.h
@@ -0,0 +1,68 @@
+/*
+ *  Copyright (C) 2010 Savoir-Faire Linux 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Additional permission under GNU GPL version 3 section 7:
+ *
+ *  If you modify this program, or any covered work, by linking or
+ *  combining it with the OpenSSL project's OpenSSL library (or a
+ *  modified version of that library), containing parts covered by the
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  grants you additional permission to convey the resulting work.
+ *  Corresponding Source for a non-source form of such a combination
+ *  shall include the source code for the parts of OpenSSL used as well
+ *  as that of the covered work.
+ */
+
+
+#ifndef __WEB_WIDGET_H__
+#define __WEB_WIDGET_H__
+
+#include <gtk/gtk.h>
+#include <webkit/webkit.h>
+
+G_BEGIN_DECLS
+
+#define WEB_WIDGET_TYPE             (im_widget_get_type())
+#define WEB_WIDGET(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), WEB_WIDGET_TYPE, WebWidget))
+#define IM_WIDGET_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST((vtable), IM_WIDGET_TYPE, WebWidgetClass))
+#define IS_IM_WIDGET(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), IM_WIDGET_TYPE))
+#define IS_IM_WIDGET_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE((vtable), IM_WIDGET_TYPE))
+#define IM_WIDGET_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS((inst), IM_WIDGET_TYPE, WebWidgetClass))
+
+typedef struct _WebWidget      WebWidget;
+typedef struct _WebWidgetClass WebWidgetClass;
+
+struct _WebWidget {
+	WebKitWebView parent_instance;
+
+	/* Private */
+	WebKitWebFrame *web_frame;      // Our web frame
+	JSGlobalContextRef js_context;  // The frame's global JS context
+	JSObjectRef js_global;          // The frame's global context JS object
+};
+
+struct _WebWidgetClass {
+	WebKitWebViewClass parent_class;
+};
+
+
+GType         im_widget_get_type         (void) G_GNUC_CONST;
+GtkWidget    *im_widget_new              (void);
+
+G_END_DECLS
+
+#endif  /* __IM_WIDGET_H__ */
diff --git a/sflphone-client-gnome/webkit/Makefile.am b/sflphone-client-gnome/webkit/Makefile.am
new file mode 100644
index 0000000000..557eafdc2e
--- /dev/null
+++ b/sflphone-client-gnome/webkit/Makefile.am
@@ -0,0 +1,8 @@
+include ../globals.mak
+
+EXTRA_DIST = $(im_DATA)
+
+webkitdir = $(datadir)/sflphone/webkit
+
+imdir = $(webkitdir)/im
+im_DATA = im/im.js im/im.html im/im.css
diff --git a/sflphone-client-gnome/webkit/im/im.css b/sflphone-client-gnome/webkit/im/im.css
new file mode 100644
index 0000000000..f738ae5800
--- /dev/null
+++ b/sflphone-client-gnome/webkit/im/im.css
@@ -0,0 +1,6 @@
+.message {
+	-webkit-border-radius: 5px;
+	background: green;
+	color: white;
+	padding: 1em;
+}
diff --git a/sflphone-client-gnome/webkit/im/im.html b/sflphone-client-gnome/webkit/im/im.html
new file mode 100644
index 0000000000..369ce676da
--- /dev/null
+++ b/sflphone-client-gnome/webkit/im/im.html
@@ -0,0 +1,11 @@
+<html>
+	<head>
+		<script src="im.js"></script>
+		<link rel="stylesheet" type="text/css" href="im.css" />
+	</head>
+	<body>
+		<div id="messages"></div>
+		<div class="message">Hello something</div>
+		<a href="http://www.savoirfairelinux.com/">www.savoirfairelinux.com</a>
+	</body>
+</html>
diff --git a/sflphone-client-gnome/webkit/im/im.js b/sflphone-client-gnome/webkit/im/im.js
new file mode 100644
index 0000000000..30e5d6790a
--- /dev/null
+++ b/sflphone-client-gnome/webkit/im/im.js
@@ -0,0 +1,4 @@
+function add_message(message)
+{
+	alert("Message: " + message);
+}
-- 
GitLab