diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2011-12-31 20:29:08 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2011-12-31 20:29:08 +0000 |
commit | ba03cb4aea212553f47a9da672fdd897e9f2e620 (patch) | |
tree | 27a03c72fa0a4416ad32c338947234f46aa7d296 /apps/plugins/clock | |
parent | c003d6c3328a59d071c2497b72b3e926be086530 (diff) | |
download | rockbox-ba03cb4aea212553f47a9da672fdd897e9f2e620.tar.gz rockbox-ba03cb4aea212553f47a9da672fdd897e9f2e620.zip |
Make local functions static in clock and chessbox plugin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31505 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/clock')
-rw-r--r-- | apps/plugins/clock/clock.c | 4 | ||||
-rw-r--r-- | apps/plugins/clock/clock_counter.c | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw.c | 10 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_analog.c | 22 | ||||
-rw-r--r-- | apps/plugins/clock/clock_draw_binary.c | 2 | ||||
-rw-r--r-- | apps/plugins/clock/clock_menu.c | 11 | ||||
-rw-r--r-- | apps/plugins/clock/clock_settings.c | 14 |
7 files changed, 33 insertions, 32 deletions
diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c index 641a1e7ad3..d287c75598 100644 --- a/apps/plugins/clock/clock.c +++ b/apps/plugins/clock/clock.c | |||
@@ -57,7 +57,7 @@ const struct button_mapping* plugin_contexts[]={ | |||
57 | /************************** | 57 | /************************** |
58 | * Cleanup on plugin return | 58 | * Cleanup on plugin return |
59 | *************************/ | 59 | *************************/ |
60 | void cleanup(void) | 60 | static void cleanup(void) |
61 | { | 61 | { |
62 | clock_draw_restore_colors(); | 62 | clock_draw_restore_colors(); |
63 | if(clock_settings.general.save_settings == 1) | 63 | if(clock_settings.general.save_settings == 1) |
@@ -68,7 +68,7 @@ void cleanup(void) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | /* puts the current time into the time struct */ | 70 | /* puts the current time into the time struct */ |
71 | void clock_update_time( struct time* time){ | 71 | static void clock_update_time( struct time* time){ |
72 | struct tm* current_time = rb->get_time(); | 72 | struct tm* current_time = rb->get_time(); |
73 | time->hour = current_time->tm_hour; | 73 | time->hour = current_time->tm_hour; |
74 | time->minute = current_time->tm_min; | 74 | time->minute = current_time->tm_min; |
diff --git a/apps/plugins/clock/clock_counter.c b/apps/plugins/clock/clock_counter.c index 7137eeaf38..ce29e4ce91 100644 --- a/apps/plugins/clock/clock_counter.c +++ b/apps/plugins/clock/clock_counter.c | |||
@@ -7,7 +7,7 @@ void counter_init(struct counter* counter){ | |||
7 | counter->paused=true; | 7 | counter->paused=true; |
8 | } | 8 | } |
9 | 9 | ||
10 | int counter_get_ticks_since_last_pause(struct counter* counter){ | 10 | static int counter_get_ticks_since_last_pause(struct counter* counter){ |
11 | if(!counter->paused) | 11 | if(!counter->paused) |
12 | return(*rb->current_tick - counter->ticks_at_last_unpause); | 12 | return(*rb->current_tick - counter->ticks_at_last_unpause); |
13 | return(0); | 13 | return(0); |
diff --git a/apps/plugins/clock/clock_draw.c b/apps/plugins/clock/clock_draw.c index 411a7f1545..ce5006d46d 100644 --- a/apps/plugins/clock/clock_draw.c +++ b/apps/plugins/clock/clock_draw.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "clock_draw_binary.h" | 26 | #include "clock_draw_binary.h" |
27 | #include "clock_settings.h" | 27 | #include "clock_settings.h" |
28 | 28 | ||
29 | void black_background(struct screen* display){ | 29 | static void black_background(struct screen* display){ |
30 | #if (LCD_DEPTH > 1) || (defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH > 1)) | 30 | #if (LCD_DEPTH > 1) || (defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH > 1)) |
31 | if(display->depth>1){ | 31 | if(display->depth>1){ |
32 | display->set_background(LCD_BLACK); | 32 | display->set_background(LCD_BLACK); |
@@ -39,7 +39,7 @@ void black_background(struct screen* display){ | |||
39 | } | 39 | } |
40 | } | 40 | } |
41 | 41 | ||
42 | void white_background(struct screen* display){ | 42 | static void white_background(struct screen* display){ |
43 | #if (LCD_DEPTH > 1) || (defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH > 1)) | 43 | #if (LCD_DEPTH > 1) || (defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH > 1)) |
44 | if(display->depth>1){ | 44 | if(display->depth>1){ |
45 | #if defined(HAVE_LCD_COLOR) | 45 | #if defined(HAVE_LCD_COLOR) |
@@ -53,18 +53,18 @@ void white_background(struct screen* display){ | |||
53 | display->clear_display(); | 53 | display->clear_display(); |
54 | } | 54 | } |
55 | 55 | ||
56 | bool skin_require_black_background(int mode, int skin){ | 56 | static bool skin_require_black_background(int mode, int skin){ |
57 | return((mode==BINARY && skin==2) || (mode==DIGITAL && skin==1 )); | 57 | return((mode==BINARY && skin==2) || (mode==DIGITAL && skin==1 )); |
58 | } | 58 | } |
59 | 59 | ||
60 | void skin_set_background(struct screen* display, int mode, int skin){ | 60 | static void skin_set_background(struct screen* display, int mode, int skin){ |
61 | if(skin_require_black_background(mode, skin) ) | 61 | if(skin_require_black_background(mode, skin) ) |
62 | black_background(display); | 62 | black_background(display); |
63 | else | 63 | else |
64 | white_background(display); | 64 | white_background(display); |
65 | } | 65 | } |
66 | 66 | ||
67 | void skin_restore_background(struct screen* display, int mode, int skin){ | 67 | static void skin_restore_background(struct screen* display, int mode, int skin){ |
68 | if(skin_require_black_background(mode, skin) ) | 68 | if(skin_require_black_background(mode, skin) ) |
69 | white_background(display); | 69 | white_background(display); |
70 | } | 70 | } |
diff --git a/apps/plugins/clock/clock_draw_analog.c b/apps/plugins/clock/clock_draw_analog.c index b8ec308eed..bda7241d33 100644 --- a/apps/plugins/clock/clock_draw_analog.c +++ b/apps/plugins/clock/clock_draw_analog.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #define SECOND_ANGLE(second) (6 * (second)) | 37 | #define SECOND_ANGLE(second) (6 * (second)) |
38 | 38 | ||
39 | /* Note that the given angle's origin is midday and not 3 o'clock */ | 39 | /* Note that the given angle's origin is midday and not 3 o'clock */ |
40 | void polar_to_cartesian(int a, int r, int* x, int* y) | 40 | static void polar_to_cartesian(int a, int r, int* x, int* y) |
41 | { | 41 | { |
42 | #if CONFIG_LCD == LCD_SSD1815 | 42 | #if CONFIG_LCD == LCD_SSD1815 |
43 | /* Correct non-square pixel aspect of archos recorder LCD */ | 43 | /* Correct non-square pixel aspect of archos recorder LCD */ |
@@ -48,7 +48,7 @@ void polar_to_cartesian(int a, int r, int* x, int* y) | |||
48 | *y = (fp14_sin(a-90) * r) >> 14; | 48 | *y = (fp14_sin(a-90) * r) >> 14; |
49 | } | 49 | } |
50 | 50 | ||
51 | void polar_to_cartesian_screen_centered(struct screen * display, | 51 | static 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); |
@@ -56,7 +56,7 @@ void polar_to_cartesian_screen_centered(struct screen * display, | |||
56 | *y+=display->getheight()/2; | 56 | *y+=display->getheight()/2; |
57 | } | 57 | } |
58 | 58 | ||
59 | void angle_to_square(int square_width, int square_height, | 59 | static void angle_to_square(int square_width, int square_height, |
60 | int a, int* x, int* y) | 60 | int a, int* x, int* y) |
61 | { | 61 | { |
62 | a = (a+360-90)%360; | 62 | a = (a+360-90)%360; |
@@ -82,7 +82,7 @@ void angle_to_square(int square_width, int square_height, | |||
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | void angle_to_square_screen_centered(struct screen * display, | 85 | static void angle_to_square_screen_centered(struct screen * display, |
86 | int square_width, int square_height, | 86 | int square_width, int square_height, |
87 | int a, int* x, int* y) | 87 | int a, int* x, int* y) |
88 | { | 88 | { |
@@ -91,7 +91,7 @@ void angle_to_square_screen_centered(struct screen * display, | |||
91 | *y+=display->getheight()/2; | 91 | *y+=display->getheight()/2; |
92 | } | 92 | } |
93 | 93 | ||
94 | void draw_hand(struct screen* display, int angle, | 94 | static void draw_hand(struct screen* display, int angle, |
95 | int radius, int thickness, bool round) | 95 | int radius, int thickness, bool round) |
96 | { | 96 | { |
97 | int x1, y1; /* the longest */ | 97 | int x1, y1; /* the longest */ |
@@ -115,7 +115,7 @@ void draw_hand(struct screen* display, int angle, | |||
115 | rb->lcd_drawline(x1, y1, x3, y3); | 115 | rb->lcd_drawline(x1, y1, x3, y3); |
116 | } | 116 | } |
117 | 117 | ||
118 | void draw_hands(struct screen* display, int hour, int minute, int second, | 118 | static void draw_hands(struct screen* display, int hour, int minute, int second, |
119 | int thickness, bool round, bool draw_seconds) | 119 | int thickness, bool round, bool draw_seconds) |
120 | { | 120 | { |
121 | if(draw_seconds){ | 121 | if(draw_seconds){ |
@@ -128,7 +128,7 @@ void draw_hands(struct screen* display, int hour, int minute, int second, | |||
128 | ANALOG_HOUR_RADIUS(display, round), thickness+2, round); | 128 | ANALOG_HOUR_RADIUS(display, round), thickness+2, round); |
129 | } | 129 | } |
130 | 130 | ||
131 | void draw_counter(struct screen* display, struct counter* counter) | 131 | static void draw_counter(struct screen* display, struct counter* counter) |
132 | { | 132 | { |
133 | char buffer[10]; | 133 | char buffer[10]; |
134 | int second_str_w, hour_str_w, str_h; | 134 | int second_str_w, hour_str_w, str_h; |
@@ -150,7 +150,7 @@ void draw_counter(struct screen* display, struct counter* counter) | |||
150 | display->getheight()-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 | static void draw_date(struct screen* display, struct time* time, int date_format) |
154 | { | 154 | { |
155 | char buffer[10]; | 155 | char buffer[10]; |
156 | int year_str_w, monthday_str_w, str_h; | 156 | int year_str_w, monthday_str_w, str_h; |
@@ -176,7 +176,7 @@ void draw_date(struct screen* display, struct time* time, int date_format) | |||
176 | display->getheight()-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 | static void draw_border(struct screen* display, int skin) |
180 | { | 180 | { |
181 | /* Draws square dots every 5 minutes */ | 181 | /* Draws square dots every 5 minutes */ |
182 | int i; | 182 | int i; |
@@ -197,7 +197,7 @@ void draw_border(struct screen* display, int skin) | |||
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
200 | void draw_hour(struct screen* display, struct time* time, | 200 | static void draw_hour(struct screen* display, struct time* time, |
201 | bool show_seconds, int skin) | 201 | bool show_seconds, int skin) |
202 | { | 202 | { |
203 | int hour=time->hour; | 203 | int hour=time->hour; |
@@ -220,7 +220,7 @@ void draw_hour(struct screen* display, struct time* time, | |||
220 | 0, skin, show_seconds); | 220 | 0, skin, show_seconds); |
221 | } | 221 | } |
222 | 222 | ||
223 | void draw_center_cover(struct screen* display) | 223 | static void draw_center_cover(struct screen* display) |
224 | { | 224 | { |
225 | display->hline((display->getwidth()/2)-1, | 225 | display->hline((display->getwidth()/2)-1, |
226 | (display->getwidth()/2)+1, (display->getheight()/2)+3); | 226 | (display->getwidth()/2)+1, (display->getheight()/2)+3); |
diff --git a/apps/plugins/clock/clock_draw_binary.c b/apps/plugins/clock/clock_draw_binary.c index 620788dc5e..611ab1b371 100644 --- a/apps/plugins/clock/clock_draw_binary.c +++ b/apps/plugins/clock/clock_draw_binary.c | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | const struct picture* binary_skin[]={binary,digits,segments}; | 26 | const struct picture* binary_skin[]={binary,digits,segments}; |
27 | 27 | ||
28 | void print_binary(char* buffer, int number, int nb_bits){ | 28 | static void print_binary(char* buffer, int number, int nb_bits){ |
29 | int i; | 29 | int i; |
30 | int mask=1; | 30 | int mask=1; |
31 | buffer[nb_bits]='\0'; | 31 | buffer[nb_bits]='\0'; |
diff --git a/apps/plugins/clock/clock_menu.c b/apps/plugins/clock/clock_menu.c index ed0027305b..a597664f49 100644 --- a/apps/plugins/clock/clock_menu.c +++ b/apps/plugins/clock/clock_menu.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "clock.h" | 22 | #include "clock.h" |
23 | #include "clock_bitmaps.h" | 23 | #include "clock_bitmaps.h" |
24 | #include "clock_settings.h" | 24 | #include "clock_settings.h" |
25 | #include "clock_menu.h" | ||
25 | #include "lib/playback_control.h" | 26 | #include "lib/playback_control.h" |
26 | 27 | ||
27 | /* Option structs (possible selections per each option) */ | 28 | /* Option structs (possible selections per each option) */ |
@@ -57,7 +58,7 @@ static const struct opt_items hour_format_text[] = { | |||
57 | * Select a mode, returs true when the mode has been selected | 58 | * Select a mode, returs true when the mode has been selected |
58 | * (we go back to clock display then) | 59 | * (we go back to clock display then) |
59 | **************/ | 60 | **************/ |
60 | bool menu_mode_selector(void){ | 61 | static bool menu_mode_selector(void){ |
61 | MENUITEM_STRINGLIST(menu,"Mode Selector",NULL, "Analog", | 62 | MENUITEM_STRINGLIST(menu,"Mode Selector",NULL, "Analog", |
62 | "Digital", "Binary"); | 63 | "Digital", "Binary"); |
63 | if(rb->do_menu(&menu, &clock_settings.mode, NULL, false) >=0) | 64 | if(rb->do_menu(&menu, &clock_settings.mode, NULL, false) >=0) |
@@ -68,7 +69,7 @@ bool menu_mode_selector(void){ | |||
68 | /********************** | 69 | /********************** |
69 | * Analog settings menu | 70 | * Analog settings menu |
70 | *********************/ | 71 | *********************/ |
71 | void menu_analog_settings(void) | 72 | static void menu_analog_settings(void) |
72 | { | 73 | { |
73 | int selection=0, result=0; | 74 | int selection=0, result=0; |
74 | 75 | ||
@@ -99,7 +100,7 @@ void menu_analog_settings(void) | |||
99 | /*********************** | 100 | /*********************** |
100 | * Digital settings menu | 101 | * Digital settings menu |
101 | **********************/ | 102 | **********************/ |
102 | void menu_digital_settings(void){ | 103 | static void menu_digital_settings(void){ |
103 | int selection=0, result=0; | 104 | int selection=0, result=0; |
104 | 105 | ||
105 | MENUITEM_STRINGLIST(menu,"Digital Mode Settings",NULL,"Show Seconds", | 106 | MENUITEM_STRINGLIST(menu,"Digital Mode Settings",NULL,"Show Seconds", |
@@ -125,7 +126,7 @@ void menu_digital_settings(void){ | |||
125 | /*********************************************************** | 126 | /*********************************************************** |
126 | * Confirm resetting of settings, used in general_settings() | 127 | * Confirm resetting of settings, used in general_settings() |
127 | **********************************************************/ | 128 | **********************************************************/ |
128 | void confirm_reset(void){ | 129 | static void confirm_reset(void){ |
129 | int result=0; | 130 | int result=0; |
130 | 131 | ||
131 | rb->set_option("Reset all settings?", &result, INT, noyes_text, 2, NULL); | 132 | rb->set_option("Reset all settings?", &result, INT, noyes_text, 2, NULL); |
@@ -141,7 +142,7 @@ void confirm_reset(void){ | |||
141 | /************************************ | 142 | /************************************ |
142 | * General settings. Reset, save, etc | 143 | * General settings. Reset, save, etc |
143 | ***********************************/ | 144 | ***********************************/ |
144 | void menu_general_settings(void){ | 145 | static void menu_general_settings(void){ |
145 | int selection=0, result=0; | 146 | int selection=0, result=0; |
146 | 147 | ||
147 | MENUITEM_STRINGLIST(menu,"General Settings",NULL, | 148 | MENUITEM_STRINGLIST(menu,"General Settings",NULL, |
diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c index 6dd1b5ee65..e559e1fe1b 100644 --- a/apps/plugins/clock/clock_settings.c +++ b/apps/plugins/clock/clock_settings.c | |||
@@ -51,7 +51,7 @@ struct clock_settings clock_settings; | |||
51 | * we can know at saving time if changes have been made */ | 51 | * we can know at saving time if changes have been made */ |
52 | struct clock_settings hdd_clock_settings; | 52 | struct clock_settings hdd_clock_settings; |
53 | 53 | ||
54 | bool settings_needs_saving(struct clock_settings* settings){ | 54 | static bool settings_needs_saving(struct clock_settings* settings){ |
55 | return(rb->memcmp(settings, &hdd_clock_settings, sizeof(*settings))); | 55 | return(rb->memcmp(settings, &hdd_clock_settings, sizeof(*settings))); |
56 | } | 56 | } |
57 | 57 | ||
@@ -99,8 +99,8 @@ void clock_settings_skin_previous(struct clock_settings* settings){ | |||
99 | settings->skin[settings->mode]=max_skin[settings->mode]-1; | 99 | settings->skin[settings->mode]=max_skin[settings->mode]-1; |
100 | } | 100 | } |
101 | 101 | ||
102 | enum settings_file_status clock_settings_load(struct clock_settings* settings, | 102 | static enum settings_file_status clock_settings_load( |
103 | char* filename){ | 103 | struct clock_settings* settings,char* filename){ |
104 | int fd = rb->open(filename, O_RDONLY); | 104 | int fd = rb->open(filename, O_RDONLY); |
105 | if(fd >= 0){ /* does file exist? */ | 105 | if(fd >= 0){ /* does file exist? */ |
106 | /* basic consistency check */ | 106 | /* basic consistency check */ |
@@ -117,8 +117,8 @@ enum settings_file_status clock_settings_load(struct clock_settings* settings, | |||
117 | return(ERRLOAD); | 117 | return(ERRLOAD); |
118 | } | 118 | } |
119 | 119 | ||
120 | enum settings_file_status clock_settings_save(struct clock_settings* settings, | 120 | static enum settings_file_status clock_settings_save( |
121 | char* filename){ | 121 | struct clock_settings* settings, char* filename){ |
122 | int fd = rb->creat(filename, 0666); | 122 | int fd = rb->creat(filename, 0666); |
123 | if(fd >= 0){ /* does file exist? */ | 123 | if(fd >= 0){ /* does file exist? */ |
124 | rb->write (fd, settings, sizeof(*settings)); | 124 | rb->write (fd, settings, sizeof(*settings)); |
@@ -128,7 +128,7 @@ enum settings_file_status clock_settings_save(struct clock_settings* settings, | |||
128 | return(ERRSAVE); | 128 | return(ERRSAVE); |
129 | } | 129 | } |
130 | 130 | ||
131 | void draw_logo(struct screen* display){ | 131 | static void draw_logo(struct screen* display){ |
132 | #ifdef HAVE_LCD_COLOR | 132 | #ifdef HAVE_LCD_COLOR |
133 | if(display->is_color){ | 133 | if(display->is_color){ |
134 | display->set_foreground(LCD_BLACK); | 134 | display->set_foreground(LCD_BLACK); |
@@ -141,7 +141,7 @@ void draw_logo(struct screen* display){ | |||
141 | picture_draw(display, logo, 0, 0); | 141 | picture_draw(display, logo, 0, 0); |
142 | } | 142 | } |
143 | 143 | ||
144 | void draw_message(struct screen* display, int msg, int y){ | 144 | static 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->getheight()-message->slide_height, | 147 | display->fillrect(0, display->getheight()-message->slide_height, |