ref: 8f27ffaf6569d4284b370a25377e6dd86edfa563
dir: /uiglue.c/
#include <u.h> #include <libc.h> #include <fcall.h> #include <thread.h> #include <9p.h> #include "common.h" #include "ui.h" #include "fs.h" #include "uiglue.h" static void openTabBox(void *, const char *label) { ui_tgroup(label); } static void openHorizontalBox(void *, const char *label) { ui_hgroup(label); } static void openVerticalBox(void *, const char *label) { ui_vgroup(label); } static void closeBox(void *) { ui_endgroup(); } static void addButton(void *, const char *label, float *zone) { ui_button(label, zone); } static void addCheckButton(void *, const char *label, float *zone) { ui_checkbox(label, zone); } static void addVerticalSlider(void *, const char *label, float *zone, float init, float min, float max, float step) { ui_vslider(label, zone, init, min, max, step); } static void addHorizontalSlider(void *, const char *label, float *zone, float init, float min, float max, float step) { ui_hslider(label, zone, init, min, max, step); } static void addNumEntry(void *, const char *label, float *zone, float init, float min, float max, float step) { ui_nentry(label, zone, init, min, max, step); } static void addVerticalBargraph(void *, const char *label, float *zone, float min, float max) { ui_vbargraph(label, zone, min, max); } static void addHorizontalBargraph(void *, const char *label, float *zone, float min, float max) { ui_hbargraph(label, zone, min, max); } static void declare(void *, float *zone, const char *key, const char *value) { ui_declare(zone, key, value); } UIGlue uiglue = { .openTabBox = openTabBox, .openHorizontalBox = openHorizontalBox, .openVerticalBox = openVerticalBox, .closeBox = closeBox, .addButton = addButton, .addCheckButton = addCheckButton, .addVerticalSlider = addVerticalSlider, .addHorizontalSlider = addHorizontalSlider, .addNumEntry = addNumEntry, .addVerticalBargraph = addVerticalBargraph, .addHorizontalBargraph = addHorizontalBargraph, .declare = declare, };