diff options
Diffstat (limited to 'openembedded/packages/gtkhtml2/files/fix-recreation.patch')
| -rw-r--r-- | openembedded/packages/gtkhtml2/files/fix-recreation.patch | 407 |
1 files changed, 407 insertions, 0 deletions
diff --git a/openembedded/packages/gtkhtml2/files/fix-recreation.patch b/openembedded/packages/gtkhtml2/files/fix-recreation.patch new file mode 100644 index 0000000000..3bc636bae9 --- /dev/null +++ b/openembedded/packages/gtkhtml2/files/fix-recreation.patch | |||
| @@ -0,0 +1,407 @@ | |||
| 1 | Index: gtkhtml2/libgtkhtml/document/htmldocument.c | ||
| 2 | =================================================================== | ||
| 3 | --- gtkhtml2.orig/libgtkhtml/document/htmldocument.c 2006-01-25 19:19:23.000000000 +0000 | ||
| 4 | +++ gtkhtml2/libgtkhtml/document/htmldocument.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 5 | @@ -110,11 +110,6 @@ | ||
| 6 | |||
| 7 | if (style_change != HTML_STYLE_CHANGE_NONE) { | ||
| 8 | |||
| 9 | - /* FIXME: Workaround bug #199, we don't support recreation | ||
| 10 | - * of dom nodes and layout boxes / jonas | ||
| 11 | - */ | ||
| 12 | - new_style->display = node->style->display; | ||
| 13 | - | ||
| 14 | html_style_ref (new_style); | ||
| 15 | html_style_unref (node->style); | ||
| 16 | node->style = new_style; | ||
| 17 | Index: gtkhtml2/libgtkhtml/layout/htmlboxfactory.c | ||
| 18 | =================================================================== | ||
| 19 | --- gtkhtml2.orig/libgtkhtml/layout/htmlboxfactory.c 2006-01-25 19:19:23.000000000 +0000 | ||
| 20 | +++ gtkhtml2/libgtkhtml/layout/htmlboxfactory.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 21 | @@ -99,7 +99,7 @@ | ||
| 22 | |||
| 23 | |||
| 24 | HtmlBox * | ||
| 25 | -html_box_factory_new_box (HtmlView *view, DomNode *node) | ||
| 26 | +html_box_factory_new_box (HtmlView *view, DomNode *node, gboolean force_new) | ||
| 27 | { | ||
| 28 | HtmlBox *box = NULL, *parent_box; | ||
| 29 | HtmlStyle *style = node->style, *parent_style = NULL; | ||
| 30 | @@ -117,7 +117,7 @@ | ||
| 31 | |||
| 32 | box = parent_box->children; | ||
| 33 | |||
| 34 | - while (box) { | ||
| 35 | + while (box && !force_new) { | ||
| 36 | if (HTML_IS_BOX_TEXT (box) && box->dom_node == node) { | ||
| 37 | |||
| 38 | html_box_text_set_text (HTML_BOX_TEXT (box), node->xmlnode->content); | ||
| 39 | Index: gtkhtml2/libgtkhtml/layout/htmlboxfactory.h | ||
| 40 | =================================================================== | ||
| 41 | --- gtkhtml2.orig/libgtkhtml/layout/htmlboxfactory.h 2006-01-25 19:19:23.000000000 +0000 | ||
| 42 | +++ gtkhtml2/libgtkhtml/layout/htmlboxfactory.h 2006-01-25 19:21:10.000000000 +0000 | ||
| 43 | @@ -33,7 +33,7 @@ | ||
| 44 | |||
| 45 | HtmlBox * html_box_factory_get_box (HtmlView *view, DomNode *node, HtmlBox *parent_box); | ||
| 46 | HtmlStyleChange html_box_factory_restyle_box (HtmlView *view, HtmlBox *box, HtmlAtom pseudo); | ||
| 47 | -HtmlBox * html_box_factory_new_box (HtmlView *view, DomNode *node); | ||
| 48 | +HtmlBox * html_box_factory_new_box (HtmlView *view, DomNode *node, gboolean force_new); | ||
| 49 | |||
| 50 | G_END_DECLS | ||
| 51 | |||
| 52 | Index: gtkhtml2/libgtkhtml/layout/htmlstyle.c | ||
| 53 | =================================================================== | ||
| 54 | --- gtkhtml2.orig/libgtkhtml/layout/htmlstyle.c 2006-01-25 19:19:23.000000000 +0000 | ||
| 55 | +++ gtkhtml2/libgtkhtml/layout/htmlstyle.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 56 | @@ -416,7 +416,7 @@ | ||
| 57 | html_style_compare (const HtmlStyle *s1, const HtmlStyle *s2) | ||
| 58 | { | ||
| 59 | /* RECREATE begin */ | ||
| 60 | - if (s1->display != s1->display) | ||
| 61 | + if (s1->display != s2->display) | ||
| 62 | return HTML_STYLE_CHANGE_RECREATE; | ||
| 63 | /* RECREATE end */ | ||
| 64 | |||
| 65 | Index: gtkhtml2/libgtkhtml/view/htmlview.c | ||
| 66 | =================================================================== | ||
| 67 | --- gtkhtml2.orig/libgtkhtml/view/htmlview.c 2006-01-25 19:19:23.000000000 +0000 | ||
| 68 | +++ gtkhtml2/libgtkhtml/view/htmlview.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 69 | @@ -1908,7 +1908,7 @@ | ||
| 70 | |||
| 71 | g_assert (node->style != NULL); | ||
| 72 | |||
| 73 | - new_box = html_box_factory_new_box (view, node); | ||
| 74 | + new_box = html_box_factory_new_box (view, node, FALSE); | ||
| 75 | |||
| 76 | if (new_box) { | ||
| 77 | |||
| 78 | @@ -2001,8 +2001,9 @@ | ||
| 79 | html_view_remove_layout_box (view, box->dom_node); | ||
| 80 | |||
| 81 | /* Check if we're trying to remove the root box */ | ||
| 82 | - if (box == view->root) | ||
| 83 | + if (box == view->root) { | ||
| 84 | view->root = NULL; | ||
| 85 | + } | ||
| 86 | |||
| 87 | html_box_remove (box); | ||
| 88 | g_object_unref (G_OBJECT (box)); | ||
| 89 | @@ -2131,6 +2132,56 @@ | ||
| 90 | } | ||
| 91 | |||
| 92 | switch (style_change) { | ||
| 93 | + case HTML_STYLE_CHANGE_RECREATE: { | ||
| 94 | + HtmlBox *new_box = NULL; | ||
| 95 | + | ||
| 96 | + /* Don't replace boxes where display: none has been set */ | ||
| 97 | + if (style->display == HTML_DISPLAY_NONE) { | ||
| 98 | + html_view_removed (document, node, view); | ||
| 99 | + break; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + new_box = html_box_factory_new_box (view, node, TRUE); | ||
| 103 | + g_assert (new_box); | ||
| 104 | + | ||
| 105 | + new_box->dom_node = node; | ||
| 106 | + g_object_add_weak_pointer (G_OBJECT (node), (gpointer *)&(new_box->dom_node)); | ||
| 107 | + new_box->next = box->next; | ||
| 108 | + new_box->prev = box->prev; | ||
| 109 | + new_box->parent = box->parent; | ||
| 110 | + new_box->children = box->children; | ||
| 111 | + | ||
| 112 | + if (box->next) box->next->prev = new_box; | ||
| 113 | + if (box->prev) box->prev->next = new_box; | ||
| 114 | + if (box->parent) | ||
| 115 | + if (box->parent->children == box) | ||
| 116 | + box->parent->children = new_box; | ||
| 117 | + if (box->children) { | ||
| 118 | + HtmlBox *child = box->children; | ||
| 119 | + while (child) { | ||
| 120 | + if (child->parent == box) | ||
| 121 | + child->parent = new_box; | ||
| 122 | + child = child->prev; | ||
| 123 | + } | ||
| 124 | + child = box->children->next; | ||
| 125 | + while (child) { | ||
| 126 | + if (child->parent == box) | ||
| 127 | + child->parent = new_box; | ||
| 128 | + child = child->next; | ||
| 129 | + } | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + if (view->root == box) | ||
| 133 | + view->root = new_box; | ||
| 134 | + | ||
| 135 | + html_view_remove_layout_box (view, node); | ||
| 136 | + g_object_unref (box); | ||
| 137 | + | ||
| 138 | + html_box_handle_html_properties (new_box, node->xmlnode); | ||
| 139 | + html_view_add_layout_box (view, node, new_box); | ||
| 140 | + html_view_relayout_callback (document, node, view); | ||
| 141 | + break; | ||
| 142 | + } | ||
| 143 | case HTML_STYLE_CHANGE_REPAINT: | ||
| 144 | html_view_repaint_callback (document, node, view); | ||
| 145 | break; | ||
| 146 | Index: gtkhtml2/libgtkhtml/css/cssmatcher.c | ||
| 147 | =================================================================== | ||
| 148 | --- gtkhtml2.orig/libgtkhtml/css/cssmatcher.c 2006-01-25 19:19:23.000000000 +0000 | ||
| 149 | +++ gtkhtml2/libgtkhtml/css/cssmatcher.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 150 | @@ -2781,7 +2781,7 @@ | ||
| 151 | } | ||
| 152 | } | ||
| 153 | if (strcasecmp ("table", n->name) == 0) { | ||
| 154 | - if ((str = xmlGetProp (n, "align"))) { | ||
| 155 | + if ((style->display != HTML_DISPLAY_BLOCK) && (str = xmlGetProp (n, "align"))) { | ||
| 156 | if (strcasecmp (str, "left") == 0) | ||
| 157 | style->Float = HTML_FLOAT_LEFT; | ||
| 158 | else if (strcasecmp (str, "right") == 0) | ||
| 159 | Index: gtkhtml2/libgtkhtml/layout/htmlbox.c | ||
| 160 | =================================================================== | ||
| 161 | --- gtkhtml2.orig/libgtkhtml/layout/htmlbox.c 2006-01-25 19:21:09.000000000 +0000 | ||
| 162 | +++ gtkhtml2/libgtkhtml/layout/htmlbox.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 163 | @@ -308,7 +308,7 @@ | ||
| 164 | else if (style->surround->margin.left.type != HTML_LENGTH_AUTO && | ||
| 165 | style->surround->margin.right.type != HTML_LENGTH_AUTO) { | ||
| 166 | |||
| 167 | - if (HTML_BOX_GET_STYLE (box->parent)->inherited->direction == HTML_DIRECTION_RTL) { | ||
| 168 | + if (HTML_BOX_GET_STYLE (html_box_get_containing_block (box))->inherited->direction == HTML_DIRECTION_RTL) { | ||
| 169 | |||
| 170 | return width - html_length_get_value (&style->box->width, width) - | ||
| 171 | html_box_left_padding (box, width) - html_box_right_padding (box, width) - | ||
| 172 | @@ -348,7 +348,7 @@ | ||
| 173 | else if (style->surround->margin.left.type != HTML_LENGTH_AUTO && | ||
| 174 | style->surround->margin.right.type != HTML_LENGTH_AUTO) { | ||
| 175 | |||
| 176 | - if (HTML_BOX_GET_STYLE (box->parent)->inherited->direction == HTML_DIRECTION_LTR) { | ||
| 177 | + if (HTML_BOX_GET_STYLE (html_box_get_containing_block (box))->inherited->direction == HTML_DIRECTION_LTR) { | ||
| 178 | |||
| 179 | return width - html_length_get_value (&style->box->width, width) - | ||
| 180 | html_box_left_padding (box, width) - html_box_right_padding (box, width) - | ||
| 181 | @@ -820,35 +820,36 @@ | ||
| 182 | int tmp; | ||
| 183 | gint old_width = *boxwidth; | ||
| 184 | gint old_height = *boxheight; | ||
| 185 | + HtmlBox *parent = html_box_get_containing_block (self); | ||
| 186 | |||
| 187 | - if (self->parent) { | ||
| 188 | + if (parent) { | ||
| 189 | if (HTML_BOX_GET_STYLE (self)->box->min_width.type != HTML_LENGTH_AUTO) { | ||
| 190 | - tmp = html_length_get_value (&HTML_BOX_GET_STYLE (self)->box->min_width, self->parent->width - | ||
| 191 | - html_box_horizontal_mbp_sum (self->parent) - html_box_horizontal_mbp_sum (self)); | ||
| 192 | + tmp = html_length_get_value (&HTML_BOX_GET_STYLE (self)->box->min_width, parent->width - | ||
| 193 | + html_box_horizontal_mbp_sum (parent) - html_box_horizontal_mbp_sum (self)); | ||
| 194 | if (*boxwidth < tmp) | ||
| 195 | *boxwidth = tmp; | ||
| 196 | |||
| 197 | } | ||
| 198 | |||
| 199 | if (HTML_BOX_GET_STYLE (self)->box->max_width.type != HTML_LENGTH_AUTO) { | ||
| 200 | - tmp = html_length_get_value (&HTML_BOX_GET_STYLE (self)->box->max_width, self->parent->width - | ||
| 201 | - html_box_horizontal_mbp_sum (self->parent) - html_box_horizontal_mbp_sum (self)); | ||
| 202 | + tmp = html_length_get_value (&HTML_BOX_GET_STYLE (self)->box->max_width, parent->width - | ||
| 203 | + html_box_horizontal_mbp_sum (parent) - html_box_horizontal_mbp_sum (self)); | ||
| 204 | if (*boxwidth > tmp) | ||
| 205 | *boxwidth = tmp; | ||
| 206 | |||
| 207 | } | ||
| 208 | |||
| 209 | if (HTML_BOX_GET_STYLE (self)->box->min_height.type != HTML_LENGTH_AUTO) { | ||
| 210 | - tmp = html_length_get_value (&HTML_BOX_GET_STYLE (self)->box->min_height, self->parent->height - | ||
| 211 | - html_box_horizontal_mbp_sum (self->parent) - html_box_horizontal_mbp_sum (self)); | ||
| 212 | + tmp = html_length_get_value (&HTML_BOX_GET_STYLE (self)->box->min_height, parent->height - | ||
| 213 | + html_box_horizontal_mbp_sum (parent) - html_box_horizontal_mbp_sum (self)); | ||
| 214 | if (*boxheight < tmp) | ||
| 215 | *boxheight = tmp; | ||
| 216 | |||
| 217 | } | ||
| 218 | |||
| 219 | if (HTML_BOX_GET_STYLE (self)->box->max_height.type != HTML_LENGTH_AUTO) { | ||
| 220 | - tmp = html_length_get_value (&HTML_BOX_GET_STYLE (self)->box->max_height, self->parent->height - | ||
| 221 | - html_box_horizontal_mbp_sum (self->parent) - html_box_horizontal_mbp_sum (self)); | ||
| 222 | + tmp = html_length_get_value (&HTML_BOX_GET_STYLE (self)->box->max_height, parent->height - | ||
| 223 | + html_box_horizontal_mbp_sum (parent) - html_box_horizontal_mbp_sum (self)); | ||
| 224 | if (*boxheight > tmp) | ||
| 225 | *boxheight = tmp; | ||
| 226 | |||
| 227 | Index: gtkhtml2/libgtkhtml/layout/htmlboxblock.c | ||
| 228 | =================================================================== | ||
| 229 | --- gtkhtml2.orig/libgtkhtml/layout/htmlboxblock.c 2006-01-25 19:19:23.000000000 +0000 | ||
| 230 | +++ gtkhtml2/libgtkhtml/layout/htmlboxblock.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 231 | @@ -358,8 +358,7 @@ | ||
| 232 | |||
| 233 | /* Get the prefered width */ | ||
| 234 | /* If the width wasn't specified by CSS, use the width of the containing box (parent) */ | ||
| 235 | - | ||
| 236 | - if (self->parent) { | ||
| 237 | + if (html_box_get_containing_block (self)) { | ||
| 238 | |||
| 239 | if (style->Float != HTML_FLOAT_NONE) | ||
| 240 | new_width = html_length_get_value (&style->box->width, html_box_get_containing_block_width (self)); | ||
| 241 | Index: gtkhtml2/libgtkhtml/graphics/htmlimagefactory.c | ||
| 242 | =================================================================== | ||
| 243 | --- gtkhtml2.orig/libgtkhtml/graphics/htmlimagefactory.c 2006-01-25 19:19:23.000000000 +0000 | ||
| 244 | +++ gtkhtml2/libgtkhtml/graphics/htmlimagefactory.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 245 | @@ -127,7 +127,7 @@ | ||
| 246 | } | ||
| 247 | |||
| 248 | static void | ||
| 249 | -html_image_shutdown (HtmlImage *image, HtmlImageFactory *image_factory) | ||
| 250 | +html_image_shutdown (HtmlImageFactory *image_factory, HtmlImage *image) | ||
| 251 | { | ||
| 252 | g_hash_table_remove (image_factory->image_hash, image->uri); | ||
| 253 | } | ||
| 254 | @@ -146,8 +146,7 @@ | ||
| 255 | |||
| 256 | image = HTML_IMAGE (g_object_new (HTML_IMAGE_TYPE, NULL)); | ||
| 257 | |||
| 258 | - g_signal_connect (G_OBJECT (image), "last_unref", | ||
| 259 | - G_CALLBACK (html_image_shutdown), image_factory); | ||
| 260 | + g_object_weak_ref (G_OBJECT (image), (GWeakNotify)html_image_shutdown, image_factory); | ||
| 261 | |||
| 262 | image->loading = TRUE; | ||
| 263 | |||
| 264 | Index: gtkhtml2/libgtkhtml/layout/html/htmlboxembeddedimage.c | ||
| 265 | =================================================================== | ||
| 266 | --- gtkhtml2.orig/libgtkhtml/layout/html/htmlboxembeddedimage.c 2006-01-25 19:19:23.000000000 +0000 | ||
| 267 | +++ gtkhtml2/libgtkhtml/layout/html/htmlboxembeddedimage.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 268 | @@ -64,25 +64,36 @@ | ||
| 269 | } | ||
| 270 | |||
| 271 | static void | ||
| 272 | -html_box_embedded_image_class_init (HtmlBoxClass *klass) | ||
| 273 | +html_box_embedded_image_resize_image (HtmlImage *image, HtmlBoxEmbeddedImage *box) | ||
| 274 | { | ||
| 275 | - | ||
| 276 | - klass->paint = html_box_embedded_image_paint; | ||
| 277 | - klass->relayout = html_box_embedded_image_relayout; | ||
| 278 | + g_signal_emit_by_name (G_OBJECT (box->view->document), "relayout_node", HTML_BOX (box)->dom_node); | ||
| 279 | +} | ||
| 280 | |||
| 281 | - parent_class = g_type_class_peek_parent (klass); | ||
| 282 | +static void | ||
| 283 | +html_box_embedded_image_repaint_image (HtmlImage *image, gint x, gint y, gint width, gint height, HtmlBoxEmbeddedImage *box) | ||
| 284 | +{ | ||
| 285 | + g_signal_emit_by_name (G_OBJECT (box->view->document), "repaint_node", HTML_BOX (box)->dom_node); | ||
| 286 | } | ||
| 287 | |||
| 288 | static void | ||
| 289 | -html_box_embedded_image_resize_image (HtmlImage *image, HtmlBoxEmbeddedImage *box) | ||
| 290 | +html_box_embedded_image_finalize (GObject *object) | ||
| 291 | { | ||
| 292 | - g_signal_emit_by_name (G_OBJECT (box->view->document), "relayout_node", HTML_BOX (box)->dom_node); | ||
| 293 | + HtmlBoxEmbeddedImage *image = HTML_BOX_EMBEDDED_IMAGE (object); | ||
| 294 | + | ||
| 295 | + g_signal_handlers_disconnect_by_func (G_OBJECT (image->image), G_CALLBACK (html_box_embedded_image_resize_image), image); | ||
| 296 | + g_signal_handlers_disconnect_by_func (G_OBJECT (image->image), G_CALLBACK (html_box_embedded_image_repaint_image), image); | ||
| 297 | } | ||
| 298 | |||
| 299 | static void | ||
| 300 | -html_box_embedded_image_repaint_image (HtmlImage *image, gint x, gint y, gint width, gint height, HtmlBoxEmbeddedImage *box) | ||
| 301 | +html_box_embedded_image_class_init (HtmlBoxClass *klass) | ||
| 302 | { | ||
| 303 | - g_signal_emit_by_name (G_OBJECT (box->view->document), "repaint_node", HTML_BOX (box)->dom_node); | ||
| 304 | + GObjectClass *object_class = (GObjectClass *)klass; | ||
| 305 | + | ||
| 306 | + klass->paint = html_box_embedded_image_paint; | ||
| 307 | + klass->relayout = html_box_embedded_image_relayout; | ||
| 308 | + object_class->finalize = html_box_embedded_image_finalize; | ||
| 309 | + | ||
| 310 | + parent_class = g_type_class_peek_parent (klass); | ||
| 311 | } | ||
| 312 | |||
| 313 | void | ||
| 314 | Index: gtkhtml2/libgtkhtml/layout/htmlboxtext.c | ||
| 315 | =================================================================== | ||
| 316 | --- gtkhtml2.orig/libgtkhtml/layout/htmlboxtext.c 2006-01-25 19:19:23.000000000 +0000 | ||
| 317 | +++ gtkhtml2/libgtkhtml/layout/htmlboxtext.c 2006-01-25 19:21:10.000000000 +0000 | ||
| 318 | @@ -146,6 +146,7 @@ | ||
| 319 | |||
| 320 | master = text->master; | ||
| 321 | if (master) { | ||
| 322 | + html_box_text_destroy_slaves (text); | ||
| 323 | html_box_text_free_master (master); | ||
| 324 | g_free (master); | ||
| 325 | text->master = NULL; | ||
| 326 | Index: gtkhtml2/libgtkhtml/layout/html/htmlboximage.c | ||
| 327 | =================================================================== | ||
| 328 | --- gtkhtml2.orig/libgtkhtml/layout/html/htmlboximage.c 2006-01-25 19:21:09.000000000 +0000 | ||
| 329 | +++ gtkhtml2/libgtkhtml/layout/html/htmlboximage.c 2006-01-25 19:21:33.000000000 +0000 | ||
| 330 | @@ -195,10 +195,41 @@ | ||
| 331 | } | ||
| 332 | |||
| 333 | static void | ||
| 334 | +html_box_image_resize_image (HtmlImage *image, HtmlBoxImage *box) | ||
| 335 | +{ | ||
| 336 | + g_signal_emit_by_name (G_OBJECT (box->view->document), "relayout_node", HTML_BOX (box)->dom_node); | ||
| 337 | +} | ||
| 338 | + | ||
| 339 | +static void | ||
| 340 | +html_box_image_repaint_image (HtmlImage *image, gint x, gint y, gint width, gint height, HtmlBoxImage *box) | ||
| 341 | +{ | ||
| 342 | + gdouble real_x, real_y; | ||
| 343 | + gdouble real_width, real_height; | ||
| 344 | + | ||
| 345 | + if (box->scaled_pixbuf && image->pixbuf) { | ||
| 346 | + | ||
| 347 | + html_box_image_update_scaled_pixbuf (box, gdk_pixbuf_get_width (box->scaled_pixbuf), gdk_pixbuf_get_height (box->scaled_pixbuf)); | ||
| 348 | + real_y = (y * gdk_pixbuf_get_height (box->scaled_pixbuf)) / (gdouble)gdk_pixbuf_get_height (image->pixbuf); | ||
| 349 | + real_x = (x * gdk_pixbuf_get_width (box->scaled_pixbuf)) / (gdouble)gdk_pixbuf_get_width (image->pixbuf); | ||
| 350 | + | ||
| 351 | + real_height = (height * gdk_pixbuf_get_height (box->scaled_pixbuf)) / (gdouble)gdk_pixbuf_get_height (image->pixbuf); | ||
| 352 | + real_width = (width * gdk_pixbuf_get_width (box->scaled_pixbuf)) / (gdouble)gdk_pixbuf_get_width (image->pixbuf); | ||
| 353 | + | ||
| 354 | + gtk_widget_queue_draw_area (GTK_WIDGET (box->view), | ||
| 355 | + html_box_get_absolute_x (HTML_BOX (box)), /* + floor (real_x + 0.5),*/ | ||
| 356 | + html_box_get_absolute_y (HTML_BOX (box)),/* + floor (real_y + 0.5),*/ | ||
| 357 | + floor (real_width + real_x + 0.5), | ||
| 358 | + floor (real_height + real_y + 0.5)); | ||
| 359 | + } | ||
| 360 | +} | ||
| 361 | + | ||
| 362 | +static void | ||
| 363 | html_box_image_finalize (GObject *object) | ||
| 364 | { | ||
| 365 | HtmlBoxImage *image = HTML_BOX_IMAGE (object); | ||
| 366 | |||
| 367 | + g_signal_handlers_disconnect_by_func (G_OBJECT (image->image), G_CALLBACK (html_box_image_resize_image), image); | ||
| 368 | + g_signal_handlers_disconnect_by_func (G_OBJECT (image->image), G_CALLBACK (html_box_image_repaint_image), image); | ||
| 369 | if (image->scaled_pixbuf) | ||
| 370 | g_object_unref (image->scaled_pixbuf); | ||
| 371 | |||
| 372 | @@ -262,35 +293,6 @@ | ||
| 373 | return HTML_BOX (box); | ||
| 374 | } | ||
| 375 | |||
| 376 | -static void | ||
| 377 | -html_box_image_resize_image (HtmlImage *image, HtmlBoxImage *box) | ||
| 378 | -{ | ||
| 379 | - g_signal_emit_by_name (G_OBJECT (box->view->document), "relayout_node", HTML_BOX (box)->dom_node); | ||
| 380 | -} | ||
| 381 | - | ||
| 382 | -static void | ||
| 383 | -html_box_image_repaint_image (HtmlImage *image, gint x, gint y, gint width, gint height, HtmlBoxImage *box) | ||
| 384 | -{ | ||
| 385 | - gdouble real_x, real_y; | ||
| 386 | - gdouble real_width, real_height; | ||
| 387 | - | ||
| 388 | - if (box->scaled_pixbuf && image->pixbuf) { | ||
| 389 | - | ||
| 390 | - html_box_image_update_scaled_pixbuf (box, gdk_pixbuf_get_width (box->scaled_pixbuf), gdk_pixbuf_get_height (box->scaled_pixbuf)); | ||
| 391 | - real_y = (y * gdk_pixbuf_get_height (box->scaled_pixbuf)) / (gdouble)gdk_pixbuf_get_height (image->pixbuf); | ||
| 392 | - real_x = (x * gdk_pixbuf_get_width (box->scaled_pixbuf)) / (gdouble)gdk_pixbuf_get_width (image->pixbuf); | ||
| 393 | - | ||
| 394 | - real_height = (height * gdk_pixbuf_get_height (box->scaled_pixbuf)) / (gdouble)gdk_pixbuf_get_height (image->pixbuf); | ||
| 395 | - real_width = (width * gdk_pixbuf_get_width (box->scaled_pixbuf)) / (gdouble)gdk_pixbuf_get_width (image->pixbuf); | ||
| 396 | - | ||
| 397 | - gtk_widget_queue_draw_area (GTK_WIDGET (box->view), | ||
| 398 | - html_box_get_absolute_x (HTML_BOX (box)), /* + floor (real_x + 0.5),*/ | ||
| 399 | - html_box_get_absolute_y (HTML_BOX (box)),/* + floor (real_y + 0.5),*/ | ||
| 400 | - floor (real_width + real_x + 0.5), | ||
| 401 | - floor (real_height + real_y + 0.5)); | ||
| 402 | - } | ||
| 403 | -} | ||
| 404 | - | ||
| 405 | void | ||
| 406 | html_box_image_set_image (HtmlBoxImage *box, HtmlImage *image) | ||
| 407 | { | ||
