summaryrefslogtreecommitdiff
path: root/src/config_node.h
blob: b4638b5f5c547fd46b8bedfbdfd064733783f476 (plain)
    1 /**
    2  * I3cstatus prints a configurable status bar for the i3 window manager
    3  * Copyright (C) 2021 Aaron Ball <nullspoon@oper.io>
    4  * 
    5  * This program is free software: you can redistribute it and/or modify
    6  * it under the terms of the GNU General Public License as published by
    7  * the Free Software Foundation, either version 3 of the License, or
    8  * (at your option) any later version.
    9  * 
   10  * This program is distributed in the hope that it will be useful,
   11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  * GNU General Public License for more details.
   14  * 
   15  * You should have received a copy of the GNU General Public License
   16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   17  */
   18 #ifndef CONFIG_NODE
   19 #define CONFIG_NODE
   20 
   21 #include <stdio.h>
   22 #include <stdlib.h>
   23 #include <string.h>
   24 #include <time.h>
   25 
   26 struct node {
   27   struct node* next;
   28   int type;
   29   void* data;                    // Additional data for the specific node type
   30   int (*loadfunc)(struct node*); // callback function so modules can manipulate their node entity
   31   void (*loadkey)(struct node*, char*, char*);  // callback function to load a type-specific ini key
   32   char color[8];                 // Color to print
   33   char label_color[8];           // Color to print
   34   char label[256];               // Label for the node
   35   char text[256];                // Value for full_text
   36   char display[64];              // How to display the data (eg: bar, percent, etc)
   37   size_t interval;               // How frequently the load function should be called
   38   time_t lastrun;                // Last time the node's load function was called
   39 };
   40 
   41 //struct node* config_node_new(void* data, void(*init_callback)(struct node*)) {
   42 struct node* node_new(void (*init_callback)(struct node*));
   43 
   44 struct node* lladd(struct node*, struct node*);
   45 
   46 void llfree(struct node*);
   47 
   48 void _load_node_key(struct node*, char*, char*);
   49 
   50 void node_print(struct node*);
   51 
   52 #endif

Generated by cgit