[gnome-chat] Add ChatConversationView



commit 583f8a7e9b201f2e11a0d163e9ddad82f94b74de
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Sep 10 18:23:58 2013 +0200

    Add ChatConversationView

 src/Makefile.am               |    3 ++
 src/chat-conversation-view.c  |   61 ++++++++++++++++++++++++++++++++++
 src/chat-conversation-view.h  |   72 +++++++++++++++++++++++++++++++++++++++++
 src/chat-conversation-view.ui |   13 +++++++
 src/chat.gresource.xml        |    1 +
 5 files changed, 150 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index a255d4a..46feb28 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,6 +24,8 @@ gnome_chat_SOURCES = \
        chat-client-factory.h \
        chat-contacts-list-dialog.c \
        chat-contacts-list-dialog.h \
+       chat-conversation-view.c \
+       chat-conversation-view.h \
        chat-conversations-list.c \
        chat-conversations-list.h \
        chat-embed.c \
@@ -50,6 +52,7 @@ EXTRA_DIST = \
        chat.gresource.xml \
        chat-app-menu.ui \
        chat-contacts-list-dialog.ui \
+       chat-conversation-view.ui \
        chat-embed.ui \
        chat-main-toolbar.ui \
        chat-main-window.ui \
diff --git a/src/chat-conversation-view.c b/src/chat-conversation-view.c
new file mode 100644
index 0000000..7c9166d
--- /dev/null
+++ b/src/chat-conversation-view.c
@@ -0,0 +1,61 @@
+/*
+ * Chat - instant messaging client for GNOME
+ * Copyright © 2013 Red Hat, Inc.
+ *
+ * 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.1
+ * 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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.
+ */
+
+
+#include "config.h"
+
+#include "chat-conversation-view.h"
+
+
+static void chat_conversation_view_buildable_init (GtkBuildableIface *iface);
+
+
+G_DEFINE_TYPE_WITH_CODE (ChatConversationView, chat_conversation_view, GTK_TYPE_TEXT_VIEW,
+                         G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+                                                chat_conversation_view_buildable_init));
+
+
+static void
+chat_conversation_view_init (ChatConversationView *self)
+{
+  gtk_widget_init_template (GTK_WIDGET (self));
+}
+
+
+static void
+chat_conversation_view_class_init (ChatConversationViewClass *class)
+{
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
+
+  gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/chat/conversation-view.ui");
+}
+
+
+static void
+chat_conversation_view_buildable_init (GtkBuildableIface *iface)
+{
+}
+
+
+GtkWidget *
+chat_conversation_view_new (void)
+{
+  return g_object_new (CHAT_TYPE_CONVERSATION_VIEW, NULL);
+}
diff --git a/src/chat-conversation-view.h b/src/chat-conversation-view.h
new file mode 100644
index 0000000..c081a23
--- /dev/null
+++ b/src/chat-conversation-view.h
@@ -0,0 +1,72 @@
+/*
+ * Chat - instant messaging client for GNOME
+ * Copyright © 2013 Red Hat, Inc.
+ *
+ * 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.1
+ * 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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.
+ */
+
+
+#ifndef CHAT_CONVERSATION_VIEW_H
+#define CHAT_CONVERSATION_VIEW_H
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define CHAT_TYPE_CONVERSATION_VIEW (chat_conversation_view_get_type ())
+
+#define CHAT_CONVERSATION_VIEW(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+   CHAT_TYPE_CONVERSATION_VIEW, ChatConversationView))
+
+#define CHAT_CONVERSATION_VIEW_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), \
+   CHAT_TYPE_CONVERSATION_VIEW, ChatConversationViewClass))
+
+#define CHAT_IS_CONVERSATION_VIEW(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+   CHAT_TYPE_CONVERSATION_VIEW))
+
+#define CHAT_IS_CONVERSATION_VIEW_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+   CHAT_TYPE_CONVERSATION_VIEW))
+
+#define CHAT_CONVERSATION_VIEW_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+   CHAT_TYPE_CONVERSATION_VIEW, ChatConversationViewClass))
+
+typedef struct _ChatConversationView        ChatConversationView;
+typedef struct _ChatConversationViewClass   ChatConversationViewClass;
+typedef struct _ChatConversationViewPrivate ChatConversationViewPrivate;
+
+struct _ChatConversationView
+{
+  GtkTextView parent_instance;
+  ChatConversationViewPrivate *priv;
+};
+
+struct _ChatConversationViewClass
+{
+  GtkTextViewClass parent_class;
+};
+
+GType                  chat_conversation_view_get_type               (void) G_GNUC_CONST;
+
+GtkWidget             *chat_conversation_view_new                    (void);
+
+G_END_DECLS
+
+#endif /* CHAT_CONVERSATION_VIEW_H */
diff --git a/src/chat-conversation-view.ui b/src/chat-conversation-view.ui
new file mode 100644
index 0000000..157736a
--- /dev/null
+++ b/src/chat-conversation-view.ui
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface domain="gnome-chat">
+  <!-- interface-requires gtk+ 3.10 -->
+  <template class="ChatConversationView" parent="GtkTextView">
+    <property name="can_focus">True</property>
+    <property name="cursor_visible">False</property>
+    <property name="editable">False</property>
+    <property name="hexpand">True</property>
+    <property name="vexpand">True</property>
+    <property name="visible">True</property>
+    <property name="wrap_mode">word-char</property>
+  </template>
+</interface>
diff --git a/src/chat.gresource.xml b/src/chat.gresource.xml
index 5e2892a..4b11494 100644
--- a/src/chat.gresource.xml
+++ b/src/chat.gresource.xml
@@ -4,6 +4,7 @@
     <file alias="app-menu.ui" preprocess="xml-stripblanks" compressed="true">chat-app-menu.ui</file>
     <file alias="embed.ui" preprocess="xml-stripblanks" compressed="true">chat-embed.ui</file>
     <file alias="contacts-list-dialog.ui" preprocess="xml-stripblanks" 
compressed="true">chat-contacts-list-dialog.ui</file>
+    <file alias="conversation-view.ui" preprocess="xml-stripblanks" 
compressed="true">chat-conversation-view.ui</file>
     <file alias="main-toolbar.ui" preprocess="xml-stripblanks" compressed="true">chat-main-toolbar.ui</file>
     <file alias="main-window.ui" preprocess="xml-stripblanks" compressed="true">chat-main-window.ui</file>
     <file>chat.css</file>


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