Browse Source

rename widgets

CPP-GTK4
yggverse 4 months ago
parent
commit
57f43e2dd9
  1. 18
      Makefile
  2. 18
      po/POTFILES.in
  3. 66
      src/app/browser/main/tab/page.cpp
  4. 8
      src/app/browser/main/tab/page.hpp
  5. 182
      src/app/browser/main/tab/page/navbar.cpp
  6. 19
      src/app/browser/main/tab/page/navbar/base.hpp
  7. 19
      src/app/browser/main/tab/page/navbar/bookmark.hpp
  8. 19
      src/app/browser/main/tab/page/navbar/history/back.hpp
  9. 19
      src/app/browser/main/tab/page/navbar/history/forward.hpp
  10. 17
      src/app/browser/main/tab/page/navbar/update.hpp
  11. 182
      src/app/browser/main/tab/page/navigation.cpp
  12. 22
      src/app/browser/main/tab/page/navigation.hpp
  13. 2
      src/app/browser/main/tab/page/navigation/base.cpp
  14. 19
      src/app/browser/main/tab/page/navigation/base.hpp
  15. 2
      src/app/browser/main/tab/page/navigation/bookmark.cpp
  16. 19
      src/app/browser/main/tab/page/navigation/bookmark.hpp
  17. 2
      src/app/browser/main/tab/page/navigation/history.cpp
  18. 8
      src/app/browser/main/tab/page/navigation/history.hpp
  19. 2
      src/app/browser/main/tab/page/navigation/history/back.cpp
  20. 19
      src/app/browser/main/tab/page/navigation/history/back.hpp
  21. 2
      src/app/browser/main/tab/page/navigation/history/forward.cpp
  22. 19
      src/app/browser/main/tab/page/navigation/history/forward.hpp
  23. 4
      src/app/browser/main/tab/page/navigation/request.cpp
  24. 8
      src/app/browser/main/tab/page/navigation/request.hpp
  25. 2
      src/app/browser/main/tab/page/navigation/update.cpp
  26. 17
      src/app/browser/main/tab/page/navigation/update.hpp
  27. 6
      src/app/browser/main/tab/page/progress.cpp
  28. 10
      src/app/browser/main/tab/page/progress.hpp

18
Makefile

@ -19,15 +19,15 @@ SRCS = src/main.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/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/navbar.cpp\ src/app/browser/main/tab/page/navigation.cpp\
src/app/browser/main/tab/page/navbar/base.cpp\ src/app/browser/main/tab/page/navigation/base.cpp\
src/app/browser/main/tab/page/navbar/bookmark.cpp\ src/app/browser/main/tab/page/navigation/bookmark.cpp\
src/app/browser/main/tab/page/navbar/history.cpp\ src/app/browser/main/tab/page/navigation/history.cpp\
src/app/browser/main/tab/page/navbar/history/back.cpp\ src/app/browser/main/tab/page/navigation/history/back.cpp\
src/app/browser/main/tab/page/navbar/history/forward.cpp\ src/app/browser/main/tab/page/navigation/history/forward.cpp\
src/app/browser/main/tab/page/navbar/request.cpp\ src/app/browser/main/tab/page/navigation/request.cpp\
src/app/browser/main/tab/page/navbar/update.cpp\ src/app/browser/main/tab/page/navigation/update.cpp\
src/app/browser/main/tab/page/progressbar.cpp\ src/app/browser/main/tab/page/progress.cpp\
src/app/browser/main/tab/label.cpp\ src/app/browser/main/tab/label.cpp\
src/lib/database.cpp\ src/lib/database.cpp\
src/lib/database/session.cpp src/lib/database/session.cpp

18
po/POTFILES.in

