mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
draft text container
This commit is contained in:
parent
3bfacf7ea9
commit
bbc1046c2a
1
Makefile
1
Makefile
@ -17,6 +17,7 @@ SRCS = src/app.cpp\
|
||||
src/app/browser/main/tab.cpp\
|
||||
src/app/browser/main/tab/page.cpp\
|
||||
src/app/browser/main/tab/page/content.cpp\
|
||||
src/app/browser/main/tab/page/content/text.cpp\
|
||||
src/app/browser/main/tab/page/content/text/gemini.cpp\
|
||||
src/app/browser/main/tab/page/content/text/plain.cpp\
|
||||
src/app/browser/main/tab/page/navigation.cpp\
|
||||
|
@ -12,6 +12,7 @@ src/app/browser/main.cpp
|
||||
src/app/browser/main/tab.cpp
|
||||
src/app/browser/main/tab/page.cpp
|
||||
src/app/browser/main/tab/page/content.cpp
|
||||
src/app/browser/main/tab/page/content/text.cpp
|
||||
src/app/browser/main/tab/page/content/text/gemini.cpp
|
||||
src/app/browser/main/tab/page/content/text/plain.cpp
|
||||
src/app/browser/main/tab/page/navigation.cpp
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "content.hpp"
|
||||
#include "content/text/gemini.hpp"
|
||||
#include "content/text/plain.hpp"
|
||||
#include "content/text.hpp"
|
||||
|
||||
using namespace app::browser::main::tab::page;
|
||||
|
||||
@ -24,23 +23,23 @@ Content::~Content()
|
||||
|
||||
// Public actions
|
||||
void Content::set_text_gemini(
|
||||
const Glib::ustring & gemtext
|
||||
const Glib::ustring & GEMTEXT
|
||||
) {
|
||||
auto contentText = new content::Text; // @TODO manage
|
||||
|
||||
contentText->set_gemini(
|
||||
GEMTEXT
|
||||
);
|
||||
|
||||
set_widget(
|
||||
new content::text::Gemini(
|
||||
gemtext
|
||||
)
|
||||
contentText
|
||||
);
|
||||
}
|
||||
|
||||
void Content::set_text_plain(
|
||||
const Glib::ustring & text
|
||||
const Glib::ustring & TEXT
|
||||
) {
|
||||
set_widget(
|
||||
new content::text::Plain(
|
||||
text
|
||||
)
|
||||
);
|
||||
// @TODO
|
||||
}
|
||||
|
||||
// @TODO text_plain, picture, video, etc.
|
||||
|
@ -22,11 +22,11 @@ namespace app::browser::main::tab::page
|
||||
~Content();
|
||||
|
||||
void set_text_gemini(
|
||||
const Glib::ustring & gemtext
|
||||
const Glib::ustring & GEMTEXT
|
||||
);
|
||||
|
||||
void set_text_plain(
|
||||
const Glib::ustring & text
|
||||
const Glib::ustring & TEXT
|
||||
);
|
||||
};
|
||||
}
|
||||
|
26
src/app/browser/main/tab/page/content/text.cpp
Normal file
26
src/app/browser/main/tab/page/content/text.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include "text.hpp"
|
||||
#include "text/gemini.hpp"
|
||||
#include "text/plain.hpp"
|
||||
|
||||
using namespace app::browser::main::tab::page::content;
|
||||
|
||||
Text::Text()
|
||||
{
|
||||
// @TODO GtkViewport?
|
||||
}
|
||||
|
||||
void Text::set_gemini(
|
||||
const Glib::ustring & GEMTEXT
|
||||
) {
|
||||
set_child(
|
||||
* new text::Gemini( // @TODO manage
|
||||
GEMTEXT
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void Text::set_plain(
|
||||
const Glib::ustring & TEXT
|
||||
) {
|
||||
// @TODO
|
||||
}
|
25
src/app/browser/main/tab/page/content/text.hpp
Normal file
25
src/app/browser/main/tab/page/content/text.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_HPP
|
||||
#define APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_HPP
|
||||
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/scrolledwindow.h>
|
||||
|
||||
namespace app::browser::main::tab::page::content
|
||||
{
|
||||
class Text : public Gtk::ScrolledWindow
|
||||
{
|
||||
public:
|
||||
|
||||
Text();
|
||||
|
||||
void set_gemini(
|
||||
const Glib::ustring & GEMTEXT
|
||||
);
|
||||
|
||||
void set_plain(
|
||||
const Glib::ustring & TEXT
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // APP_BROWSER_MAIN_TAB_PAGE_CONTENT_TEXT_HPP
|
@ -3,7 +3,7 @@
|
||||
using namespace app::browser::main::tab::page::content::text;
|
||||
|
||||
Gemini::Gemini(
|
||||
const Glib::ustring & gemtext
|
||||
const Glib::ustring & GEMTEXT
|
||||
) {
|
||||
set_wrap(
|
||||
true
|
||||
@ -14,6 +14,6 @@ Gemini::Gemini(
|
||||
);
|
||||
|
||||
set_markup(
|
||||
gemtext // @TODO
|
||||
GEMTEXT // @TODO
|
||||
);
|
||||
}
|
@ -11,7 +11,7 @@ namespace app::browser::main::tab::page::content::text
|
||||
public:
|
||||
|
||||
Gemini(
|
||||
const Glib::ustring & gemtext
|
||||
const Glib::ustring & GEMTEXT
|
||||
);
|
||||
};
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
using namespace app::browser::main::tab::page::content::text;
|
||||
|
||||
Plain::Plain(
|
||||
const Glib::ustring & text
|
||||
const Glib::ustring & TEXT
|
||||
) {
|
||||
set_wrap(
|
||||
true
|
||||
@ -14,6 +14,6 @@ Plain::Plain(
|
||||
);
|
||||
|
||||
set_text(
|
||||
text
|
||||
TEXT
|
||||
);
|
||||
}
|
@ -11,7 +11,7 @@ namespace app::browser::main::tab::page::content::text
|
||||
public:
|
||||
|
||||
Plain(
|
||||
const Glib::ustring & text
|
||||
const Glib::ustring & TEXT
|
||||
);
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user