psppire-output-view: Consistently apply "transparent" and "systemcolors".
[pspp] / src / output / render.h
index ed5bb1eaf41aefd4c7386fdeb81eb9495745876e..7375d1a2a81b66d78dcda280c110ccfc161ebe21 100644 (file)
@@ -25,9 +25,12 @@ struct table_item;
 
 enum render_line_style
   {
-    RENDER_LINE_NONE,           /* No line. */
-    RENDER_LINE_SINGLE,         /* Single line. */
-    RENDER_LINE_DOUBLE,         /* Double line. */
+    RENDER_LINE_NONE,
+    RENDER_LINE_SINGLE,
+    RENDER_LINE_DASHED,
+    RENDER_LINE_THICK,
+    RENDER_LINE_THIN,
+    RENDER_LINE_DOUBLE,
     RENDER_N_LINES
   };
 
@@ -51,14 +54,6 @@ enum render_line_style
 
    For each of the callback functions, AUX is passed as the 'aux' member of the
    render_params structure.
-
-   The device is expected to transform numerical footnote index numbers into
-   footnote markers.  The existing drivers use str_format_26adic() to transform
-   index 0 to "a", index 1 to "b", and so on.  The FOOTNOTE_IDX supplied to
-   each function is the footnote index number for the first footnote in the
-   cell.  If a cell contains more than one footnote, then the additional
-   footnote indexes increase sequentially, e.g. the second footnote has index
-   FOOTNOTE_IDX + 1.
 */
 struct render_params
   {
@@ -68,12 +63,11 @@ struct render_params
        minimum width required to avoid line breaks other than at new-lines.
        */
     void (*measure_cell_width) (void *aux, const struct table_cell *cell,
-                                int footnote_idx,
                                 int *min_width, int *max_width);
 
     /* Returns the height required to render CELL given a width of WIDTH. */
     int (*measure_cell_height) (void *aux, const struct table_cell *cell,
-                                int footnote_idx, int width);
+                                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,
@@ -86,7 +80,7 @@ struct render_params
        Optional.  If NULL, the rendering engine assumes that all breakpoints
        are acceptable. */
     int (*adjust_break) (void *aux, const struct table_cell *cell,
-                         int footnote_idx, int width, int height);
+                         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
@@ -99,15 +93,24 @@ struct render_params
        STYLES[TABLE_VERT][0]: style of line from left of BB to its center.
        STYLES[TABLE_VERT][1]: style of line from right of BB to its center. */
     void (*draw_line) (void *aux, int bb[TABLE_N_AXES][2],
-                       enum render_line_style styles[TABLE_N_AXES][2]);
+                       enum render_line_style styles[TABLE_N_AXES][2],
+                       struct cell_color colors[TABLE_N_AXES][2]);
 
     /* Draws CELL within bounding box BB.  CLIP is the same as BB (the common
        case) or a subregion enclosed by BB.  In the latter case only the part
        of the cell that lies within CLIP should actually be drawn, although BB
-       should used to determine the layout of the cell. */
-    void (*draw_cell) (void *aux, const struct table_cell *cell,
-                       int footnote_idx,
-                       int bb[TABLE_N_AXES][2], int clip[TABLE_N_AXES][2]);
+       should used to determine the layout of the cell.
+
+       The text in the cell needs to be vertically offset VALIGN_OFFSET units
+       from the top of the bounding box.  This handles vertical alignment with
+       the cell.  (The caller doesn't just reduce the bounding box size because
+       that would prevent the implementation from filling the entire cell with
+       the background color.)  The implementation must handle horizontal
+       alignment itself. */
+    void (*draw_cell) (void *aux, const struct table_cell *cell, int color_idx,
+                       int bb[TABLE_N_AXES][2], int valign_offset,
+                       int spill[TABLE_N_AXES][2],
+                       int clip[TABLE_N_AXES][2]);
 
     /* Auxiliary data passed to each of the above functions. */
     void *aux;
@@ -128,6 +131,15 @@ struct render_params
        across two pages.  (Joined cells may always be broken at join
        points.) */
     int min_break[TABLE_N_AXES];
+
+    /* True if the driver supports cell margins.  (If false, the rendering
+       engine will insert a small space betweeen adjacent cells that don't have
+       an intervening rule.)  */
+    bool supports_margins;
+
+    /* True if the local language has a right-to-left direction, otherwise
+       false.  (Use render_direction_rtl() to find out.) */
+    bool rtl;
   };
 
 /* An iterator for breaking render_pages into smaller chunks. */