wayland

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 0 Imported by: 0

README

wayland

GoReportCard

GoDoc reference

Golang Wayland

Screenshot of Golang Wayland Cube app

Go vulkan cube demo

Screenshot of Golang Wayland App

This includes two sample apps that render into a shared memory. Tested on pc (x64) and raspberry pi (arm64). The smoke app reacts on mouse input.

Screenshot of Golang Wayland Text Editor

This text editor is one of the sample apps. It is a Linux and Windows multiplatform programming text editor.

Dependencies

None, this is a pure go implementation. But for a meaningful keyboard (on Linux) support, you need the C libxkbcommon library for apps that require keyboard. On windows this is not necessary.

Golang install:

sudo apt-get install golang

or

sudo dnf install golang

Docker Installation Linux

Run the docker build command in the provided build.sh script.

Next, start your Wayland compositor, and run demos using the docker run commands that can be found in the run-shm.sh or run-smoke.sh scripts.

Important: If your docker requires root privileges, use sudo -E to start the programs. This is because $XDG_RUNTIME_DIR env variable is required.

Pre-Installation Linux

First, you need a wayland-enabled Linux, if you don't have one, install the Wayland compositor weston that is useful for testing:

sudo apt-get install weston

Install libxkbcommon:

sudo apt-get install libxkbcommon-dev

or in Fedora:

sudo dnf install libxkbcommon-devel

Install wayland-client and vulkan for cube:

sudo apt-get install libwayland-dev libvulkan-dev

On NVIDIA, install nvidia-egl-wayland for cube:

sudo apt-get install libnvidia-egl-wayland1

Pre-Installation Windows

You don't need to do anything special on Windows, simply continue using the install steps below

Installation (Windows and Linux)

Next, get the demos:

go get github.com/neurlang/wayland/...

Then, install them:

go install github.com/neurlang/wayland/go-wayland-simple-shm@latest
go install github.com/neurlang/wayland/go-wayland-smoke@latest
go install github.com/neurlang/wayland/go-wayland-imageviewer@latest
go install github.com/neurlang/wayland/go-wayland-texteditor@latest
go install github.com/neurlang/wayland/go-wayland-texteditor/editor_backend@latest

Using older golang (there is support for golang >= 1.18):

go get github.com/neurlang/wayland/go-wayland-simple-shm@latest
go get github.com/neurlang/wayland/go-wayland-smoke@latest
go get github.com/neurlang/wayland/go-wayland-imageviewer@latest
go get github.com/neurlang/wayland/go-wayland-texteditor@latest
go get github.com/neurlang/wayland/go-wayland-texteditor/editor_backend@latest

Finally, run weston and the executables.

Running the go-wayland-texteditor (Windows and Linux)

First, run the editor_backend executable

Secondly, run the go-wayland-texteditor executable, in the folder with the PNGs and JPGs (to see the fonts)

Documentation

Overview

Package wayland is the root of the wayland sample repository.

go-wayland-simple-shm

Simple shm demo, draws into shared memory, does not rely on the window package.

go-wayland-smoke

Smoke demo. Reacts on mouse input, uses the window package.

go-wayland-imageviewer

ImageViewer demo. Displays image file. Does not use window package, draws it's own decorations. Draws fonts in the titlebar, for this it needs the Deja Vu font fonts-dejavu.

go-wayland-editor

Editor demo. Currently does not work.

os

Provides basic OS functions like the creation of anonymous temporary file (CreateAnonymousFile), Mmap, Munmap, and Socket communication.

wlclient

Utility functions found in the wayland-client, provided for convenience.

xkbcommon

Wrapper around the C library libxkbcommon. Used inside the window package. Needs libxkbcommon-dev for compilation and recommends libx11-data for run time operation.

window

Implements a window model on top of wayland. Aims to be a lot like the original window.c code. Uses wl.

wlcursor

Loads an X cursors, requires to have a cursor theme installed, for instance dmz-cursor-theme.

cairoshim

Like cairo but not cairo. Does not depend on anything.

external

External contains an error checking code and the swizzle function for multiple architectures. No dependencies.

unstable

Unstable wayland protocols. Depends on wl.

wl

The wayland itself, does not require any external deps (except for wayland server during runtime).

xdg

Stable xdg protocol. Depends on wl.

Directories

Path Synopsis
Package cairo implements a simple dummy cairo api
Package cairo implements a simple dummy cairo api
cmd
external
error
Package error implements an external error
Package error implements an external error
swizzle
Package swizzle provides functions for converting between RGBA pixel formats.
Package swizzle provides functions for converting between RGBA pixel formats.
go-wayland-browser
mustard Module
Go Wayland Editor demo
Go Wayland Editor demo
Go Wayland ImageViewer demo
Go Wayland ImageViewer demo
Go Wayland SimpleShm demo
Go Wayland SimpleShm demo
Go Wayland Smoke demo
Go Wayland Smoke demo
Go Wayland Textarea demo
Go Wayland Textarea demo
Package libwayland implements a wayland protocol using wayland-client and wayland-cursor C libraries
Package libwayland implements a wayland protocol using wayland-client and wayland-cursor C libraries
Package os implements an operating system routines useful for graphics
Package os implements an operating system routines useful for graphics
Package window implements a convenient wayland windowing
Package window implements a convenient wayland windowing
Package wl implements the stable Wayland protocol
Package wl implements the stable Wayland protocol
Package wlclient implements a wayland-client like api
Package wlclient implements a wayland-client like api
Package wlcursor implements a Wayland cursor
Package wlcursor implements a Wayland cursor
xcursor
Package xcursor loads and parses the X cursor
Package xcursor loads and parses the X cursor
Package xdg implements the stable XDG Window Manager Base protocol
Package xdg implements the stable XDG Window Manager Base protocol
Package xkbcommon wraps the libxkbcommon library.
Package xkbcommon wraps the libxkbcommon library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL