Git Product home page Git Product logo

jwlc's Introduction

JWLC - Java bindings for libwlc

Currently wrapped version - 6a05b372d89fcaa884b7bb9694b55a7935506db6

Compiling and running examples

Compile example: javac -cp "./jna-4.4.0.jar:./jwlc-0.0.8.jar" jwlc/Example.java

Run example: java -cp "./jna-4.4.0.jar:./jwlc-0.0.8.jar:./" jwlc/Example

Example

This is the example from libwlc's readme.md but in Java.

import cz.upol.inf.vanusanik.jwlc.JWLC;
import cz.upol.inf.vanusanik.jwlc.wlc.View;
import cz.upol.inf.vanusanik.jwlc.wlc.ViewState;
import cz.upol.inf.vanusanik.jwlc.wlc.callbacks.ViewCreatedCallback;
import cz.upol.inf.vanusanik.jwlc.wlc.callbacks.ViewFocusCallback;

public class ExampleWebExample {

	public static void main(String[] args) throws Exception {
		View.setCreatedCallback(new ViewCreatedCallback() {
			
			public boolean onViewCreated(View view) {
				view.setMask(view.getOutput().getMask());
				view.bringToFront();
				view.focus();
				return true;
			}
		});
		
		View.setFocusCallback(new ViewFocusCallback() {
			
			public void onFocusChange(View view, boolean focusState) {
				view.setState(ViewState.ACTIVATED, focusState);
			}
		});
		
		JWLC.init();
		JWLC.run();
	}

}

For original example.c from libwlc, see jwlc.Example.java in src/test/examples.

Also, see package jwlc in src/test/examples for more different examples what you can do with this library.

Main api classes

cz.upol.inf.vanusanik.jwlc.JWLC - main class, init and termination is handled by static methods of it.

cz.upol.inf.vanusanik.jwlc.Compositor - compositor callbacks

cz.upol.inf.vanusanik.jwlc.Event - FD and timed event handling

cz.upol.inf.vanusanik.jwlc.Keyboard - keyboard related methods and callbacks

cz.upol.inf.vanusanik.jwlc.Mouse - nouse related methods and callbacks

cz.upol.inf.vanusanik.jwlc.Resource - surface resources

package cz.upol.inf.vanusanik.jwlc.geometry - geometry related classes (Point, Size, Geometry)

cz.upol.inf.vanusanik.jwlc.render.Framebuffer - framebuffer related methods

cz.upol.inf.vanusanik.jwlc.wlc.Output - output related methods and callbacks

cz.upol.inf.vanusanik.jwlc.View - view related methods and callbacks

package cz.upol.inf.vanusanik.jwlc.wlc.callbacks - all high level callback interfaces

Documentation

See doc for generated javadoc.

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.