Canvas5StyleManager.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 
34 /*
35  * Parser to Canvas v5-v11 text document ( style part )
36  *
37  */
38 #ifndef CANVAS5_STYLE_MANAGER
39 # define CANVAS5_STYLE_MANAGER
40 
41 #include <string>
42 #include <utility>
43 #include <vector>
44 
45 #include <librevenge/librevenge.h>
46 
47 #include "libmwaw_internal.hxx"
48 
49 #include "MWAWDebug.hxx"
50 #include "MWAWFont.hxx"
51 #include "MWAWGraphicStyle.hxx"
52 #include "MWAWInputStream.hxx"
53 #include "MWAWParagraph.hxx"
54 #include "MWAWPosition.hxx"
55 
56 class MWAWFont;
57 
58 namespace Canvas5Structure
59 {
60 struct Stream;
61 }
62 
64 {
65 struct ColorStyle;
66 struct PenStyle;
67 
68 struct State;
69 }
70 
71 namespace Canvas5ImageInternal
72 {
73 struct VKFLImage;
74 }
75 
76 class Canvas5Graph;
77 class Canvas5Image;
78 class Canvas5Parser;
79 
86 {
87  friend class Canvas5Graph;
88  friend class Canvas5Parser;
89 
90 public:
92  struct CharStyle {
95  : m_font()
96  , m_paragraphId(0)
97  , m_linkId(0)
98  {
99  }
105  int m_linkId;
106  };
107 
109  struct StyleList {
112  : m_fonts()
113  , m_paragraphs()
114  {
115  }
117  std::vector<CharStyle> m_fonts;
119  std::vector<std::pair<MWAWParagraph, int> > m_paragraphs;
120  };
121 
123  explicit Canvas5StyleManager(Canvas5Parser &parser);
125  virtual ~Canvas5StyleManager();
126 
128  int version() const;
130  std::shared_ptr<Canvas5Image> getImageParser() const;
131 
133  std::shared_ptr<Canvas5StyleManagerInternal::ColorStyle> readColorStyle(std::shared_ptr<Canvas5Structure::Stream> stream, unsigned type, long len);
138 
140  std::shared_ptr<Canvas5StyleManagerInternal::PenStyle> readPenStyle(Canvas5Structure::Stream &stream, unsigned type, long len);
142  bool updateLine(Canvas5StyleManagerInternal::PenStyle const &pen, MWAWGraphicStyle &style, int &numLines, int lineId, float *offset);
143 
145  bool readArrow(std::shared_ptr<Canvas5Structure::Stream> stream, MWAWGraphicStyle::Arrow &arrow, unsigned type, long len);
147  bool readCharStyle(Canvas5Structure::Stream &stream, int id, CharStyle &fontIds, bool useFileColors=true);
149  bool readDash(Canvas5Structure::Stream &stream, std::vector<float> &dashes, unsigned type, long len);
151  bool readStyleEnd(std::shared_ptr<Canvas5Structure::Stream> stream, MWAWFont *font=nullptr, MWAWParagraph *para=nullptr);
152 
153 protected:
154  // interface
155 
161  bool updateLineStyle(int sId, MWAWGraphicStyle &style, int &numLines, int lineId=-1, float *offset=nullptr);
163  bool updateLineColor(int cId, MWAWGraphicStyle &style);
165  bool updateSurfaceColor(int cId, MWAWGraphicStyle &style);
166 
167  //
168  // Intermediate level
169  //
170 
172  bool readArrows(std::shared_ptr<Canvas5Structure::Stream> stream);
174  bool readCharStyles(std::shared_ptr<Canvas5Structure::Stream> stream);
176  bool readInks(std::shared_ptr<Canvas5Structure::Stream> stream);
178  bool readInks9(std::shared_ptr<Canvas5Structure::Stream> stream);
180  bool readColor(Canvas5Structure::Stream &stream, MWAWVariable<MWAWColor> &color, std::string &extra);
182  bool readDashes(std::shared_ptr<Canvas5Structure::Stream> stream);
184  bool readFrameStyles9(std::shared_ptr<Canvas5Structure::Stream> stream);
186  bool readFonts(std::shared_ptr<Canvas5Structure::Stream> stream, int numFonts);
188  bool readFormats(std::shared_ptr<Canvas5Structure::Stream> stream);
190  bool readPenSize(std::shared_ptr<Canvas5Structure::Stream> stream);
192  bool readPenStyles(std::shared_ptr<Canvas5Structure::Stream> stream);
194  bool readStrokes(std::shared_ptr<Canvas5Structure::Stream> stream);
196  bool readParaStyle(std::shared_ptr<Canvas5Structure::Stream> stream, int id, StyleList *styles=nullptr);
198  bool readParaStyles(std::shared_ptr<Canvas5Structure::Stream> stream);
199 
200  //
201  // Windows RSRC
202  //
203 
204  //
205  // Low level
206  //
207 
209  bool readGradient(std::shared_ptr<Canvas5Structure::Stream> stream, long len, MWAWGraphicStyle::Gradient &gradient);
211  bool readHatch(std::shared_ptr<Canvas5Structure::Stream> stream, long len, MWAWGraphicStyle::Hatch &hatch,
212  MWAWVariable<MWAWColor> &backColor);
214  std::shared_ptr<Canvas5ImageInternal::VKFLImage> readSymbol(std::shared_ptr<Canvas5Structure::Stream> stream, long len,
215  MWAWVariable<MWAWColor> &backColor);
216 
217 private:
220 
221 protected:
222  //
223  // data
224  //
227 
229  std::shared_ptr<Canvas5StyleManagerInternal::State> m_state;
230 
233 };
234 #endif
235 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Canvas5Image
the main class to read/convert the image or movie inside of Canvas 5-11 files
Definition: Canvas5Image.hxx:78
MWAWParagraph::m_justify
MWAWVariable< Justification > m_justify
the justification
Definition: MWAWParagraph.hxx:167
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
Canvas5StyleManagerInternal::PenStyle::m_size
MWAWVec2f m_size
the pen size
Definition: Canvas5StyleManager.cxx:145
Canvas5StyleManagerInternal::ColorStyle::m_textureDim
MWAWVec2i m_textureDim
the texture dimension
Definition: Canvas5StyleManager.cxx:101
Canvas5Parser::defDataFunction
static void defDataFunction(std::shared_ptr< Canvas5Structure::Stream >, Item const &, std::string const &)
the default function to parse the data of a index map/a extended header
Definition: Canvas5Parser.hxx:208
MWAWFont::set
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:314
Canvas5StyleManager::readStrokes
bool readStrokes(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the stroke styles
Definition: Canvas5StyleManager.cxx:1530
MWAWGraphicStyle::Hatch::m_distance
float m_distance
the hatch distance in inches
Definition: MWAWGraphicStyle.hxx:340
MWAWGraphicStyle::Gradient::Stop::m_offset
float m_offset
the offset
Definition: MWAWGraphicStyle.hxx:170
MWAWFont::smallCapsBit
@ smallCapsBit
Definition: MWAWFont.hxx:192
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
Canvas5StyleManagerInternal::PenStyle::m_lines
std::vector< Line > m_lines
the plin lines
Definition: Canvas5StyleManager.cxx:151
MWAWParagraph::m_dropNumLines
MWAWVariable< int > m_dropNumLines
the drop number of lines
Definition: MWAWParagraph.hxx:190
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:842
Canvas5Parser::isWindowsFile
bool isWindowsFile() const
returns true if the file is a windows file
Definition: Canvas5Parser.cxx:202
MWAWVariable< MWAWColor >
libmwaw::DebugFile::addDelimiter
void addDelimiter(long pos, char c)
adds a not breaking delimiter in position pos
Definition: MWAWDebug.cxx:73
Canvas5Parser::Item::m_id
int m_id
the identifier
Definition: Canvas5Parser.hxx:195
MWAWGraphicStyle::setSurfaceColor
void setSurfaceColor(MWAWColor const &col, float opacity=1)
set the surface color
Definition: MWAWGraphicStyle.hxx:487
MWAWGraphicStyle::Hatch::H_Triple
@ H_Triple
Definition: MWAWGraphicStyle.hxx:278
Canvas5StyleManager::StyleList::StyleList
StyleList()
constructor
Definition: Canvas5StyleManager.hxx:111
Canvas5StyleManager::updateLine
bool updateLine(Canvas5StyleManagerInternal::PenStyle const &pen, MWAWGraphicStyle &style, int &numLines, int lineId, float *offset)
try to update the line color given a color style
Definition: Canvas5StyleManager.cxx:2420
Canvas5StyleManager::CharStyle::m_paragraphId
int m_paragraphId
the paragraph id
Definition: Canvas5StyleManager.hxx:103
Canvas5StyleManager::readColor
bool readColor(Canvas5Structure::Stream &stream, MWAWVariable< MWAWColor > &color, std::string &extra)
try to read a color: 12 unknown 4 components followed by a type
Definition: Canvas5StyleManager.cxx:245
MWAWGraphicStyle::Gradient::m_type
Type m_type
the gradient type
Definition: MWAWGraphicStyle.hxx:262
Canvas5StyleManagerInternal::ColorStyle::m_gradient
MWAWGraphicStyle::Gradient m_gradient
the gradient
Definition: Canvas5StyleManager.cxx:97
MWAWGraphicStyle::Arrow::plain
static Arrow plain()
returns a basic plain arrow
Definition: MWAWGraphicStyle.hxx:74
MWAWFont::boldBit
@ boldBit
Definition: MWAWFont.hxx:190
MWAWGraphicStyle::m_surfaceOpacity
float m_surfaceOpacity
true if the surface has some color
Definition: MWAWGraphicStyle.hxx:597
MWAWParagraph::m_dropNumCharacters
MWAWVariable< int > m_dropNumCharacters
the drop number character
Definition: MWAWParagraph.hxx:188
Canvas5StyleManager::StyleList::m_paragraphs
std::vector< std::pair< MWAWParagraph, int > > m_paragraphs
the paragraph list and the tab id
Definition: Canvas5StyleManager.hxx:119
MWAWFont::setColor
void setColor(MWAWColor color)
sets the font color
Definition: MWAWFont.hxx:341
Canvas5StyleManagerInternal::Stroke::m_penId
int m_penId
the pen id
Definition: Canvas5StyleManager.cxx:182
Canvas5StyleManager::readGradient
bool readGradient(std::shared_ptr< Canvas5Structure::Stream > stream, long len, MWAWGraphicStyle::Gradient &gradient)
try to read a gradient zone: OBFL
Definition: Canvas5StyleManager.cxx:290
MWAWParagraph::setInterline
void setInterline(double value, librevenge::RVNGUnit unit, LineSpacingType type=Fixed)
set the interline
Definition: MWAWParagraph.hxx:129
MWAWFont::setWidthStreching
void setWidthStreching(float scale=1.0)
sets the text width streching
Definition: MWAWFont.hxx:303
MWAWFontConverter.hxx
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:192
MWAWEmbeddedObject
small class use to define a embedded object
Definition: libmwaw_internal.hxx:467
MWAWParagraph::m_spacings
MWAWVariable< double > m_spacings[3]
the line spacing
Definition: MWAWParagraph.hxx:156
Canvas5StyleManagerInternal::State
Internal: the state of a Canvas5StyleManager.
Definition: Canvas5StyleManager.cxx:191
Canvas5StyleManagerInternal::PenStyle::PenStyle
PenStyle()
constructor
Definition: Canvas5StyleManager.cxx:126
Canvas5StyleManagerInternal::State::m_idToPen
std::map< int, std::shared_ptr< PenStyle > > m_idToPen
the id to pen style map
Definition: Canvas5StyleManager.cxx:207
MWAWGraphicStyle::Gradient::G_Linear
@ G_Linear
Definition: MWAWGraphicStyle.hxx:177
Canvas5Graph
the main class to read the graphic part of Canvas v5-v11 file
Definition: Canvas5Graph.hxx:85
Canvas5Parser.hxx
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:85
MWAWFont::Line::Simple
@ Simple
Definition: MWAWFont.hxx:49
Canvas5StyleManager::readParaStyles
bool readParaStyles(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the paragraph styles
Definition: Canvas5StyleManager.cxx:2091
Canvas5Structure::Stream::input
MWAWInputStreamPtr input()
returns the input file
Definition: Canvas5Structure.hxx:65
MWAWGraphicStyle::Gradient::getAverageColor
bool getAverageColor(MWAWColor &color) const
returns the average gradient color if the gradient is defined.
Definition: MWAWGraphicStyle.cxx:168
libmwaw::DebugFile::addNote
void addNote(char const *note)
adds a note in the file, in actual position
Definition: MWAWDebug.cxx:59
MWAWFont::setDeltaLetterSpacing
void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
sets the letter spacing ( delta value in point )
Definition: MWAWFont.hxx:292
Canvas5StyleManager::StyleList::m_fonts
std::vector< CharStyle > m_fonts
the fonts, the paragraph id and the link id
Definition: Canvas5StyleManager.hxx:117
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:48
MWAWParagraph::m_margins
MWAWVariable< double > m_margins[3]
the margins
Definition: MWAWParagraph.hxx:148
Canvas5StyleManagerInternal::ColorStyle::m_nameId
int m_nameId
the name id
Definition: Canvas5StyleManager.cxx:93
Canvas5StyleManagerInternal::PenStyle::m_usePenColor
bool m_usePenColor
use pen ink
Definition: Canvas5StyleManager.cxx:149
MWAWFont::embossBit
@ embossBit
Definition: MWAWFont.hxx:190
MWAWGraphicStyle::m_lineOpacity
float m_lineOpacity
the line opacity: 0=transparent
Definition: MWAWGraphicStyle.hxx:591
MWAWFont::uppercaseBit
@ uppercaseBit
Definition: MWAWFont.hxx:192
Canvas5StyleManagerInternal::ColorStyle::m_type
unsigned m_type
the type
Definition: Canvas5StyleManager.cxx:91
Canvas5StyleManager.hxx
MWAWGraphicStyle::Gradient::G_Rectangular
@ G_Rectangular
Definition: MWAWGraphicStyle.hxx:177
Canvas5StyleManagerInternal::PenStyle::Line::m_color
MWAWVariable< MWAWColor > m_color
the line color
Definition: Canvas5StyleManager.cxx:123
MWAWFont::setStrikeOutStyle
void setStrikeOutStyle(Line::Style style=Line::None, bool doReset=true)
sets the strikeoutline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:427
MWAWVariable::isSet
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:635
MWAWGraphicStyle::Pattern
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:348
Canvas5Parser::Item::m_pos
long m_pos
the data beginning position (may be before the current position: v9)
Definition: Canvas5Parser.hxx:201
MWAWColor::barycenter
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:206
Canvas5Parser::Item::m_decal
int m_decal
the decal position
Definition: Canvas5Parser.hxx:203
Canvas5StyleManagerInternal::ColorStyle::ColorStyle
ColorStyle()
constructor
Definition: Canvas5StyleManager.cxx:68
MWAWFont::initialcaseBit
@ initialcaseBit
Definition: MWAWFont.hxx:194
Canvas5StyleManagerInternal::PenStyle::Line::m_size
MWAWVec2f m_size
the line width
Definition: Canvas5StyleManager.cxx:119
Canvas5StyleManagerInternal::Stroke::Stroke
Stroke()
constructor
Definition: Canvas5StyleManager.cxx:158
MWAWParagraph::JustificationCenter
@ JustificationCenter
Definition: MWAWParagraph.hxx:90
MWAWParagraph::m_breakStatus
MWAWVariable< int > m_breakStatus
a list of bits: 0x1 (unbreakable), 0x2 (do not break after)
Definition: MWAWParagraph.hxx:169
Canvas5Parser::readArray9
bool readArray9(std::shared_ptr< Canvas5Structure::Stream > stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction)
try to read an array: v9
Definition: Canvas5Parser.cxx:3357
MWAWGraphicStyle::Gradient::Stop::m_color
MWAWColor m_color
the color
Definition: MWAWGraphicStyle.hxx:172
Canvas5Parser::readIndexMap
bool readIndexMap(std::shared_ptr< Canvas5Structure::Stream > stream, std::string const &what, DataFunction const &func=&Canvas5Parser::defDataFunction)
try to read a index map
Definition: Canvas5Parser.cxx:3139
Canvas5StyleManager::readFrameStyles9
bool readFrameStyles9(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the frame zones: stroke, pen style, arrow, dashes: v9
Definition: Canvas5StyleManager.cxx:2197
MWAWFont::shadowBit
@ shadowBit
Definition: MWAWFont.hxx:191
Canvas5Parser::stringDataFunction
static void stringDataFunction(std::shared_ptr< Canvas5Structure::Stream > stream, Item const &item, std::string const &what)
the default function to parse a string
Definition: Canvas5Parser.cxx:3120
MWAWParagraph.hxx
Canvas5StyleManager::readArrows
bool readArrows(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the arrows zones
Definition: Canvas5StyleManager.cxx:580
Canvas5StyleManagerInternal::ColorStyle::m_hatch
MWAWGraphicStyle::Hatch m_hatch
the hatch
Definition: Canvas5StyleManager.cxx:99
Canvas5StyleManager::readColorStyle
std::shared_ptr< Canvas5StyleManagerInternal::ColorStyle > readColorStyle(std::shared_ptr< Canvas5Structure::Stream > stream, unsigned type, long len)
try to read a color style
Definition: Canvas5StyleManager.cxx:827
Canvas5StyleManager::operator=
Canvas5StyleManager & operator=(Canvas5StyleManager const &orig)=delete
Canvas5StyleManager::m_mainParser
Canvas5Parser * m_mainParser
the main parser;
Definition: Canvas5StyleManager.hxx:232
Canvas5StyleManager::m_state
std::shared_ptr< Canvas5StyleManagerInternal::State > m_state
the state
Definition: Canvas5StyleManager.hxx:229
libmwaw_internal.hxx
MWAWEmbeddedObject::isEmpty
bool isEmpty() const
return true if the picture contains no data
Definition: libmwaw_internal.hxx:486
MWAWGraphicStyle::m_lineWidth
float m_lineWidth
the linewidth
Definition: MWAWGraphicStyle.hxx:585
MWAWPosition.hxx
MWAWGraphicStyle::Hatch::m_rotation
float m_rotation
the rotation (in degrees)
Definition: MWAWGraphicStyle.hxx:342
Canvas5StyleManagerInternal::State::m_idToColor
std::map< int, std::shared_ptr< ColorStyle > > m_idToColor
the id to color style map
Definition: Canvas5StyleManager.cxx:205
MWAWGraphicStyle::Hatch::hasHatch
bool hasHatch() const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:288
Canvas5StyleManagerInternal::PenStyle::Line::Line
Line()
constructor
Definition: Canvas5StyleManager.cxx:112
Canvas5StyleManagerInternal::State::m_idToStroke
std::map< int, Stroke > m_idToStroke
the id to stroke style map
Definition: Canvas5StyleManager.cxx:211
MWAWGraphicStyle::Gradient::Stop
a structure used to define the gradient limit in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:141
Canvas5Structure::Stream::ascii
libmwaw::DebugFile & ascii()
return the ascii file
Definition: Canvas5Structure.hxx:70
Canvas5StyleManager::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: Canvas5StyleManager.hxx:226
Canvas5Structure
a namespace used to define basic function or structure to read a Canvas v5-v11 file
Definition: Canvas5BMParser.hxx:64
Canvas5StyleManager::readArrow
bool readArrow(std::shared_ptr< Canvas5Structure::Stream > stream, MWAWGraphicStyle::Arrow &arrow, unsigned type, long len)
try to read an arrow
Definition: Canvas5StyleManager.cxx:615
M_PI
#define M_PI
Definition: libmwaw_internal.hxx:52
Canvas5Parser
the main class to read a Canvas 5-10 files (and probably some not password protected Windows 11 files...
Definition: Canvas5Parser.hxx:72
Canvas5StyleManagerInternal
Internal: the structures of a Canvas5StyleManager.
Definition: Canvas5StyleManager.cxx:62
Canvas5ImageInternal
Internal: the structures of a Canvas5Image.
Definition: Canvas5Image.cxx:70
MWAWVec2< int >
Canvas5StyleManager::StyleList
a structure use to store a list of styles
Definition: Canvas5StyleManager.hxx:109
MWAWFont::size
float size() const
returns the font size
Definition: MWAWFont.hxx:270
MWAWGraphicListener.hxx
MWAWDebug.hxx
MWAWFont::getDebugString
std::string getDebugString(std::shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:181
MWAWGraphicStyle::Hatch::H_Double
@ H_Double
Definition: MWAWGraphicStyle.hxx:278
Canvas5Structure.hxx
MWAWGraphicStyle::Hatch::H_Single
@ H_Single
Definition: MWAWGraphicStyle.hxx:278
MWAWGraphicStyle::m_arrows
Arrow m_arrows[2]
the two arrows corresponding to start and end extremity
Definition: MWAWGraphicStyle.hxx:632
MWAWGraphicStyle::setPattern
void setPattern(Pattern const &pat, float opacity=1)
set the pattern
Definition: MWAWGraphicStyle.hxx:498
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:245
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1193
Canvas5StyleManager::readFonts
bool readFonts(std::shared_ptr< Canvas5Structure::Stream > stream, int numFonts)
try to read the fonts names
Definition: Canvas5StyleManager.cxx:1114
Canvas5StyleManagerInternal::Stroke
Internal: the stroke style of a Canvas5StyleManager.
Definition: Canvas5StyleManager.cxx:156
Canvas5Parser::Item::m_type
unsigned m_type
the type (if known)
Definition: Canvas5Parser.hxx:197
MWAWGraphicStyle::Hatch
a basic hatch used in MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:276
MWAWGraphicStyle::Hatch::m_color
MWAWColor m_color
the hatch color
Definition: MWAWGraphicStyle.hxx:338
Canvas5StyleManager::readDashes
bool readDashes(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the dashes
Definition: Canvas5StyleManager.cxx:1019
MWAWFont::setId
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:264
Canvas5StyleManager::readCharStyle
bool readCharStyle(Canvas5Structure::Stream &stream, int id, CharStyle &fontIds, bool useFileColors=true)
try to read a character style, returns a font, a paragraph id and it potential link id
Definition: Canvas5StyleManager.cxx:1569
Canvas5StyleManager::readStyleEnd
bool readStyleEnd(std::shared_ptr< Canvas5Structure::Stream > stream, MWAWFont *font=nullptr, MWAWParagraph *para=nullptr)
try to read the second part of a style which contains minor paragraph styles, hyphen,...
Definition: Canvas5StyleManager.cxx:1997
Canvas5StyleManagerInternal::PenStyle::Line::m_offset
float m_offset
the offset
Definition: Canvas5StyleManager.cxx:121
Canvas5Parser::readInteger
int readInteger(Canvas5Structure::Stream &stream, int fieldSize) const
try to read a int: either a cast a double: fieldSize=8 or a int32/int16
Definition: Canvas5Parser.cxx:2906
Canvas5Parser::readExtendedHeader
bool readExtendedHeader(std::shared_ptr< Canvas5Structure::Stream > stream, int expectedValue, std::string const &what, DataFunction const &func)
try to read an extended data header, ie.
Definition: Canvas5Parser.cxx:3039
Canvas5StyleManager::getImageParser
std::shared_ptr< Canvas5Image > getImageParser() const
returns the image parser
Definition: Canvas5StyleManager.cxx:234
Canvas5StyleManagerInternal::PenStyle::Line
a line of a Canvas5StyleManager pen style
Definition: Canvas5StyleManager.cxx:110
Canvas5StyleManager::updateSurfaceColor
bool updateSurfaceColor(Canvas5StyleManagerInternal::ColorStyle const &color, MWAWGraphicStyle &style)
try to update the surface color given a color style
Definition: Canvas5StyleManager.cxx:2362
Canvas5Parser::Item
a structure used to store the item data of a Canvas5Parser
Definition: Canvas5Parser.hxx:183
Canvas5StyleManagerInternal::Stroke::operator<<
friend std::ostream & operator<<(std::ostream &o, Stroke const &stroke)
Definition: Canvas5StyleManager.cxx:165
Canvas5StyleManager::readDash
bool readDash(Canvas5Structure::Stream &stream, std::vector< float > &dashes, unsigned type, long len)
try to read a dash's array
Definition: Canvas5StyleManager.cxx:1050
Canvas5StyleManager::Canvas5StyleManager
Canvas5StyleManager(Canvas5StyleManager const &orig)=delete
Canvas5StyleManagerInternal::PenStyle::m_type
unsigned m_type
the type
Definition: Canvas5StyleManager.cxx:143
MWAWFont::setSize
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:275
MWAWGraphicStyle::m_lineColor
MWAWColor m_lineColor
the line color
Definition: MWAWGraphicStyle.hxx:593
Canvas5StyleManagerInternal::ColorStyle::m_color
MWAWVariable< MWAWColor > m_color
the basic color
Definition: Canvas5StyleManager.cxx:95
MWAWColor::getAlpha
unsigned char getAlpha() const
returns the alpha value
Definition: libmwaw_internal.hxx:264
Canvas5StyleManagerInternal::State::m_idToArrow
std::map< int, MWAWGraphicStyle::Arrow > m_idToArrow
the id to arrow map
Definition: Canvas5StyleManager.cxx:203
Canvas5StyleManagerInternal::State::m_idToDash
std::map< int, std::vector< float > > m_idToDash
the id to dash map
Definition: Canvas5StyleManager.cxx:209
Canvas5StyleManager::CharStyle::CharStyle
CharStyle()
constructor
Definition: Canvas5StyleManager.hxx:94
Canvas5StyleManagerInternal::PenStyle
Internal: the pen style of a Canvas5StyleManager.
Definition: Canvas5StyleManager.cxx:108
MWAWBox2::center
MWAWVec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:1072
MWAWGraphicStyle.hxx
MWAWFont::italicBit
@ italicBit
Definition: MWAWFont.hxx:190
MWAWParagraph::m_marginsUnit
MWAWVariable< librevenge::RVNGUnit > m_marginsUnit
the margins INCH, ...
Definition: MWAWParagraph.hxx:150
Canvas5StyleManagerInternal::Stroke::m_dashId
int m_dashId
the dash id
Definition: Canvas5StyleManager.cxx:184
Canvas5Structure::getString
std::string getString(unsigned val)
very low level: debug print some uint32_t either at char4 or sample int
Definition: Canvas5Structure.cxx:47
MWAWGraphicStyle::Gradient
a basic gradient used in a MWAWGraphicStyle
Definition: MWAWGraphicStyle.hxx:139
Canvas5StyleManagerInternal::ColorStyle::m_texture
MWAWEmbeddedObject m_texture
the embedded objet (texture)
Definition: Canvas5StyleManager.cxx:103
MWAWParagraph::NoBreakWithNextBit
@ NoBreakWithNextBit
Definition: MWAWParagraph.hxx:88
MWAWGraphicStyle::Gradient::m_percentCenter
MWAWVec2f m_percentCenter
the gradient center
Definition: MWAWGraphicStyle.hxx:270
Canvas5StyleManager::Canvas5StyleManager
Canvas5StyleManager(Canvas5Parser &parser)
constructor
Definition: Canvas5StyleManager.cxx:219
Canvas5StyleManagerInternal::PenStyle::m_colors
MWAWVariable< MWAWColor > m_colors[2]
the neo color
Definition: Canvas5StyleManager.cxx:147
MWAWGraphicStyle::m_gradient
Gradient m_gradient
the gradient
Definition: MWAWGraphicStyle.hxx:610
Canvas5StyleManagerInternal::Stroke::m_arrowId
int m_arrowId[2]
the arrow id (beg/end)
Definition: Canvas5StyleManager.cxx:186
MWAWGraphicStyle::Gradient::G_Ellipsoid
@ G_Ellipsoid
Definition: MWAWGraphicStyle.hxx:177
Canvas5Parser::Item::m_length
long m_length
the data length (from current position)
Definition: Canvas5Parser.hxx:199
Canvas5Parser::readUsed
bool readUsed(Canvas5Structure::Stream &stream, std::string const &what)
try to read the used list
Definition: Canvas5Parser.cxx:3300
Canvas5StyleManagerInternal::ColorStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, ColorStyle const &color)
Definition: Canvas5StyleManager.cxx:78
Canvas5StyleManagerInternal::PenStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, PenStyle const &pen)
Definition: Canvas5StyleManager.cxx:134
Canvas5Structure::Stream
a sub stream of Canvas5Structure
Definition: Canvas5Structure.hxx:49
MWAWParagraph::JustificationFull
@ JustificationFull
Definition: MWAWParagraph.hxx:90
Canvas5StyleManager::updateLineColor
bool updateLineColor(Canvas5StyleManagerInternal::ColorStyle const &color, MWAWGraphicStyle &style)
try to update the line color given a color style
Definition: Canvas5StyleManager.cxx:2316
Canvas5StyleManager::readSymbol
std::shared_ptr< Canvas5ImageInternal::VKFLImage > readSymbol(std::shared_ptr< Canvas5Structure::Stream > stream, long len, MWAWVariable< MWAWColor > &backColor)
try to read a symbol zone: vkfl/TXUR
Definition: Canvas5StyleManager.cxx:942
MWAWParagraph::JustificationRight
@ JustificationRight
Definition: MWAWParagraph.hxx:91
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:557
Canvas5StyleManager::version
int version() const
returns the file version
Definition: Canvas5StyleManager.cxx:229
MWAWGraphicStyle::Gradient::hasGradient
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: MWAWGraphicStyle.hxx:191
MWAWGraphicStyle::m_hatch
Hatch m_hatch
the hatch
Definition: MWAWGraphicStyle.hxx:612
libmwaw::DebugFile::addPos
void addPos(long pos)
adds a new position in the file
Definition: MWAWDebug.cxx:53
MWAWGraphicStyle::m_lineDashWidth
std::vector< float > m_lineDashWidth
the dash array: a sequence of (fullsize, emptysize)
Definition: MWAWGraphicStyle.hxx:583
Canvas5StyleManagerInternal::State::State
State()
constructor
Definition: Canvas5StyleManager.cxx:193
Canvas5StyleManager::readPenStyles
bool readPenStyles(std::shared_ptr< Canvas5Structure::Stream > stream)
read the pen styles
Definition: Canvas5StyleManager.cxx:1253
MWAWGraphicStyle::Hatch::m_type
Type m_type
the hatch type
Definition: MWAWGraphicStyle.hxx:336
libmwaw::DebugFile
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:66
Canvas5StyleManager::readHatch
bool readHatch(std::shared_ptr< Canvas5Structure::Stream > stream, long len, MWAWGraphicStyle::Hatch &hatch, MWAWVariable< MWAWColor > &backColor)
try to read a hatch zone: htch
Definition: Canvas5StyleManager.cxx:463
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:106
Canvas5StyleManager::readParaStyle
bool readParaStyle(std::shared_ptr< Canvas5Structure::Stream > stream, int id, StyleList *styles=nullptr)
try to read a paragraph style
Definition: Canvas5StyleManager.cxx:1857
MWAWInputStream.hxx
Canvas5Image.hxx
Canvas5StyleManagerInternal::ColorStyle
Internal: the color style of a Canvas5StyleManager.
Definition: Canvas5StyleManager.cxx:66
Canvas5Parser::m_imageParser
std::shared_ptr< Canvas5Image > m_imageParser
the image parser
Definition: Canvas5Parser.hxx:254
MWAWFont.hxx
Canvas5StyleManager::updateLineStyle
bool updateLineStyle(int sId, MWAWGraphicStyle &style, int &numLines, int lineId=-1, float *offset=nullptr)
try to update the line style given the stroke id and returns the number of lines(plin)
Definition: Canvas5StyleManager.cxx:2461
Canvas5StyleManager::CharStyle::m_font
MWAWFont m_font
the font
Definition: Canvas5StyleManager.hxx:101
MWAWGraphicStyle::Gradient::m_angle
float m_angle
the gradient angle
Definition: MWAWGraphicStyle.hxx:266
MWAWBox2< float >
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
Canvas5StyleManager::~Canvas5StyleManager
virtual ~Canvas5StyleManager()
destructor
Definition: Canvas5StyleManager.cxx:226
Canvas5StyleManager::CharStyle::m_linkId
int m_linkId
the link id
Definition: Canvas5StyleManager.hxx:105
Canvas5StyleManager::readInks9
bool readInks9(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the ink color zones: v9
Definition: Canvas5StyleManager.cxx:769
MWAWGraphicStyle::Gradient::G_Radial
@ G_Radial
Definition: MWAWGraphicStyle.hxx:177
Canvas5StyleManager::readPenStyle
std::shared_ptr< Canvas5StyleManagerInternal::PenStyle > readPenStyle(Canvas5Structure::Stream &stream, unsigned type, long len)
try to read a pen style
Definition: Canvas5StyleManager.cxx:1302
Canvas5StyleManager
the main class to read the style part of Canvas 5 file
Definition: Canvas5StyleManager.hxx:86
Canvas5StyleManager::readCharStyles
bool readCharStyles(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the character styles
Definition: Canvas5StyleManager.cxx:1757
MWAWGraphicStyle::Gradient::Type
Type
an enum used to define the gradient type
Definition: MWAWGraphicStyle.hxx:177
Canvas5StyleManager::CharStyle
a structure use to store a character style
Definition: Canvas5StyleManager.hxx:92
libmwaw::DebugStream
std::stringstream DebugStream
a basic stream (if debug_with_files is not defined, does nothing)
Definition: MWAWDebug.hxx:61
MWAWParser.hxx
MWAWFont::setUnderlineStyle
void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
sets the underline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:466
Canvas5StyleManager::readPenSize
bool readPenSize(std::shared_ptr< Canvas5Structure::Stream > stream)
read the pen size (header file)
Definition: Canvas5StyleManager.cxx:1229
MWAWGraphicStyle::Gradient::m_stopList
std::vector< Stop > m_stopList
the list of gradient limits
Definition: MWAWGraphicStyle.hxx:264
MWAWColor::colorFromCMYK
static MWAWColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
return a color from a cmyk color ( basic)
Definition: libmwaw_internal.hxx:218
Canvas5StyleManager::readFormats
bool readFormats(std::shared_ptr< Canvas5Structure::Stream > stream)
read the list of formats, mainly an unit's conversion table
Definition: Canvas5StyleManager.cxx:1162
MWAWParagraph::NoBreakBit
@ NoBreakBit
Definition: MWAWParagraph.hxx:88
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:325
Canvas5Parser::readDouble
bool readDouble(Canvas5Structure::Stream &stream, double &val, bool &isNaN) const
try to read a double 8
Definition: Canvas5Parser.cxx:2959
MWAWFont::lowercaseBit
@ lowercaseBit
Definition: MWAWFont.hxx:193
MWAWGraphicStyle::Arrow
a structure used to define an arrow
Definition: MWAWGraphicStyle.hxx:56
MWAWVariable::setSet
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:640
Canvas5StyleManager::readInks
bool readInks(std::shared_ptr< Canvas5Structure::Stream > stream)
try to read the ink color zones
Definition: Canvas5StyleManager.cxx:660
Canvas5StyleManagerInternal::Stroke::m_type
unsigned m_type
the type
Definition: Canvas5StyleManager.cxx:180

Generated on Mon Jul 26 2021 00:00:00 for libmwaw by doxygen 1.8.20