status.h (926B)
1 #ifndef STATUS_H 2 #define STATUS_H 3 4 #include <stdbool.h> 5 6 #include "block.h" 7 #include "config.h" 8 #include "main.h" 9 #include "util.h" 10 #include "x11.h" 11 12 typedef struct { 13 #define STATUS_LENGTH \ 14 ((BLOCK_COUNT * (MEMBER_LENGTH(block, output) - 1) + CLICKABLE_BLOCKS) + \ 15 (BLOCK_COUNT - 1 + LEADING_DELIMITER + TRAILING_DELIMITER) * \ 16 (LEN(DELIMITER) - 1) + \ 17 1) 18 char current[STATUS_LENGTH]; 19 char previous[STATUS_LENGTH]; 20 #undef STATUS_LENGTH 21 22 const block* const blocks; 23 const unsigned short block_count; 24 } status; 25 26 status status_new(const block* const blocks, const unsigned short block_count); 27 bool status_update(status* const status); 28 int status_write(const status* const status, const bool is_debug_mode, 29 x11_connection* const connection); 30 31 #endif // STATUS_H