gtkmm  4.8.0
Public Member Functions | Protected Attributes | List of all members
Gdk::ToplevelSize Class Reference

Information for computing toplevel size. More...

#include <gdkmm/toplevelsize.h>

Public Member Functions

 ToplevelSize (GdkToplevelSize * gobject)
 
 ToplevelSize (const ToplevelSize & other)=delete
 
ToplevelSizeoperator= (const ToplevelSize & other)=delete
 
 ToplevelSize (ToplevelSize && other) noexcept
 
ToplevelSizeoperator= (ToplevelSize && other) noexcept
 
 ~ToplevelSize () noexcept
 
 operator bool () const
 Checks if this instance is valid. More...
 
GdkToplevelSize * gobj ()
 Provides access to the underlying C object. More...
 
const GdkToplevelSize * gobj () const
 Provides access to the underlying C object. More...
 
void get_bounds (int & bounds_width, int & bounds_height) const
 Retrieves the bounds the toplevel is placed within. More...
 
void set_size (int width, int height)
 Sets the size the toplevel prefers to be resized to. More...
 
void set_min_size (int min_width, int min_height)
 Sets the minimum size of the toplevel. More...
 
void set_shadow_width (int left, int right, int top, int bottom)
 Sets the shadows size of the toplevel. More...
 

Protected Attributes

GdkToplevelSize * gobject_
 

Detailed Description

Information for computing toplevel size.

The Gdk::ToplevelSize struct contains information that may be useful for users of Gdk::Toplevel to compute a surface size. It also carries information back with the computational result.

Since gtkmm 3.98:

Constructor & Destructor Documentation

◆ ToplevelSize() [1/3]

Gdk::ToplevelSize::ToplevelSize ( GdkToplevelSize *  gobject)
explicit

◆ ToplevelSize() [2/3]

Gdk::ToplevelSize::ToplevelSize ( const ToplevelSize other)
delete

◆ ToplevelSize() [3/3]

Gdk::ToplevelSize::ToplevelSize ( ToplevelSize &&  other)
noexcept

◆ ~ToplevelSize()

Gdk::ToplevelSize::~ToplevelSize ( )
noexcept

Member Function Documentation

◆ get_bounds()

void Gdk::ToplevelSize::get_bounds ( int &  bounds_width,
int &  bounds_height 
) const

Retrieves the bounds the toplevel is placed within.

The bounds represent the largest size a toplevel may have while still being able to fit within some type of boundary. Depending on the backend, this may be equivalent to the dimensions of the work area or the monitor on which the window is being presented on, or something else that limits the way a toplevel can be presented.

Parameters
bounds_widthReturn location for width.
bounds_heightReturn location for height.

◆ gobj() [1/2]

GdkToplevelSize* Gdk::ToplevelSize::gobj ( )
inline

Provides access to the underlying C object.

◆ gobj() [2/2]

const GdkToplevelSize* Gdk::ToplevelSize::gobj ( ) const
inline

Provides access to the underlying C object.

◆ operator bool()

Gdk::ToplevelSize::operator bool ( ) const
explicit

Checks if this instance is valid.

It is valid if and only if it contains a pointer to a GdkToplevelSize. For instance,

if (size)
do_something()
valarray< size_t > size() const

◆ operator=() [1/2]

ToplevelSize& Gdk::ToplevelSize::operator= ( const ToplevelSize other)
delete

◆ operator=() [2/2]

ToplevelSize& Gdk::ToplevelSize::operator= ( ToplevelSize &&  other)
noexcept

◆ set_min_size()

void Gdk::ToplevelSize::set_min_size ( int  min_width,
int  min_height 
)

Sets the minimum size of the toplevel.

The minimum size corresponds to the limitations the toplevel can be shrunk to, without resulting in incorrect painting. A user of a Gdk::Toplevel should calculate these given both the existing size, and the bounds retrieved from the Gdk::ToplevelSize object.

The minimum size should be within the bounds (see get_bounds()).

Parameters
min_widthThe minimum width.
min_heightThe minimum height.

◆ set_shadow_width()

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

Sets the shadows size of the toplevel.

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.

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_size()

void Gdk::ToplevelSize::set_size ( int  width,
int  height 
)

Sets the size the toplevel prefers to be resized to.

The size should be within the bounds (see get_bounds()). The set size should be considered as a hint, and should not be assumed to be respected by the windowing system, or backend.

Parameters
widthThe width.
heightThe height.

Member Data Documentation

◆ gobject_

GdkToplevelSize* Gdk::ToplevelSize::gobject_
protected