| 1 |
/* The Ace of Penguins - funcs.c |
| 2 |
Copyright (C) 2001 DJ Delorie |
| 3 |
|
| 4 |
This program is free software; you can redistribute it and/or modify |
| 5 |
it under the terms of the GNU General Public License as published by |
| 6 |
the Free Software Foundation; either version 2, or (at your option) |
| 7 |
any later version. |
| 8 |
|
| 9 |
This program is distributed in the hope that it will be useful, |
| 10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
GNU General Public License for more details. |
| 13 |
|
| 14 |
You should have received a copy of the GNU General Public License |
| 15 |
along with this program; if not, write to the Free Software |
| 16 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
| 17 |
|
| 18 |
|
| 19 |
#include <stdlib.h> |
| 20 |
#include "funcs.h" |
| 21 |
|
| 22 |
static void |
| 23 |
default_click_cb(int x, int y, int b) |
| 24 |
{ |
| 25 |
} |
| 26 |
|
| 27 |
void (*click_cb)(int,int,int) = default_click_cb; |
| 28 |
|
| 29 |
static void |
| 30 |
default_drag_cb(int x, int y, int b) |
| 31 |
{ |
| 32 |
} |
| 33 |
|
| 34 |
void (*drag_cb)(int,int,int) = default_drag_cb; |
| 35 |
|
| 36 |
static void |
| 37 |
default_redraw_cb() |
| 38 |
{ |
| 39 |
stack_redraw(); |
| 40 |
} |
| 41 |
|
| 42 |
void (*redraw_cb)() = default_redraw_cb; |
| 43 |
|
| 44 |
static void |
| 45 |
default_init_cb() |
| 46 |
{ |
| 47 |
} |
| 48 |
|
| 49 |
void (*init_cb)() = default_init_cb; |
| 50 |
|
| 51 |
static void |
| 52 |
default_drop_cb(int x, int y, int b) |
| 53 |
{ |
| 54 |
} |
| 55 |
|
| 56 |
void (*drop_cb)(int,int,int) = default_drop_cb; |
| 57 |
|
| 58 |
static void |
| 59 |
default_key_cb(int x, int y, int k) |
| 60 |
{ |
| 61 |
if (k == 3 || k == 27 || k == 'q') |
| 62 |
exit(0); |
| 63 |
} |
| 64 |
|
| 65 |
void (*key_cb)(int,int,int) = default_key_cb; |
| 66 |
|
| 67 |
static void |
| 68 |
default_resize_cb(int w, int h) |
| 69 |
{ |
| 70 |
table_no_resize(); |
| 71 |
} |
| 72 |
|
| 73 |
void (*resize_cb)(int,int) = default_resize_cb; |
| 74 |
|
| 75 |
static void |
| 76 |
default_double_click_cb(int x, int y, int b) |
| 77 |
{ |
| 78 |
click_cb(x, y, b); |
| 79 |
} |
| 80 |
|
| 81 |
void (*double_click_cb)(int,int,int) = default_double_click_cb; |