stmm-input-doc  0.17.0
Public Member Functions | List of all members
stmi::GtkAccessor Class Referencefinal

Accessor wrapping a Gtk::Window. More...

Inheritance diagram for stmi::GtkAccessor:
Inheritance graph
[legend]

Public Member Functions

bool operator== (const Accessor &oOther) const noexcept override
 Accessor comparison. More...
 
bool operator== (const GtkAccessor &oOther) const noexcept
 GtkAccessor comparison. More...
 
 GtkAccessor (const Glib::RefPtr< Gtk::Window > &refGtkmmWindow) noexcept
 Constructs a Gtk::Window wrapper. More...
 
 GtkAccessor (Gtk::Window *p0GtkmmWindow) noexcept
 Constructs a Gtk::Window wrapper. More...
 
virtual ~GtkAccessor () noexcept
 
bool isDeleted () const noexcept
 Tells whether the window was deleted. More...
 
Gtk::Window * getGtkmmWindow () const noexcept
 The Gtk::Window pointer. More...
 
- Public Member Functions inherited from stmi::Accessor
virtual ~Accessor () noexcept=default
 

Additional Inherited Members

- Static Public Attributes inherited from stmi::Accessor
static const shared_ptr< Accessors_refEmptyAccessor
 
- Protected Member Functions inherited from stmi::Accessor
 Accessor () noexcept=default
 

Detailed Description

Accessor wrapping a Gtk::Window.

Device managers that want to receive mouse and keyboard events directed to a gtk window need this accessor.

Constructor & Destructor Documentation

◆ GtkAccessor() [1/2]

stmi::GtkAccessor::GtkAccessor ( const Glib::RefPtr< Gtk::Window > &  refGtkmmWindow)
explicitnoexcept

Constructs a Gtk::Window wrapper.

This class keeps a weak reference to the Gtk::Window.

Parameters
refGtkmmWindowThe window. Cannot be null.

◆ GtkAccessor() [2/2]

stmi::GtkAccessor::GtkAccessor ( Gtk::Window *  p0GtkmmWindow)
explicitnoexcept

Constructs a Gtk::Window wrapper.

This class keeps a weak reference to the Gtk::Window.

Parameters
p0GtkmmWindowThe window. Cannot be null.

◆ ~GtkAccessor()

virtual stmi::GtkAccessor::~GtkAccessor ( )
virtualnoexcept

Member Function Documentation

◆ getGtkmmWindow()

Gtk::Window* stmi::GtkAccessor::getGtkmmWindow ( ) const
inlinenoexcept

The Gtk::Window pointer.

To know whether the pointer is valid call isDeleted().

Returns
The non owning Gtk::Window pointer.

◆ isDeleted()

bool stmi::GtkAccessor::isDeleted ( ) const
inlinenoexcept

Tells whether the window was deleted.

If it's the case the value returned by getGtkmmWindow() no longer is a valid pointer, but still can be useful to identify and remove data structures in a device manager.

Returns
Whether the window was deleted.

◆ operator==() [1/2]

bool stmi::GtkAccessor::operator== ( const Accessor oOther) const
overridevirtualnoexcept

Accessor comparison.

The other accessor has to be a GtkAccessor too and have the same window. Comparison works also when the window has been deleted.

Parameters
oOtherThe other instance this is comparing to.
Returns
Whether they're equal.

Implements stmi::Accessor.

◆ operator==() [2/2]

bool stmi::GtkAccessor::operator== ( const GtkAccessor oOther) const
noexcept

GtkAccessor comparison.

Two accessors are equal if their window is the same. This works also when the window has already been deleted.

Parameters
oOtherThe other instance this is comparing to.
Returns
Whether they're equal.