mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
refactor page mime routing to init multimedia support
This commit is contained in:
parent
720f9ebbae
commit
81595f0b79
6 changed files with 223 additions and 195 deletions
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Content;
|
||||
|
||||
use \Yggverse\Yoda\Entity\Browser\Container\Page\Content;
|
||||
|
||||
abstract class Markup
|
||||
{
|
||||
public \GtkLabel $gtk;
|
||||
|
||||
// Dependencies
|
||||
public Content $content;
|
||||
|
||||
// Defaults
|
||||
protected int $_wrap = 140;
|
||||
|
||||
public function __construct(
|
||||
Content $content
|
||||
) {
|
||||
// Init dependency
|
||||
$this->content = $content;
|
||||
|
||||
// Init markup label
|
||||
$this->gtk = new \GtkLabel;
|
||||
|
||||
$this->gtk->set_use_markup(
|
||||
true
|
||||
);
|
||||
|
||||
$this->gtk->set_selectable(
|
||||
true
|
||||
);
|
||||
|
||||
$this->gtk->set_can_focus(
|
||||
false
|
||||
);
|
||||
|
||||
$this->gtk->set_track_visited_links(
|
||||
true
|
||||
);
|
||||
|
||||
$this->gtk->set_xalign(
|
||||
0
|
||||
);
|
||||
|
||||
$this->gtk->set_yalign(
|
||||
0
|
||||
);
|
||||
|
||||
$this->gtk->show();
|
||||
|
||||
// Init events
|
||||
$this->gtk->connect(
|
||||
'activate-link',
|
||||
function(
|
||||
\GtkLabel $label,
|
||||
string $href
|
||||
) {
|
||||
$this->_onActivateLink(
|
||||
$label,
|
||||
$href
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
abstract protected function _onActivateLink(
|
||||
\GtkLabel $label,
|
||||
string $href
|
||||
);
|
||||
|
||||
abstract public function setSource(
|
||||
string $value
|
||||
): void;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue