12#define START_ENTRY_MAX 16
23#define ENTRY_AMOUNT (sizeof(entries) / sizeof(entries[0]))
25#define START_MENU_HEIGHT(frameSize) (frameSize + 12 * START_BUTTON_HEIGHT)
27#define START_MENU_YPOS_START(screenRect, panelSize, frameSize) (RECT_HEIGHT(screenRect))
28#define START_MENU_YPOS_END(screenRect, panelSize, frameSize) \
29 (RECT_HEIGHT(screenRect) - START_MENU_HEIGHT(frameSize) - panelSize)
42 printf(
"startmenu: failed to allocate start menu private data\n");
115 bool isAnimComplete =
false;
123 isAnimComplete =
true;
125 currentY = (
int64_t)((
double)startY + ((double)endY - startY) * fraction);
133 isAnimComplete =
true;
135 currentY = (
int64_t)((
double)endY + ((double)startY - endY) * fraction);
145 rect.
bottom = currentY + height;
186 printf(
"startmenu: failed to create start menu window\n");
204 printf(
"startmenu: failed to open start menu config\n");
208 bool changed =
false;
212 snprintf(entryKey,
sizeof(entryKey),
"entry%lu", i);
214 if (entryArray ==
NULL || entryArray->
length != 2)
299 rect.
bottom = startY + height;
327 if (startMenu ==
NULL)
#define MAX_PATH
Maximum length of filepaths.
config_array_t * config_get_array(config_t *config, const char *section, const char *key)
Get an array of strings from a configuration file.
config_t * config_open(const char *prefix, const char *name)
Open a configuration file.
void config_close(config_t *config)
Close a configuration file.
void display_push(display_t *disp, surface_id_t target, event_type_t type, void *data, uint64_t size)
Push an event to the display's internal event queue.
uint64_t display_get_screen(display_t *disp, rect_t *rect, uint64_t index)
Get the rectangle of a screen.
void draw_gradient(drawable_t *draw, const rect_t *rect, pixel_t start, pixel_t end, direction_t direction, bool shouldAddNoise)
Draw a gradient filled rectangle.
void draw_rect(drawable_t *draw, const rect_t *rect, pixel_t pixel)
Draw a filled rectangle.
void draw_frame(drawable_t *draw, const rect_t *rect, uint64_t width, pixel_t foreground, pixel_t background)
Draw a skeuomorphic frame.
void element_set_private(element_t *elem, void *private)
Set private data for an element.
theme_t * element_get_theme(element_t *elem)
Get the theme of an element.
void element_draw_end(element_t *elem, drawable_t *draw)
End drawing to an element.
rect_t element_get_content_rect(element_t *elem)
Get the element's rectangle in local coordinates.
void element_draw_begin(element_t *elem, drawable_t *draw)
Begin drawing to an element.
void element_free(element_t *elem)
Deinitialize and free an element and all its children.
void * element_get_private(element_t *elem)
Get private data for an element.
theme_t * theme_global_get(void)
Get the global theme.
uint64_t window_set_visible(window_t *win, bool isVisible)
Set the visibility of the window.
rect_t window_get_rect(window_t *win)
Get the window's rectangle in screen coordinates.
uint64_t window_move(window_t *win, const rect_t *rect)
Move and/or resize the window.
uint64_t window_set_focus(window_t *win)
Set the focus to the window.
surface_id_t window_get_id(window_t *win)
Get the surface ID of the window.
uint64_t window_set_timer(window_t *win, timer_flags_t flags, clock_t timeout)
Set the window timer.
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.
element_t * window_get_client_element(window_t *win)
Get the client element of the 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.
#define ENOMEM
Out of memory.
#define errno
Error number variable.
pid_t spawn(const char **argv, const spawn_fd_t *fds, const char *cwd, spawn_attr_t *attr)
System call for creating child processes.
clock_t uptime(void)
System call for retreving the time since boot.
#define NULL
Pointer error value.
#define ERR
Integer error value.
__UINT64_TYPE__ clock_t
A nanosecond time.
EFI_PHYSICAL_ADDRESS buffer
#define RECT_SHRINK(rect, margin)
#define RECT_INIT_DIM(x, y, width, height)
#define RECT_INIT(left, top, right, bottom)
#define RECT_HEIGHT(rect)
_PUBLIC int printf(const char *_RESTRICT format,...)
_PUBLIC int snprintf(char *_RESTRICT s, size_t n, const char *_RESTRICT format,...)
_PUBLIC int sprintf(char *_RESTRICT s, const char *_RESTRICT format,...)
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
_PUBLIC char * strerror(int errnum)
char * strdup(const char *src)
_PUBLIC int strcmp(const char *s1, const char *s2)
Configuration array structure.
Opaque configuration structure.
Opaque display structure.
Opaque element structure.
pixel_t backgroundSelectedEnd
pixel_t backgroundSelectedStart