X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalTransforms.h;h=cd3e5e226a0e1354d66de3709597ad2f86ed43c6;hb=705302f6dee4e4be9ea46213aa1b0cc18be0cfb0;hp=5f9a85294bb00d053f6dd7ba96d36d210a599ced;hpb=53cea42f883c34a7741dfc3c5633d3bb9e8bb578;p=lyx.git diff --git a/src/insets/ExternalTransforms.h b/src/insets/ExternalTransforms.h index 5f9a85294b..cd3e5e226a 100644 --- a/src/insets/ExternalTransforms.h +++ b/src/insets/ExternalTransforms.h @@ -12,20 +12,24 @@ #ifndef EXTERNALTRANSFORMS_H #define EXTERNALTRANSFORMS_H -#include "lyxlength.h" +#include "Length.h" #include "graphics/GraphicsParams.h" +#include "support/unique_ptr.h" + #include -#include -#include +#include #include #include +#include -class LyXLex; namespace lyx { + +class Lexer; + namespace external { /* @@ -35,7 +39,9 @@ class ClipData { public: ClipData() : clip(false) {} - lyx::graphics::BoundingBox bbox; + /// The bounding box + graphics::BoundingBox bbox; + /// clip image bool clip; }; @@ -56,14 +62,14 @@ private: class ResizeData { public: - ResizeData() : scale(0), keepAspectRatio(false) {} + ResizeData() : scale(), keepAspectRatio(false) {} bool no_resize() const; bool usingScale() const; - float scale; - LyXLength width; - LyXLength height; + std::string scale; + Length width; + Length height; bool keepAspectRatio; }; @@ -84,11 +90,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_; } @@ -97,7 +103,6 @@ public: std::string const originString() const; private: - double angle_; OriginType origin_; }; @@ -119,7 +124,7 @@ public: */ class TransformCommand { public: - typedef std::auto_ptr ptr_type; + typedef unique_ptr ptr_type; virtual ~TransformCommand() {} /// The string from the External Template that we seek to replace. @@ -198,7 +203,7 @@ private: */ class TransformOption { public: - typedef std::auto_ptr ptr_type; + typedef unique_ptr ptr_type; virtual ~TransformOption() {} /// The string from the External Template that we seek to replace. @@ -303,7 +308,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 { @@ -314,23 +318,24 @@ enum TransformID { }; -typedef boost::function +typedef std::function ClipOptionFactory; -typedef boost::function +typedef std::function ExtraOptionFactory; -typedef boost::function +typedef std::function ResizeOptionFactory; -typedef boost::function +typedef std::function RotationOptionFactory; -typedef boost::function +typedef std::function ResizeCommandFactory; -typedef boost::function +typedef std::function RotationCommandFactory; -struct TransformStore +class TransformStore { - TransformStore() {} +public: + TransformStore() : id(Rotate) {} /** Stores \c factory and a reminder of what \c data this \c factory * operates on.