@ -11,15 +11,15 @@ 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/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/navbar.cpp src/app/browser/main/tab/page/navigation.cpp
src/app/browser/main/tab/page/navbar/base.cpp src/app/browser/main/tab/page/navigation/base.cpp
src/app/browser/main/tab/page/navbar/bookmark.cpp src/app/browser/main/tab/page/navigation/bookmark.cpp
src/app/browser/main/tab/page/navbar/history.cpp src/app/browser/main/tab/page/navigation/history.cpp
src/app/browser/main/tab/page/navbar/history/back.cpp src/app/browser/main/tab/page/navigation/history/back.cpp
src/app/browser/main/tab/page/navbar/history/forward.cpp src/app/browser/main/tab/page/navigation/history/forward.cpp
src/app/browser/main/tab/page/navbar/request.cpp src/app/browser/main/tab/page/navigation/request.cpp
src/app/browser/main/tab/page/navbar/update.cpp src/app/browser/main/tab/page/navigation/update.cpp
src/app/browser/main/tab/page/progressbar.cpp src/app/browser/main/tab/page/progress.cpp
src/app/browser/main/tab/label.cpp src/app/browser/main/tab/label.cpp
src/lib/database.cpp src/lib/database.cpp
src/lib/database/session.cpp src/lib/database/session.cpp

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

