/* skykit.h — OrionOS native UI toolkit * Shared palette, drawing utilities, and app boilerplate used by all OrionOS * shell components (Rigel, Nebula, OrionPkg, installer, etc.). */ #pragma once #include #include #include #include #include #include #include #include #include /* ── Palette ─────────────────────────────────────────────────────── */ #define SK_BG 0x0E1220UL #define SK_SURFACE 0x141828UL #define SK_SIDEBAR 0x090D1AUL #define SK_PANEL 0x111828UL #define SK_BORDER 0x1A2840UL #define SK_SEP 0x162030UL #define SK_ACCENT 0x1E58A8UL #define SK_ACCENT_HOV 0x2A70CCUL #define SK_BTN 0x182848UL #define SK_BTN_HOV 0x1E3860UL #define SK_SEL 0x1A3058UL #define SK_ROW_ALT 0x0C1520UL #define SK_ROW_HOV 0x132030UL #define SK_TEXT 0xC8D4E8UL #define SK_TEXT_HDR 0xE8F4FFUL #define SK_TEXT_DIM 0x5A6880UL #define SK_TEXT_HOV 0xF0F8FFUL #define SK_TEXT_OK 0x44BB77UL #define SK_TEXT_ERR 0xFF5555UL #define SK_TEXT_WARN 0xFFCC44UL /* ── Standard fonts ──────────────────────────────────────────────── */ #define SK_FONT_UI "Sans:size=9" #define SK_FONT_SM "Sans:size=8" #define SK_FONT_HDR "Sans:size=10:weight=bold" #define SK_FONT_MONO "DejaVu Sans Mono:size=8" /* ── App context (one per process) ──────────────────────────────── */ typedef struct { Display *dpy; int screen; Window root; Visual *vis; Colormap cmap; int depth; XftFont *font_ui; XftFont *font_sm; XftFont *font_hdr; XftFont *font_mono; } SKApp; /* ── Painter (per-window drawing context) ────────────────────────── */ typedef struct { SKApp *app; Drawable drw; GC gc; } SKPainter; /* ── Simple button descriptor ────────────────────────────────────── */ typedef struct { int x, y, w, h; const char *label; int id; } SKBtn; /* ── API ─────────────────────────────────────────────────────────── */ void sk_app_init (SKApp *app); void sk_app_free (SKApp *app); unsigned long sk_color (SKApp *app, unsigned long rgb); void sk_xft_color (SKApp *app, unsigned long rgb, XftColor *out); void sk_fill (SKPainter *p, unsigned long rgb, int x, int y, int w, int h); void sk_rect (SKPainter *p, unsigned long rgb, int x, int y, int w, int h); void sk_line (SKPainter *p, unsigned long rgb, int x1, int y1, int x2, int y2); void sk_text (SKPainter *p, XftFont *font, unsigned long rgb, int x, int y, const char *s); void sk_text_clip (SKPainter *p, XftFont *font, unsigned long rgb, int x, int y, const char *s, int cx, int cy, int cw, int ch); int sk_textw (SKApp *app, XftFont *font, const char *s); int sk_baseline (XftFont *font, int y, int h); int sk_in_rect (int mx, int my, int x, int y, int w, int h); void sk_draw_btn (SKPainter *p, SKApp *app, XftFont *font, const SKBtn *b, int hovered, unsigned long bg, unsigned long bghov);