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,
184 lout::container::typed::HashTable <lout::object::String, Anchor>
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);
293 int x,
int y,
int width,
int height);
void resetSearch()
This method is called when the user closes the "find text" dialog.
Result search(const char *key, bool caseSens, bool backwards)
The platform independent interface for image buffers.
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.
void emitResizeQueued(bool extremesChanged)
void connectLayout(Receiver *receiver)
void emitCanvasSizeChanged(int width, int ascent, int descent)
void draw(int x, int y, int width, int height)
Draw (or queue for drawing) an area, which is given in canvas coordinates.
void getBgArea(int *x, int *y, int *width, int *height)
Return the area covered by the background image.
style::BackgroundRepeat getBackgroundRepeat()
LayoutImgRenderer(Layout *layout)
style::BackgroundAttachment getBackgroundAttachment()
void getRefArea(int *xRef, int *yRef, int *widthRef, int *heightRef)
Return the "reference area".
style::Length getBackgroundPositionX()
style::Length getBackgroundPositionY()
style::StyleImage * getBackgroundImage()
bool readyToDraw()
If this method returns false, nothing is done at all.
bool emitEnter(Widget *widget, int link, int img, int x, int y)
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.
bool emitPress(Widget *widget, int link, int img, int x, int y, EventButton *event)
void connectLink(LinkReceiver *receiver)
bool emitRelease(Widget *widget, int link, int img, int x, int y, EventButton *event)
bool emitClick(Widget *widget, int link, int img, int x, int y, EventButton *event)
virtual bool click(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has clicked on a link.
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).
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.
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.
Receiver interface different signals.
virtual void resizeQueued(bool extremesChanged)
virtual void canvasSizeChanged(int width, int ascent, int descent)
The central class for managing and drawing a widget tree.
bool fontExists(const char *name)
void attachView(View *view)
Attach a view to the layout.
lout::misc::ZoneAllocator * textZone
void changeAnchor(Widget *widget, char *name, int y)
void detachWidget(Widget *widget)
int currHScrollbarThickness()
bool emitLinkRelease(Widget *w, int link, int img, int x, int y, EventButton *event)
FindtextState::Result search(const char *str, bool caseSens, int backwards)
See dw::core::FindtextState::search.
void setCursor(style::Cursor cursor)
void resetSearch()
See dw::core::FindtextState::resetSearch.
void enterNotify(View *view, int x, int y, ButtonState state)
This function is called by a view, to delegate a enter notify event.
style::Font * createFont(style::FontAttrs *attrs, bool tryEverything)
void queueDraw(int x, int y, int width, int height)
bool scrollIdleNotInterrupted
Widget * getWidgetAtPoint(int x, int y)
void containerSizeChanged()
bool motionNotify(View *view, int x, int y, ButtonState state)
This function is called by a view, to delegate a motion notify event.
void setWidget(Widget *widget)
int textWidth(style::Font *font, const char *text, int len)
bool processMouseEvent(MousePositionEvent *event, ButtonEventType type)
Common processing of press, release and motion events.
style::StyleImage * bgImage
void setBgColor(style::Color *color)
void detachView(View *view)
style::Color * getBgColor()
void moveToWidgetAtPoint(int x, int y, ButtonState state)
Emit the necessary crossing events, when the mouse pointer has moved to position (x,...
char * addAnchor(Widget *widget, const char *name)
Used, when the widget is not allocated yet.
void leaveNotify(View *view, ButtonState state)
This function is called by a view, to delegate a leave notify event.
void expose(View *view, Rectangle *area)
lout::container::typed::HashTable< lout::object::String, Anchor > * anchorsTable
void queueDrawExcept(int x, int y, int width, int height, int ex, int ey, int ewidth, int eheight)
int nextGlyph(const char *text, int idx)
VPosition scrollTargetVpos
void viewportSizeChanged(View *view, int width, int height)
HPosition scrollTargetHpos
lout::container::typed::Vector< Widget > * queueResizeList
void addWidget(Widget *widget)
Imgbuf * createImgbuf(Imgbuf::Type type, int width, int height, double gamma)
style::Tooltip * createTooltip(const char *text)
bool buttonEvent(ButtonEventType type, View *view, int numPressed, int x, int y, ButtonState state, int button)
SelectionState selectionState
bool emitLinkEnter(Widget *w, int link, int img, int x, int y)
void draw(View *view, Rectangle *area)
style::Color * createColor(int color)
void moveToWidget(Widget *newWidgetAtPoint, ButtonState state)
void setBgImage(style::StyleImage *bgImage, style::BackgroundRepeat bgRepeat, style::BackgroundAttachment bgAttachment, style::Length bgPositionX, style::Length bgPositionY)
void connect(Receiver *receiver)
void moveOutOfView(ButtonState state)
Emit the necessary crossing events, when the mouse pointer has moved out of the view.
bool emitLinkClick(Widget *w, int link, int img, int x, int y, EventButton *event)
style::StyleImage * getBgImage()
bool emitLinkPress(Widget *w, int link, int img, int x, int y, EventButton *event)
void copySelection(const char *text)
char * textToUpper(const char *text, int len)
FindtextState findtextState
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.
style::BackgroundRepeat bgRepeat
void scrollTo0(HPosition hpos, VPosition vpos, int x, int y, int width, int height, bool scrollingInterrupted)
char * textToLower(const char *text, int len)
void removeAnchor(Widget *widget, char *name)
style::BackgroundAttachment bgAttachment
static bool calcScrollInto(int targetValue, int requestedSize, int *value, int viewportSize)
void scrollPosChanged(View *view, int x, int y)
ui::ResourceFactory * getResourceFactory()
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.
void scroll(ScrollCommand)
int prevGlyph(const char *text, int idx)
style::Length bgPositionX
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.
style::Length bgPositionY
int currVScrollbarThickness()
void connectLink(LinkReceiver *receiver)
void setAnchor(const char *anchor)
Sets the anchor to scroll to.
void queueResize(bool extremesChanged)
LayoutImgRenderer * layoutImgRenderer
Base class for all mouse events related to a specific position.
dw::core::Shape implemtation for simple rectangles.
This class handles selections, as well as activation of links, which is closely related.
An interface to encapsulate platform dependent drawing.
Useful (but not mandatory) base class for updates of areas with background images.
A factory for the common resource.
Typed version of container::untyped::Vector.
A simple allocator optimized to handle many small chunks of memory.
This is the base class for many other classes, which defines very common virtual methods.
The base class for signal emitters.
void connect(Receiver *receiver)
Connect a receiver to the emitter.
The base class for signal receiver base classes.
#define DBG_OBJ_ENTER(aspect, prio, funname, fmt,...)
int Length
Type for representing all lengths within dw::core::style.
ButtonState
Platform independent representation.
Dw is in this namespace, or sub namespaces of this one.