|
#include <CWindowShape.h>

Public Member Functions | |
| CWindowShape (sptk::CWindow *window) | |
| Constructor. | |
| virtual | ~CWindowShape () |
| Destructor. | |
| bool | shapeResizing () |
| Returns true if the window is resizing as a result of border drag. | |
Protected Member Functions | |
| int | mouseZone (int mouseX, int mouseY) const |
| Computes mouse zone from window coordinates. | |
| void | changeSize (int mouseX, int mouseY) |
| Resizes the window based on mouse zone and mouse screen coordinates. | |
| virtual int | shapeCursorHandle (int event) |
| Changes the window cursor based on the mouse position in the window. | |
| void | initShapeExtension () |
| Initializes shape extension. | |
| bool | borderCleared () const |
| Returns true if border was cleared for the shape. | |
| void | shapeApply () |
| Sets the shape to the window during window->draw(). | |
| void | resizingShape (int w, int h) |
| Calls resizeShape() from inside CWindow::resize(). | |
| virtual void | shapeResize (int w, int h) |
| Shape resize. | |
Protected Attributes | |
| sptk::CWindow * | m_window |
| Window to change shape. | |
| int | m_resizingZone |
| Resizing mouse zone where mouse was pushed. | |
| int | m_lastW |
| Last window width during the shape generation. | |
| int | m_lastH |
| Last window height during the shape generation. | |
| int | m_pushedX |
| X coordinate of the last FL_PUSH event. | |
| int | m_pushedY |
| Y coordinate of the last FL_PUSH event. | |
| std::vector< CShapePoint > | m_shapePoints |
| Vector of points defining window shape. | |
| bool | m_shapeChanged |
| Is the shape size changed? | |
| int | m_borderWidth |
| Shape border width, the default is 6. | |
| bool | m_borderCleared |
| Is no border flag set for the window? | |
| bool | m_shapeExtension |
| Is the shape extension activated? | |
Window shape is defined with the array of points that should be modified at every resize of the window. The derived window should modify the shape points array by ovewriting shapeResize() method. The window resize support is activated only if window resizable() is true.
| sptk::CWindowShape::CWindowShape | ( | sptk::CWindow * | window | ) |
| void sptk::CWindowShape::changeSize | ( | int | mouseX, | |
| int | mouseY | |||
| ) | [protected] |
Resizes the window based on mouse zone and mouse screen coordinates.
| mouseX | int, mouse x-coordinate in the screen | |
| mouseY | int, mouse y-coordinate in the screen |
| void sptk::CWindowShape::initShapeExtension | ( | ) | [protected] |
Initializes shape extension.
Allows window to use shape extension. Should be called before the window is first shown.
| int sptk::CWindowShape::mouseZone | ( | int | mouseX, | |
| int | mouseY | |||
| ) | const [protected] |
Computes mouse zone from window coordinates.
| mouseX | int, mouse x-coordinate in the window | |
| mouseY | int, mouse y-coordinate in the window |
| virtual int sptk::CWindowShape::shapeCursorHandle | ( | int | event | ) | [protected, virtual] |
Changes the window cursor based on the mouse position in the window.
Designed to emulate cursor changes on the window border for shaped windows. Should be uncoditionally called inside handle() for the window.
| virtual void sptk::CWindowShape::shapeResize | ( | int | w, | |
| int | h | |||
| ) | [inline, protected, virtual] |
Shape resize.
This method should be overwritten in the derived class to adapt m_shapePoints[] to the window size.
Referenced by resizingShape().
| bool sptk::CWindowShape::shapeResizing | ( | ) | [inline] |
Returns true if the window is resizing as a result of border drag.
Can be used to simplified drawing during the resize
References m_resizingZone.