Browse Source

move Page entity out of Tab namespace

PHP-GTK3
yggverse 4 months ago
parent
commit
63bc991bda
  1. 18
      src/Abstract/Entity/Browser/Container/Page/Navbar/Button.php
  2. 18
      src/Abstract/Entity/Browser/Container/Page/Navbar/Entry.php
  3. 18
      src/Abstract/Entity/Browser/Container/Tab/Page/Navbar/Button.php
  4. 18
      src/Abstract/Entity/Browser/Container/Tab/Page/Navbar/Entry.php
  5. 24
      src/Entity/Browser/Container/Page.php
  6. 18
      src/Entity/Browser/Container/Page/Content.php
  7. 6
      src/Entity/Browser/Container/Page/Content/Data.php
  8. 6
      src/Entity/Browser/Container/Page/Content/Viewport.php
  9. 22
      src/Entity/Browser/Container/Page/Navbar.php
  10. 4
      src/Entity/Browser/Container/Page/Navbar/Base.php
  11. 4
      src/Entity/Browser/Container/Page/Navbar/Go.php
  12. 14
      src/Entity/Browser/Container/Page/Navbar/History.php
  13. 4
      src/Entity/Browser/Container/Page/Navbar/History/Back.php
  14. 4
      src/Entity/Browser/Container/Page/Navbar/History/Forward.php
  15. 4
      src/Entity/Browser/Container/Page/Navbar/Request.php
  16. 14
      src/Entity/Browser/Container/Page/Response.php
  17. 6
      src/Entity/Browser/Container/Page/Response/Query.php
  18. 6
      src/Entity/Browser/Container/Page/Response/Send.php
  19. 8
      src/Entity/Browser/Container/Page/Title.php
  20. 4
      src/Entity/Browser/Container/Tab.php
  21. 2
      src/Gtk/Browser/Container/Page/Title/Label.php

18
src/Abstract/Entity/Browser/Container/Page/Navbar/Button.php

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navbar;
abstract class Button extends \Yggverse\Yoda\Abstract\Entity\Button
{
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar $navbar;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Page\Navbar $navbar
) {
parent::__construct();
$this->navbar = $navbar;
}
}

18
src/Abstract/Entity/Browser/Container/Page/Navbar/Entry.php

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navbar;
abstract class Entry extends \Yggverse\Yoda\Abstract\Entity\Entry
{
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar $navbar;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Page\Navbar $navbar
) {
parent::__construct();
$this->navbar = $navbar;
}
}

18
src/Abstract/Entity/Browser/Container/Tab/Page/Navbar/Button.php

@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Abstract\Entity\Browser\Container\Tab\Page\Navbar;
abstract class Button extends \Yggverse\Yoda\Abstract\Entity\Button
{
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar $navbar;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar $navbar
) {
parent::__construct();
$this->navbar = $navbar;
}
}

18
src/Abstract/Entity/Browser/Container/Tab/Page/Navbar/Entry.php

@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Abstract\Entity\Browser\Container\Tab\Page\Navbar;
abstract class Entry extends \Yggverse\Yoda\Abstract\Entity\Entry
{
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar $navbar;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar $navbar
) {
parent::__construct();
$this->navbar = $navbar;
}
}

24
src/Entity/Browser/Container/Tab/Page.php → src/Entity/Browser/Container/Page.php

