8#define LABEL_HEIGHT (42)
10#define NUMPAD_COLUMNS 4
12#define NUMPAD_PADDING 6
13#define NUMPAD_BUTTON_WIDTH (64)
15#define NUMPAD_COLUMN_TO_WINDOW(column) (NUMPAD_PADDING * ((column) + 1) + NUMPAD_BUTTON_WIDTH * (column))
16#define NUMPAD_ROW_TO_WINDOW(row) (LABEL_HEIGHT + NUMPAD_PADDING * ((row) + 2) + NUMPAD_BUTTON_WIDTH * (row))
18#define LABEL_WIDTH (NUMPAD_COLUMN_TO_WINDOW(NUMPAD_COLUMNS) - NUMPAD_PADDING * 2)
20#define WINDOW_WIDTH (NUMPAD_COLUMN_TO_WINDOW(NUMPAD_COLUMNS))
21#define WINDOW_HEIGHT (NUMPAD_ROW_TO_WINDOW(NUMPAD_ROWS))
67 for (
uint64_t column = 0; column < 3; column++)
69 for (
uint64_t row = 0; row < 3; row++)
72 char name[2] = {
'0' +
id,
'\0'};
140 calc->
input = calc->
input * 10 +
event->lAction.source;
151 if (calc->
input == 0)
void font_free(font_t *font)
font_t * font_new(display_t *disp, const char *family, const char *weight, uint64_t size)
void display_disconnect(display_t *disp)
Disconnect the display connection.
uint64_t display_next(display_t *disp, event_t *event, clock_t timeout)
Retrieve the next event from the display connection.
uint64_t display_dispatch(display_t *disp, const event_t *event)
Dispatch an event to the appropriate surface.
void display_free(display_t *disp)
Free a display connection.
display_t * display_new(void)
Create a new display connection.
text_props_t * element_get_text_props(element_t *elem)
Get the text properties of an element.
void element_set_private(element_t *elem, void *private)
Set private data for an element.
element_t * element_find(element_t *elem, element_id_t id)
Find a child element by its ID.
uint64_t element_id_t
Element identifier type.
void element_redraw(element_t *elem, bool shouldPropagate)
Redraw an element.
uint64_t element_set_text(element_t *elem, const char *text)
Set the text of an element.
void * element_get_private(element_t *elem)
Get private data for an element.
uint64_t window_set_visible(window_t *win, bool isVisible)
Set the visibility of the window.
window_t * window_new(display_t *disp, const char *name, const rect_t *rect, surface_type_t type, window_flags_t flags, procedure_t procedure, void *private)
Allocate and initialize a new window.
void window_free(window_t *win)
Free a window.
display_t * window_get_display(window_t *win)
Get the display associated with the window.
@ WINDOW_DECO
Enable decorations (titlebar, close/minimize buttons, etc).
#define NULL
Pointer error value.
EFI_PHYSICAL_ADDRESS buffer
#define NUMPAD_COLUMN_TO_WINDOW(column)
static uint64_t numpad_button_create(element_t *elem, font_t *font, uint64_t column, uint64_t row, const char *name, element_id_t id)
#define NUMPAD_ROW_TO_WINDOW(row)
#define NUMPAD_BUTTON_WIDTH
static uint64_t procedure(window_t *win, element_t *elem, const event_t *event)
#define RECT_INIT_DIM(x, y, width, height)
_PUBLIC char * ulltoa(unsigned long long number, char *str, int base)
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
Opaque display structure.
Opaque element structure.
Element text properties structure.