Index: gtkhtml-3.10.0/src/htmlgdkpainter.c =================================================================== --- gtkhtml-3.10.0/src/htmlgdkpainter.c (revision 8482) +++ gtkhtml-3.10.0/src/htmlgdkpainter.c (working copy) @@ -27,22 +27,27 @@ #include #include +#include #include #include #include +#include + #include "htmlentity.h" #include "htmlgdkpainter.h" #include "htmlcolor.h" #include "htmlcolorset.h" #include "htmlembedded.h" #include "htmlengine.h" +#include "htmlimage.h" #include "htmltextslave.h" #include "htmlsettings.h" #include "gtkhtml-embedded.h" #include "gtkhtml.h" + static HTMLPainterClass *parent_class = NULL; static void set_clip_rectangle (HTMLPainter *painter, gint x, gint y, gint width, gint height); @@ -354,9 +359,169 @@ } static void +draw_pixbuf_cms (HTMLPainter *painter, + GdkDrawable *drawable, + GdkGC *gc, + GdkPixbuf *pixbuf, + HTMLImagePointer *ip, + gint src_x, + gint src_y, + gint dest_x, + gint dest_y, + gint width, + gint height, + GdkRgbDither dither, + gint x_dither, + gint y_dither, + gboolean in_place) +{ + HTMLGdkPainter *gdk_painter = HTML_GDK_PAINTER (painter); + GdkAtom type; + int format, length; + guchar *data; + +#define MONITORS 4 + static gboolean output_profile_initialized [MONITORS] = { FALSE, FALSE, FALSE, FALSE }; + static gboolean do_cms [MONITORS] = { FALSE, FALSE, FALSE, FALSE }; + static cmsHPROFILE input_profile; + static cmsHPROFILE output_profile [MONITORS]; + static cmsHTRANSFORM cmssRGBTransformRGB[MONITORS], cmssRGBTransformRGBA[MONITORS]; + + int monitor_number = gdk_screen_get_monitor_at_window (gtk_widget_get_screen (painter->widget), + painter->widget->window); + GtkHTMLClass *klass = GTK_HTML_CLASS (GTK_WIDGET_GET_CLASS (painter->widget)); + + printf ("monitor: %d\n", monitor_number); + + if (monitor_number < MONITORS && !output_profile_initialized [monitor_number]) { + gboolean have_profile = FALSE; + + if (gdk_property_get (gdk_screen_get_root_window (gtk_widget_get_screen (painter->widget)), + gdk_atom_intern ("_ICC_PROFILE", TRUE), + GDK_NONE, + 0, G_MAXLONG, FALSE, + &type, &format, &length, &data)) + have_profile = TRUE; + else { + /* try to get profile for this monitor */ + char* profile_atom_for_screen = g_strdup_printf ("_ICC_PROFILE_%d", + monitor_number + 1); + if (gdk_property_get (gdk_screen_get_root_window (gtk_widget_get_screen (painter->widget)), + gdk_atom_intern (profile_atom_for_screen, TRUE), + GDK_NONE, + 0, G_MAXLONG, FALSE, + &type, &format, &length, &data)) + have_profile = TRUE; + } + + if (have_profile) { + input_profile = klass->sRGB_profile; + output_profile [monitor_number] = cmsOpenProfileFromMem (data, length); + cmssRGBTransformRGB [monitor_number] = cmsCreateTransform (input_profile, + TYPE_RGB_8, + output_profile [monitor_number], + TYPE_RGB_8, + INTENT_PERCEPTUAL, 0); + cmssRGBTransformRGBA [monitor_number] = cmsCreateTransform (input_profile, + TYPE_RGBA_8, + output_profile [monitor_number], + TYPE_RGBA_8, + INTENT_PERCEPTUAL, 0); + printf ("got the profile, length: %d\n", length); + do_cms [monitor_number] = TRUE; + } + output_profile_initialized[monitor_number] = TRUE; + } + + if (monitor_number < MONITORS && do_cms [monitor_number]) { + GdkPixbuf *working_copy; + guchar *originalPixels, *transformedPixels; + int y, originalStride, transformedStride; + gboolean has_alpha = gdk_pixbuf_get_has_alpha (pixbuf); + + static cmsHTRANSFORM transform; + + working_copy = in_place + ? pixbuf + : gdk_pixbuf_new (gdk_pixbuf_get_colorspace (pixbuf), + has_alpha, + gdk_pixbuf_get_bits_per_sample (pixbuf), + width, height); + + originalPixels = gdk_pixbuf_get_pixels (pixbuf); + transformedPixels = gdk_pixbuf_get_pixels (working_copy); + + originalStride = gdk_pixbuf_get_rowstride (pixbuf); + transformedStride = gdk_pixbuf_get_rowstride (working_copy); + + /* transform only requested part */ + originalPixels += gdk_pixbuf_get_n_channels (pixbuf)*src_x + originalStride*src_y; + + if (ip->profile) { + printf ("use image's profile\n"); + transform = cmsCreateTransform (ip->profile, + has_alpha ? TYPE_RGBA_8 : TYPE_RGB_8, + output_profile [monitor_number], + has_alpha ? TYPE_RGBA_8 : TYPE_RGB_8, + INTENT_PERCEPTUAL, 0); + } else + transform = has_alpha ? cmssRGBTransformRGBA[monitor_number] : cmssRGBTransformRGB[monitor_number]; + + for (y = 0; y < height; y ++, originalPixels += originalStride, transformedPixels += transformedStride) { + cmsDoTransform (transform, originalPixels, transformedPixels, width); + + /* unfortunatelly we have to copy alpha channel ourself */ + if (has_alpha && !in_place) { + int x; + guchar *op, *tp; + + op = originalPixels; + tp = transformedPixels; + + for (x = 0; x < width; x ++, op += 4, tp += 4) + tp [3] = op [3]; + } + } + + /* todo: cache transform in ImagePointer */ + if (ip->profile) + cmsDeleteTransform (transform); + + gdk_draw_pixbuf (drawable, + gc, + working_copy, + in_place ? src_x : 0, + in_place ? src_y : 0, + dest_x, + dest_y, + width, + height, + dither, + x_dither, + y_dither); + + if (!in_place) + gdk_pixbuf_unref (working_copy); + } else + gdk_draw_pixbuf (drawable, + gc, + pixbuf, + src_x, + src_y, + dest_x, + dest_y, + width, + height, + dither, + x_dither, + y_dither); +} + +static void draw_background (HTMLPainter *painter, GdkColor *color, GdkPixbuf *pixbuf, + HTMLImagePointer *ip, gint x, gint y, gint width, gint height, gint tile_x, gint tile_y) @@ -454,12 +619,12 @@ dw, dh); } - gdk_draw_pixbuf (pixmap, NULL, pixbuf, + draw_pixbuf_cms (painter, pixmap, NULL, pixbuf, ip, 0, 0, 0, 0, dw, dh, GDK_RGB_DITHER_NORMAL, - paint.x, paint.y); + paint.x, paint.y, FALSE); gdk_gc_set_tile (gc, pixmap); gdk_gc_set_fill (gc, GDK_TILED); @@ -489,13 +654,13 @@ while (cw > 0) { incr_x = dw - w; - gdk_draw_pixbuf (gdk_painter->pixmap, NULL, pixbuf, + draw_pixbuf_cms (painter, gdk_painter->pixmap, NULL, pixbuf, ip, w, h, cx - clip.x, cy - clip.y, (cw >= incr_x) ? incr_x : cw, (ch >= incr_y) ? incr_y : ch, GDK_RGB_DITHER_NORMAL, - cx, cy); + cx, cy, FALSE); cw -= incr_x; cx += incr_x; @@ -516,18 +681,19 @@ paint.width, paint.height); } - gdk_draw_pixbuf (gdk_painter->pixmap, NULL, pixbuf, + draw_pixbuf_cms (painter, gdk_painter->pixmap, NULL, pixbuf, ip, tile_x % pw, tile_y % ph, paint.x - clip.x, paint.y - clip.y, paint.width, paint.height, GDK_RGB_DITHER_NORMAL, - paint.x, paint.y); + paint.x, paint.y, FALSE); } } static void draw_pixmap (HTMLPainter *painter, GdkPixbuf *pixbuf, + HTMLImagePointer *ip, gint x, gint y, gint scale_width, gint scale_height, const GdkColor *color) @@ -564,7 +730,9 @@ return; if (scale_width == orig_width && scale_height == orig_height && color == NULL) { - gdk_draw_pixbuf (gdk_painter->pixmap, NULL, pixbuf, + + + draw_pixbuf_cms (painter, gdk_painter->pixmap, NULL, pixbuf, ip, paint.x - image.x, paint.y - image.y, paint.x - clip.x, @@ -572,7 +740,7 @@ paint.width, paint.height, GDK_RGB_DITHER_NORMAL, - paint.x, paint.y); + paint.x, paint.y, FALSE); return; } @@ -641,7 +809,7 @@ } } - gdk_draw_pixbuf (gdk_painter->pixmap, NULL, tmp_pixbuf, + draw_pixbuf_cms (painter, gdk_painter->pixmap, NULL, tmp_pixbuf, ip, 0, 0, paint.x - clip.x, @@ -649,7 +817,7 @@ paint.width, paint.height, GDK_RGB_DITHER_NORMAL, - paint.x, paint.y); + paint.x, paint.y, TRUE); g_object_unref (tmp_pixbuf); } Index: gtkhtml-3.10.0/src/htmlimage.c =================================================================== --- gtkhtml-3.10.0/src/htmlimage.c (revision 8482) +++ gtkhtml-3.10.0/src/htmlimage.c (working copy) @@ -500,7 +500,7 @@ if (pixbuf && (o->width > gdk_pixbuf_get_width (pixbuf)) && (o->ascent + o->descent > gdk_pixbuf_get_height (pixbuf))) - html_painter_draw_pixmap (painter, pixbuf, + html_painter_draw_pixmap (painter, pixbuf, ip, base_x, base_y, gdk_pixbuf_get_width (pixbuf) * pixel_size, gdk_pixbuf_get_height (pixbuf) * pixel_size, @@ -542,7 +542,7 @@ } - html_painter_draw_pixmap (painter, pixbuf, + html_painter_draw_pixmap (painter, pixbuf, ip, base_x, base_y, scale_width, scale_height, highlight_color); @@ -1109,6 +1109,87 @@ } static void +update_profile (HTMLImagePointer *ip) +{ + if (ip->exif_data) { + ExifEntry *entry; + const ExifByteOrder o = exif_data_get_byte_order (ip->exif_data); + + entry = exif_content_get_entry (ip->exif_data->ifd [EXIF_IFD_EXIF], EXIF_TAG_COLOR_SPACE); + if (entry) { + + if (exif_get_short (entry->data, o) == 1) { + ip->profile = cmsCreate_sRGBProfile (); + printf ("profile is sRGB\n"); + } else if (exif_get_short (entry->data, o) == 2) { + /* TODO: create Adobe RGB profile */ + ip->profile = cmsOpenProfileFromFile ("/usr/share/color/icc/Adobe ICC Profiles/RGB Profiles/AdobeRGB1998.icc", "r"); + printf ("profile is Adobe RGB\n"); + } else if (exif_get_short (entry->data, o) == 0xFFFF) { + double gammaValue; + cmsCIExyY whitepoint; + cmsCIExyYTRIPLE primaries; + LPGAMMATABLE gamma[3]; + + const int offset = exif_format_get_size (EXIF_FORMAT_RATIONAL); + ExifRational r; + + entry = exif_content_get_entry (ip->exif_data->ifd [EXIF_IFD_0], EXIF_TAG_WHITE_POINT); + if (entry && entry->components == 2) { + r = exif_get_rational (entry->data, o); + whitepoint.x = (double)r.numerator/r.denominator; + r = exif_get_rational (entry->data + offset, o); + whitepoint.y = (double)r.numerator/r.denominator; + whitepoint.Y = 1.0; + } else { + printf ("No whitepoint found\n"); + // return; + } + + entry = exif_content_get_entry (ip->exif_data->ifd [EXIF_IFD_0], EXIF_TAG_PRIMARY_CHROMATICITIES); + if (entry && entry->components == 6) { + r = exif_get_rational (entry->data + 0 * offset, o); + primaries.Red.x = (double)r.numerator/r.denominator; + r = exif_get_rational (entry->data + 1 * offset, o); + primaries.Red.y = (double)r.numerator/r.denominator; + + r = exif_get_rational (entry->data + 2 * offset, o); + primaries.Green.x = (double)r.numerator/r.denominator; + r = exif_get_rational (entry->data + 3 * offset, o); + primaries.Green.y = (double)r.numerator/r.denominator; + + r = exif_get_rational (entry->data + 4 * offset, o); + primaries.Blue.x = (double)r.numerator/r.denominator; + r = exif_get_rational (entry->data + 5 * offset, o); + primaries.Blue.y = (double)r.numerator/r.denominator; + + primaries.Red.Y = primaries.Green.Y = primaries.Blue.Y = 1.0; + } else { + printf ("No primary chromaticities found\n"); + // return; + } + + entry = exif_content_get_entry (ip->exif_data->ifd [EXIF_IFD_EXIF], EXIF_TAG_GAMMA); + if (entry) { + r = exif_get_rational (entry->data, o); + gammaValue = (double)r.numerator/r.denominator; + } else { + /* Assume 2.2 */ + printf ("No gamma found\n"); + gammaValue = 2.2; + } + + gamma[0] = gamma[1] = gamma[2] = cmsBuildGamma(256, gammaValue); + + ip->profile = cmsCreateRGBProfile(&whitepoint, &primaries, gamma); + printf ("JPEG is calibrated\n"); + cmsFreeGamma(gamma[0]); + } + } + } +} + +static void html_image_factory_end_pixbuf (GtkHTMLStream *stream, GtkHTMLStreamStatus status, gpointer user_data) @@ -1134,6 +1215,15 @@ /* printf ("IMAGE(%p) opened streams: %d\n", ip->factory->engine, ip->factory->engine->opened_streams); */ if (ip->factory->engine->opened_streams == 0 && ip->factory->engine->block && ip->factory->engine->block_images) html_engine_schedule_update (ip->factory->engine); + + if (ip->exif_loader) { + ip->exif_data = exif_loader_get_data (ip->exif_loader); + printf ("exif loader ends with data: %p\n", ip->exif_data); + exif_loader_unref (ip->exif_loader); + ip->exif_loader = NULL; + update_profile (ip); + } + html_image_pointer_unref (ip); } @@ -1147,6 +1237,15 @@ /* FIXME ! Check return value */ gdk_pixbuf_loader_write (p->loader, buffer, size, NULL); + + printf ("data chunk size: %d\n", size); + if (p->exif_loader && exif_loader_write (p->exif_loader, buffer, size)) { + p->exif_data = exif_loader_get_data (p->exif_loader); + printf ("exif loader ends with data: %p\n", p->exif_data); + exif_loader_unref (p->exif_loader); + p->exif_loader = NULL; + update_profile (p); + } } static void @@ -1317,6 +1416,11 @@ (GtkFunction)html_image_pointer_timeout, retval); retval->animation_timeout = 0; + retval->exif_data = NULL; + retval->exif_loader = NULL; + + retval->profile = NULL; + return retval; } @@ -1411,6 +1515,11 @@ if (ip->factory->engine->block_images) html_engine_opened_streams_increment (ip->factory->engine); + if (ip->exif_loader) + exif_loader_unref (ip->exif_loader); + ip->exif_loader = exif_loader_new (); + ip->offset = 0; + return gtk_html_stream_new (GTK_HTML (ip->factory->engine->widget), html_image_factory_types, html_image_factory_write_pixbuf, Index: gtkhtml-3.10.0/src/htmlimage.h =================================================================== --- gtkhtml-3.10.0/src/htmlimage.h (revision 8482) +++ gtkhtml-3.10.0/src/htmlimage.h (working copy) @@ -27,6 +27,11 @@ #include #include "htmlobject.h" +#include +#include + +#include + #define HTML_IMAGE_FACTORY(x) ((HTMLImageFactory *)(x)) #define HTML_IMAGE_POINTER(x) ((HTMLImagePointer *)(x)) #define HTML_IS_IMAGE(x) (HTML_CHECK_TYPE ((x), HTML_TYPE_IMAGE)) @@ -42,6 +47,12 @@ gint stall; guint stall_timeout; guint animation_timeout; + + ExifLoader *exif_loader; + ExifData *exif_data; + + size_t offset; + cmsHPROFILE profile; }; #define HTML_IMAGE(x) ((HTMLImage *)(x)) Index: gtkhtml-3.10.0/src/tests/test1.html =================================================================== --- gtkhtml-3.10.0/src/tests/test1.html (revision 8482) +++ gtkhtml-3.10.0/src/tests/test1.html (working copy) @@ -1,5 +1,6 @@
+
 Some pre text to test stuff out
 Line Feeds should be working.
 
