talkatu/talkatu

bf428b4a68da
Move TalkatuHistory from a GtkTextView base to GtkListBox

Make TalkatuInput return the local time if a timestamp has not yet been set.

Add an toggle button for setting the message's edited state

Added TalkatuHistoryRow which is what will be used to display message

Add TalkatuHistoryRow to the documentation.

Add TalkatuScrolledWindow that subclasses GtkScrolledWindow but autoscrolls and has keybindings callbacks for page up and page down.

Testing Done:
Compile, docs, and manual testing in the demo. The i18n stuff is broken for unrelated reasons, which I'll fix in another review request.

Bugs closed: TALKATU-78

Reviewed at https://reviews.imfreedom.org/r/56/
/*
* talkatu
* Copyright (C) 2017-2019 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/>.
*/
#if !defined(TALKATU_GLOBAL_HEADER_INSIDE) && !defined(TALKATU_COMPILATION)
#error "only <talkatu.h> may be included directly"
#endif
#ifndef TALKATU_ACTION_GROUP_H
#define TALKATU_ACTION_GROUP_H
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <talkatu/talkatuinput.h>
#define TALKATU_ACTION_FORMAT_BOLD ("format-bold")
#define TALKATU_ACTION_FORMAT_ITALIC ("format-italic")
#define TALKATU_ACTION_FORMAT_UNDERLINE ("format-underline")
#define TALKATU_ACTION_FORMAT_STRIKETHROUGH ("format-strikethrough")
#define TALKATU_ACTION_FORMAT_GROW ("format-grow")
#define TALKATU_ACTION_FORMAT_SHRINK ("format-shrink")
#define TALKATU_ACTION_FORMAT_RESET ("format-reset")
#define TALKATU_ACTION_ATTACH_FILE ("attach-file")
#define TALKATU_ACTION_INSERT_LINK ("insert-link")
G_BEGIN_DECLS
#define TALKATU_TYPE_ACTION_GROUP (talkatu_action_group_get_type())
G_DECLARE_DERIVABLE_TYPE(TalkatuActionGroup, talkatu_action_group, TALKATU, ACTION_GROUP, GSimpleActionGroup)
struct _TalkatuActionGroupClass {
/*< private >*/
GSimpleActionGroupClass parent;
/*< public >*/
void (*action_activated)(TalkatuActionGroup *ag, GAction *action, const gchar *name);
/*< private >*/
gpointer reserved[4];
};
GSimpleActionGroup *talkatu_action_group_new(GtkTextBuffer *buffer);
GtkTextBuffer *talkatu_action_group_get_buffer(TalkatuActionGroup *ag);
void talkatu_action_group_set_input(TalkatuActionGroup *ag, TalkatuInput *input);
TalkatuInput *talkatu_action_group_get_input(TalkatuActionGroup *ag);
void talkatu_action_group_enable_action(TalkatuActionGroup *ag, const gchar *name);
const gchar *talkatu_action_name_for_tag_name(const gchar *tag_name);
void talkatu_action_group_activate_format(TalkatuActionGroup *ag, const gchar *format_name);
gboolean talkatu_action_group_get_action_activated(TalkatuActionGroup *ag, const gchar *name);
gchar **talkatu_action_group_get_activated_formats(TalkatuActionGroup *ag);
G_END_DECLS
#endif /* TALKATU_ACTIONGROUP_H */