Add README.md and LICENSE
This commit is contained in:
parent
3678412fc5
commit
8fbb1f42a0
2 changed files with 52 additions and 0 deletions
9
LICENSE
Normal file
9
LICENSE
Normal file
|
@ -0,0 +1,9 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2025 "pancakes"
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
43
README.md
Normal file
43
README.md
Normal file
|
@ -0,0 +1,43 @@
|
|||
# ZwlrLayerShell
|
||||
|
||||
C# bindings for the [gtk4-layer-shell] library intended to be used with [Gir.Core]'s GTK4 package.
|
||||
This package can be used to create applications such as panels and widgets through the [zwlr_layer_shell_v1] protocol.
|
||||
|
||||
## Usage
|
||||
|
||||
ZwlrLayerShell can be used the same way as [gtk4-layer-shell] is used in C.
|
||||
Please note that you need to link it before libwayland-client to function correctly.
|
||||
The following example uses the `LayerShell.IsSupported()` function to make sure it is linked beforehand.
|
||||
|
||||
```csharp
|
||||
using Gtk;
|
||||
using ZwlrLayerShell;
|
||||
|
||||
if (!LayerShell.IsSupported())
|
||||
{
|
||||
// Exit the program if the compositor doesn't support zwlr_layer_shell_v1
|
||||
return;
|
||||
}
|
||||
|
||||
var application = Application.New("com.example.exampleapp", Gio.ApplicationFlags.FlagsNone);
|
||||
|
||||
application.OnActivate += (sender, eventArgs) =>
|
||||
{
|
||||
var window = ApplicationWindow.New((Application)sender);
|
||||
|
||||
// Window must be assigned the layer_surface role before being presented
|
||||
LayerShell.InitForWindow(window);
|
||||
LayerShell.SetNamespace(window, "exampleapp");
|
||||
LayerShell.SetLayer(window, Layer.Top);
|
||||
|
||||
window.Present();
|
||||
};
|
||||
|
||||
application.RunWithSynchronizationContext(null);
|
||||
```
|
||||
|
||||
[Gir.Core]: https://gircore.github.io/
|
||||
|
||||
[gtk4-layer-shell]: https://github.com/wmww/gtk4-layer-shell
|
||||
|
||||
[zwlr_layer_shell_v1]: https://wayland.app/protocols/wlr-layer-shell-unstable-v1
|
Loading…
Add table
Reference in a new issue