diff --git a/src/Entity/Browser/Container.php b/src/Entity/Browser/Container.php index 2de5d522..c057cdb9 100644 --- a/src/Entity/Browser/Container.php +++ b/src/Entity/Browser/Container.php @@ -4,20 +4,20 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser; -use \Yggverse\Yoda\Entity\Browser\Container\Tab; +use \Yggverse\Yoda\Entity\Browser; class Container { public \GtkBox $gtk; // Dependencies - public \Yggverse\Yoda\Entity\Browser $browser; + public Browser $browser; // Requirements - public \Yggverse\Yoda\Entity\Browser\Container\Tab $tab; + public Container\Tab $tab; public function __construct( - \Yggverse\Yoda\Entity\Browser $browser + Browser $browser ) { // Init dependency $this->browser = $browser; @@ -28,7 +28,7 @@ class Container ); // Init tab - $this->tab = new Tab( + $this->tab = new Container\Tab( $this ); diff --git a/src/Entity/Browser/Container/Page.php b/src/Entity/Browser/Container/Page.php index f5379681..a73d9eac 100644 --- a/src/Entity/Browser/Container/Page.php +++ b/src/Entity/Browser/Container/Page.php @@ -6,12 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\Container; use \Yggverse\Yoda\Entity\Browser\Container; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Title; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Progressbar; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Content; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Response; - use \Yggverse\Yoda\Model\Connection; use \Yggverse\Yoda\Model\Filesystem; @@ -23,11 +17,11 @@ class Page public Container $container; // Requirements - public Title $title; - public Navbar $navbar; - public Progressbar $progressbar; - public Content $content; - public Response $response; + public Page\Title $title; + public Page\Navbar $navbar; + public Page\Progressbar $progressbar; + public Page\Content $content; + public Page\Response $response; public function __construct( Container $container @@ -41,12 +35,12 @@ class Page ); // Init title - $this->title = new Title( + $this->title = new Page\Title( $this ); // Init navbar - $this->navbar = new Navbar( + $this->navbar = new Page\Navbar( $this ); @@ -55,7 +49,7 @@ class Page ); // Init content - $this->content = new Content( + $this->content = new Page\Content( $this ); @@ -67,7 +61,7 @@ class Page ); // Init progress bar - $this->progressbar = new Progressbar( + $this->progressbar = new Page\Progressbar( $this ); @@ -76,7 +70,7 @@ class Page ); // Init response bar - $this->response = new Response( + $this->response = new Page\Response( $this ); diff --git a/src/Entity/Browser/Container/Page/Content.php b/src/Entity/Browser/Container/Page/Content.php index f065df40..0513d1de 100644 --- a/src/Entity/Browser/Container/Page/Content.php +++ b/src/Entity/Browser/Container/Page/Content.php @@ -6,11 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\Container\Page; use \Yggverse\Yoda\Entity\Browser\Container\Page; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Gemtext; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Image; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Plain; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Viewport; - use \Yggverse\Yoda\Model\Filesystem; class Content @@ -21,7 +16,7 @@ class Content public Page $page; // Requirements - public Viewport $viewport; + public Content\Viewport $viewport; // Defaults public const MARGIN = 8; @@ -50,7 +45,7 @@ class Content ); // Init scrolled window viewport - $this->viewport = new Viewport( + $this->viewport = new Content\Viewport( $this ); @@ -72,7 +67,7 @@ class Content $title = null; - $document = new Gemtext( + $document = new Content\Gemtext( $this ); @@ -108,7 +103,7 @@ class Content case Filesystem::MIME_TEXT_PLAIN: - $document = new Plain( + $document = new Content\Plain( $this ); @@ -123,7 +118,7 @@ class Content case Filesystem::MIME_IMAGE_PNG: case Filesystem::MIME_IMAGE_WEBP: - $document = new Image( + $document = new Content\Image( $this ); @@ -135,7 +130,7 @@ class Content default: - $document = new Plain( + $document = new Content\Plain( $this ); diff --git a/src/Entity/Browser/Container/Page/Content/Viewport.php b/src/Entity/Browser/Container/Page/Content/Viewport.php index aff8ae5a..d9f77e4a 100644 --- a/src/Entity/Browser/Container/Page/Content/Viewport.php +++ b/src/Entity/Browser/Container/Page/Content/Viewport.php @@ -6,10 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\Container\Page\Content; use \Yggverse\Yoda\Entity\Browser\Container\Page\Content; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Gemtext; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Image; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Plain; - class Viewport { public \GtkViewport $gtk; diff --git a/src/Entity/Browser/Container/Page/Navbar/History.php b/src/Entity/Browser/Container/Page/Navbar/History.php index ef6764e9..0f03aee7 100644 --- a/src/Entity/Browser/Container/Page/Navbar/History.php +++ b/src/Entity/Browser/Container/Page/Navbar/History.php @@ -5,8 +5,6 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser\Container\Page\Navbar; use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History\Back; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History\Forward; use \Yggverse\Yoda\Model\History as Memory; @@ -19,8 +17,8 @@ class History public Memory $memory; // Requirements - public Back $back; - public Forward $forward; + public History\Back $back; + public History\Forward $forward; public function __construct( Navbar $navbar @@ -37,7 +35,7 @@ class History \GtkButtonBoxStyle::EXPAND ); - $this->back = new Back( + $this->back = new History\Back( $this->navbar ); @@ -45,7 +43,7 @@ class History $this->back->gtk ); - $this->forward = new Forward( + $this->forward = new History\Forward( $this->navbar ); diff --git a/src/Entity/Browser/Container/Page/Progressbar.php b/src/Entity/Browser/Container/Page/Progressbar.php index ce669112..78828e43 100644 --- a/src/Entity/Browser/Container/Page/Progressbar.php +++ b/src/Entity/Browser/Container/Page/Progressbar.php @@ -4,12 +4,14 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser\Container\Page; +use \Yggverse\Yoda\Entity\Browser\Container\Page; + class Progressbar { public \GtkProgressBar $gtk; // Dependencies - public \Yggverse\Yoda\Entity\Browser\Container\Page $page; + public Page $page; // Defaults private bool $_active = false; @@ -17,7 +19,7 @@ class Progressbar private float $_step = 0.02; public function __construct( - \Yggverse\Yoda\Entity\Browser\Container\Page $page, + Page $page, ) { // Init dependencies $this->page = $page; diff --git a/src/Entity/Browser/Container/Page/Response.php b/src/Entity/Browser/Container/Page/Response.php index bac62b4b..72cdb5cd 100644 --- a/src/Entity/Browser/Container/Page/Response.php +++ b/src/Entity/Browser/Container/Page/Response.php @@ -6,9 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\Container\Page; use \Yggverse\Yoda\Entity\Browser\Container\Page; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Response\Query; -use \Yggverse\Yoda\Entity\Browser\Container\Page\Response\Send; - use \Yggverse\Net\Address; class Response @@ -19,8 +16,8 @@ class Response public Page $page; // Requirements - public Query $query; - public Send $send; + public Response\Query $query; + public Response\Send $send; // Defaults public const MARGIN = 8; @@ -58,7 +55,7 @@ class Response ); // Init query field - $this->query = new Query( + $this->query = new Response\Query( $this ); @@ -70,7 +67,7 @@ class Response ); // Init send button - $this->send = new Send( + $this->send = new Response\Send( $this ); diff --git a/src/Entity/Browser/Container/Page/Response/Query.php b/src/Entity/Browser/Container/Page/Response/Query.php index 19e7c61e..793e6ca7 100644 --- a/src/Entity/Browser/Container/Page/Response/Query.php +++ b/src/Entity/Browser/Container/Page/Response/Query.php @@ -4,15 +4,17 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser\Container\Page\Response; +use \Yggverse\Yoda\Entity\Browser\Container\Page\Response; + class Query extends \Yggverse\Yoda\Abstract\Entity\Entry { - public \Yggverse\Yoda\Entity\Browser\Container\Page\Response $response; + public Response $response; // Defaults protected string $_placeholder = 'Enter response...'; public function __construct( - \Yggverse\Yoda\Entity\Browser\Container\Page\Response $response + Response $response ) { // Use parent features parent::__construct(); diff --git a/src/Entity/Browser/Container/Page/Response/Send.php b/src/Entity/Browser/Container/Page/Response/Send.php index 19b1c2c1..7526ac65 100644 --- a/src/Entity/Browser/Container/Page/Response/Send.php +++ b/src/Entity/Browser/Container/Page/Response/Send.php @@ -4,16 +4,18 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser\Container\Page\Response; +use \Yggverse\Yoda\Entity\Browser\Container\Page\Response; + class Send extends \Yggverse\Yoda\Abstract\Entity\Button { // Dependencies - public \Yggverse\Yoda\Entity\Browser\Container\Page\Response $response; + public Response $response; // Defaults protected string $_label = 'Send'; public function __construct( - \Yggverse\Yoda\Entity\Browser\Container\Page\Response $response + Response $response ) { // Use parent features parent::__construct(); diff --git a/src/Entity/Browser/Container/Tab.php b/src/Entity/Browser/Container/Tab.php index a328a9a7..e9ad687f 100644 --- a/src/Entity/Browser/Container/Tab.php +++ b/src/Entity/Browser/Container/Tab.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser\Container; use \Yggverse\Yoda\Entity\Browser\Container; -use \Yggverse\Yoda\Entity\Browser\Container\Page; class Tab { diff --git a/src/Entity/Browser/Header.php b/src/Entity/Browser/Header.php index 4d96b7a7..a3cf68fe 100644 --- a/src/Entity/Browser/Header.php +++ b/src/Entity/Browser/Header.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser; use \Yggverse\Yoda\Entity\Browser; -use \Yggverse\Yoda\Entity\Browser\Header\Tray; class Header { @@ -15,7 +14,7 @@ class Header public Browser $browser; // Requirements - public Tray $tray; + public Header\Tray $tray; // Defaults protected bool $_actions = true; @@ -44,7 +43,7 @@ class Header ); // Init tray area - $this->tray = new Tray( + $this->tray = new Header\Tray( $this ); diff --git a/src/Entity/Browser/Header/Tray.php b/src/Entity/Browser/Header/Tray.php index edb51ba4..1940cb47 100644 --- a/src/Entity/Browser/Header/Tray.php +++ b/src/Entity/Browser/Header/Tray.php @@ -6,9 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\Header; use \Yggverse\Yoda\Entity\Browser\Header; -use \Yggverse\Yoda\Entity\Browser\Header\Tray\Navigation; -use \Yggverse\Yoda\Entity\Browser\Header\Tray\Tab; - class Tray { public \GtkBox $gtk; @@ -17,8 +14,8 @@ class Tray public Header $header; // Requirements - public Navigation $navigation; - public Tab $tab; + public Tray\Navigation $navigation; + public Tray\Tab $tab; // Defaults protected bool $_actions = true; @@ -50,7 +47,7 @@ class Tray ); // Init navigation - $this->navigation = new Navigation( + $this->navigation = new Tray\Navigation( $this ); @@ -59,7 +56,7 @@ class Tray ); // Init new tab button - $this->tab = new Tab( + $this->tab = new Tray\Tab( $this ); diff --git a/src/Entity/Browser/History.php b/src/Entity/Browser/History.php index 99c490e4..d65c66b7 100644 --- a/src/Entity/Browser/History.php +++ b/src/Entity/Browser/History.php @@ -4,9 +4,6 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser; -use \Yggverse\Yoda\Entity\Browser\History\Header; -use \Yggverse\Yoda\Entity\Browser\History\Container; - use \Yggverse\Yoda\Entity\Browser; class History @@ -17,8 +14,8 @@ class History public Browser $browser; // Requirements - public Header $header; - public Container $container; + public History\Header $header; + public History\Container $container; // Defaults public const WIDTH = 640; @@ -45,7 +42,7 @@ class History } // Init header - $this->header = new Header( + $this->header = new History\Header( $this ); @@ -54,7 +51,7 @@ class History ); // Init container - $this->container = new Container( + $this->container = new History\Container( $this ); diff --git a/src/Entity/Browser/History/Container.php b/src/Entity/Browser/History/Container.php index 12d948d7..80a15083 100644 --- a/src/Entity/Browser/History/Container.php +++ b/src/Entity/Browser/History/Container.php @@ -4,22 +4,21 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser\History; -use \Yggverse\Yoda\Entity\Browser\History\Container\Navbar; -use \Yggverse\Yoda\Entity\Browser\History\Container\Content; +use \Yggverse\Yoda\Entity\Browser\History; class Container { public \GtkBox $gtk; // Dependencies - public \Yggverse\Yoda\Entity\Browser\History $history; + public History $history; // Requirements - public \Yggverse\Yoda\Entity\Browser\History\Container\Navbar $navbar; - public \Yggverse\Yoda\Entity\Browser\History\Container\Content $content; + public Container\Navbar $navbar; + public Container\Content $content; public function __construct( - \Yggverse\Yoda\Entity\Browser\History $history + History $history ) { // Init dependency $this->history = $history; @@ -30,7 +29,7 @@ class Container ); // Init navbar - $this->navbar = new Navbar( + $this->navbar = new Container\Navbar( $this ); @@ -39,7 +38,7 @@ class Container ); // Init content - $this->content = new Content( + $this->content = new Container\Content( $this ); diff --git a/src/Entity/Browser/History/Container/Content.php b/src/Entity/Browser/History/Container/Content.php index 3a8349e5..7876d9b0 100644 --- a/src/Entity/Browser/History/Container/Content.php +++ b/src/Entity/Browser/History/Container/Content.php @@ -6,9 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\History\Container; use \Yggverse\Yoda\Entity\Browser\History\Container; -use \Yggverse\Yoda\Entity\Browser\History\Container\Content\Viewport; -use \Yggverse\Yoda\Entity\Browser\History\Container\Content\Table; - class Content { public \GtkScrolledWindow $gtk; @@ -17,8 +14,8 @@ class Content public Container $container; // Requirements - public Viewport $viewport; - public Table $table; + public Content\Viewport $viewport; + public Content\Table $table; // Defaults public const MARGIN = 8; @@ -45,12 +42,12 @@ class Content ); // Init history records table - $this->table = new Table( + $this->table = new Content\Table( $this ); // Init viewport to integrate scrolled window features - $this->viewport = new Viewport( + $this->viewport = new Content\Viewport( $this ); diff --git a/src/Entity/Browser/History/Container/Content/Table.php b/src/Entity/Browser/History/Container/Content/Table.php index cfe8e286..ead6a378 100644 --- a/src/Entity/Browser/History/Container/Content/Table.php +++ b/src/Entity/Browser/History/Container/Content/Table.php @@ -6,8 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\History\Container\Content; use \Yggverse\Yoda\Entity\Browser\History\Container\Content; -use \Yggverse\Yoda\Entity\Browser\History\Container\Content\Table\Data; - class Table { public \GtkTreeView $gtk; @@ -16,7 +14,7 @@ class Table public Content $content; // Requirements - public Data $data; + public Table\Data $data; // Defaults public const TIME = 'Time'; @@ -60,7 +58,7 @@ class Table ); // Init data model - $this->data = new Data( + $this->data = new Table\Data( $this ); diff --git a/src/Entity/Browser/History/Container/Content/Viewport.php b/src/Entity/Browser/History/Container/Content/Viewport.php index ae7d164c..34a43b6e 100644 --- a/src/Entity/Browser/History/Container/Content/Viewport.php +++ b/src/Entity/Browser/History/Container/Content/Viewport.php @@ -4,15 +4,17 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser\History\Container\Content; +use \Yggverse\Yoda\Entity\Browser\History\Container\Content; + class Viewport { public \GtkViewport $gtk; // Dependencies - public \Yggverse\Yoda\Entity\Browser\History\Container\Content $content; + public Content $content; public function __construct( - \Yggverse\Yoda\Entity\Browser\History\Container\Content $content + Content $content ) { // Init dependencies $this->content = $content; diff --git a/src/Entity/Browser/History/Container/Navbar.php b/src/Entity/Browser/History/Container/Navbar.php index 22d9c5a4..b586674a 100644 --- a/src/Entity/Browser/History/Container/Navbar.php +++ b/src/Entity/Browser/History/Container/Navbar.php @@ -6,11 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\History\Container; use \Yggverse\Yoda\Entity\Browser\History\Container; -use \Yggverse\Yoda\Entity\Browser\History\Container\Navbar\Delete; -use \Yggverse\Yoda\Entity\Browser\History\Container\Navbar\Filter; -use \Yggverse\Yoda\Entity\Browser\History\Container\Navbar\Open; -use \Yggverse\Yoda\Entity\Browser\History\Container\Navbar\Search; - class Navbar { public \GtkBox $gtk; @@ -19,10 +14,10 @@ class Navbar public Container $container; // Requirements - public Delete $delete; - public Filter $filter; - public Open $open; - public Search $search; + public Navbar\Delete $delete; + public Navbar\Filter $filter; + public Navbar\Open $open; + public Navbar\Search $search; // Defaults public const MARGIN = 8; @@ -60,7 +55,7 @@ class Navbar ); // Init open button - $this->open = new Open( + $this->open = new Navbar\Open( $this ); @@ -69,7 +64,7 @@ class Navbar ); // Init delete button - $this->delete = new Delete( + $this->delete = new Navbar\Delete( $this ); @@ -78,7 +73,7 @@ class Navbar ); // Init filter entry - $this->filter = new Filter( + $this->filter = new Navbar\Filter( $this ); @@ -90,7 +85,7 @@ class Navbar ); // Init search button - $this->search = new Search( + $this->search = new Navbar\Search( $this ); diff --git a/src/Entity/Browser/Menu.php b/src/Entity/Browser/Menu.php index 623ab445..8c192a52 100644 --- a/src/Entity/Browser/Menu.php +++ b/src/Entity/Browser/Menu.php @@ -4,26 +4,23 @@ declare(strict_types=1); namespace Yggverse\Yoda\Entity\Browser; -use \Yggverse\Yoda\Entity\Browser\Menu\File; -use \Yggverse\Yoda\Entity\Browser\Menu\Tab; -use \Yggverse\Yoda\Entity\Browser\Menu\History; -use \Yggverse\Yoda\Entity\Browser\Menu\Quit; +use \Yggverse\Yoda\Entity\Browser; class Menu { public \GtkMenu $gtk; // Dependencies - public \Yggverse\Yoda\Entity\Browser $browser; + public Browser $browser; // Requirements - public \Yggverse\Yoda\Entity\Browser\Menu\File $file; - public \Yggverse\Yoda\Entity\Browser\Menu\Tab $tab; - public \Yggverse\Yoda\Entity\Browser\Menu\History $history; - public \Yggverse\Yoda\Entity\Browser\Menu\Quit $quit; + public Menu\File $file; + public Menu\Tab $tab; + public Menu\History $history; + public Menu\Quit $quit; public function __construct( - \Yggverse\Yoda\Entity\Browser $browser + Browser $browser ) { // Init dependencies $this->browser = $browser; @@ -32,7 +29,7 @@ class Menu $this->gtk = new \GtkMenu; // Init file menu item - $this->file = new File( + $this->file = new Menu\File( $this ); @@ -41,7 +38,7 @@ class Menu ); // Init tab menu item - $this->tab = new Tab( + $this->tab = new Menu\Tab( $this ); @@ -50,7 +47,7 @@ class Menu ); // Init history menu item - $this->history = new History( + $this->history = new Menu\History( $this ); @@ -64,7 +61,7 @@ class Menu ); // Init quit menu item - $this->quit = new Quit( + $this->quit = new Menu\Quit( $this ); diff --git a/src/Entity/Browser/Menu/File.php b/src/Entity/Browser/Menu/File.php index bcf0ec94..fe77eb8b 100644 --- a/src/Entity/Browser/Menu/File.php +++ b/src/Entity/Browser/Menu/File.php @@ -6,9 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\Menu; use \Yggverse\Yoda\Entity\Browser\Menu; -use \Yggverse\Yoda\Entity\Browser\Menu\File\Open; -use \Yggverse\Yoda\Entity\Browser\Menu\File\Save; - class File { public \GtkMenuItem $gtk; @@ -34,7 +31,7 @@ class File $file = new \GtkMenu; // Init tab menu items - $open = new Open( + $open = new File\Open( $this ); @@ -42,7 +39,7 @@ class File $open->gtk ); - $save = new Save( + $save = new File\Save( $this ); diff --git a/src/Entity/Browser/Menu/Tab.php b/src/Entity/Browser/Menu/Tab.php index 32154b91..47436ea5 100644 --- a/src/Entity/Browser/Menu/Tab.php +++ b/src/Entity/Browser/Menu/Tab.php @@ -6,9 +6,6 @@ namespace Yggverse\Yoda\Entity\Browser\Menu; use \Yggverse\Yoda\Entity\Browser\Menu; -use \Yggverse\Yoda\Entity\Browser\Menu\Tab\Add; -use \Yggverse\Yoda\Entity\Browser\Menu\Tab\Close; - class Tab { public \GtkMenuItem $gtk; @@ -17,8 +14,8 @@ class Tab public Menu $menu; // Requirements - public Add $add; - public Close $close; + public Tab\Add $add; + public Tab\Close $close; // Defaults public const LABEL = 'Tab'; @@ -38,7 +35,7 @@ class Tab $tab = new \GtkMenu; // Init new tab menu item - $this->add = new Add( + $this->add = new Tab\Add( $this ); @@ -47,7 +44,7 @@ class Tab ); // Init close tab menu item - $this->close = new Close( + $this->close = new Tab\Close( $this );