comparison src/gtkstatusbox.c @ 11400:62db025d3eb0

[gaim-migrate @ 13635] sf patch #1277824, from Will Thompson (resiak) Fix C99isms in gtkstatusbox.c Although, I'm not conviced these ARE C99isms committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 01 Sep 2005 02:22:03 +0000
parents 6c1ad49fcb4b
children 6f9fc83ee25c
comparison
equal deleted inserted replaced
11399:48244c196228 11400:62db025d3eb0
163 } 163 }
164 164
165 static void 165 static void
166 gtk_gaim_status_box_init (GtkGaimStatusBox *status_box) 166 gtk_gaim_status_box_init (GtkGaimStatusBox *status_box)
167 { 167 {
168 GtkCellRenderer *text_rend = gtk_cell_renderer_text_new(); 168 GtkCellRenderer *text_rend;
169 GtkCellRenderer *icon_rend = gtk_cell_renderer_pixbuf_new(); 169 GtkCellRenderer *icon_rend;
170 GtkTextBuffer *buffer; 170 GtkTextBuffer *buffer;
171 GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4; 171 GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4;
172 GtkIconSize icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); 172 GtkIconSize icon_size;
173
174 text_rend = gtk_cell_renderer_text_new();
175 icon_rend = gtk_cell_renderer_pixbuf_new();
176 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS);
173 177
174 status_box->imhtml_visible = FALSE; 178 status_box->imhtml_visible = FALSE;
175 status_box->error_pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box), GAIM_STOCK_STATUS_OFFLINE, 179 status_box->error_pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box), GAIM_STOCK_STATUS_OFFLINE,
176 icon_size, "GtkGaimStatusBox"); 180 icon_size, "GtkGaimStatusBox");
177 status_box->connecting_index = 0; 181 status_box->connecting_index = 0;
276 static void 280 static void
277 gtk_gaim_status_box_size_allocate(GtkWidget *widget, 281 gtk_gaim_status_box_size_allocate(GtkWidget *widget,
278 GtkAllocation *allocation) 282 GtkAllocation *allocation)
279 { 283 {
280 GtkRequisition req = {0,0}; 284 GtkRequisition req = {0,0};
281 GtkAllocation parent_alc = *allocation, box_alc = *allocation ; 285 GtkAllocation parent_alc, box_alc;
286
287 parent_alc = *allocation;
288 box_alc = *allocation;
282 combo_box_size_request(widget, &req); 289 combo_box_size_request(widget, &req);
283 290
284 /* EVIL XXX */ 291 /* EVIL XXX */
285 box_alc.height = 80; 292 box_alc.height = 80;
286 /* box_alc.height = MAX(1,box_alc.height - req.height - 6); */ 293 /* box_alc.height = MAX(1,box_alc.height - req.height - 6); */
421 gtk_gaim_status_box_refresh(box); 428 gtk_gaim_status_box_refresh(box);
422 } 429 }
423 430
424 static void gtk_gaim_status_box_changed(GtkComboBox *box) 431 static void gtk_gaim_status_box_changed(GtkComboBox *box)
425 { 432 {
426 GtkGaimStatusBox *status_box = GTK_GAIM_STATUS_BOX(box); 433 GtkGaimStatusBox *status_box;
427 GtkTreeIter iter; 434 GtkTreeIter iter;
428 char *text, *sec_text; 435 char *text, *sec_text;
429 GdkPixbuf *pixbuf; 436 GdkPixbuf *pixbuf;
430 gchar *status_type_id; 437 gchar *status_type_id;
431 GList *l; 438 GList *l;
439
440 status_box = GTK_GAIM_STATUS_BOX(box);
432 441
433 gtk_combo_box_get_active_iter(GTK_COMBO_BOX(status_box), &iter); 442 gtk_combo_box_get_active_iter(GTK_COMBO_BOX(status_box), &iter);
434 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, TITLE_COLUMN, &text, 443 gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, TITLE_COLUMN, &text,
435 DESC_COLUMN, &sec_text, ICON_COLUMN, &pixbuf, 444 DESC_COLUMN, &sec_text, ICON_COLUMN, &pixbuf,
436 TYPE_COLUMN, &status_type_id, -1); 445 TYPE_COLUMN, &status_type_id, -1);