Added on-demand image loading option to wxRTC.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2123,9 +2123,35 @@ public:
|
||||
|
||||
bool GetImagesEnabled() const { return m_enableImages; }
|
||||
|
||||
/**
|
||||
Set laying out flag
|
||||
*/
|
||||
|
||||
void SetLayingOut(bool b) { m_layingOut = b; }
|
||||
|
||||
/**
|
||||
Returns @true if laying out.
|
||||
*/
|
||||
|
||||
bool GetLayingOut() const { return m_layingOut; }
|
||||
|
||||
/**
|
||||
Enable or disable delayed image loading
|
||||
*/
|
||||
|
||||
void EnableDelayedImageLoading(bool b) { m_enableDelayedImageLoading = b; }
|
||||
|
||||
/**
|
||||
Returns @true if delayed image loading is enabled.
|
||||
*/
|
||||
|
||||
bool GetDelayedImageLoading() const { return m_enableDelayedImageLoading; }
|
||||
|
||||
wxRichTextBuffer* m_buffer;
|
||||
bool m_enableVirtualAttributes;
|
||||
bool m_enableImages;
|
||||
bool m_enableDelayedImageLoading;
|
||||
bool m_layingOut;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -4671,11 +4697,38 @@ public:
|
||||
/**
|
||||
Creates a cached image at the required size.
|
||||
*/
|
||||
virtual bool LoadImageCache(wxDC& dc, wxRichTextDrawingContext& context, bool resetCache = false, const wxSize& parentSize = wxDefaultSize);
|
||||
virtual bool LoadImageCache(wxDC& dc, wxRichTextDrawingContext& context, wxSize& retImageSize, bool resetCache = false, const wxSize& parentSize = wxDefaultSize);
|
||||
|
||||
/**
|
||||
Do the loading and scaling
|
||||
*/
|
||||
virtual bool LoadAndScaleImageCache(wxImage& image, const wxSize& sz, bool delayLoading, bool& changed);
|
||||
|
||||
/**
|
||||
Gets the original image size.
|
||||
*/
|
||||
wxSize GetOriginalImageSize() const { return m_originalImageSize; }
|
||||
|
||||
/**
|
||||
Sets the original image size.
|
||||
*/
|
||||
void SetOriginalImageSize(const wxSize& sz) { m_originalImageSize = sz; }
|
||||
|
||||
/**
|
||||
Gets the image state.
|
||||
*/
|
||||
int GetImageState() const { return m_imageState; }
|
||||
|
||||
/**
|
||||
Sets the image state.
|
||||
*/
|
||||
void SetImageState(int state) { m_imageState = state; }
|
||||
|
||||
protected:
|
||||
wxRichTextImageBlock m_imageBlock;
|
||||
wxBitmap m_imageCache;
|
||||
wxSize m_originalImageSize;
|
||||
int m_imageState;
|
||||
};
|
||||
|
||||
class wxRichTextCommand;
|
||||
|
Reference in New Issue
Block a user