Code Monkey home page Code Monkey logo

skylight's Introduction

Skylight

This is an implementation of Wayland McWayface Part 3 by Drew DeVault. In order to have bindings of wlroots and wayland within java, I've made use of the jextract utility provided by project panama. However, I've also made use of the foreign api directly as well, which can be seen in usr.include.stdlib in the scala sources.

In the future, this project will become it's own thing, taking some cues from tinywm by the wlroots project.

Dependencies

In order to build and run this project you will need build ea+70 of project panama on jdk 13. You'll also need the wayland development libraries, the wlroots library and development libraries, clang, libpixman's development libraries, libxkbcommon and possibly others.

Building

Run sbt compile in the root of the project directory to build the project.

Check the following settings in build.sbt if build fails:

xdgShellProtocolLocation := file("/usr/share/wayland-protocols/unstable/xdg-shell/xdg-shell-unstable-v6.xml")

includeDirectory := file("/usr/include")

libraryDirectory := file("/usr/lib64")

Make sure they point to your xdg-shell-unstable-v6.xml, your include path, and the path that contains the .so files on your system.

Implementation

I have implemented the Wayland McWayface part 3 demo as written here for the most part. Below are the list of changes I've made...

  • wl_container_of is not used in some places where the original demo uses it. The following implementation...

    static void output_frame_notify(struct wl_listener *listener, void *data) {
         struct mcw_output *output = wl_container_of(listener, output, frame);

    has changed to...

    lazy val output_frame_notify: FI5 = (_: Pointer[wl_listener], data: Pointer[_]) => {

    I've made this change because scala has closures and mcw_output would have to become a C struct in order to retrieve it from the listener embedded within it.

  • mcw_output does not have a link member because we store it in outputs: Set[mcw_output] within mcw_server instead a wl_list.

  • I use constructors for mcw_server and mcw_output instead of treating them as structs.

  • I've implemented wl_signal_add in my code because it is inlined in the original library.

  • I've implemented wl_container_of in my code because it's a macro in the original wayland library.

  • There are a few api changes from the original tutorial because the wlroots api has changed between version 0.2 (which was used in Drew DeVault's tutorial) and version 0.3. This project targets wlroots version 0.3

Notes

In part 3 it shows using gnome-terminal with wayland mcwayface. I could not get gnome-terminal working, but weston-terminal works just fine:

Imgur

Also, I've added wl_display_terminate to the output_destroy_notify callback in order to have the WindowManager close when the display is closed.

skylight's People

Contributors

conflate avatar lowlifeplanet avatar markehammons avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

skylight's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.