gimp r26008 - in trunk: . app/widgets
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26008 - in trunk: . app/widgets
- Date: Sat, 28 Jun 2008 15:50:28 +0000 (UTC)
Author: mitch
Date: Sat Jun 28 15:50:27 2008
New Revision: 26008
URL: http://svn.gnome.org/viewvc/gimp?rev=26008&view=rev
Log:
2008-06-28 Michael Natterer <mitch gimp org>
* app/widgets/gimpactionview.c
* app/widgets/gimpblobeditor.c
* app/widgets/gimpbrushfactoryview.c
* app/widgets/gimpbrushselect.c
* app/widgets/gimpcellrendererdashes.c
* app/widgets/gimpcellrendererviewable.c
* app/widgets/gimpcolorbar.c
* app/widgets/gimpcoloreditor.c
* app/widgets/gimpcolorframe.c
* app/widgets/gimpcomponenteditor.c
* app/widgets/gimpcontainerbox.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainerpopup.c
* app/widgets/gimpcontainertreeview.c
* app/widgets/gimpcurveview.c
* app/widgets/gimpdasheditor.c
* app/widgets/gimpdatafactoryview.c
* app/widgets/gimpdock.c
* app/widgets/gimpdockable.c
* app/widgets/gimpdockseparator.c
* app/widgets/gimpfgbgeditor.c
* app/widgets/gimpfgbgview.c
* app/widgets/gimpgradienteditor.c
* app/widgets/gimphandlebar.c
* app/widgets/gimphistogrambox.c
* app/widgets/gimphistogramview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimpmenudock.c
* app/widgets/gimpmessagebox.c
* app/widgets/gimppaletteview.c
* app/widgets/gimpscalebutton.c
* app/widgets/gimpsessioninfo-book.c
* app/widgets/gimpsessioninfo-dock.c
* app/widgets/gimpsettingseditor.c
* app/widgets/gimpstrokeeditor.c
* app/widgets/gimptemplateeditor.c
* app/widgets/gimptemplateview.c
* app/widgets/gimpthumbbox.c
* app/widgets/gimptoolbox.c
* app/widgets/gimptooloptionseditor.c
* app/widgets/gimptoolview.c
* app/widgets/gimpuimanager.c
* app/widgets/gimpviewabledialog.c
* app/widgets/gimpviewrenderervectors.c
* app/widgets/gimpwidgets-utils.c: use accessors instead of
accessing members of GTK+ widgets directly.
Modified:
trunk/ChangeLog
trunk/app/widgets/gimpactionview.c
trunk/app/widgets/gimpblobeditor.c
trunk/app/widgets/gimpbrushfactoryview.c
trunk/app/widgets/gimpbrushselect.c
trunk/app/widgets/gimpcellrendererdashes.c
trunk/app/widgets/gimpcellrendererviewable.c
trunk/app/widgets/gimpcolorbar.c
trunk/app/widgets/gimpcoloreditor.c
trunk/app/widgets/gimpcolorframe.c
trunk/app/widgets/gimpcomponenteditor.c
trunk/app/widgets/gimpcontainerbox.c
trunk/app/widgets/gimpcontainergridview.c
trunk/app/widgets/gimpcontainerpopup.c
trunk/app/widgets/gimpcontainertreeview.c
trunk/app/widgets/gimpcurveview.c
trunk/app/widgets/gimpdasheditor.c
trunk/app/widgets/gimpdatafactoryview.c
trunk/app/widgets/gimpdock.c
trunk/app/widgets/gimpdockable.c
trunk/app/widgets/gimpdockseparator.c
trunk/app/widgets/gimpfgbgeditor.c
trunk/app/widgets/gimpfgbgview.c
trunk/app/widgets/gimpgradienteditor.c
trunk/app/widgets/gimphandlebar.c
trunk/app/widgets/gimphistogrambox.c
trunk/app/widgets/gimphistogramview.c
trunk/app/widgets/gimpitemtreeview.c
trunk/app/widgets/gimpmenudock.c
trunk/app/widgets/gimpmessagebox.c
trunk/app/widgets/gimppaletteview.c
trunk/app/widgets/gimpscalebutton.c
trunk/app/widgets/gimpsessioninfo-book.c
trunk/app/widgets/gimpsessioninfo-dock.c
trunk/app/widgets/gimpsettingseditor.c
trunk/app/widgets/gimpstrokeeditor.c
trunk/app/widgets/gimptemplateeditor.c
trunk/app/widgets/gimptemplateview.c
trunk/app/widgets/gimpthumbbox.c
trunk/app/widgets/gimptoolbox.c
trunk/app/widgets/gimptooloptionseditor.c
trunk/app/widgets/gimptoolview.c
trunk/app/widgets/gimpuimanager.c
trunk/app/widgets/gimpviewabledialog.c
trunk/app/widgets/gimpviewrenderervectors.c
trunk/app/widgets/gimpwidgets-utils.c
Modified: trunk/app/widgets/gimpactionview.c
==============================================================================
--- trunk/app/widgets/gimpactionview.c (original)
+++ trunk/app/widgets/gimpactionview.c Sat Jun 28 15:50:27 2008
@@ -341,8 +341,10 @@
gtk_tree_view_column_set_title (column, _("Shortcut"));
cell = gtk_cell_renderer_accel_new ();
- cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (cell)->editable = TRUE;
+ g_object_set (cell,
+ "mode", GTK_CELL_RENDERER_MODE_EDITABLE,
+ "editable", TRUE,
+ NULL);
gtk_tree_view_column_pack_start (column, cell, TRUE);
gtk_tree_view_column_set_attributes (column, cell,
"accel-key",
Modified: trunk/app/widgets/gimpblobeditor.c
==============================================================================
--- trunk/app/widgets/gimpblobeditor.c (original)
+++ trunk/app/widgets/gimpblobeditor.c Sat Jun 28 15:50:27 2008
@@ -188,6 +188,7 @@
GdkEventExpose *event)
{
GimpBlobEditor *editor = GIMP_BLOB_EDITOR (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
GdkRectangle rect;
gint r0;
@@ -208,10 +209,10 @@
cairo_rectangle (cr,
rect.x + 0.5, rect.y + 0.5, rect.width - 1, rect.width - 1);
- gdk_cairo_set_source_color (cr, &widget->style->light[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->light[widget->state]);
cairo_fill_preserve (cr);
- gdk_cairo_set_source_color (cr, &widget->style->dark[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->dark[widget->state]);
cairo_set_line_width (cr, 1);
cairo_stroke (cr);
@@ -319,6 +320,7 @@
gdouble radius)
{
GtkWidget *widget = GTK_WIDGET (editor);
+ GtkStyle *style = gtk_widget_get_style (widget);
Blob *blob;
BlobFunc function = blob_ellipse;
gint i;
@@ -373,6 +375,6 @@
g_free (blob);
- gdk_cairo_set_source_color (cr, &widget->style->fg[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
cairo_fill (cr);
}
Modified: trunk/app/widgets/gimpbrushfactoryview.c
==============================================================================
--- trunk/app/widgets/gimpbrushfactoryview.c (original)
+++ trunk/app/widgets/gimpbrushfactoryview.c Sat Jun 28 15:50:27 2008
@@ -155,7 +155,7 @@
/* eek */
gtk_box_pack_end (GTK_BOX (editor->view),
- factory_view->spacing_scale->parent,
+ gtk_widget_get_parent (factory_view->spacing_scale),
FALSE, FALSE, 0);
factory_view->spacing_changed_handler_id =
Modified: trunk/app/widgets/gimpbrushselect.c
==============================================================================
--- trunk/app/widgets/gimpbrushselect.c (original)
+++ trunk/app/widgets/gimpbrushselect.c Sat Jun 28 15:50:27 2008
@@ -168,7 +168,7 @@
gtk_widget_show (dialog->view);
/* Create the frame and the table for the options */
- table = GIMP_BRUSH_FACTORY_VIEW (dialog->view)->spacing_scale->parent;
+ table = gtk_widget_get_parent (GIMP_BRUSH_FACTORY_VIEW (dialog->view)->spacing_scale);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
Modified: trunk/app/widgets/gimpcellrendererdashes.c
==============================================================================
--- trunk/app/widgets/gimpcellrendererdashes.c (original)
+++ trunk/app/widgets/gimpcellrendererdashes.c Sat Jun 28 15:50:27 2008
@@ -191,6 +191,7 @@
GtkCellRendererState flags)
{
GimpCellRendererDashes *dashes = GIMP_CELL_RENDERER_DASHES (cell);
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkStateType state;
cairo_t *cr;
gint width;
@@ -240,7 +241,7 @@
}
}
- gdk_cairo_set_source_color (cr, &widget->style->text[state]);
+ gdk_cairo_set_source_color (cr, &style->text[state]);
cairo_fill (cr);
cairo_destroy (cr);
Modified: trunk/app/widgets/gimpcellrendererviewable.c
==============================================================================
--- trunk/app/widgets/gimpcellrendererviewable.c (original)
+++ trunk/app/widgets/gimpcellrendererviewable.c Sat Jun 28 15:50:27 2008
@@ -123,7 +123,9 @@
static void
gimp_cell_renderer_viewable_init (GimpCellRendererViewable *cellviewable)
{
- GTK_CELL_RENDERER (cellviewable)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
+ g_object_set (cellviewable,
+ "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ NULL);
}
static void
Modified: trunk/app/widgets/gimpcolorbar.c
==============================================================================
--- trunk/app/widgets/gimpcolorbar.c (original)
+++ trunk/app/widgets/gimpcolorbar.c Sat Jun 28 15:50:27 2008
@@ -154,15 +154,15 @@
gimp_color_bar_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- GimpColorBar *bar = GIMP_COLOR_BAR (widget);
+ GimpColorBar *bar = GIMP_COLOR_BAR (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
guchar *buf;
guchar *b;
gint x, y;
gint width, height;
gint i, j;
- x = GTK_CONTAINER (bar)->border_width;
- y = GTK_CONTAINER (bar)->border_width;
+ x = y = gtk_container_get_border_width (GTK_CONTAINER (bar));
width = widget->allocation.width - 2 * x;
height = widget->allocation.height - 2 * y;
@@ -205,7 +205,7 @@
break;
}
- gdk_draw_rgb_image (widget->window, widget->style->black_gc,
+ gdk_draw_rgb_image (widget->window, style->black_gc,
widget->allocation.x + x, widget->allocation.y + y,
width, height,
GDK_RGB_DITHER_NORMAL,
Modified: trunk/app/widgets/gimpcoloreditor.c
==============================================================================
--- trunk/app/widgets/gimpcoloreditor.c (original)
+++ trunk/app/widgets/gimpcoloreditor.c Sat Jun 28 15:50:27 2008
@@ -582,7 +582,7 @@
gimp_color_editor_tab_toggled (GtkWidget *widget,
GimpColorEditor *editor)
{
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
GtkWidget *selector;
Modified: trunk/app/widgets/gimpcolorframe.c
==============================================================================
--- trunk/app/widgets/gimpcolorframe.c (original)
+++ trunk/app/widgets/gimpcolorframe.c Sat Jun 28 15:50:27 2008
@@ -271,13 +271,14 @@
if (frame->has_number)
{
- cairo_t *cr;
- gchar buf[8];
- gint w, h;
- gdouble scale;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ cairo_t *cr;
+ gchar buf[8];
+ gint w, h;
+ gdouble scale;
cr = gdk_cairo_create (widget->window);
- gdk_cairo_set_source_color (cr, &widget->style->light[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->light[GTK_STATE_NORMAL]);
g_snprintf (buf, sizeof (buf), "%d", frame->number);
Modified: trunk/app/widgets/gimpcomponenteditor.c
==============================================================================
--- trunk/app/widgets/gimpcomponenteditor.c (original)
+++ trunk/app/widgets/gimpcomponenteditor.c Sat Jun 28 15:50:27 2008
@@ -286,6 +286,7 @@
gint view_size)
{
GtkWidget *tree_widget;
+ GtkStyle *tree_style;
GtkIconSize icon_size;
GtkTreeIter iter;
gboolean iter_valid;
@@ -295,14 +296,15 @@
view_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
tree_widget = GTK_WIDGET (editor->view);
+ tree_style = gtk_widget_get_style (tree_widget);
icon_size = gimp_get_icon_size (tree_widget,
GIMP_STOCK_VISIBLE,
GTK_ICON_SIZE_BUTTON,
view_size -
- 2 * tree_widget->style->xthickness,
+ 2 * tree_style->xthickness,
view_size -
- 2 * tree_widget->style->ythickness);
+ 2 * tree_style->ythickness);
g_object_set (editor->eye_cell,
"stock-size", icon_size,
Modified: trunk/app/widgets/gimpcontainerbox.c
==============================================================================
--- trunk/app/widgets/gimpcontainerbox.c (original)
+++ trunk/app/widgets/gimpcontainerbox.c Sat Jun 28 15:50:27 2008
@@ -106,6 +106,7 @@
{
GimpContainerView *view;
GtkScrolledWindowClass *sw_class;
+ GtkStyle *sw_style;
GtkRequisition req;
gint view_size;
gint scrollbar_width;
@@ -134,11 +135,12 @@
&req);
scrollbar_width += req.width;
- border_x = GTK_CONTAINER (box)->border_width;
- border_y = GTK_CONTAINER (box)->border_width;
+ border_x = border_y = gtk_container_get_border_width (GTK_CONTAINER (box));
- border_x += box->scrolled_win->style->xthickness * 2 + scrollbar_width;
- border_y += box->scrolled_win->style->ythickness * 2;
+ sw_style = gtk_widget_get_style (box->scrolled_win);
+
+ border_x += sw_style->xthickness * 2 + scrollbar_width;
+ border_y += sw_style->ythickness * 2;
gtk_widget_set_size_request (box->scrolled_win,
width > 0 ? width + border_x : -1,
Modified: trunk/app/widgets/gimpcontainergridview.c
==============================================================================
--- trunk/app/widgets/gimpcontainergridview.c (original)
+++ trunk/app/widgets/gimpcontainergridview.c Sat Jun 28 15:50:27 2008
@@ -179,6 +179,7 @@
gimp_container_grid_view_init (GimpContainerGridView *grid_view)
{
GimpContainerBox *box = GIMP_CONTAINER_BOX (grid_view);
+ GtkWidget *viewport;
grid_view->rows = 1;
grid_view->columns = 1;
@@ -195,14 +196,14 @@
grid_view->wrap_box = gtk_hwrap_box_new (FALSE);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (box->scrolled_win),
grid_view->wrap_box);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (grid_view->wrap_box->parent),
- GTK_SHADOW_NONE);
+ viewport = gtk_widget_get_parent (grid_view->wrap_box);
+ gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
gtk_widget_show (grid_view->wrap_box);
- g_signal_connect (grid_view->wrap_box->parent, "size-allocate",
+ g_signal_connect (viewport, "size-allocate",
G_CALLBACK (gimp_container_grid_view_viewport_resized),
grid_view);
- g_signal_connect (grid_view->wrap_box->parent, "button-press-event",
+ g_signal_connect (viewport, "button-press-event",
G_CALLBACK (gimp_container_grid_view_button_press),
grid_view);
@@ -374,8 +375,10 @@
}
else
{
- *x += widget->style->xthickness;
- *y += widget->style->ythickness;
+ GtkStyle *style = gtk_widget_get_style (widget);
+
+ *x += style->xthickness;
+ *y += style->ythickness;
}
gimp_menu_position (menu, x, y);
Modified: trunk/app/widgets/gimpcontainerpopup.c
==============================================================================
--- trunk/app/widgets/gimpcontainerpopup.c (original)
+++ trunk/app/widgets/gimpcontainerpopup.c Sat Jun 28 15:50:27 2008
@@ -588,7 +588,7 @@
gimp_container_popup_view_type_toggled (GtkWidget *button,
GimpContainerPopup *popup)
{
- if (GTK_TOGGLE_BUTTON (button)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
{
GimpViewType view_type;
Modified: trunk/app/widgets/gimpcontainertreeview.c
==============================================================================
--- trunk/app/widgets/gimpcontainertreeview.c (original)
+++ trunk/app/widgets/gimpcontainertreeview.c Sat Jun 28 15:50:27 2008
@@ -350,8 +350,10 @@
}
else
{
- *x += widget->style->xthickness;
- *y += widget->style->ythickness;
+ GtkStyle *style = gtk_widget_get_style (widget);
+
+ *x += style->xthickness;
+ *y += style->ythickness;
}
gimp_menu_position (menu, x, y);
@@ -761,13 +763,15 @@
if (stock_id)
{
+ GtkStyle *style = gtk_widget_get_style (tree_widget);
+
icon_size = gimp_get_icon_size (tree_widget,
stock_id,
GTK_ICON_SIZE_BUTTON,
view_size -
- 2 * tree_widget->style->xthickness,
+ 2 * style->xthickness,
view_size -
- 2 * tree_widget->style->ythickness);
+ 2 * style->ythickness);
g_object_set (list->data, "stock-size", icon_size, NULL);
Modified: trunk/app/widgets/gimpcurveview.c
==============================================================================
--- trunk/app/widgets/gimpcurveview.c (original)
+++ trunk/app/widgets/gimpcurveview.c Sat Jun 28 15:50:27 2008
@@ -339,7 +339,7 @@
GdkEventExpose *event)
{
GimpCurveView *view = GIMP_CURVE_VIEW (widget);
- GtkStyle *style = widget->style;
+ GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
gint border;
gint width;
Modified: trunk/app/widgets/gimpdasheditor.c
==============================================================================
--- trunk/app/widgets/gimpdasheditor.c (original)
+++ trunk/app/widgets/gimpdasheditor.c Sat Jun 28 15:50:27 2008
@@ -238,6 +238,7 @@
GdkEventExpose *event)
{
GimpDashEditor *editor = GIMP_DASH_EDITOR (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr = gdk_cairo_create (widget->window);
gint x;
gint w, h;
@@ -249,7 +250,7 @@
/* draw the background */
- gdk_cairo_set_source_color (cr, &widget->style->base[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_NORMAL]);
cairo_paint (cr);
w = editor->block_width;
@@ -273,7 +274,7 @@
cairo_rectangle (cr, x, editor->y0, w, h);
}
- gdk_cairo_set_source_color (cr, &widget->style->text_aa[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->text_aa[GTK_STATE_NORMAL]);
cairo_fill (cr);
for (; x < editor->x0 + editor->n_segments * w; x += w)
@@ -284,7 +285,7 @@
cairo_rectangle (cr, x, editor->y0, w, h);
}
- gdk_cairo_set_source_color (cr, &widget->style->text[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
cairo_fill (cr);
for (; x < widget->allocation.width + w; x += w)
@@ -295,7 +296,7 @@
cairo_rectangle (cr, x, editor->y0, w, h);
}
- gdk_cairo_set_source_color (cr, &widget->style->text_aa[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->text_aa[GTK_STATE_NORMAL]);
cairo_fill (cr);
/* draw rulers */
@@ -330,7 +331,7 @@
cairo_move_to (cr, editor->x0 - 0.5, editor->y0 - 1);
cairo_move_to (cr, editor->x0 - 0.5, editor->y0 + h);
- gdk_cairo_set_source_color (cr, &widget->style->text_aa[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->text_aa[GTK_STATE_NORMAL]);
cairo_set_line_width (cr, 1.0);
cairo_stroke (cr);
Modified: trunk/app/widgets/gimpdatafactoryview.c
==============================================================================
--- trunk/app/widgets/gimpdatafactoryview.c (original)
+++ trunk/app/widgets/gimpdatafactoryview.c Sat Jun 28 15:50:27 2008
@@ -158,8 +158,10 @@
tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
- tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
+ g_object_set (tree_view->name_cell,
+ "mode", GTK_CELL_RENDERER_MODE_EDITABLE,
+ "editable", TRUE,
+ NULL);
tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
tree_view->name_cell);
Modified: trunk/app/widgets/gimpdock.c
==============================================================================
--- trunk/app/widgets/gimpdock.c (original)
+++ trunk/app/widgets/gimpdock.c Sat Jun 28 15:50:27 2008
@@ -465,13 +465,13 @@
else
old_book = g_list_nth_data (dock->dockbooks, index - 1);
- parent = old_book->parent;
+ parent = gtk_widget_get_parent (old_book);
if ((old_length > 1) && (index > 0))
{
GtkWidget *grandparent;
- grandparent = parent->parent;
+ grandparent = gtk_widget_get_parent (parent);
old_book = parent;
parent = grandparent;
@@ -553,8 +553,8 @@
GtkWidget *parent;
GtkWidget *grandparent;
- parent = GTK_WIDGET (dockbook)->parent;
- grandparent = parent->parent;
+ parent = gtk_widget_get_parent (GTK_WIDGET (dockbook));
+ grandparent = gtk_widget_get_parent (parent);
if (index == 0)
other_book = gtk_paned_get_child2 (GTK_PANED (parent));
Modified: trunk/app/widgets/gimpdockable.c
==============================================================================
--- trunk/app/widgets/gimpdockable.c (original)
+++ trunk/app/widgets/gimpdockable.c Sat Jun 28 15:50:27 2008
@@ -312,9 +312,12 @@
GimpDockable *dockable = GIMP_DOCKABLE (widget);
GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
GtkRequisition child_requisition;
+ gint border_width;
- requisition->width = container->border_width * 2;
- requisition->height = container->border_width * 2;
+ border_width = gtk_container_get_border_width (container);
+
+ requisition->width = border_width * 2;
+ requisition->height = border_width * 2;
if (dockable->menu_button && GTK_WIDGET_VISIBLE (dockable->menu_button))
{
@@ -345,9 +348,12 @@
GtkRequisition button_requisition = { 0, };
GtkAllocation child_allocation;
+ gint border_width;
widget->allocation = *allocation;
+ border_width = gtk_container_get_border_width (container);
+
if (dockable->menu_button && GTK_WIDGET_VISIBLE (dockable->menu_button))
{
gtk_widget_size_request (dockable->menu_button, &button_requisition);
@@ -355,12 +361,12 @@
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
child_allocation.x = (allocation->x +
allocation->width -
- container->border_width -
+ border_width -
button_requisition.width);
else
- child_allocation.x = allocation->x + container->border_width;
+ child_allocation.x = allocation->x + border_width;
- child_allocation.y = allocation->y + container->border_width;
+ child_allocation.y = allocation->y + border_width;
child_allocation.width = button_requisition.width;
child_allocation.height = button_requisition.height;
@@ -369,13 +375,13 @@
if (child && GTK_WIDGET_VISIBLE (child))
{
- child_allocation.x = allocation->x + container->border_width;
- child_allocation.y = allocation->y + container->border_width;
+ child_allocation.x = allocation->x + border_width;
+ child_allocation.y = allocation->y + border_width;
child_allocation.width = MAX (allocation->width -
- container->border_width * 2,
+ border_width * 2,
0);
child_allocation.height = MAX (allocation->height -
- container->border_width * 2 -
+ border_width * 2 -
button_requisition.height,
0);
@@ -541,6 +547,7 @@
if (GTK_WIDGET_DRAWABLE (widget))
{
GimpDockable *dockable = GIMP_DOCKABLE (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
GdkRectangle title_area;
GdkRectangle expose_area;
@@ -555,7 +562,7 @@
if (dockable->blink_counter & 1)
{
- gtk_paint_box (widget->style, widget->window,
+ gtk_paint_box (style, widget->window,
GTK_STATE_SELECTED, GTK_SHADOW_NONE,
&expose_area, widget, "",
title_area.x, title_area.y,
@@ -583,7 +590,7 @@
text_y = title_area.y + (title_area.height - layout_height) / 2;
- gtk_paint_layout (widget->style, widget->window,
+ gtk_paint_layout (style, widget->window,
(dockable->blink_counter & 1) ?
GTK_STATE_SELECTED : widget->state, TRUE,
&expose_area, widget, NULL,
@@ -1062,7 +1069,7 @@
GdkRectangle *area)
{
GtkWidget *widget = GTK_WIDGET (dockable);
- gint border = GTK_CONTAINER (dockable)->border_width;
+ gint border = gtk_container_get_border_width (GTK_CONTAINER (dockable));
area->x = widget->allocation.x + border;
area->y = widget->allocation.y + border;
Modified: trunk/app/widgets/gimpdockseparator.c
==============================================================================
--- trunk/app/widgets/gimpdockseparator.c (original)
+++ trunk/app/widgets/gimpdockseparator.c Sat Jun 28 15:50:27 2008
@@ -196,13 +196,16 @@
if (dockable)
{
GtkWidget *dockbook;
+ GtkWidget *parent;
GList *children;
gint index;
g_object_set_data (G_OBJECT (dockable),
"gimp-dock-drag-widget", NULL);
- children = gtk_container_get_children (GTK_CONTAINER (widget->parent));
+ parent = gtk_widget_get_parent (widget);
+
+ children = gtk_container_get_children (GTK_CONTAINER (parent));
index = g_list_index (children, widget);
g_list_free (children);
Modified: trunk/app/widgets/gimpfgbgeditor.c
==============================================================================
--- trunk/app/widgets/gimpfgbgeditor.c (original)
+++ trunk/app/widgets/gimpfgbgeditor.c Sat Jun 28 15:50:27 2008
@@ -286,6 +286,7 @@
GdkEventExpose *eevent)
{
GimpFgBgEditor *editor = GIMP_FG_BG_EDITOR (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
gint width, height;
gint default_w, default_h;
gint swap_w, swap_h;
@@ -348,14 +349,14 @@
gimp_context_get_background (editor->context, &color);
gimp_fg_bg_editor_draw_rect (editor,
widget->window,
- widget->style->fg_gc[0],
+ style->fg_gc[0],
(width - rect_w),
(height - rect_h),
rect_w, rect_h,
&color);
}
- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
editor->active_color == GIMP_ACTIVE_COLOR_FOREGROUND ?
GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, widget, NULL,
@@ -371,13 +372,13 @@
gimp_context_get_foreground (editor->context, &color);
gimp_fg_bg_editor_draw_rect (editor,
widget->window,
- widget->style->fg_gc[0],
+ style->fg_gc[0],
0, 0,
rect_w, rect_h,
&color);
}
- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
editor->active_color == GIMP_ACTIVE_COLOR_BACKGROUND ?
GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, widget, NULL,
Modified: trunk/app/widgets/gimpfgbgview.c
==============================================================================
--- trunk/app/widgets/gimpfgbgview.c (original)
+++ trunk/app/widgets/gimpfgbgview.c Sat Jun 28 15:50:27 2008
@@ -206,7 +206,8 @@
gimp_fg_bg_view_expose (GtkWidget *widget,
GdkEventExpose *eevent)
{
- GimpFgBgView *view = GIMP_FG_BG_VIEW (widget);
+ GimpFgBgView *view = GIMP_FG_BG_VIEW (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
gint x, y;
gint width, height;
gint rect_w, rect_h;
@@ -230,14 +231,14 @@
gimp_context_get_background (view->context, &color);
gimp_fg_bg_view_draw_rect (view,
widget->window,
- widget->style->fg_gc[0],
+ style->fg_gc[0],
x + width - rect_w + 1,
y + height - rect_h + 1,
rect_w - 2, rect_h - 2,
&color);
}
- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
GTK_SHADOW_IN,
NULL, widget, NULL,
x + width - rect_w, y + height - rect_h, rect_w, rect_h);
@@ -249,13 +250,13 @@
gimp_context_get_foreground (view->context, &color);
gimp_fg_bg_view_draw_rect (view,
widget->window,
- widget->style->fg_gc[0],
+ style->fg_gc[0],
x + 1, y + 1,
rect_w - 2, rect_h - 2,
&color);
}
- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+ gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
NULL, widget, NULL,
x, y, rect_w, rect_h);
Modified: trunk/app/widgets/gimpgradienteditor.c
==============================================================================
--- trunk/app/widgets/gimpgradienteditor.c (original)
+++ trunk/app/widgets/gimpgradienteditor.c Sat Jun 28 15:50:27 2008
@@ -798,7 +798,7 @@
gradient_editor_instant_update_update (GtkWidget *widget,
GimpGradientEditor *editor)
{
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
editor->instant_update = TRUE;
gtk_range_set_update_policy (GTK_RANGE (editor->scrollbar),
@@ -1746,6 +1746,7 @@
gdouble left,
gdouble right)
{
+ GtkStyle *control_style;
GimpGradientSegment *seg;
GradientEditorDragMode handle;
gint sel_l;
@@ -1758,16 +1759,18 @@
/* Draw selection */
+ control_style = gtk_widget_get_style (editor->control);
+
sel_l = control_calc_p_pos (editor, editor->control_sel_l->left);
sel_r = control_calc_p_pos (editor, editor->control_sel_r->right);
gdk_cairo_set_source_color (cr,
- &editor->control->style->base[GTK_STATE_NORMAL]);
+ &control_style->base[GTK_STATE_NORMAL]);
cairo_rectangle (cr, 0, 0, width, height);
cairo_fill (cr);
gdk_cairo_set_source_color (cr,
- &editor->control->style->base[GTK_STATE_SELECTED]);
+ &control_style->base[GTK_STATE_SELECTED]);
cairo_rectangle (cr, sel_l, 0, sel_r - sel_l + 1, height);
cairo_fill (cr);
@@ -1835,11 +1838,12 @@
gint height,
gboolean selected)
{
- GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
+ GtkStyle *style = gtk_widget_get_style (editor->control);
+ GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
control_draw_handle (cr,
- &editor->control->style->text_aa[state],
- &editor->control->style->black,
+ &style->text_aa[state],
+ &style->black,
control_calc_p_pos (editor, pos), height);
}
@@ -1850,11 +1854,12 @@
gint height,
gboolean selected)
{
- GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
+ GtkStyle *style = gtk_widget_get_style (editor->control);
+ GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
control_draw_handle (cr,
- &editor->control->style->text_aa[state],
- &editor->control->style->white,
+ &style->text_aa[state],
+ &style->white,
control_calc_p_pos (editor, pos), height);
}
Modified: trunk/app/widgets/gimphandlebar.c
==============================================================================
--- trunk/app/widgets/gimphandlebar.c (original)
+++ trunk/app/widgets/gimphandlebar.c Sat Jun 28 15:50:27 2008
@@ -151,8 +151,7 @@
gint width, height;
gint i;
- x = GTK_CONTAINER (widget)->border_width;
- y = GTK_CONTAINER (widget)->border_width;
+ x = y = gtk_container_get_border_width (GTK_CONTAINER (widget));
width = widget->allocation.width - 2 * x;
height = widget->allocation.height - 2 * y;
@@ -214,7 +213,7 @@
GdkEventButton *bevent)
{
GimpHandleBar *bar = GIMP_HANDLE_BAR (widget);
- gint border = GTK_CONTAINER (widget)->border_width;
+ gint border = gtk_container_get_border_width (GTK_CONTAINER (widget));
gint width = widget->allocation.width - 2 * border;
gdouble value;
gint min_dist;
@@ -258,7 +257,7 @@
GdkEventMotion *mevent)
{
GimpHandleBar *bar = GIMP_HANDLE_BAR (widget);
- gint border = GTK_CONTAINER (widget)->border_width;
+ gint border = gtk_container_get_border_width (GTK_CONTAINER (widget));
gint width = widget->allocation.width - 2 * border;
gdouble value;
Modified: trunk/app/widgets/gimphistogrambox.c
==============================================================================
--- trunk/app/widgets/gimphistogrambox.c (original)
+++ trunk/app/widgets/gimphistogrambox.c Sat Jun 28 15:50:27 2008
@@ -245,8 +245,9 @@
GParamSpec *pspec,
GimpHistogramBox *box)
{
- gtk_container_set_border_width (GTK_CONTAINER (box->color_bar->parent),
- view->border_width);
+ GtkWidget *vbox = gtk_widget_get_parent (box->color_bar);
+
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), view->border_width);
}
Modified: trunk/app/widgets/gimphistogramview.c
==============================================================================
--- trunk/app/widgets/gimphistogramview.c (original)
+++ trunk/app/widgets/gimphistogramview.c Sat Jun 28 15:50:27 2008
@@ -279,7 +279,8 @@
gimp_histogram_view_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- GimpHistogramView *view = GIMP_HISTOGRAM_VIEW (widget);
+ GimpHistogramView *view = GIMP_HISTOGRAM_VIEW (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
gint x;
gint x1, x2;
gint border;
@@ -304,14 +305,14 @@
x2 = CLAMP (MAX (view->start, view->end), 0, 255);
gdk_draw_rectangle (widget->window,
- widget->style->base_gc[GTK_STATE_NORMAL], TRUE,
+ style->base_gc[GTK_STATE_NORMAL], TRUE,
0, 0,
widget->allocation.width,
widget->allocation.height);
/* Draw the outer border */
gdk_draw_rectangle (widget->window,
- widget->style->dark_gc[GTK_STATE_NORMAL], FALSE,
+ style->dark_gc[GTK_STATE_NORMAL], FALSE,
border, border,
width - 1, height - 1);
@@ -323,11 +324,11 @@
bg_max = gimp_histogram_view_get_maximum (view, view->bg_histogram,
view->channel);
- gc_in = widget->style->text_gc[GTK_STATE_SELECTED];
- gc_out = widget->style->text_gc[GTK_STATE_NORMAL];
+ gc_in = style->text_gc[GTK_STATE_SELECTED];
+ gc_out = style->text_gc[GTK_STATE_NORMAL];
- bg_gc_in = widget->style->mid_gc[GTK_STATE_SELECTED];
- bg_gc_out = widget->style->mid_gc[GTK_STATE_NORMAL];
+ bg_gc_in = style->mid_gc[GTK_STATE_SELECTED];
+ bg_gc_out = style->mid_gc[GTK_STATE_NORMAL];
if (view->channel == GIMP_HISTOGRAM_RGB)
{
@@ -369,7 +370,7 @@
if (view->subdivisions > 1 && x >= (xstop * width / view->subdivisions))
{
gdk_draw_line (widget->window,
- widget->style->dark_gc[GTK_STATE_NORMAL],
+ style->dark_gc[GTK_STATE_NORMAL],
x + border, border,
x + border, border + height - 1);
xstop++;
@@ -377,7 +378,7 @@
else if (in_selection)
{
gdk_draw_line (widget->window,
- widget->style->base_gc[GTK_STATE_SELECTED],
+ style->base_gc[GTK_STATE_SELECTED],
x + border, border,
x + border, border + height - 1);
}
@@ -388,7 +389,7 @@
for (c = 0; c < 3; c++)
gimp_histogram_view_draw_spike (view, GIMP_HISTOGRAM_RED + c,
- widget->style->black_gc,
+ style->black_gc,
NULL,
x, i, j, max, bg_max, height, border);
Modified: trunk/app/widgets/gimpitemtreeview.c
==============================================================================
--- trunk/app/widgets/gimpitemtreeview.c (original)
+++ trunk/app/widgets/gimpitemtreeview.c Sat Jun 28 15:50:27 2008
@@ -283,8 +283,10 @@
item_view = GIMP_ITEM_TREE_VIEW (object);
item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (object);
- tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
+ g_object_set (tree_view->name_cell,
+ "mode", GTK_CELL_RENDERER_MODE_EDITABLE,
+ "editable", TRUE,
+ NULL);
tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
tree_view->name_cell);
Modified: trunk/app/widgets/gimpmenudock.c
==============================================================================
--- trunk/app/widgets/gimpmenudock.c (original)
+++ trunk/app/widgets/gimpmenudock.c Sat Jun 28 15:50:27 2008
@@ -201,12 +201,13 @@
/* remove the image menu and the auto button manually here because
* of weird cross-connections with GimpDock's context
*/
- if (GIMP_DOCK (dock)->main_vbox &&
- dock->image_combo &&
- dock->image_combo->parent)
+ if (GIMP_DOCK (dock)->main_vbox && dock->image_combo)
{
- gtk_container_remove (GTK_CONTAINER (GIMP_DOCK (dock)->main_vbox),
- dock->image_combo->parent);
+ GtkWidget *parent = gtk_widget_get_parent (dock->image_combo);
+
+ if (parent)
+ gtk_container_remove (GTK_CONTAINER (GIMP_DOCK (dock)->main_vbox),
+ parent);
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
@@ -217,6 +218,7 @@
GtkStyle *prev_style)
{
GimpMenuDock *menu_dock = GIMP_MENU_DOCK (widget);
+ GtkStyle *button_style;
gint minimal_width;
GtkIconSize menu_view_size;
GtkSettings *settings;
@@ -244,7 +246,8 @@
"focus-padding", &focus_padding,
NULL);
- ythickness = menu_dock->auto_button->style->ythickness;
+ button_style = gtk_widget_get_style (widget);
+ ythickness = button_style->ythickness;
gtk_widget_set_size_request (widget, minimal_width, -1);
@@ -452,12 +455,16 @@
gimp_menu_dock_set_show_image_menu (GimpMenuDock *menu_dock,
gboolean show)
{
+ GtkWidget *parent;
+
g_return_if_fail (GIMP_IS_MENU_DOCK (menu_dock));
+ parent = gtk_widget_get_parent (menu_dock->image_combo);
+
if (show)
- gtk_widget_show (menu_dock->image_combo->parent);
+ gtk_widget_show (parent);
else
- gtk_widget_hide (menu_dock->image_combo->parent);
+ gtk_widget_hide (parent);
menu_dock->show_image_menu = show ? TRUE : FALSE;
}
Modified: trunk/app/widgets/gimpmessagebox.c
==============================================================================
--- trunk/app/widgets/gimpmessagebox.c (original)
+++ trunk/app/widgets/gimpmessagebox.c Sat Jun 28 15:50:27 2008
@@ -243,13 +243,16 @@
if (box->image && GTK_WIDGET_VISIBLE (box->image))
{
GtkRequisition child_requisition;
+ gint border_width;
gtk_widget_size_request (box->image, &child_requisition);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+
requisition->width += child_requisition.width + GIMP_MESSAGE_BOX_SPACING;
requisition->height = MAX (requisition->height,
child_requisition.height +
- 2 * GTK_CONTAINER (widget)->border_width);
+ 2 * border_width);
}
}
@@ -268,25 +271,28 @@
{
GtkRequisition child_requisition;
GtkAllocation child_allocation;
+ gint border_width;
gint height;
gtk_widget_size_request (box->image, &child_requisition);
- width = MIN (allocation->width - 2 * container->border_width,
+ border_width = gtk_container_get_border_width (container);
+
+ width = MIN (allocation->width - 2 * border_width,
child_requisition.width + GIMP_MESSAGE_BOX_SPACING);
width = MAX (1, width);
- height = allocation->height - 2 * container->border_width;
+ height = allocation->height - 2 * border_width;
height = MAX (1, height);
if (rtl)
- child_allocation.x = (allocation->width -
- container->border_width -
+ child_allocation.x = (allocation->width -
+ border_width -
child_requisition.width);
else
- child_allocation.x = allocation->x + container->border_width;
+ child_allocation.x = allocation->x + border_width;
- child_allocation.y = allocation->y + container->border_width;
+ child_allocation.y = allocation->y + border_width;
child_allocation.width = width;
child_allocation.height = height;
Modified: trunk/app/widgets/gimppaletteview.c
==============================================================================
--- trunk/app/widgets/gimppaletteview.c (original)
+++ trunk/app/widgets/gimppaletteview.c Sat Jun 28 15:50:27 2008
@@ -174,6 +174,7 @@
if (view->renderer->viewable && pal_view->selected)
{
GimpViewRendererPalette *renderer;
+ GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
gint row, col;
@@ -193,12 +194,12 @@
renderer->cell_height);
cairo_set_line_width (cr, 1.0);
- gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_SELECTED]);
+ gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_SELECTED]);
cairo_stroke_preserve (cr);
if (gimp_cairo_set_focus_line_pattern (cr, widget))
{
- gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
cairo_stroke (cr);
}
Modified: trunk/app/widgets/gimpscalebutton.c
==============================================================================
--- trunk/app/widgets/gimpscalebutton.c (original)
+++ trunk/app/widgets/gimpscalebutton.c Sat Jun 28 15:50:27 2008
@@ -105,6 +105,7 @@
GdkEventExpose *event,
GimpScaleButton *button)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkAdjustment *adj;
cairo_t *cr;
gint value;
@@ -149,7 +150,7 @@
cairo_line_to (cr, i, i + 0.5);
}
- gdk_cairo_set_source_color (cr, &widget->style->fg[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
cairo_stroke (cr);
for ( ; i < steps; i++)
@@ -158,7 +159,7 @@
cairo_line_to (cr, i, i + 0.5);
}
- gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_INSENSITIVE]);
+ gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_INSENSITIVE]);
cairo_stroke (cr);
cairo_destroy (cr);
Modified: trunk/app/widgets/gimpsessioninfo-book.c
==============================================================================
--- trunk/app/widgets/gimpsessioninfo-book.c (original)
+++ trunk/app/widgets/gimpsessioninfo-book.c Sat Jun 28 15:50:27 2008
@@ -194,6 +194,7 @@
gimp_session_info_book_from_widget (GimpDockbook *dockbook)
{
GimpSessionInfoBook *info;
+ GtkWidget *parent;
GList *children;
GList *list;
@@ -201,9 +202,11 @@
info = gimp_session_info_book_new ();
- if (GTK_IS_VPANED (GTK_WIDGET (dockbook)->parent))
+ parent = gtk_widget_get_parent (GTK_WIDGET (dockbook));
+
+ if (GTK_IS_VPANED (parent))
{
- GtkPaned *paned = GTK_PANED (GTK_WIDGET (dockbook)->parent);
+ GtkPaned *paned = GTK_PANED (parent);
if (GTK_WIDGET (dockbook) == gtk_paned_get_child2 (paned))
info->position = gtk_paned_get_position (paned);
Modified: trunk/app/widgets/gimpsessioninfo-dock.c
==============================================================================
--- trunk/app/widgets/gimpsessioninfo-dock.c (original)
+++ trunk/app/widgets/gimpsessioninfo-dock.c Sat Jun 28 15:50:27 2008
@@ -191,12 +191,15 @@
{
GimpSessionInfoBook *book_info = books->data;
GtkWidget *dockbook;
+ GtkWidget *parent;
dockbook = GTK_WIDGET (gimp_session_info_book_restore (book_info, dock));
- if (GTK_IS_VPANED (dockbook->parent))
+ parent = gtk_widget_get_parent (dockbook);
+
+ if (GTK_IS_VPANED (parent))
{
- GtkPaned *paned = GTK_PANED (dockbook->parent);
+ GtkPaned *paned = GTK_PANED (parent);
if (dockbook == gtk_paned_get_child2 (paned))
g_signal_connect_after (paned, "map",
Modified: trunk/app/widgets/gimpsettingseditor.c
==============================================================================
--- trunk/app/widgets/gimpsettingseditor.c (original)
+++ trunk/app/widgets/gimpsettingseditor.c Sat Jun 28 15:50:27 2008
@@ -164,8 +164,10 @@
G_CALLBACK (gimp_settings_editor_select_item),
editor);
- tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
+ g_object_set (tree_view->name_cell,
+ "mode", GTK_CELL_RENDERER_MODE_EDITABLE,
+ "editable", TRUE,
+ NULL);
tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
tree_view->name_cell);
Modified: trunk/app/widgets/gimpstrokeeditor.c
==============================================================================
--- trunk/app/widgets/gimpstrokeeditor.c (original)
+++ trunk/app/widgets/gimpstrokeeditor.c Sat Jun 28 15:50:27 2008
@@ -360,10 +360,11 @@
GdkEventExpose *event,
gpointer data)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkAllocation *alloc = &widget->allocation;
gint w = MIN (alloc->width, alloc->height) * 2 / 3;
- gtk_paint_arrow (widget->style, widget->window,
+ gtk_paint_arrow (style, widget->window,
widget->state, GTK_SHADOW_IN,
&event->area, widget, NULL,
data ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, TRUE,
Modified: trunk/app/widgets/gimptemplateeditor.c
==============================================================================
--- trunk/app/widgets/gimptemplateeditor.c (original)
+++ trunk/app/widgets/gimptemplateeditor.c Sat Jun 28 15:50:27 2008
@@ -572,7 +572,8 @@
gimp_template_editor_aspect_callback (GtkWidget *widget,
GimpTemplateEditor *editor)
{
- if (! editor->block_aspect && GTK_TOGGLE_BUTTON (widget)->active)
+ if (! editor->block_aspect &&
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
GimpTemplate *template = editor->template;
gint width = template->width;
Modified: trunk/app/widgets/gimptemplateview.c
==============================================================================
--- trunk/app/widgets/gimptemplateview.c (original)
+++ trunk/app/widgets/gimptemplateview.c Sat Jun 28 15:50:27 2008
@@ -111,8 +111,10 @@
tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
- tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
+ g_object_set (tree_view->name_cell,
+ "mode", GTK_CELL_RENDERER_MODE_EDITABLE,
+ "editable", TRUE,
+ NULL);
tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
tree_view->name_cell);
Modified: trunk/app/widgets/gimpthumbbox.c
==============================================================================
--- trunk/app/widgets/gimpthumbbox.c (original)
+++ trunk/app/widgets/gimpthumbbox.c Sat Jun 28 15:50:27 2008
@@ -171,22 +171,23 @@
gimp_thumb_box_style_set (GtkWidget *widget,
GtkStyle *prev_style)
{
- GimpThumbBox *box = GIMP_THUMB_BOX (widget);
+ GimpThumbBox *box = GIMP_THUMB_BOX (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
GtkWidget *ebox;
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
gtk_widget_modify_bg (box->preview, GTK_STATE_NORMAL,
- &widget->style->base[GTK_STATE_NORMAL]);
+ &style->base[GTK_STATE_NORMAL]);
gtk_widget_modify_bg (box->preview, GTK_STATE_INSENSITIVE,
- &widget->style->base[GTK_STATE_NORMAL]);
+ &style->base[GTK_STATE_NORMAL]);
ebox = gtk_bin_get_child (GTK_BIN (widget));
gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL,
- &widget->style->base[GTK_STATE_NORMAL]);
+ &style->base[GTK_STATE_NORMAL]);
gtk_widget_modify_bg (ebox, GTK_STATE_INSENSITIVE,
- &widget->style->base[GTK_STATE_NORMAL]);
+ &style->base[GTK_STATE_NORMAL]);
}
static GimpProgress *
Modified: trunk/app/widgets/gimptoolbox.c
==============================================================================
--- trunk/app/widgets/gimptoolbox.c (original)
+++ trunk/app/widgets/gimptoolbox.c Sat Jun 28 15:50:27 2008
@@ -307,7 +307,8 @@
gimp_toolbox_dnd_init (GIMP_TOOLBOX (toolbox));
- gimp_toolbox_style_set (GTK_WIDGET (toolbox), GTK_WIDGET (toolbox)->style);
+ gimp_toolbox_style_set (GTK_WIDGET (toolbox),
+ gtk_widget_get_style (GTK_WIDGET (toolbox)));
toolbox_separator_expand (toolbox);
@@ -510,12 +511,13 @@
&toolbox->header->allocation,
&clip_rect))
{
- cairo_t *cr;
- gint header_height;
- gint header_width;
- gdouble wilber_width;
- gdouble wilber_height;
- gdouble factor;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ cairo_t *cr;
+ gint header_height;
+ gint header_width;
+ gdouble wilber_width;
+ gdouble wilber_height;
+ gdouble factor;
cr = gdk_cairo_create (widget->window);
gdk_cairo_rectangle (cr, &clip_rect);
@@ -535,9 +537,9 @@
(header_height / factor - wilber_height) / 2.0);
cairo_set_source_rgba (cr,
- widget->style->fg[widget->state].red / 65535.0,
- widget->style->fg[widget->state].green / 65535.0,
- widget->style->fg[widget->state].blue / 65535.0,
+ style->fg[widget->state].red / 65535.0,
+ style->fg[widget->state].green / 65535.0,
+ style->fg[widget->state].blue / 65535.0,
0.10);
cairo_fill (cr);
@@ -811,7 +813,8 @@
GParamSpec *pspec,
GtkWidget *area)
{
- gboolean visible;
+ GtkWidget *parent = gtk_widget_get_parent (area);
+ gboolean visible;
if (config->toolbox_color_area ||
config->toolbox_foo_area ||
@@ -819,18 +822,18 @@
{
GtkRequisition req;
- gtk_widget_show (area->parent);
+ gtk_widget_show (parent);
#ifdef __GNUC__
#warning FIXME: fix GtkWrapBox child requisition/allocation instead of hacking badly (bug #162500).
#endif
gtk_widget_size_request (area, &req);
- gtk_widget_set_size_request (area->parent, req.width, req.height);
+ gtk_widget_set_size_request (parent, req.width, req.height);
}
else
{
- gtk_widget_hide (area->parent);
- gtk_widget_set_size_request (area->parent, -1, -1);
+ gtk_widget_hide (parent);
+ gtk_widget_set_size_request (parent, -1, -1);
}
g_object_get (config, pspec->name, &visible, NULL);
@@ -847,7 +850,8 @@
GtkWidget *toolbox_button = g_object_get_data (G_OBJECT (tool_info),
TOOL_BUTTON_DATA_KEY);
- if (toolbox_button && ! GTK_TOGGLE_BUTTON (toolbox_button)->active)
+ if (toolbox_button &&
+ ! gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toolbox_button)))
{
g_signal_handlers_block_by_func (toolbox_button,
toolbox_tool_button_toggled,
@@ -895,7 +899,7 @@
{
GtkWidget *toolbox = gtk_widget_get_toplevel (widget);
- if (GTK_TOGGLE_BUTTON (widget)->active)
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
gimp_context_set_tool (GIMP_DOCK (toolbox)->context, tool_info);
}
Modified: trunk/app/widgets/gimptooloptionseditor.c
==============================================================================
--- trunk/app/widgets/gimptooloptionseditor.c (original)
+++ trunk/app/widgets/gimptooloptionseditor.c Sat Jun 28 15:50:27 2008
@@ -410,7 +410,7 @@
options_gui = g_object_get_data (G_OBJECT (tool_info->tool_options),
"gimp-tool-options-gui");
- if (! options_gui->parent)
+ if (! gtk_widget_get_parent (options_gui))
gtk_box_pack_start (GTK_BOX (editor->options_vbox), options_gui,
FALSE, FALSE, 0);
Modified: trunk/app/widgets/gimptoolview.c
==============================================================================
--- trunk/app/widgets/gimptoolview.c (original)
+++ trunk/app/widgets/gimptoolview.c Sat Jun 28 15:50:27 2008
@@ -152,8 +152,9 @@
if (view_type == GIMP_VIEW_TYPE_LIST)
{
- GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
+ GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
GtkWidget *tree_widget = GTK_WIDGET (tree_view);
+ GtkStyle *tree_style = gtk_widget_get_style (tree_widget);
GtkTreeViewColumn *column;
GtkCellRenderer *eye_cell;
GtkIconSize icon_size;
@@ -167,9 +168,9 @@
GIMP_STOCK_VISIBLE,
GTK_ICON_SIZE_BUTTON,
view_size -
- 2 * tree_widget->style->xthickness,
+ 2 * tree_style->xthickness,
view_size -
- 2 * tree_widget->style->ythickness);
+ 2 * tree_style->ythickness);
g_object_set (eye_cell, "stock-size", icon_size, NULL);
gtk_tree_view_column_pack_start (column, eye_cell, FALSE);
Modified: trunk/app/widgets/gimpuimanager.c
==============================================================================
--- trunk/app/widgets/gimpuimanager.c (original)
+++ trunk/app/widgets/gimpuimanager.c Sat Jun 28 15:50:27 2008
@@ -865,13 +865,16 @@
gimp_ui_manager_item_realize (GtkWidget *widget,
GimpUIManager *manager)
{
+ GtkWidget *menu;
GtkWidget *submenu;
g_signal_handlers_disconnect_by_func (widget,
gimp_ui_manager_item_realize,
manager);
- if (GTK_IS_MENU_SHELL (widget->parent))
+ menu = gtk_widget_get_parent (widget);
+
+ if (GTK_IS_MENU_SHELL (menu))
{
static GQuark quark_key_press_connected = 0;
@@ -879,14 +882,14 @@
quark_key_press_connected =
g_quark_from_static_string ("gimp-menu-item-key-press-connected");
- if (! GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (widget->parent),
+ if (! GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (menu),
quark_key_press_connected)))
{
- g_signal_connect (widget->parent, "key-press-event",
+ g_signal_connect (menu, "key-press-event",
G_CALLBACK (gimp_ui_manager_item_key_press),
manager);
- g_object_set_qdata (G_OBJECT (widget->parent),
+ g_object_set_qdata (G_OBJECT (menu),
quark_key_press_connected,
GINT_TO_POINTER (TRUE));
}
@@ -971,7 +974,7 @@
if (! menu_item)
break;
- widget = menu_item->parent;
+ widget = gtk_widget_get_parent (menu_item);
if (! widget)
break;
Modified: trunk/app/widgets/gimpviewabledialog.c
==============================================================================
--- trunk/app/widgets/gimpviewabledialog.c (original)
+++ trunk/app/widgets/gimpviewabledialog.c Sat Jun 28 15:50:27 2008
@@ -322,15 +322,18 @@
if (viewable)
{
+ GtkWidget *box;
+
g_signal_connect_object (viewable,
GIMP_VIEWABLE_GET_CLASS (viewable)->name_changed_signal,
G_CALLBACK (gimp_viewable_dialog_name_changed),
dialog,
0);
+ box = gtk_widget_get_parent (dialog->icon);
+
dialog->view = gimp_view_new (context, viewable, 32, 1, TRUE);
- gtk_box_pack_end (GTK_BOX (dialog->icon->parent), dialog->view,
- FALSE, FALSE, 2);
+ gtk_box_pack_end (GTK_BOX (box), dialog->view, FALSE, FALSE, 2);
gtk_widget_show (dialog->view);
g_object_add_weak_pointer (G_OBJECT (dialog->view),
Modified: trunk/app/widgets/gimpviewrenderervectors.c
==============================================================================
--- trunk/app/widgets/gimpviewrenderervectors.c (original)
+++ trunk/app/widgets/gimpviewrenderervectors.c Sat Jun 28 15:50:27 2008
@@ -69,13 +69,14 @@
cairo_t *cr,
const GdkRectangle *area)
{
+ GtkStyle *style = gtk_widget_get_style (widget);
GimpVectors *vectors = GIMP_VECTORS (renderer->viewable);
GimpBezierDesc *bezdesc;
gdouble xscale;
gdouble yscale;
gint x, y;
- gdk_cairo_set_source_color (cr, &widget->style->white);
+ gdk_cairo_set_source_color (cr, &style->white);
x = area->x + (area->width - renderer->width) / 2;
y = area->y + (area->height - renderer->height) / 2;
@@ -94,7 +95,7 @@
cairo_device_to_user_distance (cr, &xscale, &yscale);
cairo_set_line_width (cr, MAX (xscale, yscale));
- gdk_cairo_set_source_color (cr, &widget->style->black);
+ gdk_cairo_set_source_color (cr, &style->black);
bezdesc = gimp_vectors_make_bezier (vectors);
Modified: trunk/app/widgets/gimpwidgets-utils.c
==============================================================================
--- trunk/app/widgets/gimpwidgets-utils.c (original)
+++ trunk/app/widgets/gimpwidgets-utils.c Sat Jun 28 15:50:27 2008
@@ -277,6 +277,7 @@
gint indicator_spacing;
gint focus_width;
gint focus_padding;
+ gint border_width;
gtk_widget_style_get (radio,
"indicator-size", &indicator_size,
@@ -285,6 +286,8 @@
"focus-padding", &focus_padding,
NULL);
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (radio));
+
hbox = gtk_hbox_new (FALSE, 0);
spacer = gtk_vbox_new (FALSE, 0);
@@ -293,7 +296,7 @@
3 * indicator_spacing +
focus_width +
focus_padding +
- GTK_CONTAINER (radio)->border_width,
+ border_width,
-1);
gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
gtk_widget_show (spacer);
@@ -307,7 +310,7 @@
NULL);
gtk_widget_set_sensitive (hbox,
- GTK_TOGGLE_BUTTON (list->data)->active);
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (list->data)));
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_reorder_child (GTK_BOX (vbox), hbox, pos);
@@ -343,7 +346,8 @@
g_return_val_if_fail (width > 0, icon_size);
g_return_val_if_fail (height > 0, icon_size);
- icon_set = gtk_style_lookup_icon_set (widget->style, stock_id);
+ icon_set = gtk_style_lookup_icon_set (gtk_widget_get_style (widget),
+ stock_id);
if (! icon_set)
return GTK_ICON_SIZE_INVALID;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]