Skip to content

Commit

Permalink
move old handlers to bak, add handlers module with generated dummies
Browse files Browse the repository at this point in the history
  • Loading branch information
ntBre committed Jul 28, 2024
1 parent 79db190 commit 9afb792
Show file tree
Hide file tree
Showing 4 changed files with 490 additions and 409 deletions.
11 changes: 11 additions & 0 deletions scripts/generate_handlers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

handlers="buttonpress clientmessage configurerequest configurenotify
destroynotify enternotify expose focusin keypress mappingnotify maprequest
motionnotify propertynotify unmapnotify"

for i in $handlers
do
echo "fn $i(e: *mut XEvent) { unsafe { bindgen::$i(e) } }"
echo
done
71 changes: 71 additions & 0 deletions src/handlers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
use crate::bindgen::{self, XEvent};

// DUMMY
pub(crate) fn buttonpress(e: *mut XEvent) {
unsafe { bindgen::buttonpress(e) }
}

// DUMMY
pub(crate) fn clientmessage(e: *mut XEvent) {
unsafe { bindgen::clientmessage(e) }
}

// DUMMY
pub(crate) fn configurerequest(e: *mut XEvent) {
unsafe { bindgen::configurerequest(e) }
}

// DUMMY
pub(crate) fn configurenotify(e: *mut XEvent) {
unsafe { bindgen::configurenotify(e) }
}

// DUMMY
pub(crate) fn destroynotify(e: *mut XEvent) {
unsafe { bindgen::destroynotify(e) }
}

// DUMMY
pub(crate) fn enternotify(e: *mut XEvent) {
unsafe { bindgen::enternotify(e) }
}

// DUMMY
pub(crate) fn expose(e: *mut XEvent) {
unsafe { bindgen::expose(e) }
}

// DUMMY
pub(crate) fn focusin(e: *mut XEvent) {
unsafe { bindgen::focusin(e) }
}

// DUMMY
pub(crate) fn keypress(e: *mut XEvent) {
unsafe { bindgen::keypress(e) }
}

// DUMMY
pub(crate) fn mappingnotify(e: *mut XEvent) {
unsafe { bindgen::mappingnotify(e) }
}

// DUMMY
pub(crate) fn maprequest(e: *mut XEvent) {
unsafe { bindgen::maprequest(e) }
}

// DUMMY
pub(crate) fn motionnotify(e: *mut XEvent) {
unsafe { bindgen::motionnotify(e) }
}

// DUMMY
pub(crate) fn propertynotify(e: *mut XEvent) {
unsafe { bindgen::propertynotify(e) }
}

// DUMMY
pub(crate) fn unmapnotify(e: *mut XEvent) {
unsafe { bindgen::unmapnotify(e) }
}
Loading

0 comments on commit 9afb792

Please sign in to comment.