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

Commit

Permalink
Merge pull request #44 from Immington-Industries/view_properties_call…
Browse files Browse the repository at this point in the history
…back

View properties callback
  • Loading branch information
Timidger authored Aug 15, 2016
2 parents befb1b2 + 3425a35 commit f5a0090
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ extern "C" {

// Input device was destroyed. (Experimental)
//fn wlc_set_input_destroyed_cb(cb: extern "C" fn(&LibinputDevice));

// View properties were updated
fn wlc_set_view_properties_updated_cb(cb: extern "C" fn(handle: WlcView, mask: ViewPropertyType));
}

/// Callback invoked when an output is created.
Expand Down Expand Up @@ -517,3 +520,14 @@ pub fn compositor_terminate(callback: extern "C" fn()) {
wlc_set_compositor_terminate_cb(callback);
}
}

/// Callback invoked when a WlcView has its properties updated.
///
/// # Arguments
/// * `view`: View handle that is changing its properties
/// * `mask`: Bitflag of which property is being updated
pub fn view_properties_changed(callback: extern "C" fn(handle: WlcView, mask: ViewPropertyType)) {
unsafe {
wlc_set_view_properties_updated_cb(callback);
}
}
13 changes: 13 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ bitflags! {
}
}

bitflags! {
/// Which view property is being updated
#[repr(C)]
pub flags ViewPropertyType: u32 {
/// View title is being updated
const PROPERTY_TITLE = 0,
/// View class is being updated
const PROPRETY_CLASS = 1,
/// View app id is being updated
const PROPERTY_APP_ID = 2,
}
}

bitflags! {
/// Represents which keyboard meta keys are being pressed.
#[repr(C)]
Expand Down

0 comments on commit f5a0090

Please sign in to comment.