Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
container.h
Go to the documentation of this file.
1/*
2 * This file is part of Ansel,
3 * Copyright (C) 2026 Aurélien PIERRE.
4 *
5 * Ansel is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * Ansel is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with Ansel. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef DT_WIDGETS_CONTAINER_H
20#define DT_WIDGETS_CONTAINER_H
21
22/* Counting and clearing the children a GtkContainer was given.
23 *
24 * gtk_container_get_children() allocates a list every time, which is three lines of
25 * boilerplate and a leak waiting to happen at each of the ~40 places that just wanted to
26 * know whether a box has anything in it. */
27
28#include <gtk/gtk.h>
29
31
32// check whether the given container has any user-added children
34// return a count of the user-added children in the given container
36// return the first child of the given container
38// return the requested child of the given container, or NULL if it has fewer children
40
41// remove all of the children we've added to the container. Any which no longer have any
42// references will be destroyed.
44
45// delete all of the children we've added to the container. Use this function only if you are
46// SURE there are no other references to any of the children (if in doubt, use
47// dt_gui_container_remove_children instead; it's a bit slower but safer).
49
51
52#endif // DT_WIDGETS_CONTAINER_H
53
54// clang-format off
55// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
56// vim: shiftwidth=2 expandtab tabstop=2 cindent
57// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
58// clang-format on
uint32_t container(dt_lib_module_t *self)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
void dt_gui_container_remove_children(GtkContainer *container)
Definition container.c:68
G_BEGIN_DECLS gboolean dt_gui_container_has_children(GtkContainer *container)
Definition container.c:23
int dt_gui_container_num_children(GtkContainer *container)
Definition container.c:33
GtkWidget * dt_gui_container_nth_child(GtkContainer *container, int which)
Definition container.c:53
void dt_gui_container_destroy_children(GtkContainer *container)
Definition container.c:80
GtkWidget * dt_gui_container_first_child(GtkContainer *container)
Definition container.c:43