|
10 | 10 |
|
11 | 11 | #define SDL_MAIN_HANDLED /*To fix SDL's "undefined reference to WinMain" issue*/ |
12 | 12 |
|
13 | | - #ifdef MP_PORT_UNIX |
14 | | - #include "SDL.h" |
15 | | - #include "SDL_thread.h" |
| 13 | + #include "SDL.h" |
| 14 | + #include "SDL_thread.h" |
16 | 15 |
|
17 | | - typedef struct { |
18 | | - int32_t x; |
19 | | - int32_t y; |
20 | | - uint8_t state; |
21 | | - } pointer_event_t; |
| 16 | + typedef struct { |
| 17 | + int32_t x; |
| 18 | + int32_t y; |
| 19 | + uint8_t state; |
| 20 | + } pointer_event_t; |
22 | 21 |
|
23 | | - typedef struct _panel_io_config_t { |
24 | | - uint16_t width; |
25 | | - uint16_t height; |
26 | | - uint32_t win_id; |
27 | | - void *buf_to_flush; |
28 | | - uint8_t bytes_per_pixel; |
29 | | - int flags; |
30 | | - } panel_io_config_t; |
| 22 | + typedef struct _panel_io_config_t { |
| 23 | + uint16_t width; |
| 24 | + uint16_t height; |
| 25 | + uint32_t win_id; |
| 26 | + void *buf_to_flush; |
| 27 | + uint8_t bytes_per_pixel; |
| 28 | + int flags; |
| 29 | + } panel_io_config_t; |
31 | 30 |
|
32 | | - typedef struct _mp_lcd_sdl_bus_obj_t { |
33 | | - mp_obj_base_t base; |
| 31 | + typedef struct _mp_lcd_sdl_bus_obj_t { |
| 32 | + mp_obj_base_t base; |
34 | 33 |
|
35 | | - mp_obj_t callback; |
| 34 | + mp_obj_t callback; |
36 | 35 |
|
37 | | - void *buf1; |
38 | | - void *buf2; |
| 36 | + void *buf1; |
| 37 | + void *buf2; |
39 | 38 |
|
40 | | - bool trans_done; |
41 | | - bool rgb565_byte_swap; |
| 39 | + bool trans_done; |
| 40 | + bool rgb565_byte_swap; |
42 | 41 |
|
43 | | - lcd_panel_io_t panel_io_handle; |
| 42 | + lcd_panel_io_t panel_io_handle; |
44 | 43 |
|
45 | | - panel_io_config_t panel_io_config; |
46 | | - SDL_Window *window; |
47 | | - SDL_Renderer *renderer; |
48 | | - SDL_Texture *texture; |
| 44 | + panel_io_config_t panel_io_config; |
| 45 | + SDL_Window *window; |
| 46 | + SDL_Renderer *renderer; |
| 47 | + SDL_Texture *texture; |
49 | 48 |
|
50 | | - pointer_event_t pointer_event; |
51 | | - mp_obj_t keypad_callback; |
52 | | - mp_obj_t window_callback; |
53 | | - mp_obj_t mouse_callback; |
54 | | - mp_obj_t quit_callback; |
| 49 | + pointer_event_t pointer_event; |
| 50 | + mp_obj_t keypad_callback; |
| 51 | + mp_obj_t window_callback; |
| 52 | + mp_obj_t mouse_callback; |
| 53 | + mp_obj_t quit_callback; |
55 | 54 |
|
56 | | - bool ignore_size_chg; |
57 | | - bool inited; |
| 55 | + bool ignore_size_chg; |
| 56 | + bool inited; |
58 | 57 |
|
59 | | - } mp_lcd_sdl_bus_obj_t; |
| 58 | + } mp_lcd_sdl_bus_obj_t; |
60 | 59 |
|
61 | | - extern const mp_obj_type_t mp_lcd_sdl_bus_type; |
62 | | - #endif |
| 60 | + extern const mp_obj_type_t mp_lcd_sdl_bus_type; |
63 | 61 | #endif |
0 commit comments