mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
draft text container
This commit is contained in:
parent
3bfacf7ea9
commit
bbc1046c2a
10 changed files with 72 additions and 20 deletions
1
Makefile
1
Makefile
|
|
@ -17,6 +17,7 @@ SRCS = src/app.cpp\
|
||||||
src/app/browser/main/tab.cpp\
|
src/app/browser/main/tab.cpp\
|
||||||
src/app/browser/main/tab/page.cpp\
|
src/app/browser/main/tab/page.cpp\
|
||||||
src/app/browser/main/tab/page/content.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/gemini.cpp\
|
||||||
src/app/browser/main/tab/page/content/text/plain.cpp\
|
src/app/browser/main/tab/page/content/text/plain.cpp\
|
||||||
src/app/browser/main/tab/page/navigation.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.cpp
|
||||||
src/app/browser/main/tab/page.cpp
|
src/app/browser/main/tab/page.cpp
|
||||||
src/app/browser/main/tab/page/content.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/gemini.cpp
|
||||||
src/app/browser/main/tab/page/content/text/plain.cpp
|
src/app/browser/main/tab/page/content/text/plain.cpp
|
||||||
src/app/browser/main/tab/page/navigation.cpp
|
src/app/browser/main/tab/page/navigation.cpp
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
#include "content.hpp"
|
#include "content.hpp"
|
||||||
#include "content/text/gemini.hpp"
|
#include "content/text.hpp"
|
||||||
#include "content/text/plain.hpp"
|
|
||||||
|
|
||||||
using namespace app::browser::main::tab::page;
|
using namespace app::browser::main::tab::page;
|
||||||
|
|
||||||
|
|
@ -24,23 +23,23 @@ Content::~Content()
|
||||||
|
|
||||||
// Public actions
|
// Public actions
|
||||||
void Content::set_text_gemini(
|
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(
|
set_widget(
|
||||||
new content::text::Gemini(
|
contentText
|
||||||
gemtext
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Content::set_text_plain(
|
void Content::set_text_plain(
|
||||||
const Glib::ustring & text
|
const Glib::ustring & TEXT
|
||||||
) {
|
) {
|
||||||
set_widget(
|
// @TODO
|
||||||
new content::text::Plain(
|
|
||||||
text
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TODO text_plain, picture, video, etc.
|
// @TODO text_plain, picture, video, etc.
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,11 @@ namespace app::browser::main::tab::page
|
||||||
~Content();
|
~Content();
|
||||||
|
|
||||||
void set_text_gemini(
|
void set_text_gemini(
|
||||||
const Glib::ustring & gemtext
|
const Glib::ustring & GEMTEXT
|
||||||
);
|
);
|
||||||
|
|
||||||
void set_text_plain(
|
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;
|
using namespace app::browser::main::tab::page::content::text;
|
||||||
|
|
||||||
Gemini::Gemini(
|
Gemini::Gemini(
|
||||||
const Glib::ustring & gemtext
|
const Glib::ustring & GEMTEXT
|
||||||
) {
|
) {
|
||||||
set_wrap(
|
set_wrap(
|
||||||
true
|
true
|
||||||
|
|
@ -14,6 +14,6 @@ Gemini::Gemini(
|
||||||
);
|
);
|
||||||
|
|
||||||
set_markup(
|
set_markup(
|
||||||
gemtext // @TODO
|
GEMTEXT // @TODO
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -11,7 +11,7 @@ namespace app::browser::main::tab::page::content::text
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Gemini(
|
Gemini(
|
||||||
const Glib::ustring & gemtext
|
const Glib::ustring & GEMTEXT
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
using namespace app::browser::main::tab::page::content::text;
|
using namespace app::browser::main::tab::page::content::text;
|
||||||
|
|
||||||
Plain::Plain(
|
Plain::Plain(
|
||||||
const Glib::ustring & text
|
const Glib::ustring & TEXT
|
||||||
) {
|
) {
|
||||||
set_wrap(
|
set_wrap(
|
||||||
true
|
true
|
||||||
|
|
@ -14,6 +14,6 @@ Plain::Plain(
|
||||||
);
|
);
|
||||||
|
|
||||||
set_text(
|
set_text(
|
||||||
text
|
TEXT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -11,7 +11,7 @@ namespace app::browser::main::tab::page::content::text
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Plain(
|
Plain(
|
||||||
const Glib::ustring & text
|
const Glib::ustring & TEXT
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue