summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/icon.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 93b1643cd9..cc92b96c27 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -116,16 +116,14 @@ void screen_put_icon_with_offset(struct screen * display,
116} 116}
117 117
118/* x,y in pixels */ 118/* x,y in pixels */
119typedef void (*lcd_draw_func)(const fb_data *src, int src_x, int src_y, 119void screen_put_iconxy(struct screen * display,
120 int stride, int x, int y, int width, int height);
121void screen_put_iconxy(struct screen * display,
122 int xpos, int ypos, enum themable_icons icon) 120 int xpos, int ypos, enum themable_icons icon)
123{ 121{
124 fb_data *data; 122 const void *data;
125 int screen = display->screen_type; 123 int screen = display->screen_type;
126 int width = ICON_WIDTH(screen); 124 int width = ICON_WIDTH(screen);
127 int height = ICON_HEIGHT(screen); 125 int height = ICON_HEIGHT(screen);
128 lcd_draw_func draw_func = NULL; 126 screen_bitmap_part_func *draw_func = NULL;
129 127
130 if (icon == Icon_NOICON) 128 if (icon == Icon_NOICON)
131 { 129 {
@@ -148,37 +146,28 @@ void screen_put_iconxy(struct screen * display,
148 screen_clear_area(display, xpos, ypos, width, height); 146 screen_clear_area(display, xpos, ypos, width, height);
149 return; 147 return;
150 } 148 }
151 data = (fb_data *)viewer_iconset[screen].data; 149 data = viewer_iconset[screen].data;
152 } 150 }
153 else if (custom_icons_loaded[screen]) 151 else if (custom_icons_loaded[screen])
154 { 152 {
155 data = (fb_data *)user_iconset[screen].data; 153 data = user_iconset[screen].data;
156 } 154 }
157 else 155 else
158 { 156 {
159 data = (fb_data *)inbuilt_icons[screen]; 157 data = inbuilt_icons[screen];
160 } 158 }
161 /* add some left padding to the icons if they are on the edge */ 159 /* add some left padding to the icons if they are on the edge */
162 if (xpos == 0) 160 if (xpos == 0)
163 xpos++; 161 xpos++;
164 162
165#ifdef HAVE_REMOTE_LCD 163#if (LCD_DEPTH == 16) || (LCD_REMOTE_DEPTH == 16)
166 if (display->screen_type == SCREEN_REMOTE) 164 if (display->depth == 16)
167 { 165 draw_func = display->transparent_bitmap_part;
168 /* Quick and Dirty hack untill lcd bitmap drawing is fixed */
169 draw_func = (lcd_draw_func)lcd_remote_bitmap_part;
170 }
171 else 166 else
172#endif 167#endif
173#if LCD_DEPTH == 16
174 draw_func = display->transparent_bitmap_part;
175#else /* LCD_DEPTH < 16 */
176 draw_func = display->bitmap_part; 168 draw_func = display->bitmap_part;
177#endif /* LCD_DEPTH == 16 */ 169
178 170 draw_func(data, 0, height * icon, width, xpos, ypos, width, height);
179 draw_func( (const fb_data *)data,
180 0, height * icon, width, xpos, ypos,
181 width, height);
182} 171}
183 172
184void screen_put_cursorxy(struct screen * display, int x, int y, bool on) 173void screen_put_cursorxy(struct screen * display, int x, int y, bool on)