ui.h (1243B)
1 /* user interface */ 2 #pragma once 3 4 #ifdef _WIN32 5 #define DIR_SEPARATOR '\\' 6 #else 7 #define DIR_SEPARATOR '/' 8 #endif 9 10 #include "luigi.h" 11 12 #define UI_COLOR_FROM_RGBA(r, g, b, a) (((uint32_t) (r) << 16) | ((uint32_t) (g) << 8) | ((uint32_t) (b) << 0) | ((uint32_t) (a) << 24)) 13 14 typedef int (*CallbackFn)(struct UIElement *element, UIMessage message, int di, void *dp); 15 16 UIWindow * MainWindowCreate(const char *wname, int w, int h); 17 18 void PreviewUpdate(Animation *, UIImageDisplay *); 19 void ShowModalWindow(UIWindow *parent, const char *def_dir, const char *def_file, CallbackFn cb); 20 int WinMainEvent(UIElement *element, UIMessage msg, int di, void *dp); 21 int WinModalEvent(UIElement *element, UIMessage msg, int di, void *dp); 22 int SliderEvent(UIElement *element, UIMessage msg, int di, void *dp); 23 int ButtonOpenEvent(UIElement *element, UIMessage msg, int di, void *dp); 24 int ButtonSaveEvent(UIElement *element, UIMessage msg, int di, void *dp); 25 int ButtonCloseEvent(UIElement *element, UIMessage msg, int di, void *dp); 26 int ButtonDialogSaveEvent(UIElement *element, UIMessage msg, int di, void *dp); 27 int ButtonDialogOpenEvent(UIElement *element, UIMessage msg, int di, void *dp); 28 int TableEvent(UIElement *element, UIMessage msg, int di, void *dp);