comparison pidgin/gtkconv.c @ 32686:3538e783b98c

Fix all deprecated GTK_WIDGET_* macros.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 09 Oct 2011 02:50:20 +0000
parents 457443ca22e0
children 737733593a29
comparison
equal deleted inserted replaced
32685:457443ca22e0 32686:3538e783b98c
77 #include "pidginstock.h" 77 #include "pidginstock.h"
78 #include "pidgintooltip.h" 78 #include "pidgintooltip.h"
79 #include "smileyparser.h" 79 #include "smileyparser.h"
80 80
81 #include "gtknickcolors.h" 81 #include "gtknickcolors.h"
82
83 #if !GTK_CHECK_VERSION(2,20,0)
84 #define gtk_widget_get_realized(x) GTK_WIDGET_REALIZED(x)
85
86 #if !GTK_CHECK_VERSION(2,18,0)
87 #define gtk_widget_get_visible(x) GTK_WIDGET_VISIBLE(x)
88 #define gtk_widget_is_drawable(x) GTK_WIDGET_DRAWABLE(x)
89 #endif
90 #endif
82 91
83 /** 92 /**
84 * A GTK+ Instant Message pane. 93 * A GTK+ Instant Message pane.
85 */ 94 */
86 struct _PidginImPane 95 struct _PidginImPane
7203 gtk_widget_queue_draw(gtkconv->infopane); 7212 gtk_widget_queue_draw(gtkconv->infopane);
7204 7213
7205 if (title != markup) 7214 if (title != markup)
7206 g_free(markup); 7215 g_free(markup);
7207 7216
7208 if (!GTK_WIDGET_REALIZED(gtkconv->tab_label)) 7217 if (!gtk_widget_get_realized(gtkconv->tab_label))
7209 gtk_widget_realize(gtkconv->tab_label); 7218 gtk_widget_realize(gtkconv->tab_label);
7210 7219
7211 accessibility_obj = gtk_widget_get_accessible(gtkconv->tab_cont); 7220 accessibility_obj = gtk_widget_get_accessible(gtkconv->tab_cont);
7212 if (im != NULL && 7221 if (im != NULL &&
7213 purple_conv_im_get_typing_state(im) == PURPLE_TYPING) { 7222 purple_conv_im_get_typing_state(im) == PURPLE_TYPING) {
7597 7606
7598 page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i); 7607 page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i);
7599 tab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), page); 7608 tab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), page);
7600 7609
7601 /* Make sure the tab is not hidden beyond an arrow */ 7610 /* Make sure the tab is not hidden beyond an arrow */
7602 if (!GTK_WIDGET_DRAWABLE(tab) && gtk_notebook_get_show_tabs(notebook)) 7611 if (!gtk_widget_is_drawable(tab) && gtk_notebook_get_show_tabs(notebook))
7603 continue; 7612 continue;
7604 7613
7605 if (horiz) { 7614 if (horiz) {
7606 if (x_rel >= tab->allocation.x - PIDGIN_HIG_BOX_SPACE && 7615 if (x_rel >= tab->allocation.x - PIDGIN_HIG_BOX_SPACE &&
7607 x_rel <= tab->allocation.x + tab->allocation.width + PIDGIN_HIG_BOX_SPACE) { 7616 x_rel <= tab->allocation.x + tab->allocation.width + PIDGIN_HIG_BOX_SPACE) {
9444 { 9453 {
9445 GtkWidget *entry = NULL; 9454 GtkWidget *entry = NULL;
9446 PurpleConversation *conv = gtkconv->active_conv; 9455 PurpleConversation *conv = gtkconv->active_conv;
9447 const char *text = NULL; 9456 const char *text = NULL;
9448 9457
9449 if (!GTK_WIDGET_VISIBLE(gtkconv->infopane)) { 9458 if (!gtk_widget_get_visible(gtkconv->infopane)) {
9450 /* There's already an entry for alias. Let's not create another one. */ 9459 /* There's already an entry for alias. Let's not create another one. */
9451 return FALSE; 9460 return FALSE;
9452 } 9461 }
9453 9462
9454 if (!purple_account_is_connected(purple_conversation_get_account(gtkconv->active_conv))) { 9463 if (!purple_account_is_connected(purple_conversation_get_account(gtkconv->active_conv))) {
9604 } 9613 }
9605 9614
9606 static gboolean gtk_conv_configure_cb(GtkWidget *w, GdkEventConfigure *event, gpointer data) { 9615 static gboolean gtk_conv_configure_cb(GtkWidget *w, GdkEventConfigure *event, gpointer data) {
9607 int x, y; 9616 int x, y;
9608 9617
9609 if (GTK_WIDGET_VISIBLE(w)) 9618 if (gtk_widget_get_visible(w))
9610 gtk_window_get_position(GTK_WINDOW(w), &x, &y); 9619 gtk_window_get_position(GTK_WINDOW(w), &x, &y);
9611 else 9620 else
9612 return FALSE; /* carry on normally */ 9621 return FALSE; /* carry on normally */
9613 9622
9614 /* Workaround for GTK+ bug # 169811 - "configure_event" is fired 9623 /* Workaround for GTK+ bug # 169811 - "configure_event" is fired
9639 int conv_width, int conv_height) 9648 int conv_width, int conv_height)
9640 { 9649 {
9641 /* if the window exists, is hidden, we're saving positions, and the 9650 /* if the window exists, is hidden, we're saving positions, and the
9642 * position is sane... */ 9651 * position is sane... */
9643 if (win && win->window && 9652 if (win && win->window &&
9644 !GTK_WIDGET_VISIBLE(win->window) && conv_width != 0) { 9653 !gtk_widget_get_visible(win->window) && conv_width != 0) {
9645 9654
9646 #ifdef _WIN32 /* only override window manager placement on Windows */ 9655 #ifdef _WIN32 /* only override window manager placement on Windows */
9647 /* ...check position is on screen... */ 9656 /* ...check position is on screen... */
9648 if (conv_x >= gdk_screen_width()) 9657 if (conv_x >= gdk_screen_width())
9649 conv_x = gdk_screen_width() - 100; 9658 conv_x = gdk_screen_width() - 100;
10244 { 10253 {
10245 int x, y; 10254 int x, y;
10246 PurpleConversationType type = purple_conversation_get_type(conv->active_conv); 10255 PurpleConversationType type = purple_conversation_get_type(conv->active_conv);
10247 GList *all; 10256 GList *all;
10248 10257
10249 if (GTK_WIDGET_VISIBLE(w)) 10258 if (gtk_widget_get_visible(w))
10250 gtk_window_get_position(GTK_WINDOW(w), &x, &y); 10259 gtk_window_get_position(GTK_WINDOW(w), &x, &y);
10251 else 10260 else
10252 return FALSE; /* carry on normally */ 10261 return FALSE; /* carry on normally */
10253 10262
10254 /* Workaround for GTK+ bug # 169811 - "configure_event" is fired 10263 /* Workaround for GTK+ bug # 169811 - "configure_event" is fired