fbee

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/fbee.h	Tue Feb 05 13:40:36 2013 +0200
     1.3 @@ -0,0 +1,57 @@
     1.4 +#ifndef FBEE_H_
     1.5 +#define FBEE_H_
     1.6 +
     1.7 +enum {
     1.8 +	FBEE_EV_DRAW,
     1.9 +	FBEE_EV_RESIZE,
    1.10 +	FBEE_EV_KEY,
    1.11 +	FBEE_EV_BUTTON,
    1.12 +	FBEE_EV_MOTION,
    1.13 +	FBEE_EV_IDLE,
    1.14 +
    1.15 +	NUM_FBEE_EVENTS
    1.16 +};
    1.17 +
    1.18 +/* callback prototypes:
    1.19 + *
    1.20 + * void draw_callback(void *cls);
    1.21 + * void resize_callback(int x, int y, void *cls);
    1.22 + * void keyb_callback(int key, int state, void *cls);
    1.23 + * void button_callback(int bn, int state, void *cls);
    1.24 + * void motion_callback(int x, int y, void *cls);
    1.25 + * void idle_callback(void *cls);
    1.26 + */
    1.27 +
    1.28 +#ifdef __cplusplus
    1.29 +extern "C" {
    1.30 +#endif
    1.31 +
    1.32 +int fbee_init(void);
    1.33 +void fbee_destroy(void);
    1.34 +
    1.35 +int fbee_set_video_mode(int width, int height, int bpp, unsigned int flags);
    1.36 +int fbee_get_video_mode(int *width, int *height, int *bpp);
    1.37 +
    1.38 +/* register an event callback */
    1.39 +void fbee_event_func(int evtype, void (*func)(), void *cls);
    1.40 +
    1.41 +/* run a single iteration of the event loop and return */
    1.42 +int fbee_process_events(void);
    1.43 +
    1.44 +/* start event processing (never returns) */
    1.45 +void fbee_evloop(void);
    1.46 +
    1.47 +/* signal fbee to redraw the window */
    1.48 +void fbee_redisplay(void);
    1.49 +
    1.50 +/* get a pointer to the framebuffer */
    1.51 +void *fbee_framebuffer(void);
    1.52 +
    1.53 +/* copy an image to the framebuffer (size and format must match) */
    1.54 +void fbee_update(void *img);
    1.55 +
    1.56 +#ifdef __cplusplus
    1.57 +}
    1.58 +#endif
    1.59 +
    1.60 +#endif	/* FBEE_H_ */