X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalTransforms.h;h=a43b45b312d5a569c68f025af8b53fef459524b3;hb=d044d6afa7192b2119784e1415e71dad644bc335;hp=9275759c5820bb3b63a2bb41a76ffe4c0fc9323e;hpb=8c96de553bc0850495e2e29469aa585ff95d3e0a;p=lyx.git diff --git a/src/insets/ExternalTransforms.h b/src/insets/ExternalTransforms.h index 9275759c58..a43b45b312 100644 --- a/src/insets/ExternalTransforms.h +++ b/src/insets/ExternalTransforms.h @@ -12,7 +12,7 @@ #ifndef EXTERNALTRANSFORMS_H #define EXTERNALTRANSFORMS_H -#include "lyxlength.h" +#include "Length.h" #include "graphics/GraphicsParams.h" @@ -23,9 +23,10 @@ #include #include -class LyXLex; - namespace lyx { + +class Lexer; + namespace external { /* @@ -35,7 +36,7 @@ class ClipData { public: ClipData() : clip(false) {} - lyx::graphics::BoundingBox bbox; + graphics::BoundingBox bbox; bool clip; }; @@ -56,12 +57,14 @@ private: class ResizeData { public: - ResizeData() : scale(0), keepAspectRatio(false) {} + ResizeData() : scale(), keepAspectRatio(false) {} bool no_resize() const; - float scale; - LyXLength width; - LyXLength height; + bool usingScale() const; + + std::string scale; + Length width; + Length height; bool keepAspectRatio; }; @@ -82,11 +85,11 @@ public: BASELINERIGHT }; - RotationData() : angle_(0), origin_(DEFAULT) {} + RotationData() : angle("0"), origin_(DEFAULT) {} bool no_rotation() const; - void angle(double a); - double angle() const { return angle_; } + std::string const adjAngle() const; + std::string angle; void origin(OriginType o) { origin_ = o; } OriginType origin() const { return origin_; } @@ -95,11 +98,22 @@ public: std::string const originString() const; private: - double angle_; OriginType origin_; }; +/** \c RotationDataType is a wrapper for RotationData::OriginType + * It can be forward-declared and passed as a function argument without + * having to expose this header file. + */ +class RotationDataType { + RotationData::OriginType val_; +public: + RotationDataType(RotationData::OriginType val) : val_(val) {} + operator RotationData::OriginType() const { return val_; } +}; + + /* * Transformers generating commands */ @@ -289,7 +303,6 @@ private: */ std::string const sanitizeLatexOption(std::string const & input); std::string const sanitizeDocBookOption(std::string const & input); -std::string const sanitizeLinuxDocOption(std::string const & input); enum TransformID { @@ -300,22 +313,23 @@ enum TransformID { }; -typedef boost::function1 +typedef boost::function ClipOptionFactory; -typedef boost::function1 +typedef boost::function ExtraOptionFactory; -typedef boost::function1 +typedef boost::function ResizeOptionFactory; -typedef boost::function1 +typedef boost::function RotationOptionFactory; -typedef boost::function1 +typedef boost::function ResizeCommandFactory; -typedef boost::function1 +typedef boost::function RotationCommandFactory; -struct TransformStore +class TransformStore { +public: TransformStore() {} /** Stores \c factory and a reminder of what \c data this \c factory