typedef struct {
guint state;
guint button;
- GSList *actions[NUM_MOUSEACTION]; /* lists of Action pointers */
+ GSList *actions[OB_MOUSE_NUM_ACTIONS]; /* lists of Action pointers */
} ObMouseBinding;
/* Array of GSList*s of PointerBinding*s. */
int j;
ObMouseBinding *b = it->data;
- for (j = 0; j < NUM_MOUSEACTION; ++j) {
+ for (j = 0; j < OB_MOUSE_NUM_ACTIONS; ++j) {
GSList *it;
for (it = b->actions[j]; it; it = it->next) {
action_free(it->data);
}
}
-static void fire_button(ObMouseAction a, ObFrameContext context,
- ObClient *c, guint state,
- guint button, int x, int y)
+static gboolean fire_button(ObMouseAction a, ObFrameContext context,
+ ObClient *c, guint state,
+ guint button, int x, int y)
{
GSList *it;
ObMouseBinding *b;
break;
}
/* if not bound, then nothing to do! */
- if (it == NULL) return;
+ if (it == NULL) return FALSE;
for (it = b->actions[a]; it; it = it->next) {
ObAction *act = it->data;
act->func(&act->data);
}
}
+ return TRUE;
}
-static void fire_motion(ObMouseAction a, ObFrameContext context, ObClient *c,
- guint state, guint button, int x_root, int y_root,
- guint32 corner)
+static gboolean fire_motion(ObMouseAction a, ObFrameContext context,
+ ObClient *c, guint state, guint button,
+ int x_root, int y_root, guint32 corner)
{
GSList *it;
ObMouseBinding *b;
break;
}
/* if not bound, then nothing to do! */
- if (it == NULL) return;
+ if (it == NULL) return FALSE;
for (it = b->actions[a]; it; it = it->next) {
ObAction *act = it->data;
act->func(&act->data);
}
}
+ return TRUE;
}
static guint32 pick_corner(int x, int y, int cx, int cy, int cw, int ch)
button = e->xbutton.button;
state = e->xbutton.state;
- fire_button(MouseAction_Press, context,
+ fire_button(OB_MOUSE_ACTION_PRESS, context,
client, e->xbutton.state,
e->xbutton.button,
e->xbutton.x_root, e->xbutton.y_root);
state = 0;
ltime = e->xbutton.time;
}
- fire_button(MouseAction_Release, context,
+ fire_button(OB_MOUSE_ACTION_RELEASE, context,
client, e->xbutton.state,
e->xbutton.button,
e->xbutton.x_root, e->xbutton.y_root);
if (click)
- fire_button(MouseAction_Click, context,
+ fire_button(OB_MOUSE_ACTION_CLICK, context,
client, e->xbutton.state,
e->xbutton.button,
e->xbutton.x_root,
e->xbutton.y_root);
if (dclick)
- fire_button(MouseAction_DClick, context,
+ fire_button(OB_MOUSE_ACTION_DOUBLE_CLICK, context,
client, e->xbutton.state,
e->xbutton.button,
e->xbutton.x_root,
client->area.height +
client->frame->size.top +
client->frame->size.bottom);
- fire_motion(MouseAction_Motion, context,
+ fire_motion(OB_MOUSE_ACTION_MOTION, context,
client, state, button, px, py, corner);
button = 0;
state = 0;