New chat view using gtkwebkit
This changes the text buffer widget to a WebKitWebView so that we can
use web technologies to control the display.
This change comes with a new dependency: libwebkit2gtk-4.0. Should
this dependency not be available on the system, we can also build the
client using libwebkit2gtk-3.0. However, the links won't be clickable.
New features:
- Implemented delivery reports.
- Avatars are now displayed in the chat window.
- Links in the chat window are now clickable.
When the client is launched with the -d option, you may right click on
the chat view to open up the dev tools.
In order to improve performance, one WebKitWebView is re-used for all
of the ChatViews, since we only display one at a time.
Tuleap: #1073
Change-Id: Ic945fa6c92f92e391f0362310ddc2f0fa16641bf
[stepan.salenikovich@savoirfairelinux.com: added change_view(); start
loading webkit on window init; destroy webkit on dispose; prevent
warning when dispose is called more than once on ChatView]
Signed-off-by: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
diff --git a/src/webkitchatcontainer.h b/src/webkitchatcontainer.h
new file mode 100644
index 0000000..ad1e317
--- /dev/null
+++ b/src/webkitchatcontainer.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2016 Savoir-faire Linux Inc.
+ * Author: Alexandre Viau <alexandre.viau@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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#pragma once
+
+#include <gtk/gtk.h>
+
+class QModelIndex;
+class QString;
+class QVariant;
+
+G_BEGIN_DECLS
+
+#define WEBKIT_CHAT_CONTAINER_TYPE (webkit_chat_container_get_type ())
+#define WEBKIT_CHAT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBKIT_CHAT_CONTAINER_TYPE, WebKitChatContainer))
+#define WEBKIT_CHAT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_CHAT_CONTAINER_TYPE, WebKitChatContainerClass))
+#define IS_WEBKIT_CHAT_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_CHAT_CONTAINER_TYPE))
+#define IS_WEBKIT_CHAT_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_CHAT_CONTAINER_TYPE))
+
+typedef struct _WebKitChatContainer WebKitChatContainer;
+typedef struct _WebKitChatContainerClass WebKitChatContainerClass;
+
+GType webkit_chat_container_get_type (void) G_GNUC_CONST;
+GtkWidget* webkit_chat_container_new (void);
+void webkit_chat_container_clear (WebKitChatContainer *view);
+void webkit_chat_container_print_new_message (WebKitChatContainer *view, const QModelIndex &idx);
+void webkit_chat_container_update_message (WebKitChatContainer *view, const QModelIndex &idx);
+void webkit_chat_container_set_sender_image (WebKitChatContainer *view, QString sender_name, QVariant sender_image);
+gboolean webkit_chat_container_is_ready (WebKitChatContainer *view);
+
+G_END_DECLS