Contains information that is necessary position a
<GdkPopup> relative to its parent.
The positioning requires a negotiation with the windowing system, since it depends on external constraints, such as the position of the parent surface, and the screen dimensions.
The basic ingredients are a rectangle on the parent surface, and the anchor on both that rectangle and the popup. The anchors specify a side or corner to place next to each other.
For cases where placing the anchors next to each other would make the popup extend offscreen, the layout includes some hints for how to resolve this problem. The hints may suggest to flip the anchor position to the other side, or to ’slide’ the popup along a side, or to resize it.
These hints may be combined.
Ultimatively, it is up to the windowing system to determine the position
and size of the popup. You can learn about the result by calling
popup:get-position-x,
popup:get-position-y,
popup:get-rect-anchor and
popup:get-surface-anchor after
the popup has been presented. This can be used to adjust the rendering.
For example, GtkPopover changes its arrow position accordingly. But you
have to be careful avoid changing the size of the popover, or it has to
be presented again.
Makes a copy of self.
Passed: a <GdkPopupLayout>.
a popup layout
Returned: a <GdkPopupLayout>.
a copy of self.
Check whether self and other has identical layout properties.
Passed: a <GdkPopupLayout>.
a popup layout
Passed: a <GdkPopupLayout>.
another popup layout
Returned: a boolean.
true if self and other have identical layout properties, otherwise false.
Get the anchor hints.
Passed: a <GdkPopupLayout>.
a popup layout
Returned: a <GdkAnchorHints>.
the anchor hints
Get the anchor rectangle.
Passed: a <GdkPopupLayout>.
a popup layout
Returned: a <GdkRectangle>.
The anchor rectangle
Retrieves the offset for the anchor rectangle.
Passed: a <GdkPopupLayout>.
a popup layout
Returned: a 32-bit integer.
return location for the delta X coordinate
Returned: a 32-bit integer.
return location for the delta Y coordinate
Returns the anchor position on the anchor rectangle.
Passed: a <GdkPopupLayout>.
a popup layout
Returned: a <GdkGravity>.
the anchor on the anchor rectangle.
Obtains the shadow widths of this layout.
Passed: a <GdkPopupLayout>.
a popup layout
Returned: a 32-bit integer.
return location for the left shadow width
Returned: a 32-bit integer.
return location for the right shadow width
Returned: a 32-bit integer.
return location for the top shadow width
Returned: a 32-bit integer.
return location for the bottom shadow width
Returns the anchor position on the popup surface.
Passed: a <GdkPopupLayout>.
a popup layout
Returned: a <GdkGravity>.
the anchor on the popup surface.
Create a popup layout description.
Used together with popup:present? to
describe how a popup surface should be placed and behave on-screen.
anchor-rect is relative to the top-left corner of the surface’s parent. rect-anchor and surface-anchor determine anchor points on anchor-rect and surface to pin together.
The position of anchor-rect’s anchor point can optionally be
offset using popup-layout:set-offset, which is equivalent to offsetting
the position of surface.
Passed: a <GdkRectangle>.
the anchor rectangle to align surface with
Passed: a <GdkGravity>, or one of its symbols.
the point on anchor-rect to align with surface’s anchor point
Passed: a <GdkGravity>, or one of its symbols.
the point on surface to align with rect’s anchor point
Returned: a <GdkPopupLayout>.
newly created instance of <GdkPopupLayout>
Increases the reference count of value.
Passed: a <GdkPopupLayout>.
a popup layout
Returned: a <GdkPopupLayout>.
the same self
Set new anchor hints.
The set anchor-hints determines how surface will be moved if
the anchor points cause it to move off-screen. For example,
flip-x will replace
north-west with north-east
and vice versa if surface extends beyond the left or right edges
of the monitor.
Passed: a <GdkPopupLayout>.
a popup layout
Passed: a <GdkAnchorHints>, or a list of its
symbols, or one of them.
the new anchor hints
Set the anchor rectangle.
Passed: a <GdkPopupLayout>.
a popup layout
Passed: a <GdkRectangle>.
the new anchor rectangle
Offset the position of the anchor rectangle with the given delta.
Passed: a <GdkPopupLayout>.
a popup layout
Passed: a 32-bit integer.
x delta to offset the anchor rectangle with
Passed: a 32-bit integer.
y delta to offset the anchor rectangle with
Set the anchor on the anchor rectangle.
Passed: a <GdkPopupLayout>.
a popup layout
Passed: a <GdkGravity>, or one of its symbols.
the new rect anchor
Sets the shadow width of the popup.
The shadow width corresponds to the part of the computed surface size that would consist of the shadow margin surrounding the window, would there be any.
Passed: a <GdkPopupLayout>.
a popup layout
Passed: a 32-bit integer.
width of the left part of the shadow
Passed: a 32-bit integer.
width of the right part of the shadow
Passed: a 32-bit integer.
height of the top part of the shadow
Passed: a 32-bit integer.
height of the bottom part of the shadow
Set the anchor on the popup surface.
Passed: a <GdkPopupLayout>.
a popup layout
Passed: a <GdkGravity>, or one of its symbols.
the new popup surface anchor
Decreases the reference count of value.
Passed: a <GdkPopupLayout>.
a popup layout