|
PatchworkOS
621ae6b
A non-POSIX operating system.
|
#include <libpatchwork/patchwork.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | calculator_t |
Macros | |
| #define | LABEL_ID 1234 |
| #define | LABEL_HEIGHT (42) |
| #define | NUMPAD_COLUMNS 4 |
| #define | NUMPAD_ROWS 4 |
| #define | NUMPAD_PADDING 6 |
| #define | NUMPAD_BUTTON_WIDTH (64) |
| #define | NUMPAD_COLUMN_TO_WINDOW(column) (NUMPAD_PADDING * ((column) + 1) + NUMPAD_BUTTON_WIDTH * (column)) |
| #define | NUMPAD_ROW_TO_WINDOW(row) (LABEL_HEIGHT + NUMPAD_PADDING * ((row) + 2) + NUMPAD_BUTTON_WIDTH * (row)) |
| #define | LABEL_WIDTH (NUMPAD_COLUMN_TO_WINDOW(NUMPAD_COLUMNS) - NUMPAD_PADDING * 2) |
| #define | WINDOW_WIDTH (NUMPAD_COLUMN_TO_WINDOW(NUMPAD_COLUMNS)) |
| #define | WINDOW_HEIGHT (NUMPAD_ROW_TO_WINDOW(NUMPAD_ROWS)) |
Functions | |
| 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) |
| static uint64_t | procedure (window_t *win, element_t *elem, const event_t *event) |
| int | main (void) |
| #define NUMPAD_COLUMN_TO_WINDOW | ( | column | ) | (NUMPAD_PADDING * ((column) + 1) + NUMPAD_BUTTON_WIDTH * (column)) |
| #define NUMPAD_ROW_TO_WINDOW | ( | row | ) | (LABEL_HEIGHT + NUMPAD_PADDING * ((row) + 2) + NUMPAD_BUTTON_WIDTH * (row)) |
| #define LABEL_WIDTH (NUMPAD_COLUMN_TO_WINDOW(NUMPAD_COLUMNS) - NUMPAD_PADDING * 2) |
| #define WINDOW_WIDTH (NUMPAD_COLUMN_TO_WINDOW(NUMPAD_COLUMNS)) |
| #define WINDOW_HEIGHT (NUMPAD_ROW_TO_WINDOW(NUMPAD_ROWS)) |