// widgetProgressBar.h  -- ProgressBar widget API
#ifndef WIDGET_PROGRESSBAR_H
#define WIDGET_PROGRESSBAR_H

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

typedef struct {
    WidgetT *(*create)(WidgetT *parent);
    WidgetT *(*createV)(WidgetT *parent);
    void     (*setValue)(WidgetT *w, int32_t value);
    int32_t  (*getValue)(const WidgetT *w);
} ProgressBarApiT;

static inline const ProgressBarApiT *dvxProgressBarApi(void) {
    static const ProgressBarApiT *sApi;
    if (!sApi) { sApi = (const ProgressBarApiT *)wgtGetApi("progressbar"); }
    return sApi;
}

#define wgtProgressBar(parent)          dvxProgressBarApi()->create(parent)
#define wgtProgressBarV(parent)         dvxProgressBarApi()->createV(parent)
#define wgtProgressBarSetValue(w, value) dvxProgressBarApi()->setValue(w, value)
#define wgtProgressBarGetValue(w)       dvxProgressBarApi()->getValue(w)

#endif // WIDGET_PROGRESSBAR_H
