Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
809 changes: 734 additions & 75 deletions src/lib/FHCollector.cpp

Large diffs are not rendered by default.

37 changes: 34 additions & 3 deletions src/lib/FHCollector.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ class FHCollector
void collectLayer(unsigned recordId, const FHLayer &layer);
void collectGroup(unsigned recordId, const FHGroup &group);
void collectClipGroup(unsigned recordId, const FHGroup &group);
void collectPathText(unsigned recordId, const FHPathText &group);
void collectCompositePath(unsigned recordId, const FHCompositePath &compositePath);
void collectTString(unsigned recordId, const std::vector<unsigned> &elements);
void collectAGDFont(unsigned recordId, const FHAGDFont &font);
void collectTEffect(unsigned recordId, const FHTEffect &tEffect);
void collectParagraph(unsigned recordId, const FHParagraph &paragraph);
void collectTabTable(unsigned recordId, const std::vector<FHTab> &tabs);
void collectTextBlok(unsigned recordId, const std::vector<unsigned short> &characters);
void collectTextObject(unsigned recordId, const FHTextObject &textObject);
void collectCharProps(unsigned recordId, const FHCharProperties &charProps);
void collectParagraphProps(unsigned recordId, const FHParagraphProperties &paragraphProps);
void collectPropList(unsigned recordId, const FHPropList &propertyList);
void collectDisplayText(unsigned recordId, const FHDisplayText &displayText);
void collectGraphicStyle(unsigned recordId, const FHGraphicStyle &graphicStyle);
Expand All @@ -70,8 +74,12 @@ class FHCollector
void collectLinearFill(unsigned recordId, const FHLinearFill &fill);
void collectRadialFill(unsigned recordId, const FHRadialFill &fill);
void collectBasicLine(unsigned recordId, const FHBasicLine &line);
void collectPatternLine(unsigned recordId, const FHPatternLine &line);
void collectCustomProc(unsigned recordId, const FHCustomProc &lineFill);
void collectTileFill(unsigned recordId, const FHTileFill &fill);
void collectPatternFill(unsigned recordId, const FHPatternFill &fill);
void collectLinePattern(unsigned recordId, const FHLinePattern &line);
void collectArrowPath(unsigned recordId, const FHPath &path);

