Began working on reworking the resizing code AGAIN.
This commit is contained in:
parent
ad2c432c4a
commit
f5f38d1fa5
|
@ -56,7 +56,6 @@ interface Control {
|
||||||
func Resize(x intmax_t, y intmax_t, width intmax_t, height intmax_t, d *Sizing);
|
func Resize(x intmax_t, y intmax_t, width intmax_t, height intmax_t, d *Sizing);
|
||||||
func QueueResize(void);
|
func QueueResize(void);
|
||||||
func GetSizing(d *Sizing);
|
func GetSizing(d *Sizing);
|
||||||
func ComputeChildSize(x *intmax_t, y *intmax_t, width *intmax_t, height *intmax_t, d *Sizing);
|
|
||||||
func ContainerVisible(void) int;
|
func ContainerVisible(void) int;
|
||||||
func Show(void);
|
func Show(void);
|
||||||
func Hide(void);
|
func Hide(void);
|
||||||
|
|
152
redo/ui.idl.TODO
152
redo/ui.idl.TODO
|
@ -1,152 +0,0 @@
|
||||||
// 6 april 2015
|
|
||||||
|
|
||||||
// This is not an IDL file for the conventional RPC or Microsoft IDLs.
|
|
||||||
// Instead, this is for a custom IDL of my own creation.
|
|
||||||
// You can find it at github.com/andlabs/pgidl
|
|
||||||
|
|
||||||
package ui {
|
|
||||||
|
|
||||||
raw "#include <stddef.h>";
|
|
||||||
raw "#include <stdint.h>";
|
|
||||||
|
|
||||||
raw "#ifndef _UI_EXTERN";
|
|
||||||
raw "#define _UI_EXTERN extern";
|
|
||||||
raw "#endif";
|
|
||||||
|
|
||||||
struct InitOptions {
|
|
||||||
field Size size_t;
|
|
||||||
};
|
|
||||||
|
|
||||||
func Init(options *InitOptions) *const char;
|
|
||||||
func Uninit(void);
|
|
||||||
func FreeInitError(err *const char);
|
|
||||||
|
|
||||||
func Main(void);
|
|
||||||
func Quit(void);
|
|
||||||
|
|
||||||
func OnShouldQuit(f *func(data *void) int, data *void);
|
|
||||||
|
|
||||||
func FreeText(text *char);
|
|
||||||
|
|
||||||
raw "typedef struct uiSizingSys uiSizingSys;";
|
|
||||||
|
|
||||||
struct Sizing {
|
|
||||||
field XPadding intmax_t;
|
|
||||||
field YPadding intmax_t;
|
|
||||||
field Sys *uiSizingSys;
|
|
||||||
};
|
|
||||||
|
|
||||||
raw "typedef struct uiControlSysFuncParams uiControlSysFuncParams;";
|
|
||||||
raw "#define uiControlSysFuncNop 0";
|
|
||||||
|
|
||||||
interface Control {
|
|
||||||
field Internal *void; // for use by ui only
|
|
||||||
func Destroy(void);
|
|
||||||
func Handle(void) uintptr_t;
|
|
||||||
func Parent(void) *Control;
|
|
||||||
func SetParent(c *Control);
|
|
||||||
func PreferredSize(d *Sizing, width *intmax_t, height *intmax_t);
|
|
||||||
func Resize(x intmax_t, y intmax_t, width intmax_t, height intmax_t, d *Sizing);
|
|
||||||
func QueueResize(void);
|
|
||||||
func GetSizing(d *Sizing);
|
|
||||||
func ContainerVisible(void) int;
|
|
||||||
func Show(void);
|
|
||||||
func Hide(void);
|
|
||||||
func ContainerShow(void);
|
|
||||||
func ContainerHide(void);
|
|
||||||
func Enable(void);
|
|
||||||
func Disable(void);
|
|
||||||
func ContainerEnable(void);
|
|
||||||
func ContainerDisable(void);
|
|
||||||
func SysFunc(p *uiControlSysFuncParams);
|
|
||||||
func StartZOrder(p *uiControlSysFuncParams) int;
|
|
||||||
};
|
|
||||||
|
|
||||||
func MakeContainer(c *Control);
|
|
||||||
|
|
||||||
interface Window from Control {
|
|
||||||
func Title(void) *char;
|
|
||||||
func SetTitle(title *const char);
|
|
||||||
func OnClosing(f *func(w *Window, data *void) int, data *void);
|
|
||||||
func SetChild(c *Control);
|
|
||||||
func Margined(void) int;
|
|
||||||
func SetMargined(margined int);
|
|
||||||
};
|
|
||||||
func NewWindow(title *const char, width int, height int, hasMenubar int) *Window;
|
|
||||||
|
|
||||||
interface Button from Control {
|
|
||||||
func Text(void) *char;
|
|
||||||
func SetText(text *const char);
|
|
||||||
func OnClicked(f *func(b *Button, data *void), data *void);
|
|
||||||
};
|
|
||||||
func NewButton(text *const char) *Button;
|
|
||||||
|
|
||||||
interface Box from Control {
|
|
||||||
func Append(c *Control, stretchy int);
|
|
||||||
func Delete(index uintmax_t);
|
|
||||||
func Padded(void) int;
|
|
||||||
func SetPadded(padded int);
|
|
||||||
};
|
|
||||||
func NewHorizontalBox(void) *Box;
|
|
||||||
func NewVerticalBox(void) *Box;
|
|
||||||
|
|
||||||
interface Entry from Control {
|
|
||||||
func Text(void) *char;
|
|
||||||
func SetText(text *const char);
|
|
||||||
func OnChanged(f *func(e *Entry, data *void), data *void);
|
|
||||||
func ReadOnly(void) int;
|
|
||||||
func SetReadOnly(readonly int);
|
|
||||||
};
|
|
||||||
func NewEntry(void) *Entry;
|
|
||||||
|
|
||||||
interface Checkbox from Control {
|
|
||||||
func Text(void) *char;
|
|
||||||
func SetText(text *const char);
|
|
||||||
func OnToggled(f *func(c *Checkbox, data *void), data *void);
|
|
||||||
func Checked(void) int;
|
|
||||||
func SetChecked(checked int);
|
|
||||||
};
|
|
||||||
func NewCheckbox(text *const char) *Checkbox;
|
|
||||||
|
|
||||||
interface Label from Control {
|
|
||||||
func Text(void) *char;
|
|
||||||
func SetText(text *const char);
|
|
||||||
};
|
|
||||||
func NewLabel(text *const char) *Label;
|
|
||||||
|
|
||||||
interface Tab from Control {
|
|
||||||
func AppendPage(name *const char, c *Control);
|
|
||||||
func InsertPageBefore(name *const char, before uintmax_t, c *Control);
|
|
||||||
func DeletePage(index uintmax_t);
|
|
||||||
func NumPages(void) uintmax_t;
|
|
||||||
func Margined(page uintmax_t) int;
|
|
||||||
func SetMargined(page uintmax_t, margined int);
|
|
||||||
};
|
|
||||||
func NewTab(void) *Tab;
|
|
||||||
|
|
||||||
interface Group from Control {
|
|
||||||
// TODO text and settext
|
|
||||||
func SetChild(c *Control);
|
|
||||||
// TODO margined and setmargined
|
|
||||||
};
|
|
||||||
func NewGroup(text *const char) *Group;
|
|
||||||
|
|
||||||
interface Menu {
|
|
||||||
func AppendItem(name *const char) *MenuItem;
|
|
||||||
func AppendCheckItem(name *const char) *MenuItem;
|
|
||||||
func AppendQuitItem(void) *MenuItem;
|
|
||||||
func AppendPreferencesItem(void) *MenuItem;
|
|
||||||
func AppendAboutItem(void) *MenuItem;
|
|
||||||
func AppendSeparator(void);
|
|
||||||
};
|
|
||||||
func NewMenu(name *const char) *Menu;
|
|
||||||
|
|
||||||
interface MenuItem {
|
|
||||||
func Enable(void);
|
|
||||||
func Disable(void);
|
|
||||||
func OnClicked(f *func(sender *MenuItem, window *Window, data *void), data *void);
|
|
||||||
func Checked(void) int;
|
|
||||||
func SetChecked(checked int);
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
|
@ -72,11 +72,6 @@ static void singleGetSizing(uiControl *c, uiSizing *d)
|
||||||
uiWindowsGetSizing(c, d);
|
uiWindowsGetSizing(c, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void singleComputeChildSize(uiControl *c, intmax_t *x, intmax_t *y, intmax_t *width, intmax_t *height, uiSizing *d)
|
|
||||||
{
|
|
||||||
complain("attempt to call uiControlComputeChildSize() on a non-container");
|
|
||||||
}
|
|
||||||
|
|
||||||
static int singleContainerVisible(uiControl *c)
|
static int singleContainerVisible(uiControl *c)
|
||||||
{
|
{
|
||||||
struct singleHWND *s = (struct singleHWND *) (c->Internal);
|
struct singleHWND *s = (struct singleHWND *) (c->Internal);
|
||||||
|
@ -242,7 +237,6 @@ void uiWindowsMakeControl(uiControl *c, uiWindowsMakeControlParams *p)
|
||||||
uiControl(c)->Resize = singleResize;
|
uiControl(c)->Resize = singleResize;
|
||||||
uiControl(c)->QueueResize = singleQueueResize;
|
uiControl(c)->QueueResize = singleQueueResize;
|
||||||
uiControl(c)->GetSizing = singleGetSizing;
|
uiControl(c)->GetSizing = singleGetSizing;
|
||||||
uiControl(c)->ComputeChildSize = singleComputeChildSize;
|
|
||||||
uiControl(c)->ContainerVisible = singleContainerVisible;
|
uiControl(c)->ContainerVisible = singleContainerVisible;
|
||||||
uiControl(c)->Show = singleShow;
|
uiControl(c)->Show = singleShow;
|
||||||
uiControl(c)->Hide = singleHide;
|
uiControl(c)->Hide = singleHide;
|
||||||
|
|
Loading…
Reference in New Issue