output: Rename page-eject-item to page-break-item.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 10 Jan 2021 19:48:47 +0000 (11:48 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 10 Jan 2021 21:16:24 +0000 (13:16 -0800)
Seems like a better name to me.

12 files changed:
src/language/data-io/print.c
src/output/automake.mk
src/output/cairo-fsm.c
src/output/cairo-pager.c
src/output/csv.c
src/output/page-break-item.c [new file with mode: 0644]
src/output/page-break-item.h [new file with mode: 0644]
src/output/page-eject-item.c [deleted file]
src/output/page-eject-item.h [deleted file]
src/output/pivot-output.c
src/output/spv-driver.c
src/output/spv/spv-writer.c

index 1c63f9c2ce7762fec294a2f6e9672dd9ddf08552..b021d8eba7340faa6de391127ca748d187bb23a8 100644 (file)
@@ -42,7 +42,7 @@
 #include "libpspp/u8-line.h"
 #include "output/pivot-table.h"
 #include "output/table.h"
-#include "output/page-eject-item.h"
+#include "output/page-break-item.h"
 #include "output/text-item.h"
 
 #include "gl/xalloc.h"
@@ -556,7 +556,7 @@ print_text_flush_records (struct print_trns *trns, struct u8_line *line,
         {
           *eject = false;
           if (trns->writer == NULL)
-            page_eject_item_submit (page_eject_item_create ());
+            page_break_item_submit (page_break_item_create ());
           else
             leader = '1';
         }
index 005fb59d7ec9d9b606f692cfae53b34279ffed90..4ee2da35569a83b33d30eacbfbde19773501eb78 100644 (file)
@@ -83,8 +83,8 @@ src_output_liboutput_la_SOURCES = \
        src/output/output-item-provider.h \
        src/output/output-item.c \
        src/output/output-item.h \
-       src/output/page-eject-item.c \
-       src/output/page-eject-item.h \
+       src/output/page-break-item.c \
+       src/output/page-break-item.h \
        src/output/page-setup-item.c \
        src/output/page-setup-item.h \
        src/output/pivot-output.c \
index 2df39754343b966b3305c6a7393b17a3c9989625..fcbbbc649cf84ec029de0a676d4d1bc74f6d2d9f 100644 (file)
@@ -40,7 +40,7 @@
 #include "output/group-item.h"
 #include "output/image-item.h"
 #include "output/message-item.h"
-#include "output/page-eject-item.h"
+#include "output/page-break-item.h"
 #include "output/page-setup-item.h"
 #include "output/pivot-output.h"
 #include "output/pivot-table.h"
@@ -995,7 +995,7 @@ xr_fsm_create (const struct output_item *item_,
   if (is_table_item (item_)
       || is_chart_item (item_)
       || is_image_item (item_)
-      || is_page_eject_item (item_))
+      || is_page_break_item (item_))
     item = output_item_ref (item_);
   else if (is_message_item (item_))
     item = table_item_super (
@@ -1026,7 +1026,7 @@ xr_fsm_create (const struct output_item *item_,
   assert (is_table_item (item)
           || is_chart_item (item)
           || is_image_item (item)
-          || is_page_eject_item (item));
+          || is_page_break_item (item));
 
   size_t *layer_indexes = NULL;
   if (is_table_item (item))
@@ -1214,7 +1214,7 @@ xr_fsm_draw_region (struct xr_fsm *fsm, cairo_t *cr,
     draw_image (to_image_item (fsm->item)->image, cr);
   else if (is_chart_item (fsm->item))
     xr_draw_chart (to_chart_item (fsm->item), cr, CHART_WIDTH, CHART_HEIGHT);
-  else if (is_page_eject_item (fsm->item))
+  else if (is_page_break_item (fsm->item))
     {
       /* Nothing to do. */
     }
@@ -1310,7 +1310,7 @@ error:
 }
 
 static int
-xr_fsm_draw_eject (struct xr_fsm *fsm, int space)
+xr_fsm_draw_page_break (struct xr_fsm *fsm, int space)
 {
   if (space >= fsm->rp.size[V])
     fsm->done = true;
@@ -1330,7 +1330,8 @@ xr_fsm_draw_slice (struct xr_fsm *fsm, cairo_t *cr, int space)
   int used = (is_table_item (fsm->item) ? xr_fsm_draw_table (fsm, space)
               : is_chart_item (fsm->item) ? xr_fsm_draw_chart (fsm, space)
               : is_image_item (fsm->item) ? xr_fsm_draw_image (fsm, space)
-              : is_page_eject_item (fsm->item) ? xr_fsm_draw_eject (fsm, space)
+              : is_page_break_item (fsm->item) ? xr_fsm_draw_page_break (fsm,
+                                                                         space)
               : (abort (), 0));
   fsm->cairo = NULL;
   cairo_restore (cr);
index 311a3b546afb7a82b188e24d99d96a55b8a31929..057ad41c6c4c67e047b659285b265c3ba76f5a2f 100644 (file)
@@ -27,7 +27,6 @@
 #include "output/driver-provider.h"
 #include "output/group-item.h"
 #include "output/message-item.h"
-#include "output/page-eject-item.h"
 #include "output/page-setup-item.h"
 #include "output/table-item.h"
 #include "output/text-item.h"
index 69f12b16f295ef9790487ce78192d391c7649610..b97bfda6004a3812597601de5905a3251a965f86 100644 (file)
@@ -30,7 +30,7 @@
 #include "output/driver-provider.h"
 #include "output/options.h"
 #include "output/message-item.h"
-#include "output/page-eject-item.h"
+#include "output/page-break-item.h"
 #include "output/pivot-output.h"
 #include "output/pivot-table.h"
 #include "output/table-item.h"
@@ -277,7 +277,7 @@ csv_submit (struct output_driver *driver,
       else
         csv_output_lines (csv, text);
     }
-  else if (is_page_eject_item (output_item))
+  else if (is_page_break_item (output_item))
     {
       csv_put_separator (csv);
       csv_output_lines (csv, "");
diff --git a/src/output/page-break-item.c b/src/output/page-break-item.c
new file mode 100644 (file)
index 0000000..477b640
--- /dev/null
@@ -0,0 +1,65 @@
+/* PSPP - a program for statistical analysis.
+   Copyright (C) 2020 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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "output/page-break-item.h"
+
+#include <stdlib.h>
+
+#include "output/driver-provider.h"
+#include "output/output-item-provider.h"
+
+#include "gl/xalloc.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+struct page_break_item *
+page_break_item_create (void)
+{
+  struct page_break_item *item = xmalloc (sizeof *item);
+  *item = (struct page_break_item) {
+    .output_item = OUTPUT_ITEM_INITIALIZER (&page_break_item_class),
+  };
+  return item;
+}
+
+/* Submits ITEM to the configured output drivers, and transfers ownership to
+   the output subsystem. */
+void
+page_break_item_submit (struct page_break_item *item)
+{
+  output_submit (&item->output_item);
+}
+
+static const char *
+page_break_item_get_label (const struct output_item *output_item UNUSED)
+{
+  return _("Page Break");
+}
+
+static void
+page_break_item_destroy (struct output_item *output_item)
+{
+  free (to_page_break_item (output_item));
+}
+
+const struct output_item_class page_break_item_class =
+  {
+    page_break_item_get_label,
+    page_break_item_destroy,
+  };
diff --git a/src/output/page-break-item.h b/src/output/page-break-item.h
new file mode 100644 (file)
index 0000000..dea0013
--- /dev/null
@@ -0,0 +1,91 @@
+/* PSPP - a program for statistical analysis.
+   Copyright (C) 2020 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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef OUTPUT_PAGE_BREAK_ITEM_H
+#define OUTPUT_PAGE_BREAK_ITEM_H 1
+
+/* Page break items.
+
+   This ejects the page (for output devices that have pages). */
+
+#include <stdbool.h>
+#include "output/output-item.h"
+
+/* A page break item. */
+struct page_break_item
+  {
+    struct output_item output_item;
+  };
+
+struct page_break_item *page_break_item_create (void);
+\f
+/* This boilerplate for page_break_item, a subclass of output_item, was
+   autogenerated by mk-class-boilerplate. */
+
+#include <assert.h>
+#include "libpspp/cast.h"
+
+extern const struct output_item_class page_break_item_class;
+
+/* Returns true if SUPER is a page_break_item, otherwise false. */
+static inline bool
+is_page_break_item (const struct output_item *super)
+{
+  return super->class == &page_break_item_class;
+}
+
+/* Returns SUPER converted to page_break_item.  SUPER must be a page_break_item, as
+   reported by is_page_break_item. */
+static inline struct page_break_item *
+to_page_break_item (const struct output_item *super)
+{
+  assert (is_page_break_item (super));
+  return UP_CAST (super, struct page_break_item, output_item);
+}
+
+/* Returns INSTANCE converted to output_item. */
+static inline struct output_item *
+page_break_item_super (const struct page_break_item *instance)
+{
+  return CONST_CAST (struct output_item *, &instance->output_item);
+}
+
+/* Increments INSTANCE's reference count and returns INSTANCE. */
+static inline struct page_break_item *
+page_break_item_ref (const struct page_break_item *instance)
+{
+  return to_page_break_item (output_item_ref (&instance->output_item));
+}
+
+/* Decrements INSTANCE's reference count, then destroys INSTANCE if
+   the reference count is now zero. */
+static inline void
+page_break_item_unref (struct page_break_item *instance)
+{
+  output_item_unref (&instance->output_item);
+}
+
+/* Returns true if INSTANCE's reference count is greater than 1,
+   false otherwise. */
+static inline bool
+page_break_item_is_shared (const struct page_break_item *instance)
+{
+  return output_item_is_shared (&instance->output_item);
+}
+
+void page_break_item_submit (struct page_break_item *);
+\f
+#endif /* output/page-break-item.h */
diff --git a/src/output/page-eject-item.c b/src/output/page-eject-item.c
deleted file mode 100644 (file)
index 85bde8c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* PSPP - a program for statistical analysis.
-   Copyright (C) 2020 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
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include "output/page-eject-item.h"
-
-#include <stdlib.h>
-
-#include "output/driver-provider.h"
-#include "output/output-item-provider.h"
-
-#include "gl/xalloc.h"
-
-#include "gettext.h"
-#define _(msgid) gettext (msgid)
-
-struct page_eject_item *
-page_eject_item_create (void)
-{
-  struct page_eject_item *item = xmalloc (sizeof *item);
-  *item = (struct page_eject_item) {
-    .output_item = OUTPUT_ITEM_INITIALIZER (&page_eject_item_class),
-  };
-  return item;
-}
-
-/* Submits ITEM to the configured output drivers, and transfers ownership to
-   the output subsystem. */
-void
-page_eject_item_submit (struct page_eject_item *item)
-{
-  output_submit (&item->output_item);
-}
-
-static const char *
-page_eject_item_get_label (const struct output_item *output_item UNUSED)
-{
-  return _("Page Break");
-}
-
-static void
-page_eject_item_destroy (struct output_item *output_item)
-{
-  free (to_page_eject_item (output_item));
-}
-
-const struct output_item_class page_eject_item_class =
-  {
-    page_eject_item_get_label,
-    page_eject_item_destroy,
-  };
diff --git a/src/output/page-eject-item.h b/src/output/page-eject-item.h
deleted file mode 100644 (file)
index b9cd675..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/* PSPP - a program for statistical analysis.
-   Copyright (C) 2020 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
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef OUTPUT_PAGE_EJECT_ITEM_H
-#define OUTPUT_PAGE_EJECT_ITEM_H 1
-
-/* Page eject items.
-
-   This ejects the page (for output devices that have pages). */
-
-#include <stdbool.h>
-#include "output/output-item.h"
-
-/* A page eject item. */
-struct page_eject_item
-  {
-    struct output_item output_item;
-  };
-
-struct page_eject_item *page_eject_item_create (void);
-\f
-/* This boilerplate for page_eject_item, a subclass of output_item, was
-   autogenerated by mk-class-boilerplate. */
-
-#include <assert.h>
-#include "libpspp/cast.h"
-
-extern const struct output_item_class page_eject_item_class;
-
-/* Returns true if SUPER is a page_eject_item, otherwise false. */
-static inline bool
-is_page_eject_item (const struct output_item *super)
-{
-  return super->class == &page_eject_item_class;
-}
-
-/* Returns SUPER converted to page_eject_item.  SUPER must be a page_eject_item, as
-   reported by is_page_eject_item. */
-static inline struct page_eject_item *
-to_page_eject_item (const struct output_item *super)
-{
-  assert (is_page_eject_item (super));
-  return UP_CAST (super, struct page_eject_item, output_item);
-}
-
-/* Returns INSTANCE converted to output_item. */
-static inline struct output_item *
-page_eject_item_super (const struct page_eject_item *instance)
-{
-  return CONST_CAST (struct output_item *, &instance->output_item);
-}
-
-/* Increments INSTANCE's reference count and returns INSTANCE. */
-static inline struct page_eject_item *
-page_eject_item_ref (const struct page_eject_item *instance)
-{
-  return to_page_eject_item (output_item_ref (&instance->output_item));
-}
-
-/* Decrements INSTANCE's reference count, then destroys INSTANCE if
-   the reference count is now zero. */
-static inline void
-page_eject_item_unref (struct page_eject_item *instance)
-{
-  output_item_unref (&instance->output_item);
-}
-
-/* Returns true if INSTANCE's reference count is greater than 1,
-   false otherwise. */
-static inline bool
-page_eject_item_is_shared (const struct page_eject_item *instance)
-{
-  return output_item_is_shared (&instance->output_item);
-}
-
-void page_eject_item_submit (struct page_eject_item *);
-\f
-#endif /* output/page-eject-item.h */
index 15df5c730673bc70f5386bb4814b9278861c2a0b..bea33985ebf1d7f0d0c22e94b7b7f243ef77927e 100644 (file)
@@ -23,7 +23,6 @@
 #include "data/settings.h"
 #include "libpspp/assertion.h"
 #include "libpspp/pool.h"
-#include "output/page-eject-item.h"
 #include "output/pivot-table.h"
 #include "output/table-item.h"
 #include "output/table-provider.h"
index 75c8e82f04e842cddc8e6934ac5dbaae16e6801a..e2bc9b235066eee6d8694d837f91d399c6fa7aab 100644 (file)
@@ -26,7 +26,6 @@
 #include "output/chart-item.h"
 #include "output/group-item.h"
 #include "output/image-item.h"
-#include "output/page-eject-item.h"
 #include "output/page-setup-item.h"
 #include "output/table-item.h"
 #include "output/text-item.h"
index 03a415146d795b0a95decfd868042641a9cc6ead..7f8f1e4155aa6dc4a037ccd0d3b3f08ba91318cc 100644 (file)
@@ -38,7 +38,7 @@
 #include "output/driver.h"
 #include "output/group-item.h"
 #include "output/image-item.h"
-#include "output/page-eject-item.h"
+#include "output/page-break-item.h"
 #include "output/page-setup-item.h"
 #include "output/pivot-table.h"
 #include "output/table-item.h"
@@ -1117,7 +1117,7 @@ spv_writer_write (struct spv_writer *w, const struct output_item *item)
                            command_id);
       free (command_id);
     }
-  else if (is_page_eject_item (item))
+  else if (is_page_break_item (item))
     w->need_page_break = true;
   else if (is_page_setup_item (item))
     {