1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 /* Structured Output Manager.
25 som considers the output stream to be a series of tables. Each
26 table is made up of a rectangular grid of cells. Cells can be
27 joined to form larger cells. Rows and columns can be separated by
28 rules of various types. Tables too large to fit on a single page
29 will be divided into sections. Rows and columns can be designated
30 as headers, which causes them to be repeated in each section.
32 Every table is an instance of a particular table class. A table
33 class is responsible for keeping track of cell data, for handling
34 requests from the som, and finally for rendering cell data to the
35 output drivers. Tables may implement these operations in any way
36 desired, and in fact almost every operation performed by som may be
37 overridden in a table class. */
47 /* Entity (Table or Chart) . */
50 struct som_table_class *class; /* Table class. */
51 enum som_type type; /* Table or Chart */
52 void *ext; /* Owned by */
58 SOM_COL_NONE, /* No columns. */
59 SOM_COL_DOWN /* Columns down first. */
62 /* Cumulation types. */
65 SOM_ROWS, SOM_ROW = SOM_ROWS, /* Rows. */
66 SOM_COLUMNS, SOM_COLUMN = SOM_COLUMNS /* Columns. */
73 SOMF_NO_SPACING = 01, /* No spacing before the table. */
74 SOMF_NO_TITLE = 02 /* No title. */
79 struct som_table_class
81 /* Set table, driver. */
82 void (*table) (struct som_entity *);
83 void (*driver) (struct outp_driver *);
85 /* Query columns and rows. */
86 void (*count) (int *n_columns, int *n_rows);
87 void (*area) (int *horiz, int *vert);
88 void (*width) (int *columns);
89 void (*height) (int *rows);
90 void (*columns) (int *style);
91 int (*breakable) (int row); /* ? */
92 void (*headers) (int *l, int *r, int *t, int *b);
93 void (*join) (int *(column[2]), int *(row[2])); /* ? */
94 void (*cumulate) (int cumtype, int start, int *end, int max, int *actual);
95 void (*flags) (unsigned *);
96 bool (*fits_width) (int width);
97 bool (*fits_length) (int length);
99 /* Set columns and rows. */
100 void (*set_width) (int column, int width); /* ? */
101 void (*set_height) (int row, int height); /* ? */
102 void (*set_headers) (int l, int r, int t, int b);
105 void (*title) (int x, int y);
106 void (*render) (int x1, int y1, int x2, int y2);
110 extern int table_num;
111 extern int subtable_num;
114 void som_new_series (void);
115 void som_submit (struct som_entity *t);
118 void som_eject_page (void);
119 void som_blank_line (void);