This commit is contained in:
Bill Quith 2021-01-02 10:22:03 -05:00 committed by GitHub
commit 49f5df0470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 14 deletions

View File

@ -27,7 +27,7 @@ int uiControlToplevel(uiControl *c)
return (*(c->Toplevel))(c);
}
int uiControlVisible(uiControl *c)
int uiControlVisible(const uiControl *c)
{
return (*(c->Visible))(c);
}
@ -42,7 +42,7 @@ void uiControlHide(uiControl *c)
(*(c->Hide))(c);
}
int uiControlEnabled(uiControl *c)
int uiControlEnabled(const uiControl *c)
{
return (*(c->Enabled))(c);
}

View File

@ -165,7 +165,7 @@ static int uiWindowToplevel(uiControl *c)
return 1;
}
static int uiWindowVisible(uiControl *c)
static int uiWindowVisible(const uiControl *c)
{
uiWindow *w = uiWindow(c);

8
ui.h
View File

@ -85,10 +85,10 @@ struct uiControl {
uiControl *(*Parent)(uiControl *);
void (*SetParent)(uiControl *, uiControl *);
int (*Toplevel)(uiControl *);
int (*Visible)(uiControl *);
int (*Visible)(const uiControl *);
void (*Show)(uiControl *);
void (*Hide)(uiControl *);
int (*Enabled)(uiControl *);
int (*Enabled)(const uiControl *);
void (*Enable)(uiControl *);
void (*Disable)(uiControl *);
};
@ -99,10 +99,10 @@ _UI_EXTERN uintptr_t uiControlHandle(uiControl *);
_UI_EXTERN uiControl *uiControlParent(uiControl *);
_UI_EXTERN void uiControlSetParent(uiControl *, uiControl *);
_UI_EXTERN int uiControlToplevel(uiControl *);
_UI_EXTERN int uiControlVisible(uiControl *);
_UI_EXTERN int uiControlVisible(const uiControl *);
_UI_EXTERN void uiControlShow(uiControl *);
_UI_EXTERN void uiControlHide(uiControl *);
_UI_EXTERN int uiControlEnabled(uiControl *);
_UI_EXTERN int uiControlEnabled(const uiControl *);
_UI_EXTERN void uiControlEnable(uiControl *);
_UI_EXTERN void uiControlDisable(uiControl *);

View File

@ -65,7 +65,7 @@ _UI_EXTERN void uiDarwinControlChildVisibilityChanged(uiDarwinControl *);
return 0; \
}
#define uiDarwinControlDefaultVisible(type, handlefield) \
static int type ## Visible(uiControl *c) \
static int type ## Visible(const uiControl *c) \
{ \
return uiDarwinControl(c)->visible; \
}
@ -84,7 +84,7 @@ _UI_EXTERN void uiDarwinControlChildVisibilityChanged(uiDarwinControl *);
uiDarwinNotifyVisibilityChanged(uiDarwinControl(c)); \
}
#define uiDarwinControlDefaultEnabled(type, handlefield) \
static int type ## Enabled(uiControl *c) \
static int type ## Enabled(const uiControl *c) \
{ \
return uiDarwinControl(c)->enabled; \
}

View File

@ -52,7 +52,7 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
return 0; \
}
#define uiUnixControlDefaultVisible(type) \
static int type ## Visible(uiControl *c) \
static int type ## Visible(const uiControl *c) \
{ \
return gtk_widget_get_visible(type(c)->widget); \
}
@ -69,7 +69,7 @@ _UI_EXTERN void uiUnixControlSetContainer(uiUnixControl *, GtkContainer *, gbool
gtk_widget_hide(type(c)->widget); \
}
#define uiUnixControlDefaultEnabled(type) \
static int type ## Enabled(uiControl *c) \
static int type ## Enabled(const uiControl *c) \
{ \
return gtk_widget_get_sensitive(type(c)->widget); \
}

View File

@ -67,7 +67,7 @@ _UI_EXTERN void uiWindowsControlChildVisibilityChanged(uiWindowsControl *);
return 0; \
}
#define uiWindowsControlDefaultVisible(type) \
static int type ## Visible(uiControl *c) \
static int type ## Visible(const uiControl *c) \
{ \
return uiWindowsControl(c)->visible; \
}
@ -86,7 +86,7 @@ _UI_EXTERN void uiWindowsControlChildVisibilityChanged(uiWindowsControl *);
uiWindowsControlNotifyVisibilityChanged(uiWindowsControl(c)); \
}
#define uiWindowsControlDefaultEnabled(type) \
static int type ## Enabled(uiControl *c) \
static int type ## Enabled(const uiControl *c) \
{ \
return uiWindowsControl(c)->enabled; \
}

View File

@ -194,7 +194,7 @@ static int uiWindowToplevel(uiControl *c)
}
// TODO initial state of windows is hidden; ensure this here and make it so on other platforms
static int uiWindowVisible(uiControl *c)
static int uiWindowVisible(const uiControl *c)
{
uiWindow *w = uiWindow(c);