Browse Source

draft text container

CPP-GTK4
yggverse 3 months ago
parent
commit
bbc1046c2a
  1. 1
      Makefile
  2. 1
      po/POTFILES.in
  3. 23
      src/app/browser/main/tab/page/content.cpp
  4. 4
      src/app/browser/main/tab/page/content.hpp
  5. 26
      src/app/browser/main/tab/page/content/text.cpp
  6. 25
      src/app/browser/main/tab/page/content/text.hpp
  7. 4
      src/app/browser/main/tab/page/content/text/gemini.cpp
  8. 2
      src/app/browser/main/tab/page/content/text/gemini.hpp
  9. 4
      src/app/browser/main/tab/page/content/text/plain.cpp
  10. 2
      src/app/browser/main/tab/page/content/text/plain.hpp

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\

1
po/POTFILES.in

@ -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

23
src/app/browser/main/tab/page/content.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.

4
src/app/browser/main/tab/page/content.hpp

@ -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

@ -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

@ -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

4
src/app/browser/main/tab/page/content/text/gemini.cpp

@ -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
); );
} }

2
src/app/browser/main/tab/page/content/text/gemini.hpp

@ -11,7 +11,7 @@ namespace app::browser::main::tab::page::content::text
public: public:
Gemini( Gemini(
const Glib::ustring & gemtext const Glib::ustring & GEMTEXT
); );
}; };
} }

4
src/app/browser/main/tab/page/content/text/plain.cpp

@ -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
); );
} }

2
src/app/browser/main/tab/page/content/text/plain.hpp

@ -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…
Cancel
Save