void ui_object_destroy_list_items (ui_object *list) { ui_object *destroy_item, *current_list_item; if (!list) { return; } current_list_item = get_ui_object_child (list); while (current_list_item) { destroy_item = current_list_item; current_list_item = get_ui_object_next (current_list_item); if (get_ui_object_type (destroy_item) != UI_TYPE_VSLIDER) { destroy_ui_object (destroy_item); } } set_ui_object_child (list, NULL); }
static void set_area_ui_object_parent (ui_object *obj, ui_object *parent) { area_ui_object *area; ui_object *next; // // Remove object from current_parents list // if (get_ui_object_parent (obj)) { ui_object *prev, *parent; next = get_ui_object_next (obj); prev = get_ui_object_prev (obj); parent = get_ui_object_parent (obj); if (next) { set_ui_object_prev (next, prev); } if (prev) { set_ui_object_next (prev, next); } if (get_ui_object_child (parent) == obj) { if (prev) { set_ui_object_child (parent, prev); } else if (next) { set_ui_object_child (parent, next); } else { set_ui_object_child (parent, NULL); } } } // // insert obj into new_parents list // area = (area_ui_object *) obj->data; next = get_ui_object_child (parent); if (area->next) { set_ui_object_prev (obj, NULL); area->parent = parent; set_ui_object_child (parent, obj); if (next) { set_ui_object_prev (next, obj); } } else if (next) { while (get_ui_object_next (next)) { next= get_ui_object_next (next); } set_ui_object_prev (obj, next); set_ui_object_next (next, obj); area->parent = parent; } else { area->parent = parent; set_area_ui_object_child (parent, obj); } }