Move the demo to blueprint-compiler
Testing Done:
* Ran the demo checked just about everything.
* Used `gresource extract` to verify that the XML looked close enough to the old version.
Reviewed at https://reviews.imfreedom.org/r/1765/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/data/demo.blp Sun Sep 25 01:24:42 2022 -0500
@@ -0,0 +1,255 @@
+Talkatu.Buffer buffer_plain { + changed => talkatu_demo_window_buffer_modified_cb(); +Talkatu.WholeBuffer buffer_whole { + changed => talkatu_demo_window_buffer_modified_cb(); +Talkatu.HtmlBuffer buffer_html { + changed => talkatu_demo_window_buffer_modified_cb(); +Talkatu.MarkdownBuffer buffer_markdown { + changed => talkatu_demo_window_buffer_modified_cb(); + action: "win.author-name"; + action: "win.author-name"; + action: "win.author-name"; + action: "win.author-name"; + action: "win.author-name"; + action: "win.author-name"; +menu author_name_color_menu { + action: "win.author-name-color"; + action: "win.author-name-color"; + action: "win.author-name-color"; + action: "win.author-name-color"; + action: "win.author-name-color"; + action: "win.author-name-color"; + action: "win.author-name-color"; +template TalkatuDemoWindow : Gtk.ApplicationWindow { + shrink-end-child: false; + shrink-start-child: false; + vadjustment: Talkatu.AutoScroller auto_scroller{}; + Talkatu.History history { + Gtk.ToggleButton toggle_plain { + tooltip-text: _("Use a TalkatuBuffer"); + icon-name: "text-x-generic"; + toggled => talkatu_demo_window_buffer_changed_cb(); + Gtk.ToggleButton toggle_whole { + tooltip-text: _("Use a TalkatuWholeBuffer"); + toggled => talkatu_demo_window_buffer_changed_cb(); + Gtk.ToggleButton toggle_html { + tooltip-text: _("Use a TalkatuHTMLBuffer"); + icon-name: "text-html"; + toggled => talkatu_demo_window_buffer_changed_cb(); + Gtk.ToggleButton toggle_markdown { + tooltip-text: _("Use a TalkatuMarkdownBuffer"); + icon-name: "text-x-generic-template"; + toggled => talkatu_demo_window_buffer_changed_cb(); + tooltip-text: _("Insert HTML from a file"); + label: _("Insert HTML"); + icon-name: "text-html"; + clicked => talkatu_demo_window_insert_html_cb(); + tooltip-text: _("Insert Markdown from a file"); + label: _("Insert Markdown"); + icon-name: "text-x-generic"; + clicked => talkatu_demo_window_insert_markdown_cb(); + Gtk.MenuButton author_button { + icon-name: "system-users"; + menu-model: author_menu; + Gtk.MenuButton author_name_color_button { + icon-name: "color-select-symbolic"; + menu-model: author_name_color_menu; + Gtk.ToggleButton toggle_toolbar { + tooltip-text: _("Toggle toolbar visibility"); + active: bind editor.show-toolbar sync-create bidirectional; + Gtk.ToggleButton toggle_send_button { + tooltip-text: _("Toggle send button visibility"); + label: _("Send Button"); + active: bind editor.show-send-button sync-create bidirectional; + Gtk.ToggleButton toggle_edited { + tooltip-text: _("Toggle whether the message is edited"); + active: bind input.edited sync-create bidirectional; + Talkatu.Editor editor { + show-send-button: false; + author-name-color: "black"; + open-url => talkatu_demo_window_view_open_url_cb(); + send-message => talkatu_demo_window_view_send_message_cb(); + Talkatu.TypingLabel typing {} \ No newline at end of file
--- a/demo/data/demo.ui Sat Sep 17 23:37:00 2022 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,322 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2
-Talkatu - GTK widgets for chat applications
-Copyright (C) 2017-2020 Gary Kramlich <grim@reaperworld.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 2 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 library; if not, see <https://www.gnu.org/licenses/>.
--->
- <requires lib="Talkatu" version="0.0"/>
- <requires lib="gtk" version="4.0"/>
- <!-- interface-license-type gplv2 -->
- <!-- interface-name Talkatu -->
- <!-- interface-description GTK widgets for chat applications -->
- <!-- interface-copyright Gary Kramlich <grim@reaperworld.com> -->
- <object class="TalkatuAutoScroller" id="auto_scroller"/>
- <template class="TalkatuDemoWindow" parent="GtkApplicationWindow">
- <property name="child">
- <object class="GtkPaned">
- <property name="shrink-end-child">0</property>
- <property name="shrink-start-child">0</property>
- <property name="orientation">vertical</property>
- <property name="wide-handle">1</property>
- <object class="GtkScrolledWindow">
- <property name="vadjustment">auto_scroller</property>
- <object class="TalkatuHistory" id="history">
- <property name="name">history</property>
- <object class="GtkBox">
- <property name="orientation">vertical</property>
- <object class="GtkBox">
- <class name="toolbar"/>
- <property name="can-focus">0</property>
- <object class="GtkToggleButton" id="toggle_plain">
- <property name="can-focus">0</property>
- <property name="tooltip-text" translatable="yes">Use a TalkatuBuffer</property>
- <property name="label" translatable="yes">Plain</property>
- <property name="use-underline">1</property>
- <property name="icon-name">text-x-generic</property>
- <property name="active">1</property>
- <signal name="toggled" handler="talkatu_demo_window_buffer_changed_cb" object="TalkatuDemoWindow" swapped="no"/>
- <object class="GtkToggleButton" id="toggle_whole">
- <property name="can-focus">0</property>
- <property name="tooltip-text" translatable="yes">Use a TalkatuWholeBuffer</property>
- <property name="label" translatable="yes">Whole</property>
- <property name="use-underline">1</property>
- <property name="icon-name">ascii</property>
- <property name="group">toggle_plain</property>
- <signal name="toggled" handler="talkatu_demo_window_buffer_changed_cb" object="TalkatuDemoWindow" swapped="no"/>
- <object class="GtkToggleButton" id="toggle_html">
- <property name="can-focus">0</property>
- <property name="tooltip-text" translatable="yes">Use a TalkatuHTMLBuffer</property>
- <property name="label" translatable="yes">HTML</property>
- <property name="use-underline">1</property>
- <property name="icon-name">text-html</property>
- <property name="group">toggle_plain</property>
- <signal name="toggled" handler="talkatu_demo_window_buffer_changed_cb" object="TalkatuDemoWindow" swapped="no"/>
- <object class="GtkToggleButton" id="toggle_markdown">
- <property name="can-focus">0</property>
- <property name="tooltip-text" translatable="yes">Use a TalkatuMarkdownBuffer</property>
- <property name="label" translatable="yes">Markdown</property>
- <property name="use-underline">1</property>
- <property name="icon-name">text-x-generic-template</property>
- <property name="group">toggle_plain</property>
- <signal name="toggled" handler="talkatu_demo_window_buffer_changed_cb" object="TalkatuDemoWindow" swapped="no"/>
- <object class="GtkSeparator">
- <property name="orientation">vertical</property>
- <property name="can-focus">0</property>
- <object class="GtkButton">
- <property name="can-focus">0</property>
- <property name="tooltip-text" translatable="yes">Insert HTML from a file</property>
- <property name="label" translatable="yes">Insert HTML</property>
- <property name="use-underline">1</property>
- <property name="icon-name">text-html</property>
- <signal name="clicked" handler="talkatu_demo_window_insert_html_cb" object="TalkatuDemoWindow" swapped="no"/>
- <object class="GtkButton">
- <property name="can-focus">0</property>
- <property name="tooltip-text" translatable="yes">Insert Markdown from a file</property>
- <property name="label" translatable="yes">Insert Markdown</property>
- <property name="use-underline">1</property>
- <property name="icon-name">text-x-generic</property>
- <signal name="clicked" handler="talkatu_demo_window_insert_markdown_cb" object="TalkatuDemoWindow" swapped="no"/>
- <object class="GtkSeparator">
- <property name="orientation">vertical</property>
- <property name="can-focus">0</property>
- <object class="GtkMenuButton" id="author_button">
- <property name="can-focus">0</property>
- <property name="icon-name">system-users</property>
- <property name="label" translatable="yes">Author</property>
- <property name="menu-model">author_menu</property>
- <property name="use-underline">1</property>
- <object class="GtkMenuButton" id="author_name_color_button">
- <property name="can-focus">0</property>
- <property name="icon-name">color-select-symbolic</property>
- <property name="label" translatable="yes">Color</property>
- <property name="menu-model">author_name_color_menu</property>
- <property name="use-underline">1</property>
- <object class="GtkSeparator">
- <property name="orientation">vertical</property>
- <property name="can-focus">0</property>
- <object class="GtkToggleButton" id="toggle_toolbar">
- <property name="can-focus">0</property>
- <property name="tooltip-text" translatable="yes">Toggle toolbar visibility</property>
- <property name="label" translatable="yes">Toolbar</property>
- <property name="use-underline">1</property>
- <object class="GtkToggleButton" id="toggle_send_button">
- <property name="can-focus">0</property>
- <property name="tooltip-text" translatable="yes">Toggle send button visibility</property>
- <property name="label" translatable="yes">Send Button</property>
- <property name="use-underline">1</property>
- <object class="GtkToggleButton" id="toggle_edited">
- <property name="can-focus">0</property>
- <property name="tooltip-text" translatable="yes">Toggle whether the message is edited</property>
- <property name="label" translatable="yes">Edited</property>
- <property name="use-underline">1</property>
- <object class="TalkatuEditor" id="editor">
- <property name="vexpand">1</property>
- <property name="orientation">vertical</property>
- <property name="visible">True</property>
- <property name="vexpand-set">True</property>
- <child internal-child="toolbar">
- <object class="TalkatuToolbar">
- <property name="hexpand-set">True</property>
- <property name="vexpand-set">True</property>
- <child internal-child="input">
- <object class="TalkatuInput">
- <property name="buffer">buffer_plain</property>
- <property name="author">Alice</property>
- <property name="send-binding">1</property>
- <signal name="open-url" handler="talkatu_demo_window_view_open_url_cb" object="TalkatuDemoWindow" swapped="no"/>
- <signal name="send-message" handler="talkatu_demo_window_view_send_message_cb" object="TalkatuDemoWindow" swapped="no"/>
- <child internal-child="send_button">
- <object class="GtkButton">
- <property name="visible">0</property>
- <property name="can-focus">0</property>
- <object class="TalkatuTypingLabel" id="typing">
- <property name="visible">True</property>
- <menu id="author_menu">
- <attribute name="label" translatable="yes">Alice</attribute>
- <attribute name="action">win.author-name</attribute>
- <attribute name="target" translatable="yes">Alice</attribute>
- <attribute name="label" translatable="yes">Bob</attribute>
- <attribute name="action">win.author-name</attribute>
- <attribute name="target" translatable="yes">Bob</attribute>
- <attribute name="label" translatable="yes">Carol</attribute>
- <attribute name="action">win.author-name</attribute>
- <attribute name="target" translatable="yes">Carol</attribute>
- <attribute name="label" translatable="yes">David</attribute>
- <attribute name="action">win.author-name</attribute>
- <attribute name="target" translatable="yes">David</attribute>
- <attribute name="label" translatable="yes">Eve</attribute>
- <attribute name="action">win.author-name</attribute>
- <attribute name="target" translatable="yes">Eve</attribute>
- <attribute name="label" translatable="yes">Mallory</attribute>
- <attribute name="action">win.author-name</attribute>
- <attribute name="target" translatable="yes">Mallory</attribute>
- <menu id="author_name_color_menu">
- <attribute name="label" translatable="yes">Not set</attribute>
- <attribute name="action">win.author-name-color</attribute>
- <attribute name="target"></attribute>
- <attribute name="label" translatable="yes">Red</attribute>
- <attribute name="action">win.author-name-color</attribute>
- <attribute name="target">red</attribute>
- <attribute name="label" translatable="yes">Green</attribute>
- <attribute name="action">win.author-name-color</attribute>
- <attribute name="target">green</attribute>
- <attribute name="label" translatable="yes">Blue</attribute>
- <attribute name="action">win.author-name-color</attribute>
- <attribute name="target">blue</attribute>
- <attribute name="label" translatable="yes">Yellow</attribute>
- <attribute name="action">win.author-name-color</attribute>
- <attribute name="target">yellow</attribute>
- <attribute name="label" translatable="yes">Purple</attribute>
- <attribute name="action">win.author-name-color</attribute>
- <attribute name="target">purple</attribute>
- <object class="TalkatuHtmlBuffer" id="buffer_html">
- <signal name="changed" handler="talkatu_demo_window_buffer_modified_cb" object="TalkatuDemoWindow" swapped="no"/>
- <object class="TalkatuMarkdownBuffer" id="buffer_markdown">
- <signal name="changed" handler="talkatu_demo_window_buffer_modified_cb" object="TalkatuDemoWindow" swapped="no"/>
- <object class="TalkatuBuffer" id="buffer_plain">
- <signal name="changed" handler="talkatu_demo_window_buffer_modified_cb" object="TalkatuDemoWindow" swapped="no"/>
- <object class="TalkatuWholeBuffer" id="buffer_whole">
- <property name="style">whole</property>
- <signal name="changed" handler="talkatu_demo_window_buffer_modified_cb" object="TalkatuDemoWindow" swapped="no"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/data/meson.build Sun Sep 25 01:24:42 2022 -0500
@@ -0,0 +1,26 @@
+# We need to define our outputs from the custom_target, so we just create a new +# list based off of the input with the extension changed. +foreach bpfile : bpfiles + uifiles += bpfile.replace('.blp', '.ui') +blueprints = custom_target('blueprints', + command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTDIR@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], + depends: [talkatu, talkatu_gir], +talkatudemo_resources = gnome.compile_resources( + 'talkatudemoresources', + 'talkatudemo.gresource.xml', + dependencies: [blueprints], --- a/demo/meson.build Sat Sep 17 23:37:00 2022 -0500
+++ b/demo/meson.build Sun Sep 25 01:24:42 2022 -0500
@@ -7,15 +7,7 @@
-###############################################################################
-###############################################################################
-talkatudemo_resources = gnome.compile_resources(
- 'talkatudemoresources',
- 'data/talkatudemo.gresource.xml',
###############################################################################
--- a/demo/talkatudemowindow.c Sat Sep 17 23:37:00 2022 -0500
+++ b/demo/talkatudemowindow.c Sun Sep 25 01:24:42 2022 -0500
@@ -274,31 +274,13 @@
const GActionEntry entries[] = {
{ "author-name", talkatu_demo_window_author_changed, "s", "'Alice'" },
{ "author-name-color", talkatu_demo_window_author_name_color_changed,
g_action_map_add_action_entries(G_ACTION_MAP(window), entries,
G_N_ELEMENTS(entries), window);
gtk_widget_init_template(GTK_WIDGET(window));
- g_object_bind_property(
- window->editor, "show-toolbar",
- window->toggle_toolbar, "active",
- G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL
- g_object_bind_property(
- window->editor, "show-send-button",
- window->toggle_send_button, "active",
- G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL
- g_object_bind_property(
- talkatu_editor_get_input(TALKATU_EDITOR(window->editor)), "edited",
- window->toggle_edited, "active",
- G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL
--- a/meson.build Sat Sep 17 23:37:00 2022 -0500
+++ b/meson.build Sun Sep 25 01:24:42 2022 -0500
@@ -111,6 +111,8 @@
toplevel_inc = include_directories('.')
###############################################################################
###############################################################################
--- a/po/POTFILES Sat Sep 17 23:37:00 2022 -0500
+++ b/po/POTFILES Sun Sep 25 01:24:42 2022 -0500
@@ -1,4 +1,4 @@
talkatu/data/attachmentdialog.ui
@@ -8,7 +8,6 @@
talkatu/data/linkdialog.ui
-talkatu/data/scrolledwindow.ui
talkatu/data/typinglabel.ui
--- a/po/meson.build Sat Sep 17 23:37:00 2022 -0500
+++ b/po/meson.build Sun Sep 25 01:24:42 2022 -0500
@@ -1,3 +1,3 @@
- i18n.gettext(GETTEXT_PACKAGE)
+ i18n.gettext(GETTEXT_PACKAGE, preset: 'glib') --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/subprojects/blueprint-compiler.wrap Sun Sep 25 01:24:42 2022 -0500
@@ -0,0 +1,8 @@
+directory = blueprint-compiler +url = https://gitlab.gnome.org/jwestman/blueprint-compiler.git +program_names = blueprint-compiler \ No newline at end of file
--- a/talkatu/meson.build Sat Sep 17 23:37:00 2022 -0500
+++ b/talkatu/meson.build Sun Sep 25 01:24:42 2022 -0500
@@ -206,6 +206,8 @@
symbol_prefix : 'talkatu',
TALKATU_GENERATED_TARGETS += talkatu_gir
+ bpenv.append('GI_TYPELIB_PATH', meson.current_build_dir()) ###############################################################################