|
|
@ -1,6 +1,6 @@ |
|
|
|
#include "text.hpp" |
|
|
|
#include "text.hpp" |
|
|
|
#include "text/gemini.hpp" |
|
|
|
#include "text/gemini.hpp" |
|
|
|
#include "text/plain.hpp" |
|
|
|
// #include "text/plain.hpp" @TODO
|
|
|
|
|
|
|
|
|
|
|
|
using namespace app::browser::main::tab::page::content; |
|
|
|
using namespace app::browser::main::tab::page::content; |
|
|
|
|
|
|
|
|
|
|
@ -8,31 +8,14 @@ Text::Text( |
|
|
|
const Type & TYPE, |
|
|
|
const Type & TYPE, |
|
|
|
const Glib::ustring & VALUE |
|
|
|
const Glib::ustring & VALUE |
|
|
|
) { |
|
|
|
) { |
|
|
|
// Init components
|
|
|
|
|
|
|
|
textGemini = nullptr; |
|
|
|
|
|
|
|
textPlain = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GtkLabel does not support ScrolledWindow features, create GtkViewport
|
|
|
|
|
|
|
|
auto viewport = new Gtk::Viewport( // @TODO manage
|
|
|
|
|
|
|
|
NULL, //Gtk::Adjustment::H
|
|
|
|
|
|
|
|
NULL //Gtk::Adjustment::V
|
|
|
|
|
|
|
|
); // @TODO manage, optimize
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
viewport->set_scroll_to_focus( |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Detect text driver by text type requested
|
|
|
|
|
|
|
|
switch (TYPE) |
|
|
|
switch (TYPE) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case GEMINI: |
|
|
|
case GEMINI: |
|
|
|
|
|
|
|
|
|
|
|
textGemini = new text::Gemini( |
|
|
|
set_child( |
|
|
|
|
|
|
|
* Gtk::make_managed<text::Gemini>( |
|
|
|
VALUE |
|
|
|
VALUE |
|
|
|
); |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
viewport->set_child( |
|
|
|
|
|
|
|
* textGemini |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
@ -47,16 +30,4 @@ Text::Text( |
|
|
|
|
|
|
|
|
|
|
|
throw _("Invalid text type enum"); // @TODO
|
|
|
|
throw _("Invalid text type enum"); // @TODO
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
set_child( |
|
|
|
|
|
|
|
* viewport |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Text::~Text() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
delete textGemini; |
|
|
|
|
|
|
|
delete textPlain; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @TODO
|
|
|
|
|
|
|
|
} |
|
|
|
} |