Decided to nuke the stubs.
This commit is contained in:
parent
e1efbb1b8f
commit
d8eeab30eb
|
@ -1,66 +0,0 @@
|
|||
// 10 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct button {
|
||||
uiButton b;
|
||||
OSTYPE OSHANDLE;
|
||||
void (*onClicked)(uiButton *, void *);
|
||||
void *onClickedData;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiButton, uiTypeButton, struct button)
|
||||
|
||||
static uintptr_t buttonHandle(uiControl *c)
|
||||
{
|
||||
struct button *b = (struct button *) c;
|
||||
|
||||
return (uintptr_t) (b->OSHANDLE);
|
||||
}
|
||||
|
||||
static void defaultOnClicked(uiButton *b, void *data)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
static char *buttonText(uiButton *bb)
|
||||
{
|
||||
struct button *b = (struct button *) bb;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void buttonSetText(uiButton *bb, const char *text)
|
||||
{
|
||||
struct button *b = (struct button *) bb;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
// changing the text might necessitate a change in the button's size
|
||||
uiControlQueueResize(uiControl(b));
|
||||
}
|
||||
|
||||
static void buttonOnClicked(uiButton *bb, void (*f)(uiButton *, void *), void *data)
|
||||
{
|
||||
struct button *b = (struct button *) bb;
|
||||
|
||||
b->onClicked = f;
|
||||
b->onClickedData = data;
|
||||
}
|
||||
|
||||
uiButton *uiNewButton(const char *text)
|
||||
{
|
||||
struct button *b;
|
||||
|
||||
b = (struct button *) MAKE_CONTROL_INSTANCE(uiTypeButton());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
b->onClicked = defaultOnClicked;
|
||||
|
||||
uiControl(b)->Handle = buttonHandle;
|
||||
|
||||
uiButton(b)->Text = buttonText;
|
||||
uiButton(b)->SetText = buttonSetText;
|
||||
uiButton(b)->OnClicked = buttonOnClicked;
|
||||
|
||||
return uiButton(b);
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
// 10 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct checkbox {
|
||||
uiCheckbox c;
|
||||
OSTYPE OSHANDLE;
|
||||
void (*onToggled)(uiCheckbox *, void *);
|
||||
void *onToggledData;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiCheckbox, uiTypeCheckbox, struct checkbox)
|
||||
|
||||
static uintptr_t checkboxHandle(uiControl *cc)
|
||||
{
|
||||
struct checkbox *c = (struct checkbox *) cc;
|
||||
|
||||
return (uintptr_t) (c->OSHANDLE);
|
||||
}
|
||||
|
||||
static void defaultOnToggled(uiCheckbox *c, void *data)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
static char *checkboxText(uiCheckbox *cc)
|
||||
{
|
||||
struct checkbox *c = (struct checkbox *) cc;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void checkboxSetText(uiCheckbox *cc, const char *text)
|
||||
{
|
||||
struct checkbox *c = (struct checkbox *) cc;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
// changing the text might necessitate a change in the checkbox's size
|
||||
uiControlQueueResize(uiControl(c));
|
||||
}
|
||||
|
||||
static void checkboxOnToggled(uiCheckbox *cc, void (*f)(uiCheckbox *, void *), void *data)
|
||||
{
|
||||
struct checkbox *c = (struct checkbox *) cc;
|
||||
|
||||
c->onToggled = f;
|
||||
c->onToggledData = data;
|
||||
}
|
||||
|
||||
static int checkboxChecked(uiCheckbox *cc)
|
||||
{
|
||||
struct checkbox *c = (struct checkbox *) cc;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void checkboxSetChecked(uiCheckbox *cc, int checked)
|
||||
{
|
||||
struct checkbox *c = (struct checkbox *) cc;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
uiCheckbox *uiNewCheckbox(const char *text)
|
||||
{
|
||||
struct checkbox *c;
|
||||
|
||||
c = (struct checkbox *) MAKE_CONTROL_INSTANCE(uiTypeCheckbox());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
c->onToggled = defaultOnToggled;
|
||||
|
||||
uiControl(c)->Handle = checkboxHandle;
|
||||
|
||||
uiCheckbox(c)->Text = checkboxText;
|
||||
uiCheckbox(c)->SetText = checkboxSetText;
|
||||
uiCheckbox(c)->OnToggled = checkboxOnToggled;
|
||||
uiCheckbox(c)->Checked = checkboxChecked;
|
||||
uiCheckbox(c)->SetChecked = checkboxSetChecked;
|
||||
|
||||
return uiCheckbox(c);
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct combobox {
|
||||
uiCombobox c;
|
||||
OSTYPE OSHANDLE;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiCombobox, uiTypeCombobox, struct combobox)
|
||||
|
||||
static uintptr_t comboboxHandle(uiControl *cc)
|
||||
{
|
||||
struct combobox *c = (struct combobox *) cc;
|
||||
|
||||
return (uintptr_t) (c->OSHANDLE);
|
||||
}
|
||||
|
||||
static void comboboxAppend(uiCombobox *cc, const char *text)
|
||||
{
|
||||
struct combobox *c = (struct combobox *) cc;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static uiCombobox *finishNewCombobox(OSTHING OSARG)
|
||||
{
|
||||
struct combobox *c;
|
||||
|
||||
c = (struct combobox *) MAKE_CONTROL_INSTANCE(uiTypeCombobox());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
uiControl(c)->Handle = comboboxHandle;
|
||||
|
||||
uiCombobox(c)->Append = comboboxAppend;
|
||||
|
||||
return uiCombobox(c);
|
||||
}
|
||||
|
||||
uiCombobox *uiNewCombobox(void)
|
||||
{
|
||||
return finishNewCombobox(OSARGNONEDITABLE);
|
||||
}
|
||||
|
||||
uiCombobox *uiNewEditableCombobox(void)
|
||||
{
|
||||
return finishNewCombobox(OSARGEDITABLE);
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct datetimepicker {
|
||||
uiDateTimePicker d;
|
||||
OSTYPE OSHANDLE;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiDateTimePicker, uiTypeDateTimePicker, struct datetimepicker)
|
||||
|
||||
static uintptr_t datetimepickerHandle(uiControl *c)
|
||||
{
|
||||
struct datetimepicker *d = (struct datetimepicker *) c;
|
||||
|
||||
return (uintptr_t) (d->OSHANDLE);
|
||||
}
|
||||
|
||||
uiDateTimePicker *finishNewDateTimePicker(OSTHING OSARG)
|
||||
{
|
||||
struct datetimepicker *d;
|
||||
|
||||
d = (struct datetimepicker *) MAKE_CONTROL_INSTANCE(uiTypeDateTimePicker());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
uiControl(d)->Handle = datetimepickerHandle;
|
||||
|
||||
return uiDateTimePicker(d);
|
||||
}
|
||||
|
||||
uiDateTimePicker *uiNewDateTimePicker(void)
|
||||
{
|
||||
return finishNewDateTimePicker(OSARGDATETIME);
|
||||
}
|
||||
|
||||
uiDateTimePicker *uiNewDatePicker(void)
|
||||
{
|
||||
return finishNewDateTimePicker(OSARGDATEONLY);
|
||||
}
|
||||
|
||||
uiDateTimePicker *uiNewTimePicker(void)
|
||||
{
|
||||
return finishNewDateTimePicker(OSARGTIMEONLY);
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct entry {
|
||||
uiEntry e;
|
||||
OSTYPE OSHANDLE;
|
||||
void (*onChanged)(uiEntry *, void *);
|
||||
void *onChangedData;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiEntry, uiTypeEntry, struct entry)
|
||||
|
||||
static uintptr_t entryHandle(uiControl *c)
|
||||
{
|
||||
struct entry *e = (struct entry *) c;
|
||||
|
||||
return (uintptr_t) (e->OSHANDLE);
|
||||
}
|
||||
|
||||
static void defaultOnChanged(uiEntry *e, void *data)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
static char *entryText(uiEntry *ee)
|
||||
{
|
||||
struct entry *e = (struct entry *) ee;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void entrySetText(uiEntry *ee, const char *text)
|
||||
{
|
||||
struct entry *e = (struct entry *) ee;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
// don't queue the control for resize; entry sizes are independent of their contents
|
||||
}
|
||||
|
||||
static void entryOnChanged(uiEntry *ee, void (*f)(uiEntry *, void *), void *data)
|
||||
{
|
||||
struct entry *e = (struct entry *) ee;
|
||||
|
||||
e->onChanged = f;
|
||||
e->onChangedData = data;
|
||||
}
|
||||
|
||||
static int entryReadOnly(uiEntry *ee)
|
||||
{
|
||||
struct entry *e = (struct entry *) ee;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void entrySetReadOnly(uiEntry *ee, int readonly)
|
||||
{
|
||||
struct entry *e = (struct entry *) ee;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
uiEntry *uiNewEntry(void)
|
||||
{
|
||||
struct entry *e;
|
||||
|
||||
e = (struct entry *) MAKE_CONTROL_INSTANCE(uiTypeEntry());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
e->onChanged = defaultOnChanged;
|
||||
|
||||
uiControl(e)->Handle = entryHandle;
|
||||
|
||||
uiEntry(e)->Text = entryText;
|
||||
uiEntry(e)->SetText = entrySetText;
|
||||
uiEntry(e)->OnChanged = entryOnChanged;
|
||||
uiEntry(e)->ReadOnly = entryReadOnly;
|
||||
uiEntry(e)->SetReadOnly = entrySetReadOnly;
|
||||
|
||||
return uiEntry(e);
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct group {
|
||||
uiGroup g;
|
||||
OSTYPE OSHANDLE;
|
||||
uiControl *child;
|
||||
int margined;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiGroup, uiTypeGroup, struct group)
|
||||
|
||||
static uintptr_t groupHandle(uiControl *c)
|
||||
{
|
||||
struct group *g = (struct group *) c;
|
||||
|
||||
return (uintptr_t) (g->OSHANDLE);
|
||||
}
|
||||
|
||||
static void groupContainerUpdateState(uiControl *c)
|
||||
{
|
||||
struct group *g = (struct group *) c;
|
||||
|
||||
if (g->child != NULL)
|
||||
uiControlUpdateState(g->child);
|
||||
}
|
||||
|
||||
static char *groupTitle(uiGroup *gg)
|
||||
{
|
||||
struct group *g = (struct group *) gg;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void groupSetTitle(uiGroup *gg, const char *text)
|
||||
{
|
||||
struct group *g = (struct group *) gg;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
// changing the text might necessitate a change in the groupbox's size
|
||||
uiControlQueueResize(uiControl(g));
|
||||
}
|
||||
|
||||
static void groupSetChild(uiGroup *gg, uiControl *child)
|
||||
{
|
||||
struct group *g = (struct group *) gg;
|
||||
|
||||
if (g->child != NULL)
|
||||
uiControlSetParent(g->child, NULL);
|
||||
g->child = child;
|
||||
if (g->child != NULL) {
|
||||
uiControlSetParent(g->child, uiControl(g));
|
||||
uiControlQueueResize(g->child);
|
||||
}
|
||||
}
|
||||
|
||||
static int groupMargined(uiGroup *gg)
|
||||
{
|
||||
struct group *g = (struct group *) gg;
|
||||
|
||||
return g->margined;
|
||||
}
|
||||
|
||||
static void groupSetMargined(uiGroup *gg, int margined)
|
||||
{
|
||||
struct group *g = (struct group *) gg;
|
||||
|
||||
g->margined = margined;
|
||||
uiControlQueueResize(uiControl(g));
|
||||
}
|
||||
|
||||
uiGroup *uiNewGroup(const char *text)
|
||||
{
|
||||
struct group *g;
|
||||
|
||||
g = (struct group *) MAKE_CONTROL_INSTANCE(uiTypeGroup());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
uiControl(g)->Handle = groupHandle;
|
||||
uiControl(g)->ContainerUpdateState = groupContainerUpdateState;
|
||||
|
||||
uiGroup(g)->Title = groupTitle;
|
||||
uiGroup(g)->SetTitle = groupSetTitle;
|
||||
uiGroup(g)->SetChild = groupSetChild;
|
||||
uiGroup(g)->Margined = groupMargined;
|
||||
uiGroup(g)->SetMargined = groupSetMargined;
|
||||
|
||||
return uiGroup(g);
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct label {
|
||||
uiLabel l;
|
||||
OSTYPE OSHANDLE;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiLabel, uiTypeLabel, struct label)
|
||||
|
||||
static uintptr_t labelHandle(uiControl *c)
|
||||
{
|
||||
struct label *l = (struct label *) c;
|
||||
|
||||
return (uintptr_t) (l->OSHANDLE);
|
||||
}
|
||||
|
||||
static char *labelText(uiLabel *ll)
|
||||
{
|
||||
struct label *l = (struct label *) ll;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void labelSetText(uiLabel *ll, const char *text)
|
||||
{
|
||||
struct label *l = (struct label *) ll;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
// changing the text might necessitate a change in the label's size
|
||||
uiControlQueueResize(uiControl(l));
|
||||
}
|
||||
|
||||
uiLabel *uiNewLabel(const char *text)
|
||||
{
|
||||
struct label *l;
|
||||
|
||||
l = (struct label *) MAKE_CONTROL_INSTANCE(uiTypeLabel());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
uiControl(l)->Handle = labelHandle;
|
||||
|
||||
uiLabel(l)->Text = labelText;
|
||||
uiLabel(l)->SetText = labelSetText;
|
||||
|
||||
return uiLabel(l);
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct progressbar {
|
||||
uiProgressBar p;
|
||||
OSTYPE OSHANDLE;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiProgressBar, uiTypeProgressBar, struct progressbar)
|
||||
|
||||
static uintptr_t progressbarHandle(uiControl *c)
|
||||
{
|
||||
struct progressbar *p = (struct progressbar *) c;
|
||||
|
||||
return (uintptr_t) (p->OSHANDLE);
|
||||
}
|
||||
|
||||
static void progressbarSetValue(uiProgressBar *pp, int value)
|
||||
{
|
||||
struct progressbar *p = (struct progressbar *) pp;
|
||||
|
||||
if (value < 0 || value > 100)
|
||||
complain("value %d out of range in progressbarSetValue()", value);
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
uiProgressBar *uiNewProgressBar(void)
|
||||
{
|
||||
struct progressbar *p;
|
||||
|
||||
p = (struct progressbar *) MAKE_CONTROL_INSTANCE(uiTypeProgressBar());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
uiControl(p)->Handle = progressbarHandle;
|
||||
|
||||
uiProgressBar(p)->SetValue = progressbarSetValue;
|
||||
|
||||
return uiProgressBar(p);
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct radiobuttons {
|
||||
uiRadioButtons r;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiRadioButtons, uiTypeRadioButtons, struct radiobuttons)
|
||||
|
||||
static uintptr_t radiobuttonsHandle(uiControl *c)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void radiobuttonsAppend(uiRadioButtons *rr, const char *text)
|
||||
{
|
||||
struct radiobuttons *r = (struct radiobuttons *) rr;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
uiControlQueueResize(uiControl(r));
|
||||
}
|
||||
|
||||
uiRadioButtons *uiNewRadioButtons(void)
|
||||
{
|
||||
struct radiobuttons *r;
|
||||
|
||||
r = (struct radiobuttons *) MAKE_CONTROL_INSTANCE(uiTypeRadioButtons());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
uiControl(r)->Handle = radiobuttonsHandle;
|
||||
|
||||
uiRadioButtons(r)->Append = radiobuttonsAppend;
|
||||
|
||||
return uiRadioButtons(r);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct separator {
|
||||
uiSeparator s;
|
||||
OSTYPE OSHANDLE;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiSeparator, uiTypeSeparator, struct separator)
|
||||
|
||||
static uintptr_t separatorHandle(uiControl *c)
|
||||
{
|
||||
struct separator *s = (struct separator *) c;
|
||||
|
||||
return (uintptr_t) (s->OSHANDLE);
|
||||
}
|
||||
|
||||
uiSeparator *uiNewHorizontalSeparator(void)
|
||||
{
|
||||
struct separator *s;
|
||||
|
||||
s = (struct separator *) MAKE_CONTROL_INSTANCE(uiTypeSeparator());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
uiControl(s)->Handle = separatorHandle;
|
||||
|
||||
return uiSeparator(s);
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct slider {
|
||||
uiSlider s;
|
||||
OSTYPE OSHANDLE;
|
||||
void (*onChanged)(uiSlider *, void *);
|
||||
void *onChangedData;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiSlider, uiTypeSlider, struct slider)
|
||||
|
||||
static uintptr_t sliderHandle(uiControl *c)
|
||||
{
|
||||
struct slider *s = (struct slider *) c;
|
||||
|
||||
return (uintptr_t) (s->OSHANDLE);
|
||||
}
|
||||
|
||||
static void defaultOnChanged(uiSlider *s, void *data)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
static intmax_t sliderValue(uiSlider *ss)
|
||||
{
|
||||
struct slider *s = (struct slider *) ss;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void sliderSetValue(uiSlider *ss, intmax_t value)
|
||||
{
|
||||
struct slider *s = (struct slider *) ss;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void sliderOnChanged(uiSlider *ss, void (*f)(uiSlider *, void *), void *data)
|
||||
{
|
||||
struct slider *s = (struct slider *) ss;
|
||||
|
||||
s->onChanged = f;
|
||||
s->onChangedData = data;
|
||||
}
|
||||
|
||||
uiSlider *uiNewSlider(intmax_t min, intmax_t max)
|
||||
{
|
||||
struct slider *s;
|
||||
|
||||
s = (struct slider *) MAKE_CONTROL_INSTANCE(uiTypeSlider());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
s->onChanged = defaultOnChanged;
|
||||
|
||||
uiControl(s)->Handle = sliderHandle;
|
||||
|
||||
uiSlider(s)->Value = sliderValue;
|
||||
uiSlider(s)->SetValue = sliderSetValue;
|
||||
uiSlider(s)->OnChanged = sliderOnChanged;
|
||||
|
||||
return uiSlider(s);
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct spinbox {
|
||||
uiSpinbox s;
|
||||
OSTYPE OSHANDLE;
|
||||
void (*onChanged)(uiSpinbox *, void *);
|
||||
void *onChangedData;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiSpinbox, uiTypeSpinbox, struct spinbox)
|
||||
|
||||
static uintptr_t spinboxHandle(uiControl *c)
|
||||
{
|
||||
struct spinbox *s = (struct spinbox *) c;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void defaultOnChanged(uiSpinbox *s, void *data)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
static intmax_t spinboxValue(uiSpinbox *ss)
|
||||
{
|
||||
struct spinbox *s = (struct spinbox *) ss;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void spinboxSetValue(uiSpinbox *ss, intmax_t value)
|
||||
{
|
||||
struct spinbox *s = (struct spinbox *) ss;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void spinboxOnChanged(uiSpinbox *ss, void (*f)(uiSpinbox *, void *), void *data)
|
||||
{
|
||||
struct spinbox *s = (struct spinbox *) ss;
|
||||
|
||||
s->onChanged = f;
|
||||
s->onChangedData = data;
|
||||
}
|
||||
|
||||
uiSpinbox *uiNewSpinbox(intmax_t min, intmax_t max)
|
||||
{
|
||||
struct spinbox *s;
|
||||
|
||||
if (min >= max)
|
||||
complain("error: min >= max in uiNewSpinbox()");
|
||||
|
||||
s = (struct spinbox *) MAKE_CONTROL_INSTANCE(uiTypeSpinbox());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
s->onChanged = defaultOnChanged;
|
||||
|
||||
uiControl(s)->Handle = spinboxHandle;
|
||||
|
||||
uiSpinbox(s)->Value = spinboxValue;
|
||||
uiSpinbox(s)->SetValue = spinboxSetValue;
|
||||
uiSpinbox(s)->OnChanged = spinboxOnChanged;
|
||||
|
||||
return uiSpinbox(s);
|
||||
}
|
78
stubs/tab.c
78
stubs/tab.c
|
@ -1,78 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct tab {
|
||||
uiTab t;
|
||||
OSTYPE OSHANDLE;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiTab, uiTypeTab, struct tab)
|
||||
|
||||
static uintptr_t tabHandle(uiControl *c)
|
||||
{
|
||||
struct tab *t = (struct tab *) c;
|
||||
|
||||
return (uintptr_t) (t->OSHANDLE);
|
||||
}
|
||||
|
||||
static void tabAppend(uiTab *tt, const char *name, uiControl *child)
|
||||
{
|
||||
struct tab *t = (struct tab *) tt;
|
||||
|
||||
uiTabInsertAt(tt, name, PUT_CODE_HERE, child);
|
||||
}
|
||||
|
||||
static void tabInsertAt(uiTab *tt, const char *name, uintmax_t n, uiControl *child)
|
||||
{
|
||||
struct tab *t = (struct tab *) tt;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void tabDelete(uiTab *tt, uintmax_t n)
|
||||
{
|
||||
struct tab *t = (struct tab *) tt;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static uintmax_t tabNumPages(uiTab *tt)
|
||||
{
|
||||
struct tab *t = (struct tab *) tt;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static int tabMargined(uiTab *tt, uintmax_t n)
|
||||
{
|
||||
struct tab *t = (struct tab *) tt;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void tabSetMargined(uiTab *tt, uintmax_t n, int margined)
|
||||
{
|
||||
struct tab *t = (struct tab *) tt;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
uiTab *uiNewTab(void)
|
||||
{
|
||||
struct tab *t;
|
||||
|
||||
t = (struct tab *) MAKE_CONTROL_INSTANCE(uiTypeTab());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
uiControl(t)->Handle = tabHandle;
|
||||
|
||||
uiTab(t)->Append = tabAppend;
|
||||
uiTab(t)->InsertAt = tabInsertAt;
|
||||
uiTab(t)->Delete = tabDelete;
|
||||
uiTab(t)->NumPages = tabNumPages;
|
||||
uiTab(t)->Margined = tabMargined;
|
||||
uiTab(t)->SetMargined = tabSetMargined;
|
||||
|
||||
return uiTab(t);
|
||||
}
|
112
stubs/window.c
112
stubs/window.c
|
@ -1,112 +0,0 @@
|
|||
// 11 june 2015
|
||||
#include "uipriv_OSHERE.h"
|
||||
|
||||
struct window {
|
||||
uiWindow w;
|
||||
OSTYPE OSHANDLE;
|
||||
uiControl *child;
|
||||
int (*onClosing)(uiWindow *, void *);
|
||||
void *onClosingData;
|
||||
int margined;
|
||||
};
|
||||
|
||||
uiDefineControlType(uiWindow, uiTypeWindow, struct window)
|
||||
|
||||
static uintptr_t windowHandle(uiControl *c)
|
||||
{
|
||||
struct window *w = (struct window *) c;
|
||||
|
||||
return (uintptr_t) (w->OSHANDLE);
|
||||
}
|
||||
|
||||
static void windowContainerUpdateState(uiControl *c)
|
||||
{
|
||||
struct window *w = (struct window *) c;
|
||||
|
||||
if (w->child != NULL)
|
||||
uiControlUpdateState(w->child);
|
||||
}
|
||||
|
||||
static char *windowTitle(uiWindow *ww)
|
||||
{
|
||||
struct window *w = (struct window *) ww;
|
||||
|
||||
return PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
static void windowSetTitle(uiWindow *ww, const char *title)
|
||||
{
|
||||
struct window *w = (struct window *) ww;
|
||||
|
||||
PUT_CODE_HERE;
|
||||
// don't queue resize; the caption isn't part of what affects layout and sizing of the client area (it'll be ellipsized if too long)
|
||||
}
|
||||
|
||||
static void windowOnClosing(uiWindow *ww, int (*f)(uiWindow *, void *), void *data)
|
||||
{
|
||||
struct window *w = (struct window *) ww;
|
||||
|
||||
w->onClosing = f;
|
||||
w->onClosingData = data;
|
||||
}
|
||||
|
||||
static void windowSetChild(uiWindow *ww, uiControl *child)
|
||||
{
|
||||
struct window *w = (struct window *) ww;
|
||||
|
||||
if (w->child != NULL)
|
||||
uiControlSetParent(w->child, NULL);
|
||||
w->child = child;
|
||||
if (w->child != NULL) {
|
||||
uiControlSetParent(w->child, uiControl(w));
|
||||
uiControlQueueResize(w->child);
|
||||
}
|
||||
}
|
||||
|
||||
static int windowMargined(uiWindow *ww)
|
||||
{
|
||||
struct window *w = (struct window *) ww;
|
||||
|
||||
return w->margined;
|
||||
}
|
||||
|
||||
static void windowSetMargined(uiWindow *ww, int margined)
|
||||
{
|
||||
struct window *w = (struct window *) ww;
|
||||
|
||||
w->margined = margined;
|
||||
uiControlQueueResize(uiControl(w));
|
||||
}
|
||||
|
||||
static void windowResizeChild(uiWindow *ww)
|
||||
{
|
||||
struct window *w = (struct window *) ww;
|
||||
|
||||
if (w->child == NULL)
|
||||
return;
|
||||
PUT_CODE_HERE;
|
||||
}
|
||||
|
||||
uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
||||
{
|
||||
struct window *w;
|
||||
|
||||
w = (struct window *) MAKE_CONTROL_INSTANCE(uiTypeWindow());
|
||||
|
||||
PUT_CODE_HERE;
|
||||
|
||||
w->onClosing = defaultOnClosing;
|
||||
|
||||
uiControl(w)->Handle = windowHandle;
|
||||
uiControl(w)->ContainerUpdateState = windowContainerUpdateState;
|
||||
|
||||
uiWindow(w)->Title = windowTitle;
|
||||
uiWindow(w)->SetTitle = windowSetTitle;
|
||||
uiWindow(w)->OnClosing = windowOnClosing;
|
||||
uiWindow(w)->SetChild = windowSetChild;
|
||||
uiWindow(w)->Margined = windowMargined;
|
||||
uiWindow(w)->SetMargined = windowSetMargined;
|
||||
uiWindow(w)->ResizeChild = windowResizeChild;
|
||||
|
||||
return uiWindow(w);
|
||||
}
|
Loading…
Reference in New Issue