summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-07-10 06:18:47 +0000
committerDana Jansens <danakj@orodu.net>2003-07-10 06:18:47 +0000
commit276b2be581c6cb138b439537761ff2ca42201805 (patch)
tree753038e7990b881a2bc0e525fab1ebc45b2523e3 /plugins
parent6357583c396382dd6ed8ac42004177f204fabe62 (diff)
add misc.h with some standard enumerations with proper prefixing and capitalizations.
use the new enums throughout. provide keycodes and cursors through ob_cursor and ob_keycode functions, which use the new misc.h enums for picking the cursor and keycode.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/keyboard/keyboard.c10
-rw-r--r--plugins/placement/history.c4
-rw-r--r--plugins/placement/placement.c4
-rw-r--r--plugins/resistance/resistance.c34
4 files changed, 24 insertions, 28 deletions
diff --git a/plugins/keyboard/keyboard.c b/plugins/keyboard/keyboard.c
index 3fe74aea..45b93ac4 100644
--- a/plugins/keyboard/keyboard.c
+++ b/plugins/keyboard/keyboard.c
@@ -78,7 +78,7 @@ void plugin_setup_config()
KeyBindingTree *firstnode = NULL;
static KeyBindingTree *curpos;
-static guint reset_key, reset_state, button_return, button_escape;
+static guint reset_key, reset_state;
static Timer *chain_timer;
static void grab_for_window(Window win, gboolean grab)
@@ -177,9 +177,9 @@ static void event(ObEvent *e, void *foo)
!(grabbed_key->state & e->data.x.e->xkey.state)))
done = TRUE;
else if (e->type == Event_X_KeyPress) {
- if (e->data.x.e->xkey.keycode == button_return)
+ if (e->data.x.e->xkey.keycode == ob_keycode(OB_KEY_RETURN))
done = TRUE;
- else if (e->data.x.e->xkey.keycode == button_escape) {
+ else if (e->data.x.e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) {
GSList *it;
for (it = grabbed_key->actions; it; it = it->next) {
Action *act = it->data;
@@ -258,8 +258,6 @@ static void event(ObEvent *e, void *foo)
void plugin_startup()
{
- guint i;
-
curpos = NULL;
chain_timer = NULL;
@@ -268,8 +266,6 @@ void plugin_startup()
(EventHandler)event, NULL);
translate_key("C-g", &reset_state, &reset_key);
- translate_key("Escape", &i, &button_escape);
- translate_key("Return", &i, &button_return);
grab_keys(TRUE);
}
diff --git a/plugins/placement/history.c b/plugins/placement/history.c
index 797aef3b..f2b4ea63 100644
--- a/plugins/placement/history.c
+++ b/plugins/placement/history.c
@@ -58,7 +58,7 @@ gboolean place_history(Client *c)
if (hi && !(hi->flags & PLACED)) {
hi->flags |= PLACED;
- if (ob_state != State_Starting) {
+ if (ob_state != OB_STATE_STARTING) {
if (hi->flags & HAVE_POSITION ||
hi->flags & HAVE_SIZE) {
if (hi->flags & HAVE_POSITION) {
@@ -77,7 +77,7 @@ gboolean place_history(Client *c)
w = c->area.width;
h = c->area.height;
}
- client_configure(c, Corner_TopLeft, x, y, w, h,
+ client_configure(c, OB_CORNER_TOPLEFT, x, y, w, h,
TRUE, TRUE);
}
if (hi->flags & HAVE_DESKTOP) {
diff --git a/plugins/placement/placement.c b/plugins/placement/placement.c
index 589e0a30..b567e229 100644
--- a/plugins/placement/placement.c
+++ b/plugins/placement/placement.c
@@ -30,7 +30,7 @@ static void place_random(Client *c)
int x, y;
Rect *area;
- if (ob_state == State_Starting) return;
+ if (ob_state == OB_STATE_STARTING) return;
area = screen_area_monitor(c->desktop,
g_random_int_range(0, screen_num_monitors));
@@ -46,7 +46,7 @@ static void place_random(Client *c)
else y = 0;
frame_frame_gravity(c->frame, &x, &y); /* get where the client should be */
- client_configure(c, Corner_TopLeft, x, y, c->area.width, c->area.height,
+ client_configure(c, OB_CORNER_TOPLEFT, x, y, c->area.width, c->area.height,
TRUE, TRUE);
}
diff --git a/plugins/resistance/resistance.c b/plugins/resistance/resistance.c
index 31844752..b9539e40 100644
--- a/plugins/resistance/resistance.c
+++ b/plugins/resistance/resistance.c
@@ -131,7 +131,7 @@ static void resist_move(Client *c, int *x, int *y)
}
}
-static void resist_size(Client *c, int *w, int *h, Corner corn)
+static void resist_size(Client *c, int *w, int *h, ObCorner corn)
{
GList *it;
Client *target; /* target */
@@ -177,15 +177,15 @@ static void resist_size(Client *c, int *w, int *h, Corner corn)
/* horizontal snapping */
if (t < tb && b > tt) {
switch (corn) {
- case Corner_TopLeft:
- case Corner_BottomLeft:
+ case OB_CORNER_TOPLEFT:
+ case OB_CORNER_BOTTOMLEFT:
dlt = l;
drb = r + *w - c->frame->area.width;
if (r < tl && drb >= tl && drb < tl + resistance)
*w = tl - l, snapx = target;
break;
- case Corner_TopRight:
- case Corner_BottomRight:
+ case OB_CORNER_TOPRIGHT:
+ case OB_CORNER_BOTTOMRIGHT:
dlt = l - *w + c->frame->area.width;
drb = r;
if (l > tr && dlt <= tr && dlt > tr - resistance)
@@ -199,15 +199,15 @@ static void resist_size(Client *c, int *w, int *h, Corner corn)
/* vertical snapping */
if (l < tr && r > tl) {
switch (corn) {
- case Corner_TopLeft:
- case Corner_TopRight:
+ case OB_CORNER_TOPLEFT:
+ case OB_CORNER_TOPRIGHT:
dlt = t;
drb = b + *h - c->frame->area.height;
if (b < tt && drb >= tt && drb < tt + resistance)
*h = tt - t, snapy = target;
break;
- case Corner_BottomLeft:
- case Corner_BottomRight:
+ case OB_CORNER_BOTTOMLEFT:
+ case OB_CORNER_BOTTOMRIGHT:
dlt = t - *h + c->frame->area.height;
drb = b;
if (t > tb && dlt <= tb && dlt > tb - resistance)
@@ -226,15 +226,15 @@ static void resist_size(Client *c, int *w, int *h, Corner corn)
/* horizontal snapping */
switch (corn) {
- case Corner_TopLeft:
- case Corner_BottomLeft:
+ case OB_CORNER_TOPLEFT:
+ case OB_CORNER_BOTTOMLEFT:
dlt = l;
drb = r + *w - c->frame->area.width;
if (r <= ar && drb > ar && drb <= ar + resistance)
*w = ar - l + 1;
break;
- case Corner_TopRight:
- case Corner_BottomRight:
+ case OB_CORNER_TOPRIGHT:
+ case OB_CORNER_BOTTOMRIGHT:
dlt = l - *w + c->frame->area.width;
drb = r;
if (l >= al && dlt < al && dlt >= al - resistance)
@@ -244,15 +244,15 @@ static void resist_size(Client *c, int *w, int *h, Corner corn)
/* vertical snapping */
switch (corn) {
- case Corner_TopLeft:
- case Corner_TopRight:
+ case OB_CORNER_TOPLEFT:
+ case OB_CORNER_TOPRIGHT:
dlt = t;
drb = b + *h - c->frame->area.height;
if (b <= ab && drb > ab && drb <= ab + resistance)
*h = ab - t + 1;
break;
- case Corner_BottomLeft:
- case Corner_BottomRight:
+ case OB_CORNER_BOTTOMLEFT:
+ case OB_CORNER_BOTTOMRIGHT:
dlt = t - *h + c->frame->area.height;
drb = b;
if (t >= at && dlt < at && dlt >= at - resistance)