summaryrefslogtreecommitdiff
path: root/libreofficekit/source/gtk/tilebuffer.hxx
diff options
context:
space:
mode:
authorPranav Kant <pranavk@gnome.org>2015-07-19 01:03:56 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-07-28 15:04:14 +0200
commit4edbf5a01fb8d93f3e6f2b9f7100a0c3d2eafa6e (patch)
tree14a19e86c40ea1f116a6ae50a55a8ff609f941da /libreofficekit/source/gtk/tilebuffer.hxx
parenta433ea9f46cc1cc0de7282f3d360d70ad215aaa8 (diff)
lokdocview: Make paintTile() async
Change-Id: I57db9e3adf26996e6e1e105b8b95f53e88e7760f
Diffstat (limited to 'libreofficekit/source/gtk/tilebuffer.hxx')
-rw-r--r--libreofficekit/source/gtk/tilebuffer.hxx28
1 files changed, 24 insertions, 4 deletions
diff --git a/libreofficekit/source/gtk/tilebuffer.hxx b/libreofficekit/source/gtk/tilebuffer.hxx
index 6e6c0beb48f3..50de72d9d3b9 100644
--- a/libreofficekit/source/gtk/tilebuffer.hxx
+++ b/libreofficekit/source/gtk/tilebuffer.hxx
@@ -86,7 +86,10 @@ class TileBuffer
int columns)
: m_pLOKDocument(document)
, m_nWidth(columns)
- { }
+ {
+ GdkPixbuf* pPixBuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, nTileSizePixels, nTileSizePixels);
+ m_DummyTile.setPixbuf(pPixBuf);
+ }
~TileBuffer() {}
@@ -104,7 +107,7 @@ class TileBuffer
@return the tile at the mentioned position (x, y)
*/
- Tile& getTile(int x, int y, float aZoom);
+ Tile& getTile(int x, int y, float aZoom, GTask*);
/// Destroys all the tiles in the tile buffer; also frees the memory allocated
/// for all the Tile objects.
void resetAllTiles();
@@ -115,17 +118,34 @@ class TileBuffer
@param x the position of tile along x-axis
@param y the position of tile along y-axis
*/
- void setInvalid(int x, int y);
+ void setInvalid(int x, int y, float zoom);
+
- private:
/// Contains the reference to the LOK Document that this tile buffer is for.
LibreOfficeKitDocument *m_pLOKDocument;
/// Stores all the tiles cached by this tile buffer.
std::map<int, Tile> m_mTiles;
/// Width of the current tile buffer (number of columns)
int m_nWidth;
+ /// Dummy tile
+ Tile m_DummyTile;
};
+struct GetTileCallbackData
+{
+ int m_nX;
+ int m_nY;
+ float m_fZoom;
+ TileBuffer* m_pBuffer;
+
+ GetTileCallbackData(int x, int y, float zoom, TileBuffer* buffer)
+ : m_nX(x),
+ m_nY(y),
+ m_fZoom(zoom),
+ m_pBuffer(buffer) { }
+};
+
+
#endif // INCLUDED_TILEBUFFER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */