PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
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. More...
 

Typedefs

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

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. More...
 
void pinkscape_loadSlideMap (PMapSlide &mapFormula, const PPath &baseOutputName)
 Load the map file of all the formulae if it exists. More...
 
void pinkscape_saveSlideMap (const PMapSlide &mapFormula, const PPath &baseOutputName)
 Save the map file of the formulae to avoid extra latex call. More...
 

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.

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 }
bool isFileExist() const
Say if the current file path does exist.
Definition: PPath.cpp:139
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 PPath::isFileExist(), and POutoutMode::mapSlide.

Referenced by saveSlides().

+ Here is the call graph for this function:
+ 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 }
Path of a directory or a file.
Definition: PPath.h:17
bool data_load(FILE *iter, T &data)
Load data from a message.
Definition: data_file.h:39
#define SLIDE_RECOVER_FILE
Define the name of the file which contains the formulae and the path to the created file.

References data_load(), and SLIDE_RECOVER_FILE.

Referenced by processFileSvg().

+ Here is the call graph for this function:
+ 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 }
bool data_save(FILE *iter, const T &data)
Save data in a message.
Definition: data_file.h:18

References data_save(), and SLIDE_RECOVER_FILE.

Referenced by processFileSvg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: