forked from PhilZ-cwm6/philz_touch_cwm6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.h
84 lines (68 loc) · 2.15 KB
/
ui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef __UI_H
#define __UI_H
#include <linux/input.h>
#include <pthread.h>
#include "minui/minui.h"
#include "ui_defines.h"
#include "common.h"
extern pthread_mutex_t gUpdateMutex;
//common.h and minui.h
extern gr_surface gBackgroundIcon[NUM_BACKGROUND_ICONS];
extern gr_surface gProgressBarEmpty;
extern gr_surface gProgressBarFill;
extern gr_surface gBackground;
#ifdef PHILZ_TOUCH_RECOVERY
extern gr_surface gVirtualKeys;
#endif
extern int boardRepeatableKeys[64];
extern int boardNumRepeatableKeys;
struct bitmaps_array {
gr_surface* surface;
const char *name;
};
extern struct bitmaps_array BITMAPS[];
enum ProgressBarType {
PROGRESSBAR_TYPE_NONE,
PROGRESSBAR_TYPE_INDETERMINATE,
PROGRESSBAR_TYPE_NORMAL,
};
extern int gProgressBarType;
extern char text[MAX_ROWS][MAX_COLS];
extern int text_cols;
extern int text_rows;
extern int text_col;
extern int text_row;
extern int text_top;
extern bool show_text;
extern bool show_text_ever;
extern char menu[MENU_MAX_ROWS][MENU_MAX_COLS];
extern int show_menu;
extern int menu_top;
extern int menu_items;
extern int menu_sel;
extern int menu_show_start;
extern int max_menu_rows;
extern pthread_mutex_t key_queue_mutex;
extern pthread_cond_t key_queue_cond;
extern int key_queue[256];
extern int key_queue_len;
extern unsigned long key_last_repeat[KEY_MAX + 1];
extern unsigned long key_press_time[KEY_MAX + 1];
extern volatile char key_pressed[KEY_MAX + 1];
void update_screen_locked(void);
void draw_screen_locked(void);
// format toggle menus to screen width
// used to format toggle menus to device screen width (only touch build)
void ui_format_gui_menu(char *item_menu, const char* menu_text, const char* menu_option);
#ifdef PHILZ_TOUCH_RECOVERY
void draw_touch_menu();
void draw_text_line(int row, const char* t, int height, int align);
void touch_init();
void ui_friendly_log(int engage_friendly_view);
void ui_format_touch_menu(char *item_menu, const char* menu_text, const char* menu_option);
void ui_refresh_display_state(int *screen_timeout);
int ui_menu_header_offset();
int touch_handle_input(int fd, struct input_event ev);
int touch_handle_key(int key_code, int visible);
#endif
#endif // __UI_H