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
  Display *dpy;
  int screen;
  Window root;
  Window win;
  int sw, sh;

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


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