File: actions.C

package info (click to toggle)
xshisen 1:1.51-4.1+deb8u1
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 1,156 kB
  • ctags: 553
  • sloc: cpp: 4,008; sh: 152; perl: 146; makefile: 114
file content (44 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "body.h"

void
PickupPieceAC(Widget w, XEvent *event, String *params, Cardinal *num)
{
    XButtonEvent *e = &(event->xbutton);
    if (e->type != ButtonPress) return;
    bd->GetPiece(e->x, e->y);
#if DEBUG
    fprintf(stderr, "PickupPieceAC: (%d,%d) %d\n", e->x, e->y, e->button);
#endif
}

void
CancelPieceAC(Widget w, XEvent *event, String *params, Cardinal *num)
{
    XButtonEvent *e = &(event->xbutton);
    if (e->type != ButtonPress) return;
    bd->CancelPiece(e->x, e->y);
#if DEBUG
    fprintf(stderr, "CancelPieceAC: (%d,%d) %d\n", e->x, e->y, e->button);
#endif
}

void
MenuAC(Widget w, XEvent *event, String *params, Cardinal *num)
{
#if DEBUG
    fprintf(stderr, "MenuAC: (%d,%d)\n",atoi(params[0]),atoi(params[1]));
#endif
    if (*num < 2)
        GameCB(w, 4);
    switch(params[0][0]) {
    case '0':
        GameCB(w, atoi(params[1]));
        break;
    case '1':
        SuppCB(w, atoi(params[1]));
        break;
    case '2':
        ChangeGameCB(w, atoi(params[1]), NULL);
        break;
    }
}