dorne/cursetree/surface.h

38 lines
1.2 KiB
C

#ifndef CURSETREE_SURFACE_H
#define CURSETREE_SURFACE_H
#include "dims.h"
#ifndef __NCURSES_H
typedef struct _win_st WINDOW;
#endif /* __NCURSES_H */
struct ct_surface {
struct ct_dims *dims;
struct ct_bounds *bounds;
WINDOW *win;
unsigned char updatereq;
};
struct ct_surface *new_surface(struct ct_dims *const dims,
struct ct_bounds *const bounds);
void destroy_surface(const struct ct_surface *const surface);
void resize_surface(struct ct_surface *const surface,
struct ct_dims *const dims);
void rebind_surface(struct ct_surface *const surface,
struct ct_bounds *const bounds);
#define sfpos(surface, x, y) (x = sfposx(surface), y = sfposy(surface))
#define sfsize(surface, width, height) (width = sfwidth(surface), height = sfheight(surface))
int sfwidth(const struct ct_surface *const surface);
int sfheight(const struct ct_surface *const surface);
int sfposx(const struct ct_surface *const surface);
int sfposy(const struct ct_surface *const surface);
struct ct_dims *sfdims(const struct ct_surface *const surface);
void sfclear(struct ct_surface *const surface);
void sfflush(struct ct_surface *const surface);
#endif /* CURSETREE_SURFACE_H */