#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
\f
-#define OUTPUT_ITEM_INITIALIZER(TYPE) .type = TYPE, .ref_cnt = 1
+#define OUTPUT_ITEM_INITIALIZER(TYPE) .type = TYPE, .ref_cnt = 1, .show = true
/* Increases ITEM's reference count, indicating that it has an additional
owner. An output item that is shared among multiple owners must not be
.label = xstrdup_if_nonnull (old->label),
.command_name = xstrdup_if_nonnull (old->command_name),
.type = old->type,
+ .show = old->show,
};
switch (old->type)
{
output. */
char *command_name;
+ /* For OUTPUT_ITEM_GROUP_OPEN, this is true if the group's subtree should
+ be expanded in an outline view, false otherwise.
+
+ For other kinds of output items, this is true to show the item's
+ content, false to hide it. The item's label is always shown in an
+ outline view. */
+ bool show;
+
enum output_item_type type;
union
{
start_elem (w, "heading");
if (item->command_name)
write_attr (w, "commandName", item->command_name);
+ if (!item->show)
+ write_attr (w, "visibility", "collapsed");
/* XXX locale */
/* XXX olang */
const char *inner_elem)
{
start_elem (w, "container");
- write_attr (w, "visibility", "visible");
+ write_attr (w, "visibility", item->show ? "visible" : "hidden");
if (w->need_page_break)
{
write_attr (w, "page-break-before", "always");