7 #include "LcdDisplay.h"
9 #define NUM_LCD_ROWS 96
10 #define NUM_LCD_COL_BYTES ( 12 )
11 #define MAX_FONT_ROWS ( 19 )
14 gint WriteLcdCharacter(oswald_ui *ui, gint x, gint y, unsigned char Character)
16 gint CharacterHeight = GetCharacterHeight();
17 gint CharacterWidth = GetCharacterWidth(Character);
18 unsigned int bitmap[MAX_FONT_ROWS];
21 GetCharacterBitmap(Character,(unsigned int*)&bitmap);
23 // printf("cw=%d ch=%d\n", CharacterWidth, CharacterHeight);
24 for (ly=0; ly<CharacterHeight; ly++) {
25 for (lx=0; lx<CharacterWidth; lx++) {
26 if (bitmap[ly] & (1<<lx)) {
27 set_pixel(ui, lx+x, ly+y, TRUE);
30 set_pixel(ui, lx+x, ly+y, FALSE);
37 return CharacterWidth + GetFontSpacing();
40 void WriteLcdString(oswald_ui *ui, gint x, gint y, gchar *str)
44 if (str == NULL || strlen(str)==0)
48 for (i=0; i<strlen(str); i++) {
49 lx += WriteLcdCharacter(ui, lx, y, str[i]);
54 void update_idle_time_date(oswald_ui *ui)
58 static gchar secs = 0;
60 SetFont(MetaWatchTime);
62 //gRow += WriteLcdCharacter(ui, gRow, gColumn, TIME_CHARACTER_SPACE_INDEX);
63 gRow += WriteLcdCharacter(ui, gRow, gColumn, 2);
64 gRow += WriteLcdCharacter(ui, gRow, gColumn, 3);
65 gRow += WriteLcdCharacter(ui, gRow, gColumn, TIME_CHARACTER_COLON_INDEX);
66 gRow += WriteLcdCharacter(ui, gRow, gColumn, 1);
67 gRow += WriteLcdCharacter(ui, gRow, gColumn, 7);
68 gRow += WriteLcdCharacter(ui, gRow, gColumn, TIME_CHARACTER_COLON_INDEX);
69 gRow += WriteLcdCharacter(ui, gRow, gColumn, (secs / 10));
70 gRow += WriteLcdCharacter(ui, gRow, gColumn, (secs % 10));