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

« back to all changes in this revision

Viewing changes to gtk/gtktext.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:
654
654
static void
655
655
gtk_text_init (GtkText *text)
656
656
{
657
 
  GTK_WIDGET_SET_FLAGS (text, GTK_CAN_FOCUS);
 
657
  gtk_widget_set_can_focus (GTK_WIDGET (text), TRUE);
658
658
 
659
659
  text->text_area = NULL;
660
660
  text->hadj = NULL;
725
725
  
726
726
  text->word_wrap = (word_wrap != FALSE);
727
727
  
728
 
  if (GTK_WIDGET_REALIZED (text))
 
728
  if (gtk_widget_get_realized (GTK_WIDGET (text)))
729
729
    {
730
730
      recompute_geometry (text);
731
731
      gtk_widget_queue_draw (GTK_WIDGET (text));
742
742
  
743
743
  text->line_wrap = (line_wrap != FALSE);
744
744
  
745
 
  if (GTK_WIDGET_REALIZED (text))
 
745
  if (gtk_widget_get_realized (GTK_WIDGET (text)))
746
746
    {
747
747
      recompute_geometry (text);
748
748
      gtk_widget_queue_draw (GTK_WIDGET (text));
886
886
  g_return_if_fail (GTK_IS_TEXT (text));
887
887
  
888
888
  if (text->freeze_count)
889
 
    if (!(--text->freeze_count) && GTK_WIDGET_REALIZED (text))
 
889
    if (!(--text->freeze_count) && gtk_widget_get_realized (GTK_WIDGET (text)))
890
890
      {
891
891
        recompute_geometry (text);
892
892
        gtk_widget_queue_draw (GTK_WIDGET (text));
1239
1239
  GdkWindowAttr attributes;
1240
1240
  gint attributes_mask;
1241
1241
 
1242
 
  GTK_WIDGET_SET_FLAGS (text, GTK_REALIZED);
 
1242
  gtk_widget_set_realized (widget, TRUE);
1243
1243
  
1244
1244
  attributes.window_type = GDK_WINDOW_CHILD;
1245
1245
  attributes.x = widget->allocation.x;
1278
1278
  widget->style = gtk_style_attach (widget->style, widget->window);
1279
1279
  
1280
1280
  /* Can't call gtk_style_set_background here because it's handled specially */
1281
 
  gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
1282
 
  gdk_window_set_background (text->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
 
1281
  gdk_window_set_background (widget->window, &widget->style->base[gtk_widget_get_state (widget)]);
 
1282
  gdk_window_set_background (text->text_area, &widget->style->base[gtk_widget_get_state (widget)]);
1283
1283
 
1284
1284
  if (widget->style->bg_pixmap[GTK_STATE_NORMAL])
1285
1285
    text->bg_gc = create_bg_gc (text);
1314
1314
{
1315
1315
  GtkText *text = GTK_TEXT (widget);
1316
1316
 
1317
 
  if (GTK_WIDGET_REALIZED (widget))
 
1317
  if (gtk_widget_get_realized (widget))
1318
1318
    {
1319
 
      gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
1320
 
      gdk_window_set_background (text->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
 
1319
      gdk_window_set_background (widget->window, &widget->style->base[gtk_widget_get_state (widget)]);
 
1320
      gdk_window_set_background (text->text_area, &widget->style->base[gtk_widget_get_state (widget)]);
1321
1321
      
1322
1322
      if (text->bg_gc)
1323
1323
        {
1342
1342
{
1343
1343
  GtkText *text = GTK_TEXT (widget);
1344
1344
  
1345
 
  if (GTK_WIDGET_REALIZED (widget))
 
1345
  if (gtk_widget_get_realized (widget))
1346
1346
    {
1347
 
      gdk_window_set_background (widget->window, &widget->style->base[GTK_WIDGET_STATE (widget)]);
1348
 
      gdk_window_set_background (text->text_area, &widget->style->base[GTK_WIDGET_STATE (widget)]);
 
1347
      gdk_window_set_background (widget->window, &widget->style->base[gtk_widget_get_state (widget)]);
 
1348
      gdk_window_set_background (text->text_area, &widget->style->base[gtk_widget_get_state (widget)]);
1349
1349
    }
1350
1350
}
1351
1351
 
1433
1433
      width = widget->allocation.width;
1434
1434
      height = widget->allocation.height;
1435
1435
      
1436
 
      if (GTK_WIDGET_HAS_FOCUS (widget))
 
1436
      if (gtk_widget_has_focus (widget))
1437
1437
        {
1438
1438
          x += 1;
1439
1439
          y += 1;
1442
1442
          xextra -= 1;
1443
1443
          yextra -= 1;
1444
1444
 
1445
 
          gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
 
1445
          gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget),
1446
1446
                           NULL, widget, "text",
1447
1447
                           0, 0,
1448
1448
                           widget->allocation.width,
1510
1510
  GtkText *text = GTK_TEXT (widget);
1511
1511
 
1512
1512
  widget->allocation = *allocation;
1513
 
  if (GTK_WIDGET_REALIZED (widget))
 
1513
  if (gtk_widget_get_realized (widget))
1514
1514
    {
1515
1515
      gdk_window_move_resize (widget->window,
1516
1516
                              allocation->x, allocation->y,
1587
1587
  
1588
1588
  text->button = event->button;
1589
1589
  
1590
 
  if (!GTK_WIDGET_HAS_FOCUS (widget))
 
1590
  if (!gtk_widget_has_focus (widget))
1591
1591
    gtk_widget_grab_focus (widget);
1592
1592
  
1593
1593
  if (event->button == 1)
2930
2930
 
2931
2931
  prop->length = length;
2932
2932
 
2933
 
  if (GTK_WIDGET_REALIZED (text))
 
2933
  if (gtk_widget_get_realized (GTK_WIDGET (text)))
2934
2934
    realize_property (text, prop);
2935
2935
 
2936
2936
  return prop;
3061
3061
        {
3062
3062
          /* Next property just has last position, take it over */
3063
3063
 
3064
 
          if (GTK_WIDGET_REALIZED (text))
 
3064
          if (gtk_widget_get_realized (GTK_WIDGET (text)))
3065
3065
            unrealize_property (text, forward_prop);
3066
3066
 
3067
3067
          forward_prop->flags = 0;
3085
3085
            }
3086
3086
          forward_prop->length += len;
3087
3087
 
3088
 
          if (GTK_WIDGET_REALIZED (text))
 
3088
          if (gtk_widget_get_realized (GTK_WIDGET (text)))
3089
3089
            realize_property (text, forward_prop);
3090
3090
        }
3091
3091
      else
3222
3222
          MARK_LIST_PTR (&text->point) = g_list_remove_link (tmp, tmp);
3223
3223
          text->point.offset = 0;
3224
3224
 
3225
 
          if (GTK_WIDGET_REALIZED (text))
 
3225
          if (gtk_widget_get_realized (GTK_WIDGET (text)))
3226
3226
            unrealize_property (text, prop);
3227
3227
 
3228
3228
          destroy_text_property (prop);
3258
3258
      
3259
3259
      text->point.offset = MARK_CURRENT_PROPERTY(&text->point)->length - 1;
3260
3260
      
3261
 
      if (GTK_WIDGET_REALIZED (text))
 
3261
      if (gtk_widget_get_realized (GTK_WIDGET (text)))
3262
3262
        unrealize_property (text, prop);
3263
3263
 
3264
3264
      destroy_text_property (prop);
3599
3599
static void
3600
3600
find_cursor (GtkText* text, gboolean scroll)
3601
3601
{
3602
 
  if (GTK_WIDGET_REALIZED (text))
 
3602
  if (gtk_widget_get_realized (GTK_WIDGET (text)))
3603
3603
    {
3604
3604
      find_line_containing_point (text, text->cursor_mark.index, scroll);
3605
3605
      
4695
4695
                         x, y, width, height);
4696
4696
    }
4697
4697
  else if (!gdk_color_equal(MARK_CURRENT_BACK (text, mark),
4698
 
                            &GTK_WIDGET(text)->style->base[GTK_WIDGET_STATE (text)]))
 
4698
                            &GTK_WIDGET(text)->style->base[gtk_widget_get_state (GTK_WIDGET (text))]))
4699
4699
    {
4700
4700
      gdk_gc_set_foreground (text->gc, MARK_CURRENT_BACK (text, mark));
4701
4701
 
5117
5117
            draw_line_wrap (text, pixels + CACHE_DATA(cache).font_ascent);
5118
5118
        }
5119
5119
      
5120
 
      if (cursor && GTK_WIDGET_HAS_FOCUS (text))
 
5120
      if (cursor && gtk_widget_has_focus (GTK_WIDGET (text)))
5121
5121
        {
5122
5122
          if (CACHE_DATA(cache).start.index <= text->cursor_mark.index &&
5123
5123
              CACHE_DATA(cache).end.index >= text->cursor_mark.index)