diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-06-24 22:33:21 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-06-24 22:33:21 +0000 |
commit | 04daef17a1d180c68888c29d11a1b9087e9ace32 (patch) | |
tree | f2d794c196981fc605880e3bbb4447edbaba5f50 /apps/recorder | |
parent | 0e935bdf01aff1e3bc66221c9a0fcc80f935c3d6 (diff) | |
download | rockbox-04daef17a1d180c68888c29d11a1b9087e9ace32.tar.gz rockbox-04daef17a1d180c68888c29d11a1b9087e9ace32.zip |
First part of graphics api rework. Special functions, parameter handling, pixel functions, lines and filled primitives done for black & white core, main display.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6856 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r-- | apps/recorder/keyboard.c | 6 | ||||
-rw-r--r-- | apps/recorder/peakmeter.c | 19 | ||||
-rw-r--r-- | apps/recorder/widgets.c | 24 |
3 files changed, 34 insertions, 15 deletions
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index d974752b84..cfaf03c94a 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c | |||
@@ -195,8 +195,12 @@ int kbd_input(char* text, int buflen) | |||
195 | #ifdef KBD_MODES | 195 | #ifdef KBD_MODES |
196 | if (!line_edit) | 196 | if (!line_edit) |
197 | #endif | 197 | #endif |
198 | { | ||
198 | /* highlight the key that has focus */ | 199 | /* highlight the key that has focus */ |
199 | lcd_invertrect(font_w * x, 8 + font_h * y, font_w, font_h); | 200 | lcd_set_drawmode(DRMODE_COMPLEMENT); |
201 | lcd_fillrect(font_w * x, 8 + font_h * y, font_w, font_h); | ||
202 | lcd_set_drawmode(DRMODE_SOLID); | ||
203 | } | ||
200 | 204 | ||
201 | status_draw(true); | 205 | status_draw(true); |
202 | 206 | ||
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 9baa9fdb35..8fffc9500d 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c | |||
@@ -835,7 +835,8 @@ unsigned short peak_meter_scale_value(unsigned short val, int meterwidth){ | |||
835 | * width > 3 | 835 | * width > 3 |
836 | * @param int height - The height of the peak meter. height > 3 | 836 | * @param int height - The height of the peak meter. height > 3 |
837 | */ | 837 | */ |
838 | void peak_meter_draw(int x, int y, int width, int height) { | 838 | void peak_meter_draw(int x, int y, int width, int height) |
839 | { | ||
839 | int left = 0, right = 0; | 840 | int left = 0, right = 0; |
840 | static int last_left = 0, last_right = 0; | 841 | static int last_left = 0, last_right = 0; |
841 | int meterwidth = width - 3; | 842 | int meterwidth = width - 3; |
@@ -930,7 +931,9 @@ void peak_meter_draw(int x, int y, int width, int height) { | |||
930 | } | 931 | } |
931 | 932 | ||
932 | /* draw the peak meter */ | 933 | /* draw the peak meter */ |
933 | lcd_clearrect(x, y, width, height); | 934 | lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
935 | lcd_fillrect(x, y, width, height); | ||
936 | lcd_set_drawmode(DRMODE_SOLID); | ||
934 | 937 | ||
935 | /* draw left */ | 938 | /* draw left */ |
936 | lcd_fillrect (x, y, left, height / 2 - 2 ); | 939 | lcd_fillrect (x, y, left, height / 2 - 2 ); |
@@ -956,17 +959,20 @@ void peak_meter_draw(int x, int y, int width, int height) { | |||
956 | lcd_drawline(x + meterwidth, y, | 959 | lcd_drawline(x + meterwidth, y, |
957 | x + meterwidth, y + height - 2); | 960 | x + meterwidth, y + height - 2); |
958 | 961 | ||
962 | lcd_set_drawmode(DRMODE_COMPLEMENT); | ||
959 | /* draw dots for scale marks */ | 963 | /* draw dots for scale marks */ |
960 | for (i = 0; i < db_scale_count; i++) { | 964 | for (i = 0; i < db_scale_count; i++) { |
961 | /* The x-coordinates of interesting scale mark points | 965 | /* The x-coordinates of interesting scale mark points |
962 | have been calculated before */ | 966 | have been calculated before */ |
963 | lcd_invertpixel(db_scale_lcd_coord[i], y + height / 2 - 1); | 967 | lcd_drawpixel(db_scale_lcd_coord[i], y + height / 2 - 1); |
964 | } | 968 | } |
965 | 969 | ||
970 | |||
966 | #ifdef HAVE_RECORDING | 971 | #ifdef HAVE_RECORDING |
967 | if (trig_status != TRIG_OFF) { | 972 | if (trig_status != TRIG_OFF) { |
968 | int start_trigx, stop_trigx, ycenter; | 973 | int start_trigx, stop_trigx, ycenter; |
969 | 974 | ||
975 | lcd_set_drawmode(DRMODE_SOLID); | ||
970 | ycenter = y + height / 2; | 976 | ycenter = y + height / 2; |
971 | /* display threshold value */ | 977 | /* display threshold value */ |
972 | start_trigx = x+peak_meter_scale_value(trig_strt_threshold,meterwidth); | 978 | start_trigx = x+peak_meter_scale_value(trig_strt_threshold,meterwidth); |
@@ -983,7 +989,8 @@ void peak_meter_draw(int x, int y, int width, int height) { | |||
983 | #ifdef PM_DEBUG | 989 | #ifdef PM_DEBUG |
984 | /* display a bar to show how many calls to peak_meter_peek | 990 | /* display a bar to show how many calls to peak_meter_peek |
985 | have ocurred since the last display */ | 991 | have ocurred since the last display */ |
986 | lcd_invertrect(x, y, tmp, 3); | 992 | lcd_set_drawmode(DRMODE_COMPLEMENT); |
993 | lcd_fillrect(x, y, tmp, 3); | ||
987 | 994 | ||
988 | if (tmp < PEEKS_PER_DRAW_SIZE) { | 995 | if (tmp < PEEKS_PER_DRAW_SIZE) { |
989 | peeks_per_redraw[tmp]++; | 996 | peeks_per_redraw[tmp]++; |
@@ -996,12 +1003,14 @@ void peak_meter_draw(int x, int y, int width, int height) { | |||
996 | 1003 | ||
997 | /* display a bar to show how many ticks have passed since | 1004 | /* display a bar to show how many ticks have passed since |
998 | the last redraw */ | 1005 | the last redraw */ |
999 | lcd_invertrect(x, y + height / 2, current_tick - pm_tick, 2); | 1006 | lcd_fillrect(x, y + height / 2, current_tick - pm_tick, 2); |
1000 | pm_tick = current_tick; | 1007 | pm_tick = current_tick; |
1001 | #endif | 1008 | #endif |
1002 | 1009 | ||
1003 | last_left = left; | 1010 | last_left = left; |
1004 | last_right = right; | 1011 | last_right = right; |
1012 | |||
1013 | lcd_set_drawmode(DRMODE_SOLID); | ||
1005 | } | 1014 | } |
1006 | 1015 | ||
1007 | #ifdef HAVE_RECORDING | 1016 | #ifdef HAVE_RECORDING |
diff --git a/apps/recorder/widgets.c b/apps/recorder/widgets.c index 5c608bcb6b..09daf87fd3 100644 --- a/apps/recorder/widgets.c +++ b/apps/recorder/widgets.c | |||
@@ -54,14 +54,16 @@ void scrollbar(int x, int y, int width, int height, int items, int min_shown, | |||
54 | /* draw box */ | 54 | /* draw box */ |
55 | lcd_drawrect(x, y, width, height); | 55 | lcd_drawrect(x, y, width, height); |
56 | 56 | ||
57 | lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
58 | |||
57 | /* clear edge pixels */ | 59 | /* clear edge pixels */ |
58 | lcd_clearpixel(x, y); | 60 | lcd_drawpixel(x, y); |
59 | lcd_clearpixel((x + width - 1), y); | 61 | lcd_drawpixel((x + width - 1), y); |
60 | lcd_clearpixel(x, (y + height - 1)); | 62 | lcd_drawpixel(x, (y + height - 1)); |
61 | lcd_clearpixel((x + width - 1), (y + height - 1)); | 63 | lcd_drawpixel((x + width - 1), (y + height - 1)); |
62 | 64 | ||
63 | /* clear pixels in progress bar */ | 65 | /* clear pixels in progress bar */ |
64 | lcd_clearrect(x + 1, y + 1, width - 2, height - 2); | 66 | lcd_fillrect(x + 1, y + 1, width - 2, height - 2); |
65 | 67 | ||
66 | /* min should be min */ | 68 | /* min should be min */ |
67 | if(min_shown < max_shown) { | 69 | if(min_shown < max_shown) { |
@@ -111,6 +113,8 @@ void scrollbar(int x, int y, int width, int height, int items, int min_shown, | |||
111 | size = 1; | 113 | size = 1; |
112 | } | 114 | } |
113 | 115 | ||
116 | lcd_set_drawmode(DRMODE_SOLID); | ||
117 | |||
114 | if(orientation == VERTICAL) | 118 | if(orientation == VERTICAL) |
115 | lcd_fillrect(x + 1, y + start + 1, width - 2, size); | 119 | lcd_fillrect(x + 1, y + start + 1, width - 2, size); |
116 | else | 120 | else |
@@ -133,11 +137,13 @@ void checkbox(int x, int y, int width, int height, bool checked) | |||
133 | lcd_drawrect(x, y, width, height); | 137 | lcd_drawrect(x, y, width, height); |
134 | 138 | ||
135 | if (checked){ | 139 | if (checked){ |
136 | lcd_drawline(x + 2, y + 2, x + width - 2 - 1 , y + height - 2 - 1); | 140 | lcd_drawline(x + 2, y + 2, x + width - 2 - 1 , y + height - 2 - 1); |
137 | lcd_drawline(x + 2, y + height - 2 - 1, x + width - 2 - 1, y + 2); | 141 | lcd_drawline(x + 2, y + height - 2 - 1, x + width - 2 - 1, y + 2); |
138 | } else { | 142 | } else { |
139 | /* be sure to clear box */ | 143 | /* be sure to clear box */ |
140 | lcd_clearrect(x + 1, y + 1, width - 2, height - 2); | 144 | lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
145 | lcd_fillrect(x + 1, y + 1, width - 2, height - 2); | ||
146 | lcd_set_drawmode(DRMODE_SOLID); | ||
141 | } | 147 | } |
142 | } | 148 | } |
143 | 149 | ||