Removed the typefn stuff from ui_*.h*.
This commit is contained in:
parent
2870f3239d
commit
46391367fe
16
ui_darwin.h
16
ui_darwin.h
|
@ -16,20 +16,12 @@ struct uiDarwinControl {
|
||||||
uiControl c;
|
uiControl c;
|
||||||
void (*Relayout)(uiDarwinControl *);
|
void (*Relayout)(uiDarwinControl *);
|
||||||
};
|
};
|
||||||
_UI_EXTERN uintmax_t uiDarwinControlType(void);
|
#define uiDarwinControl(this) ((uiDarwinControl *) (this))
|
||||||
#define uiDarwinControl(this) ((uiDarwinControl *) uiIsA((this), uiDarwinControlType(), 1))
|
|
||||||
// TODO document
|
// TODO document
|
||||||
_UI_EXTERN void uiDarwinControlTriggerRelayout(uiDarwinControl *);
|
_UI_EXTERN void uiDarwinControlTriggerRelayout(uiDarwinControl *);
|
||||||
|
|
||||||
// TODO document
|
// TODO document
|
||||||
#define uiDarwinDefineControlWithOnDestroy(type, typefn, handlefield, onDestroy) \
|
#define uiDarwinDefineControlWithOnDestroy(type, handlefield, onDestroy) \
|
||||||
static uintmax_t _ ## type ## Type = 0; \
|
|
||||||
uintmax_t typefn(void) \
|
|
||||||
{ \
|
|
||||||
if (_ ## type ## Type == 0) \
|
|
||||||
_ ## type ## Type = uiRegisterType(#type, uiDarwinControlType(), sizeof (type)); \
|
|
||||||
return _ ## type ## Type; \
|
|
||||||
} \
|
|
||||||
static void _ ## type ## CommitDestroy(uiControl *c) \
|
static void _ ## type ## CommitDestroy(uiControl *c) \
|
||||||
{ \
|
{ \
|
||||||
type *this = type(c); \
|
type *this = type(c); \
|
||||||
|
@ -49,8 +41,8 @@ _UI_EXTERN void uiDarwinControlTriggerRelayout(uiDarwinControl *);
|
||||||
/* do nothing */ \
|
/* do nothing */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define uiDarwinDefineControl(type, typefn, handlefield) \
|
#define uiDarwinDefineControl(type, handlefield) \
|
||||||
uiDarwinDefineControlWithOnDestroy(type, typefn, handlefield, (void) this;)
|
uiDarwinDefineControlWithOnDestroy(type, handlefield, (void) this;)
|
||||||
|
|
||||||
#define uiDarwinFinishNewControl(variable, type) \
|
#define uiDarwinFinishNewControl(variable, type) \
|
||||||
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
||||||
|
|
16
ui_haiku.hpp
16
ui_haiku.hpp
|
@ -17,18 +17,10 @@ typedef struct uiHaikuControl uiHaikuControl;
|
||||||
struct uiHaikuControl {
|
struct uiHaikuControl {
|
||||||
uiControl c;
|
uiControl c;
|
||||||
};
|
};
|
||||||
_UI_EXTERN uintmax_t uiHaikuControlType(void);
|
#define uiHaikuControl(this) ((uiHaikuControl *) (this))
|
||||||
#define uiHaikuControl(this) ((uiHaikuControl *) uiIsA((this), uiHaikuControlType(), 1))
|
|
||||||
|
|
||||||
// TODO document
|
// TODO document
|
||||||
#define uiHaikuDefineControlWithOnDestroy(type, typefn, handlefield, onDestroy) \
|
#define uiHaikuDefineControlWithOnDestroy(type, handlefield, onDestroy) \
|
||||||
static uintmax_t _ ## type ## Type = 0; \
|
|
||||||
uintmax_t typefn(void) \
|
|
||||||
{ \
|
|
||||||
if (_ ## type ## Type == 0) \
|
|
||||||
_ ## type ## Type = uiRegisterType(#type, uiHaikuControlType(), sizeof (type)); \
|
|
||||||
return _ ## type ## Type; \
|
|
||||||
} \
|
|
||||||
static void _ ## type ## CommitDestroy(uiControl *c) \
|
static void _ ## type ## CommitDestroy(uiControl *c) \
|
||||||
{ \
|
{ \
|
||||||
type *hthis = type(c); \
|
type *hthis = type(c); \
|
||||||
|
@ -44,8 +36,8 @@ _UI_EXTERN uintmax_t uiHaikuControlType(void);
|
||||||
/* do nothing */ \
|
/* do nothing */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define uiHaikuDefineControl(type, typefn, handlefield) \
|
#define uiHaikuDefineControl(type, handlefield) \
|
||||||
uiHaikuDefineControlWithOnDestroy(type, typefn, handlefield, (void) hthis;)
|
uiHaikuDefineControlWithOnDestroy(type, handlefield, (void) hthis;)
|
||||||
|
|
||||||
#define uiHaikuFinishNewControl(variable, type) \
|
#define uiHaikuFinishNewControl(variable, type) \
|
||||||
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
||||||
|
|
16
ui_unix.h
16
ui_unix.h
|
@ -15,18 +15,10 @@ typedef struct uiUnixControl uiUnixControl;
|
||||||
struct uiUnixControl {
|
struct uiUnixControl {
|
||||||
uiControl c;
|
uiControl c;
|
||||||
};
|
};
|
||||||
_UI_EXTERN uintmax_t uiUnixControlType(void);
|
#define uiUnixControl(this) ((uiUnixControl *) (this))
|
||||||
#define uiUnixControl(this) ((uiUnixControl *) uiIsA((this), uiUnixControlType(), 1))
|
|
||||||
|
|
||||||
// TODO document
|
// TODO document
|
||||||
#define uiUnixDefineControlWithOnDestroy(type, typefn, onDestroy) \
|
#define uiUnixDefineControlWithOnDestroy(type, onDestroy) \
|
||||||
static uintmax_t _ ## type ## Type = 0; \
|
|
||||||
uintmax_t typefn(void) \
|
|
||||||
{ \
|
|
||||||
if (_ ## type ## Type == 0) \
|
|
||||||
_ ## type ## Type = uiRegisterType(#type, uiUnixControlType(), sizeof (type)); \
|
|
||||||
return _ ## type ## Type; \
|
|
||||||
} \
|
|
||||||
static void _ ## type ## CommitDestroy(uiControl *c) \
|
static void _ ## type ## CommitDestroy(uiControl *c) \
|
||||||
{ \
|
{ \
|
||||||
type *this = type(c); \
|
type *this = type(c); \
|
||||||
|
@ -42,8 +34,8 @@ _UI_EXTERN uintmax_t uiUnixControlType(void);
|
||||||
/* do nothing */ \
|
/* do nothing */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define uiUnixDefineControl(type, typefn) \
|
#define uiUnixDefineControl(type) \
|
||||||
uiUnixDefineControlWithOnDestroy(type, typefn, (void) this;)
|
uiUnixDefineControlWithOnDestroy(type, (void) this;)
|
||||||
|
|
||||||
#define uiUnixFinishNewControl(variable, type) \
|
#define uiUnixFinishNewControl(variable, type) \
|
||||||
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
||||||
|
|
16
ui_windows.h
16
ui_windows.h
|
@ -22,20 +22,12 @@ struct uiWindowsControl {
|
||||||
void (*AssignControlIDZOrder)(uiWindowsControl *, LONG_PTR *, HWND *);
|
void (*AssignControlIDZOrder)(uiWindowsControl *, LONG_PTR *, HWND *);
|
||||||
void (*ArrangeChildrenControlIDsZOrder)(uiWindowsControl *);
|
void (*ArrangeChildrenControlIDsZOrder)(uiWindowsControl *);
|
||||||
};
|
};
|
||||||
_UI_EXTERN uintmax_t uiWindowsControlType(void);
|
#define uiWindowsControl(this) ((uiWindowsControl *) (this))
|
||||||
#define uiWindowsControl(this) ((uiWindowsControl *) uiIsA((this), uiWindowsControlType(), 1))
|
|
||||||
// TODO document
|
// TODO document
|
||||||
_UI_EXTERN void uiWindowsControlQueueRelayout(uiWindowsControl *);
|
_UI_EXTERN void uiWindowsControlQueueRelayout(uiWindowsControl *);
|
||||||
|
|
||||||
// TODO document
|
// TODO document
|
||||||
#define uiWindowsDefineControlWithOnDestroy(type, typefn, onDestroy) \
|
#define uiWindowsDefineControlWithOnDestroy(type, onDestroy) \
|
||||||
static uintmax_t _ ## type ## Type = 0; \
|
|
||||||
uintmax_t typefn(void) \
|
|
||||||
{ \
|
|
||||||
if (_ ## type ## Type == 0) \
|
|
||||||
_ ## type ## Type = uiRegisterType(#type, uiWindowsControlType(), sizeof (type)); \
|
|
||||||
return _ ## type ## Type; \
|
|
||||||
} \
|
|
||||||
static void _ ## type ## CommitDestroy(uiControl *c) \
|
static void _ ## type ## CommitDestroy(uiControl *c) \
|
||||||
{ \
|
{ \
|
||||||
type *me = type(c); \
|
type *me = type(c); \
|
||||||
|
@ -70,8 +62,8 @@ _UI_EXTERN void uiWindowsControlQueueRelayout(uiWindowsControl *);
|
||||||
/* do nothing */ \
|
/* do nothing */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define uiWindowsDefineControl(type, typefn) \
|
#define uiWindowsDefineControl(type) \
|
||||||
uiWindowsDefineControlWithOnDestroy(type, typefn, (void) me;)
|
uiWindowsDefineControlWithOnDestroy(type, (void) me;)
|
||||||
|
|
||||||
#define uiWindowsFinishNewControl(variable, type) \
|
#define uiWindowsFinishNewControl(variable, type) \
|
||||||
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
uiControl(variable)->CommitDestroy = _ ## type ## CommitDestroy; \
|
||||||
|
|
Loading…
Reference in New Issue