qulogic/talkatu

A bunch of moving stuff around

2018-08-19, Gary Kramlich
288ffdf9aafd
Parents d8a9eab2d273
Children e4e8d26ff8d0
A bunch of moving stuff around
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/talkatu/data/messageactions.ui Sun Aug 19 03:05:28 2018 -0500
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
+<interface>
+ <requires lib="gtk+" version="3.20"/>
+ <template class="TalkatuMessageActions" parent="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkEventBox" id="reactions">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">face-smile</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEventBox" id="actions">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">open-menu-symbolic</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </template>
+</interface>
--- a/talkatu/data/messageview.ui Sun Aug 19 01:49:25 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.1 -->
-<interface>
- <requires lib="gtk+" version="3.20"/>
- <template class="TalkatuMessageView" parent="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">4</property>
- <property name="spacing">4</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="valign">start</property>
- <property name="icon_name">dialog-information</property>
- <property name="icon_size">6</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">4</property>
- <child>
- <object class="GtkLabel" id="display_name">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">&lt;span font-weight="bold"&gt;grim&lt;/span&gt;</property>
- <property name="use_markup">True</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="timestamp">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">10:10</property>
- <property name="selectable">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="contents">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">This is my cool message that needs to be quite a bit longer</property>
- <property name="selectable">True</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </template>
-</interface>
--- a/talkatu/data/talkatu.gresource.xml Sun Aug 19 01:49:25 2018 -0500
+++ b/talkatu/data/talkatu.gresource.xml Sun Aug 19 03:05:28 2018 -0500
@@ -2,7 +2,7 @@
<gresources>
<gresource prefix="/org/bitbucket/rw_grim/talkatu/ui">
<file compressed="true">linkdialog.ui</file>
- <file compressed="true">messageview.ui</file>
+ <file compressed="true">messageactions.ui</file>
<file compressed="true">tagtable.ui</file>
<file compressed="true">toolbar.ui</file>
</gresource>
--- a/talkatu/meson.build Sun Aug 19 01:49:25 2018 -0500
+++ b/talkatu/meson.build Sun Aug 19 03:05:28 2018 -0500
@@ -15,7 +15,7 @@
'talkatumarkdownbuffer.h',
'talkatumenutoolbutton.h',
'talkatumessage.h',
- 'talkatumessageview.h',
+ 'talkatumessageactions.h',
'talkatutag.h',
'talkatutoolbar.h',
'talkatutooldrawer.h',
@@ -34,7 +34,7 @@
'talkatumarkdownbuffer.c',
'talkatumenutoolbutton.c',
'talkatumessage.c',
- 'talkatumessageview.c',
+ 'talkatumessageactions.c',
'talkatutag.c',
'talkatutoolbar.c',
'talkatutooldrawer.c',
--- a/talkatu/talkatuhistory.c Sun Aug 19 01:49:25 2018 -0500
+++ b/talkatu/talkatuhistory.c Sun Aug 19 03:05:28 2018 -0500
@@ -19,7 +19,7 @@
#include <talkatu/talkatuhistory.h>
#include <talkatu/talkatumessage.h>
-#include <talkatu/talkatumessageview.h>
+#include <talkatu/talkatumessageactions.h>
/**
* SECTION:talkatuhistory
@@ -47,11 +47,11 @@
data = g_object_get_data(G_OBJECT(anchor), "talkatu-message");
if(data != NULL) {
GtkTextView *text_view = GTK_TEXT_VIEW(user_data);
- GtkWidget *message_view = talkatu_message_view_new(TALKATU_MESSAGE(data));
+ GtkWidget *message_actions = talkatu_message_actions_new(TALKATU_MESSAGE(data));
- gtk_text_view_add_child_at_anchor(text_view, message_view, anchor);
+ gtk_text_view_add_child_at_anchor(text_view, message_actions, anchor);
- gtk_widget_show_all(message_view);
+ gtk_widget_show_all(message_actions);
}
}
--- a/talkatu/talkatuhistorybuffer.c Sun Aug 19 01:49:25 2018 -0500
+++ b/talkatu/talkatuhistorybuffer.c Sun Aug 19 03:05:28 2018 -0500
@@ -52,6 +52,16 @@
contents = talkatu_message_get_contents(message);
g_message("writing message '%s'", contents);
+ gtk_text_buffer_insert(
+ GTK_TEXT_BUFFER(buffer),
+ &end,
+ contents,
+ -1
+ );
+
+ g_free(contents);
+
+ /* add the anchor that contains the message */
anchor = gtk_text_child_anchor_new();
g_object_set_data_full(
G_OBJECT(anchor),
@@ -64,15 +74,6 @@
&end,
anchor
);
-
- // gtk_text_buffer_insert(
- // GTK_TEXT_BUFFER(buffer),
- // &end,
- // contents,
- // -1
- // );
-
- g_free(contents);
}
/******************************************************************************
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/talkatu/talkatumessageactions.c Sun Aug 19 03:05:28 2018 -0500
@@ -0,0 +1,68 @@
+/*
+ * talkatu
+ * Copyright (C) 2017-2018 Gary Kramlich <grim@reaperworld.com>
+ *
+ * This library 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) any later version.
+ *
+ * This library 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 library; if not, see <http://www.gnu.org/licenses/>.
+ */
+#include <gtk/gtk.h>
+
+#include "talkatu/talkatumessageactions.h"
+
+/**
+ * SECTION:talkatumessageview
+ * @Title: Message View
+ * @Short_description: A display widget for #TalkatuMessage's
+ *
+ * Talkatu provides a simple formatting message_actions that gives the user the ability
+ * to format any #TalkatuBuffer via the formatting actions.
+ */
+
+G_DEFINE_TYPE(TalkatuMessageActions, talkatu_message_actions, GTK_TYPE_BOX)
+
+/******************************************************************************
+ * GObject Stuff
+ *****************************************************************************/
+static void
+talkatu_message_actions_init(TalkatuMessageActions *message_actions) {
+ gtk_widget_init_template(GTK_WIDGET(message_actions));
+}
+
+static void
+talkatu_message_actions_class_init(TalkatuMessageActionsClass *klass) {
+ gtk_widget_class_set_template_from_resource(
+ GTK_WIDGET_CLASS(klass),
+ "/org/bitbucket/rw_grim/talkatu/ui/messageactions.ui"
+ );
+}
+
+/******************************************************************************
+ * Public API
+ *****************************************************************************/
+
+/**
+ * talkatu_message_actions_new:
+ *
+ * Creates a new #TalkatuMessageActions that provides the user with an interface to
+ * control the formatting of a #TalkatuBuffer.
+ *
+ * Returns: (transfer full): The new #TalkatuMessageActions instance.
+ */
+GtkWidget *
+talkatu_message_actions_new(TalkatuMessage *message) {
+ return GTK_WIDGET(g_object_new(
+ TALKATU_TYPE_MESSAGE_ACTIONS,
+ "message", message,
+ NULL
+ ));
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/talkatu/talkatumessageactions.h Sun Aug 19 03:05:28 2018 -0500
@@ -0,0 +1,73 @@
+/*
+ * talkatu
+ * Copyright (C) 2017-2018 Gary Kramlich <grim@reaperworld.com>
+ *
+ * This library 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) any later version.
+ *
+ * This library 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 library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GI_SCANNER__ /* hide this bit from g-ir-scanner */
+#if !defined(TALKATU_GLOBAL_HEADER_INSIDE) && !defined(TALKATU_COMPILATION)
+#error "only <talkatu.h> may be included directly"
+#endif
+#endif /* __GI_SCANNER__ */
+
+#ifndef TALKATU_MESSAGE_ACTIONS_H
+#define TALKATU_MESSAGE_ACTIONS_H
+
+#include <gtk/gtk.h>
+
+#define TALKATU_TYPE_MESSAGE_ACTIONS (talkatu_message_actions_get_type())
+#define TALKATU_MESSAGE_ACTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TALKATU_TYPE_MESSAGE_ACTIONS, TalkatuMessageActions))
+#define TALKATU_MESSAGE_ACTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TALKATU_TYPE_MESSAGE_ACTIONS, TalkatuMessageActionsClass))
+#define TALKATU_IS_MESSAGE_ACTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TALKATU_TYPE_MESSAGE_ACTIONS))
+#define TALKATU_IS_MESSAGE_ACTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TALKATU_TYPE_MESSAGE_ACTIONS))
+#define TALKATU_MESSAGE_ACTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TALKATU_TYPE_MESSAGE_ACTIONS, TalkatuMessageActionsClass))
+
+typedef struct _TalkatuMessageActions TalkatuMessageActions;
+typedef struct _TalkatuMessageActionsClass TalkatuMessageActionsClass;
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <gtk/gtk.h>
+
+#include <talkatu/talkatumessage.h>
+
+struct _TalkatuMessageActions {
+ GtkBox parent;
+
+ void (*_talkatu_reserved1)(void);
+ void (*_talkatu_reserved2)(void);
+ void (*_talkatu_reserved3)(void);
+ void (*_talkatu_reserved4)(void);
+};
+
+struct _TalkatuMessageActionsClass {
+ GtkBoxClass parent;
+
+ void (*_talkatu_reserved1)(void);
+ void (*_talkatu_reserved2)(void);
+ void (*_talkatu_reserved3)(void);
+ void (*_talkatu_reserved4)(void);
+};
+
+G_BEGIN_DECLS
+
+GType talkatu_message_actions_get_type(void);
+
+GtkWidget *talkatu_message_actions_new(TalkatuMessage *message);
+
+G_END_DECLS
+
+#endif /* TALKATU_MESSAGE_ACTIONS_H */
--- a/talkatu/talkatumessageview.c Sun Aug 19 01:49:25 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * talkatu
- * Copyright (C) 2017-2018 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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) any later version.
- *
- * This library 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 library; if not, see <http://www.gnu.org/licenses/>.
- */
-#include <gtk/gtk.h>
-
-#include "talkatu/talkatumessageview.h"
-
-/**
- * SECTION:talkatumessageview
- * @Title: Message View
- * @Short_description: A display widget for #TalkatuMessage's
- *
- * Talkatu provides a simple formatting message_view that gives the user the ability
- * to format any #TalkatuBuffer via the formatting actions.
- */
-
-G_DEFINE_TYPE(TalkatuMessageView, talkatu_message_view, GTK_TYPE_BOX)
-
-/******************************************************************************
- * GObject Stuff
- *****************************************************************************/
-static void
-talkatu_message_view_init(TalkatuMessageView *message_view) {
- gtk_widget_init_template(GTK_WIDGET(message_view));
-}
-
-static void
-talkatu_message_view_class_init(TalkatuMessageViewClass *klass) {
- gtk_widget_class_set_template_from_resource(
- GTK_WIDGET_CLASS(klass),
- "/org/bitbucket/rw_grim/talkatu/ui/messageview.ui"
- );
-}
-
-/******************************************************************************
- * Public API
- *****************************************************************************/
-
-/**
- * talkatu_message_view_new:
- *
- * Creates a new #TalkatuMessageView that provides the user with an interface to
- * control the formatting of a #TalkatuBuffer.
- *
- * Returns: (transfer full): The new #TalkatuMessageView instance.
- */
-GtkWidget *
-talkatu_message_view_new(TalkatuMessage *message) {
- return GTK_WIDGET(g_object_new(
- TALKATU_TYPE_MESSAGE_VIEW,
- "message", message,
- NULL
- ));
-}
--- a/talkatu/talkatumessageview.h Sun Aug 19 01:49:25 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * talkatu
- * Copyright (C) 2017-2018 Gary Kramlich <grim@reaperworld.com>
- *
- * This library 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) any later version.
- *
- * This library 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 library; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __GI_SCANNER__ /* hide this bit from g-ir-scanner */
-#if !defined(TALKATU_GLOBAL_HEADER_INSIDE) && !defined(TALKATU_COMPILATION)
-#error "only <talkatu.h> may be included directly"
-#endif
-#endif /* __GI_SCANNER__ */
-
-#ifndef TALKATU_MESSAGE_VIEW_H
-#define TALKATU_MESSAGE_VIEW_H
-
-#include <gtk/gtk.h>
-
-#define TALKATU_TYPE_MESSAGE_VIEW (talkatu_message_view_get_type())
-#define TALKATU_MESSAGE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TALKATU_TYPE_MESSAGE_VIEW, TalkatuMessageView))
-#define TALKATU_MESSAGE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), TALKATU_TYPE_MESSAGE_VIEW, TalkatuMessageViewClass))
-#define TALKATU_IS_MESSAGE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TALKATU_TYPE_MESSAGE_VIEW))
-#define TALKATU_IS_MESSAGE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TALKATU_TYPE_MESSAGE_VIEW))
-#define TALKATU_MESSAGE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TALKATU_TYPE_MESSAGE_VIEW, TalkatuMessageViewClass))
-
-typedef struct _TalkatuMessageView TalkatuMessageView;
-typedef struct _TalkatuMessageViewClass TalkatuMessageViewClass;
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <gtk/gtk.h>
-
-#include <talkatu/talkatumessage.h>
-
-struct _TalkatuMessageView {
- GtkBox parent;
-
- void (*_talkatu_reserved1)(void);
- void (*_talkatu_reserved2)(void);
- void (*_talkatu_reserved3)(void);
- void (*_talkatu_reserved4)(void);
-};
-
-struct _TalkatuMessageViewClass {
- GtkBoxClass parent;
-
- void (*_talkatu_reserved1)(void);
- void (*_talkatu_reserved2)(void);
- void (*_talkatu_reserved3)(void);
- void (*_talkatu_reserved4)(void);
-};
-
-G_BEGIN_DECLS
-
-GType talkatu_message_view_get_type(void);
-
-GtkWidget *talkatu_message_view_new(TalkatuMessage *message);
-
-G_END_DECLS
-
-#endif /* TALKATU_MESSAGE_VIEW_H */