summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/icon.c14
-rw-r--r--apps/gui/scrollbar.c13
-rw-r--r--apps/gui/skin_engine/skin_display.c58
3 files changed, 9 insertions, 76 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index c171da5b44..4c006f947a 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -109,14 +109,11 @@ void screen_put_icon_with_offset(struct screen * display,
109void screen_put_iconxy(struct screen * display, 109void screen_put_iconxy(struct screen * display,
110 int xpos, int ypos, enum themable_icons icon) 110 int xpos, int ypos, enum themable_icons icon)
111{ 111{
112 const void *data;
113 const int screen = display->screen_type; 112 const int screen = display->screen_type;
114 const int width = ICON_WIDTH(screen); 113 const int width = ICON_WIDTH(screen);
115 const int height = ICON_HEIGHT(screen); 114 const int height = ICON_HEIGHT(screen);
116 const int is_rtl = lang_is_rtl(); 115 const int is_rtl = lang_is_rtl();
117 int stride;
118 const struct bitmap *iconset; 116 const struct bitmap *iconset;
119 screen_bitmap_part_func *draw_func = NULL;
120 117
121 if (icon == Icon_NOICON) 118 if (icon == Icon_NOICON)
122 { 119 {
@@ -145,9 +142,6 @@ void screen_put_iconxy(struct screen * display,
145 { 142 {
146 iconset = &inbuilt_iconset[screen]; 143 iconset = &inbuilt_iconset[screen];
147 } 144 }
148 data = iconset->data;
149 stride = STRIDE(display->screen_type, iconset->width, iconset->height);
150
151 /* add some left padding to the icons if they are on the edge */ 145 /* add some left padding to the icons if they are on the edge */
152 if (xpos == 0) 146 if (xpos == 0)
153 xpos++; 147 xpos++;
@@ -155,14 +149,8 @@ void screen_put_iconxy(struct screen * display,
155 if (is_rtl) 149 if (is_rtl)
156 xpos = display->getwidth() - xpos - width; 150 xpos = display->getwidth() - xpos - width;
157 151
158#if (LCD_DEPTH == 16) || defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH == 16)
159 if (display->depth == 16)
160 draw_func = display->transparent_bitmap_part;
161 else
162#endif
163 draw_func = display->bitmap_part;
164 152
165 draw_func(data, 0, height * icon, stride, xpos, ypos, width, height); 153 display->bmp_part(iconset, 0, height * icon, xpos, ypos, width, height);
166} 154}
167 155
168void screen_put_cursorxy(struct screen * display, int x, int y, bool on) 156void screen_put_cursorxy(struct screen * display, int x, int y, bool on)
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c
index 70d34176e1..aafd4b093a 100644
--- a/apps/gui/scrollbar.c
+++ b/apps/gui/scrollbar.c
@@ -234,18 +234,7 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
234 else if (bm->height < starty + height) 234 else if (bm->height < starty + height)
235 height = bm->height - starty; 235 height = bm->height - starty;
236 236
237#if LCD_DEPTH > 1 237 screen->bmp_part(bm, startx, starty, x, y, width, height);
238 if (bm->format == FORMAT_MONO)
239#endif
240 screen->mono_bitmap_part(bm->data, startx, starty,
241 bm->width, x, y, width, height);
242#if LCD_DEPTH > 1
243 else
244 screen->transparent_bitmap_part((fb_data *)bm->data, startx, starty,
245 STRIDE(screen->screen_type,
246 bm->width, bm->height),
247 x, y, width, height);
248#endif
249} 238}
250 239
251void show_busy_slider(struct screen *s, int x, int y, int width, int height) 240void show_busy_slider(struct screen *s, int x, int y, int width, int height)
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 95e4310de9..d2dbb56f64 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -248,22 +248,8 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
248 if (pb->backdrop) 248 if (pb->backdrop)
249 { 249 {
250 struct gui_img *img = pb->backdrop; 250 struct gui_img *img = pb->backdrop;
251 char *img_data = core_get_data(img->buflib_handle); 251 img->bm.data = core_get_data(img->buflib_handle);
252#if LCD_DEPTH > 1 252 display->bmp_part(&img->bm, 0, 0, x, y, width, height);
253 if(img->bm.format == FORMAT_MONO) {
254#endif
255 display->mono_bitmap_part(img_data,
256 0, 0, img->bm.width,
257 x, y, width, height);
258#if LCD_DEPTH > 1
259 } else {
260 display->transparent_bitmap_part((fb_data *)img_data,
261 0, 0,
262 STRIDE(display->screen_type,
263 img->bm.width, img->bm.height),
264 x, y, width, height);
265 }
266#endif
267 flags |= DONT_CLEAR_EXCESS; 253 flags |= DONT_CLEAR_EXCESS;
268 } 254 }
269 255
@@ -287,7 +273,7 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
287 int xoff = 0, yoff = 0; 273 int xoff = 0, yoff = 0;
288 int w = width, h = height; 274 int w = width, h = height;
289 struct gui_img *img = pb->slider; 275 struct gui_img *img = pb->slider;
290 char *img_data = core_get_data(img->buflib_handle); 276 img->bm.data = core_get_data(img->buflib_handle);
291 277
292 if (flags&HORIZONTAL) 278 if (flags&HORIZONTAL)
293 { 279 {
@@ -305,21 +291,7 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
305 yoff = height - yoff; 291 yoff = height - yoff;
306 yoff -= h / 2; 292 yoff -= h / 2;
307 } 293 }
308#if LCD_DEPTH > 1 294 display->bmp_part(&img->bm, 0, 0, x + xoff, y + yoff, w, h);
309 if(img->bm.format == FORMAT_MONO) {
310#endif
311 display->mono_bitmap_part(img_data,
312 0, 0, img->bm.width,
313 x + xoff, y + yoff, w, h);
314#if LCD_DEPTH > 1
315 } else {
316 display->transparent_bitmap_part((fb_data *)img_data,
317 0, 0,
318 STRIDE(display->screen_type,
319 img->bm.width, img->bm.height),
320 x + xoff, y + yoff, w, h);
321 }
322#endif
323 } 295 }
324 296
325 if (pb->type == SKIN_TOKEN_PROGRESSBAR) 297 if (pb->type == SKIN_TOKEN_PROGRESSBAR)
@@ -357,30 +329,14 @@ void clear_image_pos(struct gui_wps *gwps, struct gui_img *img)
357void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subimage) 329void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subimage)
358{ 330{
359 struct screen *display = gwps->display; 331 struct screen *display = gwps->display;
360 char *img_data = core_get_data(img->buflib_handle); 332 img->bm.data = core_get_data(img->buflib_handle);
361 if(img->always_display) 333 if(img->always_display)
362 display->set_drawmode(DRMODE_FG); 334 display->set_drawmode(DRMODE_FG);
363 else 335 else
364 display->set_drawmode(DRMODE_SOLID); 336 display->set_drawmode(DRMODE_SOLID);
365 337
366#if LCD_DEPTH > 1 338 display->bmp_part(&img->bm, 0, img->subimage_height * subimage,
367 if(img->bm.format == FORMAT_MONO) { 339 img->x, img->y, img->bm.width, img->subimage_height);
368#endif
369 display->mono_bitmap_part(img_data,
370 0, img->subimage_height * subimage,
371 img->bm.width, img->x,
372 img->y, img->bm.width,
373 img->subimage_height);
374#if LCD_DEPTH > 1
375 } else {
376 display->transparent_bitmap_part((fb_data *)img_data,
377 0, img->subimage_height * subimage,
378 STRIDE(display->screen_type,
379 img->bm.width, img->bm.height),
380 img->x, img->y, img->bm.width,
381 img->subimage_height);
382 }
383#endif
384} 340}
385 341
386 342