gtkmm 4.14.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gdk::PopupLayout Class Referencefinal

Information for presenting popups. More...

#include <gdkmm/popuplayout.h>

Public Member Functions

void reference () const
 Increment the reference count for this object. More...
 
void unreference () const
 Decrement the reference count for this object. More...
 
GdkPopupLayout * gobj ()
 Provides access to the underlying C instance. More...
 
const GdkPopupLayout * gobj () const
 Provides access to the underlying C instance. More...
 
GdkPopupLayout * gobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
 PopupLayout ()=delete
 
 PopupLayout (const PopupLayout &)=delete
 
PopupLayoutoperator= (const PopupLayout &)=delete
 
Glib::RefPtr< PopupLayoutcopy () const
 Makes a copy of layout. More...
 
bool equal (const Glib::RefPtr< const PopupLayout > & other) const
 Check whether layout and other has identical layout properties. More...
 
void set_anchor_rect (const Rectangle & anchor_rect)
 Set the anchor rectangle. More...
 
Rectangle get_anchor_rect () const
 Get the anchor rectangle. More...
 
void set_rect_anchor (Gravity anchor)
 Set the anchor on the anchor rectangle. More...
 
Gravity get_rect_anchor () const
 Returns the anchor position on the anchor rectangle. More...
 
void set_surface_anchor (Gravity anchor)
 Set the anchor on the popup surface. More...
 
Gravity get_surface_anchor () const
 Returns the anchor position on the popup surface. More...
 
void set_anchor_hints (AnchorHints anchor_hints)
 Set new anchor hints. More...
 
AnchorHints get_anchor_hints () const
 Get the Gdk::AnchorHints. More...
 
void set_offset (int dx, int dy)
 Offset the position of the anchor rectangle with the given delta. More...
 
void get_offset (int & dx, int & dy)
 Retrieves the offset for the anchor rectangle. More...
 
void set_shadow_width (int left, int right, int top, int bottom)
 Sets the shadow width of the popup. More...
 
void set_shadow_width (int width)
 Sets the shadow width of the popup. More...
 
void get_shadow_width (int &left, int &right, int & top, int & bottom) const
 Obtains the shadow widths of this layout. More...
 

Static Public Member Functions

static Glib::RefPtr< PopupLayoutcreate (const Rectangle & anchor_rect, Gravity rect_anchor, Gravity surface_anchor)
 Create a popup layout description. More...
 

Protected Member Functions

