comparison src/gtkimhtml.c @ 7792:27f55b264446

[gaim-migrate @ 8438] Smileys will work again... and maybe they won't crash either. That was dumb. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 07 Dec 2003 19:31:17 +0000
parents 666f672a869a
children d2710acd0020
comparison
equal deleted inserted replaced
7791:21be2d9e8399 7792:27f55b264446
1172 *wpos = 0; 1172 *wpos = 0;
1173 ws[0] = 0; 1173 ws[0] = 0;
1174 gtk_text_buffer_get_end_iter(imhtml->text_buffer, iter); 1174 gtk_text_buffer_get_end_iter(imhtml->text_buffer, iter);
1175 if (x == NEW_SCALABLE_BIT) { 1175 if (x == NEW_SCALABLE_BIT) {
1176 GdkRectangle rect; 1176 GdkRectangle rect;
1177 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(imhtml), &rect); 1177
1178 scalable->add_to(scalable, imhtml, iter);
1179 scalable->scale(scalable, rect.width, rect.height);
1180 imhtml->scalables = g_list_append(imhtml->scalables, scalable);
1181 gtk_text_buffer_get_end_iter(imhtml->text_buffer, iter);
1182 } 1178 }
1183 } 1179 }
1184 1180
1185 1181
1186 GString* gtk_imhtml_append_text_with_images (GtkIMHtml *imhtml, 1182 GString* gtk_imhtml_append_text_with_images (GtkIMHtml *imhtml,
1365 break; 1361 break;
1366 case 26: /* HR */ 1362 case 26: /* HR */
1367 case 42: /* HR (opt) */ 1363 case 42: /* HR (opt) */
1368 ws[wpos++] = '\n'; 1364 ws[wpos++] = '\n';
1369 scalable = gtk_imhtml_hr_new(); 1365 scalable = gtk_imhtml_hr_new();
1370 //NEW_BIT(NEW_SCALABLE_BIT); 1366 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(imhtml), &rect);
1367 scalable->add_to(scalable, imhtml, &iter);
1368 scalable->scale(scalable, rect.width, rect.height);
1369 imhtml->scalables = g_list_append(imhtml->scalables, scalable);
1371 ws[wpos++] = '\n'; 1370 ws[wpos++] = '\n';
1372 break; 1371 break;
1373 case 27: /* /FONT */ 1372 case 27: /* /FONT */
1374 if (fonts) { 1373 if (fonts) {
1375 GtkIMHtmlFontDetail *font = fonts->data; 1374 GtkIMHtmlFontDetail *font = fonts->data;
2164 span->tag = gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(imhtml->text_buffer), "BOLD"); 2163 span->tag = gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(imhtml->text_buffer), "BOLD");
2165 imhtml->edit.bold = span; 2164 imhtml->edit.bold = span;
2166 imhtml->format_spans = g_list_append(imhtml->format_spans, span); 2165 imhtml->format_spans = g_list_append(imhtml->format_spans, span);
2167 } else { 2166 } else {
2168 span = imhtml->edit.bold; 2167 span = imhtml->edit.bold;
2169 printf("Set end\n");
2170 span->end = gtk_text_buffer_create_mark(imhtml->text_buffer, NULL, &iter, TRUE); 2168 span->end = gtk_text_buffer_create_mark(imhtml->text_buffer, NULL, &iter, TRUE);
2171 imhtml->edit.bold = NULL; 2169 imhtml->edit.bold = NULL;
2172 } 2170 }
2173 return imhtml->edit.bold != NULL; 2171 return imhtml->edit.bold != NULL;
2174 } 2172 }
2409 GtkTextMark *ins = gtk_text_buffer_get_insert(imhtml->text_buffer); 2407 GtkTextMark *ins = gtk_text_buffer_get_insert(imhtml->text_buffer);
2410 GtkTextIter iter; 2408 GtkTextIter iter;
2411 GdkPixbuf *pixbuf = NULL; 2409 GdkPixbuf *pixbuf = NULL;
2412 GdkPixbufAnimation *annipixbuf = NULL; 2410 GdkPixbufAnimation *annipixbuf = NULL;
2413 GtkWidget *icon = NULL; 2411 GtkWidget *icon = NULL;
2412 printf("%s %s\n", sml, smiley);
2413 gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, ins);
2414 GtkTextChildAnchor *anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, &iter); 2414 GtkTextChildAnchor *anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, &iter);
2415
2416 gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, ins);
2417 g_object_set_data(G_OBJECT(anchor), "text_tag", smiley); 2415 g_object_set_data(G_OBJECT(anchor), "text_tag", smiley);
2418 2416
2419 annipixbuf = gtk_smiley_tree_image(imhtml, sml, smiley); 2417 annipixbuf = gtk_smiley_tree_image(imhtml, sml, smiley);
2420 if(annipixbuf) { 2418 if(annipixbuf) {
2421 if(gdk_pixbuf_animation_is_static_image(annipixbuf)) { 2419 printf("HERE!\n");
2420 if(gdk_pixbuf_animation_is_static_image(annipixbuf)) {
2422 pixbuf = gdk_pixbuf_animation_get_static_image(annipixbuf); 2421 pixbuf = gdk_pixbuf_animation_get_static_image(annipixbuf);
2423 if(pixbuf) 2422 if(pixbuf)
2424 icon = gtk_image_new_from_pixbuf(pixbuf); 2423 icon = gtk_image_new_from_pixbuf(pixbuf);
2425 } else { 2424 } else {
2426 icon = gtk_image_new_from_animation(annipixbuf); 2425 icon = gtk_image_new_from_animation(annipixbuf);
2427 } 2426 }
2428 } 2427 }
2429 2428
2430 if (icon) { 2429 if (icon) {
2430 printf("THERE!\n");
2431 gtk_widget_show(icon); 2431 gtk_widget_show(icon);
2432 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor); 2432 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor);
2433 } 2433 }
2434 } 2434 }
2435 2435