2012-07-11 00:48:30 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2012 by Mailson Menezes <mailson@gmail.com> *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2012-07-07 17:40:52 +00:00
|
|
|
#ifndef _OKULAR_TILES_MANAGER_H_
|
|
|
|
#define _OKULAR_TILES_MANAGER_H_
|
|
|
|
|
|
|
|
#include "okular_export.h"
|
|
|
|
#include "area.h"
|
|
|
|
|
|
|
|
class QPixmap;
|
|
|
|
|
|
|
|
namespace Okular {
|
|
|
|
|
2012-07-11 05:14:50 +00:00
|
|
|
class OKULAR_EXPORT Tile
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Tile();
|
|
|
|
|
|
|
|
bool isValid() const;
|
|
|
|
|
|
|
|
NormalizedRect rect;
|
|
|
|
QPixmap *pixmap;
|
|
|
|
uint dirty : 1;
|
|
|
|
};
|
2012-07-07 17:40:52 +00:00
|
|
|
|
|
|
|
class OKULAR_EXPORT TilesManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TilesManager( int width, int height );
|
|
|
|
virtual ~TilesManager();
|
|
|
|
|
|
|
|
void setPixmap( QPixmap *pixmap, const NormalizedRect &rect );
|
|
|
|
bool hasPixmap( const NormalizedRect &rect );
|
2012-07-11 05:14:50 +00:00
|
|
|
QList<Tile> tilesAt( const NormalizedRect &rect ) const;
|
2012-07-07 17:40:52 +00:00
|
|
|
|
2012-07-11 05:14:50 +00:00
|
|
|
inline int width() const { return m_width; }
|
|
|
|
void setWidth( int width );
|
|
|
|
inline int height() const { return m_height; }
|
|
|
|
void setHeight( int height );
|
2012-07-07 17:40:52 +00:00
|
|
|
|
|
|
|
private:
|
2012-07-11 05:14:50 +00:00
|
|
|
Tile m_tiles[16];
|
|
|
|
int m_width;
|
|
|
|
int m_height;
|
2012-07-07 17:40:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // _OKULAR_TILES_MANAGER_H_
|