void operator delete (void *, std::size_t)
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gdk::PopupLayoutwrap (GdkPopupLayout * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

Information for presenting popups.

Popups are positioned relative to their parent surface. The Gdk::PopupLayout class contains information that is necessary to do so.

Since gtkmm 3.98:

Constructor & Destructor Documentation

◆ PopupLayout() [1/2]

Gdk::PopupLayout::PopupLayout ( )
delete

◆ PopupLayout() [2/2]

Gdk::PopupLayout::PopupLayout ( const PopupLayout )
delete

Member Function Documentation

◆ copy()

Glib::RefPtr< PopupLayout > Gdk::PopupLayout::copy ( ) const

Makes a copy of layout.

Returns
A copy of layout.

◆ create()

static Glib::RefPtr< PopupLayout > Gdk::PopupLayout::create ( const Rectangle anchor_rect,
Gravity  rect_anchor,
Gravity  surface_anchor 
)
static

Create a popup layout description.

Used together with 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 set_offset(), which is equivalent to offsetting the position of surface.

Parameters
anchor_rectThe anchor Gdk::Rectangle to align surface with.
rect_anchorThe point on anchor_rect to align with surface's anchor point.
surface_anchorThe point on surface to align with rect's anchor point.
Returns
Newly created instance of Gdk::PopupLayout.

◆ equal()

bool Gdk::PopupLayout::equal ( const Glib::RefPtr< const PopupLayout > &  other) const

Check whether layout and other has identical layout properties.

Parameters
otherAnother Gdk::PopupLayout.
Returns
true if layout and other have identical layout properties, otherwise false.

◆ get_anchor_hints()

AnchorHints Gdk::PopupLayout::get_anchor_hints ( ) const

Get the Gdk::AnchorHints.

Returns
The Gdk::AnchorHints.

◆ get_anchor_rect()

Rectangle Gdk::PopupLayout::get_anchor_rect ( ) const

Get the anchor rectangle.

Returns
The anchor rectangle.

◆ get_offset()

void Gdk::PopupLayout::get_offset ( int &  dx,
int &  dy 
)

Retrieves the offset for the anchor rectangle.

Parameters
dxReturn location for the delta X coordinate.
dyReturn location for the delta Y coordinate.

◆ get_rect_anchor()

Gravity Gdk::PopupLayout::get_rect_anchor ( ) const

Returns the anchor position on the anchor rectangle.

Returns
The anchor on the anchor rectangle.

◆ get_shadow_width()

void Gdk::PopupLayout::get_shadow_width ( int &  left,
int &  right,
int &  top,
int &  bottom 
) const

Obtains the shadow widths of this layout.

Since gtkmm 4.2:
Parameters
leftReturn location for the left shadow width.
rightReturn location for the right shadow width.
topReturn location for the top shadow width.
bottomReturn location for the bottom shadow width.

◆ get_surface_anchor()

Gravity Gdk::PopupLayout::get_surface_anchor ( ) const

Returns the anchor position on the popup surface.

Returns
The anchor on the popup surface.

◆ gobj() [1/2]

GdkPopupLayout * Gdk::PopupLayout::gobj ( )

Provides access to the underlying C instance.

◆ gobj() [2/2]

const GdkPopupLayout * Gdk::PopupLayout::gobj ( ) const

Provides access to the underlying C instance.

◆ gobj_copy()

GdkPopupLayout * Gdk::PopupLayout::gobj_copy ( ) const

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ operator delete()

void Gdk::PopupLayout::operator delete ( void *  ,
std::size_t   
)
protected

◆ operator=()

PopupLayout & Gdk::PopupLayout::operator= ( const PopupLayout )
delete

◆ reference()

void Gdk::PopupLayout::reference ( ) const

Increment the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

◆ set_anchor_hints()

void Gdk::PopupLayout::set_anchor_hints ( AnchorHints  anchor_hints)

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, Gdk::AnchorHints::FLIP_X will replace Gdk::Gravity::NORTH_WEST with Gdk::Gravity::NORTH_EAST and vice versa if surface extends beyond the left or right edges of the monitor.

Parameters
anchor_hintsThe new Gdk::AnchorHints.

◆ set_anchor_rect()

void Gdk::PopupLayout::set_anchor_rect ( const Rectangle anchor_rect)

Set the anchor rectangle.

Parameters
anchor_rectThe new anchor rectangle.

◆ set_offset()

void Gdk::PopupLayout::set_offset ( int  dx,
int  dy 
)

Offset the position of the anchor rectangle with the given delta.

Parameters
dxX delta to offset the anchor rectangle with.
dyY delta to offset the anchor rectangle with.

◆ set_rect_anchor()

void Gdk::PopupLayout::set_rect_anchor ( Gravity  anchor)

Set the anchor on the anchor rectangle.

Parameters
anchorThe new rect anchor.

◆ set_shadow_width() [1/2]

void Gdk::PopupLayout::set_shadow_width ( int  left,
int  right,
int  top,
int  bottom 
)

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.

Since gtkmm 4.2:
Parameters
leftWidth of the left part of the shadow.
rightWidth of the right part of the shadow.
topHeight of the top part of the shadow.
bottomHeight of the bottom part of the shadow.

◆ set_shadow_width() [2/2]

void Gdk::PopupLayout::set_shadow_width ( int  width)

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.

Since gtkmm 4.2:
Parameters
widthWidth of all parts of the shadow.

◆ set_surface_anchor()

void Gdk::PopupLayout::set_surface_anchor ( Gravity  anchor)

Set the anchor on the popup surface.

Parameters
anchorThe new popup surface anchor.

◆ unreference()

void Gdk::PopupLayout::unreference ( ) const

Decrement the reference count for this object.

You should never need to do this manually - use the object via a RefPtr instead.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gdk::PopupLayout > wrap ( GdkPopupLayout *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.