#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;
Atom aWmDel;
int stopFd;
// dynamic fields
int run;
int sw, sh;
int x, y, w, h;
int irx, iry, irw, irh;
int xron, xrev, xrerr;
};
int appInit(App *app);
void appDeinit(App *app);
int appRun(App *app);
void appStop(App *app, int err);
void appUpdateScreenSize(App *app, int sw, int sh);
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