diff --git a/common/control.c b/common/control.c index 98cb94aa..8259bdae 100644 --- a/common/control.c +++ b/common/control.c @@ -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); } diff --git a/darwin/window.m b/darwin/window.m index 1a048207..acc49fbd 100644 --- a/darwin/window.m +++ b/darwin/window.m @@ -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); diff --git a/ui.h b/ui.h index 40aea949..a9852456 100644 --- a/ui.h +++ b/ui.h @@ -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 *); diff --git a/ui_darwin.h b/ui_darwin.h index c9c6ad54..56fd1d59 100644 --- a/ui_darwin.h +++ b/ui_darwin.h @@ -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; \ } diff --git a/ui_unix.h b/ui_unix.h index ed019260..d9056c3a 100644 --- a/ui_unix.h +++ b/ui_unix.h @@ -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); \ } diff --git a/ui_windows.h b/ui_windows.h index 69dda366..e21e32ed 100644 --- a/ui_windows.h +++ b/ui_windows.h @@ -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; \ } diff --git a/windows/window.cpp b/windows/window.cpp index 2ea5b7ce..ac8389d3 100644 --- a/windows/window.cpp +++ b/windows/window.cpp @@ -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);