|
|
A very simple pixmap cache for theme plugins. QPixmapCache is not used since it uses QString keys which are not needed. All the information we need can be encoded in a numeric key. Using QIntCache instead allows us to skip the string operations.
This class is mostly just inline methods that do bit operations on a key composed of the widget ID, width and/or height, and then calls QIntCache::find().
One other thing to note is that full, horizontal, and vertically scaled pixmaps are not used interchangeably. For example, if you insert a fully scaled pixmap that is 32x32 then request a horizontally scaled pixmap with a width of 32, they will not match. This is because a pixmap that has been inserted into the cache has already been scaled at some point and it is very likely the vertical height was not originally 32. Thus the pixmap will be wrong when drawn, even though the horizontal width matches.
enum |
The scale hints supported by the cache. Note that Tiled is not here since tiled pixmaps are kept only once in KThemeBase.
|
The constructor.
Parameters:
bool |
Inserts a new pixmap into the cache.
Parameters:
Returns: True if the insert was successful, false otherwise.
KThemePixmap* |
Returns a fully scaled pixmap.
Parameters:
Returns: True if a pixmap matching the width, height, and widget ID of the pixmap exists, NULL otherwise.
KThemePixmap* |
Returns a horizontally scaled pixmap.
Parameters:
Returns: True if a pixmap matching the width and widget ID of the pixmap exists, NULL otherwise.
KThemePixmap* |
Returns a vertically scaled pixmap.
Parameters:
Returns: True if a pixmap matching the height and widget ID of the pixmap exists, NULL otherwise.
void |
[protected slot]
QIntCache<KThemePixmap> |
[protected]
QTimer |
[protected]