#include <Pt/Forms/WindowManager.h>
Host that attaches windows to a screen or workspace. More...
Inherits Widget.
Inherited by WorkspaceManager.
Public Types | |
| typedef Widget | Base |
| Defines the base widget type. | |
Public Member Functions | |
| WindowManager () | |
| Creates a disconnected host for window frames. | |
| virtual | ~WindowManager () |
| Destroys the window host. | |
| void | relayout () |
| Requests a relayout of hosted windows. More... | |
| Pt::Signal< Window & > & | surfaceChanged () |
| Returns the signal sent after a window backing pixmap is synchronized. More... | |
| Pt::uint64_t | id () const |
| Returns the application-unique ID of this live widget. | |
| const std::string & | name () const |
| Returns the optional name. | |
| void | setName (const std::string &n) |
| Sets the optional name immediately. | |
| void | setNextResponder (Responder *r) |
| Sets the next responder for unhandled input. More... | |
| bool | isConnected () const |
| Returns true when the widget is connected to a screen. | |
| Screen * | screen () |
| Returns the connected screen, or 0 when disconnected. | |
| const Screen * | screen () const |
| Returns the connected screen, or 0 when disconnected. | |
| Widget * | parent () |
| Returns the non-owning parent, or 0 when unparented. | |
| const Widget * | parent () const |
| Returns the non-owning parent, or 0 when unparented. | |
| bool | isDescendantOf (const Widget &top) const |
| Returns true when this widget is a strict descendant of top. | |
| bool | isAncestorOf (const Widget &child) const |
| Returns true when this widget is a strict ancestor of child. | |
| Widget * | hitTest (const Gfx::PointF &pos) |
| Returns the descendant hit at local position pos. More... | |
| Gfx::PointF | toParent (const Gfx::PointF &pos) const |
| Converts local position pos to parent coordinates. | |
| Gfx::PointF | fromParent (const Gfx::PointF &pos) const |
| Converts parent position pos to local coordinates. | |
| Gfx::PointF | toGlobal (const Gfx::PointF &pos) const |
| Converts local position pos to global coordinates. More... | |
| Gfx::PointF | fromGlobal (const Gfx::PointF &pos) const |
| Converts global position pos to local coordinates. More... | |
| void | addPeer (Widget &peer) |
| Adds a bidirectional, non-owning peer association with peer. More... | |
| void | removePeer (Widget &peer) |
| Removes the bidirectional peer association with peer. More... | |
| void | invalidate () |
| Queues a coalesced invalidation. More... | |
| virtual void | repaint (const Gfx::RectF &rect) |
| Requests repainting local dirty rectangle rect. More... | |
| virtual void | repaint () |
| Requests repainting the complete local bounds. | |
| double | scaleFactor () const |
| Returns the current logical-to-device scale factor. | |
| const Gfx::Scaling & | scaling () const |
| Returns the current logical-to-device scaling. | |
| bool | isVisible () const |
| Returns whether the last show event made the widget visible. | |
| virtual void | show (bool b=true) |
| Requests that the widget be shown or hidden. More... | |
| bool | isEnabled () const |
| Returns whether the last enable event made the widget enabled. | |
| virtual void | enable (bool isEnable=true) |
| Requests that the widget be enabled or disabled. More... | |
| void | activate (bool active=true) |
| Requests that the widget become active or inactive. More... | |
| const Gfx::PointF & | position () const |
| Returns the position in parent logical coordinates. | |
| virtual void | move (const Gfx::PointF &pos) |
| Requests a new parent-local position pos. More... | |
| const Gfx::SizeF & | size () const |
| Returns the size in local logical coordinates. | |
| const Gfx::RectF & | bounds () const |
| Returns local bounds, whose origin is always local zero. | |
| const Gfx::SizeF & | minimumSize () const |
| Returns the locally stored minimum size. More... | |
| void | setMinimumSize (const Gfx::SizeF &s) |
| Sets the local minimum size and notifies the size-limit hook. More... | |
| void | setMinimumSize (double w, double h) |
| Sets the local minimum width and height. | |
| void | setMinimumWidth (double w) |
| Sets the local minimum width. | |
| void | setMinimumHeight (double h) |
| Sets the local minimum height. | |
| const Gfx::SizeF & | maximumSize () const |
| Returns the locally stored maximum size. More... | |
| void | setMaximumSize (const Gfx::SizeF &s) |
| Sets the local maximum size and notifies the size-limit hook. More... | |
| void | setMaximumSize (double w, double h) |
| Sets the local maximum width and height. | |
| void | setMaximumWidth (double w) |
| Sets the local maximum width. | |
| void | setMaximumHeight (double h) |
| Sets the local maximum height. | |
| virtual void | resize (const Gfx::SizeF &s) |
| Requests a new local size s. More... | |
| void | setCapture (bool capture) |
| Requests pointer input capture or release. More... | |
| const Cursor * | cursor () const |
| Returns this widget's cursor or the default cursor. More... | |
| void | setCursor (const Cursor *c) |
| Sets a local cursor override. More... | |
| void | processEvent (const Pt::Event &ev) |
| Processes ev through this widget's event dispatcher. More... | |
| Pt::Signal< const Pt::Event & > & | eventReceived () |
| Returns the event dispatcher signal. More... | |
| bool | mouseEvent (const MouseEvent &ev) |
| Delivers ev along the mouse responder chain. More... | |
| void | touchEvent (const TouchEvent &ev) |
| Delivers ev along the touch responder chain. More... | |
| void | scrollEvent (const ScrollEvent &ev) |
| Delivers ev along the scroll responder chain. | |
| void | enterEvent (const EnterEvent &ev) |
| Delivers ev along the enter responder chain. | |
| void | leaveEvent (const LeaveEvent &ev) |
| Delivers ev along the leave responder chain. | |
| void | keyEvent (const KeyEvent &ev) |
| Delivers ev along the key responder chain. | |
Protected Member Functions | |
| virtual void | onConnect (Screen &screen) |
| Connects this host to screen. More... | |
| virtual void | onDisconnect () |
| Disconnects this host from its screen. More... | |
| virtual void | onRequestRelayout () |
| Handles a request to relayout hosted windows. More... | |
| virtual void | onProcessPaintEvent (const PaintEvent &ev) |
| Processes a paint event through the Widget event path. More... | |
| virtual void | onPaintEvent (const PaintEvent &ev) |
| Handles a paint event after standard processing. More... | |
| virtual WindowFrame * | onAttach (Window &window)=0 |
| Creates and registers a frame for window. More... | |
| virtual void | onDetach (WindowFrame &frame)=0 |
| Unregisters frame from this host. More... | |
| virtual void | onInit (WindowFrame &frame)=0 |
| Initializes frame after the frame initializes its window. More... | |
| virtual void | onRelease (WindowFrame &frame)=0 |
| Releases frame before it is detached and deleted. More... | |
| virtual void | onSetParent (Widget *parent) |
| Records the non-owning parent relationship. More... | |
| virtual Widget * | onHitTest (const Gfx::PointF &pos) |
| Returns the descendant hit at local position pos. More... | |
| virtual Gfx::PointF | onToParent (const Gfx::PointF &pos) const =0 |
| Converts local position pos to parent coordinates. More... | |
| virtual Gfx::PointF | onFromParent (const Gfx::PointF &pos) const =0 |
| Converts parent position pos to local coordinates. More... | |
| virtual Gfx::PointF | onToGlobal (const Gfx::PointF &pos) const |
| Converts local position pos to global coordinates. More... | |
| virtual Gfx::PointF | onFromGlobal (const Gfx::PointF &pos) const |
| Converts global position pos to local coordinates. More... | |
| virtual void | onAttachPeer (Widget &peer) |
| Attaches non-owning peer peer. More... | |
| virtual void | onDetachPeer (Widget &peer) |
| Detaches non-owning peer peer. More... | |
| virtual void | onRequestRepaint (const Gfx::RectF &rect) |
| Forwards a repaint request for local rectangle rect. | |
| virtual void | onRequestShow (bool e) |
| Forwards a request to show or hide the widget. | |
| virtual void | onRequestEnable (bool isEnable) |
| Forwards a request to enable or disable the widget. | |
| virtual void | onRequestActivate (bool active) |
| Forwards a request to activate or deactivate the widget. | |
| virtual void | onRequestMove (const Gfx::PointF &pos) |
| Forwards a request for parent-local position pos. | |
| virtual void | onSetSizeLimits (const Gfx::SizeF &minSize, const Gfx::SizeF &maxSize) |
| Notifies that locally stored size limits changed. More... | |
| virtual void | onRequestResize (const Gfx::SizeF &s) |
| Forwards a request for local size s. | |
| virtual void | onRequestCapture (bool capture) |
| Requests application-managed pointer capture or release. | |
| virtual void | onProcessEvent (const Pt::Event &ev) |
| Sends ev to the widget event dispatcher. | |
| virtual void | onProcessInvalidateEvent (const InvalidateEvent &ev) |
| Coalesces and dispatches an invalidation event. | |
| virtual void | onInvalidateEvent (const InvalidateEvent &ev) |
| Handles the final coalesced invalidation event. More... | |
| virtual void | onInvalidate () |
| Updates derived state after invalidation. More... | |
| virtual void | onProcessRescaleEvent (const RescaleEvent &ev) |
| Dispatches a rescale event. | |
| virtual void | onRescaleEvent (const RescaleEvent &ev) |
| Handles a rescale event. More... | |
| virtual void | onRescale (double scaling) |
| Updates the local scaling to scaling. | |
| virtual void | onProcessShowEvent (const ShowEvent &ev) |
| Ignores redundant show events and dispatches other ones. | |
| virtual void | onShowEvent (const ShowEvent &ev) |
| Handles a show event. More... | |
| virtual void | onShow (bool visible) |
| Updates the local visibility state to visible. | |
| virtual void | onProcessEnableEvent (const EnableEvent &ev) |
| Dispatches an enable event. | |
| virtual void | onEnableEvent (const EnableEvent &ev) |
| Updates the enabled state and handles an enable event. More... | |
| virtual void | onEnable (bool e) |
| Performs behavior associated with enabled state e. | |
| virtual void | onProcessMoveEvent (const MoveEvent &ev) |
| Dispatches a move event. | |
| virtual void | onMoveEvent (const MoveEvent &ev) |
| Updates the parent-local position from a move event. | |
| virtual void | onProcessResizeEvent (const ResizeEvent &ev) |
| Dispatches a resize event. | |
| virtual void | onResizeEvent (const ResizeEvent &ev) |
| Updates the local size and bounds from a resize event. | |
| virtual void | onProcessMouseEvent (const MouseEvent &ev) |
| Updates pointer tracking and delivers a mouse event. | |
| virtual void | onProcessTouchEvent (const TouchEvent &ev) |
| Updates pointer tracking and delivers a touch event. | |
| virtual void | onProcessScrollEvent (const ScrollEvent &ev) |
| Delivers a scroll event through the responder chain. | |
| virtual void | onProcessEnterEvent (const EnterEvent &ev) |
| Delivers an enter event through the responder chain. | |
| virtual void | onProcessLeaveEvent (const LeaveEvent &ev) |
| Delivers a leave event through the responder chain. | |
| virtual void | onProcessKeyEvent (const KeyEvent &ev) |
| Delivers a key event through the responder chain. | |
| virtual Responder * | onNextResponder () |
| Returns the non-owning next responder, or 0. | |
| virtual bool | onMouseEvent (const MouseEvent &ev) |
| Handles a mouse event in local coordinates. More... | |
| virtual bool | onTouchEvent (const TouchEvent &ev) |
| Handles a touch event in local coordinates. More... | |
| virtual bool | onScrollEvent (const ScrollEvent &ev) |
| Handles a scroll event. More... | |
| virtual bool | onEnterEvent (const EnterEvent &ev) |
| Handles pointer entry and installs the widget cursor. More... | |
| virtual bool | onLeaveEvent (const LeaveEvent &ev) |
| Handles pointer leave and restores the default cursor. More... | |
| virtual bool | onKeyEvent (const KeyEvent &ev) |
| Handles a key event. More... | |
| virtual bool | onMousePress (const MouseEvent &ev) |
| Handles a mouse press. The default returns false. | |
| virtual bool | onMouseRelease (const MouseEvent &ev) |
| Handles a mouse release. The default returns false. | |
| virtual bool | onMouseMove (const MouseEvent &ev) |
| Handles a mouse move. The default returns false. | |
A WindowManager is a Widget that attaches Window objects it does not own. Screen provides the manager for top-level platform windows, while Workspace uses a derived manager to present windows in its own bounds. Applications select a manager through a screen or workspace and attach windows through Window; they do not derive from this class.
Backend implementations derive from WindowManager and implement the attachment and lifecycle hooks that create, initialize, release, and detach each internal WindowFrame. Window controls that lifecycle: it calls onAttach(), initializes the frame and then calls onInit(). During detachment it releases the frame, calls onRelease() and onDetach(), and finally deletes the frame. The returned frame is therefore owned by the window; a manager must not delete it.
The default onInit() and onRelease() implementations connect and disconnect the frame and its window from the current screen. Derived managers must call the corresponding base implementation. The protected hooks are for backend implementations and are not an application customization API.
| void relayout | ( | ) |
Forwards the request to onRequestRelayout(). The base implementation does nothing.
| Pt::Signal<Window&>& surfaceChanged | ( | ) |
The signal argument identifies the painted window. It is sent after its WindowFrame processes a paint event; it does not report attachment, visibility, or geometry changes.
|
protectedvirtual |
Derived managers must call the base implementation and connect their existing frames when the host becomes connected.
Reimplemented from Widget.
Reimplemented in WorkspaceManager.
|
protectedvirtual |
Derived managers must disconnect their frames and call the base implementation.
Reimplemented from Widget.
Reimplemented in WorkspaceManager.
|
protectedvirtual |
The base implementation does nothing. Embedded managers normally forward the request to their containing widget.
Reimplemented in WorkspaceManager.
|
protectedvirtual |
Embedded managers can override this hook to paint their hosted frames.
Reimplemented from Widget.
Reimplemented in WorkspaceManager.
|
protectedvirtual |
The base implementation forwards the event to Widget.
Reimplemented from Widget.
|
protectedpure virtual |
Return a non-null frame that remains valid until onDetach() is called. Configure the responder relationship and manager bookkeeping, but do not delete the frame; Window owns and deletes it.
Implemented in WorkspaceManager.
|
protectedpure virtual |
Called after onRelease(). Clear responder links and manager bookkeeping, but do not delete frame.
Implemented in WorkspaceManager.
|
protectedpure virtual |
Prepare host-specific state such as scaling, then call the base implementation to connect the frame and its window to the current screen.
Implemented in WorkspaceManager.
|
protectedpure virtual |
Call the base implementation to disconnect the frame and its window from the current screen.
Implemented in WorkspaceManager.
|
inherited |
The widget does not own r. Do not create a responder cycle.
|
inherited |
Returns 0 when no descendant is hit. Derived classes implement their child hit-testing policy in onHitTest().
|
inherited |
The default conversion walks the parent chain.
|
inherited |
The default conversion walks the parent chain.
|
inherited |
Peers are not a parent, child, or screen connection and do not transfer ownership. Add a relationship only once. Both endpoints receive onAttachPeer().
|
inherited |
Both endpoints receive onDetachPeer().
|
inherited |
The Forms event loop eventually calls onInvalidateEvent() after all pending invalidation requests for this widget have coalesced.
|
virtualinherited |
The containing view, frame, or backend converts and forwards the rectangle. This does not paint synchronously.
|
virtualinherited |
isVisible() changes only when the request is confirmed by a ShowEvent.
|
virtualinherited |
isEnabled() changes only when the request is confirmed by an EnableEvent.
|
inherited |
Activation is defined by the receiving parent, frame, or backend.
|
virtualinherited |
position() changes only when a MoveEvent confirms the request.
|
inherited |
New widgets use (0, 0).
|
inherited |
This does not resize the widget or validate it against the maximum size. The receiver of onSetSizeLimits() applies the limits.
|
inherited |
New widgets use (64000, 64000).
|
inherited |
This does not resize the widget or validate it against the minimum size. The receiver of onSetSizeLimits() applies the limits.
|
virtualinherited |
size() and bounds() change only when a ResizeEvent confirms the request.
|
inherited |
Capture is owned by the application and routes pointer input to this widget until released. It is released during destruction.
|
inherited |
The returned cursor is always non-null and is owned by the widget or the Forms runtime.
|
inherited |
Pass 0 to remove the override and restore the default cursor. The cursor is copied, so the caller retains ownership of c. When this widget is under the pointer, the platform cursor is updated immediately.
|
inherited |
Use the state-request APIs for ordinary operation. This method is for backends, tests, and code that deliberately injects events.
|
inherited |
Internal event-processing slots are connected to this signal. Additional slots can observe or process deliberately dispatched widget events.
|
protectedvirtualinherited |
Container classes call this while attaching or detaching the widget. Overrides that retain the base relationship must call this implementation.
|
protectedvirtualinherited |
|
protectedpure virtualinherited |
Every direct Widget subclass must implement this mapping.
Implemented in WorkspaceManager, Window, Screen, and Control.
|
protectedpure virtualinherited |
Every direct Widget subclass must implement this mapping.
Implemented in WorkspaceManager, Window, Screen, and Control.
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
The base implementation stores the peer. Overrides that retain the association must call this implementation.
Reimplemented in Popup.
|
protectedvirtualinherited |
The base implementation removes one stored association. Overrides that retain the association must call this implementation.
Reimplemented in Popup.
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
The base implementation clears pending invalidation bookkeeping.
Reimplemented in Window, TabView, SpinBox, SpinBoxButton, Slider, ScrollBar, PushButton, ProgressBar, Panel, MenuItemBase, MenuBar, Menu, ListBox, ListBoxItem, LineEdit, Label, Form, Control, ComboBox, and CheckBox.
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
Return true to consume it. Returning false forwards the original event to the next responder.
Reimplemented from Responder.
Reimplemented in Window, SpinBox, Slider, ScrollLayout, ScrollBar, Screen, ListBoxItem, LineEdit, Form, Control, ComboBox, Button, MenuItemBase, and MenuBar.
|
protectedvirtualinherited |
Return true to consume it; otherwise it is forwarded to the next responder.
Reimplemented from Responder.
Reimplemented in Window, ScrollLayout, Screen, ListBoxItem, Form, Control, and Button.
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
inherited |
Converts the position to each responder's local coordinates. Returns true when a responder handles the event.
|
inherited |
Converts the position to each responder's local coordinates.