// widgetCheckbox.h -- Checkbox widget API #ifndef WIDGET_CHECKBOX_H #define WIDGET_CHECKBOX_H #include "../core/dvxWidget.h" typedef struct { WidgetT *(*create)(WidgetT *parent, const char *text); bool (*isChecked)(const WidgetT *w); void (*setChecked)(WidgetT *w, bool checked); } CheckboxApiT; static inline const CheckboxApiT *dvxCheckboxApi(void) { static const CheckboxApiT *sApi; if (!sApi) { sApi = (const CheckboxApiT *)wgtGetApi("checkbox"); } return sApi; } #define wgtCheckbox(parent, text) dvxCheckboxApi()->create(parent, text) #define wgtCheckboxIsChecked(w) dvxCheckboxApi()->isChecked(w) #define wgtCheckboxSetChecked(w, checked) dvxCheckboxApi()->setChecked(w, checked) #endif // WIDGET_CHECKBOX_H