comparison src/gtkimhtml.c @ 4902:0bbccc88bc67

[gaim-migrate @ 5236] fix a pair of compile warnings, and possibly fix the resize-hang bug. we'll see committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 28 Mar 2003 07:22:27 +0000
parents 9e50494f63a1
children 872598a15968
comparison
equal deleted inserted replaced
4901:ad589b887af9 4902:0bbccc88bc67
225 225
226 imhtml->show_smileys = TRUE; 226 imhtml->show_smileys = TRUE;
227 imhtml->show_comments = TRUE; 227 imhtml->show_comments = TRUE;
228 228
229 imhtml->smiley_data = g_hash_table_new_full(g_str_hash, g_str_equal, 229 imhtml->smiley_data = g_hash_table_new_full(g_str_hash, g_str_equal,
230 g_free, gtk_smiley_tree_destroy); 230 g_free, (GDestroyNotify)gtk_smiley_tree_destroy);
231 imhtml->default_smilies = gtk_smiley_tree_new(); 231 imhtml->default_smilies = gtk_smiley_tree_new();
232 232
233 g_signal_connect(G_OBJECT(imhtml), "motion-notify-event", G_CALLBACK(gtk_motion_event_notify), NULL); 233 g_signal_connect(G_OBJECT(imhtml), "motion-notify-event", G_CALLBACK(gtk_motion_event_notify), NULL);
234 g_signal_connect(G_OBJECT(imhtml), "size-allocate", G_CALLBACK(gtk_size_allocate_cb), NULL); 234 g_signal_connect(G_OBJECT(imhtml), "size-allocate", G_CALLBACK(gtk_size_allocate_cb), NULL);
235 235
1249 void gtk_imhtml_remove_smileys(GtkIMHtml *imhtml) 1249 void gtk_imhtml_remove_smileys(GtkIMHtml *imhtml)
1250 { 1250 {
1251 g_hash_table_destroy(imhtml->smiley_data); 1251 g_hash_table_destroy(imhtml->smiley_data);
1252 gtk_smiley_tree_destroy(imhtml->default_smilies); 1252 gtk_smiley_tree_destroy(imhtml->default_smilies);
1253 imhtml->smiley_data = g_hash_table_new_full(g_str_hash, g_str_equal, 1253 imhtml->smiley_data = g_hash_table_new_full(g_str_hash, g_str_equal,
1254 g_free, gtk_smiley_tree_destroy); 1254 g_free, (GDestroyNotify)gtk_smiley_tree_destroy);
1255 imhtml->default_smilies = gtk_smiley_tree_new(); 1255 imhtml->default_smilies = gtk_smiley_tree_new();
1256 } 1256 }
1257 void gtk_imhtml_show_smileys (GtkIMHtml *imhtml, 1257 void gtk_imhtml_show_smileys (GtkIMHtml *imhtml,
1258 gboolean show) 1258 gboolean show)
1259 { 1259 {
1375 return FALSE; 1375 return FALSE;
1376 } 1376 }
1377 1377
1378 static gboolean gtk_size_allocate_cb(GtkWidget *widget, GtkAllocation *alloc, gpointer user_data) 1378 static gboolean gtk_size_allocate_cb(GtkWidget *widget, GtkAllocation *alloc, gpointer user_data)
1379 { 1379 {
1380 static GdkRectangle old_rect = {0, 0, 0, 0}; 1380 static int old_width = 0, old_height = 0;
1381 GdkRectangle rect; 1381
1382 1382 if(old_width && (old_width != alloc->width || old_height != alloc->height)){
1383 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(widget), &rect);
1384
1385 if(old_rect.width && (old_rect.width != rect.width || old_rect.height != rect.height)){
1386 GList *iter = GTK_IMHTML(widget)->scalables; 1383 GList *iter = GTK_IMHTML(widget)->scalables;
1387 1384
1388 while(iter){ 1385 while(iter){
1389 GtkIMHtmlScalable *scale = GTK_IMHTML_SCALABLE(iter->data); 1386 GtkIMHtmlScalable *scale = GTK_IMHTML_SCALABLE(iter->data);
1390 scale->scale(scale, rect.width, rect.height); 1387 scale->scale(scale, alloc->width, alloc->height);
1391 1388
1392 iter = iter->next; 1389 iter = iter->next;
1393 } 1390 }
1394 } 1391 }
1395 1392
1396 old_rect = rect; 1393 old_width = alloc->width;
1394 old_height = alloc->height;
1397 return FALSE; 1395 return FALSE;
1398 } 1396 }
1399 1397
1400 /* GtkIMHtmlScalable, gaim_im_image, gaim_hr */ 1398 /* GtkIMHtmlScalable, gaim_im_image, gaim_hr */
1401 GtkIMHtmlScalable *gaim_im_image_new(GdkPixbuf *img) 1399 GtkIMHtmlScalable *gaim_im_image_new(GdkPixbuf *img)