summaryrefslogtreecommitdiff
path: root/libsigrokdecode.h
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-01-31 16:59:22 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2014-01-31 17:04:13 +0100
commit1ce468178f581b6270e1f2862ab585e8a38aa056 (patch)
treecf49b0c0d67c0af5f87b227721b9530ed4a503e3 /libsigrokdecode.h
parent3dd546c15fc973b3495f0d2557333e9ef31ca7dd (diff)
downloadlibsigrokdecode-1ce468178f581b6270e1f2862ab585e8a38aa056.tar.gz
libsigrokdecode-1ce468178f581b6270e1f2862ab585e8a38aa056.zip
Add support for annotation rows.
An annotation row is a list of annotation classes that should all be displayed in the same "row" in GUIs. For example, the UART decoder would have at least two rows (for decoded RX and TX data/startbits/stopbits/paritybits), the SPI decoder would have at least two rows (for decoded MISO and MOSI data), and so on. Each annotation row has a short ID string (mostly for use in command-line frontends), a description string (mostly for use by GUIs), and a tuple/list of annotation class IDs belonging to this row. If no annotation rows are provided by the decoder, frontends can consider this as the "trivial" case of all annotation classes being displayed on the same (only) row.
Diffstat (limited to 'libsigrokdecode.h')
-rw-r--r--libsigrokdecode.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libsigrokdecode.h b/libsigrokdecode.h
index 3175fd8..1603582 100644
--- a/libsigrokdecode.h
+++ b/libsigrokdecode.h
@@ -169,6 +169,12 @@ struct srd_decoder {
GSList *annotations;
/**
+ * List of annotation rows (row items: id, description, and a list
+ * of annotation classes belonging to this row).
+ */
+ GSList *annotation_rows;
+
+ /**
* List of NULL-terminated char[], containing descriptions of the
* supported binary output.
*/
@@ -205,6 +211,12 @@ struct srd_decoder_option {
GVariant *def;
};
+struct srd_decoder_annotation_row {
+ char *id;
+ char *desc;
+ GSList *ann_classes;
+};
+
struct srd_decoder_inst {
struct srd_decoder *decoder;
struct srd_session *sess;