+ switch(win->type) {
+ case wintype_Graphics:
+ {
+ gtk_image_get_pixmap( GTK_IMAGE(win->widget), &canvas, NULL );
+ if(canvas == NULL) {
+ WARNING("Could not get pixmap");
+ return FALSE;
+ }
+
+ gdk_draw_pixbuf( GDK_DRAWABLE(canvas), NULL, pixbuf, 0, 0, val1, val2, -1, -1, GDK_RGB_DITHER_NONE, 0, 0 );
+
+ /* Update the screen */
+ gtk_widget_queue_draw(win->widget);
+ }
+ break;
+
+ case wintype_TextBuffer:
+ {
+ GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(win->widget) );
+ GtkTextIter end, start;
+ gtk_text_buffer_get_end_iter(buffer, &end);
+ start = end;
+
+ flush_window_buffer(win);
+ gtk_text_buffer_insert_pixbuf(buffer, &end, pixbuf);
+ gtk_text_iter_forward_char(&end);
+
+ gint height = 0;
+ switch(val1) {
+ case imagealign_InlineDown:
+ height -= win->unit_height;
+ break;
+ case imagealign_InlineCenter:
+ height = -win->unit_height / 2;
+ break;
+ case imagealign_InlineUp:
+ default:
+ height = 0;
+ }
+
+ if(height != 0) {
+ GtkTextTag *tag = gtk_text_buffer_create_tag(buffer, NULL, "rise", PANGO_SCALE * (-height), NULL);
+ gtk_text_buffer_apply_tag(buffer, tag, &start, &end);
+ }
+ }
+ break;
+
+ }