Backout the blueprint compiler stuff
Turns out we just got used to the GTK Builder ui format, so the blueprint
compiler doesn't really do much for us.
This was a backout of `8c78e806f7c7` but then I put bindings in for the toolbar, send button, and edited buttons.
Testing Done:
Built and ran the demo.
Reviewed at https://reviews.imfreedom.org/r/2213/
--- a/demo/data/demo.blp Sun Jan 15 21:28:59 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +0,0 @@
-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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/data/demo.ui Tue Feb 21 21:33:39 2023 -0600
@@ -0,0 +1,315 @@
+<?xml version="1.0" encoding="UTF-8"?> +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> --> + <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"> + <object class="TalkatuAutoScroller" id="auto_scroller"/> + <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 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 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 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 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 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 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> + <property name="active" bind-source="editor" bind-property="show-toolbar" bind-flags="bidirectional|sync-create"></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> + <property name="active" bind-source="editor" bind-property="show-send-button" bind-flags="bidirectional|sync-create"></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> + <property name="active" bind-source="input" bind-property="edited" bind-flags="bidirectional|sync-create"></property> + <object class="TalkatuEditor" id="editor"> + <property name="vexpand">1</property> + <property name="orientation">vertical</property> + <child internal-child="input"> + <object class="TalkatuInput" id="input"> + <property name="buffer">buffer_plain</property> + <property name="author">Alice</property> + <property name="author-name-color">black</property> + <property name="send-binding">return</property> + <signal name="open-url" handler="talkatu_demo_window_view_open_url_cb"/> + <signal name="send-message" handler="talkatu_demo_window_view_send_message_cb"/> + <object class="TalkatuTypingLabel" id="typing"/> + <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">Black</attribute> + <attribute name="action">win.author-name-color</attribute> + <attribute name="target">black</attribute> + <attribute name="label" translatable="yes">White</attribute> + <attribute name="action">win.author-name-color</attribute> + <attribute name="target">white</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 class="TalkatuMarkdownBuffer" id="buffer_markdown"> + <signal name="changed" handler="talkatu_demo_window_buffer_modified_cb"/> + <object class="TalkatuBuffer" id="buffer_plain"> + <signal name="changed" handler="talkatu_demo_window_buffer_modified_cb"/> + <object class="TalkatuWholeBuffer" id="buffer_whole"> + <property name="style">whole</property> + <signal name="changed" handler="talkatu_demo_window_buffer_modified_cb"/> --- a/demo/data/meson.build Sun Jan 15 21:28:59 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-# 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 Sun Jan 15 21:28:59 2023 -0600
+++ b/demo/meson.build Tue Feb 21 21:33:39 2023 -0600
@@ -7,7 +7,15 @@
+############################################################################### +############################################################################### +talkatudemo_resources = gnome.compile_resources( + 'talkatudemoresources', + 'data/talkatudemo.gresource.xml', ###############################################################################
--- a/meson.build Sun Jan 15 21:28:59 2023 -0600
+++ b/meson.build Tue Feb 21 21:33:39 2023 -0600
@@ -96,7 +96,6 @@
toplevel_inc = include_directories('.')
###############################################################################
--- a/po/POTFILES Sun Jan 15 21:28:59 2023 -0600
+++ b/po/POTFILES Tue Feb 21 21:33:39 2023 -0600
@@ -1,4 +1,4 @@
talkatu/data/attachmentdialog.ui
--- a/subprojects/blueprint-compiler.wrap Sun Jan 15 21:28:59 2023 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-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 Sun Jan 15 21:28:59 2023 -0600
+++ b/talkatu/meson.build Tue Feb 21 21:33:39 2023 -0600
@@ -198,8 +198,6 @@
symbol_prefix : 'talkatu',
TALKATU_GENERATED_TARGETS += talkatu_gir
- bpenv.append('GI_TYPELIB_PATH', meson.current_build_dir())
###############################################################################