The gtkmm API has been modified slightly for the Maemo platform, making it more suitable for use on devices with reduced resources and added some new functions that are helpful on these devices. For the maemomm platform these changes were selected by building glibmm and gtkmm with these options:
--enable-deprecated=no
--enable-api-exceptions=no
--enable-api-properties=no
--enable-api-default-signal-handlers=no
--enable-api-atk=no
In general, this optional API is rarely used, and there are slightly less convenient alternatives for all of the optional API. Preprocessor macros indicate that the API is not available, so you can make sure that your application builds with both the maemomm gtkmm API and the regular gtkmm API by checking for these macros with #ifdef.
Deprecated gtkmm classes and methods, such as Gtk::Combo
are not available. Check the gtkmm documentation to find an alternative class or method.
If deprecated API is available, the GLIBMM_DISABLE_DEPRECATED
macro will not be defined.
No exceptions are used in this version of the gtkmm API, and no exceptions will be thrown. This allows applications to be built without support for exceptions, allowing their executables to be much smaller.
Where a method would normally throw an exception, that method will instead take an additional std::auto_ptr<Glib::Error>& output parameter which you should check after calling the method.
If exceptions are not available, the GLIBMM_EXCEPTIONS_ENABLED
macro will not be defined.
No property accessors are available in this version of the gtkmm API. For instance, the Gtk::Button::property_label()
method is not available. "getter" and "setter" methods, such as Gtk::Button::set_label()
will still be available.
When you really need to set or get the property value directly, for instance when using the Gtk::CellRenderer
API, you can use the alternative set_property()
and get_property()
methods. For instance:
#ifdef GLIBMM_PROPERTIES_ENABLED m_cellrenderer.property_editable() = true; #else m_cellrenderer.set_property("editable", true); #endif
To connect a signal handler that will be called when the value of the property changes, you would normally connect to the property's signal_changed
signal. But with this version of the gtkmm API, you should instead call the connect_property_changed()
function, passing it the property name and the signal handler.
If property accessors are not available, the GLIBMM_PROPERTIES_ENABLED
macro will not be defined.
No virtual signal handler methods are available in this version of the gtkmm API. For instance, the Gtk::Button::on_clicked()
method does not exist. Instead you must connect a signal handler by using the signal_clicked() accessor. This option offers a considerable code size and per-object memory reduction.
Note, however, that the compiler will not complain if you attempt to override a default signal handler when they are not supported by gtkmm, because the compiler cannot know that you expected to override a virtual method.
If default signal handlers are not available, the GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
macro will not be defined.