summaryrefslogtreecommitdiff
path: root/shelf.c
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2007-12-19 01:44:31 +0100
committerKristian Lyngstol <kristian@windu.lyngstol.net>2007-12-19 01:44:31 +0100
commitccd74c19c116b38964d14e4c80f46a2c15090d76 (patch)
tree9e0e3c167cec47b47a38b6b77ffd266897eeeb2f /shelf.c
parentb982d3af31495b5b51493f45dfdb6c31b91a91bc (diff)
downloadshelf-ccd74c19c116b38964d14e4c80f46a2c15090d76.tar.gz
shelf-ccd74c19c116b38964d14e4c80f46a2c15090d76.tar.bz2
Floating binding
Diffstat (limited to 'shelf.c')
-rw-r--r--shelf.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/shelf.c b/shelf.c
index 745f320..ff8a54d 100644
--- a/shelf.c
+++ b/shelf.c
@@ -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;
}