-2.34.3 (unstable):
+2.43.90 (unstable):
+
+Glib:
+* Error::register_init(): Call Glib::wrap_register_init().
+ (Kjell Ahlstedt) Bug #743466 (Mike Fleetwood).
+* OptionGroup:
+ - Fix enable/disable bool option pairs.
+ (Kjell Ahlstedt) Bug #744854 (Tom Schoonjans)
+ - Fix memory leaks
+ (Kjell Ahlstedt) Bug #745173.
+ - Don't use deprecate g_option_group_free().
+ (Kjell Ahlstedt)
+* Value: Deprecate Value<char>, add Value<signed char>.
+ Because g_value_[get,set]_char() are deprecated in favour of
+ g_value_[get,set]_schar().
+ (Kjell Ahlstedt)
+
+Gio:
+* Application: Deprecate property_action_group().
+ (Kjell Ahlstedt)
+* Notification: Add set_priority() and enum NotificationPriority.
+ (Kjell Ahlstedt)
+* Add TcpWrapperConnection.
+ (Murray Cumming)
+* UnixSocketAddress: Deprecate property_abstract().
+ (Kjell Ahlstedt)
+
+gmmproc:
+* Fix error messages in glib and gio by removing unnecessary _IGNORES().
+ (Kjell Ahlstedt)
+* h2def.py: Remove *_DEPRECATED_IN_*_*_FOR(*) prefixes with white space.
+ (Kjell Ahlstedt)
+* Put DOXYGEN_SHOULD_SKIP_THIS around *_Class prototypes.
+ To workaround a doxygen bug, to fix the genereated DevHelp search index.
+ (Murray Cumming) Bug #743918
+
+
+2.43.3 (unstable):
Glib:
* Binding: Rename and change BindingTransformSlot to SlotTransform.
## You should have received a copy of the GNU Lesser General Public License
## along with this library. If not, see <http://www.gnu.org/licenses/>.
-AC_INIT([glibmm], [2.43.3],
+AC_INIT([glibmm], [2.43.90],
[http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
[glibmm], [http://www.gtkmm.org/])
AC_PREREQ([2.59])
AC_DEFINE([GIOMM_STATIC_LIB], [1], [Define if giomm is built as a static library])
])
-glibreq='2.0 >= 2.43.1'
+glibreq='2.0 >= 2.43.90'
GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq"
GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq"
#include <giomm/socketsource.h>
#include <giomm/srvtarget.h>
#include <giomm/tcpconnection.h>
+#include <giomm/tcpwrapperconnection.h>
#include <giomm/themedicon.h>
#include <giomm/threadedsocketservice.h>
#include <giomm/tlscertificate.h>
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2007 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
_WRAP_METHOD(void send_notification(const Glib::ustring& id{?}, const Glib::RefPtr<Notification>& notification), g_application_send_notification)
_WRAP_METHOD(void withdraw_notification(const Glib::ustring& id), g_application_withdraw_notification)
- _WRAP_PROPERTY("action-group", Glib::RefPtr<ActionGroup>)
+ _WRAP_PROPERTY("action-group", Glib::RefPtr<ActionGroup>, deprecated "Use the Gio::ActionMap interface instead.")
_WRAP_PROPERTY("application-id", Glib::ustring)
_WRAP_PROPERTY("flags", ApplicationFlags)
_WRAP_PROPERTY("inactivity-timeout", guint)
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2007 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* @param flags Flags affecting the operation.
*/
void mount_enclosing_volume(MountMountFlags flags = MOUNT_MOUNT_NONE);
- _IGNORE(g_file_mount_enclosing _volume)
+ _IGNORE(g_file_mount_enclosing_volume)
_WRAP_METHOD(bool mount_enclosing_volume_finish(const Glib::RefPtr<AsyncResult>& result),
g_file_mount_enclosing_volume_finish,
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2007 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
_WRAP_METHOD(Glib::RefPtr<FileInfo> query_info_finish(const Glib::RefPtr<AsyncResult>& result),
g_file_input_stream_query_info_finish,
errthrow)
-
- //These seem to be just C convenience functions - they are already in the Seekable base class:
- //See http://bugzilla.gnome.org/show_bug.cgi?id=509990
- _IGNORE(g_file_input_stream_tell, g_file_input_stream_can_seek, g_file_input_stream_seek)
-// _WRAP_METHOD(goffset tell() const, g_file_input_stream_tell)
-// _WRAP_METHOD(bool can_seek() const, g_file_input_stream_can_seek)
-// _WRAP_METHOD(bool seek(goffset offset, Glib::SeekType type, const Glib::RefPtr<Cancellable>& cancellable),
-// g_file_input_stream_seek,
-// errthrow)
};
} // namespace Gio
gio_methods.defs \
gio_extra_objects.defs \
gio_unix_functions.defs \
- gio_others.defs \
gio_signals.defs \
gio_vfuncs.defs \
gio_docs.xml \
socketservice.hg \
srvtarget.hg \
tcpconnection.hg \
+ tcpwrapperconnection.hg \
threadedsocketservice.hg \
themedicon.hg \
tlscertificate.hg \
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2007 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
refreturn, errthrow)
_WRAP_METHOD(std::string get_etag() const, g_file_output_stream_get_etag)
-
- //These seem to be just C convenience functions - they are already in the Seekable base class:
- //See http://bugzilla.gnome.org/show_bug.cgi?id=509990
- _IGNORE(g_file_output_stream_tell, g_file_output_stream_can_seek, g_file_output_stream_seek,
- g_file_output_stream_can_truncate, g_file_output_stream_truncate)
-// _WRAP_METHOD(goffset tell() const, g_file_output_stream_tell)
-// _WRAP_METHOD(bool can_seek() const, g_file_output_stream_can_seek)
-// _WRAP_METHOD(bool seek(goffset offset, Glib::SeekType type, const Glib::RefPtr<Cancellable>& cancellable),
-// g_file_output_stream_seek,
-// errthrow)
-// _WRAP_METHOD(bool can_truncate() const, g_file_output_stream_can_truncate)
-// _WRAP_METHOD(bool truncate(goffset size, const Glib::RefPtr<Cancellable>& cancellable),
-// g_file_output_stream_truncate,
-// errthrow)
};
} // namespace Gio
</parameters>
</enum>
+<signal name="GListModel::items-changed">
+<description>
+This signal is emitted whenever items were added or removed to
+@list. At @position, @removed items were removed and @added items
+were added in their place.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="list">
+<parameter_description> the #GListModel that changed
+</parameter_description>
+</parameter>
+<parameter name="position">
+<parameter_description> the position at which @list changed
+</parameter_description>
+</parameter>
+<parameter name="removed">
+<parameter_description> the number of items removed
+</parameter_description>
+</parameter>
+<parameter name="added">
+<parameter_description> the number of items added
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</signal>
+
<signal name="GMenuModel::items-changed">
<description>
Emitted when a change has occured to the menu.
</return>
</function>
+<function name="g_list_model_get_item">
+<description>
+Get the item at @position. If @position is greater than the number of
+items in @list, %NULL is returned.
+
+%NULL is never returned for an index that is smaller than the length
+of the list. See g_list_model_get_n_items().
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="list">
+<parameter_description> a #GListModel
+</parameter_description>
+</parameter>
+<parameter name="position">
+<parameter_description> the position of the item to fetch
+</parameter_description>
+</parameter>
+</parameters>
+<return> the item at @position.
+
+</return>
+</function>
+
+<function name="g_list_model_get_item_type">
+<description>
+Gets the type of the items in @list. All items returned from
+g_list_model_get_type() are of that type or a subtype, or are an
+implementation of that interface.
+
+The item type of a #GListModel can not change during the life of the
+model.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="list">
+<parameter_description> a #GListModel
+</parameter_description>
+</parameter>
+</parameters>
+<return> the #GType of the items contained in @list.
+
+</return>
+</function>
+
+<function name="g_list_model_get_n_items">
+<description>
+Gets the number of items in @list.
+
+Depending on the model implementation, calling this function may be
+less efficient than iterating the list with increasing values for
+@position until g_list_model_get_item() returns %NULL.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="list">
+<parameter_description> a #GListModel
+</parameter_description>
+</parameter>
+</parameters>
+<return> the number of items in @list.
+
+</return>
+</function>
+
+<function name="g_list_model_get_object">
+<description>
+Get the item at @position. If @position is greater than the number of
+items in @list, %NULL is returned.
+
+%NULL is never returned for an index that is smaller than the length
+of the list. See g_list_model_get_n_items().
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="list">
+<parameter_description> a #GListModel
+</parameter_description>
+</parameter>
+<parameter name="position">
+<parameter_description> the position of the item to fetch
+</parameter_description>
+</parameter>
+</parameters>
+<return> the object at @position.
+
+</return>
+</function>
+
+<function name="g_list_model_items_changed">
+<description>
+Emits the #GListModel::items-changed signal on @list.
+
+This function should only be called by classes implementing
+#GListModel. It has to be called after the internal representation
+of @list has been updated, because handlers connected to this signal
+might query the new state of the list.
+
+Implementations must only make changes to the model (as visible to
+its consumer) in places that will not cause problems for that
+consumer. For models that are driven directly by a write API (such
+as #GListStore), changes can be reported in response to uses of that
+API. For models that represent remote data, changes should only be
+made from a fresh mainloop dispatch. It is particularly not
+permitted to make changes in response to a call to the #GListModel
+consumer API.
+
+Stated another way: in general, it is assumed that code making a
+series of accesses to the model via the API, without returning to the
+mainloop, and without calling other code, will continue to view the
+same contents of the model.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="list">
+<parameter_description> a #GListModel
+</parameter_description>
+</parameter>
+<parameter name="position">
+<parameter_description> the position at which @list changed
+</parameter_description>
+</parameter>
+<parameter name="removed">
+<parameter_description> the number of items removed
+</parameter_description>
+</parameter>
+<parameter name="added">
+<parameter_description> the number of items added
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_list_store_append">
+<description>
+Appends @item to @store. @item must be of type #GListStore:item-type.
+
+This function takes a ref on @item.
+
+Use g_list_store_splice() to append multiple items at the same time
+efficiently.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="store">
+<parameter_description> a #GListStore
+</parameter_description>
+</parameter>
+<parameter name="item">
+<parameter_description> the new item
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_list_store_insert">
+<description>
+Inserts @item into @store at @position. @item must be of type
+#GListStore:item-type or derived from it. @position must be smaller
+than the length of the list, or equal to it to append.
+
+This function takes a ref on @item.
+
+Use g_list_store_splice() to insert multiple items at the same time
+efficiently.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="store">
+<parameter_description> a #GListStore
+</parameter_description>
+</parameter>
+<parameter name="position">
+<parameter_description> the position at which to insert the new item
+</parameter_description>
+</parameter>
+<parameter name="item">
+<parameter_description> the new item
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_list_store_insert_sorted">
+<description>
+Inserts @item into @store at a position to be determined by the
+@compare_func.
+
+The list must already be sorted before calling this function or the
+result is undefined. Usually you would approach this by only ever
+inserting items by way of this function.
+
+This function takes a ref on @item.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="store">
+<parameter_description> a #GListStore
+</parameter_description>
+</parameter>
+<parameter name="item">
+<parameter_description> the new item
+</parameter_description>
+</parameter>
+</parameters>
+<return> the position at which @item was inserted
+
+</return>
+</function>
+
+<function name="g_list_store_new">
+<description>
+Creates a new #GListStore with items of type @item_type. @item_type
+must be a subclass of #GObject.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="item_type">
+<parameter_description> the #GType of items in the list
+</parameter_description>
+</parameter>
+</parameters>
+<return> a new #GListStore
+</return>
+</function>
+
+<function name="g_list_store_remove">
+<description>
+Removes the item from @store that is at @position. @position must be
+smaller than the current length of the list.
+
+Use g_list_store_splice() to remove multiple items at the same time
+efficiently.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="store">
+<parameter_description> a #GListStore
+</parameter_description>
+</parameter>
+<parameter name="position">
+<parameter_description> the position of the item that is to be removed
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_list_store_remove_all">
+<description>
+Removes all items from @store.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="store">
+<parameter_description> a #GListStore
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_list_store_splice">
+<description>
+Changes @store by removing @n_removals items and adding @n_additions
+items to it. @additions must contain @n_additions items of type
+#GListStore:item-type. %NULL is not permitted.
+
+This function is more efficient than g_list_store_insert() and
+g_list_store_remove(), because it only emits
+#GListModel::items-changed once for the change.
+
+This function takes a ref on each item in @additions.
+
+The parameters @position and @n_removals must be correct (ie:
+@position + @n_removals must be less than or equal to the length of
+the list at the time this function is called).
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="store">
+<parameter_description> a #GListStore
+</parameter_description>
+</parameter>
+<parameter name="position">
+<parameter_description> the position at which to make the change
+</parameter_description>
+</parameter>
+<parameter name="n_removals">
+<parameter_description> the number of items to remove
+</parameter_description>
+</parameter>
+<parameter name="additions">
+<parameter_description> the items to add
+</parameter_description>
+</parameter>
+<parameter name="n_additions">
+<parameter_description> the number of items to add
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
<function name="g_loadable_icon_load">
<description>
Loads a loadable icon. For the asynchronous version of this function,
</return>
</function>
+<function name="g_settings_schema_key_get_name">
+<description>
+Gets the name of @key.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a #GSettingsSchemaKey
+</parameter_description>
+</parameter>
+</parameters>
+<return> the name of @key.
+
+</return>
+</function>
+
<function name="g_settings_schema_key_get_range">
<description>
Queries the range of a key.
<return></return>
</function>
+<function name="g_settings_schema_list_children">
+<description>
+Gets the list of children in @schema.
+
+You should free the return value with g_strfreev() when you are done
+with it.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="schema">
+<parameter_description> a #GSettingsSchema
+</parameter_description>
+</parameter>
+</parameters>
+<return> a list of the children on @settings
+
+</return>
+</function>
+
<function name="g_settings_schema_ref">
<description>
Increase the reference count of @schema, returning a new reference.
<return></return>
</function>
+<function name="g_simple_action_set_state_hint">
+<description>
+Sets the state hint for the action.
+
+See g_action_get_state_hint() for more information about
+action state hints.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="simple">
+<parameter_description> a #GSimpleAction
+</parameter_description>
+</parameter>
+<parameter name="state_hint">
+<parameter_description> a #GVariant representing the state hint
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
<function name="g_simple_async_report_error_in_idle">
<description>
Reports an error in an asynchronous function in an idle function by
(gtype-id "G_TYPE_MENU_ITEM")
)
+(define-object NetworkMonitor
+ (in-module "Gio")
+ (c-name "GNetworkMonitor")
+ (gtype-id "G_TYPE_NETWORK_MONITOR")
+)
+
+(define-object Notification
+ (in-module "Gio")
+ (c-name "GNotification")
+ (gtype-id "G_TYPE_NOTIFICATION")
+)
+
(define-object PollableInputStream
(in-module "Gio")
(c-name "GPollableInputStream")
(gtype-id "G_TYPE_PROXY_RESOLVER")
)
+(define-object Resource
+ (in-module "Gio")
+ (c-name "GResource")
+ (gtype-id "G_TYPE_RESOURCE")
+)
+
(define-object SimpleAction
(in-module "Gio")
(c-name "GSimpleAction")
)
)
+(define-method bind_busy_property
+ (of-object "GApplication")
+ (c-name "g_application_bind_busy_property")
+ (return-type "none")
+ (parameters
+ '("gpointer" "object")
+ '("const-gchar*" "property")
+ )
+)
+
;; From gapplicationimpl.h
+;; From gio-autocleanups.h
+
+
+
;; From gioenums.h
+;; From glistmodel.h
+
+(define-method get_item_type
+ (of-object "GListModel")
+ (c-name "g_list_model_get_item_type")
+ (return-type "GType")
+)
+
+(define-method get_n_items
+ (of-object "GListModel")
+ (c-name "g_list_model_get_n_items")
+ (return-type "guint")
+)
+
+(define-method get_item
+ (of-object "GListModel")
+ (c-name "g_list_model_get_item")
+ (return-type "gpointer")
+ (parameters
+ '("guint" "position")
+ )
+)
+
+(define-method get_object
+ (of-object "GListModel")
+ (c-name "g_list_model_get_object")
+ (return-type "GObject*")
+ (parameters
+ '("guint" "position")
+ )
+)
+
+(define-method items_changed
+ (of-object "GListModel")
+ (c-name "g_list_model_items_changed")
+ (return-type "none")
+ (parameters
+ '("guint" "position")
+ '("guint" "removed")
+ '("guint" "added")
+ )
+)
+
+
+
+;; From gliststore.h
+
+(define-method insert
+ (of-object "GListStore")
+ (c-name "g_list_store_insert")
+ (return-type "none")
+ (parameters
+ '("guint" "position")
+ '("gpointer" "item")
+ )
+)
+
+(define-method insert_sorted
+ (of-object "GListStore")
+ (c-name "g_list_store_insert_sorted")
+ (return-type "guint")
+ (parameters
+ '("gpointer" "item")
+ '("GCompareDataFunc" "compare_func")
+ '("gpointer" "user_data")
+ )
+)
+
+(define-method append
+ (of-object "GListStore")
+ (c-name "g_list_store_append")
+ (return-type "none")
+ (parameters
+ '("gpointer" "item")
+ )
+)
+
+(define-method remove
+ (of-object "GListStore")
+ (c-name "g_list_store_remove")
+ (return-type "none")
+ (parameters
+ '("guint" "position")
+ )
+)
+
+(define-method remove_all
+ (of-object "GListStore")
+ (c-name "g_list_store_remove_all")
+ (return-type "none")
+)
+
+(define-method splice
+ (of-object "GListStore")
+ (c-name "g_list_store_splice")
+ (return-type "none")
+ (parameters
+ '("guint" "position")
+ '("guint" "n_removals")
+ '("gpointer*" "additions")
+ '("guint" "n_additions")
+ )
+)
+
+
+
;; From gloadableicon.h
(define-function g_loadable_icon_get_type
)
)
+(define-method list_children
+ (of-object "GSettingsSchema")
+ (c-name "g_settings_schema_list_children")
+ (return-type "gchar**")
+)
+
(define-function g_settings_schema_key_get_type
(c-name "g_settings_schema_key_get_type")
(return-type "GType")
)
)
+(define-method get_name
+ (of-object "GSettingsSchemaKey")
+ (c-name "g_settings_schema_key_get_name")
+ (return-type "const-gchar*")
+)
+
(define-method get_summary
(of-object "GSettingsSchemaKey")
(c-name "g_settings_schema_key_get_summary")
)
)
+(define-method set_state_hint
+ (of-object "GSimpleAction")
+ (c-name "g_simple_action_set_state_hint")
+ (return-type "none")
+ (parameters
+ '("GVariant*" "state_hint")
+ )
+)
+
;; From gsimpleasyncresult.h
;; From gunixmounts.h
-(define-function g_unix_mount_free
- (c-name "g_unix_mount_free")
- (return-type "none")
- (parameters
- '("GUnixMountEntry*" "mount_entry")
- )
-)
-
(define-method free
(of-object "GUnixMountPoint")
(c-name "g_unix_mount_point_free")
+++ /dev/null
---- gio_methods.defs 2011-06-19 18:23:06.000000000 -0400
-+++ gio_methods_new.defs 2011-06-19 18:21:21.000000000 -0400
-@@ -867,8 +867,8 @@
- (c-name "GFileQueryInfoFlags")
- (gtype-id "G_TYPE_FILE_QUERY_INFO_FLAGS")
- (values
-- '("ne" "G_FILE_QUERY_INFO_NONE")
-- '("follow-symlinks" "G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS")
-+ '("none" "G_FILE_QUERY_INFO_NONE")
-+ '("nofollow-symlinks" "G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS")
- )
- )
-
-@@ -888,7 +888,7 @@
- (c-name "GMountMountFlags")
- (gtype-id "G_TYPE_MOUNT_MOUNT_FLAGS")
- (values
-- '("e" "G_MOUNT_MOUNT_NONE")
-+ '("none" "G_MOUNT_MOUNT_NONE")
- )
- )
-
-@@ -907,7 +907,7 @@
- (c-name "GDriveStartFlags")
- (gtype-id "G_TYPE_DRIVE_START_FLAGS")
- (values
-- '("e" "G_DRIVE_START_NONE")
-+ '("none" "G_DRIVE_START_NONE")
- )
- )
-
-@@ -1321,8 +1321,8 @@
- (c-name "GDBusCallFlags")
- (gtype-id "G_TYPE_D_BUS_CALL_FLAGS")
- (values
-- '("ne" "G_DBUS_CALL_FLAGS_NONE")
-- '("-auto-start" "G_DBUS_CALL_FLAGS_NO_AUTO_START")
-+ '("none" "G_DBUS_CALL_FLAGS_NONE")
-+ '("no-auto-start" "G_DBUS_CALL_FLAGS_NO_AUTO_START")
- )
- )
-
-@@ -1344,9 +1344,9 @@
- (c-name "GDBusMessageFlags")
- (gtype-id "G_TYPE_D_BUS_MESSAGE_FLAGS")
- (values
-- '("ne" "G_DBUS_MESSAGE_FLAGS_NONE")
-- '("-reply-expected" "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED")
-- '("-auto-start" "G_DBUS_MESSAGE_FLAGS_NO_AUTO_START")
-+ '("none" "G_DBUS_MESSAGE_FLAGS_NONE")
-+ '("no-reply-expected" "G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED")
-+ '("no-auto-start" "G_DBUS_MESSAGE_FLAGS_NO_AUTO_START")
- )
- )
-
-@@ -1405,8 +1405,8 @@
- (c-name "GDBusSignalFlags")
- (gtype-id "G_TYPE_D_BUS_SIGNAL_FLAGS")
- (values
-- '("ne" "G_DBUS_SIGNAL_FLAGS_NONE")
-- '("-match-rule" "G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE")
-+ '("none" "G_DBUS_SIGNAL_FLAGS_NONE")
-+ '("no-match-rule" "G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE")
- )
- )
-
+++ /dev/null
-; h2defs.py does not generate this. murrayc.
-(define-function g_themed_icon_get_names
- (c-name "g_themed_icon_get_names")
- (return-type "const-char*const*")
-)
-
-; h2defs failed to generate this murrayc:
-(define-method get_environ
- (of-object "GApplicationCommandLine")
- (c-name "g_application_command_line_get_environ")
- (return-type "const-gchar*const*")
-)
-
-(define-method list_schemas
- (of-object "GSettingsBackend")
- (c-name "g_settings_list_schemas")
- (return-type "const-gchar*const*")
-)
-
-; extra_defs does not generate these, for some reason. murrayc:
-(define-signal changed
- (of-object "GMount")
- (return-type "void")
- (when "last")
-)
-
-(define-signal unmounted
- (of-object "GMount")
- (return-type "void")
- (when "last")
-)
-
-; extra_defs does not generate these, for some reason. murrayc:
-(define-signal changed
- (of-object "GVolume")
- (return-type "void")
- (when "last")
-)
-
-(define-signal removed
- (of-object "GVolume")
- (return-type "void")
- (when "last")
-)
(construct-only #f)
)
+;; From GTcpWrapperConnection
+
+(define-property base-io-stream
+ (of-object "GTcpWrapperConnection")
+ (prop-type "GParamObject")
+ (docs "The wrapped GIOStream")
+ (readable #t)
+ (writable #t)
+ (construct-only #t)
+)
+
;; From GTlsBackend
;; From GTlsCertificate
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
+#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
+#undef G_DISABLE_DEPRECATED
+#define GLIB_DISABLE_DEPRECATION_WARNINGS 1
+#m4 _POP()
+
namespace Gio
{
class Icon;
+_WRAP_ENUM(NotificationPriority, GNotificationPriority)
+
/** User Notifications (pop up messages).
*
* Gio::Notification is a mechanism for creating a notification to be shown
_WRAP_METHOD(void set_title(const Glib::ustring& title), g_notification_set_title)
_WRAP_METHOD(void set_body(const Glib::ustring& body), g_notification_set_body)
_WRAP_METHOD(void set_icon(const Glib::RefPtr<Icon>& icon), g_notification_set_icon)
- _WRAP_METHOD(void set_urgent(bool urgent = true), g_notification_set_urgent, deprecated "This should not be used in newly-written code.")
+ _WRAP_METHOD(void set_urgent(bool urgent = true), g_notification_set_urgent, deprecated "Use set_priority() instead.")
+ _WRAP_METHOD(void set_priority(NotificationPriority priority = NOTIFICATION_PRIORITY_NORMAL), g_notification_set_priority)
_WRAP_METHOD(void add_button(const Glib::ustring& label, const Glib::ustring& detailed_action), g_notification_add_button)
// Ignore functions with variable-length parameter lists.
_IGNORE(g_notification_add_button_with_target, g_notification_set_default_action_and_target)
// Ignore private methods
- _IGNORE(g_notification_get_urgent, g_notification_get_button, g_notification_get_default_action)
+ _IGNORE(g_notification_get_priority, g_notification_get_button, g_notification_get_default_action)
_IGNORE(g_notification_get_n_buttons, g_notification_get_button_with_action, g_notification_serialize)
_IGNORE(g_notification_get_icon, g_notification_get_id, g_notification_get_body, g_notification_get_title)
--- /dev/null
+/* Copyright (C) 2015 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+
+namespace Gio
+{
+} // namespace Gio
--- /dev/null
+/* Copyright (C) 2015 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <giomm/tcpconnection.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(giomm/private/tcpconnection_p.h)
+
+namespace Gio
+{
+
+/** Wrapper for non-Gio::SocketConnection-based, Gio::Socket-based Gio::IOStreams.
+ *
+ * This can be used to wrap a Gio::Stream that is
+ * based on a Gio::Socket, but which is not actually a
+ * Gio::SocketConnection. This is used by Gio::SocketClient so that it can
+ * always return a Gio::SocketConnection, even when the connection it has
+ * actually created is not directly a Gio::SocketConnection.
+ *
+ * @newin{2,34}
+ * @ingroup NetworkIO
+ */
+class TcpWrapperConnection : public Gio::TcpConnection
+{
+ _CLASS_GOBJECT(TcpWrapperConnection, GTcpWrapperConnection, G_TCP_WRAPPER_CONNECTION, Gio::TcpConnection, GTcpConnection)
+
+public:
+
+ _WRAP_CTOR(TcpWrapperConnection(const Glib::RefPtr<IOStream>& base_io_stream, const Glib::RefPtr<Socket>& socket), g_tcp_wrapper_connection_new)
+
+ _WRAP_METHOD(Glib::RefPtr<IOStream> get_base_io_stream(), g_tcp_wrapper_connection_get_base_io_stream, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const IOStream> get_base_io_stream() const, g_tcp_wrapper_connection_get_base_io_stream, constversion, refreturn)
+
+ _WRAP_PROPERTY("base-io-stream", Glib::RefPtr<IOStream>)
+};
+
+} // namespace Gio
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2010 The giomm Development Team
*
* This library is free software; you can redistribute it and/or
_WRAP_METHOD(static bool abstract_names_supported(), g_unix_socket_address_abstract_names_supported)
- _WRAP_PROPERTY("abstract", bool)
+ _WRAP_PROPERTY("abstract", bool, deprecated "Use property_address_type() instead, which distinguishes between zero-padded and non-zero-padded abstract addresses.")
_WRAP_PROPERTY("address-type", UnixSocketAddressType)
_WRAP_PROPERTY("path", std::string)
_WRAP_PROPERTY("path-as-array", Glib::RefPtr<ByteArray>)
-// -*- c++ -*-
-
/* error.cc
*
* Copyright 2002 The gtkmm Development Team
#include <glibmmconfig.h>
#include <glibmm/error.h>
+#include <glibmm/wrap.h>
#include <glibmm/wrap_init.h>
#include <glib.h>
#include <map>
if(!throw_func_table)
{
throw_func_table = new ThrowFuncTable();
+ Glib::wrap_register_init();
Glib::wrap_init(); // make sure that at least the Glib exceptions are registered
}
}
throw Glib::Error(gobject);
}
-
} // namespace Glib
-
-// -*- c++ -*-
-/* $Id$ */
-
/* Copyright (C) 2003 The glibmm Development Team
*
* This library is free software; you can redistribute it and/or
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <glibmm/wrap.h>
+#include <glibmm/init.h>
#include <glibmm/error.h>
namespace Glib
void init()
{
- Glib::wrap_register_init();
- Glib::Error::register_init(); //also calls Glib::wrap_init();
+ // Also calls Glib::wrap_register_init() and Glib::wrap_init().
+ Glib::Error::register_init();
}
} // namespace Glib
-
glibmm_files_defs = \
glib.defs \
glib_enums.defs \
- glib_deprecated_enums.defs \
glib_functions.defs \
glib_extra_objects.defs \
glib_signals.defs \
gmodule_enums.defs \
gmodule_functions.defs \
- gobject.defs \
gobject_enums.defs \
gobject_functions.defs \
glib_docs.xml \
(include glib_functions.defs)
-(include glib_deprecated_functions.defs)
(include glib_enums.defs)
-(include glib_deprecated_enums.defs)
(include glib_extra_objects.defs)
(include glib_signals.defs)
(include gobject_enums.defs)
+++ /dev/null
-;; From gthread.h
-
-;; Original typedef:
-;; typedef enum
-;; {
-;; G_THREAD_PRIORITY_LOW,
-;; G_THREAD_PRIORITY_NORMAL,
-;; G_THREAD_PRIORITY_HIGH,
-;; G_THREAD_PRIORITY_URGENT
-;; } GThreadPriority;
-
-(define-enum-extended ThreadPriority
- (in-module "G")
- (c-name "GThreadPriority")
- (values
- '("low" "G_THREAD_PRIORITY_LOW" "0")
- '("normal" "G_THREAD_PRIORITY_NORMAL" "1")
- '("high" "G_THREAD_PRIORITY_HIGH" "2")
- '("urgent" "G_THREAD_PRIORITY_URGENT" "3")
- )
-)
-
+++ /dev/null
-;; -*- scheme -*-
-; object definitions ...
-;; Enumerations and flags ...
-
-(define-enum Priority
- (in-module "GThread")
- (c-name "GThreadPriority")
- (gtype-id "G_TYPE_THREAD_PRIORITY")
- (values
- '("low" "G_THREAD_PRIORITY_LOW")
- '("normal" "G_THREAD_PRIORITY_NORMAL")
- '("high" "G_THREAD_PRIORITY_HIGH")
- '("urgent" "G_THREAD_PRIORITY_URGENT")
- )
-)
-
-
-;; From gallocator.h
-
-
-
-;; From gcache.h
-
-
-
-;; From gcompletion.h
-
-
-
-;; From grel.h
-
-
-
-;; From gthread.h
-
-(define-function guint64
- (c-name "guint64")
- (return-type "GLIB_VAR")
- (parameters
- '("*" "g_thread_gettime")
- )
-)
-
-(define-method get_mutex_impl
- (of-object "GStaticMutex")
- (c-name "g_static_mutex_get_mutex_impl")
- (return-type "GMutex*")
-)
-
-
</parameters>
</enum>
+<enum name="GWin32OSType">
+<description>
+Type of Windows edition to check for at run-time.
+
+</description>
+<parameters>
+<parameter name="G_WIN32_OS_ANY">
+<parameter_description> The running system can be a workstation or a server edition of
+Windows. The type of the running system is therefore not checked.
+</parameter_description>
+</parameter>
+<parameter name="G_WIN32_OS_WORKSTATION">
+<parameter_description> The running system is a workstation edition of Windows,
+such as Windows 7 Professional.
+</parameter_description>
+</parameter>
+<parameter name="G_WIN32_OS_SERVER">
+<parameter_description> The running system is a server edition of Windows, such as
+Windows Server 2008 R2.
+</parameter_description>
+</parameter>
+</parameters>
+</enum>
+
<function name="g_access">
<description>
A wrapper for the POSIX access() function. This function is used to
the string back using g_ascii_strtod() gives the same machine-number
(on machines with IEEE compatible 64bit doubles). It is
guaranteed that the size of the resulting string will never
-be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes.
+be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes, including the terminating
+nul character, which is always added.
</description>
a printf()-style format string. Allowed conversion
specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'.
+The returned buffer is guaranteed to be nul-terminated.
+
If you just want to want to serialize the value into a
string, use g_ascii_dtostr().
</return>
</function>
+<function name="g_auto">
+<description>
+Helper to declare a variable with automatic cleanup.
+
+The variable is cleaned up in a way appropriate to its type when the
+variable goes out of scope. The type must support this.
+
+This feature is only supported on GCC and clang. This macro is not
+defined on other compilers and should not be used in programs that
+are intended to be portable to those compilers.
+
+This is meant to be used with stack-allocated structures and
+non-pointer types. For the (more commonly used) pointer version, see
+g_autoptr().
+
+This macro can be used to avoid having to do explicit cleanups of
+local variables when exiting functions. It often vastly simplifies
+handling of error conditions, removing the need for various tricks
+such as 'goto out' or repeating of cleanup code. It is also helpful
+for non-error cases.
+
+Consider the following example:
+
+|[
+GVariant *
+my_func(void)
+{
+g_auto(GQueue) queue = G_QUEUE_INIT;
+g_auto(GVariantBuilder) builder;
+
+g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
+
+...
+
+if (error_condition)
+return NULL;
+
+...
+
+return g_variant_builder_end (&builder);
+}
+]|
+
+You must initialise the variable in some way -- either by use of an
+initialiser or by ensuring that an _init function will be called on
+it unconditionally before it goes out of scope.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="typename">
+<parameter_description> a supported variable type
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_autoptr">
+<description>
+Helper to declare a pointer variable with automatic cleanup.
+
+The variable is cleaned up in a way appropriate to its type when the
+variable goes out of scope. The type must support this.
+
+This feature is only supported on GCC and clang. This macro is not
+defined on other compilers and should not be used in programs that
+are intended to be portable to those compilers.
+
+This is meant to be used to declare pointers to types with cleanup
+functions. The type of the variable is a pointer to @typename. You
+must not add your own '*'.
+
+This macro can be used to avoid having to do explicit cleanups of
+local variables when exiting functions. It often vastly simplifies
+handling of error conditions, removing the need for various tricks
+such as 'goto out' or repeating of cleanup code. It is also helpful
+for non-error cases.
+
+Consider the following example:
+
+|[
+gboolean
+check_exists(GVariant *dict)
+{
+g_autoptr(GVariant) dirname;
+g_autoptr(GVariant) basename = NULL;
+g_autoptr(gchar) path = NULL;
+
+dirname = g_variant_lookup_value (dict, "dirname", G_VARIANT_TYPE_STRING);
+
+if (dirname == NULL)
+return FALSE;
+
+basename = g_variant_lookup_value (dict, "basename", G_VARIANT_TYPE_STRING);
+
+if (basename == NULL)
+return FALSE;
+
+path = g_build_filename (g_variant_get_string (dirname, NULL),
+g_variant_get_string (basename, NULL),
+NULL);
+
+return g_access (path, R_OK) == 0;
+}
+]|
+
+You must initialise the variable in some way -- either by use of an
+initialiser or by ensuring that it is assigned to unconditionally
+before it goes out of scope.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="typename">
+<parameter_description> a supported variable type
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
<function name="g_base64_decode">
<description>
Decode a sequence of Base-64 encoded text into binary data. Note
Releases all references to other objects. This can be used to break
reference cycles.
-This functions should only be called from object system implementations.
+This function should only be called from object system implementations.
</description>
<parameters>
<function name="g_thread_self">
<description>
-This functions returns the #GThread corresponding to the
+This function returns the #GThread corresponding to the
current thread. Note that this function does not increase
the reference count of the returned struct.
<return></return>
</function>
+<function name="g_win32_check_windows_version">
+<description>
+Returns whether the version of the Windows operating system the
+code is running on is at least the specified major, minor and
+service pack versions. See MSDN documentation for the Operating
+System Version. Software that needs even more detailed version and
+feature information should use the Win32 API VerifyVersionInfo()
+directly.
+
+Successive calls of this function can be used for enabling or
+disabling features at run-time for a range of Windows versions,
+as per the VerifyVersionInfo() API documentation.
+
+Since: 2.44
+
+</description>
+<parameters>
+<parameter name="major">
+<parameter_description> major version of Windows
+</parameter_description>
+</parameter>
+<parameter name="minor">
+<parameter_description> minor version of Windows
+</parameter_description>
+</parameter>
+<parameter name="spver">
+<parameter_description> Windows Service Pack Level, 0 if none
+</parameter_description>
+</parameter>
+<parameter name="os_type">
+<parameter_description> Type of Windows OS
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the Windows Version is the same or greater than
+the specified major, minor and service pack versions, and
+whether the running Windows is a workstation or server edition
+of Windows, if specifically specified.
+
+</return>
+</function>
+
<function name="g_win32_error_message">
<description>
Translate a Win32 error code (as returned by GetLastError() or
<function name="g_win32_get_windows_version">
<description>
-Returns version information for the Windows operating system the
-code is running on. See MSDN documentation for the GetVersion()
-function. To summarize, the most significant bit is one on Win9x,
-and zero on NT-based systems. Since version 2.14, GLib works only
-on NT-based systems, so checking whether your are running on Win9x
-in your own software is moot. The least significant byte is 4 on
-Windows NT 4, and 5 on Windows XP. Software that needs really
-detailed version and feature information should use Win32 API like
-GetVersionEx() and VerifyVersionInfo().
+This function is deprecated. Use
+g_win32_check_windows_version() instead.
-Since: 2.6
+Deprecated: 2.44: Be aware that for Windows 8.1 and Windows Server
+2012 R2 and later, this will return 62 unless the application is
+manifested for Windows 8.1/Windows Server 2012 R2, for example.
+MSDN stated that GetVersion(), which is used here, is subject to
+further change or removal after Windows 8.1.
</description>
<parameters>
)
)
+;; From gwin32.h
+
+;; Original typedef:
+;; typedef enum
+;; {
+;; G_WIN32_OS_ANY,
+;; G_WIN32_OS_WORKSTATION,
+;; G_WIN32_OS_SERVER,
+;; } GWin32OSType;
+
+(define-enum-extended Win32OSType
+ (in-module "G")
+ (c-name "GWin32OSType")
+ (values
+ '("any" "G_WIN32_OS_ANY" "0")
+ '("workstation" "G_WIN32_OS_WORKSTATION" "1")
+ '("server" "G_WIN32_OS_SERVER" "2")
+ )
+)
+
;; From gthread.h
;; Original typedef:
+;; From glib-autocleanups.h
+
+
+
;; From glibconfig.h
(return-type "none")
)
+(define-method ref
+ (of-object "GOptionGroup")
+ (c-name "g_option_group_ref")
+ (return-type "GOptionGroup*")
+)
+
+(define-method unref
+ (of-object "GOptionGroup")
+ (c-name "g_option_group_unref")
+ (return-type "none")
+)
+
(define-method add_entries
(of-object "GOptionGroup")
(c-name "g_option_group_add_entries")
(return-type "guint")
)
+(define-method locker_new
+ (of-object "GMutex")
+ (c-name "g_mutex_locker_new")
+ (return-type "GMutexLocker*")
+)
+
+(define-method free
+ (of-object "GMutexLocker")
+ (c-name "g_mutex_locker_free")
+ (return-type "none")
+)
+
;; From gthreadpool.h
)
)
+(define-function g_win32_check_windows_version
+ (c-name "g_win32_check_windows_version")
+ (return-type "gboolean")
+ (parameters
+ '("const-gint" "major")
+ '("const-gint" "minor")
+ '("const-gint" "spver")
+ '("const-GWin32OSType" "os_type")
+ )
+)
+
;; From valgrind.h
---- glib_functions.defs 2012-02-28 10:09:30.000000000 -0500
-+++ glib_functions.defs.new 2012-02-28 10:08:25.000000000 -0500
-@@ -2563,7 +2563,7 @@
+--- glib_functions.defs.orig 2015-02-15 16:49:21.605101660 +0100
++++ glib_functions.defs 2015-02-15 16:49:21.617101670 +0100
+@@ -2739,7 +2739,7 @@
)
)
(of-object "GIConv")
(c-name "g_iconv")
(return-type "gsize")
-@@ -12346,13 +12346,9 @@
+@@ -13320,13 +13320,9 @@
(return-type "const-gchar*-const*")
)
+;; has a function pointer parameter and that is not handled correctly by
+;; h2def.py.
- (define-function g_get_user_runtime_dir
- (c-name "g_get_user_runtime_dir")
-@@ -12440,13 +12436,8 @@
+ (define-function g_get_system_config_dirs
+ (c-name "g_get_system_config_dirs")
+@@ -13419,13 +13415,8 @@
)
)
+++ /dev/null
-(include gobject_functions.defs)
-(include gobject_enums.defs)
-
(return-type "GType")
)
+(define-function g_option_group_get_type
+ (c-name "g_option_group_get_type")
+ (return-type "GType")
+)
+
(define-function g_variant_get_gtype
(c-name "g_variant_get_gtype")
(return-type "GType")
+;; From gobject-autocleanups.h
+
+
+
;; From gobject.h
(define-function g_initially_unowned_get_type
* @return An IOSource object that can be polled from a MainContext's event loop.
*/
Glib::RefPtr<IOSource> create_watch(IOCondition condition);
- _IGNORE(g_io_channel_create_watch)
virtual void reference() const;
virtual void unreference() const;
g_node_append(gobj(), node.gobj());
return node;
}
- _IGNORE(g_node_append)
+ dnl// Some glib functions are in fact preprocessor macros.
+ dnl// h2def.py does not recognize them. _IGNORE()ing them produces
+ dnl// ugly error messages in the generated nodetree.h file.
+ dnl// _IGNORE(g_node_append)
/** Inserts a NodeTree as the first child.
*
insert(position, *node);
return node;
}
- _IGNORE(g_node_insert_data)
+ dnl// _IGNORE(g_node_insert_data)
/** Inserts a new NodeTree before the given sibling.
*
insert_before(sibling, *node);
return node;
}
- _IGNORE(g_node_insert_data_before)
+ dnl// _IGNORE(g_node_insert_data_before)
/** Inserts a new NodeTree as the last child.
*
append(*node);
return node;
}
- _IGNORE(g_node_append_data)
+ dnl// _IGNORE(g_node_append_data)
/** Inserts a new NodeTree as the first child.
*
prepend(*node);
return node;
}
- _IGNORE(g_node_prepend_data)
+ dnl// _IGNORE(g_node_prepend_data)
/** Reverses the order of the children.
*/
{
return const_cast<NodeTree<T>*>(this)->first_child();
}
- _IGNORE(g_node_first_child)
+ dnl// _IGNORE(g_node_first_child)
/** Gets the last child.
*
{
return const_cast<NodeTree<T>*>(this)->prev_sibling();
}
- _IGNORE(g_node_prev_sibling)
+ dnl// _IGNORE(g_node_prev_sibling)
/** Gets the next sibling
*
{
return const_cast<NodeTree<T>*>(this)->next_sibling();
}
- _IGNORE(g_node_next_sibling)
+ dnl// _IGNORE(g_node_next_sibling)
/** Gets the last sibling.
*
if(has_ownership_)
{
- g_option_group_free(gobj());
+ g_option_group_unref(gobj());
gobject_ = 0;
}
}
{
const Glib::ustring name = entry.get_long_name();
type_map_entries::iterator iterFind = map_entries_.find(name);
- if( iterFind == map_entries_.end() ) //If we have not added this entry already
+ if (iterFind == map_entries_.end()) //If we have not added this entry already
{
CppOptionEntry cppEntry;
//g_option_group_add_entry() does not take its own copy, so we must keep the instance alive.
cppEntry.entry_ = new OptionEntry(entry);
//cppEntry.entry_ is deleted in release_c_arg(), via the destructor.
- cppEntry.carg_type_ = arg_type;
- cppEntry.allocate_c_arg();
- cppEntry.set_c_arg_default(cpp_arg);
+ // Several options can refer to the same C++ variable,
+ // typically a pair of --enable-x / --disable-x options.
+ // Only one C variable shall be allocated for them.
+ // See https://bugzilla.gnome.org/show_bug.cgi?id=744854.
+ bool is_duplicate = false;
+ void* carg = 0;
+ if (arg_type != G_OPTION_ARG_CALLBACK)
+ {
+ for (type_map_entries::iterator iter = map_entries_.begin();
+ iter != map_entries_.end(); ++iter)
+ {
+ const CppOptionEntry& cpp_entry = iter->second;
+ if (cpp_entry.cpparg_ == cpp_arg &&
+ cpp_entry.carg_type_ == arg_type &&
+ cpp_entry.carg_)
+ {
+ is_duplicate = true;
+ carg = cpp_entry.carg_;
+ break;
+ }
+ }
+ }
+ cppEntry.carg_type_ = arg_type;
+ if (!is_duplicate)
+ {
+ cppEntry.allocate_c_arg();
+ cppEntry.set_c_arg_default(cpp_arg);
+ carg = cppEntry.carg_;
+ }
cppEntry.cpparg_ = cpp_arg;
//Give the information to the C API:
cppEntry.entry_->gobj()->arg = arg_type;
- cppEntry.entry_->gobj()->arg_data = cppEntry.carg_;
+ cppEntry.entry_->gobj()->arg_data = carg;
//Remember the C++/C mapping so that we can use it later:
map_entries_[name] = cppEntry;
add_entry(*(cppEntry.entry_));
}
- else if( arg_type == G_OPTION_ARG_CALLBACK )
+ else if (arg_type == G_OPTION_ARG_CALLBACK)
{
//Delete the OptionArgCallback instance that was allocated by add_entry()
//or add_entry_filename().
//defaults based on the C++-typed arguments.
switch(carg_type_)
{
- case G_OPTION_ARG_STRING: //The char* will be for UTF8 strins.
- case G_OPTION_ARG_FILENAME: //The char* will be for strings in the current locale's encoding.
+ case G_OPTION_ARG_STRING: //The char* will be for UTF8 a string.
+ case G_OPTION_ARG_FILENAME: //The char* will be for a string in the current locale's encoding.
{
char** typed_arg = new char*;
//The C code will allocate a char* and put it here, for us to g_free() later.
- //Alternatively, set_c_arg_default() might allocate a char*, and the C code might or might not free and replace that.
*typed_arg = 0;
carg_ = typed_arg;
case G_OPTION_ARG_FILENAME_ARRAY:
{
char*** typed_arg = new char**;
+ //The C code will allocate a char** and put it here, for us to g_strfreev() later.
*typed_arg = 0;
carg_ = typed_arg;
break;
}
- case G_OPTION_ARG_NONE: /* Actually a boolean. */
+ case G_OPTION_ARG_NONE: // Actually a boolean.
{
gboolean* typed_arg = new gboolean;
*typed_arg = 0;
break;
}
case G_OPTION_ARG_STRING:
- {
- Glib::ustring* typed_cpp_arg = static_cast<Glib::ustring*>(cpp_arg);
- if(typed_cpp_arg && !typed_cpp_arg->empty())
- {
- const char** typed_c_arg = static_cast<const char**>(carg_);
- *typed_c_arg = g_strdup(typed_cpp_arg->c_str()); //Freed in release_c_arg().
- }
- break;
- }
case G_OPTION_ARG_FILENAME:
- {
- std::string* typed_cpp_arg = static_cast<std::string*>(cpp_arg);
- if(typed_cpp_arg && !typed_cpp_arg->empty())
- {
- const char** typed_c_arg = static_cast<const char**>(carg_);
- *typed_c_arg = g_strdup(typed_cpp_arg->c_str()); //Freed in release_c_arg().
- }
- break;
- }
case G_OPTION_ARG_STRING_ARRAY:
- {
- std::vector<Glib::ustring>* typed_cpp_arg = static_cast<std::vector<Glib::ustring>*>(cpp_arg);
- if(typed_cpp_arg)
- {
- std::vector<Glib::ustring>& vec = *typed_cpp_arg;
- const char** array = static_cast<const char**>( g_malloc(sizeof(gchar*) * (vec.size() + 1)) );
-
- for(std::vector<Glib::ustring>::size_type i = 0; i < vec.size(); ++i)
- {
- array[i] = g_strdup( vec[i].c_str() );
- }
-
- array[vec.size()] = 0;
-
- const char*** typed_c_arg = static_cast<const char***>(carg_);
- *typed_c_arg = array;
- }
- break;
- }
case G_OPTION_ARG_FILENAME_ARRAY:
{
- std::vector<std::string>* typed_cpp_arg = static_cast<std::vector<std::string>*>(cpp_arg);
- if(typed_cpp_arg)
- {
- std::vector<std::string>& vec = *typed_cpp_arg;
- const char** array = static_cast<const char**>( g_malloc(sizeof(gchar*) * (vec.size() + 1)) );
-
- for(std::vector<Glib::ustring>::size_type i = 0; i < vec.size(); ++i)
- {
- array[i] = g_strdup( vec[i].c_str() );
- }
-
- array[vec.size()] = 0;
-
- const char*** typed_c_arg = static_cast<const char***>(carg_);
- *typed_c_arg = array;
- }
+ // No need to set default values for string-valued options.
+ // If *carg_ is still 0, when convert_c_to_cpp() is called, just don't
+ // touch *cpparg_. Besides, setting default values in *carg_ can result
+ // in memory leaks, because glib would not free the strings before
+ // the char*'s are overwritten with pointers to newly allocated copies
+ // of the command option arguments.
break;
}
case G_OPTION_ARG_CALLBACK:
case G_OPTION_ARG_FILENAME:
{
char** typed_arg = static_cast<char**>(carg_);
- g_free(*typed_arg); //Free the char* string at type_arg, which was allocated by the C code.
- delete typed_arg; //Delete the char** that we allocated in allocate_c_arg;
+ g_free(*typed_arg); //Free the char* string at typed_arg, if allocated by the C code.
+ delete typed_arg; //Delete the char** that we allocated in allocate_c_arg().
break;
}
case G_OPTION_ARG_STRING_ARRAY:
case G_OPTION_ARG_FILENAME_ARRAY:
{
- delete (char**)carg_;
+ char*** typed_arg = static_cast<char***>(carg_);
+ g_strfreev(*typed_arg); //Free the array of strings and the array at typed_arg, if allocated by the C code.
+ delete typed_arg; //Delete the char*** that we allocated in allocate_c_arg().
+
break;
}
- case G_OPTION_ARG_NONE: /* Actually a boolean. */
+ case G_OPTION_ARG_NONE: // Actually a boolean.
{
gboolean* typed_arg = static_cast<gboolean*>(carg_);
delete typed_arg;
void OptionGroup::CppOptionEntry::convert_c_to_cpp()
{
+ if (!carg_)
+ return;
+
switch(carg_type_)
{
case G_OPTION_ARG_STRING:
{
char** typed_arg = static_cast<char**>(carg_);
Glib::ustring* typed_cpp_arg = static_cast<Glib::ustring*>(cpparg_);
- if(typed_arg && typed_cpp_arg)
+ if(typed_arg && *typed_arg && typed_cpp_arg)
{
- char* pch = *typed_arg;
- (*typed_cpp_arg) = Glib::convert_const_gchar_ptr_to_ustring(pch);
-
- break;
+ *typed_cpp_arg = *typed_arg;
}
+ break;
}
case G_OPTION_ARG_FILENAME:
{
char** typed_arg = static_cast<char**>(carg_);
std::string* typed_cpp_arg = static_cast<std::string*>(cpparg_);
- if(typed_arg && typed_cpp_arg)
+ if(typed_arg && *typed_arg && typed_cpp_arg)
{
- char* pch = *typed_arg;
- (*typed_cpp_arg) = Glib::convert_const_gchar_ptr_to_stdstring(pch);
-
- break;
+ *typed_cpp_arg = *typed_arg;
}
+ break;
}
case G_OPTION_ARG_INT:
{
{
char*** typed_arg = static_cast<char***>(carg_);
vecustrings* typed_cpp_arg = static_cast<vecustrings*>(cpparg_);
- if(typed_arg && typed_cpp_arg)
+ if(typed_arg && *typed_arg && typed_cpp_arg)
{
typed_cpp_arg->clear();
- //The C array seems to be null-terminated.
+ //The C array is null-terminated.
//Glib::StringArrayHandle array_handle(*typed_arg, Glib::OWNERSHIP_NONE);
//The SUN Forte compiler complains about this:
//So we do this:
char** char_array_next = *typed_arg;
- while(char_array_next && *char_array_next)
+ while(*char_array_next)
{
typed_cpp_arg->push_back(*char_array_next);
++char_array_next;
}
}
-
break;
}
case G_OPTION_ARG_FILENAME_ARRAY:
{
char*** typed_arg = static_cast<char***>(carg_);
- vecustrings* typed_cpp_arg = static_cast<vecustrings*>(cpparg_);
- if(typed_arg && typed_cpp_arg)
+ vecstrings* typed_cpp_arg = static_cast<vecstrings*>(cpparg_);
+ if(typed_arg && *typed_arg && typed_cpp_arg)
{
typed_cpp_arg->clear();
//See comments above about the SUN Forte and Tru64 compilers.
char** char_array_next = *typed_arg;
- while(char_array_next && *char_array_next)
+ while(*char_array_next)
{
typed_cpp_arg->push_back(*char_array_next);
++char_array_next;
}
}
-
break;
}
- case G_OPTION_ARG_NONE: /* Actually a boolean. */
+ case G_OPTION_ARG_NONE: // Actually a boolean.
{
*(static_cast<bool*>(cpparg_)) = *(static_cast<gboolean*>(carg_));
break;
class OptionContext;
#endif //DOXYGEN_SHOULD_SKIP_THIS
+//TODO: GOptionGroup is now refcounted. See https://bugzilla.gnome.org/show_bug.cgi?id=743349
+//When we can break API/ABI, make Glib::OptionGroup refcounted. _CLASS_OPAQUE_REFCOUNTED?
/** An OptionGroup defines the options in a single group.
* Libraries which need to parse commandline options are expected to provide a function that allows their OptionGroups to
* be added to the application's OptionContext.
* so it is only useful with C functions that return newly-allocated GOptionGroups.
*/
explicit OptionGroup(GOptionGroup* castitem);
- _IGNORE(g_option_group_new)
+ _IGNORE(g_option_group_new, g_option_group_ref)
virtual ~OptionGroup();
- _IGNORE(g_option_group_free)
+ _IGNORE(g_option_group_free, g_option_group_unref)
virtual bool on_pre_parse(OptionContext& context, OptionGroup& group);
divert(-1)
-dnl $Id$
-
dnl Glib::Value specializations for fundamental types
dnl
dnl Copyright 2002 The gtkmm Development Team
// static
GType Value<$1>::value_type()
{
- return G_TYPE_[]UPPER($2);
+ return G_TYPE_[]UPPER(ifelse($2,schar,char,$2));
}
void Value<$1>::set($1 data)
GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const
{
- return g_param_spec_$2(
+ return g_param_spec_[]ifelse($2,schar,char,$2)(
name.c_str(), 0, 0,ifelse($2,pointer,,[
ifelse($3,,,[$3, $4, ])[]g_value_get_$2(&gobject_),])
GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
])
divert[]dnl
-// -*- c++ -*-
// This is a generated file, do not edit. Generated from __file__
/* So we can use deprecated functions in our deprecated methods */
G_GNUC_EXTENSION typedef unsigned long long unsigned_long_long;
GLIB_VALUE_BASIC(bool, boolean)
+#ifndef GLIBMM_DISABLE_DEPRECATED
GLIB_VALUE_BASIC(char, char, -128, 127)
+#endif // GLIBMM_DISABLE_DEPRECATED
+GLIB_VALUE_BASIC(signed char, schar, -128, 127)
GLIB_VALUE_BASIC(unsigned char, uchar, 0, 255)
GLIB_VALUE_BASIC(int, int, G_MININT, G_MAXINT)
GLIB_VALUE_BASIC(unsigned int, uint, 0, G_MAXUINT)
divert(-1)
-dnl $Id$
-
dnl Glib::Value specializations for fundamental types
dnl
dnl Copyright 2002 The gtkmm Development Team
])
divert[]dnl
-// -*- c++ -*-
// This is a generated file, do not edit. Generated from __file__
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
GLIB_VALUE_BASIC(bool, boolean)
+#ifndef GLIBMM_DISABLE_DEPRECATED
+/// @deprecated Use Value<signed char> instead.
GLIB_VALUE_BASIC(char, char)
+#endif // GLIBMM_DISABLE_DEPRECATED
+/// @newin{2,44}
+GLIB_VALUE_BASIC(signed char, int8)
GLIB_VALUE_BASIC(unsigned char, uchar)
GLIB_VALUE_BASIC(int, int)
GLIB_VALUE_BASIC(unsigned int, uint)
pat = re.compile(r"""\\\n""", re.MULTILINE)
buf = pat.sub('', buf)
- # Preprocess directives
+ # Preprocessor directives
pat = re.compile(r"""^[#].*?$""", re.MULTILINE)
buf = pat.sub('', buf)
- #typedefs, stucts, and enums
+ #typedefs, structs, and enums
pat = re.compile(r"""^(typedef|struct|enum)(\s|.|\n)*?;\s*""",
re.MULTILINE)
buf = pat.sub('', buf)
buf = pat.sub('', buf)
#strip *_DEPRECATED_IN_*_FOR (*):
- pat = re.compile(r"""[A-Z]+_DEPRECATED_IN_[0-9]_([0-9]*)_FOR\s*\(\S*\)\S*""", re.MULTILINE)
+ pat = re.compile(r"""[A-Z]+_DEPRECATED_IN_[0-9]_([0-9]*)_FOR\s*\(.*\)\S*""", re.MULTILINE)
buf = pat.sub('', buf)
#strip *_DEPRECATED*
<< get_defs(G_TYPE_SOCKET_CLIENT)
<< get_defs(G_TYPE_SOCKET_CONNECTION)
<< get_defs(G_TYPE_TCP_CONNECTION)
+ << get_defs(G_TYPE_TCP_WRAPPER_CONNECTION)
<< get_defs(G_TYPE_TLS_BACKEND)
<< get_defs(G_TYPE_TLS_CERTIFICATE)
<< get_defs(G_TYPE_TLS_CLIENT_CONNECTION)
_STRUCT_PROTOTYPE()
')dnl
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
__NAMESPACE_BEGIN__ class __CPPNAME__`'_Class; __NAMESPACE_END__
+#endif //DOXYGEN_SHOULD_SKIP_THIS
+
_SECTION(SECTION_HEADER3)
ifdef(`__BOOL_NO_WRAP_FUNCTION__',`dnl
_SECTION(SECTION_HEADER1)
_STRUCT_PROTOTYPE()
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
__NAMESPACE_BEGIN__ class __CPPNAME__`'_Class; __NAMESPACE_END__
+#endif // DOXYGEN_SHOULD_SKIP_THIS
+
_SECTION(SECTION_HEADER3)
ifdef(`__BOOL_NO_WRAP_FUNCTION__',`dnl
_CONV_ENUM(G,MountOperationResult)
_CONV_ENUM(G,MountUnmountFlags)
_CONV_ENUM(G,NetworkConnectivity)
+_CONV_ENUM(G,NotificationPriority)
_CONV_ENUM(G,OutputStreamSpliceFlags)
_CONV_ENUM(G,PasswordSave)
_CONV_ENUM(G,ResolverRecordType)