KStyles
Keramik::ScrollBarPainter Class Reference
#include <pixmaploader.h>

Public Member Functions | |
ScrollBarPainter (int type, int count, bool horizontal) | |
virtual | ~ScrollBarPainter () |
Static Public Member Functions | |
static int | name (bool horizontal) |
Protected Member Functions | |
virtual int | tileName (unsigned int column, unsigned int row) const |
Detailed Description
Definition at line 331 of file pixmaploader.h.
Constructor & Destructor Documentation
ScrollBarPainter::ScrollBarPainter | ( | int | type, | |
int | count, | |||
bool | horizontal | |||
) |
Definition at line 585 of file pixmaploader.cpp.
virtual Keramik::ScrollBarPainter::~ScrollBarPainter | ( | ) | [inline, virtual] |
Definition at line 335 of file pixmaploader.h.
Member Function Documentation
int ScrollBarPainter::name | ( | bool | horizontal | ) | [static] |
Definition at line 607 of file pixmaploader.cpp.
int ScrollBarPainter::tileName | ( | unsigned int | , | |
unsigned int | ||||
) | const [protected, virtual] |
The idea behind all this stuff is that for performance reasons, we want to use only integers to refer to widgets.
So we give each widget a base ID that's divisible by 256, and have all the various tiles be referred to as that ID + some small number.
genembed generates and assigns the base widget IDs, and maps various pixmaps suffixes into the adjustment numbers; using that info it writes out the tables mapping the IDs to pixmaps, and keramikrc.h, which provides nice symbolic constants for base IDs.
When painting, however, we essentially represent the widget as a table, providing fixed/tiled/stretched modes for each column and row. So to draw the widget knowing its base ID, we need to know how many rows and columns there, what the scaling modes are, and how to get to each of the tiles -- i.e. the tiles' offset from the base ID.
The various painter subclasses simply fill in most of that info into the members here during their construction, and implement the virtual tileName to get the offsets.
Note that the IDs and offsets are separated since we can reuse the same code in many cases by splitting the widget identify from tile identity (as there are many different widgets that have the same or similar tile layout)
Reimplemented from Keramik::TilePainter.
Definition at line 612 of file pixmaploader.cpp.
The documentation for this class was generated from the following files: