Revision: 77823
http://sourceforge.net/p/brlcad/code/77823
Author: brlcad
Date: 2020-11-30 08:38:48 +0000 (Mon, 30 Nov 2020)
Log Message:
-----------
need to get+set position and more alignment options.
also, don't interleave styling commands into the printf stream. let
bu_tbl_style() handle it instead, otherwise the impl has a problem.
Modified Paths:
--------------
brlcad/trunk/include/bu/tbl.h
Modified: brlcad/trunk/include/bu/tbl.h
===================================================================
--- brlcad/trunk/include/bu/tbl.h 2020-11-29 17:43:20 UTC (rev 77822)
+++ brlcad/trunk/include/bu/tbl.h 2020-11-30 08:38:48 UTC (rev 77823)
@@ -112,22 +112,39 @@
/**
* erases all cells in a table, but doesn't erase the table itself
*/
-BU_EXPORT int
+BU_EXPORT extern int
bu_tbl_clear(struct bu_tbl *);
enum bu_tbl_style {
+ /* table border style */
BU_TBL_STYLE_NONE,
BU_TBL_STYLE_BASIC,
BU_TBL_STYLE_SIMPLE,
BU_TBL_STYLE_SINGLE,
BU_TBL_STYLE_DOUBLE,
- BU_TBL_ROW_HEADER,
- BU_TBL_ROW_SEPARATOR,
+
+ /* table alignment */
BU_TBL_ALIGN_LEFT,
BU_TBL_ALIGN_CENTER,
BU_TBL_ALIGN_RIGHT,
- BU_TBL_END
+
+ /* cell styling */
+ BU_TBL_ROW_HEADER,
+
+ /* insert a horizontal separator */
+ BU_TBL_ROW_SEPARATOR,
+
+ /* cell alignment */
+ BU_TBL_ROW_ALIGN_LEFT,
+ BU_TBL_ROW_ALIGN_CENTER,
+ BU_TBL_ROW_ALIGN_RIGHT,
+ BU_TBL_COL_ALIGN_LEFT,
+ BU_TBL_COL_ALIGN_CENTER,
+ BU_TBL_COL_ALIGN_RIGHT,
+
+ /* go to next row beginning */
+ BU_TBL_ROW_END
};
@@ -134,28 +151,33 @@
/**
* sets table styling or formatting on cells printed next.
*/
-BU_EXPORT struct bu_tbl *
+BU_EXPORT extern struct bu_tbl *
bu_tbl_style(struct bu_tbl *, enum bu_tbl_style);
/**
- * set the table insertion point.
+ * set cell position of the current table insertion point.
*/
-BU_EXPORT struct bu_tbl *
-bu_tbl_index(struct bu_tbl *, size_t row, size_t col);
+BU_EXPORT extern struct bu_tbl *
+bu_tbl_go_to(struct bu_tbl *, size_t row, size_t col);
/**
+ * get cell position for the current table insertion point.
+ */
+BU_EXPORT extern struct bu_tbl *
+bu_tbl_is_at(struct bu_tbl *, size_t *row, size_t *col);
+
+
+/**
* print values into the table at the current insertion point.
*
* each column of the 'fmt' printf-style format specfier must be
* delimited by a '|' character.
*
- * callers can specify bu_tbl_style parameters as arguments after
- * 'fmt' in order to affect cell presentation. BU_TBL_END denotes the
- * end of a row. any existing values will be overwritten.
+ * any existing values will be overwritten.
*/
-BU_EXPORT struct bu_tbl *
+BU_EXPORT extern struct bu_tbl *
bu_tbl_printf(struct bu_tbl *, const char *fmt, ...);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits