libmwaw_internal.hxx Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

libmwaw_internal.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 #ifndef LIBMWAW_INTERNAL_H
35 #define LIBMWAW_INTERNAL_H
36 #include <assert.h>
37 #ifdef DEBUG
38 #include <stdio.h>
39 #endif
40
41 #include <cmath>
42 #include <map>
43 #include <ostream>
44 #include <string>
45 #include <math.h>
46 #include <vector>
47
48 #ifndef M_PI
49 #define M_PI 3.14159265358979323846
50 #endif
51
52 #include <librevenge-stream/librevenge-stream.h>
53 #include <librevenge/librevenge.h>
54
55 #if defined(_MSC_VER) || defined(__DJGPP__)
56
57 typedef signed char int8_t;
58 typedef unsigned char uint8_t;
59 typedef signed short int16_t;
60 typedef unsigned short uint16_t;
61 typedef signed int int32_t;
62 typedef unsigned int uint32_t;
63 typedef unsigned __int64 uint64_t;
64 typedef __int64 int64_t;
65
66 #else /* !_MSC_VER && !__DJGPP__*/
67
68 # ifdef HAVE_CONFIG_H
69
70 # include <config.h>
71 # ifdef HAVE_STDINT_H
72 # include <stdint.h>
73 # endif
74 # ifdef HAVE_INTTYPES_H
75 # include <inttypes.h>
76 # endif
77
78 # else
79
80 // assume that the headers are there inside LibreOffice build when no HAVE_CONFIG_H is defined
81 # include <stdint.h>
82 # include <inttypes.h>
83
84 # endif
85
86 #endif /* _MSC_VER || __DJGPP__ */
87
88 // define gmtime_r and localtime_r on Windows, so that can use
89 // thread-safe functions on other environments
90 #ifdef _WIN32
91 # define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
92 # define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
93 #endif
94
95 /* ---------- memory --------------- */
96 #if defined(SHAREDPTR_TR1)
97 #include <tr1/memory>
98 using std::tr1::shared_ptr;
99 #elif defined(SHAREDPTR_STD)
100 #include <memory>
101 using std::shared_ptr;
102 #else
103 #include <boost/shared_ptr.hpp>
104 using boost::shared_ptr;
105 #endif
106
108 template <class T>
109 struct MWAW_shared_ptr_noop_deleter {
110 void operator()(T *) {}
111 };
112
113 #if defined(__clang__) || defined(__GNUC__)
114 # define LIBMWAW_ATTRIBUTE_PRINTF(fmt, arg) __attribute__((__format__(__printf__, fmt, arg)))
115 #else
116 # define LIBMWAW_ATTRIBUTE_PRINTF(fmt, arg)
117 #endif
118
119 /* ---------- debug --------------- */
120 #ifdef DEBUG
121 namespace libmwaw
122 {
123 void printDebugMsg(const char *format, ...) LIBMWAW_ATTRIBUTE_PRINTF(1,2);
124 }
125 #define MWAW_DEBUG_MSG(M) libmwaw::printDebugMsg M
126 #else
127 #define MWAW_DEBUG_MSG(M)
128 #endif
129
130 namespace libmwaw
131 {
132 // Various exceptions:
133 class VersionException
134 {
135 };
136
137 class FileException
138 {
139 };
140
141 class ParseException
142 {
143 };
144
145 class GenericException
146 {
147 };
148
149 class WrongPasswordException
150 {
151 };
152 }
153
154 /* ---------- input ----------------- */
155 namespace libmwaw
156 {
157 uint8_t readU8(librevenge::RVNGInputStream *input);
159 void appendUnicode(uint32_t val, librevenge::RVNGString &buffer);
160 }
161
162 /* ---------- small enum/class ------------- */
163 namespace libmwaw
164 {
166 enum Position { Left = 0, Right = 1, Top = 2, Bottom = 3, HMiddle = 4, VMiddle = 5 };
168 enum { LeftBit = 0x01, RightBit = 0x02, TopBit=0x4, BottomBit = 0x08, HMiddleBit = 0x10, VMiddleBit = 0x20 };
169
170 enum NumberingType { NONE, BULLET, ARABIC, LOWERCASE, UPPERCASE, LOWERCASE_ROMAN, UPPERCASE_ROMAN };
171 std::string numberingTypeToString(NumberingType type);
172 std::string numberingValueToString(NumberingType type, int value);
173 enum SubDocumentType { DOC_NONE, DOC_CHART, DOC_CHART_ZONE, DOC_COMMENT_ANNOTATION, DOC_GRAPHIC_GROUP, DOC_HEADER_FOOTER, DOC_NOTE, DOC_SHEET, DOC_TABLE, DOC_TEXT_BOX };
174 }
175
177 struct MWAWColor {
179 MWAWColor(uint32_t argb=0) : m_value(argb)
180 {
181 }
183 MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) :
184 m_value(uint32_t((a<<24)+(r<<16)+(g<<8)+b))
185 {
186 }
188 MWAWColor &operator=(uint32_t argb)
189 {
190 m_value = argb;
191 return *this;
192 }
194 static MWAWColor colorFromCMYK(unsigned char c, unsigned char m, unsigned char y, unsigned char k)
195 {
196 double w=1.-double(k)/255.;
197 return MWAWColor
198 ((unsigned char)(255 * (1-double(c)/255) * w),
199 (unsigned char)(255 * (1-double(m)/255) * w),
200 (unsigned char)(255 * (1-double(y)/255) * w)
201 );
202 }
204 static MWAWColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
205 {
206 double c=(1-((L>=128) ? (2*double(L)-255) : (255-2*double(L)))/255)*
207 double(S)/255;
208 double tmp=std::fmod((double(H)*6/255),2)-1;
209 double x=c*(1-(tmp>0 ? tmp : -tmp));
210 unsigned char C=(unsigned char)(255*c);
211 unsigned char M=(unsigned char)(double(L)-255*c/2);
212 unsigned char X=(unsigned char)(255*x);
213 if (H<=42) return MWAWColor((unsigned char)(M+C),(unsigned char)(M+X),(unsigned char)M);
214 if (H<=85) return MWAWColor((unsigned char)(M+X),(unsigned char)(M+C),(unsigned char)M);
215 if (H<=127) return MWAWColor((unsigned char)M,(unsigned char)(M+C),(unsigned char)(M+X));
216 if (H<=170) return MWAWColor((unsigned char)M,(unsigned char)(M+X),(unsigned char)(M+C));
217 if (H<=212) return MWAWColor((unsigned char)(M+X),(unsigned char)M,(unsigned char)(M+C));
218 return MWAWColor((unsigned char)(M+C),(unsigned char)(M),(unsigned char)(M+X));
219 }
221 static MWAWColor black()
222 {
223 return MWAWColor(0,0,0);
224 }
226 static MWAWColor white()
227 {
228 return MWAWColor(255,255,255);
229 }
230
232 static MWAWColor barycenter(float alpha, MWAWColor const &colA,
233 float beta, MWAWColor const &colB);
235 uint32_t value() const
236 {
237 return m_value;
238 }
240 unsigned char getAlpha() const
241 {
242 return (unsigned char)((m_value>>24)&0xFF);
243 }
245 unsigned char getBlue() const
246 {
247 return (unsigned char)(m_value&0xFF);
248 }
250 unsigned char getRed() const
251 {
252 return (unsigned char)((m_value>>16)&0xFF);
253 }
255 unsigned char getGreen() const
256 {
257 return (unsigned char)((m_value>>8)&0xFF);
258 }
260 bool isBlack() const
261 {
262 return (m_value&0xFFFFFF)==0;
263 }
265 bool isWhite() const
266 {
267 return (m_value&0xFFFFFF)==0xFFFFFF;
268 }
270 bool operator==(MWAWColor const &c) const
271 {
272 return (c.m_value&0xFFFFFF)==(m_value&0xFFFFFF);
273 }
275 bool operator!=(MWAWColor const &c) const
276 {
277 return !operator==(c);
278 }
280 bool operator<(MWAWColor const &c) const
281 {
282 return (c.m_value&0xFFFFFF)<(m_value&0xFFFFFF);
283 }
285 bool operator<=(MWAWColor const &c) const
286 {
287 return (c.m_value&0xFFFFFF)<=(m_value&0xFFFFFF);
288 }
290 bool operator>(MWAWColor const &c) const
291 {
292 return !operator<=(c);
293 }
295 bool operator>=(MWAWColor const &c) const
296 {
297 return !operator<(c);
298 }
300 friend std::ostream &operator<< (std::ostream &o, MWAWColor const &c);
302 std::string str() const;
303 protected:
305 uint32_t m_value;
306 };
307
309 struct MWAWBorder {
311 enum Style { None, Simple, Dot, LargeDot, Dash };
313 enum Type { Single, Double, Triple };
314
316 MWAWBorder() : m_style(Simple), m_type(Single), m_width(1), m_widthsList(), m_color(MWAWColor::black()), m_extra("") { }
320 bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const;
322 bool isEmpty() const
323 {
324 return m_style==None || m_width <= 0;
325 }
327 bool operator==(MWAWBorder const &orig) const
328 {
329 return !operator!=(orig);
330 }
332 bool operator!=(MWAWBorder const &orig) const
333 {
334 return m_style != orig.m_style || m_type != orig.m_type ||
335 m_width < orig.m_width || m_width > orig.m_width || m_color != orig.m_color;
336 }
338 int compare(MWAWBorder const &orig) const;
339
341 friend std::ostream &operator<< (std::ostream &o, MWAWBorder const &border);
343 friend std::ostream &operator<< (std::ostream &o, MWAWBorder::Style const &style);
345 Style m_style;
347 Type m_type;
349 double m_width;
353 std::vector<double> m_widthsList;
355 MWAWColor m_color;
357 std::string m_extra;
358 };
359
361 struct MWAWField {
363 enum Type { None, PageCount, PageNumber, Date, Time, Title, Database };
364
366 MWAWField(Type type) : m_type(type), m_DTFormat(""), m_numberingType(libmwaw::ARABIC), m_data("")
367 {
368 }
370 Type m_type;
372 std::string m_DTFormat;
374 libmwaw::NumberingType m_numberingType;
376 std::string m_data;
377 };
378
380 struct MWAWLink {
382 MWAWLink() : m_HRef("")
383 {
384 }
385
387 bool addTo(librevenge::RVNGPropertyList &propList) const;
388
390 std::string m_HRef;
391 };
392
394 struct MWAWNote {
396 enum Type { FootNote, EndNote };
398 MWAWNote(Type type) : m_type(type), m_label(""), m_number(-1)
399 {
400 }
402 Type m_type;
404 librevenge::RVNGString m_label;
406 int m_number;
407 };
408
409 // forward declarations of basic classes and smart pointers
410 class MWAWEntry;
411 class MWAWFont;
412 class MWAWGraphicEncoder;
413 class MWAWGraphicShape;
414 class MWAWGraphicStyle;
415 class MWAWHeader;
416 class MWAWList;
417 class MWAWPageSpan;
418 class MWAWParagraph;
419 class MWAWParser;
420 class MWAWPosition;
421 class MWAWSection;
422
423 class MWAWFontConverter;
424 class MWAWGraphicListener;
425 class MWAWInputStream;
426 class MWAWListener;
427 class MWAWListManager;
428 class MWAWParserState;
429 class MWAWPresentationListener;
430 class MWAWRSRCParser;
431 class MWAWSpreadsheetListener;
432 class MWAWSubDocument;
433 class MWAWTextListener;
435 typedef shared_ptr<MWAWFontConverter> MWAWFontConverterPtr;
437 typedef shared_ptr<MWAWGraphicListener> MWAWGraphicListenerPtr;
439 typedef shared_ptr<MWAWInputStream> MWAWInputStreamPtr;
441 typedef shared_ptr<MWAWListener> MWAWListenerPtr;
443 typedef shared_ptr<MWAWListManager> MWAWListManagerPtr;
445 typedef shared_ptr<MWAWParserState> MWAWParserStatePtr;
447 typedef shared_ptr<MWAWPresentationListener> MWAWPresentationListenerPtr;
449 typedef shared_ptr<MWAWRSRCParser> MWAWRSRCParserPtr;
451 typedef shared_ptr<MWAWSpreadsheetListener> MWAWSpreadsheetListenerPtr;
453 typedef shared_ptr<MWAWSubDocument> MWAWSubDocumentPtr;
455 typedef shared_ptr<MWAWTextListener> MWAWTextListenerPtr;
456
463 template <class T> struct MWAWVariable {
465 MWAWVariable() : m_data(), m_set(false) {}
467 MWAWVariable(T const &def) : m_data(def), m_set(false) {}
469 MWAWVariable(MWAWVariable const &orig) : m_data(orig.m_data), m_set(orig.m_set) {}
471 MWAWVariable &operator=(MWAWVariable const &orig)
472 {
473 if (this != &orig) {
474 m_data = orig.m_data;
475 m_set = orig.m_set;
476 }
477 return *this;
478 }
480 MWAWVariable &operator=(T const &val)
481 {
482 m_data = val;
483 m_set = true;
484 return *this;
485 }
487 void insert(MWAWVariable const &orig)
488 {
489 if (orig.m_set) {
490 m_data = orig.m_data;
491 m_set = orig.m_set;
492 }
493 }
495 T const *operator->() const
496 {
497 return &m_data;
498 }
500 T *operator->()
501 {
502 m_set = true;
503 return &m_data;
504 }
506 T const &operator*() const
507 {
508 return m_data;
509 }
511 T &operator*()
512 {
513 m_set = true;
514 return m_data;
515 }
517 T const &get() const
518 {
519 return m_data;
520 }
522 bool isSet() const
523 {
524 return m_set;
525 }
527 void setSet(bool newVal)
528 {
529 m_set=newVal;
530 }
531 protected:
533 T m_data;
535 bool m_set;
536 };
537
538 /* ---------- vec2/box2f ------------- */
542 template <class T> class MWAWVec2
543 {
544 public:
546 MWAWVec2(T xx=0,T yy=0) : m_x(xx), m_y(yy) { }
548 template <class U> MWAWVec2(MWAWVec2<U> const &p) : m_x(T(p.x())), m_y(T(p.y())) {}
549
551 T x() const
552 {
553 return m_x;
554 }
556 T y() const
557 {
558 return m_y;
559 }
561 T operator[](int c) const
562 {
563 if (c<0 || c>1) throw libmwaw::GenericException();
564 return (c==0) ? m_x : m_y;
565 }
567 T &operator[](int c)
568 {
569 if (c<0 || c>1) throw libmwaw::GenericException();
570 return (c==0) ? m_x : m_y;
571 }
572
574 void set(T xx, T yy)
575 {
576 m_x = xx;
577 m_y = yy;
578 }
580 void setX(T xx)
581 {
582 m_x = xx;
583 }
585 void setY(T yy)
586 {
587 m_y = yy;
588 }
589
591 void add(T dx, T dy)
592 {
593 m_x += dx;
594 m_y += dy;
595 }
596
598 MWAWVec2<T> &operator+=(MWAWVec2<T> const &p)
599 {
600 m_x += p.m_x;
601 m_y += p.m_y;
602 return *this;
603 }
605 MWAWVec2<T> &operator-=(MWAWVec2<T> const &p)
606 {
607 m_x -= p.m_x;
608 m_y -= p.m_y;
609 return *this;
610 }
612 template <class U>
613 MWAWVec2<T> &operator*=(U scale)
614 {
615 m_x = T(m_x*scale);
616 m_y = T(m_y*scale);
617 return *this;
618 }
619
621 friend MWAWVec2<T> operator+(MWAWVec2<T> const &p1, MWAWVec2<T> const &p2)
622 {
623 MWAWVec2<T> p(p1);
624 return p+=p2;
625 }
627 friend MWAWVec2<T> operator-(MWAWVec2<T> const &p1, MWAWVec2<T> const &p2)
628 {
629 MWAWVec2<T> p(p1);
630 return p-=p2;
631 }
633 template <class U>
634 friend MWAWVec2<T> operator*(U scale, MWAWVec2<T> const &p1)
635 {
636 MWAWVec2<T> p(p1);
637 return p *= scale;
638 }
639
641 bool operator==(MWAWVec2<T> const &p) const
642 {
643 return cmpY(p) == 0;
644 }
646 bool operator!=(MWAWVec2<T> const &p) const
647 {
648 return cmpY(p) != 0;
649 }
651 bool operator<(MWAWVec2<T> const &p) const
652 {
653 return cmpY(p) < 0;
654 }
656 int cmp(MWAWVec2<T> const &p) const
657 {
658 if (m_x < p.m_x) return -1;
659 if (m_x > p.m_x) return 1;
660 if (m_y < p.m_y) return -1;
661 if (m_y > p.m_y) return 1;
662 return 0;
663 }
665 int cmpY(MWAWVec2<T> const &p) const
666 {
667 if (m_y < p.m_y) return -1;
668 if (m_y > p.m_y) return 1;
669 if (m_x < p.m_x) return -1;
670 if (m_x > p.m_x) return 1;
671 return 0;
672 }
673
675 friend std::ostream &operator<< (std::ostream &o, MWAWVec2<T> const &f)
676 {
677 o << f.m_x << "x" << f.m_y;
678 return o;
679 }
680
684 struct PosSizeLtX {
686 bool operator()(MWAWVec2<T> const &s1, MWAWVec2<T> const &s2) const
687 {
688 return s1.cmp(s2) < 0;
689 }
690 };
694 typedef std::map<MWAWVec2<T>, T,struct PosSizeLtX> MapX;
695
699 struct PosSizeLtY {
701 bool operator()(MWAWVec2<T> const &s1, MWAWVec2<T> const &s2) const
702 {
703 return s1.cmpY(s2) < 0;
704 }
705 };
709 typedef std::map<MWAWVec2<T>, T,struct PosSizeLtY> MapY;
710 protected:
711 T m_x, m_y;
712 };
713
715 typedef MWAWVec2<bool> MWAWVec2b;
717 typedef MWAWVec2<int> MWAWVec2i;
719 typedef MWAWVec2<long> MWAWVec2l;
721 typedef MWAWVec2<float> MWAWVec2f;
722
726 template <class T> class MWAWVec3
727 {
728 public:
730 MWAWVec3(T xx=0,T yy=0,T zz=0)
731 {
732 m_val[0] = xx;
733 m_val[1] = yy;
734 m_val[2] = zz;
735 }
737 template <class U> MWAWVec3(MWAWVec3<U> const &p)
738 {
739 for (int c = 0; c < 3; c++) m_val[c] = T(p[c]);
740 }
741
743 T x() const
744 {
745 return m_val[0];
746 }
748 T y() const
749 {
750 return m_val[1];
751 }
753 T z() const
754 {
755 return m_val[2];
756 }
758 T operator[](int c) const
759 {
760 if (c<0 || c>2) throw libmwaw::GenericException();
761 return m_val[c];
762 }
764 T &operator[](int c)
765 {
766 if (c<0 || c>2) throw libmwaw::GenericException();
767 return m_val[c];
768 }
769
771 void set(T xx, T yy, T zz)
772 {
773 m_val[0] = xx;
774 m_val[1] = yy;
775 m_val[2] = zz;
776 }
778 void setX(T xx)
779 {
780 m_val[0] = xx;
781 }
783 void setY(T yy)
784 {
785 m_val[1] = yy;
786 }
788 void setZ(T zz)
789 {
790 m_val[2] = zz;
791 }
792
794 void add(T dx, T dy, T dz)
795 {
796 m_val[0] += dx;
797 m_val[1] += dy;
798 m_val[2] += dz;
799 }
800
802 MWAWVec3<T> &operator+=(MWAWVec3<T> const &p)
803 {
804 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]+p.m_val[c]);
805 return *this;
806 }
808 MWAWVec3<T> &operator-=(MWAWVec3<T> const &p)
809 {
810 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]-p.m_val[c]);
811 return *this;
812 }
814 template <class U>
815 MWAWVec3<T> &operator*=(U scale)
816 {
817 for (int c = 0; c < 3; c++) m_val[c] = T(m_val[c]*scale);
818 return *this;
819 }
820
822 friend MWAWVec3<T> operator+(MWAWVec3<T> const &p1, MWAWVec3<T> const &p2)
823 {
824 MWAWVec3<T> p(p1);
825 return p+=p2;
826 }
828 friend MWAWVec3<T> operator-(MWAWVec3<T> const &p1, MWAWVec3<T> const &p2)
829 {
830 MWAWVec3<T> p(p1);
831 return p-=p2;
832 }
834 template <class U>
835 friend MWAWVec3<T> operator*(U scale, MWAWVec3<T> const &p1)
836 {
837 MWAWVec3<T> p(p1);
838 return p *= scale;
839 }
840
842 bool operator==(MWAWVec3<T> const &p) const
843 {
844 return cmp(p) == 0;
845 }
847 bool operator!=(MWAWVec3<T> const &p) const
848 {
849 return cmp(p) != 0;
850 }
852 bool operator<(MWAWVec3<T> const &p) const
853 {
854 return cmp(p) < 0;
855 }
857 int cmp(MWAWVec3<T> const &p) const
858 {
859 for (int c = 0; c < 3; c++) {
860 T diff = m_val[c]-p.m_val[c];
861 if (diff) return (diff < 0) ? -1 : 1;
862 }
863 return 0;
864 }
865
867 friend std::ostream &operator<< (std::ostream &o, MWAWVec3<T> const &f)
868 {
869 o << f.m_val[0] << "x" << f.m_val[1] << "x" << f.m_val[2];
870 return o;
871 }
872
876 struct PosSizeLt {
878 bool operator()(MWAWVec3<T> const &s1, MWAWVec3<T> const &s2) const
879 {
880 return s1.cmp(s2) < 0;
881 }
882 };
886 typedef std::map<MWAWVec3<T>, T,struct PosSizeLt> Map;
887
888 protected:
890 T m_val[3];
891 };
892
894 typedef MWAWVec3<unsigned char> MWAWVec3uc;
896 typedef MWAWVec3<int> MWAWVec3i;
898 typedef MWAWVec3<float> MWAWVec3f;
899
903 template <class T> class MWAWBox2
904 {
905 public:
907 MWAWBox2(MWAWVec2<T> minPt=MWAWVec2<T>(), MWAWVec2<T> maxPt=MWAWVec2<T>())
908 {
909 m_pt[0] = minPt;
910 m_pt[1] = maxPt;
911 }
913 template <class U> MWAWBox2(MWAWBox2<U> const &p)
914 {
915 for (int c=0; c < 2; c++) m_pt[c] = p[c];
916 }
917
919 MWAWVec2<T> const &min() const
920 {
921 return m_pt[0];
922 }
924 MWAWVec2<T> const &max() const
925 {
926 return m_pt[1];
927 }
929 MWAWVec2<T> &min()
930 {
931 return m_pt[0];
932 }
934 MWAWVec2<T> &max()
935 {
936 return m_pt[1];
937 }
941 MWAWVec2<T> const &operator[](int c) const
942 {
943 if (c<0 || c>1) throw libmwaw::GenericException();
944 return m_pt[c];
945 }
947 MWAWVec2<T> size() const
948 {
949 return m_pt[1]-m_pt[0];
950 }
952 MWAWVec2<T> center() const
953 {
954 return 0.5*(m_pt[0]+m_pt[1]);
955 }
956
958 void set(MWAWVec2<T> const &x, MWAWVec2<T> const &y)
959 {
960 m_pt[0] = x;
961 m_pt[1] = y;
962 }
964 void setMin(MWAWVec2<T> const &x)
965 {
966 m_pt[0] = x;
967 }
969 void setMax(MWAWVec2<T> const &y)
970 {
971 m_pt[1] = y;
972 }
973
975 void resizeFromMin(MWAWVec2<T> const &sz)
976 {
977 m_pt[1] = m_pt[0]+sz;
978 }
980 void resizeFromMax(MWAWVec2<T> const &sz)
981 {
982 m_pt[0] = m_pt[1]-sz;
983 }
985 void resizeFromCenter(MWAWVec2<T> const &sz)
986 {
987 MWAWVec2<T> centerPt = 0.5*(m_pt[0]+m_pt[1]);
988 m_pt[0] = centerPt - 0.5*sz;
989 m_pt[1] = centerPt + (sz - 0.5*sz);
990 }
991
993 template <class U> void scale(U factor)
994 {
995 m_pt[0] *= factor;
996 m_pt[1] *= factor;
997 }
998
1000 void extend(T val)
1001 {
1002 m_pt[0] -= MWAWVec2<T>(val/2,val/2);
1003 m_pt[1] += MWAWVec2<T>(val-(val/2),val-(val/2));
1004 }
1005
1007 MWAWBox2<T> getUnion(MWAWBox2<T> const &box) const
1008 {
1009 MWAWBox2<T> res;
1010 res.m_pt[0]=MWAWVec2<T>(m_pt[0][0]<box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1011 m_pt[0][1]<box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1012 res.m_pt[1]=MWAWVec2<T>(m_pt[1][0]>box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1013 m_pt[1][1]>box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1014 return res;
1015 }
1017 MWAWBox2<T> getIntersection(MWAWBox2<T> const &box) const
1018 {
1019 MWAWBox2<T> res;
1020 res.m_pt[0]=MWAWVec2<T>(m_pt[0][0]>box.m_pt[0][0]?m_pt[0][0] : box.m_pt[0][0],
1021 m_pt[0][1]>box.m_pt[0][1]?m_pt[0][1] : box.m_pt[0][1]);
1022 res.m_pt[1]=MWAWVec2<T>(m_pt[1][0]<box.m_pt[1][0]?m_pt[1][0] : box.m_pt[1][0],
1023 m_pt[1][1]<box.m_pt[1][1]?m_pt[1][1] : box.m_pt[1][1]);
1024 return res;
1025 }
1027 bool operator==(MWAWBox2<T> const &p) const
1028 {
1029 return cmp(p) == 0;
1030 }
1032 bool operator!=(MWAWBox2<T> const &p) const
1033 {
1034 return cmp(p) != 0;
1035 }
1037 bool operator<(MWAWBox2<T> const &p) const
1038 {
1039 return cmp(p) < 0;
1040 }
1041
1043 int cmp(MWAWBox2<T> const &p) const
1044 {
1045 int diff = m_pt[0].cmpY(p.m_pt[0]);
1046 if (diff) return diff;
1047 diff = m_pt[1].cmpY(p.m_pt[1]);
1048 if (diff) return diff;
1049 return 0;
1050 }
1051
1053 friend std::ostream &operator<< (std::ostream &o, MWAWBox2<T> const &f)
1054 {
1055 o << "(" << f.m_pt[0] << "<->" << f.m_pt[1] << ")";
1056 return o;
1057 }
1058
1062 struct PosSizeLt {
1064 bool operator()(MWAWBox2<T> const &s1, MWAWBox2<T> const &s2) const
1065 {
1066 return s1.cmp(s2) < 0;
1067 }
1068 };
1072 typedef std::map<MWAWBox2<T>, T,struct PosSizeLt> Map;
1073
1074 protected:
1076 MWAWVec2<T> m_pt[2];
1077 };
1078
1080 typedef MWAWBox2<int> MWAWBox2i;
1082 typedef MWAWBox2<float> MWAWBox2f;
1084 typedef MWAWBox2<long> MWAWBox2l;
1085
1086 // some geometrical function
1087 namespace libmwaw
1088 {
1090 MWAWBox2f rotateBoxFromCenter(MWAWBox2f const &box, float angle);
1091 }
1092 #endif /* LIBMWAW_INTERNAL_H */
1093 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWListenerPtr
shared_ptr< MWAWListener > MWAWListenerPtr
a smart pointer of MWAWListener
Definition: libmwaw_internal.hxx:441
MWAWVec2::setY
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:585
MWAWBorder::Double
Definition: libmwaw_internal.hxx:313
MWAWNote::m_number
int m_number
the note number if defined
Definition: libmwaw_internal.hxx:406
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
MWAWVec3::operator*=
MWAWVec3< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:815
libmwaw::NumberingType
NumberingType
Definition: libmwaw_internal.hxx:170
MWAWVec3::operator!=
bool operator!=(MWAWVec3< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:847
MWAWVariable::operator*
T const & operator*() const
operator*
Definition: libmwaw_internal.hxx:506
MWAWVec2::operator-=
MWAWVec2< T > & operator-=(MWAWVec2< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:605
libmwaw::appendUnicode
void appendUnicode(uint32_t val, librevenge::RVNGString &buffer)
adds an unicode character to a string
Definition: libmwaw_internal.cxx:62
libmwaw::DOC_NONE
Definition: libmwaw_internal.hxx:173
MWAWVec3::PosSizeLt::operator()
bool operator()(MWAWVec3< T > const &s1, MWAWVec3< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:878
MWAWColor::operator=
MWAWColor & operator=(uint32_t argb)
operator=
Definition: libmwaw_internal.hxx:188
libmwaw::LOWERCASE_ROMAN
Definition: libmwaw_internal.hxx:170
MWAWBorder::Dot
Definition: libmwaw_internal.hxx:311
MWAWColor::str
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:207
libmwaw::UPPERCASE_ROMAN
Definition: libmwaw_internal.hxx:170
MWAWVec3i
MWAWVec3< int > MWAWVec3i
MWAWVec3 of int.
Definition: libmwaw_internal.hxx:896
MWAWVec2< bool >::MapX
std::map< MWAWVec2< bool >, bool, struct PosSizeLtX > MapX
Definition: libmwaw_internal.hxx:694
libmwaw::DOC_GRAPHIC_GROUP
Definition: libmwaw_internal.hxx:173
libmwaw::NONE
Definition: libmwaw_internal.hxx:170
MWAWField::m_data
std::string m_data
the database/link field ( if defined )
Definition: libmwaw_internal.hxx:376
MWAWField::Database
Definition: libmwaw_internal.hxx:363
MWAWPresentationListener
This class contains code needed to write a presention document.
Definition: MWAWPresentationListener.hxx:59
MWAWBorder::m_type
Type m_type
the border repetition
Definition: libmwaw_internal.hxx:347
MWAWBorder::operator==
bool operator==(MWAWBorder const &orig) const
operator==
Definition: libmwaw_internal.hxx:327
libmwaw::TopBit
Definition: libmwaw_internal.hxx:168
MWAWVec2::operator==
bool operator==(MWAWVec2< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:641
MWAWVec2::cmp
int cmp(MWAWVec2< T > const &p) const
a comparison function: which first compares x then y
Definition: libmwaw_internal.hxx:656
MWAWPageSpan
A class which defines the page properties.
Definition: MWAWPageSpan.hxx:95
libmwaw::rotateBoxFromCenter
MWAWBox2f rotateBoxFromCenter(MWAWBox2f const &box, float angle)
rotate a bdox and returns the final bdbox
Definition: libmwaw_internal.cxx:364
MWAWVariable::operator*
T & operator*()
operator*
Definition: libmwaw_internal.hxx:511
libmwaw::DOC_TEXT_BOX
Definition: libmwaw_internal.hxx:173
MWAWTextListener
This class contents the main functions needed to create a Word processing Document.
Definition: MWAWTextListener.hxx:64
MWAWBox2::operator[]
MWAWVec2< T > const & operator[](int c) const
the two extremum points which defined the box
Definition: libmwaw_internal.hxx:941
MWAWField::Title
Definition: libmwaw_internal.hxx:363
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:226
MWAWNote::MWAWNote
MWAWNote(Type type)
constructor
Definition: libmwaw_internal.hxx:398
MWAWColor::operator>
bool operator>(MWAWColor const &c) const
operator>
Definition: libmwaw_internal.hxx:290
MWAWColor::operator<
bool operator<(MWAWColor const &c) const
operator<
Definition: libmwaw_internal.hxx:280
MWAWVec2::MWAWVec2
MWAWVec2(T xx=0, T yy=0)
constructor
Definition: libmwaw_internal.hxx:546
libmwaw::DOC_NOTE
Definition: libmwaw_internal.hxx:173
libmwaw::numberingValueToString
std::string numberingValueToString(NumberingType type, int value)
Definition: libmwaw_internal.cxx:126
MWAWLink
a link
Definition: libmwaw_internal.hxx:380
MWAWVariable::m_data
T m_data
the value
Definition: libmwaw_internal.hxx:533
MWAWPresentationListenerPtr
shared_ptr< MWAWPresentationListener > MWAWPresentationListenerPtr
a smart pointer of MWAWPresentationListener
Definition: libmwaw_internal.hxx:447
libmwaw::VMiddleBit
Definition: libmwaw_internal.hxx:168
MWAWBox2::extend
void extend(T val)
extends the bdbox by (val, val) keeping the center
Definition: libmwaw_internal.hxx:1000
MWAWVec2::operator[]
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:561
MWAWVariable::operator->
T * operator->()
operator*
Definition: libmwaw_internal.hxx:500
MWAWColor::MWAWColor
MWAWColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
constructor from color
Definition: libmwaw_internal.hxx:183
MWAWVec3::z
T z() const
third element
Definition: libmwaw_internal.hxx:753
MWAWVec3::add
void add(T dx, T dy, T dz)
increases the actuals values by dx, dy, dz
Definition: libmwaw_internal.hxx:794
MWAWField::None
Definition: libmwaw_internal.hxx:363
libmwaw::DOC_CHART
Definition: libmwaw_internal.hxx:173
MWAWColor::getRed
unsigned char getRed() const
returns the red value
Definition: libmwaw_internal.hxx:250
MWAWVariable::MWAWVariable
MWAWVariable(T const &def)
constructor with a default value
Definition: libmwaw_internal.hxx:467
MWAWBox2::resizeFromMax
void resizeFromMax(MWAWVec2< T > const &sz)
resize the box keeping the maximum
Definition: libmwaw_internal.hxx:980
MWAWColor::operator==
bool operator==(MWAWColor const &c) const
operator==
Definition: libmwaw_internal.hxx:270
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:221
MWAWVec3::Map
std::map< MWAWVec3< T >, T, struct PosSizeLt > Map
map of MWAWVec3
Definition: libmwaw_internal.hxx:886
MWAWGraphicStyle
a structure used to define a picture style
Definition: MWAWGraphicStyle.hxx:47
MWAWVec3::operator-=
MWAWVec3< T > & operator-=(MWAWVec3< T > const &p)
operator-=
Definition: libmwaw_internal.hxx:808
MWAWVariable::insert
void insert(MWAWVariable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:487
MWAWGraphicListener
This class contains the code needed to create Graphic document.
Definition: MWAWGraphicListener.hxx:59
libmwaw::SubDocumentType
SubDocumentType
Definition: libmwaw_internal.hxx:173
MWAWVec3::operator*
friend MWAWVec3< T > operator*(U scale, MWAWVec3< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:835
libmwaw::numberingTypeToString
std::string numberingTypeToString(NumberingType type)
Definition: libmwaw_internal.cxx:104
libmwaw::VMiddle
Definition: libmwaw_internal.hxx:166
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition: libmwaw_internal.hxx:717
MWAWBorder::m_width
double m_width
the border total width in point
Definition: libmwaw_internal.hxx:349
libmwaw::Bottom
Definition: libmwaw_internal.hxx:166
MWAWVec2::MWAWVec2
MWAWVec2(MWAWVec2< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:548
MWAWVec2::operator-
friend MWAWVec2< T > operator-(MWAWVec2< T > const &p1, MWAWVec2< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:627
libmwaw::Position
Position
basic position enum
Definition: libmwaw_internal.hxx:166
libmwaw::Top
Definition: libmwaw_internal.hxx:166
MWAWVec2::operator*=
MWAWVec2< T > & operator*=(U scale)
generic operator*=
Definition: libmwaw_internal.hxx:613
MWAWBox2i
MWAWBox2< int > MWAWBox2i
MWAWBox2 of int.
Definition: libmwaw_internal.hxx:1080
MWAWNote::m_type
Type m_type
the note type
Definition: libmwaw_internal.hxx:402
MWAWVec2::add
void add(T dx, T dy)
increases the actuals values by dx and dy
Definition: libmwaw_internal.hxx:591
libmwaw::Right
Definition: libmwaw_internal.hxx:166
MWAWLink::addTo
bool addTo(librevenge::RVNGPropertyList &propList) const
add the link property to proplist (if needed )
Definition: libmwaw_internal.cxx:215
MWAWVec2::operator[]
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:567
MWAWColor::getAlpha
unsigned char getAlpha() const
returns the alpha value
Definition: libmwaw_internal.hxx:240
MWAWVec3
small class which defines a vector with 3 elements
Definition: libmwaw_internal.hxx:726
libmwaw
namespace used to regroup all libwpd functions, enumerations which we have redefined for internal usa...
Definition: libmwaw_internal.cxx:49
MWAWNote::EndNote
Definition: libmwaw_internal.hxx:396
MWAWBorder::Type
Type
the line repetition
Definition: libmwaw_internal.hxx:313
MWAWColor::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWColor const &c)
operator<< in the form #rrggbb
Definition: libmwaw_internal.cxx:195
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:194
MWAWBorder::operator<<
friend std::ostream & operator<<(std::ostream &o, MWAWBorder const &border)
operator<<
Definition: libmwaw_internal.cxx:329
MWAWBox2::set
void set(MWAWVec2< T > const &x, MWAWVec2< T > const &y)
resets the data to minimum x and maximum y
Definition: libmwaw_internal.hxx:958
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:177
libmwaw::DOC_CHART_ZONE
Definition: libmwaw_internal.hxx:173
libmwaw::WrongPasswordException
Definition: libmwaw_internal.hxx:149
MWAWSubDocumentPtr
shared_ptr< MWAWSubDocument > MWAWSubDocumentPtr
a smart pointer of MWAWSubDocument
Definition: libmwaw_internal.hxx:453
MWAWVec3::operator-
friend MWAWVec3< T > operator-(MWAWVec3< T > const &p1, MWAWVec3< T > const &p2)
operator-
Definition: libmwaw_internal.hxx:828
MWAWField::PageCount
Definition: libmwaw_internal.hxx:363
MWAWField::MWAWField
MWAWField(Type type)
basic constructor
Definition: libmwaw_internal.hxx:366
MWAWVec3::operator[]
T & operator[](int c)
operator[]
Definition: libmwaw_internal.hxx:764
libmwaw::Left
Definition: libmwaw_internal.hxx:166
MWAWBox2::PosSizeLt
internal struct used to create sorted map, sorted first min then max
Definition: libmwaw_internal.hxx:1062
MWAWNote::m_label
librevenge::RVNGString m_label
the note label
Definition: libmwaw_internal.hxx:404
MWAWBorder::Style
Style
the line style
Definition: libmwaw_internal.hxx:311
MWAWVec2::x
T x() const
first element
Definition: libmwaw_internal.hxx:551
libmwaw::UPPERCASE
Definition: libmwaw_internal.hxx:170
MWAWInputStream
Internal class used to read the file stream Internal class used to read the file stream, this class adds some usefull functions to the basic librevenge::RVNGInputStream:
Definition: MWAWInputStream.hxx:53
MWAWNote::Type
Type
enum to define note type
Definition: libmwaw_internal.hxx:396
MWAWLink::MWAWLink
MWAWLink()
basic constructor
Definition: libmwaw_internal.hxx:382
MWAWVec2::m_y
T m_y
second element
Definition: libmwaw_internal.hxx:711
MWAWBorder::m_widthsList
std::vector< double > m_widthsList
the different length used for each line/sep (if defined)
Definition: libmwaw_internal.hxx:353
MWAWBorder::compare
int compare(MWAWBorder const &orig) const
compare two borders
Definition: libmwaw_internal.cxx:224
MWAWVec2::y
T y() const
second element
Definition: libmwaw_internal.hxx:556
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
MWAWBorder
a border
Definition: libmwaw_internal.hxx:309
MWAWBox2
small class which defines a 2D Box
Definition: libmwaw_internal.hxx:903
MWAWVariable::operator=
MWAWVariable & operator=(T const &val)
set a value
Definition: libmwaw_internal.hxx:480
MWAWBox2::min
MWAWVec2< T > & min()
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:929
MWAWVec3::m_val
T m_val[3]
the values
Definition: libmwaw_internal.hxx:890
MWAWParserState
a class to define the parser state
Definition: MWAWParser.hxx:49
MWAWRSRCParserPtr
shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:449
MWAWVariable::m_set
bool m_set
a flag to know if the variable is set or not
Definition: libmwaw_internal.hxx:535
libmwaw::DOC_TABLE
Definition: libmwaw_internal.hxx:173
MWAWBorder::LargeDot
Definition: libmwaw_internal.hxx:311
MWAWVec2::cmpY
int cmpY(MWAWVec2< T > const &p) const
a comparison function: which first compares y then x
Definition: libmwaw_internal.hxx:665
MWAWField::Date
Definition: libmwaw_internal.hxx:363
MWAWBox2::size
MWAWVec2< T > size() const
the box size
Definition: libmwaw_internal.hxx:947
MWAWVec2::setX
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:580
MWAWVec3::operator==
bool operator==(MWAWVec3< T > const &p) const
comparison==
Definition: libmwaw_internal.hxx:842
MWAWBox2::min
MWAWVec2< T > const & min() const
the minimum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:919
libmwaw::GenericException
Definition: libmwaw_internal.hxx:145
MWAWSpreadsheetListener
This class contents the main functions needed to create a spreadsheet processing Document.
Definition: MWAWSpreadsheetListener.hxx:65
MWAWField::m_type
Type m_type
the type
Definition: libmwaw_internal.hxx:370
MWAWVec2f
MWAWVec2< float > MWAWVec2f
MWAWVec2 of float.
Definition: libmwaw_internal.hxx:721
MWAWSpreadsheetListenerPtr
shared_ptr< MWAWSpreadsheetListener > MWAWSpreadsheetListenerPtr
a smart pointer of MWAWSpreadsheetListener
Definition: libmwaw_internal.hxx:451
libmwaw::BULLET
Definition: libmwaw_internal.hxx:170
MWAWVariable::operator=
MWAWVariable & operator=(MWAWVariable const &orig)
copy operator
Definition: libmwaw_internal.hxx:471
MWAWVec3f
MWAWVec3< float > MWAWVec3f
MWAWVec3 of float.
Definition: libmwaw_internal.hxx:898
MWAWVec2::operator!=
bool operator!=(MWAWVec2< T > const &p) const
comparison!=
Definition: libmwaw_internal.hxx:646
MWAWBox2::m_pt
MWAWVec2< T > m_pt[2]
the two extremities
Definition: libmwaw_internal.hxx:1076
MWAWVec2::operator+=
MWAWVec2< T > & operator+=(MWAWVec2< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:598
MWAWBox2::MWAWBox2
MWAWBox2(MWAWBox2< U > const &p)
generic constructor
Definition: libmwaw_internal.hxx:913
MWAWVec2b
MWAWVec2< bool > MWAWVec2b
MWAWVec2 of bool.
Definition: libmwaw_internal.hxx:715
libmwaw::LOWERCASE
Definition: libmwaw_internal.hxx:170
MWAWSubDocument
abstract class used to store a subdocument (with a comparison function)
Definition: MWAWSubDocument.hxx:41
MWAWBox2::cmp
int cmp(MWAWBox2< T > const &p) const
comparison function : fist sorts min by Y,X values then max extremity
Definition: libmwaw_internal.hxx:1043
MWAWVec3::x
T x() const
first element
Definition: libmwaw_internal.hxx:743
MWAWColor::operator!=
bool operator!=(MWAWColor const &c) const
operator!=
Definition: libmwaw_internal.hxx:275
MWAWBorder::None
Definition: libmwaw_internal.hxx:311
MWAWColor::operator>=
bool operator>=(MWAWColor const &c) const
operator>=
Definition: libmwaw_internal.hxx:295
MWAWListManager
a manager which manages the lists, keeps the different kind of lists, to assure the unicity of each l...
Definition: MWAWList.hxx:195
libmwaw::BottomBit
Definition: libmwaw_internal.hxx:168
MWAWVec3::PosSizeLt
internal struct used to create sorted map, sorted by X, Y, Z
Definition: libmwaw_internal.hxx:876
MWAWBox2::getUnion
MWAWBox2< T > getUnion(MWAWBox2< T > const &box) const
returns the union between this and box
Definition: libmwaw_internal.hxx:1007
MWAWVec3::setX
void setX(T xx)
resets the first element
Definition: libmwaw_internal.hxx:778
libmwaw::ParseException
Definition: libmwaw_internal.hxx:141
MWAWColor::MWAWColor
MWAWColor(uint32_t argb=0)
constructor
Definition: libmwaw_internal.hxx:179
MWAWBorder::addTo
bool addTo(librevenge::RVNGPropertyList &propList, std::string which="") const
add the border property to proplist (if needed )
Definition: libmwaw_internal.cxx:236
MWAWBorder::Single
Definition: libmwaw_internal.hxx:313
MWAWBox2::resizeFromCenter
void resizeFromCenter(MWAWVec2< T > const &sz)
resize the box keeping the center
Definition: libmwaw_internal.hxx:985
LIBMWAW_ATTRIBUTE_PRINTF
#define LIBMWAW_ATTRIBUTE_PRINTF(fmt, arg)
Definition: libmwaw_internal.hxx:116
libmwaw::FileException
Definition: libmwaw_internal.hxx:137
libmwaw::DOC_SHEET
Definition: libmwaw_internal.hxx:173
MWAWBox2::getIntersection
MWAWBox2< T > getIntersection(MWAWBox2< T > const &box) const
returns the intersection between this and box
Definition: libmwaw_internal.hxx:1017
MWAWField::PageNumber
Definition: libmwaw_internal.hxx:363
MWAWVec3::set
void set(T xx, T yy, T zz)
resets the three elements
Definition: libmwaw_internal.hxx:771
MWAWColor::barycenter
static MWAWColor barycenter(float alpha, MWAWColor const &colA, float beta, MWAWColor const &colB)
return alpha*colA+beta*colB
Definition: libmwaw_internal.cxx:181
MWAWSection
a class which stores section properties
Definition: MWAWSection.hxx:45
MWAWColor::getBlue
unsigned char getBlue() const
returns the green value
Definition: libmwaw_internal.hxx:245
MWAWVec3::MWAWVec3
MWAWVec3(MWAWVec3< U > const &p)
generic copy constructor
Definition: libmwaw_internal.hxx:737
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:439
MWAWBorder::operator!=
bool operator!=(MWAWBorder const &orig) const
operator!=
Definition: libmwaw_internal.hxx:332
MWAWBox2::MWAWBox2
MWAWBox2(MWAWVec2< T > minPt=MWAWVec2< T >(), MWAWVec2< T > maxPt=MWAWVec2< T >())
constructor
Definition: libmwaw_internal.hxx:907
MWAWVec2::operator+
friend MWAWVec2< T > operator+(MWAWVec2< T > const &p1, MWAWVec2< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:621
libmwaw::HMiddleBit
Definition: libmwaw_internal.hxx:168
MWAWBorder::m_style
Style m_style
the border style
Definition: libmwaw_internal.hxx:345
MWAWVec3::operator+
friend MWAWVec3< T > operator+(MWAWVec3< T > const &p1, MWAWVec3< T > const &p2)
operator+
Definition: libmwaw_internal.hxx:822
MWAWFontConverter
a namespace used to convert Mac font characters in unicode
Definition: MWAWFontConverter.hxx:63
MWAWVec2::set
void set(T xx, T yy)
resets the two elements
Definition: libmwaw_internal.hxx:574
MWAWField::Time
Definition: libmwaw_internal.hxx:363
MWAWColor::getGreen
unsigned char getGreen() const
returns the green value
Definition: libmwaw_internal.hxx:255
MWAWGraphicListenerPtr
shared_ptr< MWAWGraphicListener > MWAWGraphicListenerPtr
a smart pointer of MWAWGraphicListener
Definition: libmwaw_internal.hxx:437
MWAWVec3::setZ
void setZ(T zz)
resets the third element
Definition: libmwaw_internal.hxx:788
MWAWVec3uc
MWAWVec3< unsigned char > MWAWVec3uc
MWAWVec3 of unsigned char.
Definition: libmwaw_internal.hxx:894
MWAWBox2::max
MWAWVec2< T > & max()
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:934
MWAWNote::FootNote
Definition: libmwaw_internal.hxx:396
MWAW_shared_ptr_noop_deleter
an noop deleter used to transform a libwpd pointer in a false shared_ptr
Definition: libmwaw_internal.hxx:109
libmwaw::RightBit
Definition: libmwaw_internal.hxx:168
MWAWGraphicShape
a structure used to define a picture shape
Definition: MWAWGraphicShape.hxx:45
MWAWVec3::MWAWVec3
MWAWVec3(T xx=0, T yy=0, T zz=0)
constructor
Definition: libmwaw_internal.hxx:730
MWAWFontConverterPtr
shared_ptr< MWAWFontConverter > MWAWFontConverterPtr
a smart pointer of MWAWFontConverter
Definition: libmwaw_internal.hxx:433
libmwaw::ARABIC
Definition: libmwaw_internal.hxx:170
MWAWVec2::PosSizeLtY
internal struct used to create sorted map, sorted by Y
Definition: libmwaw_internal.hxx:699
MWAWBox2f
MWAWBox2< float > MWAWBox2f
MWAWBox2 of float.
Definition: libmwaw_internal.hxx:1082
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:82
MWAWLink::m_HRef
std::string m_HRef
the href field
Definition: libmwaw_internal.hxx:390
MWAWBox2::setMax
void setMax(MWAWVec2< T > const &y)
resets the maximum point
Definition: libmwaw_internal.hxx:969
MWAWBorder::Dash
Definition: libmwaw_internal.hxx:311
MWAWVariable::setSet
void setSet(bool newVal)
define if the variable is set
Definition: libmwaw_internal.hxx:527
MWAWField
a field
Definition: libmwaw_internal.hxx:361
MWAWColor::colorFromHSL
static MWAWColor colorFromHSL(unsigned char H, unsigned char S, unsigned char L)
return a color from a hsl color (basic)
Definition: libmwaw_internal.hxx:204
MWAWBox2::max
MWAWVec2< T > const & max() const
the maximum 2D point (in x and in y)
Definition: libmwaw_internal.hxx:924
MWAWVec2< bool >::MapY
std::map< MWAWVec2< bool >, bool, struct PosSizeLtY > MapY
Definition: libmwaw_internal.hxx:709
MWAWField::m_DTFormat
std::string m_DTFormat
the date/time format using strftime format if defined
Definition: libmwaw_internal.hxx:372
MWAWVariable::MWAWVariable
MWAWVariable(MWAWVariable const &orig)
copy constructor
Definition: libmwaw_internal.hxx:469
MWAWColor::operator<=
bool operator<=(MWAWColor const &c) const
operator<=
Definition: libmwaw_internal.hxx:285
MWAWBorder::Triple
Definition: libmwaw_internal.hxx:313
libmwaw::DOC_HEADER_FOOTER
Definition: libmwaw_internal.hxx:173
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:445
libmwaw::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libmwaw_internal.cxx:51
MWAWBorder::m_extra
std::string m_extra
extra data ( if needed)
Definition: libmwaw_internal.hxx:357
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:265
MWAWBox2< int >::Map
std::map< MWAWBox2< int >, int, struct PosSizeLt > Map
Definition: libmwaw_internal.hxx:1072
MWAWNote
a note
Definition: libmwaw_internal.hxx:394
MWAWParser
virtual class which defines the ancestor of all main zone parser
Definition: MWAWParser.hxx:97
MWAWPosition
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: MWAWPosition.hxx:47
MWAWField::Type
Type
Defines some basic type for field.
Definition: libmwaw_internal.hxx:363
MWAWListener
This class contains a virtual interface to all listener.
Definition: MWAWListener.hxx:49
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:260
MWAWVec2l
MWAWVec2< long > MWAWVec2l
MWAWVec2 of long.
Definition: libmwaw_internal.hxx:719
MWAWVec2::PosSizeLtY::operator()
bool operator()(MWAWVec2< T > const &s1, MWAWVec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:701
MWAWBorder::MWAWBorder
MWAWBorder()
constructor
Definition: libmwaw_internal.hxx:316
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
MWAWBox2::operator!=
bool operator!=(MWAWBox2< T > const &p) const
comparison operator!=
Definition: libmwaw_internal.hxx:1032
MWAWBox2::operator==
bool operator==(MWAWBox2< T > const &p) const
comparison operator==
Definition: libmwaw_internal.hxx:1027
MWAW_shared_ptr_noop_deleter::operator()
void operator()(T *)
Definition: libmwaw_internal.hxx:110
MWAWVec2::m_x
T m_x
first element
Definition: libmwaw_internal.hxx:711
MWAWBox2::scale
void scale(U factor)
scales all points of the box by factor
Definition: libmwaw_internal.hxx:993
MWAWBox2l
MWAWBox2< long > MWAWBox2l
MWAWBox2 of long.
Definition: libmwaw_internal.hxx:1084
MWAWList
a small structure used to store the informations about a list
Definition: MWAWList.hxx:105
MWAWBorder::Simple
Definition: libmwaw_internal.hxx:311
MWAWRSRCParser
the main class to read a Mac resource fork
Definition: MWAWRSRCParser.hxx:46
libmwaw::LeftBit
Definition: libmwaw_internal.hxx:168
MWAWColor::value
uint32_t value() const
return the rgba value
Definition: libmwaw_internal.hxx:235
MWAWBorder::m_color
MWAWColor m_color
the border color
Definition: libmwaw_internal.hxx:355
MWAWVec3::operator+=
MWAWVec3< T > & operator+=(MWAWVec3< T > const &p)
operator+=
Definition: libmwaw_internal.hxx:802
MWAWField::m_numberingType
libmwaw::NumberingType m_numberingType
the number type ( for number field )
Definition: libmwaw_internal.hxx:374
MWAWVariable::isSet
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:522
libmwaw::DOC_COMMENT_ANNOTATION
Definition: libmwaw_internal.hxx:173
MWAWVec3::operator[]
T operator[](int c) const
operator[]
Definition: libmwaw_internal.hxx:758
MWAWBox2::PosSizeLt::operator()
bool operator()(MWAWBox2< T > const &s1, MWAWBox2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:1064
MWAWVariable::MWAWVariable
MWAWVariable()
constructor
Definition: libmwaw_internal.hxx:465
MWAWGraphicEncoder
main class used to define store librevenge::RVNGDrawingInterface lists of command in a librevenge::RV...
Definition: MWAWGraphicEncoder.hxx:55
MWAWVec2::operator*
friend MWAWVec2< T > operator*(U scale, MWAWVec2< T > const &p1)
generic operator*
Definition: libmwaw_internal.hxx:634
MWAWVec2::PosSizeLtX
internal struct used to create sorted map, sorted by X
Definition: libmwaw_internal.hxx:684
MWAWVariable
a generic variable template: value + flag to know if the variable is set
Definition: libmwaw_internal.hxx:463
MWAWVec3::cmp
int cmp(MWAWVec3< T > const &p) const
a comparison function: which first compares x values, then y values then z values.
Definition: libmwaw_internal.hxx:857
libmwaw::HMiddle
Definition: libmwaw_internal.hxx:166
MWAWBox2::resizeFromMin
void resizeFromMin(MWAWVec2< T > const &sz)
resize the box keeping the minimum
Definition: libmwaw_internal.hxx:975
MWAWTextListenerPtr
shared_ptr< MWAWTextListener > MWAWTextListenerPtr
a smart pointer of MWAWTextListener
Definition: libmwaw_internal.hxx:455
MWAWColor::m_value
uint32_t m_value
the argb color
Definition: libmwaw_internal.hxx:305
MWAWVariable::operator->
T const * operator->() const
operator*
Definition: libmwaw_internal.hxx:495
MWAWVec2::PosSizeLtX::operator()
bool operator()(MWAWVec2< T > const &s1, MWAWVec2< T > const &s2) const
comparaison function
Definition: libmwaw_internal.hxx:686
libmwaw::VersionException
Definition: libmwaw_internal.hxx:133
MWAWVec2
small class which defines a vector with 2 elements
Definition: libmwaw_internal.hxx:542
MWAWBox2::center
MWAWVec2< T > center() const
the box center
Definition: libmwaw_internal.hxx:952
MWAWListManagerPtr
shared_ptr< MWAWListManager > MWAWListManagerPtr
a smart pointer of MWAWListManager
Definition: libmwaw_internal.hxx:443
MWAWVec3::setY
void setY(T yy)
resets the second element
Definition: libmwaw_internal.hxx:783
MWAWBox2::setMin
void setMin(MWAWVec2< T > const &x)
resets the minimum point
Definition: libmwaw_internal.hxx:964
MWAWVec3::y
T y() const
second element
Definition: libmwaw_internal.hxx:748
MWAWBorder::isEmpty
bool isEmpty() const
returns true if the border is empty
Definition: libmwaw_internal.hxx:322