seed random from ruby interface
[swftools.git] / lib / gfxwindow.h
1 /* gfxwindow.h 
2
3    Simple GUI abstraction.
4
5    Part of the swftools package.
6
7    Copyright (c) 2005 Matthias Kramm <kramm@quiss.org> 
8
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
22
23 #ifndef __gfxwindow_h__
24 #define __gfxwindow_h__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #define GFXEVENT_NOTHING 0
31
32 #define GFXEVENT_KEY 4
33 #define GFXEVENT_KEYPRESS 4
34 #define GFXEVENT_KEYRELEASE 5
35
36 #define GFXEVENT_MOUSEPRESS 8
37 #define GFXEVENT_MOUSERELEASE 9
38 #define GFXEVENT_MOUSEMOVE 10
39 #define GFXEVENT_MOUSEENTER 11
40 #define GFXEVENT_MOUSELEAVE 12
41
42 #define GFXEVENT_DESTROY 16
43
44 typedef struct _gfxevent
45 {
46     void * internal;
47     int type;
48     int key; //if type == KEY
49     int x,y; //if type == MOUSEMOVED
50     int button; //if type = MOUSEPRESSED/RELEASED
51 } gfxevent_t;
52
53 typedef struct _gfxwindow
54 {
55     void * internal;
56     unsigned char* currentscr;
57     unsigned char* lastscr;
58     int width;
59     int height;
60     void (*flippage)(struct _gfxwindow*win);
61     void (*move)(struct _gfxwindow*win,int x, int y);
62     void (*resize)(struct _gfxwindow*win,int width, int height);
63     gfxevent_t (*getEvent)(struct _gfxwindow*win);
64     void (*destroy)(struct _gfxwindow*win);
65 } gfxwindow_t;
66
67 gfxwindow_t* gfxwindow_new(int width, int height);
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif