More TODO resolution.
This commit is contained in:
parent
ec070204a5
commit
7b104667ab
|
@ -29,8 +29,6 @@ static void uiContainer_dispose(GObject *obj)
|
||||||
G_OBJECT_CLASS(uiContainer_parent_class)->dispose(obj);
|
G_OBJECT_CLASS(uiContainer_parent_class)->dispose(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO switch from using uiContainer() directly below
|
|
||||||
|
|
||||||
static void uiContainer_finalize(GObject *obj)
|
static void uiContainer_finalize(GObject *obj)
|
||||||
{
|
{
|
||||||
G_OBJECT_CLASS(uiContainer_parent_class)->finalize(obj);
|
G_OBJECT_CLASS(uiContainer_parent_class)->finalize(obj);
|
||||||
|
@ -41,27 +39,30 @@ static void uiContainer_finalize(GObject *obj)
|
||||||
|
|
||||||
static void uiContainer_add(GtkContainer *container, GtkWidget *widget)
|
static void uiContainer_add(GtkContainer *container, GtkWidget *widget)
|
||||||
{
|
{
|
||||||
gtk_widget_set_parent(widget, GTK_WIDGET(container));
|
uiContainer *c = uiContainer(container);
|
||||||
if (uiContainer(container)->children != NULL)
|
|
||||||
g_ptr_array_add(uiContainer(container)->children, widget);
|
gtk_widget_set_parent(widget, GTK_WIDGET(c));
|
||||||
|
if (c->children != NULL)
|
||||||
|
g_ptr_array_add(c->children, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uiContainer_remove(GtkContainer *container, GtkWidget *widget)
|
static void uiContainer_remove(GtkContainer *container, GtkWidget *widget)
|
||||||
{
|
{
|
||||||
|
uiContainer *c = uiContainer(container);
|
||||||
|
|
||||||
gtk_widget_unparent(widget);
|
gtk_widget_unparent(widget);
|
||||||
if (uiContainer(container)->children != NULL)
|
if (c->children != NULL)
|
||||||
g_ptr_array_remove(uiContainer(container)->children, widget);
|
g_ptr_array_remove(c->children, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uiContainer_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
|
static void uiContainer_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
|
||||||
{
|
{
|
||||||
uiControl *c;
|
uiContainer *c = uiContainer(widget);
|
||||||
uiSizing d;
|
uiSizing d;
|
||||||
|
|
||||||
gtk_widget_set_allocation(widget, allocation);
|
gtk_widget_set_allocation(GTK_WIDGET(c), allocation);
|
||||||
c = uiContainer(widget)->child;
|
if (c->child != NULL)
|
||||||
if (c != NULL)
|
(*(c->child->resize))(c->child, allocation->x, allocation->y, allocation->width, allocation->height, &d);
|
||||||
(*(c->resize))(c, allocation->x, allocation->y, allocation->width, allocation->height, &d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct forall {
|
struct forall {
|
||||||
|
@ -78,12 +79,13 @@ static void doforall(gpointer obj, gpointer data)
|
||||||
|
|
||||||
static void uiContainer_forall(GtkContainer *container, gboolean includeInternals, GtkCallback callback, gpointer data)
|
static void uiContainer_forall(GtkContainer *container, gboolean includeInternals, GtkCallback callback, gpointer data)
|
||||||
{
|
{
|
||||||
|
uiContainer *c = uiContainer(container);
|
||||||
struct forall s;
|
struct forall s;
|
||||||
|
|
||||||
s.callback = callback;
|
s.callback = callback;
|
||||||
s.data = data;
|
s.data = data;
|
||||||
if (uiContainer(container)->children != NULL)
|
if (c->children != NULL)
|
||||||
g_ptr_array_foreach(uiContainer(container)->children, doforall, &s);
|
g_ptr_array_foreach(c->children, doforall, &s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uiContainer_class_init(uiContainerClass *class)
|
static void uiContainer_class_init(uiContainerClass *class)
|
||||||
|
@ -98,8 +100,5 @@ static void uiContainer_class_init(uiContainerClass *class)
|
||||||
|
|
||||||
GtkWidget *newContainer(void)
|
GtkWidget *newContainer(void)
|
||||||
{
|
{
|
||||||
uiContainer *c;
|
return GTK_WIDGET(g_object_new(uiContainerType, NULL));
|
||||||
|
|
||||||
c = uiContainer(g_object_new(uiContainerType, NULL));
|
|
||||||
return GTK_WIDGET(c);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue