/* * $Id: xbasic.h,v 1.1.1.1 2005/09/18 22:04:30 dhmunro Exp $ * Declare the basic play engine for GIST. */ /* Copyright (c) 2005, The Regents of the University of California. * All rights reserved. * This file is part of yorick (http://yorick.sourceforge.net). * Read the accompanying LICENSE file for details. */ #ifndef XBASIC_H #define XBASIC_H #include "gist.h" #include "engine.h" #include "play.h" typedef struct XEngine XEngine; struct XEngine { Engine e; /* --------------- Specific to XEngine ------------------- */ p_scr *s; p_win *win; int width, height; /* of (virtual page) graphics window */ int wtop, htop; /* of actual top-level window */ int topMargin; /* height of top menu bar, if any */ int leftMargin; /* width of left menu bar, if any */ int x, y; /* position of graphics relative to win */ int dpi; /* resolution of X window (dots per inch, 75 or 100) */ int mapped, clipping; /* if w!=win, this is animation mode */ p_win *w; int a_width, a_height; /* of animation Pixmap */ int a_x, a_y; /* where it goes on graphics window */ GpTransform swapped; /* transform for graphics window while * in animation mode */ /* if non-zero, these handlers can deal with input events */ void (*HandleExpose)(Engine *engine, Drauing *drawing, int *xy); void (*HandleClick)(Engine *e,int b,int md,int x,int y, unsigned long ms); void (*HandleMotion)(Engine *e,int md,int x,int y); void (*HandleKey)(Engine *e,int k,int md); }; PLUG_API p_scr *g_connect(char *displayName); PLUG_API void g_disconnect(p_scr *s); PLUG_API int gx75width, gx100width; /* defaults are 450 and 600 pixels */ #define DefaultTopWidth(dpi) \ (gx75width