} shape_desc;
#ifndef DISABLE_CODEGENS
+ typedef struct codegen_s codegen_t;
+ typedef struct codegen_info_s codegen_info_t;
+
struct codegen_s {
void (*reset) (void);
void (*begin_job) (FILE * ofp, graph_t * g, char **lib, char *user,
#include "types.h"
#include "globals.h"
#include "graph.h"
-#include "gvplugin.h"
+#include "gvcext.h"
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
- typedef struct gvdevice_engine_s gvdevice_engine_t;
- typedef struct gvrender_engine_s gvrender_engine_t;
- typedef struct gvlayout_engine_s gvlayout_engine_t;
- typedef struct gvtextlayout_engine_s gvtextlayout_engine_t;
- typedef struct gvusershape_engine_s gvusershape_engine_t;
-
typedef struct GVJ_s GVJ_t;
typedef struct GVC_s GVC_t;
-#ifndef DISABLE_CODEGENS
- typedef struct codegen_s codegen_t;
- typedef struct codegen_info_s codegen_info_t;
-#endif
+ typedef struct {
+ const char *name;
+ void* address;
+ } lt_symlist_t;
+
+ extern const lt_symlist_t lt_preloaded_symbols[];
#ifdef __cplusplus
}
extern "C" {
#endif
-#include "geom.h"
-#include "color.h"
+#include "types.h"
#define ARRAY_SIZE(A) (sizeof(A)/sizeof(A[0]))
+ typedef struct gvdevice_engine_s gvdevice_engine_t;
+ typedef struct gvrender_engine_s gvrender_engine_t;
+ typedef struct gvlayout_engine_s gvlayout_engine_t;
+ typedef struct gvtextlayout_engine_s gvtextlayout_engine_t;
+ typedef struct gvusershape_engine_s gvusershape_engine_t;
+
+
typedef enum { PEN_NONE, PEN_DASHED, PEN_DOTTED, PEN_SOLID } pen_type;
typedef enum { FILL_NONE, FILL_SOLID } fill_type;
typedef enum { FONT_REGULAR, FONT_BOLD, FONT_ITALIC } font_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
}
gvplugin_api_t *apis;
} gvplugin_library_t;
-
- typedef struct {
- const char *name;
- void* address;
- } lt_symlist_t;
-
- extern const lt_symlist_t lt_preloaded_symbols[];
-
#ifdef __cplusplus
}
#endif
}
//-------------------------------------------------
-char *set(Agraph_t *g, Agsym_t *a)
+char *getv(Agraph_t *g, Agsym_t *a)
{
char *val;
return "";
return val;
}
-char *set(Agraph_t *g, char *attr)
+char *getv(Agraph_t *g, char *attr)
{
Agsym_t *a;
char *val;
return "";
return val;
}
-char *set(Agraph_t *g, Agsym_t *a, char *val)
+char *setv(Agraph_t *g, Agsym_t *a, char *val)
{
- if (!g || !a)
+ if (!g || !a || !val)
return NULL;
- if (!val) {
- val = agxget(g, a->index);
- if (!val)
- return "";
- return val;
- }
agxset(g, a->index, val);
return val;
}
-char *set(Agraph_t *g, char *attr, char *val)
+char *setv(Agraph_t *g, char *attr, char *val)
{
Agsym_t *a;
- if (!g || !attr)
+ if (!g || !attr || !val)
return NULL;
a = agfindattr(g->root, attr);
if (!a)
a = agraphattr(g->root, attr, "");
- if (!val) {
- val = agxget(g, a->index);
- if (!val)
- return "";
- return val;
- }
agxset(g, a->index, val);
return val;
}
//-------------------------------------------------
-char *set(Agnode_t *n, Agsym_t *a)
+char *getv(Agnode_t *n, Agsym_t *a)
{
char *val;
return "";
return val;
}
-char *set(Agnode_t *n, char *attr)
+char *getv(Agnode_t *n, char *attr)
{
Agraph_t *g;
Agsym_t *a;
return "";
return val;
}
-char *set(Agnode_t *n, Agsym_t *a, char *val)
+char *setv(Agnode_t *n, Agsym_t *a, char *val)
{
- if (!n || !a)
+ if (!n || !a || !val)
return NULL;
- if (!val) {
- val = agxget(n, a->index);
- if (!val)
- return "";
- return val;
- }
agxset(n, a->index, val);
return val;
}
-char *set(Agnode_t *n, char *attr, char *val)
+char *setv(Agnode_t *n, char *attr, char *val)
{
Agraph_t *g;
Agsym_t *a;
- if (!n || !attr)
+ if (!n || !attr || !val)
return NULL;
g = n->graph->root;
a = agfindattr(g->proto->n, attr);
if (!a)
a = agnodeattr(g, attr, "");
- if (!val) {
- val = agxget(n, a->index);
- if (!val)
- return "";
- return val;
- }
agxset(n, a->index, val);
return val;
}
//-------------------------------------------------
-char *set(Agedge_t *e, Agsym_t *a)
+char *getv(Agedge_t *e, Agsym_t *a)
{
char *val;
return "";
return val;
}
-char *set(Agedge_t *e, char *attr)
+char *getv(Agedge_t *e, char *attr)
{
Agraph_t *g;
Agsym_t *a;
return "";
return val;
}
-char *set(Agedge_t *e, Agsym_t *a, char *val)
+char *setv(Agedge_t *e, Agsym_t *a, char *val)
{
- if (!e || !a)
+ if (!e || !a || !val)
return NULL;
- if (!val) {
- val = agxget(e, a->index);
- if (!val)
- return "";
- return val;
- }
agxset(e, a->index, val);
return val;
}
-char *set(Agedge_t *e, char *attr, char *val)
+char *setv(Agedge_t *e, char *attr, char *val)
{
Agraph_t *g;
Agsym_t *a;
- if (!e || !attr)
+ if (!e || !attr || !val)
return NULL;
g = e->head->graph->root;
a = agfindattr(g->proto->e, attr);
if (!a)
a = agnodeattr(g, attr, "");
- if (!val) {
- val = agxget(e, a->index);
- if (!val)
- return "";
- return val;
- }
agxset(e, a->index, val);
return val;
}
extern Agedge_t *edge(Agraph_t *g, char *tname, char *hname);/* add edge between named nodes, induced as necessary */
/* set/get attribute of graph/node/edge */
-extern char *set(Agraph_t *g, char *attr, char *val=NULL);
-extern char *set(Agnode_t *n, char *attr, char *val=NULL);
-extern char *set(Agedge_t *e, char *attr, char *val=NULL);
+extern char *setv(Agraph_t *g, char *attr, char *val);
+extern char *setv(Agnode_t *n, char *attr, char *val);
+extern char *setv(Agedge_t *e, char *attr, char *val);
-extern char *set(Agraph_t *g, Agsym_t *a, char *val=NULL);
-extern char *set(Agnode_t *n, Agsym_t *a, char *val=NULL);
-extern char *set(Agedge_t *e, Agsym_t *a, char *val=NULL);
+extern char *setv(Agraph_t *g, Agsym_t *a, char *val);
+extern char *setv(Agnode_t *n, Agsym_t *a, char *val);
+extern char *setv(Agedge_t *e, Agsym_t *a, char *val);
+
+extern char *getv(Agraph_t *g, char *attr);
+extern char *getv(Agnode_t *n, char *attr);
+extern char *getv(Agedge_t *e, char *attr);
+
+extern char *getv(Agraph_t *g, Agsym_t *a);
+extern char *getv(Agnode_t *n, Agsym_t *a);
+extern char *getv(Agedge_t *e, Agsym_t *a);
/* names */
extern char *nameof(Agraph_t *g);