diff options
author | Peter D'Hoye <peter.dhoye@gmail.com> | 2008-06-28 20:45:21 +0000 |
---|---|---|
committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2008-06-28 20:45:21 +0000 |
commit | 205f3df7816a1eea9c812ea285d74a4f8ecfad2a (patch) | |
tree | 356be7b807a4407b7e243ec57da4d5068fe09ab1 | |
parent | 3d240f1e2a34e616c2aba22b58ea78de7f277127 (diff) | |
download | rockbox-205f3df7816a1eea9c812ea285d74a4f8ecfad2a.tar.gz rockbox-205f3df7816a1eea9c812ea285d74a4f8ecfad2a.zip |
Remove a viewport ambiguity by changing the screens width/heigth members into lcdwidth/lcdheight. Normal usercode should always use getwidth()/getheigth() as that returns the viewport width/height. Fixes issues that would have appeared in many places when introducing viewports with sizes != lcd sizes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17857 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/color_picker.c | 30 | ||||
-rw-r--r-- | apps/gui/gwps.c | 6 | ||||
-rw-r--r-- | apps/gui/list.c | 2 | ||||
-rw-r--r-- | apps/gui/pitchscreen.c | 26 | ||||
-rw-r--r-- | apps/gui/quickscreen.c | 2 | ||||
-rw-r--r-- | apps/gui/splash.c | 14 | ||||
-rw-r--r-- | apps/gui/statusbar.c | 8 | ||||
-rw-r--r-- | apps/gui/viewport.c | 6 | ||||
-rw-r--r-- | apps/gui/wps_parser.c | 7 | ||||
-rw-r--r-- | apps/menus/eq_menu.c | 4 | ||||
-rw-r--r-- | apps/menus/recording_menu.c | 8 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw.c | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_analog.c | 48 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_binary.c | 4 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_digital.c | 15 | ||||
-rw-r--r-- | apps/plugins/clock/clock_settings.c | 6 | ||||
-rw-r--r-- | apps/plugins/demystify.c | 12 | ||||
-rw-r--r-- | apps/plugins/dice.c | 6 | ||||
-rw-r--r-- | apps/plugins/jackpot.c | 11 | ||||
-rw-r--r-- | apps/plugins/maze.c | 4 | ||||
-rw-r--r-- | apps/plugins/star.c | 2 | ||||
-rw-r--r-- | apps/plugins/zxbox/zxbox_keyb.c | 28 | ||||
-rw-r--r-- | apps/recorder/keyboard.c | 38 | ||||
-rw-r--r-- | apps/recorder/recording.c | 11 | ||||
-rw-r--r-- | apps/screen_access.c | 12 | ||||
-rw-r--r-- | apps/screen_access.h | 2 |
26 files changed, 165 insertions, 149 deletions
diff --git a/apps/gui/color_picker.c b/apps/gui/color_picker.c index 239a8b4c81..4ac4fa7fff 100644 --- a/apps/gui/color_picker.c +++ b/apps/gui/color_picker.c | |||
@@ -158,11 +158,11 @@ static void draw_screen(struct screen *display, char *title, | |||
158 | enough to display the selected slider - calculate total height | 158 | enough to display the selected slider - calculate total height |
159 | of display with three sliders present */ | 159 | of display with three sliders present */ |
160 | display_three_rows = | 160 | display_three_rows = |
161 | display->height >= MARGIN_TOP + | 161 | display->getheight() >= MARGIN_TOP + |
162 | display->char_height*4 + /* Title + 3 sliders */ | 162 | display->char_height*4 + /* Title + 3 sliders */ |
163 | TITLE_MARGIN_BOTTOM + | 163 | TITLE_MARGIN_BOTTOM + |
164 | SELECTOR_TB_MARGIN*6 + /* 2 margins/slider */ | 164 | SELECTOR_TB_MARGIN*6 + /* 2 margins/slider */ |
165 | MARGIN_BOTTOM; | 165 | MARGIN_BOTTOM; |
166 | 166 | ||
167 | /* Figure out widest label character in case they vary - | 167 | /* Figure out widest label character in case they vary - |
168 | this function assumes labels are one character */ | 168 | this function assumes labels are one character */ |
@@ -178,13 +178,13 @@ static void draw_screen(struct screen *display, char *title, | |||
178 | /* Draw title string */ | 178 | /* Draw title string */ |
179 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); | 179 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); |
180 | display->getstringsize(title, &x, &y); | 180 | display->getstringsize(title, &x, &y); |
181 | display->putsxy((display->width - x) / 2, MARGIN_TOP, title); | 181 | display->putsxy((display->getwidth() - x) / 2, MARGIN_TOP, title); |
182 | 182 | ||
183 | /* Get slider positions and top starting position */ | 183 | /* Get slider positions and top starting position */ |
184 | text_top = MARGIN_TOP + y + TITLE_MARGIN_BOTTOM + SELECTOR_TB_MARGIN; | 184 | text_top = MARGIN_TOP + y + TITLE_MARGIN_BOTTOM + SELECTOR_TB_MARGIN; |
185 | slider_left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN + | 185 | slider_left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN + |
186 | max_label_width + SLIDER_MARGIN_LEFT; | 186 | max_label_width + SLIDER_MARGIN_LEFT; |
187 | slider_width = display->width - slider_left - SLIDER_MARGIN_RIGHT - | 187 | slider_width = display->getwidth() - slider_left - SLIDER_MARGIN_RIGHT - |
188 | display->char_width*2 - SELECTOR_LR_MARGIN - SELECTOR_WIDTH - | 188 | display->char_width*2 - SELECTOR_LR_MARGIN - SELECTOR_WIDTH - |
189 | MARGIN_RIGHT; | 189 | MARGIN_RIGHT; |
190 | 190 | ||
@@ -208,7 +208,7 @@ static void draw_screen(struct screen *display, char *title, | |||
208 | /* Draw solid bar selection bar */ | 208 | /* Draw solid bar selection bar */ |
209 | display->fillrect(0, | 209 | display->fillrect(0, |
210 | text_top - SELECTOR_TB_MARGIN, | 210 | text_top - SELECTOR_TB_MARGIN, |
211 | display->width, | 211 | display->getwidth(), |
212 | display->char_height + | 212 | display->char_height + |
213 | SELECTOR_TB_MARGIN*2); | 213 | SELECTOR_TB_MARGIN*2); |
214 | 214 | ||
@@ -225,8 +225,8 @@ static void draw_screen(struct screen *display, char *title, | |||
225 | SELECTOR_HEIGHT) / 2; | 225 | SELECTOR_HEIGHT) / 2; |
226 | screen_put_iconxy(display, MARGIN_LEFT, top, Icon_Cursor); | 226 | screen_put_iconxy(display, MARGIN_LEFT, top, Icon_Cursor); |
227 | screen_put_iconxy(display, | 227 | screen_put_iconxy(display, |
228 | display->width - MARGIN_RIGHT - | 228 | display->getwidth() - MARGIN_RIGHT - |
229 | get_icon_width(display->screen_type), | 229 | get_icon_width(display->screen_type), |
230 | top, Icon_Cursor); | 230 | top, Icon_Cursor); |
231 | } | 231 | } |
232 | 232 | ||
@@ -282,9 +282,9 @@ static void draw_screen(struct screen *display, char *title, | |||
282 | /* Display color swatch on color screens only */ | 282 | /* Display color swatch on color screens only */ |
283 | int left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN; | 283 | int left = MARGIN_LEFT + SELECTOR_WIDTH + SELECTOR_LR_MARGIN; |
284 | int top = text_top + SWATCH_TOP_MARGIN; | 284 | int top = text_top + SWATCH_TOP_MARGIN; |
285 | int width = display->width - left - SELECTOR_LR_MARGIN - | 285 | int width = display->getwidth() - left - SELECTOR_LR_MARGIN - |
286 | SELECTOR_WIDTH - MARGIN_RIGHT; | 286 | SELECTOR_WIDTH - MARGIN_RIGHT; |
287 | int height = display->height - top - MARGIN_BOTTOM; | 287 | int height = display->getheight() - top - MARGIN_BOTTOM; |
288 | 288 | ||
289 | /* Only draw if room */ | 289 | /* Only draw if room */ |
290 | if (height >= display->char_height + 2) | 290 | if (height >= display->char_height + 2) |
@@ -314,11 +314,11 @@ static void draw_screen(struct screen *display, char *title, | |||
314 | display->getstringsize(buf, &x, &y); | 314 | display->getstringsize(buf, &x, &y); |
315 | i = text_top + SWATCH_TOP_MARGIN; | 315 | i = text_top + SWATCH_TOP_MARGIN; |
316 | 316 | ||
317 | if (i + y <= display->height - MARGIN_BOTTOM) | 317 | if (i + y <= display->getheight() - MARGIN_BOTTOM) |
318 | { | 318 | { |
319 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); | 319 | set_drawinfo(display, DRMODE_SOLID, text_color, background_color); |
320 | x = (display->width - x) / 2; | 320 | x = (display->getwidth() - x) / 2; |
321 | y = (i + display->height - MARGIN_BOTTOM - y) / 2; | 321 | y = (i + display->getheight() - MARGIN_BOTTOM - y) / 2; |
322 | display->putsxy(x, y, buf); | 322 | display->putsxy(x, y, buf); |
323 | } | 323 | } |
324 | } | 324 | } |
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index d752cb3da5..a7c5295f48 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -788,17 +788,17 @@ static void statusbar_toggle_handler(void *data) | |||
788 | if (!global_settings.statusbar && !draw) | 788 | if (!global_settings.statusbar && !draw) |
789 | { | 789 | { |
790 | vp->vp.y = 0; | 790 | vp->vp.y = 0; |
791 | vp->vp.height = screens[i].height; | 791 | vp->vp.height = screens[i].lcdheight; |
792 | } | 792 | } |
793 | else | 793 | else |
794 | { | 794 | { |
795 | vp->vp.y = STATUSBAR_HEIGHT; | 795 | vp->vp.y = STATUSBAR_HEIGHT; |
796 | vp->vp.height = screens[i].height - STATUSBAR_HEIGHT; | 796 | vp->vp.height = screens[i].lcdheight - STATUSBAR_HEIGHT; |
797 | } | 797 | } |
798 | } | 798 | } |
799 | } | 799 | } |
800 | #endif | 800 | #endif |
801 | 801 | ||
802 | void gui_sync_wps_init(void) | 802 | void gui_sync_wps_init(void) |
803 | { | 803 | { |
804 | int i; | 804 | int i; |
diff --git a/apps/gui/list.c b/apps/gui/list.c index 0ec40d3aed..96652ce0a9 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -78,7 +78,7 @@ void list_init_viewports(struct gui_synclist *list) | |||
78 | { | 78 | { |
79 | viewport_set_defaults(vp, i); | 79 | viewport_set_defaults(vp, i); |
80 | list->parent[i]->y = gui_statusbar_height(); | 80 | list->parent[i]->y = gui_statusbar_height(); |
81 | list->parent[i]->height = screens[i].height - list->parent[i]->y; | 81 | list->parent[i]->height = screens[i].lcdheight - list->parent[i]->y; |
82 | } | 82 | } |
83 | } | 83 | } |
84 | #ifdef HAVE_BUTTONBAR | 84 | #ifdef HAVE_BUTTONBAR |
diff --git a/apps/gui/pitchscreen.c b/apps/gui/pitchscreen.c index c9d6750242..e0a7416ac6 100644 --- a/apps/gui/pitchscreen.c +++ b/apps/gui/pitchscreen.c | |||
@@ -64,7 +64,7 @@ static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode) | |||
64 | { | 64 | { |
65 | w = snprintf((char *)buf, sizeof(buf), "%s: %d.%d%%",str(LANG_PITCH), | 65 | w = snprintf((char *)buf, sizeof(buf), "%s: %d.%d%%",str(LANG_PITCH), |
66 | pitch / 10, pitch % 10 ); | 66 | pitch / 10, pitch % 10 ); |
67 | display->putsxy((display->width-(w*display->char_width))/2, | 67 | display->putsxy((display->lcdwidth-(w*display->char_width))/2, |
68 | display->nb_lines/2,buf); | 68 | display->nb_lines/2,buf); |
69 | } | 69 | } |
70 | else /* bigger screen, show everything... */ | 70 | else /* bigger screen, show everything... */ |
@@ -77,9 +77,9 @@ static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode) | |||
77 | ptr = str(LANG_PITCH_UP_SEMITONE); | 77 | ptr = str(LANG_PITCH_UP_SEMITONE); |
78 | } | 78 | } |
79 | display->getstringsize(ptr,&w,&h); | 79 | display->getstringsize(ptr,&w,&h); |
80 | display->putsxy((display->width-w)/2, 0, ptr); | 80 | display->putsxy((display->lcdwidth-w)/2, 0, ptr); |
81 | display->mono_bitmap(bitmap_icons_7x8[Icon_UpArrow], | 81 | display->mono_bitmap(bitmap_icons_7x8[Icon_UpArrow], |
82 | display->width/2 - 3, h, 7, 8); | 82 | display->lcdwidth/2 - 3, h, 7, 8); |
83 | 83 | ||
84 | /* DOWN: Pitch Down */ | 84 | /* DOWN: Pitch Down */ |
85 | if (pitch_mode == PITCH_MODE_ABSOLUTE) { | 85 | if (pitch_mode == PITCH_MODE_ABSOLUTE) { |
@@ -88,33 +88,35 @@ static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode) | |||
88 | ptr = str(LANG_PITCH_DOWN_SEMITONE); | 88 | ptr = str(LANG_PITCH_DOWN_SEMITONE); |
89 | } | 89 | } |
90 | display->getstringsize(ptr,&w,&h); | 90 | display->getstringsize(ptr,&w,&h); |
91 | display->putsxy((display->width-w)/2, display->height - h, ptr); | 91 | display->putsxy((display->lcdwidth-w)/2, display->lcdheight - h, ptr); |
92 | display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], | 92 | display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], |
93 | display->width/2 - 3, display->height - h*2, 7, 8); | 93 | display->lcdwidth/2 - 3, |
94 | display->lcdheight - h*2, 7, 8); | ||
94 | 95 | ||
95 | /* RIGHT: +2% */ | 96 | /* RIGHT: +2% */ |
96 | ptr = "+2%"; | 97 | ptr = "+2%"; |
97 | display->getstringsize(ptr,&w,&h); | 98 | display->getstringsize(ptr,&w,&h); |
98 | display->putsxy(display->width-w, (display->height-h)/2, ptr); | 99 | display->putsxy(display->lcdwidth-w, (display->lcdheight-h)/2, ptr); |
99 | display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], | 100 | display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], |
100 | display->width-w-8, (display->height-h)/2, 7, 8); | 101 | display->lcdwidth-w-8, |
102 | (display->lcdheight-h)/2, 7, 8); | ||
101 | 103 | ||
102 | /* LEFT: -2% */ | 104 | /* LEFT: -2% */ |
103 | ptr = "-2%"; | 105 | ptr = "-2%"; |
104 | display->getstringsize(ptr,&w,&h); | 106 | display->getstringsize(ptr,&w,&h); |
105 | display->putsxy(0, (display->height-h)/2, ptr); | 107 | display->putsxy(0, (display->lcdheight-h)/2, ptr); |
106 | display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], | 108 | display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], |
107 | w+1, (display->height-h)/2, 7, 8); | 109 | w+1, (display->lcdheight-h)/2, 7, 8); |
108 | 110 | ||
109 | /* "Pitch" */ | 111 | /* "Pitch" */ |
110 | snprintf((char *)buf, sizeof(buf), str(LANG_PITCH)); | 112 | snprintf((char *)buf, sizeof(buf), str(LANG_PITCH)); |
111 | display->getstringsize(buf,&w,&h); | 113 | display->getstringsize(buf,&w,&h); |
112 | display->putsxy((display->width-w)/2, (display->height/2)-h, buf); | 114 | display->putsxy((display->lcdwidth-w)/2, (display->lcdheight/2)-h, buf); |
113 | /* "XX.X%" */ | 115 | /* "XX.X%" */ |
114 | snprintf((char *)buf, sizeof(buf), "%d.%d%%", | 116 | snprintf((char *)buf, sizeof(buf), "%d.%d%%", |
115 | pitch / 10, pitch % 10 ); | 117 | pitch / 10, pitch % 10 ); |
116 | display->getstringsize(buf,&w,&h); | 118 | display->getstringsize(buf,&w,&h); |
117 | display->putsxy((display->width-w)/2, display->height/2, buf); | 119 | display->putsxy((display->lcdwidth-w)/2, display->lcdheight/2, buf); |
118 | } | 120 | } |
119 | 121 | ||
120 | display->update(); | 122 | display->update(); |
@@ -123,7 +125,7 @@ static void pitch_screen_draw(struct screen *display, int pitch, int pitch_mode) | |||
123 | static int pitch_increase(int pitch, int delta, bool allow_cutoff) | 125 | static int pitch_increase(int pitch, int delta, bool allow_cutoff) |
124 | { | 126 | { |
125 | int new_pitch; | 127 | int new_pitch; |
126 | 128 | ||
127 | if (delta < 0) { | 129 | if (delta < 0) { |
128 | if (pitch + delta >= PITCH_MIN) { | 130 | if (pitch + delta >= PITCH_MIN) { |
129 | new_pitch = pitch + delta; | 131 | new_pitch = pitch + delta; |
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index 3eb9426c39..ef1111fe3e 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c | |||
@@ -107,7 +107,7 @@ static void quickscreen_fix_viewports(struct gui_quickscreen *qs, | |||
107 | vp_icons[screen].height = | 107 | vp_icons[screen].height = |
108 | vps[screen][QUICKSCREEN_BOTTOM].y - vp_icons[screen].y; | 108 | vps[screen][QUICKSCREEN_BOTTOM].y - vp_icons[screen].y; |
109 | 109 | ||
110 | if (left_width + right_width > display->width - CENTER_ICONAREA_WIDTH) | 110 | if (left_width + right_width > display->lcdwidth - CENTER_ICONAREA_WIDTH) |
111 | { | 111 | { |
112 | /* scrolling needed */ | 112 | /* scrolling needed */ |
113 | int width = (parent->width - CENTER_ICONAREA_WIDTH)/2; | 113 | int width = (parent->width - CENTER_ICONAREA_WIDTH)/2; |
diff --git a/apps/gui/splash.c b/apps/gui/splash.c index 0405c0586d..b4b451eed6 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c | |||
@@ -91,14 +91,14 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) | |||
91 | #endif | 91 | #endif |
92 | if (lastbreak) | 92 | if (lastbreak) |
93 | { | 93 | { |
94 | if (x + (next - lastbreak) * space_w + w > screen->width) | 94 | if (x + (next - lastbreak) * space_w + w > screen->lcdwidth) |
95 | { /* too wide, wrap */ | 95 | { /* too wide, wrap */ |
96 | widths[line] = x; | 96 | widths[line] = x; |
97 | #ifdef HAVE_LCD_BITMAP | 97 | #ifdef HAVE_LCD_BITMAP |
98 | if (x > maxw) | 98 | if (x > maxw) |
99 | maxw = x; | 99 | maxw = x; |
100 | #endif | 100 | #endif |
101 | if ((y + h > screen->height) || (line >= (MAXLINES-1))) | 101 | if ((y + h > screen->lcdheight) || (line >= (MAXLINES-1))) |
102 | break; /* screen full or out of lines */ | 102 | break; /* screen full or out of lines */ |
103 | x = 0; | 103 | x = 0; |
104 | y += h; | 104 | y += h; |
@@ -132,8 +132,8 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) | |||
132 | #ifdef HAVE_LCD_BITMAP | 132 | #ifdef HAVE_LCD_BITMAP |
133 | /* If we center the display, then just clear the box we need and put | 133 | /* If we center the display, then just clear the box we need and put |
134 | a nice little frame and put the text in there! */ | 134 | a nice little frame and put the text in there! */ |
135 | y = (screen->height - y) / 2; /* height => y start position */ | 135 | y = (screen->lcdheight - y) / 2; /* height => y start position */ |
136 | x = (screen->width - maxw) / 2 - 2; | 136 | x = (screen->lcdwidth - maxw) / 2 - 2; |
137 | 137 | ||
138 | #if LCD_DEPTH > 1 | 138 | #if LCD_DEPTH > 1 |
139 | if (screen->depth > 1) | 139 | if (screen->depth > 1) |
@@ -147,7 +147,7 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) | |||
147 | #endif | 147 | #endif |
148 | screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 148 | screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
149 | 149 | ||
150 | screen->fillrect(x, y-2, maxw+4, screen->height-y*2+4); | 150 | screen->fillrect(x, y-2, maxw+4, screen->lcdheight-y*2+4); |
151 | 151 | ||
152 | #if LCD_DEPTH > 1 | 152 | #if LCD_DEPTH > 1 |
153 | if (screen->depth > 1) | 153 | if (screen->depth > 1) |
@@ -156,7 +156,7 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) | |||
156 | #endif | 156 | #endif |
157 | screen->set_drawmode(DRMODE_SOLID); | 157 | screen->set_drawmode(DRMODE_SOLID); |
158 | 158 | ||
159 | screen->drawrect(x, y-2, maxw+4, screen->height-y*2+4); | 159 | screen->drawrect(x, y-2, maxw+4, screen->lcdheight-y*2+4); |
160 | #else /* HAVE_LCD_CHARCELLS */ | 160 | #else /* HAVE_LCD_CHARCELLS */ |
161 | y = 0; /* vertical centering on 2 lines would be silly */ | 161 | y = 0; /* vertical centering on 2 lines would be silly */ |
162 | x = 0; | 162 | x = 0; |
@@ -167,7 +167,7 @@ static void splash(struct screen * screen, const char *fmt, va_list ap) | |||
167 | 167 | ||
168 | for (i = 0; i <= line; i++) | 168 | for (i = 0; i <= line; i++) |
169 | { | 169 | { |
170 | x = MAX((screen->width - widths[i]) / 2, 0); | 170 | x = MAX((screen->lcdwidth - widths[i]) / 2, 0); |
171 | 171 | ||
172 | #ifdef HAVE_LCD_BITMAP | 172 | #ifdef HAVE_LCD_BITMAP |
173 | screen->putsxy(x, y, lines[i]); | 173 | screen->putsxy(x, y, lines[i]); |
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index b9941eb061..0a421e8b16 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -256,7 +256,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
256 | memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) | 256 | memcmp(&(bar->info), &(bar->lastinfo), sizeof(struct status_info))) |
257 | { | 257 | { |
258 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 258 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
259 | display->fillrect(0, 0, display->width, STATUSBAR_HEIGHT); | 259 | display->fillrect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); |
260 | display->set_drawmode(DRMODE_SOLID); | 260 | display->set_drawmode(DRMODE_SOLID); |
261 | 261 | ||
262 | if (bar->info.battery_state) | 262 | if (bar->info.battery_state) |
@@ -329,7 +329,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
329 | if(!display->has_disk_led && bar->info.led) | 329 | if(!display->has_disk_led && bar->info.led) |
330 | gui_statusbar_led(display); | 330 | gui_statusbar_led(display); |
331 | #endif | 331 | #endif |
332 | display->update_rect(0, 0, display->width, STATUSBAR_HEIGHT); | 332 | display->update_rect(0, 0, display->getwidth(), STATUSBAR_HEIGHT); |
333 | bar->lastinfo = bar->info; | 333 | bar->lastinfo = bar->info; |
334 | } | 334 | } |
335 | #endif /* HAVE_LCD_BITMAP */ | 335 | #endif /* HAVE_LCD_BITMAP */ |
@@ -573,7 +573,7 @@ static void gui_statusbar_icon_lock_remote(struct screen * display) | |||
573 | static void gui_statusbar_led(struct screen * display) | 573 | static void gui_statusbar_led(struct screen * display) |
574 | { | 574 | { |
575 | display->mono_bitmap(bitmap_icon_disk, | 575 | display->mono_bitmap(bitmap_icon_disk, |
576 | STATUSBAR_DISK_X_POS(display->width), | 576 | STATUSBAR_DISK_X_POS(display->getwidth()), |
577 | STATUSBAR_Y_POS, STATUSBAR_DISK_WIDTH, | 577 | STATUSBAR_Y_POS, STATUSBAR_DISK_WIDTH, |
578 | STATUSBAR_HEIGHT); | 578 | STATUSBAR_HEIGHT); |
579 | } | 579 | } |
@@ -605,7 +605,7 @@ static void gui_statusbar_time(struct screen * display, struct tm *time) | |||
605 | display->setfont(FONT_SYSFIXED); | 605 | display->setfont(FONT_SYSFIXED); |
606 | display->getstringsize(buffer, &width, &height); | 606 | display->getstringsize(buffer, &width, &height); |
607 | if (height <= STATUSBAR_HEIGHT) { | 607 | if (height <= STATUSBAR_HEIGHT) { |
608 | display->putsxy(STATUSBAR_TIME_X_END(display->width) - width, | 608 | display->putsxy(STATUSBAR_TIME_X_END(display->getwidth()) - width, |
609 | STATUSBAR_Y_POS, buffer); | 609 | STATUSBAR_Y_POS, buffer); |
610 | } | 610 | } |
611 | display->setfont(FONT_UI); | 611 | display->setfont(FONT_UI); |
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 6aad7c5b05..ef61494b71 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -48,10 +48,10 @@ int viewport_get_nb_lines(struct viewport *vp) | |||
48 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) | 48 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) |
49 | { | 49 | { |
50 | vp->x = 0; | 50 | vp->x = 0; |
51 | vp->width = screens[screen].width; | 51 | vp->width = screens[screen].lcdwidth; |
52 | 52 | ||
53 | vp->y = gui_statusbar_height(); | 53 | vp->y = gui_statusbar_height(); |
54 | vp->height = screens[screen].height - vp->y; | 54 | vp->height = screens[screen].lcdheight - vp->y; |
55 | #ifdef HAVE_LCD_BITMAP | 55 | #ifdef HAVE_LCD_BITMAP |
56 | vp->drawmode = DRMODE_SOLID; | 56 | vp->drawmode = DRMODE_SOLID; |
57 | vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ | 57 | vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ |
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index e89f2692cf..73516f604d 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -1550,16 +1550,17 @@ bool wps_data_load(struct wps_data *wps_data, | |||
1550 | 1550 | ||
1551 | /* Initialise the first (default) viewport */ | 1551 | /* Initialise the first (default) viewport */ |
1552 | wps_data->viewports[0].vp.x = 0; | 1552 | wps_data->viewports[0].vp.x = 0; |
1553 | wps_data->viewports[0].vp.width = display->width; | 1553 | wps_data->viewports[0].vp.width = display->getwidth(); |
1554 | if (!global_settings.statusbar) | 1554 | if (!global_settings.statusbar) |
1555 | { | 1555 | { |
1556 | wps_data->viewports[0].vp.y = 0; | 1556 | wps_data->viewports[0].vp.y = 0; |
1557 | wps_data->viewports[0].vp.height = display->height; | 1557 | wps_data->viewports[0].vp.height = display->getheight(); |
1558 | } | 1558 | } |
1559 | else | 1559 | else |
1560 | { | 1560 | { |
1561 | wps_data->viewports[0].vp.y = STATUSBAR_HEIGHT; | 1561 | wps_data->viewports[0].vp.y = STATUSBAR_HEIGHT; |
1562 | wps_data->viewports[0].vp.height = display->height - STATUSBAR_HEIGHT; | 1562 | wps_data->viewports[0].vp.height = display->getheight() - |
1563 | STATUSBAR_HEIGHT; | ||
1563 | } | 1564 | } |
1564 | #ifdef HAVE_LCD_BITMAP | 1565 | #ifdef HAVE_LCD_BITMAP |
1565 | wps_data->viewports[0].vp.font = FONT_UI; | 1566 | wps_data->viewports[0].vp.font = FONT_UI; |
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c index 13af7e6c14..279f8255c2 100644 --- a/apps/menus/eq_menu.c +++ b/apps/menus/eq_menu.c | |||
@@ -399,8 +399,8 @@ static int draw_eq_sliders(int current_band, enum eq_slider_mode mode) | |||
399 | enum eq_type type; | 399 | enum eq_type type; |
400 | 400 | ||
401 | FOR_NB_SCREENS(i) | 401 | FOR_NB_SCREENS(i) |
402 | slider_width[i] = screens[i].width - 4; /* two pixel margin on each side */ | 402 | slider_width[i] = screens[i].getwidth() - 4; /* 2 pixel margin |
403 | 403 | each side */ | |
404 | for (i=0; i<5; i++) { | 404 | for (i=0; i<5; i++) { |
405 | cutoff = *setting++; | 405 | cutoff = *setting++; |
406 | q = *setting++; | 406 | q = *setting++; |
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c index 6342bccde7..ae58472942 100644 --- a/apps/menus/recording_menu.c +++ b/apps/menus/recording_menu.c | |||
@@ -448,7 +448,7 @@ int rectrigger(void) | |||
448 | int old_stop_gap = global_settings.rec_stop_gap; | 448 | int old_stop_gap = global_settings.rec_stop_gap; |
449 | int old_trigger_mode = global_settings.rec_trigger_mode; | 449 | int old_trigger_mode = global_settings.rec_trigger_mode; |
450 | int old_trigger_type = global_settings.rec_trigger_type; | 450 | int old_trigger_type = global_settings.rec_trigger_type; |
451 | 451 | ||
452 | FOR_NB_SCREENS(i) | 452 | FOR_NB_SCREENS(i) |
453 | { | 453 | { |
454 | screens[i].clear_display(); | 454 | screens[i].clear_display(); |
@@ -457,11 +457,11 @@ int rectrigger(void) | |||
457 | vp[i].height -= SYSFONT_HEIGHT*2; | 457 | vp[i].height -= SYSFONT_HEIGHT*2; |
458 | trig_xpos[i] = 0; | 458 | trig_xpos[i] = 0; |
459 | trig_ypos[i] = vp[i].y + vp[i].height; | 459 | trig_ypos[i] = vp[i].y + vp[i].height; |
460 | pm_y[i] = screens[i].height - SYSFONT_HEIGHT; | 460 | pm_y[i] = screens[i].getheight() - SYSFONT_HEIGHT; |
461 | trig_width[i] = screens[i].width; | 461 | trig_width[i] = screens[i].getwidth(); |
462 | } | 462 | } |
463 | /* TODO: what to do if there is < 4 lines on the screen? */ | 463 | /* TODO: what to do if there is < 4 lines on the screen? */ |
464 | 464 | ||
465 | settings[TRIGGER_MODE] = | 465 | settings[TRIGGER_MODE] = |
466 | find_setting(&global_settings.rec_trigger_mode, NULL); | 466 | find_setting(&global_settings.rec_trigger_mode, NULL); |
467 | settings[TRIGGER_TYPE] = | 467 | settings[TRIGGER_TYPE] = |
diff --git a/apps/plugins/clock/clock_draw.c b/apps/plugins/clock/clock_draw.c index 06711dff74..f9dbb3c809 100644 --- a/apps/plugins/clock/clock_draw.c +++ b/apps/plugins/clock/clock_draw.c | |||
@@ -35,7 +35,7 @@ void black_background(struct screen* display){ | |||
35 | #endif | 35 | #endif |
36 | { | 36 | { |
37 | display->clear_display(); | 37 | display->clear_display(); |
38 | display->fillrect(0,0,display->width,display->height); | 38 | display->fillrect(0,0,display->getwidth(),display->getheight()); |
39 | } | 39 | } |
40 | } | 40 | } |
41 | 41 | ||
diff --git a/apps/plugins/clock/clock_draw_analog.c b/apps/plugins/clock/clock_draw_analog.c index dbed316322..391bd73519 100644 --- a/apps/plugins/clock/clock_draw_analog.c +++ b/apps/plugins/clock/clock_draw_analog.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #define ANALOG_SECOND_RADIUS(screen, round) \ | 28 | #define ANALOG_SECOND_RADIUS(screen, round) \ |
29 | ANALOG_MINUTE_RADIUS(screen, round) | 29 | ANALOG_MINUTE_RADIUS(screen, round) |
30 | #define ANALOG_MINUTE_RADIUS(screen, round) \ | 30 | #define ANALOG_MINUTE_RADIUS(screen, round) \ |
31 | (round?MIN(screen->height/2 -10, screen->width/2 -10):screen->height/2) | 31 | (round?MIN(screen->getheight()/2 -10, screen->getwidth()/2 -10):screen->getheight()/2) |
32 | #define ANALOG_HOUR_RADIUS(screen, round) \ | 32 | #define ANALOG_HOUR_RADIUS(screen, round) \ |
33 | (2*ANALOG_MINUTE_RADIUS(screen, round)/3) | 33 | (2*ANALOG_MINUTE_RADIUS(screen, round)/3) |
34 | 34 | ||
@@ -52,8 +52,8 @@ void polar_to_cartesian_screen_centered(struct screen * display, | |||
52 | int a, int r, int* x, int* y) | 52 | int a, int r, int* x, int* y) |
53 | { | 53 | { |
54 | polar_to_cartesian(a, r, x, y); | 54 | polar_to_cartesian(a, r, x, y); |
55 | *x+=display->width/2; | 55 | *x+=display->getwidth()/2; |
56 | *y+=display->height/2; | 56 | *y+=display->getheight()/2; |
57 | } | 57 | } |
58 | 58 | ||
59 | void angle_to_square(int square_width, int square_height, | 59 | void angle_to_square(int square_width, int square_height, |
@@ -87,8 +87,8 @@ void angle_to_square_screen_centered(struct screen * display, | |||
87 | int a, int* x, int* y) | 87 | int a, int* x, int* y) |
88 | { | 88 | { |
89 | angle_to_square(square_width, square_height, a, x, y); | 89 | angle_to_square(square_width, square_height, a, x, y); |
90 | *x+=display->width/2; | 90 | *x+=display->getwidth()/2; |
91 | *y+=display->height/2; | 91 | *y+=display->getheight()/2; |
92 | } | 92 | } |
93 | 93 | ||
94 | void draw_hand(struct screen* display, int angle, | 94 | void draw_hand(struct screen* display, int angle, |
@@ -100,9 +100,9 @@ void draw_hand(struct screen* display, int angle, | |||
100 | polar_to_cartesian_screen_centered(display, angle, radius, &x1, &y1); | 100 | polar_to_cartesian_screen_centered(display, angle, radius, &x1, &y1); |
101 | }else{/* fullscreen clock, hands describes square motions */ | 101 | }else{/* fullscreen clock, hands describes square motions */ |
102 | int square_width, square_height; | 102 | int square_width, square_height; |
103 | /* radius is defined smallest between width and height */ | 103 | /* radius is defined smallest between getwidth() and getheight() */ |
104 | square_height=radius; | 104 | square_height=radius; |
105 | square_width=(radius*display->width)/display->height; | 105 | square_width=(radius*display->getwidth())/display->getheight(); |
106 | angle_to_square_screen_centered( | 106 | angle_to_square_screen_centered( |
107 | display, square_width, square_height, angle, &x1, &y1); | 107 | display, square_width, square_height, angle, &x1, &y1); |
108 | } | 108 | } |
@@ -140,14 +140,14 @@ void draw_counter(struct screen* display, struct counter* counter) | |||
140 | counter_time.hour, counter_time.minute); | 140 | counter_time.hour, counter_time.minute); |
141 | getstringsize(smalldigits_bitmaps, buffer, &hour_str_w, &str_h); | 141 | getstringsize(smalldigits_bitmaps, buffer, &hour_str_w, &str_h); |
142 | draw_string(display, smalldigits_bitmaps, buffer, | 142 | draw_string(display, smalldigits_bitmaps, buffer, |
143 | display->width-hour_str_w, | 143 | display->getwidth()-hour_str_w, |
144 | display->height-2*str_h); | 144 | display->getheight()-2*str_h); |
145 | 145 | ||
146 | rb->snprintf(buffer, 10, "%02d", counter_time.second); | 146 | rb->snprintf(buffer, 10, "%02d", counter_time.second); |
147 | getstringsize(smalldigits_bitmaps, buffer, &second_str_w, &str_h); | 147 | getstringsize(smalldigits_bitmaps, buffer, &second_str_w, &str_h); |
148 | draw_string(display, smalldigits_bitmaps, buffer, | 148 | draw_string(display, smalldigits_bitmaps, buffer, |
149 | display->width-(hour_str_w+second_str_w)/2, | 149 | display->getwidth()-(hour_str_w+second_str_w)/2, |
150 | display->height-str_h); | 150 | display->getheight()-str_h); |
151 | } | 151 | } |
152 | 152 | ||
153 | void draw_date(struct screen* display, struct time* time, int date_format) | 153 | void draw_date(struct screen* display, struct time* time, int date_format) |
@@ -166,14 +166,14 @@ void draw_date(struct screen* display, struct time* time, int date_format) | |||
166 | /* draws month and day */ | 166 | /* draws month and day */ |
167 | getstringsize(smalldigits_bitmaps, buffer, &monthday_str_w, &str_h); | 167 | getstringsize(smalldigits_bitmaps, buffer, &monthday_str_w, &str_h); |
168 | draw_string(display, smalldigits_bitmaps, buffer, | 168 | draw_string(display, smalldigits_bitmaps, buffer, |
169 | 0, display->height-year_line*str_h); | 169 | 0, display->getheight()-year_line*str_h); |
170 | rb->snprintf(buffer, 10, "%04d", time->year); | 170 | rb->snprintf(buffer, 10, "%04d", time->year); |
171 | 171 | ||
172 | /* draws year */ | 172 | /* draws year */ |
173 | getstringsize(smalldigits_bitmaps, buffer, &year_str_w, &str_h); | 173 | getstringsize(smalldigits_bitmaps, buffer, &year_str_w, &str_h); |
174 | draw_string(display, smalldigits_bitmaps, buffer, | 174 | draw_string(display, smalldigits_bitmaps, buffer, |
175 | (monthday_str_w-year_str_w)/2, | 175 | (monthday_str_w-year_str_w)/2, |
176 | display->height-monthday_line*str_h); | 176 | display->getheight()-monthday_line*str_h); |
177 | } | 177 | } |
178 | 178 | ||
179 | void draw_border(struct screen* display, int skin) | 179 | void draw_border(struct screen* display, int skin) |
@@ -181,7 +181,7 @@ void draw_border(struct screen* display, int skin) | |||
181 | /* Draws square dots every 5 minutes */ | 181 | /* Draws square dots every 5 minutes */ |
182 | int i; | 182 | int i; |
183 | int x, y; | 183 | int x, y; |
184 | int size=display->height/50;/* size of the square dots */ | 184 | int size=display->getheight()/50;/* size of the square dots */ |
185 | if(size%2)/* a pair number */ | 185 | if(size%2)/* a pair number */ |
186 | size++; | 186 | size++; |
187 | for(i=0; i < 60; i+=5){ | 187 | for(i=0; i < 60; i+=5){ |
@@ -190,7 +190,7 @@ void draw_border(struct screen* display, int skin) | |||
190 | ANALOG_MINUTE_RADIUS(display, skin), &x, &y); | 190 | ANALOG_MINUTE_RADIUS(display, skin), &x, &y); |
191 | }else{ | 191 | }else{ |
192 | angle_to_square_screen_centered( | 192 | angle_to_square_screen_centered( |
193 | display, display->width/2-size/2, display->height/2-size/2, | 193 | display, display->getwidth()/2-size/2, display->getheight()/2-size/2, |
194 | MINUTE_ANGLE(i, 0), &x, &y); | 194 | MINUTE_ANGLE(i, 0), &x, &y); |
195 | } | 195 | } |
196 | display->fillrect(x-size/2, y-size/2, size, size); | 196 | display->fillrect(x-size/2, y-size/2, size, size); |
@@ -222,15 +222,15 @@ void draw_hour(struct screen* display, struct time* time, | |||
222 | 222 | ||
223 | void draw_center_cover(struct screen* display) | 223 | void draw_center_cover(struct screen* display) |
224 | { | 224 | { |
225 | display->hline((display->width/2)-1, | 225 | display->hline((display->getwidth()/2)-1, |
226 | (display->width/2)+1, (display->height/2)+3); | 226 | (display->getwidth()/2)+1, (display->getheight()/2)+3); |
227 | display->hline((display->width/2)-3, | 227 | display->hline((display->getwidth()/2)-3, |
228 | (display->width/2)+3, (display->height/2)+2); | 228 | (display->getwidth()/2)+3, (display->getheight()/2)+2); |
229 | display->fillrect((display->width/2)-4, (display->height/2)-1, 9, 3); | 229 | display->fillrect((display->getwidth()/2)-4, (display->getheight()/2)-1, 9, 3); |
230 | display->hline((display->width/2)-3, | 230 | display->hline((display->getwidth()/2)-3, |
231 | (display->width/2)+3, (display->height/2)-2); | 231 | (display->getwidth()/2)+3, (display->getheight()/2)-2); |
232 | display->hline((display->width/2)-1, | 232 | display->hline((display->getwidth()/2)-1, |
233 | (display->width/2)+1, (display->height/2)-3); | 233 | (display->getwidth()/2)+1, (display->getheight()/2)-3); |
234 | } | 234 | } |
235 | 235 | ||
236 | void analog_clock_draw(struct screen* display, struct time* time, | 236 | void analog_clock_draw(struct screen* display, struct time* time, |
diff --git a/apps/plugins/clock/clock_draw_binary.c b/apps/plugins/clock/clock_draw_binary.c index f50351f226..b6c7a9ac29 100644 --- a/apps/plugins/clock/clock_draw_binary.c +++ b/apps/plugins/clock/clock_draw_binary.c | |||
@@ -45,8 +45,8 @@ void binary_clock_draw(struct screen* display, struct time* time, int skin){ | |||
45 | char buffer[9]; | 45 | char buffer[9]; |
46 | int i; | 46 | int i; |
47 | const struct picture* binary_bitmaps = &(binary_skin[skin][display->screen_type]); | 47 | const struct picture* binary_bitmaps = &(binary_skin[skin][display->screen_type]); |
48 | int y_offset=(display->height-(binary_bitmaps->height*3))/2; | 48 | int y_offset=(display->getheight()-(binary_bitmaps->height*3))/2; |
49 | int x_offset=(display->width-(binary_bitmaps->width*6))/2; | 49 | int x_offset=(display->getwidth()-(binary_bitmaps->width*6))/2; |
50 | for(i=0;i<3;i++){ | 50 | for(i=0;i<3;i++){ |
51 | print_binary(buffer, lines_values[i], 6); | 51 | print_binary(buffer, lines_values[i], 6); |
52 | draw_string(display, binary_bitmaps, buffer, x_offset, | 52 | draw_string(display, binary_bitmaps, buffer, x_offset, |
diff --git a/apps/plugins/clock/clock_draw_digital.c b/apps/plugins/clock/clock_draw_digital.c index d5c37ad8dc..7c5925d75f 100644 --- a/apps/plugins/clock/clock_draw_digital.c +++ b/apps/plugins/clock/clock_draw_digital.c | |||
@@ -64,19 +64,22 @@ void digital_clock_draw(struct screen* display, | |||
64 | } | 64 | } |
65 | } | 65 | } |
66 | getstringsize(digits_bitmaps, buffer, &str_w, &str_h); | 66 | getstringsize(digits_bitmaps, buffer, &str_w, &str_h); |
67 | draw_string(display, digits_bitmaps, buffer, (display->width-str_w)/2, 0); | 67 | draw_string(display, digits_bitmaps, buffer, |
68 | (display->getwidth()-str_w)/2, 0); | ||
68 | if(settings->digital.show_seconds){ | 69 | if(settings->digital.show_seconds){ |
69 | buffer_pos=0; | 70 | buffer_pos=0; |
70 | buffer_printf(buffer, buffer_pos, "%02d", time->second); | 71 | buffer_printf(buffer, buffer_pos, "%02d", time->second); |
71 | getstringsize(digits_bitmaps, buffer, &str_w, &str_h); | 72 | getstringsize(digits_bitmaps, buffer, &str_w, &str_h); |
72 | draw_string(display, digits_bitmaps, buffer, (display->width-str_w)/2, | 73 | draw_string(display, digits_bitmaps, buffer, |
74 | (display->getwidth()-str_w)/2, | ||
73 | digits_bitmaps->height); | 75 | digits_bitmaps->height); |
74 | } | 76 | } |
75 | if(settings->general.date_format!=NONE){ | 77 | if(settings->general.date_format!=NONE){ |
76 | format_date(buffer, time, settings->general.date_format); | 78 | format_date(buffer, time, settings->general.date_format); |
77 | getstringsize(smalldigits_bitmaps, buffer, &str_w, &str_h); | 79 | getstringsize(smalldigits_bitmaps, buffer, &str_w, &str_h); |
78 | draw_string(display, smalldigits_bitmaps, buffer, (display->width-str_w)/2, | 80 | draw_string(display, smalldigits_bitmaps, buffer, |
79 | display->height-smalldigits_bitmaps->height*2); | 81 | (display->getwidth()-str_w)/2, |
82 | display->getheight()-smalldigits_bitmaps->height*2); | ||
80 | } | 83 | } |
81 | if(counter){ | 84 | if(counter){ |
82 | struct time counter_time; | 85 | struct time counter_time; |
@@ -84,7 +87,7 @@ void digital_clock_draw(struct screen* display, | |||
84 | rb->snprintf(buffer, 20, "%02d:%02d:%02d", | 87 | rb->snprintf(buffer, 20, "%02d:%02d:%02d", |
85 | counter_time.hour, counter_time.minute, counter_time.second); | 88 | counter_time.hour, counter_time.minute, counter_time.second); |
86 | getstringsize(smalldigits_bitmaps, buffer, &str_w, &str_h); | 89 | getstringsize(smalldigits_bitmaps, buffer, &str_w, &str_h); |
87 | draw_string(display, smalldigits_bitmaps, buffer, (display->width-str_w)/2, | 90 | draw_string(display, smalldigits_bitmaps, buffer, |
88 | display->height-str_h); | 91 | (display->getwidth()-str_w)/2, display->getheight()-str_h); |
89 | } | 92 | } |
90 | } | 93 | } |
diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c index ea87720f87..44a6f164a7 100644 --- a/apps/plugins/clock/clock_settings.c +++ b/apps/plugins/clock/clock_settings.c | |||
@@ -144,11 +144,11 @@ void draw_logo(struct screen* display){ | |||
144 | void draw_message(struct screen* display, int msg, int y){ | 144 | void draw_message(struct screen* display, int msg, int y){ |
145 | const struct picture* message = &(messages[display->screen_type]); | 145 | const struct picture* message = &(messages[display->screen_type]); |
146 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 146 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
147 | display->fillrect(0, display->height-message->height, | 147 | display->fillrect(0, display->getheight()-message->height, |
148 | display->width, message->height); | 148 | display->getwidth(), message->height); |
149 | display->set_drawmode(DRMODE_SOLID); | 149 | display->set_drawmode(DRMODE_SOLID); |
150 | vertical_picture_draw_sprite(display, message, msg, | 150 | vertical_picture_draw_sprite(display, message, msg, |
151 | 0, display->height-(message->height*y)); | 151 | 0, display->getheight()-(message->height*y)); |
152 | } | 152 | } |
153 | 153 | ||
154 | void load_settings(void){ | 154 | void load_settings(void){ |
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c index bc659eb0d0..96cb5a4cc0 100644 --- a/apps/plugins/demystify.c +++ b/apps/plugins/demystify.c | |||
@@ -108,8 +108,8 @@ void polygon_init(struct polygon * polygon, struct screen * display) | |||
108 | int i; | 108 | int i; |
109 | for(i=0;i<NB_POINTS;++i) | 109 | for(i=0;i<NB_POINTS;++i) |
110 | { | 110 | { |
111 | polygon->points[i].x=(rb->rand() % (display->width)); | 111 | polygon->points[i].x=(rb->rand() % (display->getwidth())); |
112 | polygon->points[i].y=(rb->rand() % (display->height)); | 112 | polygon->points[i].y=(rb->rand() % (display->getheight())); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
@@ -167,9 +167,9 @@ void polygon_update(struct polygon *polygon, struct screen * display, struct pol | |||
167 | x=1; | 167 | x=1; |
168 | polygon_move->move_steps[i].x=get_new_step(step); | 168 | polygon_move->move_steps[i].x=get_new_step(step); |
169 | } | 169 | } |
170 | else if(x>=display->width) | 170 | else if(x>=display->getwidth()) |
171 | { | 171 | { |
172 | x=display->width-1; | 172 | x=display->getwidth()-1; |
173 | polygon_move->move_steps[i].x=get_new_step(step); | 173 | polygon_move->move_steps[i].x=get_new_step(step); |
174 | } | 174 | } |
175 | polygon->points[i].x=x; | 175 | polygon->points[i].x=x; |
@@ -182,9 +182,9 @@ void polygon_update(struct polygon *polygon, struct screen * display, struct pol | |||
182 | y=1; | 182 | y=1; |
183 | polygon_move->move_steps[i].y=get_new_step(step); | 183 | polygon_move->move_steps[i].y=get_new_step(step); |
184 | } | 184 | } |
185 | else if(y>=display->height) | 185 | else if(y>=display->getheight()) |
186 | { | 186 | { |
187 | y=display->height-1; | 187 | y=display->getheight()-1; |
188 | polygon_move->move_steps[i].y=get_new_step(step); | 188 | polygon_move->move_steps[i].y=get_new_step(step); |
189 | } | 189 | } |
190 | polygon->points[i].y=y; | 190 | polygon->points[i].y=y; |
diff --git a/apps/plugins/dice.c b/apps/plugins/dice.c index 6f13cdd51a..086309a1b8 100644 --- a/apps/plugins/dice.c +++ b/apps/plugins/dice.c | |||
@@ -112,7 +112,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame | |||
112 | void dice_init(struct dices* dice){ | 112 | void dice_init(struct dices* dice){ |
113 | dice->nb_dices=INITIAL_NB_DICES; | 113 | dice->nb_dices=INITIAL_NB_DICES; |
114 | sides_index=INITIAL_NB_SIDES; | 114 | sides_index=INITIAL_NB_SIDES; |
115 | 115 | ||
116 | } | 116 | } |
117 | 117 | ||
118 | void dice_roll(struct dices* dice) { | 118 | void dice_roll(struct dices* dice) { |
@@ -139,8 +139,8 @@ void dice_print(struct dices* dice, struct screen* display){ | |||
139 | /* display characteristics */ | 139 | /* display characteristics */ |
140 | int char_height, char_width; | 140 | int char_height, char_width; |
141 | display->getstringsize("M", &char_width, &char_height); | 141 | display->getstringsize("M", &char_width, &char_height); |
142 | int display_nb_row=display->height/char_height; | 142 | int display_nb_row=display->getheight()/char_height; |
143 | int display_nb_col=display->width/char_width; | 143 | int display_nb_col=display->getwidth()/char_width; |
144 | 144 | ||
145 | int nb_dices_per_line=display_nb_col/4;/* 4 char per dice displayed*/ | 145 | int nb_dices_per_line=display_nb_col/4;/* 4 char per dice displayed*/ |
146 | int nb_lines_required=dice->nb_dices/nb_dices_per_line; | 146 | int nb_lines_required=dice->nb_dices/nb_dices_per_line; |
diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c index f4a2914116..38cd12e993 100644 --- a/apps/plugins/jackpot.c +++ b/apps/plugins/jackpot.c | |||
@@ -173,8 +173,8 @@ void jackpot_display_slot_machine(struct jackpot* game, struct screen* display) | |||
173 | display->putc(0, 0, '['); | 173 | display->putc(0, 0, '['); |
174 | #else | 174 | #else |
175 | const struct picture* picture= &(jackpot_pictures[display->screen_type]); | 175 | const struct picture* picture= &(jackpot_pictures[display->screen_type]); |
176 | int pos_x=(display->width-NB_SLOTS*(picture->width+1))/2; | 176 | int pos_x=(display->getwidth()-NB_SLOTS*(picture->width+1))/2; |
177 | int pos_y=(display->height-(picture->height))/2; | 177 | int pos_y=(display->getheight()-(picture->height))/2; |
178 | #endif /* HAVE_LCD_CHARCELLS */ | 178 | #endif /* HAVE_LCD_CHARCELLS */ |
179 | for(i=0;i<NB_SLOTS;i++) | 179 | for(i=0;i<NB_SLOTS;i++) |
180 | { | 180 | { |
@@ -223,9 +223,10 @@ void jackpot_info_message(struct screen* display, char* message) | |||
223 | int xpos, ypos; | 223 | int xpos, ypos; |
224 | int message_height, message_width; | 224 | int message_height, message_width; |
225 | display->getstringsize(message, &message_width, &message_height); | 225 | display->getstringsize(message, &message_width, &message_height); |
226 | xpos=(display->width-message_width)/2; | 226 | xpos=(display->getwidth()-message_width)/2; |
227 | ypos=display->height-message_height; | 227 | ypos=display->getheight()-message_height; |
228 | rb->screen_clear_area(display, 0, ypos, display->width, message_height); | 228 | rb->screen_clear_area(display, 0, ypos, display->getwidth(), |
229 | message_height); | ||
229 | display->putsxy(xpos,ypos,message); | 230 | display->putsxy(xpos,ypos,message); |
230 | display->update(); | 231 | display->update(); |
231 | #endif /* HAVE_LCD_CHARCELLS */ | 232 | #endif /* HAVE_LCD_CHARCELLS */ |
diff --git a/apps/plugins/maze.c b/apps/plugins/maze.c index e407caeb82..2fbdd60480 100644 --- a/apps/plugins/maze.c +++ b/apps/plugins/maze.c | |||
@@ -176,8 +176,8 @@ void maze_draw(struct maze* maze, struct screen* display) | |||
176 | int point_width, point_height, point_offset_x, point_offset_y; | 176 | int point_width, point_height, point_offset_x, point_offset_y; |
177 | unsigned short cell; | 177 | unsigned short cell; |
178 | 178 | ||
179 | wx = (int) display->width / MAZE_WIDTH; | 179 | wx = (int) display->getwidth() / MAZE_WIDTH; |
180 | wy = (int) display->height / MAZE_HEIGHT; | 180 | wy = (int) display->getheight() / MAZE_HEIGHT; |
181 | 181 | ||
182 | if(wx>3){ | 182 | if(wx>3){ |
183 | point_width=wx-3; | 183 | point_width=wx-3; |
diff --git a/apps/plugins/star.c b/apps/plugins/star.c index b419d965c5..23bfd3ceef 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c | |||
@@ -995,7 +995,7 @@ static int star_menu(void) | |||
995 | rb->viewport_set_defaults(&vp[selection], selection); | 995 | rb->viewport_set_defaults(&vp[selection], selection); |
996 | /* we are hiding the statusbar so fix the height also */ | 996 | /* we are hiding the statusbar so fix the height also */ |
997 | vp[selection].y = 0; | 997 | vp[selection].y = 0; |
998 | vp[selection].height = rb->screens[selection]->height; | 998 | vp[selection].height = rb->screens[selection]->lcdheight; |
999 | #if LCD_DEPTH > 1 | 999 | #if LCD_DEPTH > 1 |
1000 | if (rb->screens[selection]->depth > 1) | 1000 | if (rb->screens[selection]->depth > 1) |
1001 | { | 1001 | { |
diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c index 184d2ef4b5..146d7432b4 100644 --- a/apps/plugins/zxbox/zxbox_keyb.c +++ b/apps/plugins/zxbox/zxbox_keyb.c | |||
@@ -232,7 +232,8 @@ int zx_kbd_input(char* text/*, int buflen*/) | |||
232 | param[l].font_h = param[l].font->height; | 232 | param[l].font_h = param[l].font->height; |
233 | 233 | ||
234 | /* check if FONT_UI fits the screen */ | 234 | /* check if FONT_UI fits the screen */ |
235 | if (2*param[l].font_h+3 + BUTTONBAR_HEIGHT > rb->screens[l]->height) { | 235 | if (2*param[l].font_h+3 + BUTTONBAR_HEIGHT > |
236 | rb->screens[l]->getheight()) { | ||
236 | param[l].font = rb->font_get(FONT_SYSFIXED); | 237 | param[l].font = rb->font_get(FONT_SYSFIXED); |
237 | param[l].font_h = param[l].font->height; | 238 | param[l].font_h = param[l].font->height; |
238 | param[l].curfont = FONT_SYSFIXED; | 239 | param[l].curfont = FONT_SYSFIXED; |
@@ -259,9 +260,9 @@ int zx_kbd_input(char* text/*, int buflen*/) | |||
259 | { | 260 | { |
260 | if( param[l].kbd_buf[i] == '\n' ) | 261 | if( param[l].kbd_buf[i] == '\n' ) |
261 | { | 262 | { |
262 | k = ( rb->screens[l]->width / param[l].font_w ) | 263 | k = ( rb->screens[l]->getwidth() / param[l].font_w ) - |
263 | - i % ( rb->screens[l]->width / param[l].font_w ) - 1; | 264 | i % ( rb->screens[l]->getwidth() / param[l].font_w ) - 1; |
264 | if( k == ( rb->screens[l]->width / param[l].font_w ) - 1 ) | 265 | if( k == ( rb->screens[l]->getwidth() / param[l].font_w ) - 1 ) |
265 | { | 266 | { |
266 | param[l].nchars--; | 267 | param[l].nchars--; |
267 | for( j = i; j < param[l].nchars; j++ ) | 268 | for( j = i; j < param[l].nchars; j++ ) |
@@ -303,17 +304,19 @@ int zx_kbd_input(char* text/*, int buflen*/) | |||
303 | if (w > text_w) | 304 | if (w > text_w) |
304 | text_w = w; | 305 | text_w = w; |
305 | } | 306 | } |
306 | param[l].max_chars_text = rb->screens[l]->width / text_w - 2; | 307 | param[l].max_chars_text = rb->screens[l]->getwidth() / text_w - 2; |
307 | 308 | ||
308 | /* calculate keyboard grid size */ | 309 | /* calculate keyboard grid size */ |
309 | param[l].max_chars = rb->screens[l]->width / param[l].font_w; | 310 | param[l].max_chars = rb->screens[l]->getwidth() / param[l].font_w; |
310 | if (!kbd_loaded) { | 311 | if (!kbd_loaded) { |
311 | param[l].lines = param[l].DEFAULT_LINES; | 312 | param[l].lines = param[l].DEFAULT_LINES; |
312 | param[l].keyboard_margin = DEFAULT_MARGIN; | 313 | param[l].keyboard_margin = DEFAULT_MARGIN; |
313 | } else { | 314 | } else { |
314 | param[l].lines = (rb->screens[l]->height - BUTTONBAR_HEIGHT - statusbar_size) / param[l].font_h - 1; | 315 | param[l].lines = (rb->screens[l]->lcdheight - BUTTONBAR_HEIGHT - |
315 | param[l].keyboard_margin = rb->screens[l]->height - BUTTONBAR_HEIGHT - | 316 | statusbar_size) / param[l].font_h - 1; |
316 | statusbar_size - (param[l].lines+1)*param[l].font_h; | 317 | param[l].keyboard_margin = rb->screens[l]->lcdheight - |
318 | BUTTONBAR_HEIGHT - statusbar_size - | ||
319 | (param[l].lines+1)*param[l].font_h; | ||
317 | if (param[l].keyboard_margin < 3) { | 320 | if (param[l].keyboard_margin < 3) { |
318 | param[l].lines--; | 321 | param[l].lines--; |
319 | param[l].keyboard_margin += param[l].font_h; | 322 | param[l].keyboard_margin += param[l].font_h; |
@@ -342,7 +345,7 @@ int zx_kbd_input(char* text/*, int buflen*/) | |||
342 | FOR_NB_SCREENS(l) | 345 | FOR_NB_SCREENS(l) |
343 | rb->screens[l]->clear_display(); | 346 | rb->screens[l]->clear_display(); |
344 | 347 | ||
345 | 348 | ||
346 | /* draw page */ | 349 | /* draw page */ |
347 | FOR_NB_SCREENS(l) | 350 | FOR_NB_SCREENS(l) |
348 | { | 351 | { |
@@ -360,12 +363,13 @@ int zx_kbd_input(char* text/*, int buflen*/) | |||
360 | } | 363 | } |
361 | } | 364 | } |
362 | } | 365 | } |
363 | 366 | ||
364 | 367 | ||
365 | /* separator */ | 368 | /* separator */ |
366 | FOR_NB_SCREENS(l) | 369 | FOR_NB_SCREENS(l) |
367 | { | 370 | { |
368 | rb->screens[l]->hline(0, rb->screens[l]->width - 1, param[l].main_y - param[l].keyboard_margin); | 371 | rb->screens[l]->hline(0, rb->screens[l]->getwidth() - 1, |
372 | param[l].main_y - param[l].keyboard_margin); | ||
369 | 373 | ||
370 | /* write out the text */ | 374 | /* write out the text */ |
371 | #if 0 | 375 | #if 0 |
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index 2b0ba49fb3..a15b4cc346 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2002 by Björn Stenberg | 10 | * Copyright (C) 2002 by Bj�rn Stenberg |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or | 12 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 13 | * modify it under the terms of the GNU General Public License |
@@ -302,7 +302,7 @@ int kbd_input(char* text, int buflen) | |||
302 | #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 96 | 302 | #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 96 |
303 | struct screen *sc = &screens[l]; | 303 | struct screen *sc = &screens[l]; |
304 | 304 | ||
305 | if (sc->width >= 160 && sc->height >= 96) | 305 | if (sc->getwidth() >= 160 && sc->getheight() >= 96) |
306 | { | 306 | { |
307 | pm->default_kbd = | 307 | pm->default_kbd = |
308 | "ABCDEFG abcdefg !?\" @#$%+'\n" | 308 | "ABCDEFG abcdefg !?\" @#$%+'\n" |
@@ -384,7 +384,8 @@ int kbd_input(char* text, int buflen) | |||
384 | pm->font_h = pm->font->height; | 384 | pm->font_h = pm->font->height; |
385 | 385 | ||
386 | /* check if FONT_UI fits the screen */ | 386 | /* check if FONT_UI fits the screen */ |
387 | if (2*pm->font_h + 3 + statusbar_size + BUTTONBAR_HEIGHT > sc->height) | 387 | if (2*pm->font_h + 3 + statusbar_size + |
388 | BUTTONBAR_HEIGHT > sc->getheight()) | ||
388 | { | 389 | { |
389 | pm->font = font_get(FONT_SYSFIXED); | 390 | pm->font = font_get(FONT_SYSFIXED); |
390 | pm->font_h = pm->font->height; | 391 | pm->font_h = pm->font->height; |
@@ -419,11 +420,11 @@ int kbd_input(char* text, int buflen) | |||
419 | { | 420 | { |
420 | if (pm->kbd_buf[i] == '\n') | 421 | if (pm->kbd_buf[i] == '\n') |
421 | { | 422 | { |
422 | int k = sc->width / pm->font_w | 423 | int k = sc->getwidth() / pm->font_w |
423 | - i % ( sc->width / pm->font_w ) - 1; | 424 | - i % ( sc->getwidth() / pm->font_w ) - 1; |
424 | int j; | 425 | int j; |
425 | 426 | ||
426 | if (k == sc->width / pm->font_w - 1) | 427 | if (k == sc->getwidth() / pm->font_w - 1) |
427 | { | 428 | { |
428 | pm->nchars--; | 429 | pm->nchars--; |
429 | 430 | ||
@@ -478,10 +479,10 @@ int kbd_input(char* text, int buflen) | |||
478 | text_w = w; | 479 | text_w = w; |
479 | } | 480 | } |
480 | 481 | ||
481 | pm->max_chars_text = sc->width / text_w - 2; | 482 | pm->max_chars_text = sc->getwidth() / text_w - 2; |
482 | 483 | ||
483 | /* Calculate keyboard grid size */ | 484 | /* Calculate keyboard grid size */ |
484 | pm->max_chars = sc->width / pm->font_w; | 485 | pm->max_chars = sc->getwidth() / pm->font_w; |
485 | 486 | ||
486 | if (!kbd_loaded) | 487 | if (!kbd_loaded) |
487 | { | 488 | { |
@@ -490,9 +491,9 @@ int kbd_input(char* text, int buflen) | |||
490 | } | 491 | } |
491 | else | 492 | else |
492 | { | 493 | { |
493 | pm->lines = (sc->height - BUTTONBAR_HEIGHT - statusbar_size) | 494 | pm->lines = (sc->getheight() - BUTTONBAR_HEIGHT - statusbar_size) |
494 | / pm->font_h - 1; | 495 | / pm->font_h - 1; |
495 | pm->keyboard_margin = sc->height - BUTTONBAR_HEIGHT - | 496 | pm->keyboard_margin = sc->getheight() - BUTTONBAR_HEIGHT - |
496 | statusbar_size - (pm->lines+1)*pm->font_h; | 497 | statusbar_size - (pm->lines+1)*pm->font_h; |
497 | 498 | ||
498 | if (pm->keyboard_margin < 3) | 499 | if (pm->keyboard_margin < 3) |
@@ -518,7 +519,7 @@ int kbd_input(char* text, int buflen) | |||
518 | #ifdef KBD_MORSE_INPUT | 519 | #ifdef KBD_MORSE_INPUT |
519 | pm->old_main_y = pm->main_y; | 520 | pm->old_main_y = pm->main_y; |
520 | if (morse_mode) | 521 | if (morse_mode) |
521 | pm->main_y = sc->height - pm->font_h; | 522 | pm->main_y = sc->getheight() - pm->font_h; |
522 | #endif | 523 | #endif |
523 | } | 524 | } |
524 | 525 | ||
@@ -587,7 +588,7 @@ int kbd_input(char* text, int buflen) | |||
587 | } | 588 | } |
588 | 589 | ||
589 | pm->x += w*5 - 3; | 590 | pm->x += w*5 - 3; |
590 | if (pm->x >= sc->width - w*6) | 591 | if (pm->x >= sc->getwidth() - w*6) |
591 | { | 592 | { |
592 | pm->x = 0; | 593 | pm->x = 0; |
593 | pm->y += 8; /* sysfixed font height */ | 594 | pm->y += 8; /* sysfixed font height */ |
@@ -639,10 +640,10 @@ int kbd_input(char* text, int buflen) | |||
639 | doesn't collide */ | 640 | doesn't collide */ |
640 | sc->set_drawmode(DRMODE_SOLID | DRMODE_INVERSEVID); | 641 | sc->set_drawmode(DRMODE_SOLID | DRMODE_INVERSEVID); |
641 | sc->fillrect(0, pm->main_y - pm->keyboard_margin - 1, | 642 | sc->fillrect(0, pm->main_y - pm->keyboard_margin - 1, |
642 | sc->width, pm->font_h + 4); | 643 | sc->getwidth(), pm->font_h + 4); |
643 | sc->set_drawmode(DRMODE_SOLID); | 644 | sc->set_drawmode(DRMODE_SOLID); |
644 | 645 | ||
645 | sc->hline(0, sc->width - 1, pm->main_y - pm->keyboard_margin); | 646 | sc->hline(0, sc->getwidth() - 1, pm->main_y - pm->keyboard_margin); |
646 | 647 | ||
647 | /* write out the text */ | 648 | /* write out the text */ |
648 | sc->setfont(pm->curfont); | 649 | sc->setfont(pm->curfont); |
@@ -691,13 +692,14 @@ int kbd_input(char* text, int buflen) | |||
691 | /* Draw nicer bitmap arrow if room, else settle for ">". */ | 692 | /* Draw nicer bitmap arrow if room, else settle for ">". */ |
692 | if (text_w >= 6 && pm->font_h >= 8) | 693 | if (text_w >= 6 && pm->font_h >= 8) |
693 | { | 694 | { |
694 | screen_put_iconxy(sc, sc->width - text_w + (text_w - 6) / 2, | 695 | screen_put_iconxy(sc, sc->getwidth() - text_w + |
696 | (text_w - 6) / 2, | ||
695 | pm->main_y + (pm->font_h - 8) / 2, | 697 | pm->main_y + (pm->font_h - 8) / 2, |
696 | Icon_Cursor); | 698 | Icon_Cursor); |
697 | } | 699 | } |
698 | else | 700 | else |
699 | { | 701 | { |
700 | sc->putsxy(sc->width - text_w, pm->main_y, ">"); | 702 | sc->putsxy(sc->getwidth() - text_w, pm->main_y, ">"); |
701 | } | 703 | } |
702 | } | 704 | } |
703 | 705 | ||
@@ -729,7 +731,7 @@ int kbd_input(char* text, int buflen) | |||
729 | #ifdef KBD_MODES | 731 | #ifdef KBD_MODES |
730 | if (pm->line_edit) | 732 | if (pm->line_edit) |
731 | sc->fillrect(0, pm->main_y - pm->keyboard_margin + 2, | 733 | sc->fillrect(0, pm->main_y - pm->keyboard_margin + 2, |
732 | sc->width, pm->font_h + 2); | 734 | sc->getwidth(), pm->font_h + 2); |
733 | else /* highlight the key that has focus */ | 735 | else /* highlight the key that has focus */ |
734 | #endif | 736 | #endif |
735 | sc->fillrect(pm->font_w*pm->x, | 737 | sc->fillrect(pm->font_w*pm->x, |
@@ -801,7 +803,7 @@ int kbd_input(char* text, int buflen) | |||
801 | if (morse_mode) | 803 | if (morse_mode) |
802 | { | 804 | { |
803 | pm->old_main_y = pm->main_y; | 805 | pm->old_main_y = pm->main_y; |
804 | pm->main_y = sc->height - pm->font_h; | 806 | pm->main_y = sc->getheight() - pm->font_h; |
805 | } | 807 | } |
806 | else | 808 | else |
807 | { | 809 | { |
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 9251a1d609..de4a2e6805 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -1064,8 +1064,9 @@ bool recording_screen(bool no_source) | |||
1064 | screen_update = 1; | 1064 | screen_update = 1; |
1065 | screens[1].clear_display(); | 1065 | screens[1].clear_display(); |
1066 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); | 1066 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); |
1067 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, | 1067 | screens[1].puts((screens[1].getwidth()/w - strlen(buf))/2 + |
1068 | screens[1].height/(h*2) + 1, buf); | 1068 | 1, |
1069 | screens[1].getheight()/(h*2) + 1, buf); | ||
1069 | screens[1].update(); | 1070 | screens[1].update(); |
1070 | gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); | 1071 | gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); |
1071 | } | 1072 | } |
@@ -1880,10 +1881,12 @@ bool recording_screen(bool no_source) | |||
1880 | /* draw the trigger status */ | 1881 | /* draw the trigger status */ |
1881 | FOR_NB_SCREENS(i) | 1882 | FOR_NB_SCREENS(i) |
1882 | { | 1883 | { |
1884 | /* NOTE: UGLY width setting based on height! To be fixed! */ | ||
1883 | trig_width[i] = ((vp[i].height < 64) || | 1885 | trig_width[i] = ((vp[i].height < 64) || |
1884 | ((vp[i].height < 72) && (PM_HEIGHT > 1))) ? | 1886 | ((vp[i].height < 72) && (PM_HEIGHT > 1))) ? |
1885 | screens[i].width - 14 * w : screens[i].width; | 1887 | screens[i].getwidth() - 14 * w : |
1886 | trig_xpos[i] = screens[i].width - trig_width[i]; | 1888 | screens[i].getwidth(); |
1889 | trig_xpos[i] = screens[i].getwidth() - trig_width[i]; | ||
1887 | trig_ypos[i] = ((vp[i].height < 72) && (PM_HEIGHT > 1)) ? | 1890 | trig_ypos[i] = ((vp[i].height < 72) && (PM_HEIGHT > 1)) ? |
1888 | h*2 : | 1891 | h*2 : |
1889 | h*(1 + filename_offset[i] + PM_HEIGHT + | 1892 | h*(1 + filename_offset[i] + PM_HEIGHT + |
diff --git a/apps/screen_access.c b/apps/screen_access.c index a1cabf67e3..de59537770 100644 --- a/apps/screen_access.c +++ b/apps/screen_access.c | |||
@@ -36,8 +36,8 @@ struct screen screens[NB_SCREENS] = | |||
36 | { | 36 | { |
37 | { | 37 | { |
38 | .screen_type=SCREEN_MAIN, | 38 | .screen_type=SCREEN_MAIN, |
39 | .width=LCD_WIDTH, | 39 | .lcdwidth=LCD_WIDTH, |
40 | .height=LCD_HEIGHT, | 40 | .lcdheight=LCD_HEIGHT, |
41 | .depth=LCD_DEPTH, | 41 | .depth=LCD_DEPTH, |
42 | #if defined(HAVE_LCD_COLOR) | 42 | #if defined(HAVE_LCD_COLOR) |
43 | .is_color=true, | 43 | .is_color=true, |
@@ -134,8 +134,8 @@ struct screen screens[NB_SCREENS] = | |||
134 | #if NB_SCREENS == 2 | 134 | #if NB_SCREENS == 2 |
135 | { | 135 | { |
136 | .screen_type=SCREEN_REMOTE, | 136 | .screen_type=SCREEN_REMOTE, |
137 | .width=LCD_REMOTE_WIDTH, | 137 | .lcdwidth=LCD_REMOTE_WIDTH, |
138 | .height=LCD_REMOTE_HEIGHT, | 138 | .lcdheight=LCD_REMOTE_HEIGHT, |
139 | .depth=LCD_REMOTE_DEPTH, | 139 | .depth=LCD_REMOTE_DEPTH, |
140 | .is_color=false,/* No color remotes yet */ | 140 | .is_color=false,/* No color remotes yet */ |
141 | .pixel_format=LCD_REMOTE_PIXELFORMAT, | 141 | .pixel_format=LCD_REMOTE_PIXELFORMAT, |
@@ -230,8 +230,8 @@ void screen_access_init(void) | |||
230 | #ifdef HAVE_LCD_BITMAP | 230 | #ifdef HAVE_LCD_BITMAP |
231 | ((struct screen*)&screens[i])->setfont(FONT_UI); | 231 | ((struct screen*)&screens[i])->setfont(FONT_UI); |
232 | #endif | 232 | #endif |
233 | 233 | ||
234 | int height=display->height; | 234 | int height=display->lcdheight; |
235 | #ifdef HAVE_LCD_BITMAP | 235 | #ifdef HAVE_LCD_BITMAP |
236 | if(global_settings.statusbar) | 236 | if(global_settings.statusbar) |
237 | height -= STATUSBAR_HEIGHT; | 237 | height -= STATUSBAR_HEIGHT; |
diff --git a/apps/screen_access.h b/apps/screen_access.h index 950551592e..d800c31489 100644 --- a/apps/screen_access.h +++ b/apps/screen_access.h | |||
@@ -58,7 +58,7 @@ typedef void screen_bitmap_func(const void *src, int x, int y, int width, | |||
58 | struct screen | 58 | struct screen |
59 | { | 59 | { |
60 | enum screen_type screen_type; | 60 | enum screen_type screen_type; |
61 | int width, height; | 61 | int lcdwidth, lcdheight; |
62 | int depth; | 62 | int depth; |
63 | int nb_lines; | 63 | int nb_lines; |
64 | #ifdef HAVE_LCD_BITMAP | 64 | #ifdef HAVE_LCD_BITMAP |