diff --git a/Makefile b/Makefile index e8eece17..e0545baa 100644 --- a/Makefile +++ b/Makefile @@ -19,15 +19,15 @@ SRCS = src/main.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/plain.cpp\ - src/app/browser/main/tab/page/navbar.cpp\ - src/app/browser/main/tab/page/navbar/base.cpp\ - src/app/browser/main/tab/page/navbar/bookmark.cpp\ - src/app/browser/main/tab/page/navbar/history.cpp\ - src/app/browser/main/tab/page/navbar/history/back.cpp\ - src/app/browser/main/tab/page/navbar/history/forward.cpp\ - src/app/browser/main/tab/page/navbar/request.cpp\ - src/app/browser/main/tab/page/navbar/update.cpp\ - src/app/browser/main/tab/page/progressbar.cpp\ + src/app/browser/main/tab/page/navigation.cpp\ + src/app/browser/main/tab/page/navigation/base.cpp\ + src/app/browser/main/tab/page/navigation/bookmark.cpp\ + src/app/browser/main/tab/page/navigation/history.cpp\ + src/app/browser/main/tab/page/navigation/history/back.cpp\ + src/app/browser/main/tab/page/navigation/history/forward.cpp\ + src/app/browser/main/tab/page/navigation/request.cpp\ + src/app/browser/main/tab/page/navigation/update.cpp\ + src/app/browser/main/tab/page/progress.cpp\ src/app/browser/main/tab/label.cpp\ src/lib/database.cpp\ src/lib/database/session.cpp diff --git a/po/POTFILES.in b/po/POTFILES.in index 00efafd2..6ce04a21 100644 --- a/po/POTFILES.in +++ b/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/text/gemini.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/navbar/base.cpp -src/app/browser/main/tab/page/navbar/bookmark.cpp -src/app/browser/main/tab/page/navbar/history.cpp -src/app/browser/main/tab/page/navbar/history/back.cpp -src/app/browser/main/tab/page/navbar/history/forward.cpp -src/app/browser/main/tab/page/navbar/request.cpp -src/app/browser/main/tab/page/navbar/update.cpp -src/app/browser/main/tab/page/progressbar.cpp +src/app/browser/main/tab/page/navigation.cpp +src/app/browser/main/tab/page/navigation/base.cpp +src/app/browser/main/tab/page/navigation/bookmark.cpp +src/app/browser/main/tab/page/navigation/history.cpp +src/app/browser/main/tab/page/navigation/history/back.cpp +src/app/browser/main/tab/page/navigation/history/forward.cpp +src/app/browser/main/tab/page/navigation/request.cpp +src/app/browser/main/tab/page/navigation/update.cpp +src/app/browser/main/tab/page/progress.cpp src/app/browser/main/tab/label.cpp src/lib/database.cpp src/lib/database/session.cpp diff --git a/src/app/browser/main/tab/page.cpp b/src/app/browser/main/tab/page.cpp index 7e453258..b8ac416f 100644 --- a/src/app/browser/main/tab/page.cpp +++ b/src/app/browser/main/tab/page.cpp @@ -1,7 +1,7 @@ #include "page.hpp" #include "page/content.hpp" -#include "page/navbar.hpp" -#include "page/progressbar.hpp" +#include "page/navigation.hpp" +#include "page/progress.hpp" using namespace app::browser::main::tab; @@ -33,18 +33,18 @@ Page::Page( ); // Init components - pageNavbar = Gtk::make_managed( + pageNavigation = Gtk::make_managed( REQUEST ); append( - * pageNavbar + * pageNavigation ); - pageProgressbar = Gtk::make_managed(); + pageProgress = Gtk::make_managed(); append( - * pageProgressbar + * pageProgress ); pageContent = Gtk::make_managed(); @@ -75,12 +75,12 @@ Glib::ustring Page::get_subtitle() // Actions void Page::back() { - pageNavbar->history_back(); + pageNavigation->history_back(); } void Page::forward() { - pageNavbar->history_forward(); + pageNavigation->history_forward(); } void Page::refresh( @@ -92,7 +92,7 @@ void Page::refresh( subtitle = SUBTITLE; - pageProgressbar->refresh( + pageProgress->refresh( PROGRESS ); @@ -107,27 +107,27 @@ void Page::update( // Update navigation history if (HISTORY) { - pageNavbar->history_add( - pageNavbar->get_request_text() + pageNavigation->history_add( + pageNavigation->get_request_text() ); } // Update page extras refresh( - pageNavbar->get_request_host(), + pageNavigation->get_request_host(), Glib::ustring::sprintf( _("load %s.."), - pageNavbar->get_request_text() + pageNavigation->get_request_text() ), 0 ); // Connect scheme driver - if ("file" == pageNavbar->get_request_scheme()) + if ("file" == pageNavigation->get_request_scheme()) { // @TODO } - else if ("gemini" == pageNavbar->get_request_scheme()) + else if ("gemini" == pageNavigation->get_request_scheme()) { // Create new socket connection GioSocketClient = Gio::SocketClient::create(); @@ -145,14 +145,14 @@ void Page::update( ); GioSocketClient->connect_to_uri_async( - pageNavbar->get_request_text(), 1965, + pageNavigation->get_request_text(), 1965, [this](const Glib::RefPtr & result) { refresh( - pageNavbar->get_request_host(), + pageNavigation->get_request_host(), Glib::ustring::sprintf( _("connect %s.."), - pageNavbar->get_request_host() + pageNavigation->get_request_host() ), .25 ); @@ -166,7 +166,7 @@ void Page::update( catch (const Glib::Error & EXCEPTION) { refresh( - pageNavbar->get_request_host(), + pageNavigation->get_request_host(), EXCEPTION.what(), 1 ); } @@ -174,7 +174,7 @@ void Page::update( // Connection established, begin request 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( request.data(), @@ -182,11 +182,11 @@ void Page::update( [this](const Glib::RefPtr & result) { refresh( - pageNavbar->get_request_host(), + pageNavigation->get_request_host(), Glib::ustring::sprintf( _("request %s.."), - pageNavbar->get_request_path().empty() ? pageNavbar->get_request_host() - : pageNavbar->get_request_path() + pageNavigation->get_request_path().empty() ? pageNavigation->get_request_host() + : pageNavigation->get_request_path() ), .5 ); @@ -197,11 +197,11 @@ void Page::update( [this](const Glib::RefPtr & result) { refresh( - pageNavbar->get_request_host(), + pageNavigation->get_request_host(), Glib::ustring::sprintf( _("reading %s.."), - pageNavbar->get_request_path().empty() ? pageNavbar->get_request_host() - : pageNavbar->get_request_path() + pageNavigation->get_request_path().empty() ? pageNavigation->get_request_host() + : pageNavigation->get_request_path() ), .75 ); @@ -215,7 +215,7 @@ void Page::update( if (meta[1] == "20") { // 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( buffer // @TODO @@ -240,9 +240,9 @@ void Page::update( GioSocketConnection->close(); refresh( - pageNavbar->get_request_host(), // @TODO title - pageNavbar->get_request_path().empty() ? pageNavbar->get_request_host() - : pageNavbar->get_request_path() + pageNavigation->get_request_host(), // @TODO title + pageNavigation->get_request_path().empty() ? pageNavigation->get_request_host() + : pageNavigation->get_request_path() , 1 ); } @@ -255,10 +255,10 @@ void Page::update( } // 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( - "gemini://" + pageNavbar->get_request_text() + pageNavigation->set_request_text( + "gemini://" + pageNavigation->get_request_text() ); update(); diff --git a/src/app/browser/main/tab/page.hpp b/src/app/browser/main/tab/page.hpp index 7f2478af..c7ba0e14 100644 --- a/src/app/browser/main/tab/page.hpp +++ b/src/app/browser/main/tab/page.hpp @@ -20,8 +20,8 @@ namespace app::browser::main::tab namespace page { class Content; - class Navbar; - class Progressbar; + class Navigation; + class Progress; } class Page : public Gtk::Box @@ -38,8 +38,8 @@ namespace app::browser::main::tab // Components page::Content * pageContent; - page::Navbar * pageNavbar; - page::Progressbar * pageProgressbar; + page::Navigation * pageNavigation; + page::Progress * pageProgress; public: diff --git a/src/app/browser/main/tab/page/navbar.cpp b/src/app/browser/main/tab/page/navbar.cpp deleted file mode 100644 index d859062f..00000000 --- a/src/app/browser/main/tab/page/navbar.cpp +++ /dev/null @@ -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(); - - append( - * navbarBase - ); - - navbarHistory = Gtk::make_managed(); - - append( - * navbarHistory - ); - - navbarUpdate = Gtk::make_managed(); - - append( - * navbarUpdate - ); - - navbarRequest = Gtk::make_managed( - REQUEST - ); - - append( - * navbarRequest - ); - - navbarBookmark = Gtk::make_managed(); - - 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(); -} \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/base.hpp b/src/app/browser/main/tab/page/navbar/base.hpp deleted file mode 100644 index 6944b717..00000000 --- a/src/app/browser/main/tab/page/navbar/base.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BASE_HPP -#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BASE_HPP - -#include -#include - -namespace app::browser::main::tab::page::navbar -{ - class Base : public Gtk::Button - { - public: - - Base(); - - ~Base(); - }; -} - -#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BASE_HPP \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/bookmark.hpp b/src/app/browser/main/tab/page/navbar/bookmark.hpp deleted file mode 100644 index 59e3e7ca..00000000 --- a/src/app/browser/main/tab/page/navbar/bookmark.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BOOKMARK_HPP -#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BOOKMARK_HPP - -#include -#include - -namespace app::browser::main::tab::page::navbar -{ - class Bookmark : public Gtk::Button - { - public: - - Bookmark(); - - ~Bookmark(); - }; -} - -#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_BOOKMARK_HPP \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/history/back.hpp b/src/app/browser/main/tab/page/navbar/history/back.hpp deleted file mode 100644 index 1f36aad0..00000000 --- a/src/app/browser/main/tab/page/navbar/history/back.hpp +++ /dev/null @@ -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 -#include - -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 \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/history/forward.hpp b/src/app/browser/main/tab/page/navbar/history/forward.hpp deleted file mode 100644 index 4ea4f2da..00000000 --- a/src/app/browser/main/tab/page/navbar/history/forward.hpp +++ /dev/null @@ -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 -#include - -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 \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/update.hpp b/src/app/browser/main/tab/page/navbar/update.hpp deleted file mode 100644 index 94d59bad..00000000 --- a/src/app/browser/main/tab/page/navbar/update.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_UPDATE_HPP -#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_UPDATE_HPP - -#include -#include - -namespace app::browser::main::tab::page::navbar -{ - class Update : public Gtk::Button - { - public: - - Update(); - }; -} - -#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_UPDATE_HPP \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navigation.cpp b/src/app/browser/main/tab/page/navigation.cpp new file mode 100644 index 00000000..5f233236 --- /dev/null +++ b/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(); + + append( + * navigationBase + ); + + navigationHistory = Gtk::make_managed(); + + append( + * navigationHistory + ); + + navigationUpdate = Gtk::make_managed(); + + append( + * navigationUpdate + ); + + navigationRequest = Gtk::make_managed( + REQUEST + ); + + append( + * navigationRequest + ); + + navigationBookmark = Gtk::make_managed(); + + 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(); +} \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar.hpp b/src/app/browser/main/tab/page/navigation.hpp similarity index 70% rename from src/app/browser/main/tab/page/navbar.hpp rename to src/app/browser/main/tab/page/navigation.hpp index 88f063b1..7d77df44 100644 --- a/src/app/browser/main/tab/page/navbar.hpp +++ b/src/app/browser/main/tab/page/navigation.hpp @@ -1,5 +1,5 @@ -#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HPP -#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HPP +#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP +#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP #include #include @@ -8,7 +8,7 @@ namespace app::browser::main::tab::page { - namespace navbar + namespace navigation { class Base; class Bookmark; @@ -17,14 +17,14 @@ namespace app::browser::main::tab::page class Request; } - class Navbar : public Gtk::Box + class Navigation : public Gtk::Box { // Components - navbar::Base * navbarBase; - navbar::Bookmark * navbarBookmark; - navbar::History * navbarHistory; - navbar::Request * navbarRequest; - navbar::Update * navbarUpdate; + navigation::Base * navigationBase; + navigation::Bookmark * navigationBookmark; + navigation::History * navigationHistory; + navigation::Request * navigationRequest; + navigation::Update * navigationUpdate; // Defaults const int SPACING = 8; @@ -32,7 +32,7 @@ namespace app::browser::main::tab::page public: - Navbar( + Navigation( const Glib::ustring & REQUEST ); @@ -63,4 +63,4 @@ namespace app::browser::main::tab::page }; } -#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HPP \ No newline at end of file +#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/base.cpp b/src/app/browser/main/tab/page/navigation/base.cpp similarity index 78% rename from src/app/browser/main/tab/page/navbar/base.cpp rename to src/app/browser/main/tab/page/navigation/base.cpp index 885973ef..3a5f30cb 100644 --- a/src/app/browser/main/tab/page/navbar/base.cpp +++ b/src/app/browser/main/tab/page/navigation/base.cpp @@ -1,6 +1,6 @@ #include "base.hpp" -using namespace app::browser::main::tab::page::navbar; +using namespace app::browser::main::tab::page::navigation; Base::Base() { diff --git a/src/app/browser/main/tab/page/navigation/base.hpp b/src/app/browser/main/tab/page/navigation/base.hpp new file mode 100644 index 00000000..24efac73 --- /dev/null +++ b/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 +#include + +namespace app::browser::main::tab::page::navigation +{ + class Base : public Gtk::Button + { + public: + + Base(); + + ~Base(); + }; +} + +#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_BASE_HPP \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/bookmark.cpp b/src/app/browser/main/tab/page/navigation/bookmark.cpp similarity index 82% rename from src/app/browser/main/tab/page/navbar/bookmark.cpp rename to src/app/browser/main/tab/page/navigation/bookmark.cpp index e3b40a62..521f2598 100644 --- a/src/app/browser/main/tab/page/navbar/bookmark.cpp +++ b/src/app/browser/main/tab/page/navigation/bookmark.cpp @@ -1,6 +1,6 @@ #include "bookmark.hpp" -using namespace app::browser::main::tab::page::navbar; +using namespace app::browser::main::tab::page::navigation; Bookmark::Bookmark() { diff --git a/src/app/browser/main/tab/page/navigation/bookmark.hpp b/src/app/browser/main/tab/page/navigation/bookmark.hpp new file mode 100644 index 00000000..2fbee63b --- /dev/null +++ b/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 +#include + +namespace app::browser::main::tab::page::navigation +{ + class Bookmark : public Gtk::Button + { + public: + + Bookmark(); + + ~Bookmark(); + }; +} + +#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_BOOKMARK_HPP \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/history.cpp b/src/app/browser/main/tab/page/navigation/history.cpp similarity index 96% rename from src/app/browser/main/tab/page/navbar/history.cpp rename to src/app/browser/main/tab/page/navigation/history.cpp index 02992170..4190f814 100644 --- a/src/app/browser/main/tab/page/navbar/history.cpp +++ b/src/app/browser/main/tab/page/navigation/history.cpp @@ -2,7 +2,7 @@ #include "history/back.hpp" #include "history/forward.hpp" -using namespace app::browser::main::tab::page::navbar; +using namespace app::browser::main::tab::page::navigation; History::History() { diff --git a/src/app/browser/main/tab/page/navbar/history.hpp b/src/app/browser/main/tab/page/navigation/history.hpp similarity index 85% rename from src/app/browser/main/tab/page/navbar/history.hpp rename to src/app/browser/main/tab/page/navigation/history.hpp index f6a27f02..53912578 100644 --- a/src/app/browser/main/tab/page/navbar/history.hpp +++ b/src/app/browser/main/tab/page/navigation/history.hpp @@ -1,5 +1,5 @@ -#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_HPP -#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_HPP +#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP +#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP #include #include @@ -8,7 +8,7 @@ #include #include -namespace app::browser::main::tab::page::navbar +namespace app::browser::main::tab::page::navigation { namespace history { @@ -61,4 +61,4 @@ namespace app::browser::main::tab::page::navbar }; } -#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_HISTORY_HPP \ No newline at end of file +#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/history/back.cpp b/src/app/browser/main/tab/page/navigation/history/back.cpp similarity index 87% rename from src/app/browser/main/tab/page/navbar/history/back.cpp rename to src/app/browser/main/tab/page/navigation/history/back.cpp index b2b2923d..4452ce1d 100644 --- a/src/app/browser/main/tab/page/navbar/history/back.cpp +++ b/src/app/browser/main/tab/page/navigation/history/back.cpp @@ -1,6 +1,6 @@ #include "back.hpp" -using namespace app::browser::main::tab::page::navbar::history; +using namespace app::browser::main::tab::page::navigation::history; Back::Back() { diff --git a/src/app/browser/main/tab/page/navigation/history/back.hpp b/src/app/browser/main/tab/page/navigation/history/back.hpp new file mode 100644 index 00000000..9a65ac7c --- /dev/null +++ b/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 +#include + +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 \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/history/forward.cpp b/src/app/browser/main/tab/page/navigation/history/forward.cpp similarity index 87% rename from src/app/browser/main/tab/page/navbar/history/forward.cpp rename to src/app/browser/main/tab/page/navigation/history/forward.cpp index 9cb930df..c86fec77 100644 --- a/src/app/browser/main/tab/page/navbar/history/forward.cpp +++ b/src/app/browser/main/tab/page/navigation/history/forward.cpp @@ -1,6 +1,6 @@ #include "forward.hpp" -using namespace app::browser::main::tab::page::navbar::history; +using namespace app::browser::main::tab::page::navigation::history; Forward::Forward() { diff --git a/src/app/browser/main/tab/page/navigation/history/forward.hpp b/src/app/browser/main/tab/page/navigation/history/forward.hpp new file mode 100644 index 00000000..2bb82657 --- /dev/null +++ b/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 +#include + +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 \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/request.cpp b/src/app/browser/main/tab/page/navigation/request.cpp similarity index 94% rename from src/app/browser/main/tab/page/navbar/request.cpp rename to src/app/browser/main/tab/page/navigation/request.cpp index 5269fc2a..721563fc 100644 --- a/src/app/browser/main/tab/page/navbar/request.cpp +++ b/src/app/browser/main/tab/page/navigation/request.cpp @@ -1,6 +1,6 @@ #include "request.hpp" -using namespace app::browser::main::tab::page::navbar; +using namespace app::browser::main::tab::page::navigation; // Construct Request::Request( @@ -31,7 +31,7 @@ Request::Request( parse(); activate_action( - "navbar.refresh" + "navigation.refresh" ); } ); diff --git a/src/app/browser/main/tab/page/navbar/request.hpp b/src/app/browser/main/tab/page/navigation/request.hpp similarity index 74% rename from src/app/browser/main/tab/page/navbar/request.hpp rename to src/app/browser/main/tab/page/navigation/request.hpp index c9973e0c..827de312 100644 --- a/src/app/browser/main/tab/page/navbar/request.hpp +++ b/src/app/browser/main/tab/page/navigation/request.hpp @@ -1,12 +1,12 @@ -#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_REQUEST_HPP -#define APP_BROWSER_MAIN_TAB_PAGE_NAVBAR_REQUEST_HPP +#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP +#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP #include #include #include #include -namespace app::browser::main::tab::page::navbar +namespace app::browser::main::tab::page::navigation { 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 \ No newline at end of file +#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP \ No newline at end of file diff --git a/src/app/browser/main/tab/page/navbar/update.cpp b/src/app/browser/main/tab/page/navigation/update.cpp similarity index 77% rename from src/app/browser/main/tab/page/navbar/update.cpp rename to src/app/browser/main/tab/page/navigation/update.cpp index 45da7920..c8cf4d6a 100644 --- a/src/app/browser/main/tab/page/navbar/update.cpp +++ b/src/app/browser/main/tab/page/navigation/update.cpp @@ -1,6 +1,6 @@ #include "update.hpp" -using namespace app::browser::main::tab::page::navbar; +using namespace app::browser::main::tab::page::navigation; Update::Update() { diff --git a/src/app/browser/main/tab/page/navigation/update.hpp b/src/app/browser/main/tab/page/navigation/update.hpp new file mode 100644 index 00000000..599c7ed8 --- /dev/null +++ b/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 +#include + +namespace app::browser::main::tab::page::navigation +{ + class Update : public Gtk::Button + { + public: + + Update(); + }; +} + +#endif // APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_UPDATE_HPP \ No newline at end of file diff --git a/src/app/browser/main/tab/page/progressbar.cpp b/src/app/browser/main/tab/page/progress.cpp similarity index 90% rename from src/app/browser/main/tab/page/progressbar.cpp rename to src/app/browser/main/tab/page/progress.cpp index 97419ef1..fb8bb15d 100644 --- a/src/app/browser/main/tab/page/progressbar.cpp +++ b/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; -Progressbar::Progressbar() +Progress::Progress() { set_margin_top( MARGIN @@ -20,7 +20,7 @@ Progressbar::Progressbar() } // Public actions -void Progressbar::refresh( +void Progress::refresh( double fraction ) { // Toggle transparency diff --git a/src/app/browser/main/tab/page/progressbar.hpp b/src/app/browser/main/tab/page/progress.hpp similarity index 60% rename from src/app/browser/main/tab/page/progressbar.hpp rename to src/app/browser/main/tab/page/progress.hpp index 9fc9c228..de8a166d 100644 --- a/src/app/browser/main/tab/page/progressbar.hpp +++ b/src/app/browser/main/tab/page/progress.hpp @@ -1,12 +1,12 @@ -#ifndef APP_BROWSER_MAIN_TAB_PAGE_PROGRESSBAR_HPP -#define APP_BROWSER_MAIN_TAB_PAGE_PROGRESSBAR_HPP +#ifndef APP_BROWSER_MAIN_TAB_PAGE_PROGRESS_HPP +#define APP_BROWSER_MAIN_TAB_PAGE_PROGRESS_HPP #include #include namespace app::browser::main::tab::page { - class Progressbar : public Gtk::ProgressBar + class Progress : public Gtk::ProgressBar { const int MARGIN = 2; const double PULSE_STEP = .1; @@ -16,7 +16,7 @@ namespace app::browser::main::tab::page public: - Progressbar(); + Progress(); void refresh( double fraction @@ -24,4 +24,4 @@ namespace app::browser::main::tab::page }; } -#endif // APP_BROWSER_MAIN_TAB_PAGE_PROGRESSBAR_HPP \ No newline at end of file +#endif // APP_BROWSER_MAIN_TAB_PAGE_PROGRESS_HPP \ No newline at end of file