changeset 4729:751c37a940dd

[gaim-migrate @ 5042] compile cleanups, and let those silly gtk2.0 people compile again. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 12 Mar 2003 21:43:39 +0000
parents cf718383cd60
children 9d3b7b106def
files plugins/docklet/docklet.c src/buddy.c src/gtklist.h src/pounce.c src/protocols/msn/msn.c src/protocols/yahoo/yahoo.c
diffstat 6 files changed, 36 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/docklet/docklet.c	Wed Mar 12 16:51:23 2003 +0000
+++ b/plugins/docklet/docklet.c	Wed Mar 12 21:43:39 2003 +0000
@@ -32,6 +32,7 @@
 #include "gaim.h"
 #include "sound.h"
 #include "eggtrayicon.h"
+#include "gtklist.h"
 
 #ifndef GAIM_PLUGINS
 #define GAIM_PLUGINS
--- a/src/buddy.c	Wed Mar 12 16:51:23 2003 +0000
+++ b/src/buddy.c	Wed Mar 12 21:43:39 2003 +0000
@@ -340,7 +340,6 @@
 
 static void gaim_gtk_blist_paint_tip(GtkWidget *widget, GdkEventExpose *event, struct buddy *b)
 {
-	int x,y,scr_w,scr_h, w, h;
 	GtkStyle *style;
 	GdkPixbuf *pixbuf = gaim_gtk_blist_get_status_icon(b, GAIM_STATUS_ICON_LARGE);
 	PangoLayout *layout;
@@ -352,9 +351,13 @@
 	
 	gtk_paint_flat_box (style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
 			    NULL, gtkblist->tipwindow, "tooltip", 0, 0, -1, -1);
-	
+
+#if GTK_CHECK_VERSION(2,2,0)
 	gdk_draw_pixbuf(GDK_DRAWABLE(gtkblist->tipwindow->window), NULL, pixbuf,
 			0, 0, 4, 4, -1 , -1, GDK_RGB_DITHER_NONE, 0, 0);
+#else
+	gdk_pixbuf_render_to_drawable(pixbuf, NULL, GDK_DRAWABLE(gtkblist->tipwindow->window), 0, 0, 4, 4, -1, -1, GDK_RGB_DITHER_NONE, 0, 0);
+#endif
 
 	gtk_paint_layout (style, gtkblist->tipwindow->window, GTK_STATE_NORMAL, TRUE,
 			  NULL, gtkblist->tipwindow, "tooltip", 38, 4, layout);
@@ -370,7 +373,6 @@
 	GtkTreePath *path;
 	GtkTreeIter iter;
 	GaimBlistNode *node;
-	char *tooltiptext;
 	GValue val = {0};
 
 	if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tv), gtkblist->rect.x, gtkblist->rect.y, &path, NULL, NULL, NULL))
@@ -386,7 +388,7 @@
 		char *tooltiptext = gaim_get_tooltip_text(buddy);
 		gtkblist->tipwindow = gtk_window_new(GTK_WINDOW_POPUP);
 		gtk_widget_set_app_paintable(gtkblist->tipwindow, TRUE);
-		gtk_window_set_policy(GTK_WINDOW(gtkblist->tipwindow), FALSE, FALSE, TRUE);
+		gtk_window_set_resizable(GTK_WINDOW(gtkblist->tipwindow), FALSE);
 		gtk_widget_set_name(gtkblist->tipwindow, "gtk-tooltips");
 		g_signal_connect(G_OBJECT(gtkblist->tipwindow), "expose_event", 
 				 G_CALLBACK(gaim_gtk_blist_paint_tip), buddy);
@@ -423,10 +425,10 @@
 		g_object_unref (layout);
 		g_free(tooltiptext);
 		gtk_widget_set_size_request(gtkblist->tipwindow, w, h);
-		gtk_widget_set_uposition(gtkblist->tipwindow, x, y);
+		gtk_window_move(GTK_WINDOW(gtkblist->tipwindow), x, y);
 		gtk_widget_show(gtkblist->tipwindow);
 	}
