mousetrap v0.2.0
|
object that can emit GLib signals \for_internal_use_only More...
#include <signal_emitter.hpp>
Public Member Functions | |
void | set_signal_blocked (const std::string &signal_id, bool b) |
block a signal by id \for_internal_use_only | |
bool | get_signal_blocked (const std::string &signal_id) const |
get whether a signal is currently blocked | |
std::vector< std::string > | get_all_signal_names () |
get list of possible signal ids \for_internal_use_only | |
template<typename Function_t > | |
void | connect_signal (const std::string &signal_id, Function_t *function, void *data=nullptr) |
connect static function to signal, does not work with lambdas \for_internal_use_only | |
void | disconnect_signal (const std::string &signal_id) |
disconnect signal, it may not be invoked until reconnected, if signal is not registered, does nothing. For internal use only | |
virtual | operator NativeObject () const =0 |
expose as NativeObject, this is the GLib instance that signals are emitted on \for_internal_use_only | |
virtual NativeObject | get_internal () const |
expose internally managed object, \for_internal_use_only | |
Protected Member Functions | |
SignalEmitter () | |
ctor | |
~SignalEmitter () | |
destructor | |
object that can emit GLib signals \for_internal_use_only
void mousetrap::SignalEmitter::connect_signal | ( | const std::string & | signal_id, |
Function_t * | function, | ||
void * | data = nullptr |
||
) |
connect static function to signal, does not work with lambdas \for_internal_use_only
Function_t | static function pointer, the user is responsible for asserting that the function has the correct signature |
signal_id | glib id of the signal |
function | pointer to C-function, does not work with lambdas |
data | void-pointer to arbitrary data |
References disconnect_signal().
Referenced by mousetrap::SpinButton::set_text_to_value_function(), mousetrap::Widget::set_tooltip_widget(), and mousetrap::SpinButton::set_value_to_text_function().
void mousetrap::SignalEmitter::disconnect_signal | ( | const std::string & | signal_id | ) |
disconnect signal, it may not be invoked until reconnected, if signal is not registered, does nothing. For internal use only
signal_id |
Referenced by connect_signal(), and mousetrap::SpinButton::reset_value_to_text_function().
std::vector< std::string > mousetrap::SignalEmitter::get_all_signal_names | ( | ) |
get list of possible signal ids \for_internal_use_only
|
virtual |
expose internally managed object, \for_internal_use_only
Reimplemented in mousetrap::FrameClock, mousetrap::Grid, mousetrap::ProgressBar, mousetrap::RenderArea, mousetrap::Revealer, mousetrap::Scale, mousetrap::Separator, mousetrap::Spinner, mousetrap::Stack, mousetrap::ToggleButton, mousetrap::Viewport, mousetrap::Action, mousetrap::ActionBar, mousetrap::Adjustment, mousetrap::Application, mousetrap::AspectFrame, mousetrap::Box, mousetrap::Button, mousetrap::CenterBox, mousetrap::CheckButton, mousetrap::ClampFrame, mousetrap::ColumnView, mousetrap::DropDown, mousetrap::Entry, mousetrap::EventController, mousetrap::Expander, mousetrap::FileChooser, mousetrap::FileMonitor, mousetrap::Fixed, mousetrap::FlowBox, mousetrap::Frame, mousetrap::GridView, mousetrap::HeaderBar, mousetrap::ImageDisplay, mousetrap::Label, mousetrap::LevelBar, mousetrap::ListView, mousetrap::MenuBar, mousetrap::MenuModel, mousetrap::MultisampledRenderTexture, mousetrap::Notebook, mousetrap::Overlay, mousetrap::Paned, mousetrap::Popover, mousetrap::PopoverButton, mousetrap::PopoverMenu, mousetrap::PopupMessage, mousetrap::PopupMessageOverlay, mousetrap::RenderTexture, mousetrap::Scrollbar, mousetrap::SelectionModel, mousetrap::Shader, mousetrap::Shape, mousetrap::SpinButton, mousetrap::Switch, mousetrap::TextView, mousetrap::Texture, mousetrap::TransformBin, mousetrap::Widget, and mousetrap::Window.
bool mousetrap::SignalEmitter::get_signal_blocked | ( | const std::string & | signal_id | ) | const |
get whether a signal is currently blocked
|
explicitpure virtual |
expose as NativeObject, this is the GLib instance that signals are emitted on \for_internal_use_only
Implemented in mousetrap::Animation, mousetrap::PopupMessage, mousetrap::Action, mousetrap::Adjustment, mousetrap::Application, mousetrap::Entry, mousetrap::EventController, mousetrap::FileChooser, mousetrap::FileMonitor, mousetrap::MenuModel, mousetrap::SelectionModel, mousetrap::Shader, mousetrap::Shape, mousetrap::TextView, mousetrap::Widget, and mousetrap::Window.
void mousetrap::SignalEmitter::set_signal_blocked | ( | const std::string & | signal_id, |
bool | b | ||
) |
block a signal by id \for_internal_use_only
signal_id | |
b | true if signal handler should not be invoked, false otherwise |
References mousetrap::log::critical().