diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2007-12-19 01:44:31 +0100 |
---|---|---|
committer | Kristian Lyngstol <kristian@windu.lyngstol.net> | 2007-12-19 01:44:31 +0100 |
commit | ccd74c19c116b38964d14e4c80f46a2c15090d76 (patch) | |
tree | 9e0e3c167cec47b47a38b6b77ffd266897eeeb2f /shelf.c | |
parent | b982d3af31495b5b51493f45dfdb6c31b91a91bc (diff) | |
download | shelf-ccd74c19c116b38964d14e4c80f46a2c15090d76.tar.gz shelf-ccd74c19c116b38964d14e4c80f46a2c15090d76.tar.bz2 |
Floating binding
Diffstat (limited to 'shelf.c')
-rw-r--r-- | shelf.c | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -101,6 +101,49 @@ shelfTrigger (CompDisplay *d, return TRUE; } +/* shelfInc and shelfDec are matcing functions and bindings; + * They increase and decrease the scale factor by 'interval'. + */ +static Bool +shelfInc (CompDisplay *d, + CompAction *action, + CompActionState state, + CompOption *option, + int nOption) +{ + CompWindow *w = findWindowAtDisplay (d, d->activeWindow); + if (!w) + return TRUE; + SHELF_SCREEN (w->screen); + SHELF_WINDOW (w); + sw->scale += shelfGetInterval(d); + if (sw->scale >= 1.00f) + sw->scale = 1.00f; + shelfShapeInput (w); + damageScreen (w->screen); + return TRUE; +} + +static Bool +shelfDec (CompDisplay *d, + CompAction *action, + CompActionState state, + CompOption *option, + int nOption) +{ + CompWindow *w = findWindowAtDisplay (d, d->activeWindow); + if (!w) + return TRUE; + SHELF_SCREEN (w->screen); + SHELF_WINDOW (w); + sw->scale -= shelfGetInterval(d); + if (sw->scale < 0.001f) + sw->scale = 0.001f; + shelfShapeInput (w); + damageScreen (w->screen); + return TRUE; +} + /* The window was damaged, adjust the damage to fit the actual area we * care about. * @@ -228,6 +271,8 @@ shelfInitDisplay (CompPlugin *p, return FALSE; } shelfSetTriggerKeyInitiate (d, shelfTrigger); + shelfSetIncButtonInitiate (d, shelfInc); + shelfSetDecButtonInitiate (d, shelfDec); return TRUE; } |