-	
+
 	gtk_tree_path_free(path);
 	return FALSE;
 }
@@ -520,7 +522,6 @@
 	char *text = NULL;
 	struct prpl* prpl = find_prpl(b->account->protocol);
 	char *statustext = NULL;
-	char *tooltiptext = NULL;
 	char *warning = NULL, *idletime = NULL;
 
 	if (prpl->tooltip_text) {
@@ -795,6 +796,19 @@
 	node->ui_data = g_new0(struct gaim_gtk_blist_node, 1);
 }
 
+void gaim_gtk_blist_update_columns()
+{
+	if (blist_options & OPT_BLIST_SHOW_ICONS) {
+		gtk_tree_view_column_set_visible(gtkblist->buddy_icon_column, TRUE);
+		gtk_tree_view_column_set_visible(gtkblist->idle_column, FALSE);
+		gtk_tree_view_column_set_visible(gtkblist->warning_column, FALSE);
+	} else {
+		gtk_tree_view_column_set_visible(gtkblist->idle_column, blist_options & OPT_BLIST_SHOW_IDLETIME);
+		gtk_tree_view_column_set_visible(gtkblist->warning_column, blist_options & OPT_BLIST_SHOW_WARN);
+		gtk_tree_view_column_set_visible(gtkblist->buddy_icon_column, FALSE);
+	}
+}
+
 enum {DRAG_BUDDY, DRAG_ROW};
 
 static void gaim_gtk_blist_show(struct gaim_buddy_list *list)
@@ -805,7 +819,7 @@
 	GtkWidget *sw;
 	GtkWidget *button;
 	GtkSizeGroup *sg;
- 	GtkTargetEntry gte[] = {{"GAIM_BUDDY", GTK_TARGET_SAME_APP, DRAG_ROW},
+	GtkTargetEntry gte[] = {{"GAIM_BUDDY", GTK_TARGET_SAME_APP, DRAG_ROW},
 				{"application/x-im-contact", 0, DRAG_BUDDY}};
 
 	if (gtkblist) {
@@ -844,7 +858,7 @@
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	gtk_widget_set_size_request(sw, 200, 200);
 
-	gtkblist->treemodel = gtk_tree_store_new(BLIST_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, 
+	gtkblist->treemodel = gtk_tree_store_new(BLIST_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING,
 						 G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_POINTER);
 
 	gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel));
@@ -912,7 +926,7 @@
 	gtk_size_group_add_widget(sg, button);
 	g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(gtk_blist_button_info_cb),
 			 gtkblist->treeview);
-	
+
 	button = gaim_pixbuf_button_from_stock(_("Chat"), GAIM_STOCK_CHAT, GAIM_BUTTON_VERTICAL);
 	gtk_box_pack_start(GTK_BOX(gtkblist->bbox), button, FALSE, FALSE, 0);
 	gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
@@ -928,7 +942,7 @@
 	/* OK... let's show this bad boy. */
 	gaim_gtk_blist_refresh(list);
 	gtk_widget_show_all(gtkblist->window);
-	
+
 	gaim_gtk_blist_update_toolbar();
 
 }
@@ -993,19 +1007,6 @@
 		gtk_widget_show_all(gtkblist->bbox);
 }
 