@ -2,31 +2,31 @@ @@ -2,31 +2,31 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab;
namespace Yggverse\Yoda\Entity\Browser\Container;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Title;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Title;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Content;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Response;
class Page
{
public \GtkBox $gtk;
// Dependencies
public \Yggverse\Yoda\Entity\Browser\Container\Tab $tab;
public \Yggverse\Yoda\Entity\Browser\Container $container;
// Requirements
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Title $title;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar $navbar;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content $content;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response $response;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Title $title;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar $navbar;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Content $content;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Response $response;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab $tab
\Yggverse\Yoda\Entity\Browser\Container $container
) {
// Init dependencies
$this->tab = $tab;
$this->container = $container;
// Init container
$this->gtk = new \GtkBox(

18
src/Entity/Browser/Container/Tab/Page/Content.php → src/Entity/Browser/Container/Page/Content.php

@ -2,27 +2,27 @@ @@ -2,27 +2,27 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page;
namespace Yggverse\Yoda\Entity\Browser\Container\Page;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content\Data;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content\Viewport;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Data;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Viewport;
class Content
{
public \GtkScrolledWindow $gtk;
// Dependencies
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page;
public \Yggverse\Yoda\Entity\Browser\Container\Page $page;
// Requirements
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content\Data $data;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content\Viewport $viewport;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Data $data;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Content\Viewport $viewport;
// Defaults
private int $_margin = 8;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page
\Yggverse\Yoda\Entity\Browser\Container\Page $page
) {
$this->page = $page;
@ -92,7 +92,7 @@ class Content @@ -92,7 +92,7 @@ class Content
);
// Update history in database
$this->page->tab->container->browser->database->renewHistory(
$this->page->container->browser->database->renewHistory(
$address->get(),
// @TODO title
);
@ -408,7 +408,7 @@ class Content @@ -408,7 +408,7 @@ class Content
$this->page->refresh();
// Update window header
$this->page->tab->container->browser->header->setTitle(
$this->page->container->browser->header->setTitle(
$this->page->title->getValue(),
$this->page->title->getSubtitle(),
);

6
src/Entity/Browser/Container/Tab/Page/Content/Data.php → src/Entity/Browser/Container/Page/Content/Data.php

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Content;
use \Yggverse\Gemtext\Document;
use \Yggverse\Net\Address;
@ -12,10 +12,10 @@ class Data @@ -12,10 +12,10 @@ class Data
public \GtkLabel $gtk;
// Dependencies
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content $content;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Content $content;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content $content
\Yggverse\Yoda\Entity\Browser\Container\Page\Content $content
) {
// Init dependency
$this->content = $content;

6
src/Entity/Browser/Container/Tab/Page/Content/Viewport.php → src/Entity/Browser/Container/Page/Content/Viewport.php

@ -2,17 +2,17 @@ @@ -2,17 +2,17 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Content;
class Viewport
{
public \GtkViewport $gtk;
// Dependencies
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content $content;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Content $content;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Content $content
\Yggverse\Yoda\Entity\Browser\Container\Page\Content $content
) {
// Init dependencies
$this->content = $content;

22
src/Entity/Browser/Container/Tab/Page/Navbar.php → src/Entity/Browser/Container/Page/Navbar.php

@ -2,31 +2,31 @@ @@ -2,31 +2,31 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page;
namespace Yggverse\Yoda\Entity\Browser\Container\Page;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\Base;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\Go;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\History;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\Request;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\Base;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\Go;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\Request;
class Navbar
{
public \GtkBox $gtk;
// Dependencies
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page;
public \Yggverse\Yoda\Entity\Browser\Container\Page $page;
// Requirements
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\Base $base;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\Go $go;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\History $history;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\Request $request;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\Base $base;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\Go $go;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History $history;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\Request $request;
// Defaults
private int $_margin = 8;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page
\Yggverse\Yoda\Entity\Browser\Container\Page $page
) {
// Init dependencies
$this->page = $page;

4
src/Entity/Browser/Container/Tab/Page/Navbar/Base.php → src/Entity/Browser/Container/Page/Navbar/Base.php

@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Navbar;
class Base extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Tab\Page\Navbar\Button
class Base extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navbar\Button
{
protected string $_label = 'Base';

4
src/Entity/Browser/Container/Tab/Page/Navbar/Go.php → src/Entity/Browser/Container/Page/Navbar/Go.php

@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Navbar;
class Go extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Tab\Page\Navbar\Button
class Go extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navbar\Button
{
protected string $_label = 'Go';

14
src/Entity/Browser/Container/Tab/Page/Navbar/History.php → src/Entity/Browser/Container/Page/Navbar/History.php

@ -2,10 +2,10 @@ @@ -2,10 +2,10 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Navbar;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\History\Back;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\History\Forward;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History\Back;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History\Forward;
class History
{
@ -14,14 +14,14 @@ class History @@ -14,14 +14,14 @@ class History
// Dependencies
public \Yggverse\Yoda\Model\History $memory;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar $navbar;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar $navbar;
// Requirements
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\History\Back $back;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\History\Forward $forward;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History\Back $back;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History\Forward $forward;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar $navbar
\Yggverse\Yoda\Entity\Browser\Container\Page\Navbar $navbar
) {
$this->memory = new \Yggverse\Yoda\Model\History();

4
src/Entity/Browser/Container/Tab/Page/Navbar/History/Back.php → src/Entity/Browser/Container/Page/Navbar/History/Back.php

@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\History;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History;
class Back extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Tab\Page\Navbar\Button
class Back extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navbar\Button
{
protected string $_label = 'Back';

4
src/Entity/Browser/Container/Tab/Page/Navbar/History/Forward.php → src/Entity/Browser/Container/Page/Navbar/History/Forward.php

@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar\History;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Navbar\History;
class Forward extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Tab\Page\Navbar\Button
class Forward extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navbar\Button
{
protected string $_label = 'Forward';

4
src/Entity/Browser/Container/Tab/Page/Navbar/Request.php → src/Entity/Browser/Container/Page/Navbar/Request.php

@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Navbar;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Navbar;
class Request extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Tab\Page\Navbar\Entry
class Request extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navbar\Entry
{
protected string $_placeholder = 'URL or search term...';

14
src/Entity/Browser/Container/Tab/Page/Response.php → src/Entity/Browser/Container/Page/Response.php

@ -2,10 +2,10 @@ @@ -2,10 +2,10 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page;
namespace Yggverse\Yoda\Entity\Browser\Container\Page;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response\Query;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response\Send;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Response\Query;
use \Yggverse\Yoda\Entity\Browser\Container\Page\Response\Send;
use \Yggverse\Net\Address;
@ -14,17 +14,17 @@ class Response @@ -14,17 +14,17 @@ class Response
public \GtkBox $gtk;
// Dependencies
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page;
public \Yggverse\Yoda\Entity\Browser\Container\Page $page;
// Requirements
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response\Query $query;
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response\Send $send;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Response\Query $query;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Response\Send $send;
// Defaults
private int $_margin = 8;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page
\Yggverse\Yoda\Entity\Browser\Container\Page $page
) {
// Init dependencies
$this->page = $page;

6
src/Entity/Browser/Container/Tab/Page/Response/Query.php → src/Entity/Browser/Container/Page/Response/Query.php

@ -2,17 +2,17 @@ @@ -2,17 +2,17 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Response;
class Query extends \Yggverse\Yoda\Abstract\Entity\Entry
{
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response $response;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Response $response;
// Defaults
protected string $_placeholder = 'Enter response...';
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response $response
\Yggverse\Yoda\Entity\Browser\Container\Page\Response $response
) {
// Use parent features
parent::__construct();

6
src/Entity/Browser/Container/Tab/Page/Response/Send.php → src/Entity/Browser/Container/Page/Response/Send.php

@ -2,18 +2,18 @@ @@ -2,18 +2,18 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response;
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Response;
class Send extends \Yggverse\Yoda\Abstract\Entity\Button
{
// Dependencies
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response $response;
public \Yggverse\Yoda\Entity\Browser\Container\Page\Response $response;
// Defaults
protected string $_label = 'Send';
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page\Response $response
\Yggverse\Yoda\Entity\Browser\Container\Page\Response $response
) {
// Use parent features
parent::__construct();

8
src/Entity/Browser/Container/Tab/Page/Title.php → src/Entity/Browser/Container/Page/Title.php

@ -2,16 +2,16 @@ @@ -2,16 +2,16 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container\Tab\Page;
namespace Yggverse\Yoda\Entity\Browser\Container\Page;
use \Yggverse\Yoda\Gtk\Browser\Container\Tab\Page\Title\Label;
use \Yggverse\Yoda\Gtk\Browser\Container\Page\Title\Label;
class Title
{
public Label $gtk;
// Dependencies
public \Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page;
public \Yggverse\Yoda\Entity\Browser\Container\Page $page;
// Defaults
private int $_ellipsize = 3;
@ -20,7 +20,7 @@ class Title @@ -20,7 +20,7 @@ class Title
private ?string $_subtitle = null;
public function __construct(
\Yggverse\Yoda\Entity\Browser\Container\Tab\Page $page,
\Yggverse\Yoda\Entity\Browser\Container\Page $page,
) {
// Init dependencies
$this->page = $page;

4
src/Entity/Browser/Container/Tab.php

@ -4,7 +4,7 @@ declare(strict_types=1); @@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Container;
use \Yggverse\Yoda\Entity\Browser\Container\Tab\Page;
use \Yggverse\Yoda\Entity\Browser\Container\Page;
class Tab
{
@ -73,7 +73,7 @@ class Tab @@ -73,7 +73,7 @@ class Tab
): void
{
$page = new Page(
$this
$this->container
);
if ($request)

2
src/Gtk/Browser/Container/Tab/Page/Title/Label.php → src/Gtk/Browser/Container/Page/Title/Label.php

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Yggverse\Yoda\Gtk\Browser\Container\Tab\Page\Title;
namespace Yggverse\Yoda\Gtk\Browser\Container\Page\Title;
class Label extends \GtkLabel
{
Loading…
Cancel
Save