Dillo
|
The central class for managing and drawing a widget tree. More...
#include <layout.hh>
Classes | |
class | Anchor |
class | Emitter |
class | LayoutImgRenderer |
class | LinkEmitter |
class | LinkReceiver |
class | Receiver |
Receiver interface different signals. More... | |
Public Member Functions | |
Layout (Platform *platform) | |
~Layout () | |
void | connectLink (LinkReceiver *receiver) |
bool | emitLinkEnter (Widget *w, int link, int img, int x, int y) |
bool | emitLinkPress (Widget *w, int link, int img, int x, int y, EventButton *event) |
bool | emitLinkRelease (Widget *w, int link, int img, int x, int y, EventButton *event) |
bool | emitLinkClick (Widget *w, int link, int img, int x, int y, EventButton *event) |
void | addWidget (Widget *widget) |
void | setWidget (Widget *widget) |
void | attachView (View *view) |
Attach a view to the layout. More... | |
void | detachView (View *view) |
bool | getUsesViewport () |
int | getWidthViewport () |
int | getHeightViewport () |
int | getScrollPosX () |
int | getScrollPosY () |
void | scrollTo (HPosition hpos, VPosition vpos, int x, int y, int width, int height) |
Scrolls all viewports, so that the region [x, y, width, height] is seen, according to hpos and vpos. More... | |
void | scroll (ScrollCommand) |
void | setAnchor (const char *anchor) |
void | expose (View *view, Rectangle *area) |
bool | buttonPress (View *view, int numPressed, int x, int y, ButtonState state, int button) |
This function is called by a view, to delegate a button press event. More... | |
void | containerSizeChanged () |
bool | buttonRelease (View *view, int numPressed, int x, int y, ButtonState state, int button) |
This function is called by a view, to delegate a button press event. More... | |
bool | motionNotify (View *view, int x, int y, ButtonState state) |
This function is called by a view, to delegate a motion notify event. More... | |
void | enterNotify (View *view, int x, int y, ButtonState state) |
This function is called by a view, to delegate a enter notify event. More... | |
void | leaveNotify (View *view, ButtonState state) |
This function is called by a view, to delegate a leave notify event. More... | |
void | scrollPosChanged (View *view, int x, int y) |
void | viewportSizeChanged (View *view, int width, int height) |
Platform * | getPlatform () |
int | textWidth (style::Font *font, const char *text, int len) |
char * | textToUpper (const char *text, int len) |
char * | textToLower (const char *text, int len) |
int | nextGlyph (const char *text, int idx) |
int | prevGlyph (const char *text, int idx) |
float | dpiX () |
float | dpiY () |
style::Font * | createFont (style::FontAttrs *attrs, bool tryEverything) |
bool | fontExists (const char *name) |
style::Color * | createColor (int color) |
style::Tooltip * | createTooltip (const char *text) |
void | cancelTooltip () |
Imgbuf * | createImgbuf (Imgbuf::Type type, int width, int height, double gamma) |
void | copySelection (const char *text) |
ui::ResourceFactory * | getResourceFactory () |
void | connect (Receiver *receiver) |
FindtextState::Result | search (const char *str, bool caseSens, int backwards) |
See dw::core::FindtextState::search. More... | |
void | resetSearch () |
See dw::core::FindtextState::resetSearch. More... | |
void | setBgColor (style::Color *color) |
void | setBgImage (style::StyleImage *bgImage, style::BackgroundRepeat bgRepeat, style::BackgroundAttachment bgAttachment, style::Length bgPositionX, style::Length bgPositionY) |
style::Color * | getBgColor () |
style::StyleImage * | getBgImage () |
Public Member Functions inherited from lout::object::Object | |
virtual | ~Object () |
The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More... | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. More... | |
virtual int | hashValue () |
Return a hash value for the object. More... | |
virtual Object * | clone () |
Return an exact copy of the object. More... | |
virtual void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. More... | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. More... | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. More... | |
Public Attributes | |
LinkEmitter | linkEmitter |
lout::misc::ZoneAllocator * | textZone |
Private Types | |
enum | ButtonEventType { BUTTON_PRESS, BUTTON_RELEASE, MOTION_NOTIFY } |
Private Member Functions | |
void | detachWidget (Widget *widget) |
Widget * | getWidgetAtPoint (int x, int y) |
void | moveToWidget (Widget *newWidgetAtPoint, ButtonState state) |
void | moveToWidgetAtPoint (int x, int y, ButtonState state) |
Emit the necessary crossing events, when the mouse pointer has moved to position (x, );. More... | |
void | moveOutOfView (ButtonState state) |
Emit the necessary crossing events, when the mouse pointer has moved out of the view. More... | |
bool | processMouseEvent (MousePositionEvent *event, ButtonEventType type) |
Common processing of press, release and motion events. More... | |
bool | buttonEvent (ButtonEventType type, View *view, int numPressed, int x, int y, ButtonState state, int button) |
void | resizeIdle () |
void | setSizeHints () |
void | draw (View *view, Rectangle *area) |
void | scrollTo0 (HPosition hpos, VPosition vpos, int x, int y, int width, int height, bool scrollingInterrupted) |
void | scrollIdle () |
void | adjustScrollPos () |
int | currHScrollbarThickness () |
int | currVScrollbarThickness () |
void | updateAnchor () |
char * | addAnchor (Widget *widget, const char *name) |
char * | addAnchor (Widget *widget, const char *name, int y) |
void | changeAnchor (Widget *widget, char *name, int y) |
void | removeAnchor (Widget *widget, char *name) |
void | setCursor (style::Cursor cursor) |
void | updateCursor () |
void | queueDraw (int x, int y, int width, int height) |
void | queueDrawExcept (int x, int y, int width, int height, int ex, int ey, int ewidth, int eheight) |
void | queueResize (bool extremesChanged) |
void | removeWidget () |
void | enterResizeIdle () |
void | leaveResizeIdle () |
Static Private Member Functions | |
static bool | calcScrollInto (int targetValue, int requestedSize, int *value, int viewportSize) |
Friends | |
class | Widget |
The central class for managing and drawing a widget tree.
|
private |
dw::core::Layout::Layout | ( | Platform * | platform | ) |
dw::core::Layout::~Layout | ( | ) |
References DBG_OBJ_DELETE, and platform.
|
private |
Used, when the widget is not allocated yet.
Referenced by dw::core::Widget::addAnchor().
|
private |
void dw::core::Layout::addWidget | ( | Widget * | widget | ) |
|
private |
References lout::misc::max(), and lout::misc::min().
void dw::core::Layout::attachView | ( | View * | view | ) |
Attach a view to the layout.
It will become a child of the layout, and so it will be destroyed, when the layout will be destroyed.
References DBG_OBJ_ASSOC_CHILD, DBG_OBJ_SET_NUM, dw::core::View::getHScrollbarThickness(), dw::core::View::getVScrollbarThickness(), lout::misc::max(), platform, dw::core::View::scrollTo(), dw::core::View::setBgColor(), dw::core::View::setCanvasSize(), dw::core::View::setCursor(), dw::core::View::setLayout(), dw::core::View::setViewportSize(), and dw::core::View::usesViewport().
Referenced by dw::fltk::ui::FltkComplexButtonResource::createNewWidget(), dw::fltk::FltkPreview::FltkPreview(), main(), and dw::fltk::ui::FltkComplexButtonResource::setLayout().
|
private |
Referenced by buttonPress(), and buttonRelease().
|
inline |
This function is called by a view, to delegate a button press event.
numPressed is 1 for simple presses, 2 for double presses etc. (more that 2 is never needed), x and y the world coordinates, and button the number of the button pressed.
References BUTTON_PRESS, and buttonEvent().
Referenced by dw::fltk::FltkViewBase::handle().
|
inline |
This function is called by a view, to delegate a button press event.
Arguments are similar to dw::core::Layout::buttonPress.
References BUTTON_RELEASE, and buttonEvent().
Referenced by dw::fltk::FltkViewBase::handle().
|
staticprivate |
|
inline |
References dw::core::Platform::cancelTooltip().
Referenced by dw::fltk::FltkViewBase::handle().
|
private |
References dw::core::Layout::Anchor::widget, and dw::core::Layout::Anchor::y.
Referenced by dw::core::Widget::changeAnchor().
|
inline |
References dw::core::Layout::Emitter::connectLayout().
|
inline |
References dw::core::Layout::LinkEmitter::connectLink().
Referenced by main().
void dw::core::Layout::containerSizeChanged | ( | ) |
References DBG_OBJ_ENTER0, and DBG_OBJ_LEAVE.
|
inline |
References dw::core::Platform::copySelection().
|
inline |
References dw::core::Platform::createColor().
Referenced by dw::core::style::Color::create().
|
inline |
References dw::core::Platform::createFont().
Referenced by dw::core::style::Font::create0().
|
inline |
References dw::core::Platform::createImgbuf().
Referenced by imageInitTimeout(), solution1(), solution2(), and solution3().
|
inline |
References dw::core::Platform::createTooltip().
Referenced by dw::core::style::Tooltip::create().
|
private |
|
private |
void dw::core::Layout::detachView | ( | View * | view | ) |
References platform, and dw::core::View::setLayout().
|
private |
|
inline |
References dw::core::Platform::dpiX().
|
inline |
References dw::core::Platform::dpiY().
References DBG_OBJ_ENTER, DBG_OBJ_LEAVE, dw::core::style::drawBackgroundImage(), dw::core::View::finishDrawing(), dw::core::Rectangle::height, dw::core::Rectangle::intersectsWith(), lout::misc::max(), dw::core::View::startDrawing(), dw::core::Rectangle::width, dw::core::Rectangle::x, and dw::core::Rectangle::y.
Referenced by expose().
|
inline |
References dw::core::Layout::LinkEmitter::emitClick().
|
inline |
References dw::core::Layout::LinkEmitter::emitEnter().
|
inline |
References dw::core::Layout::LinkEmitter::emitPress().
|
inline |
References dw::core::Layout::LinkEmitter::emitRelease().
void dw::core::Layout::enterNotify | ( | View * | view, |
int | x, | ||
int | y, | ||
ButtonState | state | ||
) |
This function is called by a view, to delegate a enter notify event.
Arguments are similar to dw::core::Layout::buttonPress.
References dw::core::Widget::enterNotify().
Referenced by dw::fltk::FltkViewBase::handle().
|
inlineprivate |
References DBG_OBJ_ENTER, DBG_OBJ_LEAVE, draw(), dw::core::Rectangle::height, dw::core::Rectangle::width, dw::core::Rectangle::x, and dw::core::Rectangle::y.
Referenced by dw::fltk::FltkViewBase::draw().
|
inline |
References dw::core::Platform::fontExists().
Referenced by dw::core::style::Font::exists().
|
inline |
References bgColor.
Referenced by dw::core::style::drawBackground().
|
inline |
References bgImage.
Referenced by dw::core::style::drawBackground().
|
inline |
References viewportHeight.
Referenced by dw::core::Iterator::scrollTo().
|
inline |
References dw::core::Platform::getResourceFactory().
Referenced by main().
|
inline |
References scrollX.
|
inline |
References scrollY.
|
inline |
References usesViewport.
Referenced by dw::core::Iterator::scrollTo().
|
private |
References DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_MSGF, and dw::core::Widget::getWidgetAtPoint().
Referenced by moveToWidgetAtPoint().
|
inline |
References viewportWidth.
Referenced by dw::core::Iterator::scrollTo().
void dw::core::Layout::leaveNotify | ( | View * | view, |
ButtonState | state | ||
) |
This function is called by a view, to delegate a leave notify event.
Arguments are similar to dw::core::Layout::buttonPress.
References dw::core::Widget::leaveNotify().
Referenced by dw::fltk::FltkViewBase::handle().
|
inlineprivate |
bool dw::core::Layout::motionNotify | ( | View * | view, |
int | x, | ||
int | y, | ||
ButtonState | state | ||
) |
This function is called by a view, to delegate a motion notify event.
Arguments are similar to dw::core::Layout::buttonPress.
Referenced by dw::fltk::FltkViewBase::handle(), and dw::fltk::FltkViewport::positionChanged().
|
inlineprivate |
Emit the necessary crossing events, when the mouse pointer has moved out of the view.
References moveToWidget().
|
private |
References dw::core::EventCrossing::currentWidget, DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_MSGF, dw::core::Widget::enterNotify(), dw::core::Widget::getNearestCommonAncestor(), dw::core::Widget::getParent(), dw::core::Widget::getTopLevel(), dw::core::EventCrossing::lastWidget, dw::core::Widget::leaveNotify(), and dw::core::MouseEvent::state.
Referenced by moveOutOfView(), and moveToWidgetAtPoint().
|
inlineprivate |
Emit the necessary crossing events, when the mouse pointer has moved to position (x, );.
References getWidgetAtPoint(), and moveToWidget().
|
inline |
References dw::core::Platform::nextGlyph().
Referenced by dw::fltk::FltkWidgetView::drawText().
|
inline |
References dw::core::Platform::prevGlyph().
|
private |
Common processing of press, release and motion events.
This function depends on that move_to_widget_at_point() has been called before.
References lout::misc::assertNotReached(), dw::core::Widget::buttonPress(), dw::core::Widget::buttonRelease(), dw::core::Widget::getAllocation(), dw::core::Widget::getParent(), dw::core::Widget::isButtonSensitive(), lout::misc::min(), dw::core::Widget::motionNotify(), dw::core::Allocation::x, dw::core::MousePositionEvent::xCanvas, dw::core::Allocation::y, and dw::core::MousePositionEvent::yCanvas.
|
private |
|
private |
References lout::misc::max(), and lout::misc::min().
|
private |
References DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_MSGF, and platform.
|
private |
Referenced by dw::core::Widget::removeAnchor().
|
private |
|
inline |
See dw::core::FindtextState::resetSearch.
References dw::core::FindtextState::resetSearch().
Referenced by resetCallback().
|
private |
References dw::core::Widget::allocateQueued(), dw::core::Allocation::ascent, dw::core::Requisition::ascent, DBG_OBJ_ENTER0, DBG_OBJ_LEAVE, DBG_OBJ_MSGF, DBG_OBJ_SET_SYM, dw::core::Allocation::descent, dw::core::Requisition::descent, dw::core::Widget::extremesQueued(), lout::container::typed::Iterator< T >::hasNext(), dw::core::Widget::resizeQueued(), dw::core::Widget::setFlags(), dw::core::Widget::unsetFlags(), dw::core::Allocation::width, dw::core::Requisition::width, dw::core::Allocation::x, and dw::core::Allocation::y.
void dw::core::Layout::scroll | ( | ScrollCommand | cmd | ) |
References dw::core::View::scroll().
|
private |
void dw::core::Layout::scrollPosChanged | ( | View * | view, |
int | x, | ||
int | y | ||
) |
Referenced by dw::fltk::FltkViewport::scrollTo(), and dw::fltk::FltkPreviewWindow::scrollTo().
void dw::core::Layout::scrollTo | ( | HPosition | hpos, |
VPosition | vpos, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Scrolls all viewports, so that the region [x, y, width, height] is seen, according to hpos and vpos.
Referenced by dw::fltk::FltkViewBase::manageTabToFocus(), and dw::core::Iterator::scrollTo().
|
private |
References platform.
|
inline |
See dw::core::FindtextState::search.
References dw::core::FindtextState::search().
Referenced by findCallback().
void dw::core::Layout::setAnchor | ( | const char * | anchor | ) |
Sets the anchor to scroll to.
Referenced by anchorCallback().
void dw::core::Layout::setBgColor | ( | style::Color * | color | ) |
References dw::core::style::Color::ref().
void dw::core::Layout::setBgImage | ( | style::StyleImage * | bgImage, |
style::BackgroundRepeat | bgRepeat, | ||
style::BackgroundAttachment | bgAttachment, | ||
style::Length | bgPositionX, | ||
style::Length | bgPositionY | ||
) |
|
private |
Referenced by dw::core::Widget::setCursor().
|
private |
void dw::core::Layout::setWidget | ( | Widget * | widget | ) |
References DBG_OBJ_ASSOC_CHILD.
Referenced by main(), and textTimeout().
|
inline |
References dw::core::Platform::textToLower().
|
inline |
References dw::core::Platform::textToUpper().
|
inline |
References dw::core::Platform::textWidth().
Referenced by dw::AlignedTableCell::getValue().
|
private |
References dw::core::HPOS_NO_CHANGE, platform, dw::core::VPOS_TOP, and dw::core::Layout::Anchor::y.
|
private |
References dw::core::style::CURSOR_DEFAULT.
void dw::core::Layout::viewportSizeChanged | ( | View * | view, |
int | width, | ||
int | height | ||
) |
References DBG_OBJ_ENTER, DBG_OBJ_LEAVE, DBG_OBJ_SET_NUM, and DBG_OBJ_SET_SYM.
Referenced by dw::fltk::FltkViewport::resize(), and dw::fltk::FltkViewBase::setLayout().
|
friend |
|
private |
|
private |
|
private |
Referenced by getBgColor().
|
private |
Referenced by getBgImage().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
LinkEmitter dw::core::Layout::linkEmitter |
|
private |
Referenced by getPlatform().
|
private |
|
private |
|
private |
|
private |
Referenced by dw::core::Widget::resizeIdleEntered().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by getScrollPosX().
|
private |
Referenced by getScrollPosY().
|
private |
Referenced by dw::core::Widget::selectionHandleEvent().
|
private |
|
private |
lout::misc::ZoneAllocator* dw::core::Layout::textZone |
|
private |
|
private |
Referenced by getUsesViewport().
|
private |
|
private |
Referenced by getHeightViewport().
|
private |
Referenced by getWidthViewport().
|
private |
|
private |