comparison pidgin/gtkimhtml.c @ 32696:763d65f3f758

explicit merge of '6ab9f5ff810acde3c06a2add7b8df2bd75cce6e3' and '7a0bb807afc9c1c3f2aaa7143fc5d1e3dc7c6ee8' to branch 'im.pidgin.cpw.qulogic.gtk3'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 23 Dec 2011 06:58:52 +0000
parents 1cec4425d0cc 3538e783b98c
children
comparison
equal deleted inserted replaced
32418:466efc330d3d 32696:763d65f3f758
63 63
64 #include <pango/pango-font.h> 64 #include <pango/pango-font.h>
65 65
66 #define TOOLTIP_TIMEOUT 500 66 #define TOOLTIP_TIMEOUT 500
67 67
68 #if !GTK_CHECK_VERSION(2,20,0)
69 #define gtk_widget_get_realized(x) GTK_WIDGET_REALIZED(x)
70
71 #if !GTK_CHECK_VERSION(2,18,0)
72 #define gtk_widget_get_has_window(x) !GTK_WIDGET_NO_WINDOW(x)
73 #define gtk_widget_get_state(x) GTK_WIDGET_STATE(x)
74 #define gtk_widget_is_drawable(x) GTK_WIDGET_DRAWABLE(x)
75 #endif
76 #endif
77
68 static GtkTextViewClass *parent_class = NULL; 78 static GtkTextViewClass *parent_class = NULL;
69 79
70 struct scalable_data { 80 struct scalable_data {
71 GtkIMHtmlScalable *scalable; 81 GtkIMHtmlScalable *scalable;
72 GtkTextMark *mark; 82 GtkTextMark *mark;
456 imhtml->old_rect = rect; 466 imhtml->old_rect = rect;
457 parent_size_allocate(widget, alloc); 467 parent_size_allocate(widget, alloc);
458 468
459 /* Don't scroll here if we're in the middle of a smooth scroll */ 469 /* Don't scroll here if we're in the middle of a smooth scroll */
460 if (scroll && imhtml->scroll_time == NULL && 470 if (scroll && imhtml->scroll_time == NULL &&
461 GTK_WIDGET_REALIZED(imhtml)) 471 gtk_widget_get_realized(GTK_WIDGET(imhtml)))
462 gtk_imhtml_scroll_to_end(imhtml, FALSE); 472 gtk_imhtml_scroll_to_end(imhtml, FALSE);
463 } 473 }
464 474
465 #define DEFAULT_SEND_COLOR "#204a87" 475 #define DEFAULT_SEND_COLOR "#204a87"
466 #define DEFAULT_RECV_COLOR "#cc0000" 476 #define DEFAULT_RECV_COLOR "#cc0000"
573 583
574 gint gap, x, y, h, w, scr_w, baseline_skip; 584 gint gap, x, y, h, w, scr_w, baseline_skip;
575 585
576 g_return_val_if_fail(GTK_IS_IMHTML(imhtml), FALSE); 586 g_return_val_if_fail(GTK_IS_IMHTML(imhtml), FALSE);
577 587
578 if (!imhtml->tip || !GTK_WIDGET_DRAWABLE (GTK_WIDGET(imhtml))) { 588 if (!imhtml->tip || !gtk_widget_is_drawable (GTK_WIDGET(imhtml))) {
579 imhtml->tip_timer = 0; 589 imhtml->tip_timer = 0;
580 return FALSE; 590 return FALSE;
581 } 591 }
582 592
583 if (imhtml->tip_window){ 593 if (imhtml->tip_window){
626 pango_font_metrics_get_descent(font_metrics)); 636 pango_font_metrics_get_descent(font_metrics));
627 w = 8 + scr_w; 637 w = 8 + scr_w;
628 h = 8 + baseline_skip; 638 h = 8 + baseline_skip;
629 639
630 gdk_window_get_pointer (NULL, &x, &y, NULL); 640 gdk_window_get_pointer (NULL, &x, &y, NULL);
631 if (GTK_WIDGET_NO_WINDOW (GTK_WIDGET(imhtml))) 641 if (!gtk_widget_get_has_window (GTK_WIDGET(imhtml)))
632 y += GTK_WIDGET(imhtml)->allocation.y; 642 y += GTK_WIDGET(imhtml)->allocation.y;
633 643
634 scr_w = gdk_screen_width(); 644 scr_w = gdk_screen_width();
635 645
636 x -= ((w >> 1) + 4); 646 x -= ((w >> 1) + 4);
822 832
823 if (GTK_IMHTML(widget)->edit.background) { 833 if (GTK_IMHTML(widget)->edit.background) {
824 gdk_color_parse(GTK_IMHTML(widget)->edit.background, &gcolor); 834 gdk_color_parse(GTK_IMHTML(widget)->edit.background, &gcolor);
825 gdk_cairo_set_source_color(cr, &gcolor); 835 gdk_cairo_set_source_color(cr, &gcolor);
826 } else { 836 } else {
827 gdk_cairo_set_source_color(cr, &(widget->style->base[GTK_WIDGET_STATE(widget)])); 837 gdk_cairo_set_source_color(cr, &(widget->style->base[gtk_widget_get_state(widget)]));
828 } 838 }
829 839
830 cairo_rectangle(cr, 840 cairo_rectangle(cr,
831 visible_rect.x, visible_rect.y, 841 visible_rect.x, visible_rect.y,
832 visible_rect.width, visible_rect.height); 842 visible_rect.width, visible_rect.height);