void collectSymbolClass(unsigned recordId, const FHSymbolClass &symbolClass);
void collectSymbolInstance(unsigned recordId, const FHSymbolInstance &symbolInstance);
Expand All @@ -90,8 +98,9 @@ class FHCollector
void _outputGroup(const FHGroup *group, ::librevenge::RVNGDrawingInterface *painter);
void _outputClipGroup(const FHGroup *group, ::librevenge::RVNGDrawingInterface *painter);
void _outputCompositePath(const FHCompositePath *compositePath, ::librevenge::RVNGDrawingInterface *painter);
void _outputPathText(const FHPathText *pathText, ::librevenge::RVNGDrawingInterface *painter);
void _outputTextObject(const FHTextObject *textObject, ::librevenge::RVNGDrawingInterface *painter);
void _outputParagraph(const FHParagraph *paragraph, ::librevenge::RVNGDrawingInterface *painter);
void _outputParagraph(const FHParagraph *paragraph, ::librevenge::RVNGDrawingInterface *painter, unsigned &actPos, unsigned minPos, unsigned maxPos);
void _outputTextRun(const std::vector<unsigned short> *characters, unsigned offset, unsigned length,
unsigned charStyleId, ::librevenge::RVNGDrawingInterface *painter);
void _outputDisplayText(const FHDisplayText *displayText, ::librevenge::RVNGDrawingInterface *painter);
Expand All @@ -104,6 +113,7 @@ class FHCollector
void _getBBofLayer(unsigned layerId,FHBoundingBox &bBox);
void _getBBofGroup(const FHGroup *group,FHBoundingBox &bBox);
void _getBBofClipGroup(const FHGroup *group,FHBoundingBox &bBox);
void _getBBofPathText(const FHPathText *pathText,FHBoundingBox &bBox);
void _getBBofCompositePath(const FHCompositePath *compositePath,FHBoundingBox &bBox);
void _getBBofTextObject(const FHTextObject *textObject,FHBoundingBox &bBox);
void _getBBofDisplayText(const FHDisplayText *displayText,FHBoundingBox &bBox);
Expand All @@ -118,15 +128,21 @@ class FHCollector
void _appendCharacterProperties(::librevenge::RVNGPropertyList &propList, unsigned charPropsId);
void _appendCharacterProperties(::librevenge::RVNGPropertyList &propList, const FH3CharProperties &charProps);
void _appendFontProperties(::librevenge::RVNGPropertyList &propList, unsigned agdFontId);
void _appendTabProperties(::librevenge::RVNGPropertyList &propList, const FHTab &tab);
void _appendFillProperties(::librevenge::RVNGPropertyList &propList, unsigned graphicStyleId);
void _appendStrokeProperties(::librevenge::RVNGPropertyList &propList, unsigned graphicStyleId);
void _appendBasicFill(::librevenge::RVNGPropertyList &propList, const FHBasicFill *basicFill);
void _appendBasicLine(::librevenge::RVNGPropertyList &propList, const FHBasicLine *basicLine);
void _appendPatternLine(::librevenge::RVNGPropertyList &propList, const FHPatternLine *basicLine);
void _appendCustomProcFill(::librevenge::RVNGPropertyList &propList, const FHCustomProc *customProc);
void _appendCustomProcLine(::librevenge::RVNGPropertyList &propList, const FHCustomProc *customProc);
void _appendLinearFill(::librevenge::RVNGPropertyList &propList, const FHLinearFill *linearFill);
void _appendLensFill(::librevenge::RVNGPropertyList &propList, const FHLensFill *lensFill);
void _appendRadialFill(::librevenge::RVNGPropertyList &propList, const FHRadialFill *radialFill);
void _appendTileFill(::librevenge::RVNGPropertyList &propList, const FHTileFill *tileFill);
void _appendPatternFill(::librevenge::RVNGPropertyList &propList, const FHPatternFill *patternFill);
void _appendLinePattern(::librevenge::RVNGPropertyList &propList, const FHLinePattern *linePattern);
void _appendArrowPath(::librevenge::RVNGPropertyList &propList, const FHPath *arrow, bool startArrow);
void _appendOpacity(::librevenge::RVNGPropertyList &propList, const double *opacity);
void _appendShadow(::librevenge::RVNGPropertyList &propList, const FWShadowFilter *filter);
void _appendGlow(::librevenge::RVNGPropertyList &propList, const FWGlowFilter *filter);
Expand All @@ -137,9 +153,12 @@ class FHCollector
const FHGroup *_findGroup(unsigned id);
const FHGroup *_findClipGroup(unsigned id);
const FHCompositePath *_findCompositePath(unsigned id);
const FHPathText *_findPathText(unsigned id);
const FHTextObject *_findTextObject(unsigned id);
const FHTransform *_findTransform(unsigned id);
const FHTEffect *_findTEffect(unsigned id);
const FHParagraph *_findParagraph(unsigned id);
const std::vector<FHTab> *_findTabTable(unsigned id);
const FHPropList *_findPropList(unsigned id);
const FHGraphicStyle *_findGraphicStyle(unsigned id);
const std::vector<unsigned short> *_findTextBlok(unsigned id);
Expand All @@ -149,7 +168,11 @@ class FHCollector
const FHRadialFill *_findRadialFill(unsigned id);
const FHTileFill *_findTileFill(unsigned id);
const FHPatternFill *_findPatternFill(unsigned id);
const FHLinePattern *_findLinePattern(unsigned id);
const FHPath *_findArrowPath(unsigned id);
const FHBasicLine *_findBasicLine(unsigned id);
const FHCustomProc *_findCustomProc(unsigned id);
const FHPatternLine *_findPatternLine(unsigned id);
const FHRGBColor *_findRGBColor(unsigned id);
const FHTintColor *_findTintColor(unsigned id);
const FHDisplayText *_findDisplayText(unsigned id);
Expand All @@ -160,7 +183,7 @@ class FHCollector
const FWGlowFilter *_findFWGlowFilter(unsigned id);
const FHFilterAttributeHolder *_findFilterAttributeHolder(unsigned id);
const ::librevenge::RVNGBinaryData *_findData(unsigned id);
::librevenge::RVNGString getColorString(unsigned id);
::librevenge::RVNGString getColorString(unsigned id, double tint=1);
unsigned _findFillId(const FHGraphicStyle &graphicStyle);
unsigned _findStrokeId(const FHGraphicStyle &graphicStyle);
const FHFilterAttributeHolder *_findFilterAttributeHolder(const FHGraphicStyle &graphicStyle);
Expand All @@ -187,16 +210,22 @@ class FHCollector
std::stack<FHTransform> m_currentTransforms;
std::vector<FHTransform> m_fakeTransforms;
std::map<unsigned, FHCompositePath> m_compositePaths;
std::map<unsigned, FHPathText> m_pathTexts;
std::map<unsigned, std::vector<unsigned> > m_tStrings;
std::map<unsigned, FHAGDFont> m_fonts;
std::map<unsigned, FHTEffect> m_tEffects;
std::map<unsigned, FHParagraph> m_paragraphs;
std::map<unsigned, std::vector<FHTab> > m_tabs;
std::map<unsigned, std::vector<unsigned short> > m_textBloks;
std::map<unsigned, FHTextObject> m_textObjects;
std::map<unsigned, FHCharProperties> m_charProperties;
std::map<unsigned, FHParagraphProperties> m_paragraphProperties;
std::map<unsigned, FHRGBColor> m_rgbColors;
std::map<unsigned, FHBasicFill> m_basicFills;
std::map<unsigned, FHPropList> m_propertyLists;
std::map<unsigned, FHBasicLine> m_basicLines;
std::map<unsigned, FHCustomProc> m_customProcs;
std::map<unsigned, FHPatternLine> m_patternLines;
std::map<unsigned, FHDisplayText> m_displayTexts;
std::map<unsigned, FHGraphicStyle> m_graphicStyles;
std::map<unsigned, FHAttributeHolder> m_attributeHolders;
Expand All @@ -217,11 +246,13 @@ class FHCollector
std::map<unsigned, FHSymbolClass> m_symbolClasses;
std::map<unsigned, FHSymbolInstance> m_symbolInstances;
std::map<unsigned, FHPatternFill> m_patternFills;
std::map<unsigned, FHLinePattern> m_linePatterns;
std::map<unsigned, FHPath> m_arrowPaths;

unsigned m_strokeId;
unsigned m_fillId;
unsigned m_contentId;

unsigned m_textBoxNumberId;
std::deque<unsigned> m_visitedObjects;
};

Expand Down
28 changes: 21 additions & 7 deletions src/lib/FHConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,28 @@

#define FH_NAME 0x0321
#define FH_UID 0x065b
#define FH_TEXT_ALIGN 0x15e3
#define FH_PARA_TEXT_ALIGN 0x15e3
#define FH_PARA_TEXT_INDENT 0x1604
#define FH_PARA_LINE_TOGETHER 0x160b
#define FH_PARA_LEFT_INDENT 0x1614
#define FH_SPC_LETTER_MAX 0x161c
#define FH_SPC_WORD_MAX 0x1624
#define FH_SPC_LETTER_MIN 0x1634
#define FH_SPC_WORD_MIN 0x163c
#define FH_SPC_LETTER_OPT 0x164c
#define FH_SPC_WORD_OPT 0x1654
#define FH_PARA_RIGHT_INDENT 0x1664
#define FH_PARA_SPC_BELLOW 0x1684
#define FH_PARA_SPC_ABOVE 0x168c
#define FH_TAB_TABLE_ID 0x1691
#define FH_PARA_TAB_TABLE_ID 0x1691
#define FH_BASELN_SHIFT 0x169c
#define FH_PARA_KEEP_SAME_LINE 0x16a2
#define FH_TEFFECT_ID 0x16b1
#define FH_TXT_COLOR_ID 0x16b9
#define FH_FONT_ID 0x16c1
#define FH_HOR_SCALE 0x16d4
#define FH_LEADING 0x16dc
#define FH_LEADING_TYPE 0x16e3
#define FH_PARA_LEADING 0x16dc
#define FH_PARA_LEADING_TYPE 0x16e3
#define FH_RNG_KERN 0x16ec
#define FH_FONT_SIZE 0x1734
#define FH_FONT_NAME 0x1739
Expand All @@ -48,16 +53,25 @@
#define FH_AGD_STYLE 0x0e1b
#define FH_AGD_SIZE 0x0e24

#define FH_DISLAY_BODER 0x1302
#define FH_DISLAY_BORDER 0x1302
#define FH_INSET_BOTTOM 0x130c
#define FH_DIMENTSION_HEIGHT 0x131c
#define FH_DIMENSION_HEIGHT 0x131c
#define FH_ROWBREAK_FIRST 0x132a
#define FH_COL_SEPARATOR 0x1344
#define FH_DIMENSION_LEFT 0x134c
#define FH_INSET_LEFT 0x1354
#define FH_LINETABLE_ID 0x1369
#define FH_COL_NUM 0x137b
#define FH_ROW_NUM 0x1383
#define FH_INSET_RIGHT 0x13ac
#define FH_ROW_SEPARATOR 0x13bc
#define FH_TEXT_PATH_ID 0x13d1
#define FH_DIMENSION_TOP 0x13dc
#define FH_INSET_TOP 0x13e4
#define FH_TEXT_END_POS 0x13fb
#define FH_TEXT_BEGIN_POS 0x1403
#define FH_DIMENSION_WIDTH 0x140c
#define FH_LINETABLE_ID 0x1369

#define FH_EFFECT_NAME 0x1a91
#define FH_UNDERLINE_COLOR_ID 0x1ab9
#define FH_UNDERLINE_DASH_ID 0x1ac1
Expand Down
Loading