diff --git a/unix/button.c b/unix/button.c index 2244e6a9..ac6c9b43 100644 --- a/unix/button.c +++ b/unix/button.c @@ -38,20 +38,20 @@ static void setText(uiButton *b, const char *text) gtk_button_set_label(BUTTON(b), text); } -static void setOnClicked(uiButton *b, void (*f)(uiControl *, void *), void *data) +static void setOnClicked(uiButton *bb, void (*f)(uiControl *, void *), void *data) { - struct button *b = (struct button *) b; + struct button *b = (struct button *) bb; b->onClicked = f; b->onClickedData = data; } -uiControl *uiNewButton(const char *text) +uiButton *uiNewButton(const char *text) { struct button *b; GtkWidget *widget; - b = uiNew(b); + b = uiNew(struct button); uiUnixNewControl(uiControl(b), GTK_TYPE_BUTTON, FALSE, FALSE, diff --git a/unix/checkbox.c b/unix/checkbox.c index de494391..5111c0ed 100644 --- a/unix/checkbox.c +++ b/unix/checkbox.c @@ -3,7 +3,7 @@ struct checkbox { uiCheckbox c; - void (*onToggled)(uiControl *, void *); + void (*onToggled)(uiCheckbox *, void *); void *onToggledData; gulong onToggledSignal; }; @@ -12,10 +12,10 @@ static void onToggled(GtkToggleButton *b, gpointer data) { struct checkbox *c = (struct checkbox *) data; - (*(c->onToggled))(uiControl(c), c->onToggledData); + (*(c->onToggled))(uiCheckbox(c), c->onToggledData); } -static void defaultOnToggled(uiControl *c, void *data) +static void defaultOnToggled(uiCheckbox *c, void *data) { // do nothing } @@ -39,9 +39,9 @@ static void setText(uiCheckbox *c, const char *text) gtk_button_set_label(CHECKBOX(c), text); } -static void setOnToggled(uiCheckbox *c, void (*f)(uiControl *, void *), void *data) +static void setOnToggled(uiCheckbox *cc, void (*f)(uiCheckbox *, void *), void *data) { - struct checkbox *c = (struct checkbox *) c; + struct checkbox *c = (struct checkbox *) cc; c->onToggled = f; c->onToggledData = data; @@ -52,9 +52,9 @@ static int getChecked(uiCheckbox *c) return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CHECKBOX(c))) != FALSE; } -static void setChecked(uiCheckbox *c, int checked) +static void setChecked(uiCheckbox *cc, int checked) { - struct checkbox *cc = (struct checkbox *) c; + struct checkbox *c = (struct checkbox *) cc; GtkToggleButton *button; gboolean active; @@ -63,12 +63,12 @@ static void setChecked(uiCheckbox *c, int checked) active = TRUE; // we need to inhibit sending of ::toggled because this WILL send a ::toggled otherwise button = GTK_TOGGLE_BUTTON(CHECKBOX(c)); - g_signal_handler_block(button, cc->onToggledSignal); + g_signal_handler_block(button, c->onToggledSignal); gtk_toggle_button_set_active(button, active); - g_signal_handler_unblock(button, cc->onToggledSignal); + g_signal_handler_unblock(button, c->onToggledSignal); } -uiControl *uiNewCheckbox(const char *text) +uiCheckbox *uiNewCheckbox(const char *text) { struct checkbox *c; GtkWidget *widget; diff --git a/unix/entry.c b/unix/entry.c index a18b5089..4731f68d 100644 --- a/unix/entry.c +++ b/unix/entry.c @@ -19,12 +19,12 @@ static char *getText(uiEntry *e) return g_strdup(gtk_entry_get_text(ENTRY(e))); } -static void uiEntrySetText(uiEntry *e, const char *text) +static void setText(uiEntry *e, const char *text) { gtk_entry_set_text(ENTRY(e), text); } -uiControl *uiNewEntry(void) +uiEntry *uiNewEntry(void) { struct entry *e; GtkWidget *widget; diff --git a/unix/label.c b/unix/label.c index caf7d553..1a7aa284 100644 --- a/unix/label.c +++ b/unix/label.c @@ -25,7 +25,7 @@ static void setText(uiLabel *l, const char *text) gtk_label_set_text(LABEL(l), text); } -uiControl *uiNewLabel(const char *text) +uiLabel *uiNewLabel(const char *text) { struct label *l; GtkWidget *widget; diff --git a/unix/tab.c b/unix/tab.c index eca79974..8332bbd2 100644 --- a/unix/tab.c +++ b/unix/tab.c @@ -31,7 +31,7 @@ static void addPage(uiTab *tt, const char *name, uiControl *child) t->pages = (uiParent **) uiRealloc(t->pages, t->cap * sizeof (uiParent *), "uiParent *[]"); } - notebook = GTK_WIDGET(uiControlHandle(c)); + notebook = GTK_WIDGET(TAB(t)); content = uiNewParent((uintptr_t) notebook); uiParentSetChild(content, child); uiParentUpdate(content); @@ -41,7 +41,7 @@ static void addPage(uiTab *tt, const char *name, uiControl *child) t->len++; } -uiControl *uiNewTab(void) +uiTab *uiNewTab(void) { uiControl *c; struct tab *t; diff --git a/unix/window.c b/unix/window.c index 7ecab4b7..c030d87e 100644 --- a/unix/window.c +++ b/unix/window.c @@ -46,7 +46,7 @@ static uintptr_t handle(uiWindow *ww) return (uintptr_t) (w->widget); } -static char *title(uiWindow *ww) +static char *getTitle(uiWindow *ww) { struct window *w = (struct window *) ww; @@ -109,7 +109,7 @@ static void setMargined(uiWindow *ww, int margined) uiParentUpdate(w->content); } -uiWindow *uiNewWindow(char *title, int width, int height) +uiWindow *uiNewWindow(const char *title, int width, int height) { struct window *w; @@ -124,7 +124,7 @@ uiWindow *uiNewWindow(char *title, int width, int height) uiWindow(w)->Destroy = windowDestroy; uiWindow(w)->Handle = handle; - uiWindow(w)->Title = title; + uiWindow(w)->Title = getTitle; uiWindow(w)->SetTitle = setTitle; uiWindow(w)->Show = show; uiWindow(w)->Hide = hide;