comparison src/gtkimhtmltoolbar.c @ 8962:4ff4c34b7500

[gaim-migrate @ 9736] IM Image, WYSIWYG. It's still somewhat buggy, although the worse problems are with oscar's direct connect. We could always yank oscar's im image flag if we think it will cause too many bug reports. I made the GaimImgstore struct opque. I modified oscar's sending function to parse im images better, and everything seems to work. I made it write some errors to the conversation if you try to send an image and you aren't direct connected. That's just a hack until you can set formatting flags on a per conversation bases. There's a scrolling bug I haven't tracked down. I think it may exist normally and this just causes it better. It's worth noting jabber also uses this for pics in profiles, although I never did find a test case. Hopefully some other stuff can use this soon too, maybe Yahoo! pics in profiles or something. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Mon, 17 May 2004 06:47:20 +0000
parents ed62fb44aa30
children b24967757d46
comparison
equal deleted inserted replaced
8961:92e061a1db10 8962:4ff4c34b7500
411 char *name, *filename; 411 char *name, *filename;
412 char *buf, *filedata; 412 char *buf, *filedata;
413 size_t size; 413 size_t size;
414 GError *error = NULL; 414 GError *error = NULL;
415 int id; 415 int id;
416 GtkTextIter iter;
417 GtkTextMark *ins;
416 418
417 if (resp != GTK_RESPONSE_OK) { 419 if (resp != GTK_RESPONSE_OK) {
418 //set_toggle(toolbar->image, FALSE); 420 //set_toggle(toolbar->image, FALSE);
419 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbar->image), FALSE); 421 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toolbar->image), FALSE);
420 return; 422 return;
459 g_free(name); 461 g_free(name);
460 462
461 return; 463 return;
462 } 464 }
463 465
464 //im->images = g_slist_append(im->images, GINT_TO_POINTER(id)); 466 ins = gtk_text_buffer_get_insert(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->imhtml)));
465 467 gtk_text_buffer_get_iter_at_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->imhtml)),
466 /*buf = g_strdup_printf("<IMG ID=\"%d\" SRC=\"file://%s\">", id, filename); 468 &iter, ins);
467 gtk_text_buffer_insert_at_cursor(GTK_TEXT_BUFFER(gtkconv->entry_buffer), buf, -1); 469 gtk_imhtml_insert_image_at_iter(GTK_IMHTML(toolbar->imhtml), id, &iter);
468 g_free(buf); 470 gaim_imgstore_unref(id);
469 */ 471
470 g_free(name); 472 g_free(name);
471 } 473 }
472 474
473 475
474 static void 476 static void
984 sep = gtk_hseparator_new(); 986 sep = gtk_hseparator_new();
985 gtk_box_pack_start(GTK_BOX(toolbar), sep, FALSE, FALSE, 0); 987 gtk_box_pack_start(GTK_BOX(toolbar), sep, FALSE, FALSE, 0);
986 gtk_widget_show(sep); 988 gtk_widget_show(sep);
987 toolbar->sml = NULL; 989 toolbar->sml = NULL;
988 gtk_widget_show_all(hbox); 990 gtk_widget_show_all(hbox);
989
990 /* XXX - IMIMAGE - Fix IM images then remove the following line */
991 gtk_widget_hide(toolbar->image);
992 } 991 }
993 992
994 GtkWidget *gtk_imhtmltoolbar_new() 993 GtkWidget *gtk_imhtmltoolbar_new()
995 { 994 {
996 return GTK_WIDGET(g_object_new(gtk_imhtmltoolbar_get_type(), NULL)); 995 return GTK_WIDGET(g_object_new(gtk_imhtmltoolbar_get_type(), NULL));