From: ellson Date: Wed, 4 May 2005 00:52:03 +0000 (+0000) Subject: rename API_text to API_textlayout X-Git-Tag: LAST_LIBGRAPH~32^2~7581 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c13e0ded11e62162fddb2f00513a0d34faf6567;p=graphviz rename API_text to API_textlayout add some comments to gvplugin.h --- diff --git a/lib/gvc/Makefile.am b/lib/gvc/Makefile.am index 90d3d1fcc..e5e895f43 100644 --- a/lib/gvc/Makefile.am +++ b/lib/gvc/Makefile.am @@ -14,7 +14,7 @@ pkginclude_HEADERS = gvc.h gvcint.h gvplugin.h \ gvplugin_render.h gvplugin_layout.h gvplugin_text.h pkglib_LTLIBRARIES = libgvc.la -libgvc_la_SOURCES = gvrender.c gvlayout.c gvtext.c gvcontext.c \ +libgvc_la_SOURCES = gvrender.c gvlayout.c gvtextlayout.c gvcontext.c \ gvjobs.c gvevent.c gvplugin.c gvconfig.c gvhostname.c EXTRA_DIST = Makefile.old diff --git a/lib/gvc/gvplugin.h b/lib/gvc/gvplugin.h index 370a49768..16b646ac5 100644 --- a/lib/gvc/gvplugin.h +++ b/lib/gvc/gvplugin.h @@ -27,23 +27,41 @@ extern "C" { #define NULL (void *)0 #endif + +/* + * Terminology: + * + * package - e.g. libgvplugin_cairo.so, or table of codegen builtins. + * api - e.g. render + * type - e.g. "png", "ps" + */ + /* * Define an apis array of name strings using an enumerated api_t as index. * The enumerated type is defined here. The apis array is * inititialized in gvplugin.c by redefining ELEM and reinvoking APIS. */ -#define APIS ELEM(render) ELEM(layout) ELEM(display) ELEM(text) +#define APIS ELEM(render) ELEM(layout) ELEM(textlayout) #define ELEM(x) API_##x, typedef enum { APIS } api_t; /* API_render, API_layout, ... */ #undef ELEM typedef struct { - int id; - char *type; - int quality; - void *engine; - void *features; + int id; /* an id that is only unique within a package + of plugins of the same api. + A codegen id is unique in in the set of codegens. + A renderer-type such as "png" in the cairo package + has an id that is different from the "ps" type + in the same package */ + char *type; /* a string name, such as "png" or "ps" that + distinguishes different types withing the same + api (renderer in this case) */ + int quality; /* an arbitrary integer used for ordering plugins of + the same type from different packages */ + void *engine; /* pointer to the jump table for the plugin */ + void *features; /* pointer to the feature description + void* because type varies by api */ } gvplugin_type_t; typedef struct { diff --git a/lib/gvc/gvtext.c b/lib/gvc/gvtextlayout.c similarity index 96% rename from lib/gvc/gvtext.c rename to lib/gvc/gvtextlayout.c index dfa113d4b..40e0b0c09 100644 --- a/lib/gvc/gvtext.c +++ b/lib/gvc/gvtextlayout.c @@ -36,7 +36,7 @@ int gvtext_select(GVC_t * gvc, char *text_layout) gv_plugin_t *plugin; gvplugin_type_t *typeptr; - plugin = gvplugin_load(gvc, API_text, text_layout); + plugin = gvplugin_load(gvc, API_textlayout, text_layout); if (plugin) { typeptr = plugin->typeptr; gvc->layout_engine = (gvlayout_engine_t *) (typeptr->engine);