This application will display an analog and digital clock on the screen. More...
|
Data Structures | |
| struct | app_clock |
| Context for the clock application. More... | |
Enumerations | |
| enum | app_clock_button_ids { BUTTON_EXIT_ID = 1 } |
Event command ID for the application widgets. More... | |
Functions | |
| static void | app_clock_frame_draw_handler (struct win_window *win, const struct win_clip_region *clip) |
| Frame draw handler handling draw events. | |
| static bool | app_clock_frame_command_handler (struct wtk_basic_frame *frame, win_command_t command_data) |
| Frame command handler handling the button events. | |
| void | app_clock_launch (struct workqueue_task *task) |
| Launcher for the clock application. | |
Variables | |
| static struct app_clock * | the_clock_app |
| Pointer to the clock application context. | |
Clock color scheme. | |
|
| |
| #define | COLOR_TEXT GFX_COLOR(255, 255, 255) |
| Color on text strings. | |
| #define | COLOR_BACKGROUND GFX_COLOR(0, 0, 0) |
| Background color. | |
| #define | COLOR_BORDER GFX_COLOR(150, 150, 150) |
| Color on frame border. | |
Clock frame size and layout. | |
|
| |
| #define | FRAME_PADDING 40 |
| Padding in pixels from screen border to frame. | |
| #define | FRAME_HEIGHT (gfx_get_height() - (2 * FRAME_PADDING)) |
| Height of frame. | |
| #define | FRAME_WIDTH (gfx_get_width() - (2 * FRAME_PADDING)) |
| Width of frame. | |
| #define | FRAME_POS_X FRAME_PADDING |
| X position of top left corner. | |
| #define | FRAME_POS_Y FRAME_PADDING |
| Y position of top left corner. | |
Clock text appearance. | |
|
| |
| #define | TEXT_INDENT 15 |
| Number of pixels to indent a string. | |
| #define | TEXT_PADDING_NEWLINE 4 |
| Number of pixels to pad after a string newline. | |
This application will display an analog and digital clock on the screen.
To adjust the clock, touch the screen continuously for three seconds to enter adjustment mode.
| #define COLOR_BACKGROUND GFX_COLOR(0, 0, 0) |
| #define COLOR_BORDER GFX_COLOR(150, 150, 150) |
Color on frame border.
Definition at line 66 of file app_clock.c.
Referenced by app_clock_frame_draw_handler().
| #define COLOR_TEXT GFX_COLOR(255, 255, 255) |
Color on text strings.
Definition at line 62 of file app_clock.c.
Referenced by app_clock_frame_draw_handler(), draw_font_box(), screen_draw_file_list_from_index(), screen_draw_file_system_info(), screen_draw_fonts_info(), screen_draw_introduction(), screen_draw_language_info(), screen_draw_messages(), and screen_draw_splash().
| #define FRAME_HEIGHT (gfx_get_height() - (2 * FRAME_PADDING)) |
Height of frame.
Definition at line 79 of file app_clock.c.
Referenced by app_clock_frame_draw_handler().
| #define FRAME_PADDING 40 |
Padding in pixels from screen border to frame.
Definition at line 77 of file app_clock.c.
| #define FRAME_POS_X FRAME_PADDING |
X position of top left corner.
Definition at line 83 of file app_clock.c.
Referenced by app_clock_frame_draw_handler().
| #define FRAME_POS_Y FRAME_PADDING |
Y position of top left corner.
Definition at line 85 of file app_clock.c.
Referenced by app_clock_frame_draw_handler().
| #define FRAME_WIDTH (gfx_get_width() - (2 * FRAME_PADDING)) |
Width of frame.
Definition at line 81 of file app_clock.c.
Referenced by app_clock_frame_draw_handler().
| #define TEXT_INDENT 15 |
Number of pixels to indent a string.
Definition at line 96 of file app_clock.c.
Referenced by app_clock_frame_draw_handler(), draw_font_box(), screen_draw_file_list_from_index(), screen_draw_file_system_info(), screen_draw_fonts_info(), screen_draw_introduction(), and screen_draw_language_info().
| #define TEXT_PADDING_NEWLINE 4 |
Number of pixels to pad after a string newline.
Definition at line 98 of file app_clock.c.
Referenced by app_clock_frame_draw_handler(), draw_font_box(), screen_draw_file_system_info(), screen_draw_fonts_info(), screen_draw_fonts_list(), screen_draw_introduction(), and screen_draw_language_info().
| enum app_clock_button_ids |
Event command ID for the application widgets.
Definition at line 105 of file app_clock.c.
| static bool app_clock_frame_command_handler | ( | struct wtk_basic_frame * | frame, | |
| win_command_t | command_data | |||
| ) | [static] |
Frame command handler handling the button events.
| frame | Pointer to the basic frame object | |
| command_data | Command data provided with the event, holds button ID |
Definition at line 185 of file app_clock.c.
References app_desktop_restart(), BUTTON_EXIT_ID, membag_free(), memcpy(), app_clock::prev_sysfont, and sysfont.
| static void app_clock_frame_draw_handler | ( | struct win_window * | win, | |
| const struct win_clip_region * | clip | |||
| ) | [static] |
Frame draw handler handling draw events.
This function will draw the contents of the frame to the screen.
Definition at line 138 of file app_clock.c.
References COLOR_BORDER, COLOR_TEXT, FRAME_HEIGHT, FRAME_POS_X, FRAME_POS_Y, FRAME_WIDTH, GFX_COLOR_TRANSPARENT, gfx_draw_rect, gfx_draw_string(), gfx_font_get_height(), sysfont, TEXT_INDENT, and TEXT_PADDING_NEWLINE.
| void app_clock_launch | ( | struct workqueue_task * | task | ) |
Launcher for the clock application.
| task | Workqueue task to use for the application's worker functions. |
struct app_clock* the_clock_app [static] |
Pointer to the clock application context.
Definition at line 129 of file app_clock.c.
1.6.3