GtkLayerShell - A Raku module for interfacing with Gtk Layer Shell

NAME

GtkLayerShell - A Raku module for interfacing with Gtk Layer Shell

SYNOPSIS


use GtkLayerShell:auth<zef:CIAvash>:api<0.6>;

# With C<Gnome::Gtk3> module
use Gnome::Gtk3::Main;
use Gnome::Gtk3::Window;
use Gnome::Gtk3::Box;
use Gnome::Gtk3::Label;

my Gnome::Gtk3::Main   $m          .= new;
my Gnome::Gtk3::Window $gtk_window .= new;

my $window = $gtk_window.get-native-object;

my GtkLayerShell $layer_surface .= new: :$window, :init,
                                        :layer(LAYER_OVERLAY)
                                        :anchors(:EDGE_LEFT, :EDGE_TOP),
                                        :margins(:EDGE_TOP(5), :EDGE_LEFT(10)),
                                        :exclusive_zone(50);

# Or
my $layer_surface = GtkLayerShell.new: :$window;
$layer_surface.init;
$layer_surface.set: :layer(LAYER_OVERLAY),
                    :anchors(:EDGE_LEFT, :EDGE_TOP),
                    :margins(:EDGE_TOP(5), :EDGE_LEFT(10)),
                    :name_space<panel>,
                    :auto_exclusive_zone

# Or
my $layer_surface = GtkLayerShell.new: :$window, :init;
$layer_surface.set_layer:  LAYER_OVERLAY;
$layer_surface.set_anchor: EDGE_TOP,  True;
$layer_surface.set_anchor: EDGE_LEFT, True;
$layer_surface.set_margin: EDGE_TOP,  10;
$layer_surface.set_margin: EDGE_LEFT, 10;

my $box = Gnome::Gtk3::Box.new;
$box.add: Gnome::Gtk3::Label.new: :text('Gtk Layer Shell!');

$gtk_window.add: $box;

$gtk_window.show-all;

$m.gtk-main;

# With GTK::Simple
use GTK::Simple;
use GTK::Simple::App;

my GTK::Simple::App $app .= new;

my GtkLayerShell $layer_surface .= new: :window($app.WIDGET), :init, :anchors(:EDGE_RIGHT, :EDGE_BOTTOM);

$app.set-content: GTK::Simple::HBox.new: GTK::Simple::Label.new: text => 'Gtk Layer Shell!';

$app.run;

INSTALLATION

You need to have Gtk Layer Shell and a Wayland compositor that works with it, Raku and zef, then run:


zef install "GtkLayerShell:auth<zef:CIAvash>:api<0.6>"

or if you have've cloned the repo:


zef install .

TESTING


prove -ve 'raku -I.' --ext rakutest

ATTRIBUTES

METHODS

AUTHOR

Siavash Askari Nasr - https://www.ciavash.name

COPYRIGHT

Copyright © 2021 Siavash Askari Nasr

LICENSE

This file is part of GtkLayerShell.

GtkLayerShell is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

GtkLayerShell is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with GtkLayerShell. If not, see <http://www.gnu.org/licenses/>.

GtkLayerShell v0.1.0

Library and Native bindings for Gtk Layer Shell, a library for creating panels and other desktop components for Wayland, using the Layer Shell protocol.

Authors

  • Siavash Askari Nasr

License

LGPL-3.0-or-later

Dependencies

NativeLibs:auth<github:salortiz>:ver<0.0.9+>

Provides

  • GtkLayerShell
  • GtkLayerShell::Native

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.