// widgetBox.h  -- Box container widget API (VBox, HBox, Frame)
#ifndef WIDGET_BOX_H
#define WIDGET_BOX_H

#include "../core/dvxWidget.h"

typedef struct {
    WidgetT *(*vBox)(WidgetT *parent);
    WidgetT *(*hBox)(WidgetT *parent);
    WidgetT *(*frame)(WidgetT *parent, const char *title);
} BoxApiT;

static inline const BoxApiT *dvxBoxApi(void) {
    static const BoxApiT *sApi;
    if (!sApi) { sApi = (const BoxApiT *)wgtGetApi("box"); }
    return sApi;
}

#define wgtVBox(parent)         dvxBoxApi()->vBox(parent)
#define wgtHBox(parent)         dvxBoxApi()->hBox(parent)
#define wgtFrame(parent, title) dvxBoxApi()->frame(parent, title)

#endif // WIDGET_BOX_H
