table: Rename area_style to table_area_style for consistency.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 30 Oct 2020 06:11:59 +0000 (23:11 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 30 Oct 2020 06:12:39 +0000 (23:12 -0700)
Other, similarly situated data structures have a table_ prefix.

17 files changed:
src/output/ascii.c
src/output/pivot-output.c
src/output/pivot-table.c
src/output/pivot-table.h
src/output/render.c
src/output/spv/spv-legacy-decoder.c
src/output/spv/spv-light-decoder.c
src/output/spv/spv-table-look.c
src/output/spv/spv-table-look.h
src/output/spv/spv-writer.c
src/output/table-item.c
src/output/table-item.h
src/output/table-provider.h
src/output/table.c
src/output/table.h
src/output/text-item.c
tests/output/render-test.c

index a5faa1f81409a819b5e50496dcb38b8cc71087a7..8bdcd51d960f62efcc8aa10afd6bdf3ae45f33b4 100644 (file)
@@ -941,7 +941,7 @@ ascii_test_write (struct output_driver *driver,
   if (!a->file)
     return;
 
-  struct area_style style = {
+  struct table_area_style style = {
     .cell_style.halign = TABLE_HALIGN_LEFT,
     .font_style.bold = bold,
     .font_style.underline = underline,
index 158116117f02b0a10ee098d77e8c3d776798fdf8..1e27c84192633ecafc6d131ae0707f515ed801f6 100644 (file)
@@ -53,19 +53,19 @@ find_category (const struct pivot_dimension *d, int dim_index,
   return NULL;
 }
 
-static struct area_style *
-area_style_override (struct pool *pool,
-                     const struct area_style *in,
-                     const struct cell_style *cell_,
-                     const struct font_style *font_)
+static struct table_area_style *
+table_area_style_override (struct pool *pool,
+                           const struct table_area_style *in,
+                           const struct cell_style *cell_,
+                           const struct font_style *font_)
 {
   const struct cell_style *cell = cell_ ? cell_ : &in->cell_style;
   const struct font_style *font = font_ ? font_ : &in->font_style;
 
-  struct area_style *out = (pool
+  struct table_area_style *out = (pool
                             ? pool_alloc (pool, sizeof *out)
                             : xmalloc (sizeof *out));
-  *out = (struct area_style) {
+  *out = (struct table_area_style) {
     .cell_style.halign = cell->halign,
     .cell_style.valign = cell->valign,
     .cell_style.decimal_offset = cell->decimal_offset,
@@ -91,7 +91,7 @@ area_style_override (struct pool *pool,
 
 static void
 fill_cell (struct table *t, int x1, int y1, int x2, int y2,
-           const struct area_style *style, int style_idx,
+           const struct table_area_style *style, int style_idx,
            const struct pivot_value *value, struct footnote **footnotes,
            enum settings_value_show show_values,
            enum settings_value_show show_variables,
@@ -118,9 +118,9 @@ fill_cell (struct table *t, int x1, int y1, int x2, int y2,
     {
       if (value->cell_style || value->font_style)
         table_add_style (t, x1, y1,
-                         area_style_override (t->container, style,
-                                              value->cell_style,
-                                              value->font_style));
+                         table_area_style_override (t->container, style,
+                                                    value->cell_style,
+                                                    value->font_style));
 
       for (size_t i = 0; i < value->n_footnotes; i++)
         {
@@ -137,7 +137,7 @@ fill_cell (struct table *t, int x1, int y1, int x2, int y2,
 
 static struct table_item_text *
 pivot_value_to_table_item_text (const struct pivot_value *value,
-                                const struct area_style *area,
+                                const struct table_area_style *area,
                                 struct footnote **footnotes,
                                 enum settings_value_show show_values,
                                 enum settings_value_show show_variables)
@@ -152,7 +152,7 @@ pivot_value_to_table_item_text (const struct pivot_value *value,
   *text = (struct table_item_text) {
     .content = ds_steal_cstr (&s),
     .footnotes = xnmalloc (value->n_footnotes, sizeof *text->footnotes),
-    .style = area_style_override (
+    .style = table_area_style_override (
       NULL, area, value->cell_style, value->font_style),
   };
 
@@ -195,8 +195,9 @@ compose_headings (struct table *t,
                   enum pivot_border cat_col_horz,
                   enum pivot_border cat_col_vert,
                   const size_t *column_enumeration, size_t n_columns,
-                  const struct area_style *label_style, int label_style_idx,
-                  const struct area_style *corner_style,
+                  const struct table_area_style *label_style,
+                  int label_style_idx,
+                  const struct table_area_style *corner_style,
                   struct footnote **footnotes,
                   enum settings_value_show show_values,
                   enum settings_value_show show_variables,
@@ -324,8 +325,8 @@ pivot_table_submit_layer (const struct pivot_table *pt,
                                       stub[H], 0, stub[V], 0);
 
   for (size_t i = 0; i < PIVOT_N_AREAS; i++)
-    table->styles[i] = area_style_override (table->container, &pt->areas[i],
-                                            NULL, NULL);
+    table->styles[i] = table_area_style_override (
+      table->container, &pt->areas[i], NULL, NULL);
 
   for (size_t i = 0; i < PIVOT_N_BORDERS; i++)
     {
@@ -353,9 +354,10 @@ pivot_table_submit_layer (const struct pivot_table *pt,
                                             pt->show_variables);
       footnotes[i] = table_create_footnote (
         table, i, content, marker,
-        area_style_override (table->container, &pt->areas[PIVOT_AREA_FOOTER],
-                             pf->content->cell_style,
-                             pf->content->font_style));
+        table_area_style_override (table->container,
+                                   &pt->areas[PIVOT_AREA_FOOTER],
+                                   pf->content->cell_style,
+                                   pf->content->font_style));
       free (marker);
       free (content);
     }
@@ -469,7 +471,7 @@ pivot_table_submit_layer (const struct pivot_table *pt,
           if (!layers)
             {
               layers = xzalloc (sizeof *layers);
-              layers->style = area_style_override (
+              layers->style = table_area_style_override (
                 NULL, &pt->areas[PIVOT_AREA_LAYERS], NULL, NULL);
               layers->layers = xnmalloc (layer_axis->n_dimensions,
                                          sizeof *layers->layers);
index f2967eae81de9d14ac60dd015b9421112b2c2068..3e7fb8ca137a8aecadd60008e02e077b04336b8e 100644 (file)
@@ -62,7 +62,7 @@ pivot_area_to_string (enum pivot_area area)
     }
 }
 
-const struct area_style *
+const struct table_area_style *
 pivot_area_get_default_style (enum pivot_area area)
 {
 #define STYLE(BOLD, H, V, L, R, T, B) {                         \
@@ -80,7 +80,7 @@ pivot_area_get_default_style (enum pivot_area area)
       .typeface = (char *) "Sans Serif",                        \
     },                                                          \
   }
-  static const struct area_style default_area_styles[PIVOT_N_AREAS] = {
+  static const struct table_area_style default_area_styles[PIVOT_N_AREAS] = {
     [PIVOT_AREA_TITLE]         = STYLE(true, CENTER, CENTER,  8,11,1,8),
     [PIVOT_AREA_CAPTION]       = STYLE(false, LEFT,   TOP,     8,11,1,1),
     [PIVOT_AREA_FOOTER]        = STYLE(false, LEFT,   TOP,    11, 8,2,3),
@@ -713,7 +713,8 @@ pivot_table_create__ (struct pivot_value *title, const char *subtype)
   table->sizing[TABLE_VERT].range[1] = 120;
 
   for (size_t i = 0; i < PIVOT_N_AREAS; i++)
-    area_style_copy (NULL, &table->areas[i], pivot_area_get_default_style (i));
+    table_area_style_copy (NULL, &table->areas[i],
+                           pivot_area_get_default_style (i));
 
   /* Set default border styles. */
   static const enum table_stroke default_strokes[PIVOT_N_BORDERS] = {
@@ -820,7 +821,7 @@ pivot_table_unref (struct pivot_table *table)
   pivot_value_destroy (table->caption);
 
   for (size_t i = 0; i < PIVOT_N_AREAS; i++)
-    area_style_uninit (&table->areas[i]);
+    table_area_style_uninit (&table->areas[i]);
 
   for (size_t i = 0; i < table->n_dimensions; i++)
     pivot_dimension_destroy (table->dimensions[i]);
@@ -1355,8 +1356,8 @@ pivot_dimension_dump (const struct pivot_dimension *d, int indentation)
 }
 
 static void
-area_style_dump (enum pivot_area area, const struct area_style *a,
-                 int indentation)
+table_area_style_dump (enum pivot_area area, const struct table_area_style *a,
+                       int indentation)
 {
   indent (indentation);
   printf ("%s: ", pivot_area_to_string (area));
@@ -1504,7 +1505,7 @@ pivot_table_dump (const struct pivot_table *table, int indentation)
   indent (indentation);
   printf ("areas:\n");
   for (enum pivot_area area = 0; area < PIVOT_N_AREAS; area++)
-    area_style_dump (area, &table->areas[area], indentation + 1);
+    table_area_style_dump (area, &table->areas[area], indentation + 1);
 
   indent (indentation);
   printf ("borders:\n");
@@ -1988,7 +1989,7 @@ void
 pivot_value_get_style (struct pivot_value *value,
                        const struct font_style *base_font_style,
                        const struct cell_style *base_cell_style,
-                       struct area_style *area)
+                       struct table_area_style *area)
 {
   font_style_copy (NULL, &area->font_style, (value->font_style
                                              ? value->font_style
@@ -2001,7 +2002,7 @@ pivot_value_get_style (struct pivot_value *value,
 /* Copies AREA into VALUE's style. */
 void
 pivot_value_set_style (struct pivot_value *value,
-                       const struct area_style *area)
+                       const struct table_area_style *area)
 {
   if (value->font_style)
     font_style_uninit (value->font_style);
index ed8f9b7a2b33948cc961a3e1347a9d30d870f80f..b6f746e6bf17703d9c838e9358583a1c3e9353c5 100644 (file)
@@ -107,7 +107,7 @@ enum pivot_area
   };
 
 const char *pivot_area_to_string (enum pivot_area);
-const struct area_style *pivot_area_get_default_style (enum pivot_area);
+const struct table_area_style *pivot_area_get_default_style (enum pivot_area);
 
 /* Table borders for styling purposes. */
 enum pivot_border
@@ -439,7 +439,7 @@ struct pivot_table
     char *notes;
 
     /* Styles. */
-    struct area_style areas[PIVOT_N_AREAS];
+    struct table_area_style areas[PIVOT_N_AREAS];
     struct table_border_style borders[PIVOT_N_BORDERS];
 
     /* Dimensions. */
@@ -714,8 +714,9 @@ void pivot_value_destroy (struct pivot_value *);
 void pivot_value_get_style (struct pivot_value *,
                             const struct font_style *base_font_style,
                             const struct cell_style *base_cell_style,
-                            struct area_style *);
-void pivot_value_set_style (struct pivot_value *, const struct area_style *);
+                            struct table_area_style *);
+void pivot_value_set_style (struct pivot_value *,
+                            const struct table_area_style *);
 
 /* Template arguments. */
 struct pivot_argument
index 890741a3f904725f1a7adb99482a5d5f31a1ae85..a7cc3e67b6e6e5b812a7a4c6e74711784c815b29 100644 (file)
@@ -1532,7 +1532,7 @@ add_text_page (struct render_pager *p, const struct table_item_text *t,
   for (size_t i = 0; i < t->n_footnotes; i++)
     table_add_footnote (tab, 0, 0, t->footnotes[i]);
   if (t->style)
-    tab->styles[0] = area_style_clone (tab->container, t->style);
+    tab->styles[0] = table_area_style_clone (tab->container, t->style);
   render_pager_add_table (p, tab, min_width);
 }
 
@@ -1552,7 +1552,7 @@ add_layers_page (struct render_pager *p,
         table_add_footnote (tab, 0, i, layer->footnotes[j]);
     }
   if (layers->style)
-    tab->styles[0] = area_style_clone (tab->container, layers->style);
+    tab->styles[0] = table_area_style_clone (tab->container, layers->style);
   render_pager_add_table (p, tab, min_width);
 }
 
index b5f4e9eeacb9285af5fbb6ccb5c720f50740d274..0c0f954797aa80c0eb14129d696acf914da5b7ad 100644 (file)
@@ -578,7 +578,7 @@ optional_px (double inches, int default_px)
 static void
 decode_spvdx_style_incremental (const struct spvdx_style *in,
                                 const struct spvdx_style *bg,
-                                struct area_style *out)
+                                struct table_area_style *out)
 {
   if (in && in->font_weight)
     out->font_style.bold = in->font_weight == SPVDX_FONT_WEIGHT_BOLD;
@@ -644,9 +644,9 @@ decode_spvdx_style_incremental (const struct spvdx_style *in,
 static void
 decode_spvdx_style (const struct spvdx_style *in,
                     const struct spvdx_style *bg,
-                    struct area_style *out)
+                    struct table_area_style *out)
 {
-  *out = (struct area_style) AREA_STYLE_INITIALIZER;
+  *out = (struct table_area_style) TABLE_AREA_STYLE_INITIALIZER;
   decode_spvdx_style_incremental (in, bg, out);
 }
 
@@ -667,7 +667,7 @@ decode_label_frame (struct pivot_table *table,
     return NULL;
 
   struct pivot_value **target;
-  struct area_style *area;
+  struct table_area_style *area;
   if (lf->label->purpose == SPVDX_PURPOSE_TITLE)
     {
       target = &table->title;
@@ -697,7 +697,7 @@ decode_label_frame (struct pivot_table *table,
   else
     return NULL;
 
-  area_style_uninit (area);
+  table_area_style_uninit (area);
   decode_spvdx_style (lf->label->style, lf->label->text_frame_style, area);
 
   if (target)
@@ -1079,14 +1079,14 @@ add_dimension (struct spv_series **series, size_t n,
     = find_facet_level (v, base_facet_level + n);
   if (fl)
     {
-      struct area_style *area = (axis_type == PIVOT_AXIS_COLUMN
-                                 ? &table->areas[PIVOT_AREA_COLUMN_LABELS]
-                                 : axis_type == PIVOT_AXIS_ROW
-                                 ? &table->areas[PIVOT_AREA_ROW_LABELS]
-                                 : NULL);
+      struct table_area_style *area = (axis_type == PIVOT_AXIS_COLUMN
+                                       ? &table->areas[PIVOT_AREA_COLUMN_LABELS]
+                                       : axis_type == PIVOT_AXIS_ROW
+                                       ? &table->areas[PIVOT_AREA_ROW_LABELS]
+                                       : NULL);
       if (area && fl->axis->label)
         {
-          area_style_uninit (area);
+          table_area_style_uninit (area);
           decode_spvdx_style (fl->axis->label->style,
                               fl->axis->label->text_frame_style, area);
         }
@@ -1409,7 +1409,7 @@ static void
 apply_styles_to_value (struct pivot_table *table,
                        struct pivot_value *value,
                        const struct spvdx_set_format *sf,
-                       const struct area_style *base_area_style,
+                       const struct table_area_style *base_area_style,
                        const struct spvdx_style *fg,
                        const struct spvdx_style *bg)
 {
@@ -1464,7 +1464,7 @@ apply_styles_to_value (struct pivot_table *table,
     }
   if (fg || bg)
     {
-      struct area_style area;
+      struct table_area_style area;
       pivot_value_get_style (
         value,
         value->font_style ? value->font_style : &base_area_style->font_style,
@@ -1472,7 +1472,7 @@ apply_styles_to_value (struct pivot_table *table,
         &area);
       decode_spvdx_style_incremental (fg, bg, &area);
       pivot_value_set_style (value, &area);
-      area_style_uninit (&area);
+      table_area_style_uninit (&area);
     }
 }
 
@@ -1491,13 +1491,13 @@ decode_set_cell_properties__ (struct pivot_table *table,
       && !interval && !major_ticks && !frame && !set_format)
     {
       /* Sets alt_fg_color and alt_bg_color. */
-      struct area_style area;
+      struct table_area_style area;
       decode_spvdx_style (labeling, graph, &area);
       table->areas[PIVOT_AREA_DATA].font_style.fg[1]
         = area.font_style.fg[0];
       table->areas[PIVOT_AREA_DATA].font_style.bg[1]
         = area.font_style.bg[0];
-      area_style_uninit (&area);
+      table_area_style_uninit (&area);
     }
   else if (graph
            && !labeling && !interval && !major_ticks && !frame && !set_format)
@@ -1529,7 +1529,7 @@ decode_set_cell_properties__ (struct pivot_table *table,
           struct pivot_category *c = find_category (s, include);
           if (c)
             {
-              const struct area_style *base_area_style
+              const struct table_area_style *base_area_style
                 = (c->dimension->axis_type == PIVOT_AXIS_ROW
                    ? &table->areas[PIVOT_AREA_ROW_LABELS]
                    : &table->areas[PIVOT_AREA_COLUMN_LABELS]);
@@ -1844,7 +1844,7 @@ decode_spvdx_table (const struct spvdx_visualization *v, const char *subtype,
       }
   if (v->graph->interval->labeling->style)
     {
-      area_style_uninit (&table->areas[PIVOT_AREA_DATA]);
+      table_area_style_uninit (&table->areas[PIVOT_AREA_DATA]);
       decode_spvdx_style (v->graph->interval->labeling->style,
                           v->graph->cell_style,
                           &table->areas[PIVOT_AREA_DATA]);
index ebac2a56355b4f86eefbafffda7be516c7997aba..a09ac5ba242080b89ab5705c633caadea8afc7e0 100644 (file)
@@ -434,7 +434,7 @@ decode_spvlb_value (const struct pivot_table *table,
 }
 
 static char * WARN_UNUSED_RESULT
-decode_spvlb_area (const struct spvlb_area *in, struct area_style *out,
+decode_spvlb_area (const struct spvlb_area *in, struct table_area_style *out,
                    const char *encoding)
 {
   char *error;
@@ -467,7 +467,7 @@ decode_spvlb_area (const struct spvlb_area *in, struct area_style *out,
   if (error)
     return error;
 
-  *out = (struct area_style) {
+  *out = (struct table_area_style) {
     .font_style = {
       .bold = (in->style & 1) != 0,
       .italic = (in->style & 2) != 0,
index 3a2fb4578c0734474b20599f1d8f0a4ef85e718f..c9945b000c6dd5239fda002db95a764cebfdddef 100644 (file)
@@ -144,7 +144,8 @@ spv_table_look_decode (const struct spvsx_table_properties *in,
     = (f->number_format == SPVSX_NUMBER_FORMAT_NUMERIC);
 
   for (int i = 0; i < PIVOT_N_AREAS; i++)
-    area_style_copy (NULL, &out->areas[i], pivot_area_get_default_style (i));
+    table_area_style_copy (NULL, &out->areas[i],
+                           pivot_area_get_default_style (i));
 
   const struct spvsx_cell_format_properties *cfp = in->cell_format_properties;
   for (size_t i = 0; i < cfp->n_cell_style; i++)
@@ -159,7 +160,7 @@ spv_table_look_decode (const struct spvsx_table_properties *in,
           goto error;
         }
 
-      struct area_style *a = &out->areas[area];
+      struct table_area_style *a = &out->areas[area];
       const struct spvsx_style *s = c->style;
       if (s->font_weight)
         a->font_style.bold = s->font_weight == SPVSX_FONT_WEIGHT_BOLD;
@@ -408,7 +409,7 @@ spv_table_look_write (const char *filename, const struct spv_table_look *look)
   start_elem (xml, "cellFormatProperties");
   for (enum pivot_area a = 0; a < PIVOT_N_AREAS; a++)
     {
-      const struct area_style *area = &look->areas[a];
+      const struct table_area_style *area = &look->areas[a];
       const struct font_style *font = &area->font_style;
       const struct cell_style *cell = &area->cell_style;
 
@@ -511,7 +512,7 @@ spv_table_look_destroy (struct spv_table_look *look)
     {
       free (look->name);
       for (size_t i = 0; i < PIVOT_N_AREAS; i++)
-        area_style_uninit (&look->areas[i]);
+        table_area_style_uninit (&look->areas[i]);
       free (look->continuation);
       free (look);
     }
@@ -538,8 +539,8 @@ spv_table_look_install (const struct spv_table_look *look,
 
   for (size_t i = 0; i < PIVOT_N_AREAS; i++)
     {
-      area_style_uninit (&table->areas[i]);
-      area_style_copy (NULL, &table->areas[i], &look->areas[i]);
+      table_area_style_uninit (&table->areas[i]);
+      table_area_style_copy (NULL, &table->areas[i], &look->areas[i]);
     }
   for (size_t i = 0; i < PIVOT_N_BORDERS; i++)
     table->borders[i] = look->borders[i];
@@ -572,7 +573,7 @@ spv_table_look_get (const struct pivot_table *table)
   look->show_numeric_markers = table->show_numeric_markers;
 
   for (size_t i = 0; i < PIVOT_N_AREAS; i++)
-    area_style_copy (NULL, &look->areas[i], &table->areas[i]);
+    table_area_style_copy (NULL, &look->areas[i], &table->areas[i]);
   for (size_t i = 0; i < PIVOT_N_BORDERS; i++)
     look->borders[i] = table->borders[i];
 
index 98675950215d7d4374d21247dec712fa54ea0140..76d6efb03ab6a58bc6ca9661e48567baaa76d27e 100644 (file)
@@ -45,7 +45,7 @@ struct spv_table_look
     bool footnote_marker_superscripts;
 
     /* Styles. */
-    struct area_style areas[PIVOT_N_AREAS];
+    struct table_area_style areas[PIVOT_N_AREAS];
     struct table_border_style borders[PIVOT_N_BORDERS];
 
     /* Print settings. */
index 1cba64bd8b6bea47b223441e1d013304b09f2999..db8d03dfbffee47f320e29b6db962895b9a829db 100644 (file)
@@ -795,7 +795,7 @@ put_light_table (struct buf *buf, uint64_t table_id,
   /* Areas. */
   for (size_t i = 0; i < PIVOT_N_AREAS; i++)
     {
-      const struct area_style *a = &table->areas[i];
+      const struct table_area_style *a = &table->areas[i];
       put_byte (buf, i + 1);
       put_byte (buf, 0x31);
       put_string (buf, (a->font_style.typeface
index a1595479bbf5bde005fc9734085b471e8f5c0cff..1ead1f92f6b61be784c39a036e71a6b97d90b457 100644 (file)
@@ -52,7 +52,7 @@ table_item_text_clone (const struct table_item_text *old)
     .footnotes = xmemdup (old->footnotes,
                           old->n_footnotes * sizeof *old->footnotes),
     .n_footnotes = old->n_footnotes,
-    .style = area_style_clone (NULL, old->style),
+    .style = table_area_style_clone (NULL, old->style),
   };
   return new;
 }
@@ -64,7 +64,7 @@ table_item_text_destroy (struct table_item_text *text)
     {
       free (text->content);
       free (text->footnotes);
-      area_style_free (text->style);
+      table_area_style_free (text->style);
       free (text);
     }
 }
@@ -99,7 +99,7 @@ table_item_layers_clone (const struct table_item_layers *old)
   *new = (struct table_item_layers) {
     .layers = xnmalloc (old->n_layers, sizeof *new->layers),
     .n_layers = old->n_layers,
-    .style = area_style_clone (NULL, old->style),
+    .style = table_area_style_clone (NULL, old->style),
   };
   for (size_t i = 0; i < new->n_layers; i++)
     table_item_layer_copy (&new->layers[i], &old->layers[i]);
@@ -114,7 +114,7 @@ table_item_layers_destroy (struct table_item_layers *layers)
       for (size_t i = 0; i < layers->n_layers; i++)
         table_item_layer_uninit (&layers->layers[i]);
       free (layers->layers);
-      area_style_free (layers->style);
+      table_area_style_free (layers->style);
       free (layers);
     }
 }
index a16c82ebb36a3ad84502cb6f516e3554bc8d5c1f..eb3dcb16ea440ba9db1da0eb15c44836941eaef3 100644 (file)
@@ -35,7 +35,7 @@ struct table_item_text
     char *content;
     const struct footnote **footnotes;
     size_t n_footnotes;
-    struct area_style *style;
+    struct table_area_style *style;
   };
 
 struct table_item_text *table_item_text_create (const char *);
@@ -57,7 +57,7 @@ struct table_item_layers
   {
     struct table_item_layer *layers;
     size_t n_layers;
-    struct area_style *style;
+    struct table_area_style *style;
   };
 
 struct table_item_layers *table_item_layers_clone (
index 711f84d6b3960a529a60022a21354cca4b0a4b92..be45912d92148994b3484404cdb8d3e626497a58 100644 (file)
@@ -30,7 +30,7 @@ struct footnote
     size_t idx;
     char *content;
     char *marker;
-    struct area_style *style;
+    struct table_area_style *style;
   };
 
 /* A cell in a table. */
@@ -60,7 +60,7 @@ struct table_cell
     char *superscript;
     const struct footnote **footnotes;
     size_t n_footnotes;
-    const struct area_style *style;
+    const struct table_area_style *style;
   };
 
 void table_cell_format_footnote_markers (const struct table_cell *,
index 31348a46a70d53b32aa6c3e7fdd8cd9bb2c5eea4..c27d208f72b09b4fcf5aa435b3738035618d5388 100644 (file)
@@ -67,10 +67,10 @@ table_is_shared (const struct table *table)
   return table->ref_cnt > 1;
 }
 \f
-struct area_style *
-area_style_clone (struct pool *pool, const struct area_style *old)
+struct table_area_style *
+table_area_style_clone (struct pool *pool, const struct table_area_style *old)
 {
-  struct area_style *new = pool_malloc (pool, sizeof *new);
+  struct table_area_style *new = pool_malloc (pool, sizeof *new);
   *new = *old;
   if (new->font_style.typeface)
     new->font_style.typeface = pool_strdup (pool, new->font_style.typeface);
@@ -78,7 +78,7 @@ area_style_clone (struct pool *pool, const struct area_style *old)
 }
 
 void
-area_style_free (struct area_style *style)
+table_area_style_free (struct table_area_style *style)
 {
   if (style)
     {
@@ -177,8 +177,8 @@ table_from_string (const char *text)
 {
   struct table *t = table_create (1, 1, 0, 0, 0, 0);
   t->styles[0] = pool_alloc (t->container, sizeof *t->styles[0]);
-  *t->styles[0] = (struct area_style) {
-    AREA_STYLE_INITIALIZER__,
+  *t->styles[0] = (struct table_area_style) {
+    TABLE_AREA_STYLE_INITIALIZER__,
     .cell_style.halign = TABLE_HALIGN_LEFT,
     .cell_style.valign = TABLE_VALIGN_TOP
   };
@@ -250,15 +250,15 @@ font_style_uninit (struct font_style *font)
 }
 
 void
-area_style_copy (struct pool *container,
-                 struct area_style *dst, const struct area_style *src)
+table_area_style_copy (struct pool *container, struct table_area_style *dst,
+                       const struct table_area_style *src)
 {
   font_style_copy (container, &dst->font_style, &src->font_style);
   dst->cell_style = src->cell_style;
 }
 
 void
-area_style_uninit (struct area_style *area)
+table_area_style_uninit (struct table_area_style *area)
 {
   if (area)
     font_style_uninit (&area->font_style);
@@ -667,7 +667,7 @@ table_add_superscript (struct table *table, int x, int y,
    footnote later, so it is important for the caller to remember it. */
 struct footnote *
 table_create_footnote (struct table *table, size_t idx, const char *content,
-                       const char *marker, struct area_style *style)
+                       const char *marker, struct table_area_style *style)
 {
   assert (style);
 
@@ -701,7 +701,7 @@ table_add_footnote (struct table *table, int x, int y,
    TABLE->container or have a lifetime that will outlive TABLE. */
 void
 table_add_style (struct table *table, int x, int y,
-                 const struct area_style *style)
+                 const struct table_area_style *style)
 {
   get_joined_cell (table, x, y)->style = style;
 }
@@ -758,7 +758,7 @@ table_get_cell (const struct table *t, int x, int y, struct table_cell *cell)
   unsigned short opt = t->ct[index];
   const void *cc = t->cc[index];
 
-  const struct area_style *style
+  const struct table_area_style *style
     = t->styles[(opt & TAB_STYLE_MASK) >> TAB_STYLE_SHIFT];
   if (opt & TAB_JOIN)
     {
index 0cdeef1b4ea1a7661dcf717fd53b6c134a216161..ed8e70123bb74b0894c32c1b6569b98c2d5d884f 100644 (file)
@@ -157,22 +157,23 @@ void font_style_copy (struct pool *,
 void font_style_uninit (struct font_style *);
 void font_style_dump (const struct font_style *);
 
-struct area_style
+struct table_area_style
   {
     struct cell_style cell_style;
     struct font_style font_style;
   };
 
-#define AREA_STYLE_INITIALIZER { AREA_STYLE_INITIALIZER__ }
-#define AREA_STYLE_INITIALIZER__                \
+#define TABLE_AREA_STYLE_INITIALIZER { TABLE_AREA_STYLE_INITIALIZER__ }
+#define TABLE_AREA_STYLE_INITIALIZER__          \
        .cell_style = CELL_STYLE_INITIALIZER,    \
        .font_style = FONT_STYLE_INITIALIZER
 
-struct area_style *area_style_clone (struct pool *, const struct area_style *);
-void area_style_copy (struct pool *,
-                      struct area_style *, const struct area_style *);
-void area_style_uninit (struct area_style *);
-void area_style_free (struct area_style *);
+struct table_area_style *table_area_style_clone (
+  struct pool *, const struct table_area_style *);
+void table_area_style_copy (struct pool *, struct table_area_style *,
+                            const struct table_area_style *);
+void table_area_style_uninit (struct table_area_style *);
+void table_area_style_free (struct table_area_style *);
 
 /* Properties of a table cell. */
 enum
@@ -227,7 +228,7 @@ struct table
        points to a struct table_cell. */
     void **cc;                  /* Cell contents; void *[nr][nc]. */
     unsigned short *ct;                /* Cell types; unsigned short[nr][nc]. */
-    struct area_style *styles[8];
+    struct table_area_style *styles[8];
 
     /* Rules. */
     unsigned char *rh;         /* Horiz rules; unsigned char[nr+1][nc]. */
@@ -299,12 +300,12 @@ void table_add_superscript (struct table *, int x, int y,
 struct footnote *table_create_footnote (struct table *, size_t idx,
                                         const char *content,
                                         const char *marker,
-                                        struct area_style *);
+                                        struct table_area_style *);
 void table_add_footnote (struct table *, int x, int y,
                          const struct footnote *);
 
 void table_add_style (struct table *, int x, int y,
-                      const struct area_style *);
+                      const struct table_area_style *);
 
 bool table_cell_is_empty (const struct table *, int c, int r);
 
index ba0f3873adb0071f2dc996f62b3846d2117ccf02..f892e9277453a1fd406b8f3f447bce6190bc984a 100644 (file)
@@ -121,9 +121,9 @@ text_item_to_table_item (struct text_item *text_item)
 {
   struct table *tab = table_create (1, 1, 0, 0, 0, 0);
 
-  struct area_style *style = pool_alloc (tab->container, sizeof *style);
-  *style = (struct area_style) { AREA_STYLE_INITIALIZER__,
-                                 .cell_style.halign = TABLE_HALIGN_LEFT };
+  struct table_area_style *style = pool_alloc (tab->container, sizeof *style);
+  *style = (struct table_area_style) { TABLE_AREA_STYLE_INITIALIZER__,
+                                       .cell_style.halign = TABLE_HALIGN_LEFT };
   struct font_style *font_style = &style->font_style;
   if (text_item->typeface)
     font_style->typeface = pool_strdup (tab->container, text_item->typeface);
index b9ddd3e7f9491976a85c4dcfbeb9d1c821ed4a02..6b0aa73c4a049a0593acaa3e610905ead457d206 100644 (file)
@@ -413,13 +413,15 @@ read_table (FILE *stream)
               cs = 1;
             }
 
-#define S(H) { AREA_STYLE_INITIALIZER__, .cell_style.halign = H }
-          static const struct area_style left_style = S (TABLE_HALIGN_LEFT);
-          static const struct area_style right_style = S (TABLE_HALIGN_RIGHT);
-          static const struct area_style center_style
+#define S(H) { TABLE_AREA_STYLE_INITIALIZER__, .cell_style.halign = H }
+          static const struct table_area_style left_style
+            = S (TABLE_HALIGN_LEFT);
+          static const struct table_area_style right_style
+            = S (TABLE_HALIGN_RIGHT);
+          static const struct table_area_style center_style
             = S (TABLE_HALIGN_CENTER);
 
-          const struct area_style *style = &right_style;
+          const struct table_area_style *style = &right_style;
           while (*text && strchr ("<>^,@()|", *text))
             switch (*text++)
               {
@@ -478,7 +480,7 @@ read_table (FILE *stream)
                 char marker[2] = { 'a' + n_footnotes, '\0' };
                 struct footnote *f = table_create_footnote (
                   tab, n_footnotes, content, marker,
-                  area_style_clone (tab->container, &left_style));
+                  table_area_style_clone (tab->container, &left_style));
                 table_add_footnote (tab, c, r, f);
                 n_footnotes++;
               }