Graphviz  2.29.20120524.0446
lib/gvc/gvplugin.h
Go to the documentation of this file.
00001 /* $Id$ $Revision$ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /*************************************************************************
00005  * Copyright (c) 2011 AT&T Intellectual Property 
00006  * All rights reserved. This program and the accompanying materials
00007  * are made available under the terms of the Eclipse Public License v1.0
00008  * which accompanies this distribution, and is available at
00009  * http://www.eclipse.org/legal/epl-v10.html
00010  *
00011  * Contributors: See CVS logs. Details at http://www.graphviz.org/
00012  *************************************************************************/
00013 
00014 /* Header used by plugins */
00015 
00016 #ifndef GVPLUGIN_H
00017 #define GVPLUGIN_H
00018 
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022 
00023 #include "gvcext.h"
00024 
00025 /* 
00026  * Terminology:
00027  *
00028  *    package         - e.g. libgvplugin_cairo.so
00029  *       api          - e.g. render
00030  *          type      - e.g. "png", "ps"
00031  */
00032 
00033     typedef struct {
00034         int id;         /* an id that is only unique within a package 
00035                         of plugins of the same api.
00036                         A renderer-type such as "png" in the cairo package
00037                         has an id that is different from the "ps" type
00038                         in the same package */
00039         const char *type;       /* a string name, such as "png" or "ps" that
00040                         distinguishes different types withing the same
00041                          (renderer in this case) */
00042         int quality;    /* an arbitrary integer used for ordering plugins of
00043                         the same type from different packages */
00044         void *engine;   /* pointer to the jump table for the plugin */
00045         void *features; /* pointer to the feature description 
00046                                 void* because type varies by api */
00047     } gvplugin_installed_t;
00048 
00049     typedef struct {
00050         api_t api;
00051         gvplugin_installed_t *types;
00052     } gvplugin_api_t;
00053 
00054     typedef struct {
00055         char *packagename;    /* used when this plugin is builtin and has
00056                                         no pathname */
00057         gvplugin_api_t *apis;
00058     } gvplugin_library_t;
00059 
00060 #ifdef __cplusplus
00061 }
00062 #endif
00063 #endif                          /* GVPLUGIN_H */