gtkmm: 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)
 The minimum size corresponds to the limitations the toplevel can be shrunk to, without resulting in incorrect painting. More...

 
void set_shadow_width (int left, int right, int top, int bottom)
 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. 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

Gdk::ToplevelSize::ToplevelSize ( GdkToplevelSize *  gobject)
explicit
Gdk::ToplevelSize::ToplevelSize ( const ToplevelSize other)
delete
Gdk::ToplevelSize::ToplevelSize ( ToplevelSize&&  other)
noexcept
Gdk::ToplevelSize::~ToplevelSize ( )
noexcept

Member Function Documentation

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.
GdkToplevelSize* Gdk::ToplevelSize::gobj ( )
inline

Provides access to the underlying C object.

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

Provides access to the underlying C object.

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()
ToplevelSize& Gdk::ToplevelSize::operator= ( const ToplevelSize other)
delete
ToplevelSize& Gdk::ToplevelSize::operator= ( ToplevelSize&&  other)
noexcept
void Gdk::ToplevelSize::set_min_size ( int  min_width,
int  min_height 
)

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.
void Gdk::ToplevelSize::set_shadow_width ( int  left,
int  right,
int  top,
int  bottom 
)

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.
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

GdkToplevelSize* Gdk::ToplevelSize::gobject_
protected