summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_icon.h
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_icon.h')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_icon.h47
1 files changed, 18 insertions, 29 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_icon.h b/fpdfsdk/pdfwindow/cpwl_icon.h
index 0b82a4b5d6..e97c540bf6 100644
--- a/fpdfsdk/pdfwindow/cpwl_icon.h
+++ b/fpdfsdk/pdfwindow/cpwl_icon.h
@@ -7,48 +7,37 @@
#ifndef FPDFSDK_PDFWINDOW_CPWL_ICON_H_
#define FPDFSDK_PDFWINDOW_CPWL_ICON_H_
+#include <utility>
+
#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_string.h"
#include "fpdfsdk/pdfwindow/cpwl_wnd.h"
-class CPWL_Image : public CPWL_Wnd {
- public:
- CPWL_Image();
- ~CPWL_Image() override;
-
- virtual void GetScale(float& fHScale, float& fVScale);
- virtual void GetImageOffset(float& x, float& y);
-
- CPDF_Stream* GetPDFStream() const;
- void SetPDFStream(CPDF_Stream* pStream);
- void GetImageSize(float& fWidth, float& fHeight);
- CFX_Matrix GetImageMatrix();
- CFX_ByteString GetImageAlias();
- void SetImageAlias(const char* sImageAlias);
-
- protected:
- CFX_UnownedPtr<CPDF_Stream> m_pPDFStream;
- CFX_ByteString m_sImageAlias;
-};
-
-class CPWL_Icon : public CPWL_Image {
+class CPWL_Icon : public CPWL_Wnd {
public:
CPWL_Icon();
~CPWL_Icon() override;
- CPDF_IconFit* GetIconFit() const;
+ void SetIconFit(CPDF_IconFit* pIconFit) { m_pIconFit = pIconFit; }
+ void SetPDFStream(CPDF_Stream* pStream) { m_pPDFStream = pStream; }
- // CPWL_Image
- void GetScale(float& fHScale, float& fVScale) override;
- void GetImageOffset(float& x, float& y) override;
+ // horizontal scale, vertical scale
+ std::pair<float, float> GetScale();
- int32_t GetScaleMethod();
- bool IsProportionalScale();
- void GetIconPosition(float& fLeft, float& fBottom);
+ // x, y
+ std::pair<float, float> GetImageOffset();
- void SetIconFit(CPDF_IconFit* pIconFit) { m_pIconFit = pIconFit; }
+ CFX_Matrix GetImageMatrix();
+ CFX_ByteString GetImageAlias();
private:
+ // left, bottom
+ std::pair<float, float> GetIconPosition();
+
+ // width, height
+ std::pair<float, float> GetImageSize();
+
+ CFX_UnownedPtr<CPDF_Stream> m_pPDFStream;
CFX_UnownedPtr<CPDF_IconFit> m_pIconFit;
};