comparison src/gtkblist.c @ 9869:348636e6ba89

[gaim-migrate @ 10748] gtk 2.0 again from Stu committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 25 Aug 2004 21:47:00 +0000
parents aa3c963729f2
children e74eb0d11f86
comparison
equal deleted inserted replaced
9868:6fc9498b757b 9869:348636e6ba89
2073 { 2073 {
2074 GtkTreePath *path; 2074 GtkTreePath *path;
2075 GtkTreeIter iter; 2075 GtkTreeIter iter;
2076 GaimBlistNode *node; 2076 GaimBlistNode *node;
2077 GValue val = {0}; 2077 GValue val = {0};
2078 int scr_w, scr_h, w, h, x, y, mon_num; 2078 int scr_w, scr_h, w, h, x, y;
2079 #if GTK_CHECK_VERSION(2,2,0)
2080 int mon_num;
2081 GdkScreen *screen = NULL;
2082 #endif
2079 PangoLayout *layout; 2083 PangoLayout *layout;
2080 gboolean tooltip_top = FALSE; 2084 gboolean tooltip_top = FALSE;
2081 char *tooltiptext = NULL; 2085 char *tooltiptext = NULL;
2082 struct _gaim_gtk_blist_node *gtknode; 2086 struct _gaim_gtk_blist_node *gtknode;
2083 GdkRectangle mon_size; 2087 GdkRectangle mon_size;
2084 GdkScreen *screen = NULL;
2085 #ifdef WANT_DROP_SHADOW 2088 #ifdef WANT_DROP_SHADOW
2086 GdkWindowAttr attr; 2089 GdkWindowAttr attr;
2087 #endif 2090 #endif
2088 2091
2089 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), gtkblist->tip_rect.x, gtkblist->tip_rect.y, &path, NULL, NULL, NULL)) 2092 if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), gtkblist->tip_rect.x, gtkblist->tip_rect.y, &path, NULL, NULL, NULL))
2187 pango_layout_set_wrap(layout, PANGO_WRAP_WORD); 2190 pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
2188 pango_layout_set_width(layout, 300000); 2191 pango_layout_set_width(layout, 300000);
2189 pango_layout_set_markup(layout, tooltiptext, strlen(tooltiptext)); 2192 pango_layout_set_markup(layout, tooltiptext, strlen(tooltiptext));
2190 pango_layout_get_size (layout, &w, &h); 2193 pango_layout_get_size (layout, &w, &h);
2191 2194
2195 #if GTK_CHECK_VERSION(2,2,0)
2192 gdk_display_get_pointer(gdk_display_get_default(), &screen, &x, &y, NULL); 2196 gdk_display_get_pointer(gdk_display_get_default(), &screen, &x, &y, NULL);
2193 mon_num = gdk_screen_get_monitor_at_point(screen, x, y); 2197 mon_num = gdk_screen_get_monitor_at_point(screen, x, y);
2194 gdk_screen_get_monitor_geometry(screen, mon_num, &mon_size); 2198 gdk_screen_get_monitor_geometry(screen, mon_num, &mon_size);
2195 2199
2196 scr_w = mon_size.width + mon_size.x; 2200 scr_w = mon_size.width + mon_size.x;
2197 scr_h = mon_size.height + mon_size.y; 2201 scr_h = mon_size.height + mon_size.y;
2202 #else
2203 scr_w = gdk_screen_width();
2204 scr_h = gdk_screen_height();
2205 gdk_window_get_pointer(NULL, &x, &y, NULL);
2206 mon_size.x = 0;
2207 mon_size.y = 0;
2208 #endif
2198 2209
2199 w = PANGO_PIXELS(w) + 8; 2210 w = PANGO_PIXELS(w) + 8;
2200 h = PANGO_PIXELS(h) + 8; 2211 h = PANGO_PIXELS(h) + 8;
2201 2212
2202 /* 38 is the size of a large status icon plus 4 pixels padding on each side. 2213 /* 38 is the size of a large status icon plus 4 pixels padding on each side.
2203 * I should #define this or something */ 2214 * I should #define this or something */
2204 w = w + 38; 2215 w = w + 38;
2205 h = MAX(h, 38); 2216 h = MAX(h, 38);
2206 2217
2218 #if GTK_CHECK_VERSION(2,2,0)
2207 if( w > mon_size.width ) 2219 if( w > mon_size.width )
2208 w = mon_size.width - 10; 2220 w = mon_size.width - 10;
2209 2221
2210 if( h > mon_size.height ) 2222 if( h > mon_size.height )
2211 h = mon_size.height - 10; 2223 h = mon_size.height - 10;
2224 #endif
2212 2225
2213 if (GTK_WIDGET_NO_WINDOW(gtkblist->window)) 2226 if (GTK_WIDGET_NO_WINDOW(gtkblist->window))
2214 y+=gtkblist->window->allocation.y; 2227 y+=gtkblist->window->allocation.y;
2215 2228
2216 x -= ((w >> 1) + 4); 2229 x -= ((w >> 1) + 4);