Commit e1a88379 authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

app: remove the model column enum from gimpcontainertreeview.h

and use the right enum from gimpcontainertreestore.h all over the
place instead.
parent 104d0ffb
......@@ -27,6 +27,7 @@
#include "core/gimpcontainer.h"
#include "core/gimpviewable.h"
#include "gimpcontainertreestore.h"
#include "gimpcontainertreeview.h"
#include "gimpcontainertreeview-dnd.h"
#include "gimpcontainertreeview-private.h"
......@@ -105,7 +106,7 @@ gimp_container_tree_view_drop_status (GimpContainerTreeView *tree_view,
gtk_tree_model_get_iter (tree_view->model, &iter, drop_path);
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
dest_viewable = renderer->viewable;
......
......@@ -172,23 +172,23 @@ gimp_container_tree_view_init (GimpContainerTreeView *tree_view)
GIMP_TYPE_CONTAINER_TREE_VIEW,
GimpContainerTreeViewPriv);
g_assert (GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER ==
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_VIEW_COLUMN_NAME ==
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_VIEW_COLUMN_NAME_ATTRIBUTES ==
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_VIEW_COLUMN_NAME_SENSITIVE ==
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_VIEW_COLUMN_USER_DATA ==
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));
......@@ -221,7 +221,7 @@ gimp_container_tree_view_constructor (GType type,
tree_view->view = g_object_new (GTK_TYPE_TREE_VIEW,
"model", tree_view->model,
"search-column", GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME,
"search-column", GIMP_CONTAINER_TREE_STORE_COLUMN_NAME,
"enable-search", FALSE,
"headers-visible", FALSE,
"has-tooltip", TRUE,
......@@ -248,7 +248,7 @@ gimp_container_tree_view_constructor (GType type,
gtk_tree_view_column_set_attributes (tree_view->main_column,
tree_view->renderer_cell,
"renderer", GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER,
"renderer", GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER,
NULL);
tree_view->priv->name_cell = gtk_cell_renderer_text_new ();
......@@ -259,9 +259,9 @@ gimp_container_tree_view_constructor (GType type,
gtk_tree_view_column_set_attributes (tree_view->main_column,
tree_view->priv->name_cell,
"text", GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME,
"attributes", GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_ATTRIBUTES,
"sensitive", GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_SENSITIVE,
"text", GIMP_CONTAINER_TREE_STORE_COLUMN_NAME,
"attributes", GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_ATTRIBUTES,
"sensitive", GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_SENSITIVE,
NULL);
g_signal_connect (tree_view->priv->name_cell, "editing-canceled",
......@@ -655,7 +655,7 @@ gimp_container_tree_view_reorder_item (GimpContainerView *view,
GimpViewRenderer *renderer;
gtk_tree_model_get (tree_view->model, &selected_iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
if (renderer->viewable != viewable)
......@@ -820,13 +820,13 @@ gimp_container_tree_view_name_canceled (GtkCellRendererText *cell,
gchar *name;
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
name = gimp_viewable_get_description (renderer->viewable, NULL);
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME, name,
-1);
g_free (name);
......@@ -921,7 +921,7 @@ gimp_container_tree_view_button_press (GtkWidget *widget,
gtk_tree_model_get_iter (tree_view->model, &iter, path);
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
tree_view->priv->dnd_renderer = renderer;
......@@ -1057,7 +1057,7 @@ gimp_container_tree_view_button_press (GtkWidget *widget,
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model),
&iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME,
real_name,
-1);
}
......@@ -1152,7 +1152,7 @@ gimp_container_tree_view_tooltip (GtkWidget *widget,
return FALSE;
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
if (renderer)
......@@ -1274,7 +1274,7 @@ gimp_container_tree_view_get_selected (GimpContainerView *view,
(GtkTreePath *) current_row->data);
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
if (renderer->viewable)
......
......@@ -25,17 +25,6 @@
#include "gimpcontainerbox.h"
enum
{
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_ATTRIBUTES,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_SENSITIVE,
GIMP_CONTAINER_TREE_VIEW_COLUMN_USER_DATA,
GIMP_CONTAINER_TREE_VIEW_N_COLUMNS
};
#define GIMP_TYPE_CONTAINER_TREE_VIEW (gimp_container_tree_view_get_type ())
#define GIMP_CONTAINER_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CONTAINER_TREE_VIEW, GimpContainerTreeView))
#define GIMP_CONTAINER_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CONTAINER_TREE_VIEW, GimpContainerTreeViewClass))
......
......@@ -41,6 +41,7 @@
#include "gimpcombotagentry.h"
#include "gimpcontainergridview.h"
#include "gimpcontainertreestore.h"
#include "gimpcontainertreeview.h"
#include "gimpcontainerview.h"
#include "gimpdatafactoryview.h"
......@@ -390,7 +391,7 @@ gimp_data_factory_view_tree_name_edited (GtkCellRendererText *cell,
gchar *name;
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
data = GIMP_DATA (renderer->viewable);
......@@ -410,7 +411,7 @@ gimp_data_factory_view_tree_name_edited (GtkCellRendererText *cell,
name = gimp_viewable_get_description (renderer->viewable, NULL);
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME, name,
-1);
g_free (name);
}
......
......@@ -31,6 +31,7 @@
#include "core/gimpmarshal.h"
#include "gimpcontainerview.h"
#include "gimpcontainertreestore.h"
#include "gimpcontainertreeview.h"
#include "gimpdeviceeditor.h"
#include "gimpdeviceinfo.h"
......@@ -331,8 +332,8 @@ gimp_device_editor_add_device (GimpContainer *container,
treeview = GIMP_CONTAINER_TREE_VIEW (private->treeview);
gtk_tree_store_set (GTK_TREE_STORE (treeview->model), iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_USER_DATA, widget,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_SENSITIVE,
GIMP_CONTAINER_TREE_STORE_COLUMN_USER_DATA, widget,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_SENSITIVE,
gimp_device_info_get_device (info, NULL) != NULL,
-1);
}
......@@ -357,7 +358,7 @@ gimp_device_editor_remove_device (GimpContainer *container,
treeview = GIMP_CONTAINER_TREE_VIEW (private->treeview);
gtk_tree_model_get (treeview->model, iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_USER_DATA, &widget,
GIMP_CONTAINER_TREE_STORE_COLUMN_USER_DATA, &widget,
-1);
if (widget)
......@@ -381,7 +382,7 @@ gimp_device_editor_select_device (GimpContainerView *view,
treeview = GIMP_CONTAINER_TREE_VIEW (private->treeview);
gtk_tree_model_get (treeview->model, insert_data,
GIMP_CONTAINER_TREE_VIEW_COLUMN_USER_DATA, &widget,
GIMP_CONTAINER_TREE_STORE_COLUMN_USER_DATA, &widget,
-1);
if (widget)
......
......@@ -1196,7 +1196,7 @@ gimp_item_tree_view_name_edited (GtkCellRendererText *cell,
GError *error = NULL;
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
item = GIMP_ITEM (renderer->viewable);
......@@ -1216,7 +1216,7 @@ gimp_item_tree_view_name_edited (GtkCellRendererText *cell,
gchar *name = gimp_viewable_get_description (renderer->viewable, NULL);
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME, name,
-1);
g_free (name);
......@@ -1442,7 +1442,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle,
context = gimp_container_view_get_context (GIMP_CONTAINER_VIEW (view));
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
g_object_get (toggle,
"active", &active,
......@@ -1467,7 +1467,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle,
&iter))
{
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
if ((GimpItem *) renderer->viewable != item)
......
......@@ -896,7 +896,7 @@ gimp_layer_tree_view_floating_selection_changed (GimpImage *image,
if (iter)
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_ATTRIBUTES,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_ATTRIBUTES,
layer_view->priv->italic_attrs,
-1);
}
......@@ -915,7 +915,7 @@ gimp_layer_tree_view_floating_selection_changed (GimpImage *image,
if (iter)
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_ATTRIBUTES,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_ATTRIBUTES,
gimp_drawable_has_alpha (drawable) ?
NULL : layer_view->priv->bold_attrs,
-1);
......@@ -1262,7 +1262,7 @@ gimp_layer_tree_view_update_borders (GimpLayerTreeView *layer_view,
GimpViewBorderType layer_type = GIMP_VIEW_BORDER_BLACK;
gtk_tree_model_get (tree_view->model, iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &layer_renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &layer_renderer,
layer_view->priv->model_column_mask, &mask_renderer,
-1);
......@@ -1433,7 +1433,7 @@ gimp_layer_tree_view_alpha_update (GimpLayerTreeView *view,
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME_ATTRIBUTES,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME_ATTRIBUTES,
gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)) ?
NULL : view->priv->bold_attrs,
-1);
......
......@@ -34,6 +34,7 @@
#include "core/gimplist.h"
#include "core/gimpviewable.h"
#include "gimpcontainertreestore.h"
#include "gimpcontainertreeview.h"
#include "gimpcontainerview.h"
#include "gimpsettingseditor.h"
......@@ -283,7 +284,7 @@ gimp_settings_editor_row_separator_func (GtkTreeModel *model,
gchar *name = NULL;
gtk_tree_model_get (model, iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, &name,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME, &name,
-1);
g_free (name);
......@@ -373,7 +374,7 @@ gimp_settings_editor_name_edited (GtkCellRendererText *cell,
gchar *name;
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
object = GIMP_OBJECT (renderer->viewable);
......@@ -403,7 +404,7 @@ gimp_settings_editor_name_edited (GtkCellRendererText *cell,
name = gimp_viewable_get_description (renderer->viewable, NULL);
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME, name,
-1);
g_free (name);
}
......
......@@ -36,6 +36,7 @@
#include "core/gimpimage.h"
#include "core/gimptemplate.h"
#include "gimpcontainertreestore.h"
#include "gimpcontainertreeview.h"
#include "gimpcontainerview.h"
#include "gimptemplateview.h"
......@@ -195,7 +196,7 @@ gimp_template_view_tree_name_edited (GtkCellRendererText *cell,
const gchar *old_name;
gtk_tree_model_get (tree_view->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
object = GIMP_OBJECT (renderer->viewable);
......@@ -215,7 +216,7 @@ gimp_template_view_tree_name_edited (GtkCellRendererText *cell,
NULL);
gtk_tree_store_set (GTK_TREE_STORE (tree_view->model), &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_NAME, name,
GIMP_CONTAINER_TREE_STORE_COLUMN_NAME, name,
-1);
g_free (name);
}
......
......@@ -32,6 +32,7 @@
#include "core/gimpcontext.h"
#include "core/gimptoolinfo.h"
#include "gimpcontainertreestore.h"
#include "gimpcontainerview.h"
#include "gimpviewrenderer.h"
#include "gimptooleditor.h"
......@@ -492,7 +493,7 @@ gimp_tool_editor_eye_data_func (GtkTreeViewColumn *tree_column,
gboolean visible;
gtk_tree_model_get (tree_model, iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
g_object_get (renderer->viewable, "visible", &visible, NULL);
......@@ -523,7 +524,7 @@ gimp_tool_editor_eye_clicked (GtkCellRendererToggle *toggle,
"active", &active,
NULL);
gtk_tree_model_get (priv->model, &iter,
GIMP_CONTAINER_TREE_VIEW_COLUMN_RENDERER, &renderer,
GIMP_CONTAINER_TREE_STORE_COLUMN_RENDERER, &renderer,
-1);
g_object_set (renderer->viewable, "visible", ! active, NULL);
......
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