Stubbed the other controls (and implemented uiLabel) on Haiku.

This commit is contained in:
Pietro Gagliardi 2015-11-19 08:47:53 -05:00
parent 4f1bd2474d
commit 2e24d2ce5a
14 changed files with 592 additions and 0 deletions

View File

@ -4,8 +4,21 @@ CXXFILES += \
haiku/alloc.cpp \
haiku/area.cpp \
haiku/box.cpp \
haiku/button.cpp \
haiku/checkbox.cpp \
haiku/combobox.cpp \
haiku/control.cpp \
haiku/datetimepicker.cpp \
haiku/entry.cpp \
haiku/group.cpp \
haiku/label.cpp \
haiku/main.cpp \
haiku/progressbar.cpp \
haiku/radiobuttons.cpp \
haiku/separator.cpp \
haiku/slider.cpp \
haiku/spinbox.cpp \
haiku/tab.cpp \
haiku/text.cpp \
haiku/util.cpp \
haiku/window.cpp

43
haiku/button.cpp Normal file
View File

@ -0,0 +1,43 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiButton {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiButton, // type name
uiButtonType, // type function
dummy // handle
)
char *uiButtonText(uiButton *b)
{
// TODO
return NULL;
}
void uiButtonSetText(uiButton *b, const char *text)
{
// TODO
}
void uiButtonOnClicked(uiButton *b, void (*f)(uiButton *b, void *data), void *data)
{
// TODO
}
uiButton *uiNewButton(const char *text)
{
uiButton *b;
b = (uiButton *) uiNewControl(uiButtonType());
b->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiButton not implemented");
uiHaikuFinishNewControl(b, uiButton);
return b;
}

54
haiku/checkbox.cpp Normal file
View File

@ -0,0 +1,54 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiCheckbox {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiCheckbox, // type name
uiCheckboxType, // type function
dummy // handle
)
char *uiCheckboxText(uiCheckbox *c)
{
// TODO
return NULL;
}
void uiCheckboxSetText(uiCheckbox *c, const char *text)
{
// TODO
}
void uiCheckboxOnToggled(uiCheckbox *c, void (*f)(uiCheckbox *c, void *data), void *data)
{
// TODO
}
int uiCheckboxChecked(uiCheckbox *c)
{
// TODO
return 0;
}
void uiCheckboxSetChecked(uiCheckbox *c, int checked)
{
// TODO
}
uiCheckbox *uiNewCheckbox(const char *text)
{
uiCheckbox *c;
c = (uiCheckbox *) uiNewControl(uiCheckboxType());
c->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiCheckbox not implemented");
uiHaikuFinishNewControl(c, uiCheckbox);
return c;
}

58
haiku/combobox.cpp Normal file
View File

@ -0,0 +1,58 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiCombobox {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiCombobox, // type name
uiComboboxType, // type function
dummy // handle
)
void uiComboboxAppend(uiCombobox *c, const char *text)
{
// TODO
}
intmax_t uiComboboxSelected(uiCombobox *c)
{
// TODO
return -1;
}
void uiComboboxSetSelected(uiCombobox *c, intmax_t n)
{
// TODO
}
void uiComboboxOnSelected(uiCombobox *c, void (*f)(uiCombobox *c, void *data), void *data)
{
// TODO
}
static uiCombobox *finishNewCombobox(void)
{
uiCombobox *c;
c = (uiCombobox *) uiNewControl(uiComboboxType());
c->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiCombobox not implemented");
uiHaikuFinishNewControl(c, uiCombobox);
return c;
}
uiCombobox *uiNewCombobox(void)
{
return finishNewCombobox();
}
uiCombobox *uiNewEditableCombobox(void)
{
return finishNewCombobox();
}

42
haiku/datetimepicker.cpp Normal file
View File

@ -0,0 +1,42 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiDateTimePicker {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiDateTimePicker, // type name
uiDateTimePickerType, // type function
dummy // handle
)
static uiDateTimePicker *finishNewDateTimePicker(void)
{
uiDateTimePicker *d;
d = (uiDateTimePicker *) uiNewControl(uiDateTimePickerType());
d->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiDateTimePicker not implemented");
uiHaikuFinishNewControl(d, uiDateTimePicker);
return d;
}
uiDateTimePicker *uiNewDateTimePicker(void)
{
return finishNewDateTimePicker();
}
uiDateTimePicker *uiNewDatePicker(void)
{
return finishNewDateTimePicker();
}
uiDateTimePicker *uiNewTimePicker(void)
{
return finishNewDateTimePicker();
}

54
haiku/entry.cpp Normal file
View File

@ -0,0 +1,54 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiEntry {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiEntry, // type name
uiEntryType, // type function
dummy // handle
)
char *uiEntryText(uiEntry *e)
{
// TODO
return NULL;
}
void uiEntrySetText(uiEntry *e, const char *text)
{
// TODO
}
void uiEntryOnChanged(uiEntry *e, void (*f)(uiEntry *e, void *data), void *data)
{
// TODO
}
int uiEntryReadOnly(uiEntry *e)
{
// TODO
return 0;
}
void uiEntrySetReadOnly(uiEntry *e, int readonly)
{
// TODO
}
uiEntry *uiNewEntry(void)
{
uiEntry *e;
e = (uiEntry *) uiNewControl(uiEntryType());
e->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiEntry not implemented");
uiHaikuFinishNewControl(e, uiEntry);
return e;
}

54
haiku/group.cpp Normal file
View File

@ -0,0 +1,54 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiGroup {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiGroup, // type name
uiGroupType, // type function
dummy // handle
)
char *uiGroupTitle(uiGroup *g)
{
// TODO
return NULL;
}
void uiGroupSetTitle(uiGroup *g, const char *title)
{
// TODO
}
void uiGroupSetChild(uiGroup *g, uiControl *c)
{
// TODO
}
int uiGroupMargined(uiGroup *g)
{
// TODO
return 0;
}
void uiGroupSetMargined(uiGroup *g, int margined)
{
// TODO
}
uiGroup *uiNewGroup(const char *title)
{
uiGroup *g;
g = (uiGroup *) uiNewControl(uiGroupType());
g->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiGroup not implemented");
uiHaikuFinishNewControl(g, uiGroup);
return g;
}

38
haiku/label.cpp Normal file
View File

@ -0,0 +1,38 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
// TODO forcibly aligned to the bottom of the allocation
struct uiLabel {
uiHaikuControl c;
BStringView *label;
};
uiHaikuDefineControl(
uiLabel, // type name
uiLabelType, // type function
label // handle
)
char *uiLabelText(uiLabel *l)
{
return uiHaikuStrdupText(l->label->Text());
}
void uiLabelSetText(uiLabel *l, const char *text)
{
l->label->SetText(text);
}
uiLabel *uiNewLabel(const char *text)
{
uiLabel *l;
l = (uiLabel *) uiNewControl(uiLabelType());
l->label = new BStringView(BRect(0, 0, 1, 1), NULL, text);
uiHaikuFinishNewControl(l, uiLabel);
return l;
}

32
haiku/progressbar.cpp Normal file
View File

@ -0,0 +1,32 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiProgressBar {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiProgressBar, // type name
uiProgressBarType, // type function
dummy // handle
)
void uiProgressBarSetValue(uiProgressBar *p, int n)
{
// TODO
}
uiProgressBar *uiNewProgressBar(void)
{
uiProgressBar *p;
p = (uiProgressBar *) uiNewControl(uiProgressBarType());
p->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiProgressBar not implemented");
uiHaikuFinishNewControl(p, uiProgressBar);
return p;
}

32
haiku/radiobuttons.cpp Normal file
View File

@ -0,0 +1,32 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiRadioButtons {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiRadioButtons, // type name
uiRadioButtonsType, // type function
dummy // handle
)
void uiRadioButtonsAppend(uiRadioButtons *r, const char *text)
{
// TODO
}
uiRadioButtons *uiNewRadioButtons(void)
{
uiRadioButtons *r;
r = (uiRadioButtons *) uiNewControl(uiRadioButtonsType());
r->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiRadioButtons not implemented");
uiHaikuFinishNewControl(r, uiRadioButtons);
return r;
}

27
haiku/separator.cpp Normal file
View File

@ -0,0 +1,27 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiSeparator {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiSeparator, // type name
uiSeparatorType, // type function
dummy // handle
)
uiSeparator *uiNewHorizontalSeparator(void)
{
uiSeparator *s;
s = (uiSeparator *) uiNewControl(uiSeparatorType());
s->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiSeparator not implemented");
uiHaikuFinishNewControl(s, uiSeparator);
return s;
}

43
haiku/slider.cpp Normal file
View File

@ -0,0 +1,43 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiSlider {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiSlider, // type name
uiSliderType, // type function
dummy // handle
)
intmax_t uiSliderValue(uiSlider *s)
{
// TODO
return 0;
}
void uiSliderSetValue(uiSlider *s, intmax_t value)
{
// TODO
}
void uiSliderOnChanged(uiSlider *s, void (*f)(uiSlider *s, void *data), void *data)
{
// TODO
}
uiSlider *uiNewSlider(intmax_t min, intmax_t max)
{
uiSlider *s;
s = (uiSlider *) uiNewControl(uiSliderType());
s->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiSlider not implemented");
uiHaikuFinishNewControl(s, uiSlider);
return s;
}

43
haiku/spinbox.cpp Normal file
View File

@ -0,0 +1,43 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiSpinbox {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiSpinbox, // type name
uiSpinboxType, // type function
dummy // handle
)
intmax_t uiSpinboxValue(uiSpinbox *s)
{
// TODO
return 0;
}
void uiSpinboxSetValue(uiSpinbox *s, intmax_t value)
{
// TODO
}
void uiSpinboxOnChanged(uiSpinbox *s, void (*f)(uiSpinbox *s, void *data), void *data)
{
// TODO
}
uiSpinbox *uiNewSpinbox(intmax_t min, intmax_t max)
{
uiSpinbox *s;
s = (uiSpinbox *) uiNewControl(uiSpinboxType());
s->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiSpinbox not implemented");
uiHaikuFinishNewControl(s, uiSpinbox);
return s;
}

59
haiku/tab.cpp Normal file
View File

@ -0,0 +1,59 @@
// 18 november 2015
#include "uipriv_haiku.hpp"
struct uiTab {
uiHaikuControl c;
BStringView *dummy;
};
uiHaikuDefineControl(
uiTab, // type name
uiTabType, // type function
dummy // handle
)
void uiTabAppend(uiTab *t, const char *name, uiControl *c)
{
// TODO
}
void uiTabInsertAt(uiTab *t, const char *name, uintmax_t before, uiControl *c)
{
// TODO
}
void uiTabDelete(uiTab *t, uintmax_t index)
{
// TODO
}
uintmax_t uiTabNumPages(uiTab *t)
{
// TODO
return 0;
}
int uiTabMargined(uiTab *t, uintmax_t page)
{
// TODO
return 0;
}
void uiTabSetMargined(uiTab *t, uintmax_t page, int margined)
{
// TODO
}
uiTab *uiNewTab(void)
{
uiTab *t;
t = (uiTab *) uiNewControl(uiTabType());
t->dummy = new BStringView(BRect(0, 0, 1, 1), NULL,
"TODO uiTab not implemented");
uiHaikuFinishNewControl(t, uiTab);
return t;
}