Blob Blame Raw
#ifndef APP_H
#define APP_H


#include "common.h"
#include "graph.h"
#include "input.h"
#include "keyboard.h"


struct App {
  // keep these filds at the begining for easyest static initialization
  Keyboard keyboard;
  Input input;
  Graph graph;
  
  // these fields will be set while initialization
  xcb_connection_t *xcb;
  xcb_screen_t *screen;
  xcb_window_t win;

  // dynamic fields
  int irx, iry, irw, irh;
  int x, y, w, h;
  int run;
};


int appInit(App *app);
void appDeinit(App *app);
int appRun(App *app);
void appStop(App *app, int err);
void appMove(App *app, int x, int y, int w, int h);
void appInvalidateRect(App *app, int x, int y, int w, int h);


#endif