From cee974f4fcb1c37511820173b9ddf2b468fbe584 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 28 Aug 2015 10:10:52 -0400 Subject: [PATCH] Fixed some compiler issues. Oops, forgot to migrate menu.c. --- redo/unix/box.c | 6 ++---- redo/unix/button.c | 2 +- redo/unix/checkbox.c | 2 +- redo/unix/combobox.c | 2 +- redo/unix/datetimepicker.c | 2 +- redo/unix/entry.c | 4 ++-- redo/unix/group.c | 10 ++++------ redo/unix/label.c | 2 +- redo/unix/menu.c | 4 ++-- redo/unix/progressbar.c | 2 +- redo/unix/radiobuttons.c | 2 +- redo/unix/separator.c | 2 +- redo/unix/slider.c | 2 +- redo/unix/spinbox.c | 2 +- redo/unix/tab.c | 2 +- redo/unix/window.c | 4 ++-- 16 files changed, 23 insertions(+), 27 deletions(-) diff --git a/redo/unix/box.c b/redo/unix/box.c index fd1a848f..b458446c 100644 --- a/redo/unix/box.c +++ b/redo/unix/box.c @@ -52,7 +52,7 @@ static void boxContainerUpdateState(uiControl *c) for (i = 0; i < b->controls->len; i++) { bc = ptrArrayIndex(b->controls, struct boxControl *, i); - uiControlUpdateState(bc->c); + controlUpdateState(bc->c); } } @@ -120,7 +120,7 @@ static uiBox *finishNewBox(GtkOrientation orientation) { uiBox *b; - b = (uiBox *) uiNewControl(uiTypeBox()); + b = (uiBox *) uiNewControl(uiBoxType()); b->widget = gtk_box_new(orientation, 0); b->container = GTK_CONTAINER(b->widget); @@ -135,8 +135,6 @@ static uiBox *finishNewBox(GtkOrientation orientation) b->controls = newPtrArray(); - uiUnixMakeSingleWidgetControl(uiControl(b), b->widget); - uiUnixFinishNewControl(b, uiBox); uiControl(b)->ContainerUpdateState = boxContainerUpdateState; diff --git a/redo/unix/button.c b/redo/unix/button.c index af003caa..8bcea519 100644 --- a/redo/unix/button.c +++ b/redo/unix/button.c @@ -48,7 +48,7 @@ uiButton *uiNewButton(const char *text) { uiButton *b; - b = (uiButton *) uiNewControl(uiTypeButton()); + b = (uiButton *) uiNewControl(uiButtonType()); b->widget = gtk_button_new_with_label(text); b->button = GTK_BUTTON(b->widget); diff --git a/redo/unix/checkbox.c b/redo/unix/checkbox.c index 3e38d801..0cb8a87a 100644 --- a/redo/unix/checkbox.c +++ b/redo/unix/checkbox.c @@ -69,7 +69,7 @@ uiCheckbox *uiNewCheckbox(const char *text) { uiCheckbox *c; - c = (uiCheckbox *) uiNewControl(uiTypeCheckbox()); + c = (uiCheckbox *) uiNewControl(uiCheckboxType()); c->widget = gtk_check_button_new_with_label(text); c->button = GTK_BUTTON(c->widget); diff --git a/redo/unix/combobox.c b/redo/unix/combobox.c index 2c284338..7dc7e0cf 100644 --- a/redo/unix/combobox.c +++ b/redo/unix/combobox.c @@ -22,7 +22,7 @@ static uiCombobox *finishNewCombobox(GtkWidget *(*newfunc)(void)) { uiCombobox *c; - c = (uiCombobox *) uiNewControl(uiTypeCombobox()); + c = (uiCombobox *) uiNewControl(uiComboboxType()); c->widget = (*newfunc)(); c->combobox = GTK_COMBO_BOX(c->widget); diff --git a/redo/unix/datetimepicker.c b/redo/unix/datetimepicker.c index 26d0be4b..86f7ebdd 100644 --- a/redo/unix/datetimepicker.c +++ b/redo/unix/datetimepicker.c @@ -23,7 +23,7 @@ uiDateTimePicker *finishNewDateTimePicker(OSTHING OSARG) { uiDateTimePicker *d; - d = (uiDateTimePicker *) uiNewControl(uiTypeDateTimePicker()); + d = (uiDateTimePicker *) uiNewControl(uiDateTimePickerType()); d->widget = gtk_label_new("TODO uiDateTimePicker not implemented"); diff --git a/redo/unix/entry.c b/redo/unix/entry.c index 64bfed3c..5b4d66e8 100644 --- a/redo/unix/entry.c +++ b/redo/unix/entry.c @@ -67,14 +67,14 @@ uiEntry *uiNewEntry(void) { uiEntry *e; - e = (uiEntry *) uiNewControl(uiTypeEntry()); + e = (uiEntry *) uiNewControl(uiEntryType()); e->widget = gtk_entry_new(); e->entry = GTK_ENTRY(e->widget); e->editable = GTK_EDITABLE(e->widget); e->onChangedSignal = g_signal_connect(e->widget, "changed", G_CALLBACK(onChanged), e); - uiEntryOnChanged(e->onChanged, defaultOnChanged, NULL); + uiEntryOnChanged(e, defaultOnChanged, NULL); uiUnixFinishNewControl(e, uiEntry); diff --git a/redo/unix/group.c b/redo/unix/group.c index 74d019eb..36b7bbfd 100644 --- a/redo/unix/group.c +++ b/redo/unix/group.c @@ -36,7 +36,7 @@ static void groupContainerUpdateState(uiControl *c) uiGroup *g = uiGroup(c); if (g->child != NULL) - uiControlUpdateState(g->child); + controlUpdateState(g->child); } char *uiGroupTitle(uiGroup *g) @@ -53,17 +53,15 @@ void uiGroupSetTitle(uiGroup *g, const char *text) void uiGroupSetChild(uiGroup *g, uiControl *child) { - struct group *g = (struct group *) gg; - if (g->child != NULL) { - gtk_container_remove(GTK_CONTAINER(g->bin), + gtk_container_remove(GTK_CONTAINER(g->box), GTK_WIDGET(uiControlHandle(g->child))); uiControlSetParent(g->child, NULL); } g->child = child; if (g->child != NULL) { uiControlSetParent(g->child, uiControl(g)); - gtk_container_add(GTK_CONTAINER(g->bin), + gtk_container_add(GTK_CONTAINER(g->box), GTK_WIDGET(uiControlHandle(g->child))); uiControlQueueResize(g->child); } @@ -89,7 +87,7 @@ uiGroup *uiNewGroup(const char *text) PangoAttribute *bold; PangoAttrList *boldlist; - g = (uiGroup *) uiNewControl(uiTypeGroup()); + g = (uiGroup *) uiNewControl(uiGroupType()); g->widget = gtk_frame_new(text); g->container = GTK_CONTAINER(g->widget); diff --git a/redo/unix/label.c b/redo/unix/label.c index 96fe3bf7..d8b481ff 100644 --- a/redo/unix/label.c +++ b/redo/unix/label.c @@ -29,7 +29,7 @@ uiLabel *uiNewLabel(const char *text) { uiLabel *l; - l = (uiLabel *) uiNewControl(uiTypeLabel()); + l = (uiLabel *) uiNewControl(uiLabelType()); l->widget = gtk_label_new(text); l->misc = GTK_MISC(l->widget); diff --git a/redo/unix/menu.c b/redo/unix/menu.c index 8ee571cb..33d8a4e1 100644 --- a/redo/unix/menu.c +++ b/redo/unix/menu.c @@ -149,7 +149,7 @@ static uiMenuItem *newItem(struct menu *m, int type, const char *name) complain("attempt to create a new menu item after menus have been finalized"); item = uiNew(struct menuItem); - uiTyped(item)->Type = uiTypeMenuItem(); + uiTyped(item)->Type = uiMenuItemType(); g_array_append_val(m->items, item); @@ -250,7 +250,7 @@ uiMenu *uiNewMenu(const char *name) menus = g_array_new(FALSE, TRUE, sizeof (struct menu *)); m = uiNew(struct menu); - uiTyped(m)->Type = uiTypeMenu(); + uiTyped(m)->Type = uiMenuType(); g_array_append_val(menus, m); diff --git a/redo/unix/progressbar.c b/redo/unix/progressbar.c index 8ca9b5f9..8aa94538 100644 --- a/redo/unix/progressbar.c +++ b/redo/unix/progressbar.c @@ -23,7 +23,7 @@ uiProgressBar *uiNewProgressBar(void) { uiProgressBar *p; - p = (uiProgressBar *) uiNewControl(uiTypeProgressBar()); + p = (uiProgressBar *) uiNewControl(uiProgressBarType()); p->widget = gtk_progress_bar_new(); p->pbar = GTK_PROGRESS_BAR(p->widget); diff --git a/redo/unix/radiobuttons.c b/redo/unix/radiobuttons.c index 4e73be64..f3ac7a13 100644 --- a/redo/unix/radiobuttons.c +++ b/redo/unix/radiobuttons.c @@ -43,7 +43,7 @@ uiRadioButtons *uiNewRadioButtons(void) { uiRadioButtons *r; - r = (uiRadioButtons *) uiNewControl(uiTypeRadioButtons()); + r = (uiRadioButtons *) uiNewControl(uiRadioButtonsType()); r->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); r->container = GTK_CONTAINER(r->widget); diff --git a/redo/unix/separator.c b/redo/unix/separator.c index b0603a7f..301d198a 100644 --- a/redo/unix/separator.c +++ b/redo/unix/separator.c @@ -16,7 +16,7 @@ uiSeparator *uiNewHorizontalSeparator(void) { uiSeparator *s; - s = (uiSeparator *) uiNewControl(uiTypeSeparator()); + s = (uiSeparator *) uiNewControl(uiSeparatorType()); s->widget = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); s->separator = GTK_SEPARATOR(s->widget); diff --git a/redo/unix/slider.c b/redo/unix/slider.c index f082f268..0c91a6a1 100644 --- a/redo/unix/slider.c +++ b/redo/unix/slider.c @@ -51,7 +51,7 @@ uiSlider *uiNewSlider(intmax_t min, intmax_t max) { uiSlider *s; - s = (uiSlider *) uiNewControl(uiTypeSlider()); + s = (uiSlider *) uiNewControl(uiSliderType()); s->widget = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, min, max, 1); s->range = GTK_RANGE(s->widget); diff --git a/redo/unix/spinbox.c b/redo/unix/spinbox.c index cfc2ade6..4e8d2d84 100644 --- a/redo/unix/spinbox.c +++ b/redo/unix/spinbox.c @@ -55,7 +55,7 @@ uiSpinbox *uiNewSpinbox(intmax_t min, intmax_t max) if (min >= max) complain("error: min >= max in uiNewSpinbox()"); - s = (uiSpinbox *) uiNewControl(uiTypeSpinbox()); + s = (uiSpinbox *) uiNewControl(uiSpinboxType()); s->widget = gtk_spin_button_new_with_range(min, max, 1); s->entry = GTK_ENTRY(s->widget); diff --git a/redo/unix/tab.c b/redo/unix/tab.c index 5080b6c5..d7326e51 100644 --- a/redo/unix/tab.c +++ b/redo/unix/tab.c @@ -107,7 +107,7 @@ uiTab *uiNewTab(void) { uiTab *t; - t = (uiTab *) uiNewControl(uiTypeTab()); + t = (uiTab *) uiNewControl(uiTabType()); t->widget = gtk_notebook_new(); t->container = GTK_CONTAINER(t->widget); diff --git a/redo/unix/window.c b/redo/unix/window.c index 792088f8..3879baaf 100644 --- a/redo/unix/window.c +++ b/redo/unix/window.c @@ -74,7 +74,7 @@ static void windowContainerUpdateState(uiControl *c) uiWindow *w = uiWindow(c); if (w->child != NULL) - uiControlUpdateState(w->child); + controlUpdateState(w->child); } char *uiWindowTitle(uiWindow *w) @@ -124,7 +124,7 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) { uiWindow *w; - w = (uiWindow *) uiNewControl(uiTypeWindow()); + w = (uiWindow *) uiNewControl(uiWindowType()); w->widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); w->container = GTK_CONTAINER(w->widget);