create separated widget for markup

This commit is contained in:
yggverse 2024-09-14 06:20:54 +03:00
parent e9fc9db486
commit 712d1801d8
10 changed files with 267 additions and 206 deletions

View file

@ -1,51 +1,13 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_GEMINI_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_GEMINI_HPP
#include <glibmm/markup.h>
#include <glibmm/regex.h>
#include <glibmm/ustring.h>
#include <gtkmm/label.h>
#include <gtkmm/viewport.h>
namespace app::browser::main::tab::page::content::text
{
class Gemini : public Gtk::Viewport
{
/*
* Tools (currently is private)
*/
struct Line
{
struct Match
{
static bool link(
const Glib::ustring & GEMTEXT,
Glib::ustring & address,
Glib::ustring & date,
Glib::ustring & alt
);
};
};
struct Markup
{
struct Make
{
static Glib::ustring link(
const Glib::ustring & ADDRESS,
const Glib::ustring & DATE,
const Glib::ustring & ALT
);
};
static Glib::ustring make(
const Glib::ustring & GEMTEXT
);
};
/*
* Gemini class API
*/
public:
Gemini(