fbee

view src/fbee.h @ 0:88a2049be27b

fbee initial
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 05 Feb 2013 13:40:36 +0200
parents
children
line source
1 #ifndef FBEE_H_
2 #define FBEE_H_
4 enum {
5 FBEE_EV_DRAW,
6 FBEE_EV_RESIZE,
7 FBEE_EV_KEY,
8 FBEE_EV_BUTTON,
9 FBEE_EV_MOTION,
10 FBEE_EV_IDLE,
12 NUM_FBEE_EVENTS
13 };
15 /* callback prototypes:
16 *
17 * void draw_callback(void *cls);
18 * void resize_callback(int x, int y, void *cls);
19 * void keyb_callback(int key, int state, void *cls);
20 * void button_callback(int bn, int state, void *cls);
21 * void motion_callback(int x, int y, void *cls);
22 * void idle_callback(void *cls);
23 */
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
29 int fbee_init(void);
30 void fbee_destroy(void);
32 int fbee_set_video_mode(int width, int height, int bpp, unsigned int flags);
33 int fbee_get_video_mode(int *width, int *height, int *bpp);
35 /* register an event callback */
36 void fbee_event_func(int evtype, void (*func)(), void *cls);
38 /* run a single iteration of the event loop and return */
39 int fbee_process_events(void);
41 /* start event processing (never returns) */
42 void fbee_evloop(void);
44 /* signal fbee to redraw the window */
45 void fbee_redisplay(void);
47 /* get a pointer to the framebuffer */
48 void *fbee_framebuffer(void);
50 /* copy an image to the framebuffer (size and format must match) */
51 void fbee_update(void *img);
53 #ifdef __cplusplus
54 }
55 #endif
57 #endif /* FBEE_H_ */