Blob Blame Raw
#ifndef APP_H
#define APP_H


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

#include <X11/extensions/Xrandr.h>


struct App {
  // keep these filds at the begining for easyest static initialization
  Keyboard keyboard;
  Input input;
  Graph graph;
  Touch touch;
  
  // 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;
  Rotation sr;
  int x, y, w, h;
  int dockt, dockb;
  int irx, iry, irw, irh;
  int xron, xrev, xrerr;
};


int appInit(App *app, const char *touch_dev);
void appDeinit(App *app);
int appRun(App *app);
void appStop(App *app, int err);
void appUpdateStrut(App *app);
void appUpdateScreenSize(App *app, int sw, int sh, Rotation sr);
void appMove(App *app, int x, int y, int w, int h, int force);
void appInvalidateRect(App *app, int x, int y, int w, int h);


#endif