gol

Implementation of Conway's Game of Life writen in C
git clone git://git.dimitrijedobrota.com/gol.git
Log | Files | Refs | README

window.h (1041B)


      1 /**
      2  * @file window.h
      3  * @author Dimitrije Dobrota
      4  * @date 19 June 2022
      5  * @brief Window interface
      6  */
      7 
      8 #ifndef WINDOW_H
      9 #define WINDOW_H
     10 
     11 #include <curses.h>
     12 
     13 #define window_T T
     14 typedef struct T *T;
     15 
     16 // General
     17 
     18 T window_new(void);
     19 T window_init(T self);
     20 T window_split(T self, int hor, int a, int b, char *name1, char *name2);
     21 T window_center(T self, int h, int w, char *name);
     22 
     23 WINDOW *window_win_new(T self);
     24 
     25 int  window_clicked(T self, int y, int x);
     26 void window_clear(T self);
     27 void window_clear_noRefresh(T self);
     28 void window_free(T self);
     29 void window_settings(WINDOW *win);
     30 void window_unsplit(T self);
     31 void window_update_children(T self);
     32 
     33 // Setters and Getters
     34 
     35 T window_sibiling(T self);
     36 
     37 WINDOW *window_win(T self);
     38 
     39 int  window_height(T self);
     40 int  window_width(T self);
     41 int  window_x(T self);
     42 int  window_y(T self);
     43 void window_set_title(T self, char *title);
     44 
     45 // Help
     46 
     47 int  wcenter_vertical(T window, int n);
     48 void cursor_offset(WINDOW *win, int oy, int ox);
     49 void wcenter_horizontal(T window, int y, int n);
     50 
     51 #undef T
     52 #endif