gimp r27675 - in trunk: . app/widgets
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27675 - in trunk: . app/widgets
- Date: Sun, 16 Nov 2008 20:58:53 +0000 (UTC)
Author: martinn
Date: Sun Nov 16 20:58:53 2008
New Revision: 27675
URL: http://svn.gnome.org/viewvc/gimp?rev=27675&view=rev
Log:
* app/widgets/gimpcontainertreeview.[ch]
* app/widgets/gimpcontainertreeview-private.h: Make the
renderer_cells and toggle_cells members private.
(gimp_container_tree_view_set_main_column_title)
(gimp_container_tree_view_prepend_toggle_cell_renderer)
(gimp_container_tree_view_prepend_cell_renderer): New interface.
* app/widgets/gimptoolview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpcontrollerlist.c: Use new interface.
Modified:
trunk/ChangeLog
trunk/app/widgets/gimpcontainertreeview-private.h
trunk/app/widgets/gimpcontainertreeview.c
trunk/app/widgets/gimpcontainertreeview.h
trunk/app/widgets/gimpcontrollerlist.c
trunk/app/widgets/gimpitemtreeview.c
trunk/app/widgets/gimplayertreeview.c
trunk/app/widgets/gimptoolview.c
Modified: trunk/app/widgets/gimpcontainertreeview-private.h
==============================================================================
--- trunk/app/widgets/gimpcontainertreeview-private.h (original)
+++ trunk/app/widgets/gimpcontainertreeview-private.h Sun Nov 16 20:58:53 2008
@@ -25,19 +25,22 @@
struct _GimpContainerTreeViewPriv
{
- GtkTreeSelection *selection;
+ GtkTreeSelection *selection;
- GtkCellRenderer *name_cell;
+ GtkCellRenderer *name_cell;
- GList *editable_cells;
+ GList *editable_cells;
- GimpViewRenderer *dnd_renderer;
+ GimpViewRenderer *dnd_renderer;
- guint scroll_timeout_id;
- guint scroll_timeout_interval;
- GdkScrollDirection scroll_dir;
+ GList *toggle_cells;
+ GList *renderer_cells;
- gboolean dnd_drop_to_empty;
+ guint scroll_timeout_id;
+ guint scroll_timeout_interval;
+ GdkScrollDirection scroll_dir;
+
+ gboolean dnd_drop_to_empty;
};
Modified: trunk/app/widgets/gimpcontainertreeview.c
==============================================================================
--- trunk/app/widgets/gimpcontainertreeview.c (original)
+++ trunk/app/widgets/gimpcontainertreeview.c Sun Nov 16 20:58:53 2008
@@ -238,8 +238,8 @@
G_CALLBACK (gimp_container_tree_view_name_canceled),
tree_view);
- tree_view->renderer_cells = g_list_prepend (tree_view->renderer_cells,
- tree_view->renderer_cell);
+ tree_view->priv->renderer_cells = g_list_prepend (tree_view->priv->renderer_cells,
+ tree_view->renderer_cell);
tree_view->priv->selection = gtk_tree_view_get_selection (tree_view->view);
@@ -272,16 +272,16 @@
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (object);
- if (tree_view->toggle_cells)
+ if (tree_view->priv->toggle_cells)
{
- g_list_free (tree_view->toggle_cells);
- tree_view->toggle_cells = NULL;
+ g_list_free (tree_view->priv->toggle_cells);
+ tree_view->priv->toggle_cells = NULL;
}
- if (tree_view->renderer_cells)
+ if (tree_view->priv->renderer_cells)
{
- g_list_free (tree_view->renderer_cells);
- tree_view->renderer_cells = NULL;
+ g_list_free (tree_view->priv->renderer_cells);
+ tree_view->priv->renderer_cells = NULL;
}
if (tree_view->priv->editable_cells)
@@ -396,6 +396,38 @@
}
void
+gimp_container_tree_view_set_main_column_title (GimpContainerTreeView *tree_view,
+ const gchar *title)
+{
+ g_return_if_fail (GIMP_IS_CONTAINER_TREE_VIEW (tree_view));
+
+ gtk_tree_view_column_set_title (tree_view->main_column,
+ title);
+}
+
+void
+gimp_container_tree_view_prepend_toggle_cell_renderer (GimpContainerTreeView *tree_view,
+ GtkCellRenderer *cell_renderer)
+{
+ g_return_if_fail (GIMP_IS_CONTAINER_TREE_VIEW (tree_view));
+ g_return_if_fail (GTK_IS_CELL_RENDERER (cell_renderer));
+
+ tree_view->priv->toggle_cells = g_list_prepend (tree_view->priv->toggle_cells,
+ cell_renderer);
+}
+
+void
+gimp_container_tree_view_prepend_cell_renderer (GimpContainerTreeView *tree_view,
+ GtkCellRenderer *cell_renderer)
+{
+ g_return_if_fail (GIMP_IS_CONTAINER_TREE_VIEW (tree_view));
+ g_return_if_fail (GTK_IS_CELL_RENDERER (cell_renderer));
+
+ tree_view->priv->renderer_cells = g_list_prepend (tree_view->priv->renderer_cells,
+ cell_renderer);
+}
+
+void
gimp_container_tree_view_set_dnd_drop_to_empty (GimpContainerTreeView *tree_view,
gboolean dnd_drop_to_empty)
{
@@ -590,7 +622,7 @@
{
GList *list;
- for (list = tree_view->renderer_cells; list; list = list->next)
+ for (list = tree_view->priv->renderer_cells; list; list = list->next)
g_object_set (list->data, "renderer", NULL, NULL);
}
}
@@ -750,7 +782,7 @@
{
GList *list;
- for (list = tree_view->renderer_cells; list; list = list->next)
+ for (list = tree_view->priv->renderer_cells; list; list = list->next)
g_object_set (list->data, "renderer", NULL, NULL);
}
@@ -793,7 +825,7 @@
if (! tree_widget)
return;
- for (list = tree_view->toggle_cells; list; list = g_list_next (list))
+ for (list = tree_view->priv->toggle_cells; list; list = g_list_next (list))
{
gchar *stock_id;
GtkIconSize icon_size;
@@ -952,14 +984,14 @@
toggled_cell = (GimpCellRendererToggle *)
gimp_container_tree_view_find_click_cell (widget,
- tree_view->toggle_cells,
+ tree_view->priv->toggle_cells,
column, &column_area,
bevent->x, bevent->y);
if (! toggled_cell)
clicked_cell = (GimpCellRendererViewable *)
gimp_container_tree_view_find_click_cell (widget,
- tree_view->renderer_cells,
+ tree_view->priv->renderer_cells,
column, &column_area,
bevent->x, bevent->y);
Modified: trunk/app/widgets/gimpcontainertreeview.h
==============================================================================
--- trunk/app/widgets/gimpcontainertreeview.h (original)
+++ trunk/app/widgets/gimpcontainertreeview.h Sun Nov 16 20:58:53 2008
@@ -59,9 +59,6 @@
GtkTreeViewColumn *main_column;
GtkCellRenderer *renderer_cell;
- GList *toggle_cells;
- GList *renderer_cells;
-
Gimp *dnd_gimp; /* eek */
GimpContainerTreeViewPriv *priv;
@@ -114,6 +111,18 @@
gint view_size,
gint view_border_width);
+void gimp_container_tree_view_set_main_column_title
+ (GimpContainerTreeView *tree_view,
+ const gchar *title);
+
+void gimp_container_tree_view_prepend_toggle_cell_renderer
+ (GimpContainerTreeView *tree_view,
+ GtkCellRenderer *cell_renderer);
+
+void gimp_container_tree_view_prepend_cell_renderer
+ (GimpContainerTreeView *tree_view,
+ GtkCellRenderer *cell_renderer);
+
void gimp_container_tree_view_set_dnd_drop_to_empty
(GimpContainerTreeView *tree_view,
gboolean dnd_drop_to_emtpy);
Modified: trunk/app/widgets/gimpcontrollerlist.c
==============================================================================
--- trunk/app/widgets/gimpcontrollerlist.c (original)
+++ trunk/app/widgets/gimpcontrollerlist.c Sun Nov 16 20:58:53 2008
@@ -270,8 +270,8 @@
icon_size, &icon_width, &icon_height);
list->dest = gimp_container_tree_view_new (NULL, NULL, icon_height, 0);
- gtk_tree_view_column_set_title (GIMP_CONTAINER_TREE_VIEW (list->dest)->main_column,
- _("Active Controllers"));
+ gimp_container_tree_view_set_main_column_title (GIMP_CONTAINER_TREE_VIEW (list->dest),
+ _("Active Controllers"));
gtk_tree_view_set_headers_visible (GIMP_CONTAINER_TREE_VIEW (list->dest)->view,
TRUE);
gtk_box_pack_start (GTK_BOX (list->hbox), list->dest, TRUE, TRUE, 0);
Modified: trunk/app/widgets/gimpitemtreeview.c
==============================================================================
--- trunk/app/widgets/gimpitemtreeview.c (original)
+++ trunk/app/widgets/gimpitemtreeview.c Sun Nov 16 20:58:53 2008
@@ -298,8 +298,8 @@
item_view->model_column_visible,
NULL);
- tree_view->toggle_cells = g_list_prepend (tree_view->toggle_cells,
- item_view->eye_cell);
+ gimp_container_tree_view_prepend_toggle_cell_renderer (tree_view,
+ item_view->eye_cell);
g_signal_connect (item_view->eye_cell, "clicked",
G_CALLBACK (gimp_item_tree_view_eye_clicked),
@@ -315,8 +315,8 @@
item_view->model_column_linked,
NULL);
- tree_view->toggle_cells = g_list_prepend (tree_view->toggle_cells,
- item_view->chain_cell);
+ gimp_container_tree_view_prepend_toggle_cell_renderer (tree_view,
+ item_view->chain_cell);
g_signal_connect (item_view->chain_cell, "clicked",
G_CALLBACK (gimp_item_tree_view_chain_clicked),
Modified: trunk/app/widgets/gimplayertreeview.c
==============================================================================
--- trunk/app/widgets/gimplayertreeview.c (original)
+++ trunk/app/widgets/gimplayertreeview.c Sun Nov 16 20:58:53 2008
@@ -364,8 +364,8 @@
layer_view->model_column_mask_visible,
NULL);
- tree_view->renderer_cells = g_list_prepend (tree_view->renderer_cells,
- layer_view->mask_cell);
+ gimp_container_tree_view_prepend_cell_renderer (tree_view,
+ layer_view->mask_cell);
g_signal_connect (tree_view->renderer_cell, "clicked",
G_CALLBACK (gimp_layer_tree_view_layer_clicked),
Modified: trunk/app/widgets/gimptoolview.c
==============================================================================
--- trunk/app/widgets/gimptoolview.c (original)
+++ trunk/app/widgets/gimptoolview.c Sun Nov 16 20:58:53 2008
@@ -179,8 +179,8 @@
tree_view,
NULL);
- tree_view->toggle_cells = g_list_prepend (tree_view->toggle_cells,
- eye_cell);
+ gimp_container_tree_view_prepend_toggle_cell_renderer (tree_view,
+ eye_cell);
g_signal_connect (eye_cell, "clicked",
G_CALLBACK (gimp_tool_view_eye_clicked),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]