extern "C" {
#endif
+#include "geom.h"
+#include "color.h"
+
#define ARRAY_SIZE(A) (sizeof(A)/sizeof(A[0]))
typedef enum { PEN_NONE, PEN_DASHED, PEN_DOTTED, PEN_SOLID } pen_type;
void (*modify) (GVJ_t * job, char *name, char *value);
} gvdevice_callbacks_t;
+ typedef int (*gvevent_key_callback_t) (GVJ_t * job);
+
+ typedef struct gvevent_key_binding_s {
+ char *keystring;
+ gvevent_key_callback_t callback;
+ } gvevent_key_binding_t;
+
struct GVJ_s {
GVC_t *gvc; /* parent gvc */
GVJ_t *next; /* linked list of jobs */
unsigned int width; /* device width in device units */
unsigned int height; /* device height in device units */
+ box boundingBox; /* drawable region in device units */
int dpi; /* device resolution device-units-per-inch */
+
+ boxf bb; /* bb in graph units */
double zoom; /* viewport zoom factor */
int rotation; /* viewport rotation 0=portrait, 1=landscape */
pointf focus; /* viewport focus in graph units */
- box boundingBox; /* drawable region in device units */
boxf clip; /* clip region in graph units */
boxf pageBoxClip; /* intersection of clip and pageBox */
/* e.g. "color" "red" "style" "filled" */
void *window; /* display-specific data for gvrender plugin */
- };
- typedef int (*gvevent_key_callback_t) (GVJ_t * job);
-
- typedef struct gvevent_key_binding_s {
- char *keystring;
- gvevent_key_callback_t callback;
- } gvevent_key_binding_t;
+ /* keybindings for keyboard events */
+ gvevent_key_binding_t *keybindings;
+ int numkeys;
+ void *keycodes;
+ };
#ifdef __cplusplus
}
void gvdevice_finalize(GVC_t * gvc)
{
- GVJ_t *job = gvc->active_jobs;
- gvdevice_engine_t *gvde = job->device.engine;
+ GVJ_t *firstjob = gvc->active_jobs;
+ gvdevice_engine_t *gvde = firstjob->device.engine;
if (gvde) {
if (gvde->finalize) {
- job->callbacks = &gvdevice_callbacks;
- gvde->finalize(gvc);
+ firstjob->callbacks = &gvdevice_callbacks;
+ gvde->finalize(firstjob);
}
}
#ifndef DISABLE_CODEGENS
else {
- codegen_t *cg = job->codegen;
+ codegen_t *cg = firstjob->codegen;
if (cg && cg->reset)
cg->reset();