gvplugin.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /// @file
  2. /// @ingroup plugin_api
  3. /// @defgroup plugin_api Plugin API
  4. /// @ingroup public_apis
  5. /// @{
  6. /*************************************************************************
  7. * Copyright (c) 2011 AT&T Intellectual Property
  8. * All rights reserved. This program and the accompanying materials
  9. * are made available under the terms of the Eclipse Public License v1.0
  10. * which accompanies this distribution, and is available at
  11. * https://www.eclipse.org/legal/epl-v10.html
  12. *
  13. * Contributors: Details at https://graphviz.org
  14. *************************************************************************/
  15. /* Header used by plugins */
  16. #pragma once
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #include "gvcext.h"
  21. /*
  22. * Terminology:
  23. *
  24. * package - e.g. libgvplugin_cairo.so
  25. * api - e.g. render
  26. * type - e.g. "png", "ps"
  27. */
  28. /// ingroup plugin_api
  29. typedef struct {
  30. int id; /* an id that is only unique within a package
  31. of plugins of the same api.
  32. A renderer-type such as "png" in the cairo package
  33. has an id that is different from the "ps" type
  34. in the same package */
  35. const char *type; /* a string name, such as "png" or "ps" that
  36. distinguishes different types within the same
  37. (renderer in this case) */
  38. int quality; /* an arbitrary integer used for ordering plugins of
  39. the same type from different packages */
  40. void *engine; /* pointer to the jump table for the plugin */
  41. void *features; /* pointer to the feature description
  42. void* because type varies by api */
  43. } gvplugin_installed_t;
  44. typedef struct {
  45. api_t api;
  46. gvplugin_installed_t *types;
  47. } gvplugin_api_t;
  48. typedef struct {
  49. char *packagename; /* used when this plugin is builtin and has
  50. no pathname */
  51. gvplugin_api_t *apis;
  52. } gvplugin_library_t;
  53. /// @}
  54. #ifdef __cplusplus
  55. }
  56. #endif