X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Frender.h;h=f2ded79d6c117432cb68a788be0f299084c33ddd;hb=d1d0556e538bf04cb0b991b7acb205c144a2f826;hp=af779843b9209195cc5cab8c77acff87a5bf9224;hpb=f550aee00a62fe1d8baf62d83cd7efef6cc2ee92;p=pspp diff --git a/src/output/render.h b/src/output/render.h index af779843b9..f2ded79d6c 100644 --- a/src/output/render.h +++ b/src/output/render.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009, 2010, 2011, 2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ #include #include -#include +#include "output/table-provider.h" struct table; @@ -44,6 +44,19 @@ struct render_params int (*measure_cell_height) (void *aux, const struct table_cell *cell, int width); + /* Given that there is space measuring WIDTH by HEIGHT to render CELL, + where HEIGHT is insufficient to render the entire height of the cell, + returns the largest height less than HEIGHT at which it is appropriate + to break the cell. For example, if breaking at the specified HEIGHT + would break in the middle of a line of text, the return value would be + just sufficiently less that the breakpoint would be between lines of + text. + + Optional. If NULL, the rendering engine assumes that all breakpoints + are acceptable. */ + int (*adjust_break) (void *aux, const struct table_cell *cell, + int width, int height); + /* Draws a generalized intersection of lines in the rectangle whose top-left corner is (BB[TABLE_HORZ][0], BB[TABLE_VERT][0]) and whose bottom-right corner is (BB[TABLE_HORZ][1], BB[TABLE_VERT][1]). @@ -78,6 +91,11 @@ struct render_params /* Width of different kinds of lines. */ int line_widths[TABLE_N_AXES][RENDER_N_LINES]; + + /* Minimum cell width or height before allowing the cell to be broken + across two pages. (Joined cells may always be broken at join + points.) */ + int min_break[TABLE_N_AXES]; }; /* A "page" of content that is ready to be rendered. @@ -93,14 +111,18 @@ void render_page_unref (struct render_page *); int render_page_get_size (const struct render_page *, enum table_axis); void render_page_draw (const struct render_page *); +void render_page_draw_region (const struct render_page *, + int x, int y, int w, int h); + +int render_page_get_best_breakpoint (const struct render_page *, int height); /* An iterator for breaking render_pages into smaller chunks. */ struct render_break { struct render_page *page; /* Page being broken up. */ enum table_axis axis; /* Axis along which 'page' is being broken. */ - int cell; /* Next cell. */ - int pixel; /* Pixel offset within 'cell' (usually 0). */ + int z; /* Next cell along 'axis'. */ + int pixel; /* Pixel offset within cell 'z' (usually 0). */ int hw; /* Width of headers of 'page' along 'axis'. */ };