glibmm  2.62.0
About: glibmm is a set of C++ bindings for glib, including cross-platform APIs such as a std::string-like UTF8 string class, string utility methods, such as a text encoding converter API, file access, and threads.
  Fossies Dox: glibmm-2.62.0.tar.xz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Glib::ObjectBase Class Referenceabstract

Glib::ObjectBase is a common base class for Objects and Interfaces. More...

#include <objectbase.h>

Inheritance diagram for Glib::ObjectBase:
[legend]
Collaboration diagram for Glib::ObjectBase:
[legend]

Public Member Functions

 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
void set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
 You probably want to use a specific property_*() accessor method instead. More...
 
void get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
 You probably want to use a specific property_*() accessor method instead. More...
 
template<class PropertyType >
void set_property (const Glib::ustring &property_name, const PropertyType &value)
 You probably want to use a specific property_*() accessor method instead. More...
 
template<class PropertyType >
void get_property (const Glib::ustring &property_name, PropertyType &value) const
 You probably want to use a specific property_*() accessor method instead. More...
 
void connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
 You can use the signal_changed() signal of the property proxy instead. More...
 
void connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot)
 You can use the signal_changed() signal of the property proxy instead. More...
 
sigc::connection connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
 You can use the signal_changed() signal of the property proxy instead. More...
 
sigc::connection connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot< void > &&slot)
 You can use the signal_changed() signal of the property proxy instead. More...
 
void freeze_notify ()
 Increases the freeze count on object. More...
 
void thaw_notify ()
 Reverts the effect of a previous call to freeze_notify(). More...
 
virtual void reference () const
 Increment the reference count for this object. More...
 
virtual void unreference () const
 Decrement the reference count for this object. More...
 
GObjectgobj ()
 Provides access to the underlying C GObject. More...
 
const GObjectgobj () const
 Provides access to the underlying C GObject. More...
 
GObjectgobj_copy () const
 Give a ref-ed copy to someone. Use for direct struct access. More...
 

Protected Member Functions

 ObjectBase ()
 This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. More...
 
 ObjectBase (const char *custom_type_name)
 A derived constructor always overrides this choice. More...
 
 ObjectBase (const std::type_info &custom_type_info)
 This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually. More...
 
 ObjectBase (ObjectBase &&src) noexcept
 
ObjectBaseoperator= (ObjectBase &&src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject *castitem)
 
void initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)
 

Detailed Description

Glib::ObjectBase is a common base class for Objects and Interfaces.

This is used as virtual base class. This means the ObjectBase constructor runs before all others, either implicitly or explicitly. Each of the available constructors initializes custom_type_name_ in a different way.

Definition at line 57 of file objectbase.h.

Constructor & Destructor Documentation

◆ ObjectBase() [1/5]

Glib::ObjectBase::ObjectBase ( const ObjectBase )
delete

◆ ObjectBase() [2/5]

Glib::ObjectBase::ObjectBase ( )
protected

This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor.

This is normal behaviour for C++ virtual inheritance.

The GType name will be gtkmm__anonymous_custom_type.

Definition at line 46 of file objectbase.cc.

◆ ObjectBase() [3/5]

Glib::ObjectBase::ObjectBase ( const char *  custom_type_name)
explicitprotected

A derived constructor always overrides this choice.

The C++ language itself ensures that the constructor is only invoked once.

All classes generated by gtkmmproc use this constructor, with custom_type_name = nullptr, which essentially means it's not a custom type. This is used to optimize vfunc and signal handler callbacks – since the C++ virtual methods are not overridden, invocation can be skipped.

The GType name will be custom_type_name.

Definition at line 53 of file objectbase.cc.

◆ ObjectBase() [4/5]

Glib::ObjectBase::ObjectBase ( const std::type_info &  custom_type_info)
explicitprotected

This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually.

This feature is sometimes necessary, e.g. to implement a custom Gtk::CellRenderer. The neat trick with the virtual base class ctor makes it possible to reuse the same direct base class' constructor as with non-custom types.

The GType name will be custom_type_info.name().

Definition at line 58 of file objectbase.cc.

◆ ObjectBase() [5/5]

Glib::ObjectBase::ObjectBase ( ObjectBase &&  src)
protectednoexcept

Definition at line 111 of file objectbase.cc.

◆ ~ObjectBase()

Glib::ObjectBase::~ObjectBase ( )
protectedpure virtualnoexcept

Definition at line 140 of file objectbase.cc.

References Glib::quark_.

Member Function Documentation

◆ connect_property_changed() [1/2]

void Glib::ObjectBase::connect_property_changed ( const Glib::ustring property_name,
const sigc::slot< void > &  slot 
)

You can use the signal_changed() signal of the property proxy instead.

See also connect_property_changed_with_return().

Definition at line 354 of file objectbase.cc.

References connect_property_changed_with_return().

◆ connect_property_changed() [2/2]

void Glib::ObjectBase::connect_property_changed ( const Glib::ustring property_name,
sigc::slot< void > &&  slot 
)

You can use the signal_changed() signal of the property proxy instead.

Since @PACKAGE_NAME@ 2.48:

Definition at line 361 of file objectbase.cc.

References connect_property_changed_with_return().

◆ connect_property_changed_with_return() [1/2]

sigc::connection Glib::ObjectBase::connect_property_changed_with_return ( const Glib::ustring property_name,
const sigc::slot< void > &  slot 
)

You can use the signal_changed() signal of the property proxy instead.

This method was added because connect_property_changed() does not return a sigc::connection, and we could not break the ABI by changing that function.

Definition at line 367 of file objectbase.cc.

References gobj().

Referenced by connect_property_changed().

◆ connect_property_changed_with_return() [2/2]

sigc::connection Glib::ObjectBase::connect_property_changed_with_return ( const Glib::ustring property_name,
sigc::slot< void > &&  slot 
)

You can use the signal_changed() signal of the property proxy instead.

Since @PACKAGE_NAME@ 2.48:

Definition at line 380 of file objectbase.cc.

References gobj().

◆ freeze_notify()

void Glib::ObjectBase::freeze_notify ( )

Increases the freeze count on object.

If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero.

This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

Definition at line 393 of file objectbase.cc.

References gobj().

◆ get_property()

template<class PropertyType >
void Glib::ObjectBase::get_property ( const Glib::ustring property_name,
PropertyType &  value 
) const

You probably want to use a specific property_*() accessor method instead.

◆ get_property_value()

void Glib::ObjectBase::get_property_value ( const Glib::ustring property_name,
Glib::ValueBase value 
) const

You probably want to use a specific property_*() accessor method instead.

Definition at line 348 of file objectbase.cc.

References Glib::ustring::c_str(), Glib::ValueBase::gobj(), and gobj().

◆ gobj() [1/2]

◆ gobj() [2/2]

const GObject* Glib::ObjectBase::gobj ( ) const
inline

Provides access to the underlying C GObject.

Definition at line 186 of file objectbase.h.

◆ gobj_copy()

GObject * Glib::ObjectBase::gobj_copy ( ) const

Give a ref-ed copy to someone. Use for direct struct access.

Definition at line 203 of file objectbase.cc.

References reference().

◆ initialize()

void Glib::ObjectBase::initialize ( GObject castitem)
protected

Definition at line 68 of file objectbase.cc.

Referenced by Glib::Interface::Interface(), and Glib::Object::Object().

◆ initialize_move()

void Glib::ObjectBase::initialize_move ( GObject castitem,
Glib::ObjectBase previous_wrapper 
)
protected

Definition at line 89 of file objectbase.cc.

Referenced by Glib::Object::Object().

◆ operator=() [1/2]

ObjectBase& Glib::ObjectBase::operator= ( const ObjectBase )
delete

Referenced by Glib::Object::operator=().

◆ operator=() [2/2]

ObjectBase & Glib::ObjectBase::operator= ( ObjectBase &&  src)
protectednoexcept

Definition at line 120 of file objectbase.cc.

References Glib::quark_.

◆ reference()

void Glib::ObjectBase::reference ( ) const
virtual

Increment the reference count for this object.

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

Definition at line 189 of file objectbase.cc.

References GLIBMM_DEBUG_REFERENCE.

