aboutsummaryrefslogtreecommitdiff
path: root/includes/info.h
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2019-07-02 17:16:21 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2019-07-06 13:08:54 -0700
commit285664ed7e706d731e20064b40746204db72fbc4 (patch)
tree5159a3d238b28d2cb90e5824c2c1c371d9444d5b /includes/info.h
parentcf3983370bfa97a123699338b43af524619fff6e (diff)
struct info: add morinfo() tag and flags support
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'includes/info.h')
-rw-r--r--includes/info.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/includes/info.h b/includes/info.h
index f244ceb4..da4c12e4 100644
--- a/includes/info.h
+++ b/includes/info.h
@@ -21,6 +21,13 @@
#include <stdarg.h>
#include <glib.h>
+enum {
+ INFO_NONE = 0,
+ INFO_FIELD_SELECTED = 1, /* '*' */
+ INFO_FIELD_REPORT_DETAILS
+ = 1<<1, /* '!' */
+};
+
struct Info {
GArray *groups;
@@ -48,8 +55,10 @@ struct InfoField {
const gchar *name;
const gchar *value;
const gchar *icon;
+ gchar *tag; /* moreinfo() lookup tag */
int update_interval;
+ unsigned int flags;
gboolean free_value_on_flatten;
};
@@ -73,6 +82,18 @@ static inline struct InfoField info_field_with_icon(struct InfoField field, cons
field.icon = icon;
return field;
}
+static inline struct InfoField info_field_set_flags(struct InfoField field, int flags)
+{
+ field.flags |= flags;
+ return field;
+}
+#define info_field_selected(field, INFO_FIELD_SELECTED);
+#define info_field_report_details(field, INFO_FIELD_REPORT_DETAILS);
+static inline struct InfoField info_field_with_tag(struct InfoField field, const gchar *tag)
+{
+ field.tag = g_strdup(tag);
+ return field;
+}
void info_set_column_title(struct Info *info, const gchar *column, const gchar *title);
void info_set_column_headers_visible(struct Info *info, gboolean setting);