Index: gtkhtml-3.10.0/src/tests/test.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = image/jpeg Index: gtkhtml-3.10.0/src/htmlengine.c =================================================================== --- gtkhtml-3.10.0/src/htmlengine.c (revision 8482) +++ gtkhtml-3.10.0/src/htmlengine.c (working copy) @@ -4315,10 +4315,11 @@ pixbuf = gdk_pixbuf_animation_get_static_image (bgpixmap->animation); } + /* fixme: pass exif data for background pixmap */ html_painter_draw_background (e->painter, &html_colorset_get_color_allocated (e->settings->color_set, e->painter, HTMLBgColor)->color, - pixbuf, x, y, w, h, x, y); + pixbuf, NULL, x, y, w, h, x, y); } void Index: gtkhtml-3.10.0/src/htmltable.c =================================================================== --- gtkhtml-3.10.0/src/htmltable.c (revision 8482) +++ gtkhtml-3.10.0/src/htmltable.c (working copy) @@ -1182,11 +1182,15 @@ gint tx, gint ty) { GdkPixbuf *pixbuf = NULL; + HTMLImagePointer *ip = NULL; GdkColor *color = table->bgColor; HTMLObject *o = HTML_OBJECT (table); - if (table->bgPixmap && table->bgPixmap->animation) - pixbuf = gdk_pixbuf_animation_get_static_image (table->bgPixmap->animation); + if (table->bgPixmap) { + if (table->bgPixmap->animation) + pixbuf = gdk_pixbuf_animation_get_static_image (table->bgPixmap->animation); + ip = table->bgPixmap; + } if (color) html_painter_alloc_color (p, color); @@ -1195,6 +1199,7 @@ html_painter_draw_background (p, color, pixbuf, + ip, tx + paint->x, ty + paint->y, paint->width, Index: gtkhtml-3.10.0/src/htmltablecell.c =================================================================== --- gtkhtml-3.10.0/src/htmltablecell.c (revision 8482) +++ gtkhtml-3.10.0/src/htmltablecell.c (working copy) @@ -51,6 +51,7 @@ HTMLObject *o; HTMLClueV *cluev; GdkPixbuf *pixbuf = NULL; + ExifData *exif= NULL; GdkColor *color = NULL; int pixel_size = html_painter_get_pixel_size (p); @@ -69,11 +70,13 @@ if (cell->bgPixmap->animation) { pixbuf = gdk_pixbuf_animation_get_static_image (cell->bgPixmap->animation); } + exif = cell->bgPixmap->exif_data; } if (!HTML_IS_PLAIN_PAINTER (p)) html_painter_draw_background (p, color, pixbuf, + exif, tx + paint->x + pixel_size*cluev->border_width, ty + paint->y + pixel_size*cluev->border_width, paint->width - 2*pixel_size*cluev->border_width, Index: gtkhtml-3.10.0/src/Makefile.am =================================================================== --- gtkhtml-3.10.0/src/Makefile.am (revision 8482) +++ gtkhtml-3.10.0/src/Makefile.am (working copy) @@ -207,7 +207,7 @@ $(NULL) libgtkhtml_3_8_la_LDFLAGS = -version-info $(GTKHTML_CURRENT):$(GTKHTML_REVISION):$(GTKHTML_AGE) -no-undefined -libgtkhtml_3_8_la_LIBADD = $(GTKHTML_LIBS) ../a11y/libgtkhtml-a11y.la $(GAIL_LIBS) $(REGEX_LIBS) +libgtkhtml_3_8_la_LIBADD = $(GTKHTML_LIBS) ../a11y/libgtkhtml-a11y.la $(GAIL_LIBS) $(REGEX_LIBS) -llcms -lexif dist-hook: mkdir $(distdir)/tests @@ -226,13 +226,13 @@ #testgtkhtml_LDFLAGS = -static testgtkhtml_LDADD = \ libgtkhtml-@GTKHTML_API_VERSION@.la \ - $(SOUP_LIBS) + $(SOUP_LIBS) -llcms -lexif gtest_SOURCES = \ test.c gtest_LDFLAGS = gtest_LDADD = \ - libgtkhtml-@GTKHTML_API_VERSION@.la + libgtkhtml-@GTKHTML_API_VERSION@.la -llcms %-@GTKHTML_API_VERSION@.pc: %.pc cp $< $@ @@ -241,13 +241,13 @@ test-suite.c test_suite_LDFLAGS = test_suite_LDADD = \ - libgtkhtml-@GTKHTML_API_VERSION@.la + libgtkhtml-@GTKHTML_API_VERSION@.la -llcms test_stress_SOURCES = \ test-stress.c test_stress_LDFLAGS = test_stress_LDADD = \ - libgtkhtml-@GTKHTML_API_VERSION@.la + libgtkhtml-@GTKHTML_API_VERSION@.la -llcms pkgconfig_in_files = libgtkhtml.pc.in pkgconfigdir = $(libdir)/pkgconfig Index: gtkhtml-3.10.0/src/htmlplainpainter.c =================================================================== --- gtkhtml-3.10.0/src/htmlplainpainter.c (revision 8482) +++ gtkhtml-3.10.0/src/htmlplainpainter.c (working copy) @@ -17,7 +17,7 @@ along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ +l*/ #include #include @@ -48,6 +48,7 @@ draw_background (HTMLPainter *painter, GdkColor *color, GdkPixbuf *pixbuf, + HTMLImagePointer *ip, gint x, gint y, gint width, gint height, gint tile_x, gint tile_y) @@ -87,6 +88,7 @@ static void draw_pixmap (HTMLPainter *painter, GdkPixbuf *pixbuf, + HTMLImagePointer *ip, gint x, gint y, gint scale_width, gint scale_height, const GdkColor *color) Index: gtkhtml-3.10.0/src/htmlcluev.c =================================================================== --- gtkhtml-3.10.0/src/htmlcluev.c (revision 8482) +++ gtkhtml-3.10.0/src/htmlcluev.c (working copy) @@ -389,7 +389,7 @@ html_painter_alloc_color (p, &cluev->background_color->color); html_painter_draw_background (p, &cluev->background_color->color, - NULL, tx + paint.x, ty + paint.y, paint.width, paint.height, 0, 0); + NULL, NULL, tx + paint.x, ty + paint.y, paint.width, paint.height, 0, 0); } HTML_OBJECT_CLASS (&html_clue_class)->draw (o, Index: gtkhtml-3.10.0/src/htmlprinter.c =================================================================== --- gtkhtml-3.10.0/src/htmlprinter.c (revision 8482) +++ gtkhtml-3.10.0/src/htmlprinter.c (working copy) @@ -447,6 +447,7 @@ draw_background (HTMLPainter *painter, GdkColor *color, GdkPixbuf *pixbuf, + HTMLImagePointer *ip, gint ix, gint iy, gint pix_width, gint pix_height, gint tile_x, gint tile_y) @@ -501,7 +502,7 @@ } static void -draw_pixmap (HTMLPainter *painter, GdkPixbuf *pixbuf, gint x, gint y, gint scale_width, gint scale_height, const GdkColor *color) +draw_pixmap (HTMLPainter *painter, GdkPixbuf *pixbuf, HTMLImagePointer *ip, gint x, gint y, gint scale_width, gint scale_height, const GdkColor *color) { HTMLPrinter *printer; double print_x, print_y; Index: gtkhtml-3.10.0/src/gtkhtml.c =================================================================== --- gtkhtml-3.10.0/src/gtkhtml.c (revision 8482) +++ gtkhtml-3.10.0/src/gtkhtml.c (working copy) @@ -3094,6 +3094,8 @@ html_class->cursor_move = cursor_move; html_class->command = command; + html_class->sRGB_profile = cmsCreate_sRGBProfile (); + add_bindings (klass); gtk_html_accessibility_init (); Index: gtkhtml-3.10.0/src/gtkhtml.h =================================================================== --- gtkhtml-3.10.0/src/gtkhtml.h (revision 8482) +++ gtkhtml-3.10.0/src/gtkhtml.h (working copy) @@ -28,6 +28,8 @@ #include #include +#include + #include "gtkhtml-types.h" #include "gtkhtml-enums.h" @@ -109,6 +111,9 @@ GtkHTMLClassProperties *properties; GtkBindingSet *emacs_bindings; gboolean use_emacs_bindings; + + /* color management */ + cmsHPROFILE sRGB_profile; }; struct _GtkHTMLEditorAPI Index: gtkhtml-3.10.0/src/htmlpainter.c =================================================================== --- gtkhtml-3.10.0/src/htmlpainter.c (revision 8482) +++ gtkhtml-3.10.0/src/htmlpainter.c (working copy) @@ -688,6 +688,7 @@ void html_painter_draw_pixmap (HTMLPainter *painter, GdkPixbuf *pixbuf, + HTMLImagePointer *ip, gint x, gint y, gint scale_width, gint scale_height, const GdkColor *color) @@ -696,7 +697,7 @@ g_return_if_fail (HTML_IS_PAINTER (painter)); g_return_if_fail (pixbuf != NULL); - (* HP_CLASS (painter)->draw_pixmap) (painter, pixbuf, x, y, scale_width, scale_height, color); + (* HP_CLASS (painter)->draw_pixmap) (painter, pixbuf, ip, x, y, scale_width, scale_height, color); } void @@ -800,6 +801,7 @@ html_painter_draw_background (HTMLPainter *painter, GdkColor *color, GdkPixbuf *pixbuf, + HTMLImagePointer *ip, gint x, gint y, gint width, gint height, gint tile_x, gint tile_y) @@ -807,7 +809,7 @@ g_return_if_fail (painter != NULL); g_return_if_fail (HTML_IS_PAINTER (painter)); - (* HP_CLASS (painter)->draw_background) (painter, color, pixbuf, x, y, width, height, tile_x, tile_y); + (* HP_CLASS (painter)->draw_background) (painter, color, pixbuf, ip, x, y, width, height, tile_x, tile_y); } guint Index: gtkhtml-3.10.0/src/htmlpainter.h =================================================================== --- gtkhtml-3.10.0/src/htmlpainter.h (revision 8482) +++ gtkhtml-3.10.0/src/htmlpainter.h (working copy) @@ -77,7 +77,7 @@ gint (* draw_glyphs) (HTMLPainter *painter, gint x, gint y, PangoItem *item, PangoGlyphString *glyphs, GdkColor *fg, GdkColor *bg); gint (* draw_spell_error) (HTMLPainter *painter, int x, int y, int width); void (* fill_rect) (HTMLPainter *painter, gint x, gint y, gint width, gint height); - void (* draw_pixmap) (HTMLPainter *painter, GdkPixbuf *pixbuf, + void (* draw_pixmap) (HTMLPainter *painter, GdkPixbuf *pixbuf, HTMLImagePointer *ip, gint x, gint y, gint scale_width, gint scale_height, @@ -91,7 +91,7 @@ HTMLBorderStyle style, gint bordersize); void (* set_clip_rectangle) (HTMLPainter *painter, gint x, gint y, gint width, gint height); - void (* draw_background) (HTMLPainter *painter, GdkColor *color, GdkPixbuf *pixbuf, + void (* draw_background) (HTMLPainter *painter, GdkColor *color, GdkPixbuf *pixbuf, HTMLImagePointer *ip, gint x, gint y, gint width, gint height, gint tile_x, gint tile_y); guint (* get_pixel_size) (HTMLPainter *painter); void (* draw_embedded) (HTMLPainter *painter, HTMLEmbedded *element, gint x, gint y); @@ -203,6 +203,7 @@ gint height); void html_painter_draw_pixmap (HTMLPainter *painter, GdkPixbuf *pixbuf, + HTMLImagePointer *ip, gint x, gint y, gint scale_width, @@ -245,6 +246,7 @@ void html_painter_draw_background (HTMLPainter *painter, GdkColor *color, GdkPixbuf *pixbuf, + HTMLImagePointer *ip, gint x, gint y, gint width,