mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #10: Remove too old pages from cache
This commit is contained in:
@ -30,6 +30,7 @@
|
||||
|
||||
class QPainter;
|
||||
class QScrollBar;
|
||||
class QTimer;
|
||||
|
||||
namespace pdf
|
||||
{
|
||||
@ -307,6 +308,9 @@ public:
|
||||
/// \param rect Rectangle to test
|
||||
std::vector<PDFInteger> getPagesIntersectingRect(QRect rect) const;
|
||||
|
||||
/// Returns sorted vector of page indices, which should remain in the cache
|
||||
std::vector<PDFInteger> getActivePages() const;
|
||||
|
||||
/// Returns page, under which is point. If no page is under the point,
|
||||
/// then -1 is returned. Point is in widget coordinates. If \p pagePoint
|
||||
/// is not nullptr, then point in page coordinate space is set here.
|
||||
@ -431,9 +435,14 @@ private:
|
||||
static constexpr PDFReal MIN_ZOOM = 8.0 / 100.0;
|
||||
static constexpr PDFReal MAX_ZOOM = 6400.0 / 100.0;
|
||||
|
||||
static constexpr qint64 CACHE_CLEAR_TIMEOUT = 5000;
|
||||
static constexpr qint64 CACHE_PAGE_EXPIRATION_TIMEOUT = 30000;
|
||||
|
||||
/// Converts rectangle from device space to the pixel space
|
||||
QRectF fromDeviceSpace(const QRectF& rect) const;
|
||||
|
||||
void performPageCacheClear();
|
||||
|
||||
void onTextLayoutChanged();
|
||||
void onOptionalContentGroupStateChanged();
|
||||
void onColorManagementSystemChanged();
|
||||
@ -529,6 +538,9 @@ private:
|
||||
/// Progress
|
||||
PDFProgress* m_progress;
|
||||
|
||||
/// Cache clear timer
|
||||
QTimer* m_cacheClearTimer;
|
||||
|
||||
/// Additional drawing interfaces
|
||||
std::set<IDocumentDrawInterface*> m_drawInterfaces;
|
||||
|
||||
|
Reference in New Issue
Block a user