-void gaim_gtk_blist_update_columns() 
-{
-	if (blist_options & OPT_BLIST_SHOW_ICONS) {
-		gtk_tree_view_column_set_visible(gtkblist->buddy_icon_column, TRUE);
-		gtk_tree_view_column_set_visible(gtkblist->idle_column, FALSE);
-		gtk_tree_view_column_set_visible(gtkblist->warning_column, FALSE);
-	} else {
-		gtk_tree_view_column_set_visible(gtkblist->idle_column, blist_options & OPT_BLIST_SHOW_IDLETIME);
-		gtk_tree_view_column_set_visible(gtkblist->warning_column, blist_options & OPT_BLIST_SHOW_WARN);
-		gtk_tree_view_column_set_visible(gtkblist->buddy_icon_column, FALSE);
-	}
-}					 
-
 static void gaim_gtk_blist_remove(struct gaim_buddy_list *list, GaimBlistNode *node)
 {
 	struct gaim_gtk_blist_node *gtknode;
--- a/src/gtklist.h	Wed Mar 12 16:51:23 2003 +0000
+++ b/src/gtklist.h	Wed Mar 12 21:43:39 2003 +0000
@@ -117,6 +117,6 @@
 void gaim_gtk_blist_docklet_toggle();
 void gaim_gtk_blist_docklet_add();
 void gaim_gtk_blist_docklet_remove();
-void gaim_gtk_blist_update_colums();
+void gaim_gtk_blist_update_columns();
 
 #endif /* _GAIM_GTK_LIST_H_ */
--- a/src/pounce.c	Wed Mar 12 16:51:23 2003 +0000
+++ b/src/pounce.c	Wed Mar 12 21:43:39 2003 +0000
@@ -311,7 +311,7 @@
 
 static void pounce_choose(GtkWidget *opt, struct addbp *b)
 {
-	struct gaim_account *account = gtk_object_get_user_data(GTK_OBJECT(opt));
+	struct gaim_account *account = g_object_get_data(G_OBJECT(opt), "gaim_account");
 	b->account = account;
 }
 
@@ -337,7 +337,7 @@
 		p = (struct prpl *)find_prpl(account->protocol);
 		g_snprintf(buf, sizeof buf, "%s (%s)", account->username, (p && p->name)?p->name:_("Unknown"));
 		opt = gtk_menu_item_new_with_label(buf);
-		gtk_object_set_user_data(GTK_OBJECT(opt), account);
+		g_object_set_data(G_OBJECT(opt), "gaim_account", account);
 		g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(pounce_choose), b);
 		gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
 		gtk_widget_show(opt);
--- a/src/protocols/msn/msn.c	Wed Mar 12 16:51:23 2003 +0000
+++ b/src/protocols/msn/msn.c	Wed Mar 12 21:43:39 2003 +0000
@@ -1650,11 +1650,11 @@
 static GList *msn_buddy_menu(struct gaim_connection *gc, char *who)
 {
 	GList *m = NULL;
+#if 0
 	struct proto_buddy_menu *pbm;
 	struct buddy *b = gaim_find_buddy(gc->account, who);
 	static char buf[MSN_BUF_LEN];
 
-#if 0
 	pbm = g_new0(struct proto_buddy_menu, 1);
 	pbm->label = _("Send File");
 	pbm->callback = msn_ask_send_file;
--- a/src/protocols/yahoo/yahoo.c	Wed Mar 12 16:51:23 2003 +0000
+++ b/src/protocols/yahoo/yahoo.c	Wed Mar 12 21:43:39 2003 +0000
@@ -1069,24 +1069,26 @@
 {
 	struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data;
 	if (b->uc & UC_UNAVAILABLE && b->uc >> 2 != YAHOO_STATUS_IDLE) {
-	       	if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
+		if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
 			return yahoo_get_status_string(b->uc >> 2);
 		else
 			return g_hash_table_lookup(yd->hash, b->name);
 	}
+	return NULL;
 }
 
 static char *yahoo_tooltip_text(struct buddy *b)
 {
 	struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data;
 	if (b->uc & UC_UNAVAILABLE && b->uc >> 2 != YAHOO_STATUS_IDLE) {
-	       	if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
+		if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
 			return g_strdup(yahoo_get_status_string(b->uc >> 2));
 		else
 			return g_strdup(g_hash_table_lookup(yd->hash, b->name));
 	}
-} 
-    
+	return NULL;
+}
+
 static GList *yahoo_buddy_menu(struct gaim_connection *gc, char *who)
 {
 	GList *m = NULL;
@@ -1094,7 +1096,6 @@
 	struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data;
 	struct buddy *b = gaim_find_buddy(gc->account, who); /* this should never be null. if it is,
 						  segfault and get the bug report. */
-	static char buf[1024];
 	static char buf2[1024];
 
 	if (b->uc | YAHOO_STATUS_GAME) {