aboutsummaryrefslogtreecommitdiff
path: root/src/render.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-03-28 18:35:24 +0200
committerThomas White <taw@bitwiz.org.uk>2016-03-28 18:35:24 +0200
commit4def920737575625a8336a41a4310cc52052ce01 (patch)
tree913bc133a0b435918452edcc207af8ce23a8d2bb /src/render.c
parent3bebe8b1c2fec41a9c33b7310f27804bc1062db6 (diff)
Restore callbacks
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c104
1 files changed, 0 insertions, 104 deletions
diff --git a/src/render.c b/src/render.c
index d64c8ed..d3dfa01 100644
--- a/src/render.c
+++ b/src/render.c
@@ -43,110 +43,6 @@
#include "imagestore.h"
-#if 0
-static void render_callback_box(cairo_t *cr, struct wrap_box *box)
-{
- double ascd;
- double x, y, w, h;
-
- cairo_surface_t *surf;
-
- cairo_save(cr);
-
- ascd = pango_units_to_double(box->ascent);
-
- /* This is how wide the image should be in Cairo units */
- w = pango_units_to_double(box->width);
- h = pango_units_to_double(box->height);
- cairo_user_to_device_distance(cr, &w, &h);
- /* w is now how wide the image should be in pixels */
-
- surf = box->draw_func(w, h, box->bvp, box->vp);
-
- cairo_new_path(cr);
- x = 0.0; y = -ascd;
- cairo_user_to_device(cr, &x, &y);
- x = rint(x); y = rint(y);
- cairo_device_to_user(cr, &x, &y);
- cairo_rectangle(cr, x, y, pango_units_to_double(box->width),
- pango_units_to_double(box->height));
- cairo_clip_preserve(cr);
-
- if ( surf == NULL ) {
- cairo_set_source_rgba(cr, 1.0, 0.0, 0.0, 1.0);
- fprintf(stderr, "Null surface box");
- } else {
- cairo_set_source_surface(cr, surf, x, y);
- }
-
- cairo_paint(cr);
- cairo_reset_clip(cr);
-
- cairo_new_path(cr);
- cairo_rectangle(cr, x+0.5, y+0.5, pango_units_to_double(box->width),
- pango_units_to_double(box->height));
- cairo_set_line_width(cr, 1.0);
- cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
- cairo_stroke(cr);
- cairo_restore(cr);
-
- cairo_surface_destroy(surf);
-}
-#endif
-
-
-#if 0
-static void render_image_box(cairo_t *cr, struct wrap_box *box, ImageStore *is,
- enum is_size isz)
-{
- cairo_surface_t *surf;
- double w, h;
- int wi;
- double ascd;
- double x, y;
-
- cairo_save(cr);
-
- ascd = pango_units_to_double(box->ascent);
-
- x = 0.0;
- y = -ascd;
- cairo_user_to_device(cr, &x, &y);
-
- cairo_new_path(cr);
- cairo_rectangle(cr, 0.0, -ascd,
- pango_units_to_double(box->width),
- pango_units_to_double(box->height));
-
- /* This is how wide the image should be in Cairo units */
- w = pango_units_to_double(box->width);
-
- h = 0.0; /* Dummy */
- cairo_user_to_device_distance(cr, &w, &h);
- /* w is now how wide the image should be in pixels */
-
- wi = lrint(w);
-
- surf = lookup_image(is, box->filename, wi, isz);
- //show_imagestore(is);
-
- if ( surf == NULL ) {
- cairo_set_source_rgba(cr, 1.0, 0.0, 0.0, 1.0);
- fprintf(stderr, "Failed to load '%s' at size %i\n",
- box->filename, wi);
- } else {
- cairo_identity_matrix(cr);
- cairo_set_source_surface(cr, surf, x, y);
- }
-
- cairo_fill(cr);
- cairo_restore(cr);
-}
-#endif
-
-
-
-
static void do_background(cairo_t *cr, struct frame *fr)
{
cairo_pattern_t *patt = NULL;