libcm is a C development framework with an emphasis on audio signal processing applications.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cmSvgWriter.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //| Copyright: (C) 2009-2020 Kevin Larke <contact AT larke DOT org>
  2. //| License: GNU GPL version 3.0 or above. See the accompanying LICENSE file.
  3. #ifndef cmSvgWriter_h
  4. #define cmSvgWriter_h
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. //( { file_desc:"SVG file writer." kw[file plot] }
  9. enum
  10. {
  11. kOkSvgRC = cmOkRC,
  12. kFileFailSvgRC,
  13. kPrintFailSvgRC,
  14. kLHeapFailSvgRC
  15. };
  16. typedef cmRC_t cmSvgRC_t;
  17. typedef cmHandle_t cmSvgH_t;
  18. extern cmSvgH_t cmSvgNullHandle;
  19. cmSvgRC_t cmSvgWriterAlloc( cmCtx_t* ctx, cmSvgH_t* hp );
  20. cmSvgRC_t cmSvgWriterFree( cmSvgH_t* hp );
  21. bool cmSvgWriterIsValid( cmSvgH_t h );
  22. cmSvgRC_t cmSvgWriterRect( cmSvgH_t h, double x, double y, double ww, double hh, const cmChar_t* cssClassLabel );
  23. cmSvgRC_t cmSvgWriterLine( cmSvgH_t h, double x0, double y0, double x1, double y1, const cmChar_t* cssClassLabel );
  24. cmSvgRC_t cmSvgWriterText( cmSvgH_t h, double x, double y, const cmChar_t* text, const cmChar_t* cssClassLabel );
  25. // Write the SVG file. Note that header on this file references the CSS file 'cssFn'
  26. // and the Javascript file svg-pan-zoom.min.js from https://github.com/ariutta/svg-pan-zoom.
  27. // Both the CSS file and svg-pan-zoom.min.js should therefore be in the same directory
  28. // as the output HTML file.
  29. cmSvgRC_t cmSvgWriterWrite( cmSvgH_t h, const cmChar_t* cssFn, const cmChar_t* outFn, bool standaloneFl, bool panZoomFl );
  30. //)
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif