Commit 89f7500b authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

app: add gimp_container_tree_store_columns_init()

which initializes the type array with the default columns.
parent e1a88379
......@@ -405,6 +405,35 @@ gimp_container_tree_store_set_view_size (GimpContainerTreeStore *store)
/* private functions */
void
gimp_container_tree_store_columns_init (GType *types,
gint *n_types)
{
g_return_if_fail (types != NULL);
g_return_if_fail (n_types != NULL);
g_return_if_fail (*n_types == 0);
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER ==
gimp_container_tree_store_columns_add (types, n_types,
GIMP_TYPE_VIEW_RENDERER));
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_NAME ==
gimp_container_tree_store_columns_add (types, n_types,
G_TYPE_STRING));
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_ATTRIBUTES ==
gimp_container_tree_store_columns_add (types, n_types,
PANGO_TYPE_ATTR_LIST));
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_SENSITIVE ==
gimp_container_tree_store_columns_add (types, n_types,
G_TYPE_BOOLEAN));
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_USER_DATA ==
gimp_container_tree_store_columns_add (types, n_types,
G_TYPE_POINTER));
}
gint
gimp_container_tree_store_columns_add (GType *types,
gint *n_types,
......
......@@ -56,6 +56,8 @@ struct _GimpContainerTreeStoreClass
GType gimp_container_tree_store_get_type (void) G_GNUC_CONST;
void gimp_container_tree_store_columns_init (GType *types,
gint *n_types);
gint gimp_container_tree_store_columns_add (GType *types,
gint *n_types,
GType type);
......
......@@ -172,26 +172,8 @@ gimp_container_tree_view_init (GimpContainerTreeView *tree_view)
GIMP_TYPE_CONTAINER_TREE_VIEW,
GimpContainerTreeViewPriv);
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER ==
gimp_container_tree_store_columns_add (tree_view->model_columns,
&tree_view->n_model_columns,
GIMP_TYPE_VIEW_RENDERER));
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_NAME ==
gimp_container_tree_store_columns_add (tree_view->model_columns,
&tree_view->n_model_columns,
G_TYPE_STRING));
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_ATTRIBUTES ==
gimp_container_tree_store_columns_add (tree_view->model_columns,
&tree_view->n_model_columns,
PANGO_TYPE_ATTR_LIST));
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_SENSITIVE ==
gimp_container_tree_store_columns_add (tree_view->model_columns,
&tree_view->n_model_columns,
G_TYPE_BOOLEAN));
g_assert (GIMP_CONTAINER_TREE_STORE_COLUMN_USER_DATA ==
gimp_container_tree_store_columns_add (tree_view->model_columns,
&tree_view->n_model_columns,
G_TYPE_POINTER));
gimp_container_tree_store_columns_init (tree_view->model_columns,
&tree_view->n_model_columns);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (box->scrolled_win),
GTK_SHADOW_IN);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment