Main Page Widgets glibmm Namespaces Book

# Glib::ObjectBase Class Reference

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

Inheritance diagram for Glib::ObjectBase:

[legend]
List of all members.

## Public Member Functions

void | set_property_value (const Glib::ustring& property_name, const Glib::ValueBase& value)
| You probably want to use a specific property_*() accessor method instead.
void | get_property_value (const Glib::ustring& property_name, Glib::ValueBase& value) const
| You probably want to use a specific property_*() accessor method instead.
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.
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.
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, but this is necessary when using the reduced API.
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, but this is necessary when using the reduced API.
virtual void | reference () const
| Increment the reference count for this object.
virtual void | unreference () const
| Decrement the reference count for this object.
GObject* | gobj ()
| Provides access to the underlying C GtkObject.
const GObject* | gobj () const
| Provides access to the underlying C GtkObject.
GObject* | gobj_copy () const
| Give a ref-ed copy to someone. Use for direct struct access.

## 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.
| ObjectBase (const char* custom_type_name)
| A derived constructor always overrides this choice.
| 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.
virtual | ~ObjectBase ()=0
void | initialize (GObject* castitem)

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

## Constructor & Destructor Documentation

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.

Glib::ObjectBase::ObjectBase | ( | const char * | custom_type_name | ) | `[explicit, protected]`

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 = 0, 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.

Glib::ObjectBase::ObjectBase | ( | const std::type_info & | custom_type_info | ) | `[explicit, protected]`

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

virtual Glib::ObjectBase::~ObjectBase | ( |  | ) | `[protected, pure virtual]`

## Member Function Documentation

void Glib::ObjectBase::initialize | ( | GObject* | castitem | ) | `[protected]`

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.

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.

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.

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.

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, but this is necessary when using the reduced API.

See also connect_property_changed_with_return().

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, but this is necessary when using the reduced API.

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.

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

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

GObject* Glib::ObjectBase::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented in Glib::Interface, Gio::AppLaunchContext, Gio::AppInfo, Gio::AsyncResult, Gio::BufferedInputStream, Gio::BufferedOutputStream, Gio::Cancellable, Gio::DataInputStream, Gio::DataOutputStream, Gio::Drive, Gio::File, Gio::FileEnumerator, Gio::FileIcon, Gio::FileInfo, Gio::FileInputStream, Gio::FileMonitor, Gio::FilenameCompleter, Gio::FileOutputStream, Gio::FilterInputStream, Gio::FilterOutputStream, Gio::Icon, Gio::InputStream, Gio::LoadableIcon, Gio::MemoryInputStream, Gio::Mount, Gio::MountOperation, Gio::OutputStream, Gio::Seekable, Gio::SimpleAsyncResult, Gio::ThemedIcon, Gio::UnixInputStream, Gio::UnixOutputStream, Gio::Vfs, Gio::Volume, and Gio::VolumeMonitor.

const GObject* Glib::ObjectBase::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented in Glib::Interface, Gio::AppLaunchContext, Gio::AppInfo, Gio::AsyncResult, Gio::BufferedInputStream, Gio::BufferedOutputStream, Gio::Cancellable, Gio::DataInputStream, Gio::DataOutputStream, Gio::Drive, Gio::File, Gio::FileEnumerator, Gio::FileIcon, Gio::FileInfo, Gio::FileInputStream, Gio::FileMonitor, Gio::FilenameCompleter, Gio::FileOutputStream, Gio::FilterInputStream, Gio::FilterOutputStream, Gio::Icon, Gio::InputStream, Gio::LoadableIcon, Gio::MemoryInputStream, Gio::Mount, Gio::MountOperation, Gio::OutputStream, Gio::Seekable, Gio::SimpleAsyncResult, Gio::ThemedIcon, Gio::UnixInputStream, Gio::UnixOutputStream, Gio::Vfs, Gio::Volume, and Gio::VolumeMonitor.

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

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

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

- objectbase.h