sign_defs.h
Go to the documentation of this file.
1 #ifndef NVIM_SIGN_DEFS_H
2 #define NVIM_SIGN_DEFS_H
3 
4 #include <stdbool.h>
5 
6 #include "nvim/pos.h"
7 #include "nvim/types.h"
8 
9 // signs: line annotations
10 
11 // Sign group
12 typedef struct signgroup_S {
13  uint16_t sg_refcount; // number of signs in this group
14  int sg_next_sign_id; // next sign id for this group
15  char_u sg_name[1]; // sign group name
16 } signgroup_T;
17 
18 // Macros to get the sign group structure from the group name
19 #define SGN_KEY_OFF offsetof(signgroup_T, sg_name)
20 #define HI2SG(hi) ((signgroup_T *)((hi)->hi_key - SGN_KEY_OFF))
21 
22 typedef struct sign_entry sign_entry_T;
23 
24 struct sign_entry {
25  int se_id; // unique identifier for each placed sign
26  int se_typenr; // typenr of sign
27  int se_priority; // priority for highlighting
28  bool se_has_text_or_icon; // has text or icon
29  linenr_T se_lnum; // line number which has this sign
30  signgroup_T *se_group; // sign group
31  sign_entry_T *se_next; // next entry in a list of signs
32  sign_entry_T *se_prev; // previous entry -- for easy reordering
33 };
34 
36 typedef struct sign_attrs_S {
41  int sat_numhl;
42 } sign_attrs_T;
43 
44 #define SIGN_SHOW_MAX 9
45 
46 // Default sign priority for highlighting
47 #define SIGN_DEF_PRIO 10
48 
49 // type argument for sign_get_attr()
50 typedef enum {
54 } SignType;
55 
56 
57 #endif // NVIM_SIGN_DEFS_H
sign_entry::se_typenr
int se_typenr
Definition: sign_defs.h:26
sign_attrs_S::sat_linehl
int sat_linehl
Definition: sign_defs.h:40
sign_entry::se_has_text_or_icon
bool se_has_text_or_icon
Definition: sign_defs.h:28
types.h
signgroup_S::sg_name
char_u sg_name[1]
Definition: sign_defs.h:15
signgroup_S::sg_refcount
uint16_t sg_refcount
Definition: sign_defs.h:13
sign_entry::se_prev
sign_entry_T * se_prev
Definition: sign_defs.h:32
sign_entry::se_group
signgroup_T * se_group
Definition: sign_defs.h:30
SIGN_LINEHL
@ SIGN_LINEHL
Definition: sign_defs.h:51
signgroup_S
Definition: sign_defs.h:12
sign_attrs_S::sat_numhl
int sat_numhl
Definition: sign_defs.h:41
sign_entry::se_next
sign_entry_T * se_next
Definition: sign_defs.h:31
sign_entry::se_lnum
linenr_T se_lnum
Definition: sign_defs.h:29
sign_attrs_S::sat_typenr
int sat_typenr
Definition: sign_defs.h:37
sign_entry::se_id
int se_id
Definition: sign_defs.h:25
sign_attrs_S::sat_texthl
int sat_texthl
Definition: sign_defs.h:39
SignType
SignType
Definition: sign_defs.h:50
SIGN_NUMHL
@ SIGN_NUMHL
Definition: sign_defs.h:52
signgroup_S::sg_next_sign_id
int sg_next_sign_id
Definition: sign_defs.h:14
sign_entry
Definition: sign_defs.h:24
char_u
unsigned char char_u
Definition: types.h:12
sign_attrs_S::sat_text
char_u * sat_text
Definition: sign_defs.h:38
signgroup_T
struct signgroup_S signgroup_T
sign_attrs_T
struct sign_attrs_S sign_attrs_T
Sign attributes. Used by the screen refresh routines.
sign_entry::se_priority
int se_priority
Definition: sign_defs.h:27
sign_attrs_S
Sign attributes. Used by the screen refresh routines.
Definition: sign_defs.h:36
linenr_T
long linenr_T
Definition: pos.h:7
pos.h
SIGN_TEXT
@ SIGN_TEXT
Definition: sign_defs.h:53