Add support for rendering basic HTML in TalkatuHistory.
* Remove the data argument from class methods
* Renamed TalkatuHtmlParser to TalkatuHtmlRenderer
* Created TalkatuHtmlPangoRenderer
* Use the TalkatuMessage::content-type to determine how to render the text in
TalkatuHistory.
Testing Done:
Tested in the demo with a hack for the content type that will be fixed in a later review request.
Reviewed at https://reviews.imfreedom.org/r/403/
/*
* Talkatu - GTK widgets for chat applications
* Copyright (C) 2017-2020 Gary Kramlich <grim@reaperworld.com>
*
* This library 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 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 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/>.
*/
#include"talkatu/talkatuactiongroup.h"
#include"talkatu/talkatutag.h"
#include"talkatu/talkatuenums.h"
/**
* SECTION:talkatutag
* @Title: Tags
* @Short_description: Helpers for handling tags.
*
* Talkatu deals with a lot of tags which this API tries to make easier.
*/
/**
* TALKATU_TYPE_TAG:
*
* The standard _get_type macro for #TalkatuTag.
*/
/**
* TALKATU_TAG_ANCHOR:
*
* A constant that represents an anchor or link font style.
*/
/**
* TALKATU_TAG_AUTHOR:
*
* A constant for referencing the styling for an author.
*/
/**
* TALKATU_TAG_BOLD:
*
* A constant that represents the bold font style.
*/
/**
* TALKATU_TAG_CODE:
*
* A constant that represents a code font style.
*/
/**
* TALKATU_TAG_CONTENTS:
*
* A constant for the tag that tags message contents in a #TalkatuHistory
* buffer.
*/
/**
* TALKATU_TAG_DD:
*
* A constant that represents the dd HTML element.
*/
/**
* TALKATU_TAG_DL:
*
* A constant that represents the dl HTML element.
*/
/**
* TALKATU_TAG_DT:
*
* A constant that reprensents the dt HTML element.
*/
/**
* TALKATU_TAG_FORMATTING_END:
*
* A constant to be used as a suffix for tags that need formatting applied
* after the original tag.
*/
/**
* TALKATU_TAG_FORMATTING_START:
*
* A constant to be used as a prefix for tags that need formatting applied
* before the original tag.
*/
/**
* TALKATU_TAG_H1:
*
* A constant that represents the h1 header font style.
*/
/**
* TALKATU_TAG_H2:
*
* A constant that represents the h2 header font style.
*/
/**
* TALKATU_TAG_H3:
*
* A constant that represents the h3 header font style.
*/
/**
* TALKATU_TAG_H4:
*
* A constant that represents the h4 header font style.
*/
/**
* TALKATU_TAG_H5:
*
* A constant that represents the h5 header font style.
*/
/**
* TALKATU_TAG_H6:
*
* A constant that represents the h6 header font style.
*/
/**
* TALKATU_TAG_ITALIC:
*
* A constant that represents the italic font style.
*/
/**
* TALKATU_TAG_MESSAGE:
*
* A constant for the tag that tags an entire message in a #TalkatuHistory
* buffer.
*/
/**
* TALKATU_TAG_PRE:
*
* A constant that represents a preformatted font style.
*/
/**
* TALKATU_TAG_PREFIX:
*
* The prefix that all Talkatu tags use.
*/
/**
* TALKATU_TAG_PREFIX_LEN:
*
* The length of #TALKATU_TAG_PREFIX for easy computation.
*/
/**
* TALKATU_TAG_SEARCH:
*
* A constant that represents the highlighted search term font style.
*/
/**
* TALKATU_TAG_STRIKETHROUGH:
*
* A constant that represents the strikethrough font style.
*/
/**
* TALKATU_TAG_SUBSCRIPT:
*
* A constant that represents the sub-script font style.
*/
/**
* TALKATU_TAG_SUPERSCRIPT:
*
* A constant that represents the super-script font style.
*/
/**
* TALKATU_TAG_TIMESTAMP:
*
* A constant that represents the timestamp font style.
*/
/**
* TALKATU_TAG_UNDERLINE:
*
* A constant that represents the underlined font style.
*/
/**
* TalkatuTagDisplay:
* @TALKATU_TAG_DISPLAY_INLINE: The tag should be rendered inline.
* @TALKATU_TAG_DISPLAY_BLOCK: The tag should be rendered on its own line.
*
* An enum representing how a tag should be rendered.
*/
/**
* TalkatuTag:
*
* TalkatuTag is a #GtkTextTag subclass that has a few additional properties
* that allows greater control of how text is rendered.