fbee

annotate 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
rev   line source
nuclear@0 1 #ifndef FBEE_H_
nuclear@0 2 #define FBEE_H_
nuclear@0 3
nuclear@0 4 enum {
nuclear@0 5 FBEE_EV_DRAW,
nuclear@0 6 FBEE_EV_RESIZE,
nuclear@0 7 FBEE_EV_KEY,
nuclear@0 8 FBEE_EV_BUTTON,
nuclear@0 9 FBEE_EV_MOTION,
nuclear@0 10 FBEE_EV_IDLE,
nuclear@0 11
nuclear@0 12 NUM_FBEE_EVENTS
nuclear@0 13 };
nuclear@0 14
nuclear@0 15 /* callback prototypes:
nuclear@0 16 *
nuclear@0 17 * void draw_callback(void *cls);
nuclear@0 18 * void resize_callback(int x, int y, void *cls);
nuclear@0 19 * void keyb_callback(int key, int state, void *cls);
nuclear@0 20 * void button_callback(int bn, int state, void *cls);
nuclear@0 21 * void motion_callback(int x, int y, void *cls);
nuclear@0 22 * void idle_callback(void *cls);
nuclear@0 23 */
nuclear@0 24
nuclear@0 25 #ifdef __cplusplus
nuclear@0 26 extern "C" {
nuclear@0 27 #endif
nuclear@0 28
nuclear@0 29 int fbee_init(void);
nuclear@0 30 void fbee_destroy(void);
nuclear@0 31
nuclear@0 32 int fbee_set_video_mode(int width, int height, int bpp, unsigned int flags);
nuclear@0 33 int fbee_get_video_mode(int *width, int *height, int *bpp);
nuclear@0 34
nuclear@0 35 /* register an event callback */
nuclear@0 36 void fbee_event_func(int evtype, void (*func)(), void *cls);
nuclear@0 37
nuclear@0 38 /* run a single iteration of the event loop and return */
nuclear@0 39 int fbee_process_events(void);
nuclear@0 40
nuclear@0 41 /* start event processing (never returns) */
nuclear@0 42 void fbee_evloop(void);
nuclear@0 43
nuclear@0 44 /* signal fbee to redraw the window */
nuclear@0 45 void fbee_redisplay(void);
nuclear@0 46
nuclear@0 47 /* get a pointer to the framebuffer */
nuclear@0 48 void *fbee_framebuffer(void);
nuclear@0 49
nuclear@0 50 /* copy an image to the framebuffer (size and format must match) */
nuclear@0 51 void fbee_update(void *img);
nuclear@0 52
nuclear@0 53 #ifdef __cplusplus
nuclear@0 54 }
nuclear@0 55 #endif
nuclear@0 56
nuclear@0 57 #endif /* FBEE_H_ */