PhoenixInkscape
1.2.4
Batch convert SVG to PNG with Inkscape
Toggle main menu visibility
Loading...
Searching...
No Matches
pinkscape_slide.cpp
Go to the documentation of this file.
1
/***************************************
2
Auteur : Pierre Aubert
3
Mail : pierre.aubert@lapp.in2p3.fr
4
Licence : CeCILL-C
5
****************************************/
6
7
#include <sys/stat.h>
8
#include <sys/types.h>
9
#include <fstream>
10
11
#include "data_all.h"
12
#include "convertToString.h"
13
14
#include "
pinkscape_slide.h
"
15
17
19
void
pinkscape_loadSlideMap
(
PMapSlide
& mapFormula,
const
PPath & baseOutputName){
20
PPath fileName(baseOutputName + PPath(
SLIDE_RECOVER_FILE
));
21
if
(!data_load(fileName, mapFormula)){
return
;}
22
}
23
25
27
void
pinkscape_saveSlideMap
(
const
PMapSlide
& mapFormula,
const
PPath & baseOutputName){
28
PPath fileName(baseOutputName + PPath(
SLIDE_RECOVER_FILE
));
29
if
(!data_save(fileName, mapFormula)){
return
;}
30
}
31
33
37
bool
pinkscape_isSlideKnown
(
POutoutMode
& outputMode,
const
PPath & outputSlide,
const
PString & slideContent){
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
}
57
58
59
60
61
pinkscape_loadSlideMap
void pinkscape_loadSlideMap(PMapSlide &mapFormula, const PPath &baseOutputName)
Load the map file of all the formulae if it exists.
Definition
pinkscape_slide.cpp:19
pinkscape_saveSlideMap
void pinkscape_saveSlideMap(const PMapSlide &mapFormula, const PPath &baseOutputName)
Save the map file of the formulae to avoid extra latex call.
Definition
pinkscape_slide.cpp:27
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.
Definition
pinkscape_slide.cpp:37
pinkscape_slide.h
SLIDE_RECOVER_FILE
#define SLIDE_RECOVER_FILE
Define the name of the file which contains the formulae and the path to the created file.
Definition
pinkscape_slide.h:14
PMapSlide
std::map< PPath, PPath > PMapSlide
Map of the formulae generated by the ptex2html which can be reused by other PLatexObj which have the ...
Definition
pinkscape_slide.h:17
POutoutMode
Output mode of the html backend.
Definition
pinkscape_slide.h:20
POutoutMode::mapSlide
PMapSlide mapSlide
Map of the formula which are already saved as png files.
Definition
pinkscape_slide.h:22
src
pinkscape_slide.cpp
Generated by
1.17.0