// splitter.h  -- Splitter widget API
#ifndef SPLITTER_H
#define SPLITTER_H

#include "../../../libs/kpunch/libdvx/dvxWgt.h"

typedef struct {
    WidgetT *(*create)(WidgetT *parent, bool vertical);
    void     (*setPos)(WidgetT *w, int32_t pos);
    int32_t  (*getPos)(const WidgetT *w);
} SplitterApiT;

static inline const SplitterApiT *dvxSplitterApi(void) {
    static const SplitterApiT *sApi;
    if (!sApi) { sApi = (const SplitterApiT *)wgtGetApi("splitter"); }
    return sApi;
}

#define wgtSplitter(parent, vertical) dvxSplitterApi()->create(parent, vertical)
#define wgtSplitterSetPos(w, pos)     dvxSplitterApi()->setPos(w, pos)
#define wgtSplitterGetPos(w)          dvxSplitterApi()->getPos(w)

#endif // SPLITTER_H