Referenced by Gio::Socket::create_source(), Gio::TcpWrapperConnection::get_base_io_stream(), Gio::TlsConnection::get_certificate(), Gio::DBus::ObjectManagerClient::get_connection(), Gio::Application::get_dbus_connection(), Gio::Application::get_default(), Gio::VolumeMonitor::get_mount_for_uuid(), Gio::TlsConnection::get_peer_certificate(), Gio::DBus::Connection::get_peer_credentials(), Gio::SocketClient::get_proxy_resolver(), Glib::Binding::get_source(), Gio::DBus::Connection::get_stream(), Glib::Binding::get_target(), Gio::VolumeMonitor::get_volume_for_uuid(), Gio::MenuAttributeIter::gobj_copy(), Gio::CharsetConverter::gobj_copy(), Gio::MenuLinkIter::gobj_copy(), Gio::Cancellable::gobj_copy(), Gio::ProxyAddress::gobj_copy(), Gio::MenuItem::gobj_copy(), Gio::SimplePermission::gobj_copy(), Gio::SocketAddressEnumerator::gobj_copy(), Gio::FilterInputStream::gobj_copy(), Gio::FilenameCompleter::gobj_copy(), Gio::ZlibDecompressor::gobj_copy(), Gio::DataInputStream::gobj_copy(), Gio::DataOutputStream::gobj_copy(), Gio::TcpConnection::gobj_copy(), Gio::FilterOutputStream::gobj_copy(), Gio::UnixOutputStream::gobj_copy(), Gio::SocketAddress::gobj_copy(), Gio::TcpWrapperConnection::gobj_copy(), Gio::ConverterInputStream::gobj_copy(), Gio::ConverterOutputStream::gobj_copy(), Gio::UnixInputStream::gobj_copy(), Gio::NetworkAddress::gobj_copy(), Gio::FileIcon::gobj_copy(), Gio::VolumeMonitor::gobj_copy(), Gio::UnixFDList::gobj_copy(), Gio::MemoryInputStream::gobj_copy(), Gio::ListStoreBase::gobj_copy(), Gio::Menu::gobj_copy(), Gio::SimpleAction::gobj_copy(), Gio::UnixConnection::gobj_copy(), Gio::InputStream::gobj_copy(), Gio::SimpleActionGroup::gobj_copy(), Gio::SimpleIOStream::gobj_copy(), Gio::InetSocketAddress::gobj_copy(), Gio::EmblemedIcon::gobj_copy(), Gio::UnixCredentialsMessage::gobj_copy(), Gio::BufferedOutputStream::gobj_copy(), Gio::NetworkService::gobj_copy(), Gio::InetAddress::gobj_copy(), Gio::FileInputStream::gobj_copy(), Gio::FileIOStream::gobj_copy(), Gio::ThemedIcon::gobj_copy(), Gio::UnixFDMessage::gobj_copy(), Gio::AppLaunchContext::gobj_copy(), Gio::DBus::MenuModel::gobj_copy(), Gio::BufferedInputStream::gobj_copy(), Gio::FileOutputStream::gobj_copy(), Gio::TlsCertificate::gobj_copy(), Gio::SocketListener::gobj_copy(), Gio::DBus::ActionGroup::gobj_copy(), Gio::MemoryOutputStream::gobj_copy(), Gio::DBus::ObjectProxy::gobj_copy(), Gio::ThreadedSocketService::gobj_copy(), Gio::Permission::gobj_copy(), Gio::SocketConnection::gobj_copy(), Gio::FileEnumerator::gobj_copy(), Gio::DBus::ObjectSkeleton::gobj_copy(), Gio::DesktopAppInfo::gobj_copy(), Gio::SocketControlMessage::gobj_copy(), Gio::SocketService::gobj_copy(), Gio::ApplicationCommandLine::gobj_copy(), Gio::DBus::MethodInvocation::gobj_copy(), Gio::DBus::ObjectManagerServer::gobj_copy(), Gio::Emblem::gobj_copy(), Gio::DBus::AuthObserver::gobj_copy(), Gio::ZlibCompressor::gobj_copy(), Gio::Credentials::gobj_copy(), Gio::TlsConnection::gobj_copy(), Gio::OutputStream::gobj_copy(), Gio::FileMonitor::gobj_copy(), Gio::UnixSocketAddress::gobj_copy(), Gio::Notification::gobj_copy(), Gio::TlsPassword::gobj_copy(), gobj_copy(), Gio::MenuModel::gobj_copy(), Gio::IOStream::gobj_copy(), Gio::SocketClient::gobj_copy(), Gio::DBus::InterfaceSkeleton::gobj_copy(), Gio::Resolver::gobj_copy(), Gio::Settings::gobj_copy(), Gio::DBus::Server::gobj_copy(), Gio::DBus::Proxy::gobj_copy(), Gio::TlsInteraction::gobj_copy(), Gio::MountOperation::gobj_copy(), Glib::Binding::gobj_copy(), Gio::TlsDatabase::gobj_copy(), Gio::DBus::ObjectManagerClient::gobj_copy(), Gio::Application::gobj_copy(), Gio::FileInfo::gobj_copy(), Gio::Socket::gobj_copy(), Gio::DBus::Message::gobj_copy(), Gio::DBus::Connection::gobj_copy(), and Glib::wrap_auto().

◆ set_property()

template<class PropertyType >
void Glib::ObjectBase::set_property ( const Glib::ustring property_name,
const PropertyType &  value 
)

You probably want to use a specific property_*() accessor method instead.

◆ set_property_value()

void Glib::ObjectBase::set_property_value ( const Glib::ustring property_name,
const Glib::ValueBase value 
)

You probably want to use a specific property_*() accessor method instead.

Definition at line 342 of file objectbase.cc.

References Glib::ustring::c_str(), Glib::ValueBase::gobj(), and gobj().

◆ thaw_notify()

void Glib::ObjectBase::thaw_notify ( )

Reverts the effect of a previous call to freeze_notify().

The freeze count is decreased on object and when it reaches zero, all queued "notify" signals are emitted.

It is an error to call this function when the freeze count is zero.

Definition at line 399 of file objectbase.cc.

References gobj().

◆ unreference()

void Glib::ObjectBase::unreference ( ) const
virtual

Decrement the reference count for this object.

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

Definition at line 196 of file objectbase.cc.

References GLIBMM_DEBUG_UNREFERENCE.


The documentation for this class was generated from the following files: