output: Add support for cell margins.
[pspp] / src / output / render.h
index 14f87b50c1bf404cdbeeb1b8db49eecc8580038a..f04eb79005df1b8a5ffc0a66d6b5d2b2b2b95f7d 100644 (file)
@@ -25,18 +25,43 @@ 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
   };
 
+/* Parameters for rendering a table_item to a device.
+
+
+   Coordinate system
+   =================
+
+   The rendering code assumes that larger 'x' is to the right and larger 'y'
+   toward the bottom of the page.
+
+   The rendering code assumes that the table being rendered has its upper left
+   corner at (0,0) in device coordinates.  This is usually not the case from
+   the driver's perspective, so the driver should expect to apply its own
+   offset to coordinates passed to callback functions.
+
+
+   Callback functions
+   ==================
+
+   For each of the callback functions, AUX is passed as the 'aux' member of the
+   render_params structure.
+*/
 struct render_params
   {
     /* Measures CELL's width.  Stores in *MIN_WIDTH the minimum width required
        to avoid splitting a single word across multiple lines (normally, this
        is the width of the longest word in the cell) and in *MAX_WIDTH the
-       minimum width required to avoid line breaks other than at new-lines. */
+       minimum width required to avoid line breaks other than at new-lines.
+       */
     void (*measure_cell_width) (void *aux, const struct table_cell *cell,
                                 int *min_width, int *max_width);
 
@@ -75,7 +100,9 @@ struct render_params
        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 bb[TABLE_N_AXES][2], int clip[TABLE_N_AXES][2]);
+                       int bb[TABLE_N_AXES][2],
+                       int spill[TABLE_N_AXES][2],
+                       int clip[TABLE_N_AXES][2]);
 
     /* Auxiliary data passed to each of the above functions. */
     void *aux;
@@ -96,9 +123,10 @@ struct render_params
        across two pages.  (Joined cells may always be broken at join
        points.) */
     int min_break[TABLE_N_AXES];
+
+    bool supports_margins;
   };
-\f
-\f
+
 /* An iterator for breaking render_pages into smaller chunks. */
 struct render_pager *render_pager_create (const struct render_params *,
                                           const struct table_item *);
@@ -114,4 +142,7 @@ void render_pager_draw_region (const struct render_pager *,
 int render_pager_get_size (const struct render_pager *, enum table_axis);
 int render_pager_get_best_breakpoint (const struct render_pager *, int height);
 
+bool render_direction_rtl (void);
+
+
 #endif /* output/render.h */