PhoenixInkscape  0.8.0
Batch convert SVG to PNG with Inkscape
Loading...
Searching...
No Matches
pinkscape_slide.h File Reference
#include <map>
#include "PPath.h"
+ Include dependency graph for pinkscape_slide.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  POutoutMode
 Output mode of the html backend. More...
 

Macros

#define SLIDE_RECOVER_FILE   "_slide_recover.slide"
 Define the name of the file which contains the formulae and the path to the created file.
 

Typedefs

typedef std::map< PPath, PPath > PMapSlide
 Map of the formulae generated by the ptex2html which can be reused by other PLatexObj which have the same formula.
 

Functions

bool pinkscape_isSlideKnown (POutoutMode &outputMode, const PPath &outputSlide, const PString &slideContent)
 Check if the slide we are going to save was already saved (with the same content) or not.
 
void pinkscape_loadSlideMap (PMapSlide &mapFormula, const PPath &baseOutputName)
 Load the map file of all the formulae if it exists.
 
void pinkscape_saveSlideMap (const PMapSlide &mapFormula, const PPath &baseOutputName)
 Save the map file of the formulae to avoid extra latex call.
 

Macro Definition Documentation

◆ SLIDE_RECOVER_FILE

#define SLIDE_RECOVER_FILE   "_slide_recover.slide"

Define the name of the file which contains the formulae and the path to the created file.

Definition at line 14 of file pinkscape_slide.h.

Referenced by pinkscape_loadSlideMap(), and pinkscape_saveSlideMap().

Typedef Documentation

◆ PMapSlide

typedef std::map<PPath,PPath> PMapSlide

Map of the formulae generated by the ptex2html which can be reused by other PLatexObj which have the same formula.

Definition at line 17 of file pinkscape_slide.h.

Function Documentation

◆ pinkscape_isSlideKnown()

bool pinkscape_isSlideKnown ( POutoutMode & outputMode,
const PPath & outputSlide,
const PString & slideContent )

Check if the slide we are going to save was already saved (with the same content) or not.

Parameters
[out]outputMode: output mode to be checked and/or updated
outputSlide: output file name of the current slide
slideContent: content of the slide in svg

Definition at line 37 of file pinkscape_slide.cpp.

37 {
38 PMapSlide & mapSlide = outputMode.mapSlide;
39 PMapSlide::iterator it(mapSlide.find(outputSlide));
40 if(it != mapSlide.end()){ //The slide is already known
41 if(it->second == slideContent){ //If the slide content is the same
42 if(outputSlide.isFileExist()){ //We do not need to save it because it already exist
43 return true;
44 }else{
45 std::cout << "pinkscape_isSlideKnown : file '"<<outputSlide<<"' does not exist" << std::endl;
46 }
47 }else{
48 std::cout << "pinkscape_isSlideKnown : '"<<outputSlide<<" 'slide content changed" << std::endl;
49 }
50 }
51 //The slide is not known
52
53 //Let's update the slide content (or create it)
54 mapSlide[outputSlide] = slideContent;
55 return false;
56}
std::map< PPath, PPath > PMapSlide
Map of the formulae generated by the ptex2html which can be reused by other PLatexObj which have the ...
PMapSlide mapSlide
Map of the formula which are already saved as png files.

References POutoutMode::mapSlide.

Referenced by saveSlides().

+ Here is the caller graph for this function:

◆ pinkscape_loadSlideMap()

void pinkscape_loadSlideMap ( PMapSlide & mapFormula,
const PPath & baseOutputName )

Load the map file of all the formulae if it exists.

Parameters
[out]mapFormula: map of formulae to be loaded to avoid calling latex too much

Definition at line 19 of file pinkscape_slide.cpp.

19 {
20 PPath fileName(baseOutputName + PPath(SLIDE_RECOVER_FILE));
21 if(!data_load(fileName, mapFormula)){return;}
22}
#define SLIDE_RECOVER_FILE
Define the name of the file which contains the formulae and the path to the created file.

References SLIDE_RECOVER_FILE.

Referenced by processFileSvg().

+ Here is the caller graph for this function:

◆ pinkscape_saveSlideMap()

void pinkscape_saveSlideMap ( const PMapSlide & mapFormula,
const PPath & baseOutputName )

Save the map file of the formulae to avoid extra latex call.

Parameters
[out]mapFormula: map of formulae to be saved

Definition at line 27 of file pinkscape_slide.cpp.

27 {
28 PPath fileName(baseOutputName + PPath(SLIDE_RECOVER_FILE));
29 if(!data_save(fileName, mapFormula)){return;}
30}

References SLIDE_RECOVER_FILE.

Referenced by processFileSvg().

+ Here is the caller graph for this function: