Skip to content
This repository has been archived by the owner on Jan 11, 2020. It is now read-only.

Commit

Permalink
Merge version-stability into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SnirkImmington committed Apr 11, 2016
2 parents e58c076 + 29eb04c commit 014ee2b
Show file tree
Hide file tree
Showing 12 changed files with 768 additions and 134 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cargo.lock
/target/
/example/target/
*.bk
18 changes: 0 additions & 18 deletions Cargo.lock

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rustwlc"
description = "wlc Wayland library bindings for Rust"
version = "0.2.1"
version = "0.3.0"
repository = "https://github.com/Immington-Industries/rust-wlc/"
keywords = ["wlc", "Wayland", "compositor", "bindings"]
readme = "README.md"
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

Rust bindings for [wlc](https://github.com/Cloudef/wlc), the Wayland compositor library.

Currently requires a version of wlc from before the `v0.0.1` release.
Requires [wlc](https:://github.com/Cloudef/wlc) v0.0.1 or later.

### Rust Example

```rust
// For more functional example see example/src/main.rs

extern crate rustwlc;
use rustwlc::interface::WlcView;
use rustwlc::callback;
use rustwlc::types::*;

// Callbacks must be labeled extern as they will be called from C
Expand All @@ -29,22 +29,22 @@ extern "C" fn view_focus(view: WlcView, focused: bool) {
}

fn main() {
let interface = WlcInterface::new()
.view_created(view_created)
.view_focus(view_focus);
callback::view_created(view_created)
callback::view_focus(view_focus);

// The default log handler will print wlc logs to stdout
rustwlc::log_set_default_handler();
let run_fn = rustwlc::init(interface).expect("Unable to initialize!");
let run_fn = rustwlc::init().expect("Unable to initialize!");
run_fn();
}
```

### Usage
We're on [crates.io](https://crates.io/crates/rustwlc), so to use the library simply add:

```toml
[depdenencies]
rustwlc = "0.2.1"
rustwlc = "^0.3"
```
to your Cargo.toml.

Expand Down
8 changes: 4 additions & 4 deletions example/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 10 additions & 12 deletions example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ extern crate lazy_static;
extern crate rustwlc;

use rustwlc::*;
use rustwlc::interface::*;
use rustwlc::handle::{WlcView, WlcOutput};
use rustwlc::types::*;
use rustwlc::xkb::keysyms;
Expand Down Expand Up @@ -286,19 +285,18 @@ extern fn on_pointer_motion(_in_view: WlcView, _time: u32, point: &Point) -> boo
}

fn main() {
let interface = WlcInterface::new()
.output_resolution(on_output_resolution)
.view_created(on_view_created)
.view_destroyed(on_view_destroyed)
.view_focus(on_view_focus)
.view_request_move(on_view_request_move)
.view_request_resize(on_view_request_resize)
.keyboard_key(on_keyboard_key)
.pointer_button(on_pointer_button)
.pointer_motion(on_pointer_motion);
callback::output_resolution(on_output_resolution);
callback::view_created(on_view_created);
callback::view_destroyed(on_view_destroyed);
callback::view_focus(on_view_focus);
callback::view_request_move(on_view_request_move);
callback::view_request_resize(on_view_request_resize);
callback::keyboard_key(on_keyboard_key);
callback::pointer_button(on_pointer_button);
callback::pointer_motion(on_pointer_motion);

rustwlc::log_set_default_handler();
let run_fn = rustwlc::init(interface).expect("Unable to initialize!");
let run_fn = rustwlc::init2().expect("Unable to initialize wlc!");
run_fn();
}

Loading

0 comments on commit 014ee2b

Please sign in to comment.