diff options
Diffstat (limited to 'apps/gui/skin_engine/skin_display.c')
-rwxr-xr-x | apps/gui/skin_engine/skin_display.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 137bced19b..60557bba0d 100755 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -97,6 +97,73 @@ void skin_update(enum skinnable_screens skin, enum screen_type screen, | |||
97 | 97 | ||
98 | #ifdef HAVE_LCD_BITMAP | 98 | #ifdef HAVE_LCD_BITMAP |
99 | 99 | ||
100 | |||
101 | #ifdef AB_REPEAT_ENABLE | ||
102 | |||
103 | #define DIRECTION_RIGHT 1 | ||
104 | #define DIRECTION_LEFT -1 | ||
105 | |||
106 | static int ab_calc_mark_x_pos(int mark, int capacity, | ||
107 | int offset, int size) | ||
108 | { | ||
109 | return offset + ( (size * mark) / capacity ); | ||
110 | } | ||
111 | |||
112 | static void ab_draw_vertical_line_mark(struct screen * screen, | ||
113 | int x, int y, int h) | ||
114 | { | ||
115 | screen->set_drawmode(DRMODE_COMPLEMENT); | ||
116 | screen->vline(x, y, y+h-1); | ||
117 | } | ||
118 | |||
119 | static void ab_draw_arrow_mark(struct screen * screen, | ||
120 | int x, int y, int h, int direction) | ||
121 | { | ||
122 | /* draw lines in decreasing size until a height of zero is reached */ | ||
123 | screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
124 | while( h > 0 ) | ||
125 | { | ||
126 | screen->vline(x, y, y+h-1); | ||
127 | h -= 2; | ||
128 | y++; | ||
129 | x += direction; | ||
130 | screen->set_drawmode(DRMODE_COMPLEMENT); | ||
131 | } | ||
132 | } | ||
133 | |||
134 | void ab_draw_markers(struct screen * screen, int capacity, | ||
135 | int x, int y, int w, int h) | ||
136 | { | ||
137 | bool a_set, b_set; | ||
138 | unsigned int a, b; | ||
139 | int xa, xb; | ||
140 | |||
141 | a_set = ab_get_A_marker(&a); | ||
142 | b_set = ab_get_B_marker(&b); | ||
143 | xa = ab_calc_mark_x_pos(a, capacity, x, w); | ||
144 | xb = ab_calc_mark_x_pos(b, capacity, x, w); | ||
145 | /* if both markers are set, determine if they're far enough apart | ||
146 | to draw arrows */ | ||
147 | if ( a_set && b_set ) | ||
148 | { | ||
149 | int arrow_width = (h+1) / 2; | ||
150 | if ( (xb-xa) < (arrow_width*2) ) | ||
151 | { | ||
152 | ab_draw_vertical_line_mark(screen, xa, y, h); | ||
153 | ab_draw_vertical_line_mark(screen, xb, y, h); | ||
154 | return; | ||
155 | } | ||
156 | } | ||
157 | |||
158 | if (a_set) | ||
159 | ab_draw_arrow_mark(screen, xa, y, h, DIRECTION_RIGHT); | ||
160 | |||
161 | if (b_set) | ||
162 | ab_draw_arrow_mark(screen, xb, y, h, DIRECTION_LEFT); | ||
163 | } | ||
164 | |||
165 | #endif | ||
166 | |||
100 | void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) | 167 | void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) |
101 | { | 168 | { |
102 | struct screen *display = gwps->display; | 169 | struct screen *display = gwps->display; |