1 #ifndef __DW_LAYOUT_HH__
2 #define __DW_LAYOUT_HH__
4 #ifndef __INCLUDED_FROM_DW_CORE_HH__
5 # error Do not include this file directly, use "core.hh" instead.
29 void getBgArea (
int *x,
int *y,
int *width,
int *height);
30 void getRefArea (
int *xRef,
int *yRef,
int *widthRef,
int *heightRef);
36 void draw (
int x,
int y,
int width,
int height);
68 virtual bool enter (
Widget *widget,
int link,
int img,
int x,
int y);
76 virtual bool press (
Widget *widget,
int link,
int img,
int x,
int y,
85 virtual bool release (
Widget *widget,
int link,
int img,
int x,
int y,
99 virtual bool click (
Widget *widget,
int link,
int img,
int x,
int y,
219 int x,
int y,
int width,
int height,
220 bool scrollingInterrupted);
224 int *value,
int viewportSize);
238 void queueDraw (
int x,
int y,
int width,
int height);
240 int ex,
int ey,
int ewidth,
int eheight);
262 {
return linkEmitter.
emitEnter (w, link, img, x, y); }
266 {
return linkEmitter.
emitPress (w, link, img, x, y, event); }
270 {
return linkEmitter.
emitRelease (w, link, img, x, y, event); }
274 {
return linkEmitter.
emitClick (w, link, img, x, y, event); }
293 int x,
int y,
int width,
int height);
351 return platform->
textWidth (font, text, len);
376 return platform->
dpiX ();
381 return platform->
dpiY ();
386 return platform->
createFont (attrs, tryEverything);
412 return platform->
createImgbuf (type, width, height, gamma);
431 {
return findtextState.
search (str, caseSens, backwards); }
449 #endif // __DW_LAYOUT_HH__
int canvasDescent
Definition: layout.hh:168
Cursor
Definition: style.hh:200
bool drawAfterScrollReq
Definition: layout.hh:170
int canvasAscent
Definition: layout.hh:168
char * name
Definition: layout.hh:148
void detachWidget(Widget *widget)
Definition: layout.cc:348
style::Color * createColor(int color)
Definition: layout.hh:394
void containerSizeChanged()
Definition: layout.cc:1329
View * view
Definition: layout.hh:156
bool getUsesViewport()
Definition: layout.hh:284
Typed version of container::untyped::Vector.
Definition: container.hh:425
int hScrollbarThickness
Definition: layout.hh:173
virtual bool release(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has released the mouse button on a link.
Definition: layout.cc:157
ui::ResourceFactory * getResourceFactory()
Definition: layout.hh:420
void removeAnchor(Widget *widget, char *name)
Definition: layout.cc:775
int scrollIdleId
Definition: layout.hh:180
SelectionState selectionState
Definition: layout.hh:187
void connect(Receiver *receiver)
Connect a receiver to the emitter.
Definition: signal.cc:65
A factory for the common resource.
Definition: ui.hh:580
Typed version of container::untyped::HashTable.
Definition: container.hh:514
int nextGlyph(const char *text, int idx)
Definition: layout.hh:364
bool canvasHeightGreater
Definition: layout.hh:172
HPosition scrollTargetHpos
Definition: layout.hh:175
Widget * getWidgetAtPoint(int x, int y)
Definition: layout.cc:1105
void enterNotify(View *view, int x, int y, ButtonState state)
This function is called by a view, to delegate a enter notify event.
Definition: layout.cc:1061
void setAnchor(const char *anchor)
Definition: layout.cc:729
dw::core::Shape implemtation for simple rectangles.
Definition: types.hh:69
This class handles selections, as well as activation of links, which is closely related.
Definition: selection.hh:178
Definition: layout.hh:190
style::Length getBackgroundPositionX()
Definition: layout.cc:77
style::Color * bgColor
Definition: layout.hh:161
style::Font * createFont(style::FontAttrs *attrs, bool tryEverything)
Definition: layout.hh:384
VPosition scrollTargetVpos
Definition: layout.hh:176
char * requestedAnchor
Definition: layout.hh:179
bool processMouseEvent(MousePositionEvent *event, ButtonEventType type)
Common processing of press, release and motion events.
Definition: layout.cc:1217
void moveOutOfView(ButtonState state)
Emit the necessary crossing events, when the mouse pointer has moved out of the view.
Definition: layout.hh:208
void emitCanvasSizeChanged(int width, int ascent, int descent)
Definition: layout.cc:135
int queueResizeCounter
Definition: layout.hh:248
style::Length getBackgroundPositionY()
Definition: layout.cc:82
~Anchor()
Definition: layout.cc:249
int viewportHeight
Definition: layout.hh:171
LayoutImgRenderer * layoutImgRenderer
Definition: layout.hh:39
void moveToWidgetAtPoint(int x, int y, ButtonState state)
Emit the necessary crossing events, when the mouse pointer has moved to position (x, );.
Definition: layout.hh:201
char * textToLower(const char *text, int len)
Definition: layout.hh:359
The central class for managing and drawing a widget tree.
Definition: layout.hh:16
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...
Definition: layout.cc:530
void emitResizeQueued(bool extremesChanged)
Definition: layout.cc:128
This is the base class for many other classes, which defines very common virtual methods.
Definition: object.hh:24
void scrollIdle()
Definition: layout.cc:561
void scrollPosChanged(View *view, int x, int y)
Definition: layout.cc:1280
int getExtremesCounter
Definition: layout.hh:248
float dpiY()
Definition: layout.hh:379
int scrollY
Definition: layout.hh:171
int scrollTargetWidth
Definition: layout.hh:177
Definition: layout.hh:145
int x
Definition: types.hh:72
int scrollTargetY
Definition: layout.hh:177
int sizeRequestCounter
Definition: layout.hh:248
Result search(const char *key, bool caseSens, bool backwards)
Definition: findtext.cc:74
A simple allocator optimized to handle many small chunks of memory. The chunks can not be free'd indi...
Definition: misc.hh:626
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.
Definition: layout.hh:328
style::Length bgPositionY
Definition: layout.hh:165
void leaveNotify(View *view, ButtonState state)
This function is called by a view, to delegate a leave notify event.
Definition: layout.cc:1082
void addWidget(Widget *widget)
Definition: layout.cc:368
void detachView(View *view)
Definition: layout.cc:504
int getHeightViewport()
Definition: layout.hh:286
void changeAnchor(Widget *widget, char *name, int y)
Definition: layout.cc:765
Receiver interface different signals.
Definition: layout.hh:47
ButtonState
Platform independent representation.
Definition: events.hh:14
void setCursor(style::Cursor cursor)
Definition: layout.cc:801
bool emitToReceiver(lout::signal::Receiver *receiver, int signalNo, int argc, lout::object::Object **argv)
A sub class must implement this for a call to a single receiver.
Definition: layout.cc:171
int getWidthViewport()
Definition: layout.hh:285
void moveToWidget(Widget *newWidgetAtPoint, ButtonState state)
Definition: layout.cc:1126
The base class for signal emitters.
Definition: signal.hh:212
Useful (but not mandatory) base class for updates of areas with background images.
Definition: style.hh:812
int sizeAllocateCounter
Definition: layout.hh:248
void removeWidget()
Definition: layout.cc:403
bool motionNotify(View *view, int x, int y, ButtonState state)
This function is called by a view, to delegate a motion notify event.
Definition: layout.cc:1043
Definition: layout.hh:130
int vScrollbarThickness
Definition: layout.hh:173
void resizeIdle()
Definition: layout.cc:861
BackgroundAttachment
Definition: style.hh:243
bool emitLinkRelease(Widget *w, int link, int img, int x, int y, EventButton *event)
Definition: layout.hh:268
Definition: layout.hh:190
Type
Definition: imgbuf.hh:164
bool emitRelease(Widget *widget, int link, int img, int x, int y, EventButton *event)
Definition: layout.cc:231
int getScrollPosY()
Definition: layout.hh:288
style::Color * getBgColor()
Definition: layout.hh:442
Definition: layout.hh:127
bool scrollIdleNotInterrupted
Definition: layout.hh:181
void queueDrawExcept(int x, int y, int width, int height, int ex, int ey, int ewidth, int eheight)
Definition: layout.cc:977
style::BackgroundAttachment getBackgroundAttachment()
Definition: layout.cc:72
style::StyleImage * bgImage
Definition: layout.hh:162
void connectLink(LinkReceiver *receiver)
Definition: layout.hh:258
#define DBG_OBJ_LEAVE()
Definition: debug_rtfl.hh:406
int scrollTargetX
Definition: layout.hh:177
Definition: layout.hh:103
int y
Definition: layout.hh:150
style::StyleImage * getBackgroundImage()
Definition: layout.cc:61
lout::misc::ZoneAllocator * textZone
Definition: layout.hh:276
Definition: layout.hh:106
float dpiX()
Definition: layout.hh:374
void updateAnchor()
Definition: layout.cc:781
void resetSearch()
See dw::core::FindtextState::resetSearch.
Definition: layout.hh:434
int currVScrollbarThickness()
Definition: layout.cc:720
HPosition
Definition: types.hh:15
Emitter emitter
Definition: layout.hh:143
void connect(Receiver *receiver)
Definition: layout.hh:425
VPosition
Definition: types.hh:25
void attachView(View *view)
Attach a view to the layout.
Definition: layout.cc:452
Widget * topLevel
Definition: layout.hh:157
virtual void resizeQueued(bool extremesChanged)
Definition: layout.cc:94
Layout * layout
Definition: layout.hh:23
virtual bool click(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has clicked on a link.
Definition: layout.cc:163
~Layout()
Definition: layout.cc:311
void resetSearch()
This method is called when the user closes the "find text" dialog.
Definition: findtext.cc:150
void scrollTo0(HPosition hpos, VPosition vpos, int x, int y, int width, int height, bool scrollingInterrupted)
Definition: layout.cc:536
Base class for all mouse events related to a specific position.
Definition: events.hh:48
Definition: findtext.hh:13
void expose(View *view, Rectangle *area)
Definition: layout.hh:299
The base class for signal receiver base classes.
Definition: signal.hh:253
void getBgArea(int *x, int *y, int *width, int *height)
Return the area covered by the background image.
Definition: layout.cc:40
lout::container::typed::Vector< Widget > * queueResizeList
Definition: layout.hh:158
char * textToUpper(const char *text, int len)
Definition: layout.hh:354
int getScrollPosX()
Definition: layout.hh:287
void setBgColor(style::Color *color)
Definition: layout.cc:817
int currHScrollbarThickness()
Definition: layout.cc:715
Definition: layout.hh:190
void copySelection(const char *text)
Definition: layout.hh:415
Definition: layout.hh:106
void setBgImage(style::StyleImage *bgImage, style::BackgroundRepeat bgRepeat, style::BackgroundAttachment bgAttachment, style::Length bgPositionX, style::Length bgPositionY)
Definition: layout.cc:830
Platform * platform
Definition: layout.hh:155
bool fontExists(const char *name)
Definition: layout.hh:389
#define DBG_OBJ_ENTER(aspect, prio, funname, fmt,...)
Definition: debug_rtfl.hh:404
Widget * widgetAtPoint
Definition: layout.hh:157
static bool calcScrollInto(int targetValue, int requestedSize, int *value, int viewportSize)
Definition: layout.cc:636
int resizeIdleId
Definition: layout.hh:180
int scrollX
Definition: layout.hh:171
virtual bool enter(Widget *widget, int link, int img, int x, int y)
Called, when a link is entered, left, or the position has changed.
Definition: layout.cc:145
void queueResize(bool extremesChanged)
Definition: layout.cc:1000
lout::container::typed::HashTable< lout::object::String, Anchor > * anchorsTable
Definition: layout.hh:185
style::BackgroundRepeat getBackgroundRepeat()
Definition: layout.cc:66
int height
Definition: types.hh:75
void cancelTooltip()
Definition: layout.hh:404
bool emitEnter(Widget *widget, int link, int img, int x, int y)
Definition: layout.cc:215
bool emitPress(Widget *widget, int link, int img, int x, int y, EventButton *event)
Definition: layout.cc:223
Definition: layout.hh:106
style::Tooltip * createTooltip(const char *text)
Definition: layout.hh:399
void connectLink(LinkReceiver *receiver)
Definition: layout.hh:113
LinkEmitter linkEmitter
Definition: layout.hh:124
char * addAnchor(Widget *widget, const char *name)
Definition: layout.cc:742
FindtextState::Result search(const char *str, bool caseSens, int backwards)
See dw::core::FindtextState::search.
Definition: layout.hh:429
void getRefArea(int *xRef, int *yRef, int *widthRef, int *heightRef)
Return the "reference area".
Definition: layout.cc:47
The platform independent interface for image buffers.
Definition: imgbuf.hh:161
void adjustScrollPos()
Definition: layout.cc:623
void connectLayout(Receiver *receiver)
Definition: layout.hh:137
ButtonEventType
Definition: layout.hh:190
Result
Definition: findtext.hh:16
style::BackgroundRepeat bgRepeat
Definition: layout.hh:163
Definition: layout.hh:106
bool emitLinkClick(Widget *w, int link, int img, int x, int y, EventButton *event)
Definition: layout.hh:272
style::StyleImage * getBgImage()
Definition: layout.hh:443
virtual bool press(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has pressed the mouse button on a link (but not yet released).
Definition: layout.cc:151
int resizeIdleCounter
Definition: layout.hh:248
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtablecell.cc:28
Imgbuf * createImgbuf(Imgbuf::Type type, int width, int height, double gamma)
Definition: layout.hh:409
style::Cursor cursor
Definition: layout.hh:167
bool emitToReceiver(lout::signal::Receiver *receiver, int signalNo, int argc, lout::object::Object **argv)
A sub class must implement this for a call to a single receiver.
Definition: layout.cc:104
An interface to encapsulate platform dependent drawing.
Definition: view.hh:16
bool emitClick(Widget *widget, int link, int img, int x, int y, EventButton *event)
Definition: layout.cc:239
int textWidth(style::Font *font, const char *text, int len)
Definition: layout.hh:349
void viewportSizeChanged(View *view, int width, int height)
Definition: layout.cc:1295
int width
Definition: types.hh:74
bool usesViewport
Definition: layout.hh:170
int canvasWidth
Definition: layout.hh:168
virtual void canvasSizeChanged(int width, int ascent, int descent)
Definition: layout.cc:98
int viewportWidth
Definition: layout.hh:171
style::BackgroundAttachment bgAttachment
Definition: layout.hh:164
Definition: layout.hh:130
ScrollCommand
Definition: types.hh:35
void setWidget(Widget *widget)
Definition: layout.cc:430
void queueDraw(int x, int y, int width, int height)
Definition: layout.cc:964
void enterResizeIdle()
Definition: layout.hh:251
bool readyToDraw()
If this method returns false, nothing is done at all.
Definition: layout.cc:35
style::Length bgPositionX
Definition: layout.hh:165
LayoutImgRenderer(Layout *layout)
Definition: layout.hh:26
int prevGlyph(const char *text, int idx)
Definition: layout.hh:369
BackgroundRepeat
Definition: style.hh:236
int y
Definition: types.hh:73
int scrollTargetHeight
Definition: layout.hh:177
bool emitLinkEnter(Widget *w, int link, int img, int x, int y)
Definition: layout.hh:261
bool emitLinkPress(Widget *w, int link, int img, int x, int y, EventButton *event)
Definition: layout.hh:264
int Length
Type for representing all lengths within dw::core::style.
Definition: style.hh:428
Platform * getPlatform()
Definition: layout.hh:342
Widget * widget
Definition: layout.hh:149
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.
Definition: layout.hh:314
FindtextState findtextState
Definition: layout.hh:188
void scroll(ScrollCommand)
Definition: layout.cc:520
bool buttonEvent(ButtonEventType type, View *view, int numPressed, int x, int y, ButtonState state, int button)
Definition: layout.cc:1020
void leaveResizeIdle()
Definition: layout.hh:252
void draw(int x, int y, int width, int height)
Draw (or queue for drawing) an area, which is given in canvas coordinates.
Definition: layout.cc:87
Layout(Platform *platform)
Definition: layout.cc:256
void draw(View *view, Rectangle *area)
Definition: layout.cc:661
void updateCursor()
Definition: layout.cc:809