// widgetScrollPane.h  -- ScrollPane widget API
#ifndef WIDGET_SCROLLPANE_H
#define WIDGET_SCROLLPANE_H

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

typedef struct {
    WidgetT *(*create)(WidgetT *parent);
    void     (*scrollToChild)(WidgetT *sp, const WidgetT *child);
    void     (*setNoBorder)(WidgetT *w, bool noBorder);
} ScrollPaneApiT;

static inline const ScrollPaneApiT *dvxScrollPaneApi(void) {
    static const ScrollPaneApiT *sApi;
    if (!sApi) { sApi = (const ScrollPaneApiT *)wgtGetApi("scrollpane"); }
    return sApi;
}

#define wgtScrollPane(parent) dvxScrollPaneApi()->create(parent)
#define wgtScrollPaneScrollToChild(sp, child)  dvxScrollPaneApi()->scrollToChild((sp), (child))
#define wgtScrollPaneSetNoBorder(w, noBorder) dvxScrollPaneApi()->setNoBorder((w), (noBorder))

#endif // WIDGET_SCROLLPANE_H
