2 * (C) GraÅžvydas "notaz" Ignotas, 2010-2012
4 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
5 * See the COPYING file in the top-level directory.
8 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
10 #define err(fmt, ...) \
11 fprintf(stderr, "omapsdl: " fmt "\n", ##__VA_ARGS__)
12 #define err_perror(fmt, ...) do { \
13 fprintf(stderr, "omapsdl: " fmt ": ", ##__VA_ARGS__); \
16 #define log(fmt, ...) \
17 fprintf(stdout, "omapsdl: " fmt "\n", ##__VA_ARGS__)
18 #define not_supported() \
19 fprintf(stderr, "omapsdl: %s not supported\n", __FUNCTION__)
21 #define trace(fmt, ...) printf(" %s(" fmt ")\n", __FUNCTION__, ##__VA_ARGS__)
28 struct SDL_PrivateVideoData {
29 struct vout_fbdev *fbdev;
31 /* physical screen size, should match touchscreen */
34 int layer_x, layer_y, layer_w, layer_h;
35 /* SDL surface borders to hide */
36 int border_l, border_r, border_t, border_b;
37 /* phys -> layer coord multipliers (16.16) */
40 unsigned int xenv_up:1;
41 unsigned int xenv_mouse:1;
42 unsigned int app_uses_flip:1;
43 unsigned int cfg_force_vsync:1;
44 unsigned int cfg_force_doublebuf:1;
45 unsigned int cfg_no_ts_translate:1;
46 unsigned int cfg_ts_force_tslib:1;
49 void *osdl_video_set_mode(struct SDL_PrivateVideoData *pdata,
50 int border_l, int border_r, int border_t, int border_b,
51 int width, int height, int bpp, int *doublebuf,
52 const char *wm_title);
53 void *osdl_video_flip(struct SDL_PrivateVideoData *pdata);
54 int osdl_video_detect_screen(struct SDL_PrivateVideoData *pdata);
55 int osdl_video_pause(struct SDL_PrivateVideoData *pdata, int is_pause);
56 void osdl_video_finish(struct SDL_PrivateVideoData *pdata);
58 void omapsdl_input_init(void);
59 void omapsdl_input_bind(const char *kname, const char *sdlname);
60 int omapsdl_input_get_events(int timeout_ms,
61 int (*key_cb)(void *cb_arg, int sdl_kc, int sdl_sc, int is_pressed),
62 int (*ts_cb)(void *cb_arg, int x, int y, unsigned int pressure),
64 void omapsdl_input_finish(void);
66 void omapsdl_config(struct SDL_PrivateVideoData *pdata);
67 void omapsdl_config_from_env(struct SDL_PrivateVideoData *pdata);
69 /* functions for standalone */
70 void do_clut(void *dest, void *src, unsigned short *pal, int count);