~ubuntu-branches/ubuntu/lucid/gtk+2.0/lucid-proposed

« back to all changes in this revision

Viewing changes to gtk/gtkiconview.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-03-11 18:28:01 UTC
  • mfrom: (1.11.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100311182801-wqr2drmus369zy6r
Tags: 2.19.7-0ubuntu1
* New upstream version
  - Bug fixes:
  611707 Move documentation from templates to inline comments
  69872 GTK_WIDGET_SET_FLAGS should be deprecated
  612066 empathy hangs when clicked on information about contact...
         (lp: #532947)
  557420 Some compose sequences don't work anymore...
  569042 gailbooleancell does not seem to attend to changes...
  600992 File chooser reference counting issues
  610905 gtk_drag_source_set need instrospection hint
  611051 Search Entry Clear Icon not accessible
  611217 Incorrect translator comment
  611317 Document targets in drag and drop
  611319 gtk_window_set_transient_for undocumented NULL value for parent
  611658 Update documentation for gtkvscrollbar
  611662 Update documentation for gtkvseparator
  611686 focus_in/focus_out in gailtreeview.c should return FALSE...
  611831 Move documentation to inline comments: GtkVBox
  612119 Do not scroll when middle pasting
  - Translation updates
* debian/patches/071_no_offscreen_widgets_grabbing.patch,
  debian/patches/091_bugzilla_tooltip_refresh.patch:
  - new version update
  - increased the alpha value for tooltips to 85%
* debian/rules:
  - updated the shlibs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1106
1106
  icon_view->priv->pixbuf_cell = -1;  
1107
1107
  icon_view->priv->tooltip_column = -1;  
1108
1108
 
1109
 
  GTK_WIDGET_SET_FLAGS (icon_view, GTK_CAN_FOCUS);
 
1109
  gtk_widget_set_can_focus (GTK_WIDGET (icon_view), TRUE);
1110
1110
  
1111
1111
  gtk_icon_view_set_adjustments (icon_view, NULL, NULL);
1112
1112
 
1318
1318
  
1319
1319
  icon_view = GTK_ICON_VIEW (widget);
1320
1320
 
1321
 
  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
 
1321
  gtk_widget_set_realized (widget, TRUE);
1322
1322
 
1323
1323
  /* Make the main, clipping window */
1324
1324
  attributes.window_type = GDK_WINDOW_CHILD;
1382
1382
{
1383
1383
  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
1384
1384
 
1385
 
  if (GTK_WIDGET_REALIZED (widget))
 
1385
  if (gtk_widget_get_realized (widget))
1386
1386
    {
1387
1387
      gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
1388
1388
      gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
1397
1397
{
1398
1398
  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
1399
1399
 
1400
 
  if (GTK_WIDGET_REALIZED (widget))
 
1400
  if (gtk_widget_get_realized (widget))
1401
1401
    {
1402
1402
      gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
1403
1403
      gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
1425
1425
 
1426
1426
      tmp_list = tmp_list->next;
1427
1427
 
1428
 
      if (GTK_WIDGET_VISIBLE (child->widget))
 
1428
      if (gtk_widget_get_visible (child->widget))
1429
1429
        gtk_widget_size_request (child->widget, &child_requisition);
1430
1430
    }  
1431
1431
}
1472
1472
 
1473
1473
  widget->allocation = *allocation;
1474
1474
  
1475
 
  if (GTK_WIDGET_REALIZED (widget))
 
1475
  if (gtk_widget_get_realized (widget))
1476
1476
    {
1477
1477
      gdk_window_move_resize (widget->window,
1478
1478
                              allocation->x, allocation->y,
1507
1507
  if (vadjustment->value > vadjustment->upper - vadjustment->page_size)
1508
1508
    gtk_adjustment_set_value (vadjustment, MAX (0, vadjustment->upper - vadjustment->page_size));
1509
1509
 
1510
 
  if (GTK_WIDGET_REALIZED (widget) &&
 
1510
  if (gtk_widget_get_realized (widget) &&
1511
1511
      icon_view->priv->scroll_to_path)
1512
1512
    {
1513
1513
      GtkTreePath *path;
1592
1592
        case GTK_ICON_VIEW_DROP_INTO:
1593
1593
          gtk_paint_focus (widget->style,
1594
1594
                           icon_view->priv->bin_window,
1595
 
                           GTK_WIDGET_STATE (widget),
 
1595
                           gtk_widget_get_state (widget),
1596
1596
                           NULL,
1597
1597
                           widget,
1598
1598
                           "iconview-drop-indicator",
1602
1602
        case GTK_ICON_VIEW_DROP_ABOVE:
1603
1603
          gtk_paint_focus (widget->style,
1604
1604
                           icon_view->priv->bin_window,
1605
 
                           GTK_WIDGET_STATE (widget),
 
1605
                           gtk_widget_get_state (widget),
1606
1606
                           NULL,
1607
1607
                           widget,
1608
1608
                           "iconview-drop-indicator",
1612
1612
        case GTK_ICON_VIEW_DROP_LEFT:
1613
1613
          gtk_paint_focus (widget->style,
1614
1614
                           icon_view->priv->bin_window,
1615
 
                           GTK_WIDGET_STATE (widget),
 
1615
                           gtk_widget_get_state (widget),
1616
1616
                           NULL,
1617
1617
                           widget,
1618
1618
                           "iconview-drop-indicator",
1622
1622
        case GTK_ICON_VIEW_DROP_BELOW:
1623
1623
          gtk_paint_focus (widget->style,
1624
1624
                           icon_view->priv->bin_window,
1625
 
                           GTK_WIDGET_STATE (widget),
 
1625
                           gtk_widget_get_state (widget),
1626
1626
                           NULL,
1627
1627
                           widget,
1628
1628
                           "iconview-drop-indicator",
1632
1632
        case GTK_ICON_VIEW_DROP_RIGHT:
1633
1633
          gtk_paint_focus (widget->style,
1634
1634
                           icon_view->priv->bin_window,
1635
 
                           GTK_WIDGET_STATE (widget),
 
1635
                           gtk_widget_get_state (widget),
1636
1636
                           NULL,
1637
1637
                           widget,
1638
1638
                           "iconview-drop-indicator",
1849
1849
 
1850
1850
  icon_view->priv->children = g_list_append (icon_view->priv->children, child);
1851
1851
 
1852
 
  if (GTK_WIDGET_REALIZED (icon_view))
 
1852
  if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
1853
1853
    gtk_widget_set_parent_window (child->widget, icon_view->priv->bin_window);
1854
1854
  
1855
1855
  gtk_widget_set_parent (widget, GTK_WIDGET (icon_view));
1875
1875
      info->editing = FALSE;
1876
1876
    }
1877
1877
 
1878
 
  if (GTK_WIDGET_HAS_FOCUS (editable))
 
1878
  if (gtk_widget_has_focus (GTK_WIDGET (editable)))
1879
1879
    gtk_widget_grab_focus (GTK_WIDGET (icon_view));
1880
1880
  
1881
1881
  g_signal_handlers_disconnect_by_func (editable,
2122
2122
  if (event->window != icon_view->priv->bin_window)
2123
2123
    return FALSE;
2124
2124
 
2125
 
  if (!GTK_WIDGET_HAS_FOCUS (widget))
 
2125
  if (!gtk_widget_has_focus (widget))
2126
2126
    gtk_widget_grab_focus (widget);
2127
2127
 
2128
2128
  if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
2652
2652
gtk_icon_view_adjustment_changed (GtkAdjustment *adjustment,
2653
2653
                                  GtkIconView   *icon_view)
2654
2654
{
2655
 
  if (GTK_WIDGET_REALIZED (icon_view))
 
2655
  if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
2656
2656
    {
2657
2657
      gdk_window_move (icon_view->priv->bin_window,
2658
2658
                       - icon_view->priv->hadjustment->value,
2854
2854
      icon_view->priv->height != widget->requisition.height)
2855
2855
    gtk_widget_queue_resize_no_redraw (widget);
2856
2856
 
2857
 
  if (GTK_WIDGET_REALIZED (icon_view))
 
2857
  if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
2858
2858
    gdk_window_resize (icon_view->priv->bin_window,
2859
2859
                       MAX (icon_view->priv->width, widget->allocation.width),
2860
2860
                       MAX (icon_view->priv->height, widget->allocation.height));
3162
3162
  if (item->selected)
3163
3163
    {
3164
3164
      flags = GTK_CELL_RENDERER_SELECTED;
3165
 
      if (GTK_WIDGET_HAS_FOCUS (icon_view))
 
3165
      if (gtk_widget_has_focus (GTK_WIDGET (icon_view)))
3166
3166
        state = GTK_STATE_SELECTED;
3167
3167
      else
3168
3168
        state = GTK_STATE_ACTIVE;
3231
3231
    }
3232
3232
 
3233
3233
  if (draw_focus &&
3234
 
      GTK_WIDGET_HAS_FOCUS (icon_view) &&
 
3234
      gtk_widget_has_focus (GTK_WIDGET (icon_view)) &&
3235
3235
      item == icon_view->priv->cursor_item)
3236
3236
    {
3237
3237
      for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
3826
3826
                        step == GTK_MOVEMENT_PAGES ||
3827
3827
                        step == GTK_MOVEMENT_BUFFER_ENDS, FALSE);
3828
3828
 
3829
 
  if (!GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (icon_view)))
 
3829
  if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
3830
3830
    return FALSE;
3831
3831
 
3832
3832
  gtk_icon_view_stop_editing (icon_view, FALSE);
4081
4081
  gboolean dirty = FALSE;
4082
4082
  gint step;
4083
4083
  
4084
 
  if (!GTK_WIDGET_HAS_FOCUS (icon_view))
 
4084
  if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
4085
4085
    return;
4086
4086
  
4087
4087
  if (!icon_view->priv->cursor_item)
4150
4150
  GtkIconViewItem *item;
4151
4151
  gboolean dirty = FALSE;
4152
4152
  
4153
 
  if (!GTK_WIDGET_HAS_FOCUS (icon_view))
 
4153
  if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
4154
4154
    return;
4155
4155
  
4156
4156
  if (!icon_view->priv->cursor_item)
4207
4207
  gboolean dirty = FALSE;
4208
4208
  gint step;
4209
4209
  
4210
 
  if (!GTK_WIDGET_HAS_FOCUS (icon_view))
 
4210
  if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
4211
4211
    return;
4212
4212
  
4213
4213
  if (!icon_view->priv->cursor_item)
4276
4276
  GList *list;
4277
4277
  gboolean dirty = FALSE;
4278
4278
  
4279
 
  if (!GTK_WIDGET_HAS_FOCUS (icon_view))
 
4279
  if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
4280
4280
    return;
4281
4281
  
4282
4282
  if (count < 0)
4358
4358
    item = g_list_nth_data (icon_view->priv->items,
4359
4359
                            gtk_tree_path_get_indices(path)[0]);
4360
4360
  
4361
 
  if (!GTK_WIDGET_REALIZED (icon_view) || !item || item->width < 0)
 
4361
  if (!item || item->width < 0 ||
 
4362
      !gtk_widget_get_realized (GTK_WIDGET (icon_view)))
4362
4363
    {
4363
4364
      if (icon_view->priv->scroll_to_path)
4364
4365
        gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
5381
5382
 
5382
5383
  g_object_notify (G_OBJECT (icon_view), "model");  
5383
5384
 
5384
 
  if (GTK_WIDGET_REALIZED (icon_view))
 
5385
  if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
5385
5386
    gtk_widget_queue_resize (GTK_WIDGET (icon_view));
5386
5387
}
5387
5388
 
7376
7377
 
7377
7378
  widget = GTK_WIDGET (icon_view);
7378
7379
 
7379
 
  if (!GTK_WIDGET_REALIZED (widget))
 
7380
  if (!gtk_widget_get_realized (widget))
7380
7381
    return NULL;
7381
7382
 
7382
7383
  index = gtk_tree_path_get_indices (path)[0];
7396
7397
          cairo_set_line_width (cr, 1.);
7397
7398
 
7398
7399
          gdk_cairo_set_source_color
7399
 
            (cr, &widget->style->base[GTK_WIDGET_STATE (widget)]);
 
7400
            (cr, &widget->style->base[gtk_widget_get_state (widget)]);
7400
7401
          cairo_rectangle (cr, 0, 0, item->width + 2, item->height + 2);
7401
7402
          cairo_fill (cr);
7402
7403