driver.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*!
  2. \file lib/pngdriver/driver.c
  3. \brief GRASS png display driver - driver initialization
  4. (C) 2007-2014 by Glynn Clements and the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. \author Glynn Clements
  8. */
  9. #include "pngdriver.h"
  10. /*!
  11. \brief Initialize display driver
  12. \return pointer driver structure
  13. */
  14. const struct driver *PNG_Driver(void)
  15. {
  16. static struct driver drv;
  17. static int initialized;
  18. if (initialized)
  19. return &drv;
  20. drv.name = "png";
  21. drv.Box = PNG_Box;
  22. drv.Erase = PNG_Erase;
  23. drv.Graph_set = PNG_Graph_set;
  24. drv.Graph_close = PNG_Graph_close;
  25. drv.Graph_get_file = PNG_Graph_get_file;
  26. drv.Line_width = PNG_Line_width;
  27. drv.Set_window = PNG_Set_window;
  28. drv.Begin_raster = PNG_begin_raster;
  29. drv.Raster = PNG_raster;
  30. drv.End_raster = NULL;
  31. drv.Begin = PNG_Begin;
  32. drv.Move = PNG_Move;
  33. drv.Cont = PNG_Cont;
  34. drv.Close = PNG_Close;
  35. drv.Stroke = PNG_Stroke;
  36. drv.Fill = PNG_Fill;
  37. drv.Point = PNG_Point;
  38. drv.Color = PNG_color_rgb;
  39. drv.Bitmap = PNG_draw_bitmap;
  40. drv.Text = NULL;
  41. drv.Text_box = NULL;
  42. drv.Set_font = NULL;
  43. drv.Font_list = NULL;
  44. drv.Font_info = NULL;
  45. initialized = 1;
  46. return &drv;
  47. }