Browse Source

use entire uri pointer

CPP-GTK4
yggverse 4 months ago
parent
commit
4c0cb8c6f0
  1. 4
      src/app/browser/main/tab/page.cpp
  2. 8
      src/app/browser/main/tab/page/content.cpp
  3. 4
      src/app/browser/main/tab/page/content.hpp
  4. 8
      src/app/browser/main/tab/page/content/text.cpp
  5. 4
      src/app/browser/main/tab/page/content/text.hpp
  6. 8
      src/app/browser/main/tab/page/content/text/gemini.cpp
  7. 4
      src/app/browser/main/tab/page/content/text/gemini.hpp
  8. 8
      src/app/browser/main/tab/page/content/text/gemini/reader.cpp
  9. 6
      src/app/browser/main/tab/page/content/text/gemini/reader.hpp

4
src/app/browser/main/tab/page.cpp

@ -351,8 +351,8 @@ void Page::navigation_reload( @@ -351,8 +351,8 @@ void Page::navigation_reload(
// Set content driver
pageContent->update(
page::Content::TEXT_GEMINI,
pageNavigation->get_request_text(), // @TODO use current page URI parsed instead of request able to change after
buffer
buffer,
uri
);
// Update title on detected by document provider

8
src/app/browser/main/tab/page/content.cpp

@ -40,8 +40,8 @@ Glib::ustring Content::get_title() @@ -40,8 +40,8 @@ Glib::ustring Content::get_title()
// Setters
void Content::update(
const MIME & MIME,
const Glib::ustring & REQUEST,
const Glib::ustring & SOURCE
const Glib::ustring & SOURCE,
GUri * uri
) {
// Cleanup, free memory
if (contentText != nullptr)
@ -64,8 +64,8 @@ void Content::update( @@ -64,8 +64,8 @@ void Content::update(
contentText = new content::Text(
content::Text::Type::GEMINI,
REQUEST,
SOURCE
SOURCE,
uri
);
title = contentText->get_title();

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

@ -42,8 +42,8 @@ namespace app::browser::main::tab::page @@ -42,8 +42,8 @@ namespace app::browser::main::tab::page
// Actions
void update(
const MIME & MIME,
const Glib::ustring & REQUEST,
const Glib::ustring & SOURCE
const Glib::ustring & SOURCE,
GUri * uri
);
// Getters

8
src/app/browser/main/tab/page/content/text.cpp

@ -6,8 +6,8 @@ using namespace app::browser::main::tab::page::content; @@ -6,8 +6,8 @@ using namespace app::browser::main::tab::page::content;
Text::Text(
const Type & TYPE,
const Glib::ustring & REQUEST,
const Glib::ustring & SOURCE
const Glib::ustring & SOURCE,
GUri * uri
) {
switch (TYPE)
{
@ -15,9 +15,9 @@ Text::Text( @@ -15,9 +15,9 @@ Text::Text(
set_child(
* Gtk::make_managed<text::Gemini>(
REQUEST,
SOURCE,
title
title,
uri
)
);

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

@ -30,8 +30,8 @@ namespace app::browser::main::tab::page::content @@ -30,8 +30,8 @@ namespace app::browser::main::tab::page::content
*/
Text(
const Type & TYPE,
const Glib::ustring & REQUEST,
const Glib::ustring & SOURCE
const Glib::ustring & SOURCE,
GUri * uri
);
// Getters

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

@ -4,9 +4,9 @@ @@ -4,9 +4,9 @@
using namespace app::browser::main::tab::page::content::text;
Gemini::Gemini(
const Glib::ustring & REQUEST,
const Glib::ustring & GEMTEXT,
Glib::ustring & title
Glib::ustring & title,
GUri * uri
) : Gtk::Viewport( // add scrolled window features to childs
NULL,
NULL
@ -18,9 +18,9 @@ Gemini::Gemini( @@ -18,9 +18,9 @@ Gemini::Gemini(
set_child(
* Gtk::make_managed<gemini::Reader>(
REQUEST,
GEMTEXT,
title
title,
uri
)
);
}

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

@ -14,9 +14,9 @@ namespace app::browser::main::tab::page::content::text @@ -14,9 +14,9 @@ namespace app::browser::main::tab::page::content::text
public:
Gemini(
const Glib::ustring & REQUEST,
const Glib::ustring & GEMTEXT,
Glib::ustring & title
Glib::ustring & title,
GUri * uri
);
};
}

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

@ -3,9 +3,9 @@ @@ -3,9 +3,9 @@
using namespace app::browser::main::tab::page::content::text::gemini;
Reader::Reader(
const Glib::ustring & REQUEST,
const Glib::ustring & GEMTEXT,
Glib::ustring & title
Glib::ustring & title,
GUri * base
) {
// Build markup
Glib::ustring markup;
@ -48,7 +48,9 @@ Reader::Reader( @@ -48,7 +48,9 @@ Reader::Reader(
{
markup.append(
Make::link(
REQUEST,
g_uri_to_string(
base
),
address,
date,
alt

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

@ -48,7 +48,7 @@ namespace app::browser::main::tab::page::content::text::gemini @@ -48,7 +48,7 @@ namespace app::browser::main::tab::page::content::text::gemini
);
static Glib::ustring link(
const Glib::ustring & REQUEST,
const Glib::ustring & BASE,
const Glib::ustring & ADDRESS,
const Glib::ustring & DATE,
const Glib::ustring & ALT
@ -69,9 +69,9 @@ namespace app::browser::main::tab::page::content::text::gemini @@ -69,9 +69,9 @@ namespace app::browser::main::tab::page::content::text::gemini
public:
Reader(
const Glib::ustring & REQUEST,
const Glib::ustring & GEMTEXT,
Glib::ustring & title
Glib::ustring & title,
GUri * uri
);
};
}

Loading…
Cancel
Save