@ -1,7 +1,7 @@
#include "page.hpp" #include "page.hpp"
#include "page/content.hpp" #include "page/content.hpp"
#include "page/navbar.hpp" #include "page/navigation.hpp"
#include "page/progressbar.hpp" #include "page/progress.hpp"
using namespace app::browser::main::tab; using namespace app::browser::main::tab;
@ -33,18 +33,18 @@ Page::Page(
); );
// Init components // Init components
pageNavbar = Gtk::make_managed<page::Navbar>( pageNavigation = Gtk::make_managed<page::Navigation>(
REQUEST REQUEST
); );
append( append(
* pageNavbar * pageNavigation
); );
pageProgressbar = Gtk::make_managed<page::Progressbar>(); pageProgress = Gtk::make_managed<page::Progress>();
append( append(
* pageProgressbar * pageProgress
); );
pageContent = Gtk::make_managed<page::Content>(); pageContent = Gtk::make_managed<page::Content>();
@ -75,12 +75,12 @@ Glib::ustring Page::get_subtitle()
// Actions // Actions
void Page::back() void Page::back()
{ {
pageNavbar->history_back(); pageNavigation->history_back();
} }
void Page::forward() void Page::forward()
{ {
pageNavbar->history_forward(); pageNavigation->history_forward();
} }
void Page::refresh( void Page::refresh(
@ -92,7 +92,7 @@ void Page::refresh(
subtitle = SUBTITLE; subtitle = SUBTITLE;
pageProgressbar->refresh( pageProgress->refresh(
PROGRESS PROGRESS
); );
@ -107,27 +107,27 @@ void Page::update(
// Update navigation history // Update navigation history
if (HISTORY) if (HISTORY)
{ {
pageNavbar->history_add( pageNavigation->history_add(
pageNavbar->get_request_text() pageNavigation->get_request_text()
); );
} }
// Update page extras // Update page extras
refresh( refresh(
pageNavbar->get_request_host(), pageNavigation->get_request_host(),
Glib::ustring::sprintf( Glib::ustring::sprintf(
_("load %s.."), _("load %s.."),
pageNavbar->get_request_text() pageNavigation->get_request_text()
), 0 ), 0
); );
// Connect scheme driver // Connect scheme driver
if ("file" == pageNavbar->get_request_scheme()) if ("file" == pageNavigation->get_request_scheme())
{ {
// @TODO // @TODO
} }
else if ("gemini" == pageNavbar->get_request_scheme()) else if ("gemini" == pageNavigation->get_request_scheme())
{ {
// Create new socket connection // Create new socket connection
GioSocketClient = Gio::SocketClient::create(); GioSocketClient = Gio::SocketClient::create();
@ -145,14 +145,14 @@ void Page::update(
); );
GioSocketClient->connect_to_uri_async( GioSocketClient->connect_to_uri_async(
pageNavbar->get_request_text(), 1965, pageNavigation->get_request_text(), 1965,
[this](const Glib::RefPtr<Gio::AsyncResult> & result) [this](const Glib::RefPtr<Gio::AsyncResult> & result)
{ {
refresh( refresh(
pageNavbar->get_request_host(), pageNavigation->get_request_host(),
Glib::ustring::sprintf( Glib::ustring::sprintf(
_("connect %s.."), _("connect %s.."),
pageNavbar->get_request_host() pageNavigation->get_request_host()
), .25 ), .25
); );
@ -166,7 +166,7 @@ void Page::update(
catch (const Glib::Error & EXCEPTION) catch (const Glib::Error & EXCEPTION)
{ {
refresh( refresh(
pageNavbar->get_request_host(), pageNavigation->get_request_host(),
EXCEPTION.what(), 1 EXCEPTION.what(), 1
); );
} }
@ -174,7 +174,7 @@ void Page::update(
// Connection established, begin request // Connection established, begin request
if (GioSocketConnection != nullptr) if (GioSocketConnection != nullptr)
{ {
const Glib::ustring request = pageNavbar->get_request_text() + "\r\n"; const Glib::ustring request = pageNavigation->get_request_text() + "\r\n";
GioSocketConnection->get_output_stream()->write_async( GioSocketConnection->get_output_stream()->write_async(
request.data(), request.data(),
@ -182,11 +182,11 @@ void Page::update(
[this](const Glib::RefPtr<Gio::AsyncResult> & result) [this](const Glib::RefPtr<Gio::AsyncResult> & result)
{ {
refresh( refresh(
pageNavbar->get_request_host(), pageNavigation->get_request_host(),
Glib::ustring::sprintf( Glib::ustring::sprintf(
_("request %s.."), _("request %s.."),
pageNavbar->get_request_path().empty() ? pageNavbar->get_request_host() pageNavigation->get_request_path().empty() ? pageNavigation->get_request_host()
: pageNavbar->get_request_path() : pageNavigation->get_request_path()
), .5 ), .5
); );
@ -197,11 +197,11 @@ void Page::update(
[this](const Glib::RefPtr<Gio::AsyncResult> & result) [this](const Glib::RefPtr<Gio::AsyncResult> & result)
{ {
refresh( refresh(
pageNavbar->get_request_host(), pageNavigation->get_request_host(),
Glib::ustring::sprintf( Glib::ustring::sprintf(
_("reading %s.."), _("reading %s.."),
pageNavbar->get_request_path().empty() ? pageNavbar->get_request_host() pageNavigation->get_request_path().empty() ? pageNavigation->get_request_host()
: pageNavbar->get_request_path() : pageNavigation->get_request_path()
), .75 ), .75
); );
@ -215,7 +215,7 @@ void Page::update(
if (meta[1] == "20") if (meta[1] == "20")
{ {
// Route by mime type or path extension // Route by mime type or path extension
if (meta[2] == "text/gemini" || Glib::str_has_suffix(pageNavbar->get_request_path(), ".gmi")) if (meta[2] == "text/gemini" || Glib::str_has_suffix(pageNavigation->get_request_path(), ".gmi"))
{ {
pageContent->set_text_gemini( pageContent->set_text_gemini(
buffer // @TODO buffer // @TODO
@ -240,9 +240,9 @@ void Page::update(
GioSocketConnection->close(); GioSocketConnection->close();
refresh( refresh(
pageNavbar->get_request_host(), // @TODO title pageNavigation->get_request_host(), // @TODO title
pageNavbar->get_request_path().empty() ? pageNavbar->get_request_host() pageNavigation->get_request_path().empty() ? pageNavigation->get_request_host()
: pageNavbar->get_request_path() : pageNavigation->get_request_path()
, 1 , 1
); );
} }
@ -255,10 +255,10 @@ void Page::update(
} }
// Scheme not found but host provided, redirect to gemini:// // Scheme not found but host provided, redirect to gemini://
else if (pageNavbar->get_request_scheme().empty() && !pageNavbar->get_request_host().empty()) else if (pageNavigation->get_request_scheme().empty() && !pageNavigation->get_request_host().empty())
{ {
pageNavbar->set_request_text( pageNavigation->set_request_text(
"gemini://" + pageNavbar->get_request_text() "gemini://" + pageNavigation->get_request_text()
); );
update(); update();

8
src/app/browser/main/tab/page.hpp

@ -20,8 +20,8 @@ namespace app::browser::main::tab
namespace page namespace page
{ {
class Content; class Content;
class Navbar; class Navigation;
class Progressbar; class Progress;
} }
class Page : public Gtk::Box class Page : public Gtk::Box
@ -38,8 +38,8 @@ namespace app::browser::main::tab
// Components // Components
page::Content * pageContent; page::Content * pageContent;
page::Navbar * pageNavbar; page::Navigation * pageNavigation;
page::Progressbar * pageProgressbar; page::Progress * pageProgress;
public: public:

182
src/app/browser/main/tab/page/navbar.cpp

@ -1,182 +0,0 @@
#include "navbar.hpp"
#include "navbar/base.hpp"
#include "navbar/bookmark.hpp"
#include "navbar/history.hpp"
#include "navbar/request.hpp"
#include "navbar/update.hpp"
using namespace app::browser::main::tab::page;
Navbar::Navbar(
const Glib::ustring & REQUEST
) {
// Init container
set_orientation(
Gtk::Orientation::HORIZONTAL
);
set_spacing(
SPACING
);
set_margin_top(
MARGIN
);
set_margin_start(
MARGIN
);
set_margin_end(
MARGIN
);
set_margin_bottom(
MARGIN
);
// Init components
navbarBase = Gtk::make_managed<navbar::Base>();
append(
* navbarBase
);
navbarHistory = Gtk::make_managed<navbar::History>();
append(
* navbarHistory
);
navbarUpdate = Gtk::make_managed<navbar::Update>();
append(
* navbarUpdate
);
navbarRequest = Gtk::make_managed<navbar::Request>(
REQUEST
);
append(
* navbarRequest
);
navbarBookmark = Gtk::make_managed<navbar::Bookmark>();
append(
* navbarBookmark
);
// Init actions group
auto GioSimpleActionGroup = Gio::SimpleActionGroup::create();
// Define group actions
GioSimpleActionGroup->add_action(
"refresh",
[this]
{
refresh();
}
);
insert_action_group(
"navbar",
GioSimpleActionGroup
);
}
// Actions
void Navbar::history_back()
{
navbar::History::Memory match;
if (navbarHistory->try_back(match))
{
navbarRequest->set_text(
match.request
);
navbarUpdate->activate();
}
}
void Navbar::history_forward()
{
navbar::History::Memory match;
if (navbarHistory->try_forward(match))
{
navbarRequest->set_text(
match.request
);
navbarUpdate->activate();
}
}
void Navbar::history_add(
const Glib::ustring & VALUE
) {
navbarHistory->add(
VALUE
);
}
void Navbar::refresh()
{
// Toggle base button sensibility
navbarBase->set_sensitive(
!navbarRequest->get_host().empty() && !navbarRequest->get_path().empty()
);
// Toggle update button sensibility
navbarUpdate->set_sensitive(
navbarRequest->get_text_length() > 0
);
// Refresh history widget
navbarHistory->refresh();
}
// Setters @TODO is really wanted?
void Navbar::set_request_text(
const Glib::ustring & VALUE
) {
navbarRequest->set_text(
VALUE
);
// refresh(); not wanted as on change listener do same @TODO
}
// Getters @TODO &
Glib::ustring Navbar::get_request_text()
{
return navbarRequest->get_text();
}
Glib::ustring Navbar::get_request_scheme()
{
return navbarRequest->get_scheme();
}
Glib::ustring Navbar::get_request_host()
{
return navbarRequest->get_host();
}
Glib::ustring Navbar::get_request_path()
{
return navbarRequest->get_path();
}
Glib::ustring Navbar::get_request_query()
{
return navbarRequest->get_query();
}
Glib::ustring Navbar::get_request_port()
{
return navbarRequest->get_port();
}

19
src/app/browser/main/tab/page/navbar/base.hpp

@ -1,19 +0,0 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BASE_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BASE_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navbar
{
class Base : public Gtk::Button
{
public:
Base();
~Base();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BASE_HPP

19
src/app/browser/main/tab/page/navbar/bookmark.hpp

@ -1,19 +0,0 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BOOKMARK_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BOOKMARK_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navbar
{
class Bookmark : public Gtk::Button
{
public:
Bookmark();
~Bookmark();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BOOKMARK_HPP

19
src/app/browser/main/tab/page/navbar/history/back.hpp

@ -1,19 +0,0 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_BACK_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_BACK_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navbar::history
{
class Back : public Gtk::Button
{
public:
Back();
~Back();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_BACK_HPP

19
src/app/browser/main/tab/page/navbar/history/forward.hpp

@ -1,19 +0,0 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_FORWARD_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_FORWARD_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navbar::history
{
class Forward : public Gtk::Button
{
public:
Forward();
~Forward();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_FORWARD_HPP

17
src/app/browser/main/tab/page/navbar/update.hpp

@ -1,17 +0,0 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_UPDATE_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_UPDATE_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navbar
{
class Update : public Gtk::Button
{
public:
Update();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_UPDATE_HPP

182
src/app/browser/main/tab/page/navigation.cpp

@ -0,0 +1,182 @@
#include "navigation.hpp"
#include "navigation/base.hpp"
#include "navigation/bookmark.hpp"
#include "navigation/history.hpp"
#include "navigation/request.hpp"
#include "navigation/update.hpp"
using namespace app::browser::main::tab::page;
Navigation::Navigation(
const Glib::ustring & REQUEST
) {
// Init container
set_orientation(
Gtk::Orientation::HORIZONTAL
);
set_spacing(
SPACING
);
set_margin_top(
MARGIN
);
set_margin_start(
MARGIN
);
set_margin_end(
MARGIN
);
set_margin_bottom(
MARGIN
);
// Init components
navigationBase = Gtk::make_managed<navigation::Base>();
append(
* navigationBase
);
navigationHistory = Gtk::make_managed<navigation::History>();
append(
* navigationHistory
);
navigationUpdate = Gtk::make_managed<navigation::Update>();
append(
* navigationUpdate
);
navigationRequest = Gtk::make_managed<navigation::Request>(
REQUEST
);
append(
* navigationRequest
);
navigationBookmark = Gtk::make_managed<navigation::Bookmark>();
append(
* navigationBookmark
);
// Init actions group
auto GioSimpleActionGroup = Gio::SimpleActionGroup::create();
// Define group actions
GioSimpleActionGroup->add_action(
"refresh",
[this]
{
refresh();
}
);
insert_action_group(
"navigation",
GioSimpleActionGroup
);
}
// Actions
void Navigation::history_back()
{
navigation::History::Memory match;
if (navigationHistory->try_back(match))
{
navigationRequest->set_text(
match.request
);
navigationUpdate->activate();
}
}
void Navigation::history_forward()
{
navigation::History::Memory match;
if (navigationHistory->try_forward(match))
{
navigationRequest->set_text(
match.request
);
navigationUpdate->activate();
}
}
void Navigation::history_add(
const Glib::ustring & VALUE
) {
navigationHistory->add(
VALUE
);
}
void Navigation::refresh()
{
// Toggle base button sensibility
navigationBase->set_sensitive(
!navigationRequest->get_host().empty() && !navigationRequest->get_path().empty()
);
// Toggle update button sensibility
navigationUpdate->set_sensitive(
navigationRequest->get_text_length() > 0
);
// Refresh history widget
navigationHistory->refresh();
}
// Setters @TODO is really wanted?
void Navigation::set_request_text(
const Glib::ustring & VALUE
) {
navigationRequest->set_text(
VALUE
);
// refresh(); not wanted as on change listener do same @TODO
}
// Getters @TODO &
Glib::ustring Navigation::get_request_text()
{
return navigationRequest->get_text();
}
Glib::ustring Navigation::get_request_scheme()
{
return navigationRequest->get_scheme();
}
Glib::ustring Navigation::get_request_host()
{
return navigationRequest->get_host();
}
Glib::ustring Navigation::get_request_path()
{
return navigationRequest->get_path();
}
Glib::ustring Navigation::get_request_query()
{
return navigationRequest->get_query();
}
Glib::ustring Navigation::get_request_port()
{
return navigationRequest->get_port();
}

22
src/app/browser/main/tab/page/navbar.hpp → src/app/browser/main/tab/page/navigation.hpp

@ -1,5 +1,5 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HPP #ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HPP #define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP
#include <giomm/simpleactiongroup.h> #include <giomm/simpleactiongroup.h>
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
@ -8,7 +8,7 @@
namespace app::browser::main::tab::page namespace app::browser::main::tab::page
{ {
namespace navbar namespace navigation
{ {
class Base; class Base;
class Bookmark; class Bookmark;
@ -17,14 +17,14 @@ namespace app::browser::main::tab::page
class Request; class Request;
} }
class Navbar : public Gtk::Box class Navigation : public Gtk::Box
{ {
// Components // Components
navbar::Base * navbarBase; navigation::Base * navigationBase;
navbar::Bookmark * navbarBookmark; navigation::Bookmark * navigationBookmark;
navbar::History * navbarHistory; navigation::History * navigationHistory;
navbar::Request * navbarRequest; navigation::Request * navigationRequest;
navbar::Update * navbarUpdate; navigation::Update * navigationUpdate;
// Defaults // Defaults
const int SPACING = 8; const int SPACING = 8;
@ -32,7 +32,7 @@ namespace app::browser::main::tab::page
public: public:
Navbar( Navigation(
const Glib::ustring & REQUEST const Glib::ustring & REQUEST
); );
@ -63,4 +63,4 @@ namespace app::browser::main::tab::page
}; };
} }
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HPP #endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP

2
src/app/browser/main/tab/page/navbar/base.cpp → src/app/browser/main/tab/page/navigation/base.cpp

@ -1,6 +1,6 @@
#include "base.hpp" #include "base.hpp"
using namespace app::browser::main::tab::page::navbar; using namespace app::browser::main::tab::page::navigation;
Base::Base() Base::Base()
{ {

19
src/app/browser/main/tab/page/navigation/base.hpp

@ -0,0 +1,19 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_BASE_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_BASE_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navigation
{
class Base : public Gtk::Button
{
public:
Base();
~Base();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_BASE_HPP

2
src/app/browser/main/tab/page/navbar/bookmark.cpp → src/app/browser/main/tab/page/navigation/bookmark.cpp

@ -1,6 +1,6 @@
#include "bookmark.hpp" #include "bookmark.hpp"
using namespace app::browser::main::tab::page::navbar; using namespace app::browser::main::tab::page::navigation;
Bookmark::Bookmark() Bookmark::Bookmark()
{ {

19
src/app/browser/main/tab/page/navigation/bookmark.hpp

@ -0,0 +1,19 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_BOOKMARK_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_BOOKMARK_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navigation
{
class Bookmark : public Gtk::Button
{
public:
Bookmark();
~Bookmark();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_BOOKMARK_HPP

2
src/app/browser/main/tab/page/navbar/history.cpp → src/app/browser/main/tab/page/navigation/history.cpp

@ -2,7 +2,7 @@
#include "history/back.hpp" #include "history/back.hpp"
#include "history/forward.hpp" #include "history/forward.hpp"
using namespace app::browser::main::tab::page::navbar; using namespace app::browser::main::tab::page::navigation;
History::History() History::History()
{ {

8
src/app/browser/main/tab/page/navbar/history.hpp → src/app/browser/main/tab/page/navigation/history.hpp

@ -1,5 +1,5 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_HPP #ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_HPP #define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP
#include <ctime> #include <ctime>
#include <glibmm/i18n.h> #include <glibmm/i18n.h>
@ -8,7 +8,7 @@
#include <gtkmm/object.h> #include <gtkmm/object.h>
#include <vector> #include <vector>
namespace app::browser::main::tab::page::navbar namespace app::browser::main::tab::page::navigation
{ {
namespace history namespace history
{ {
@ -61,4 +61,4 @@ namespace app::browser::main::tab::page::navbar
}; };
} }
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_HPP #endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP

2
src/app/browser/main/tab/page/navbar/history/back.cpp → src/app/browser/main/tab/page/navigation/history/back.cpp

@ -1,6 +1,6 @@
#include "back.hpp" #include "back.hpp"
using namespace app::browser::main::tab::page::navbar::history; using namespace app::browser::main::tab::page::navigation::history;
Back::Back() Back::Back()
{ {

19
src/app/browser/main/tab/page/navigation/history/back.hpp

@ -0,0 +1,19 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navigation::history
{
class Back : public Gtk::Button
{
public:
Back();
~Back();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK_HPP

2
src/app/browser/main/tab/page/navbar/history/forward.cpp → src/app/browser/main/tab/page/navigation/history/forward.cpp

@ -1,6 +1,6 @@
#include "forward.hpp" #include "forward.hpp"
using namespace app::browser::main::tab::page::navbar::history; using namespace app::browser::main::tab::page::navigation::history;
Forward::Forward() Forward::Forward()
{ {

19
src/app/browser/main/tab/page/navigation/history/forward.hpp

@ -0,0 +1,19 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navigation::history
{
class Forward : public Gtk::Button
{
public:
Forward();
~Forward();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD_HPP

4
src/app/browser/main/tab/page/navbar/request.cpp → src/app/browser/main/tab/page/navigation/request.cpp

@ -1,6 +1,6 @@
#include "request.hpp" #include "request.hpp"
using namespace app::browser::main::tab::page::navbar; using namespace app::browser::main::tab::page::navigation;
// Construct // Construct
Request::Request( Request::Request(
@ -31,7 +31,7 @@ Request::Request(
parse(); parse();
activate_action( activate_action(
"navbar.refresh" "navigation.refresh"
); );
} }
); );

8
src/app/browser/main/tab/page/navbar/request.hpp → src/app/browser/main/tab/page/navigation/request.hpp

@ -1,12 +1,12 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_REQUEST_HPP #ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_REQUEST_HPP #define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP
#include <glibmm/i18n.h> #include <glibmm/i18n.h>
#include <glibmm/regex.h> #include <glibmm/regex.h>
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
#include <gtkmm/entry.h> #include <gtkmm/entry.h>
namespace app::browser::main::tab::page::navbar namespace app::browser::main::tab::page::navigation
{ {
class Request : public Gtk::Entry class Request : public Gtk::Entry
{ {
@ -34,4 +34,4 @@ namespace app::browser::main::tab::page::navbar
}; };
} }
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_REQUEST_HPP #endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP

2
src/app/browser/main/tab/page/navbar/update.cpp → src/app/browser/main/tab/page/navigation/update.cpp

@ -1,6 +1,6 @@
#include "update.hpp" #include "update.hpp"
using namespace app::browser::main::tab::page::navbar; using namespace app::browser::main::tab::page::navigation;
Update::Update() Update::Update()
{ {

17
src/app/browser/main/tab/page/navigation/update.hpp

@ -0,0 +1,17 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_UPDATE_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_UPDATE_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navigation
{
class Update : public Gtk::Button
{
public:
Update();
};
}
#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_UPDATE_HPP

6
src/app/browser/main/tab/page/progressbar.cpp → src/app/browser/main/tab/page/progress.cpp

@ -1,8 +1,8 @@
#include "progressbar.hpp" #include "progress.hpp"
using namespace app::browser::main::tab::page; using namespace app::browser::main::tab::page;
Progressbar::Progressbar() Progress::Progress()
{ {
set_margin_top( set_margin_top(
MARGIN MARGIN
@ -20,7 +20,7 @@ Progressbar::Progressbar()
} }
// Public actions // Public actions
void Progressbar::refresh( void Progress::refresh(
double fraction double fraction
) { ) {
// Toggle transparency // Toggle transparency

10
src/app/browser/main/tab/page/progressbar.hpp → src/app/browser/main/tab/page/progress.hpp

@ -1,12 +1,12 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_PROGRESSBAR_HPP #ifndef APP_BROWSER_MAIN_TAB_PAGE_PROGRESS_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_PROGRESSBAR_HPP #define APP_BROWSER_MAIN_TAB_PAGE_PROGRESS_HPP
#include <glibmm/main.h> #include <glibmm/main.h>
#include <gtkmm/progressbar.h> #include <gtkmm/progressbar.h>
namespace app::browser::main::tab::page namespace app::browser::main::tab::page
{ {
class Progressbar : public Gtk::ProgressBar class Progress : public Gtk::ProgressBar
{ {
const int MARGIN = 2; const int MARGIN = 2;
const double PULSE_STEP = .1; const double PULSE_STEP = .1;
@ -16,7 +16,7 @@ namespace app::browser::main::tab::page
public: public:
Progressbar(); Progress();
void refresh( void refresh(
double fraction double fraction
@ -24,4 +24,4 @@ namespace app::browser::main::tab::page
}; };
} }
#endif // APP_BROWSER_MAIN_TAB_PAGE_PROGRESSBAR_HPP #endif // APP_BROWSER_MAIN_TAB_PAGE_PROGRESS_HPP
Loading…
Cancel
Save