From: DongHun Kwak Date: Mon, 7 Sep 2020 06:48:13 +0000 (-0700) Subject: Imported Upstream version 2.43.2 X-Git-Tag: upstream/2.43.2^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51a3fc8b5ed1b67871017fcf7edf64042c3c7b46;p=platform%2Fupstream%2Fglibmm.git Imported Upstream version 2.43.2 --- diff --git a/NEWS b/NEWS index 616f720..3b75041 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,20 @@ +2.43.2 (unstable): + +Gio: +* Added NetworkMonitor. + (Murray Cumming) +* UnixFDList, UnixFDMessage: Correct array lengths in steal_fds() + (Kjell Ahlstedt) Bug #741365 (Matthew Balkam) + +gmmproc: +* Don't make one very long line for the enum documentation. + (Kjell Ahlstedt) +* Improve the conversion of Since to @newin. + (Kjell Ahlstedt) +* Add an empty line after @newin where it's missing + (Kjell Ahlstedt) + + 2.43.1 (unstable): gmmproc: diff --git a/configure.ac b/configure.ac index 6a22c4e..547e9ed 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ ## You should have received a copy of the GNU Lesser General Public License ## along with this library. If not, see . -AC_INIT([glibmm], [2.43.1], +AC_INIT([glibmm], [2.43.2], [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm], [glibmm], [http://www.gtkmm.org/]) AC_PREREQ([2.59]) diff --git a/gio/src/action.hg b/gio/src/action.hg index 932ab8c..5e6dcf8 100644 --- a/gio/src/action.hg +++ b/gio/src/action.hg @@ -119,6 +119,7 @@ public: * See get_state_hint(). * * @newin{2,38} + * * @param value The new state. */ template @@ -180,6 +181,7 @@ public: * Detailed action names can have three formats. See parse_detailed_name_variant(). * * @newin{2,40} + * * @param detailed_name A detailed action name. * @param[out] action_name The action name. * @param[out] target_value The target value. diff --git a/gio/src/cancellable.hg b/gio/src/cancellable.hg index 2fcd58b..886dc27 100644 --- a/gio/src/cancellable.hg +++ b/gio/src/cancellable.hg @@ -1,5 +1,3 @@ -// -*- 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 @@ -75,6 +73,7 @@ public: * See Cancellable::signal_cancelled() for details on how to use this. * * @newin{2,22} + * * @param slot The slot to connect. * @return The id of the signal handler or 0 if @a cancellable has already * been cancelled. diff --git a/gio/src/charsetconverter.hg b/gio/src/charsetconverter.hg index b4808c8..d5f8d87 100644 --- a/gio/src/charsetconverter.hg +++ b/gio/src/charsetconverter.hg @@ -43,6 +43,7 @@ public: /** Creates a new CharsetConverter. * * @newin{2,24} + * * @param to_charset Destination charset. * @param from_charset Source charset. * @return A new CharsetConverter, or 0 on error. diff --git a/gio/src/file.hg b/gio/src/file.hg index 7df94c3..08e4ce8 100644 --- a/gio/src/file.hg +++ b/gio/src/file.hg @@ -1052,7 +1052,7 @@ public: g_file_set_display_name_finish, errthrow) - //TODO: Remove the bool results from this and other methods that thrown an exception. + //TODO: Remove the bool results from this and other methods that throw an exception. /** Deletes a file. * If the file is a directory, it will only be deleted if it is empty. diff --git a/gio/src/filelist.am b/gio/src/filelist.am index 8ce9dd5..17737fb 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -87,6 +87,7 @@ giomm_files_any_hg = \ mount.hg \ mountoperation.hg \ networkaddress.hg \ + networkmonitor.hg \ networkservice.hg \ notification.hg \ outputstream.hg \ diff --git a/gio/src/gio_docs.xml b/gio/src/gio_docs.xml index 1ddcc56..c2d54f7 100644 --- a/gio/src/gio_docs.xml +++ b/gio/src/gio_docs.xml @@ -4269,6 +4269,39 @@ file operations on the mount. + + +The host's network connectivity state, as reported by #GNetworkMonitor. + +Since: 2.44 + + + + + The host is not configured with a +route to the Internet; it may or may not be connected to a local +network. + + + + The host is connected to a network, but +does not appear to be able to reach the full Internet, perhaps +due to upstream network problems. + + + + The host is behind a captive portal and +cannot reach the full Internet. + + + + The host is connected to a network, and +appears to be able to reach the full Internet. + + + + + Emitted when the network configuration changes. If @available is @@ -47835,6 +47868,42 @@ See g_network_monitor_can_reach_async(). + + +Gets a more detailed networking state than +g_network_monitor_get_network_available(). + +If #GNetworkMonitor:network-available is %FALSE, then the +connectivity state will be %G_NETWORK_CONNECTIVITY_LOCAL. + +If #GNetworkMonitor:network-available is %TRUE, then the +connectivity state will be %G_NETWORK_CONNECTIVITY_FULL (if there +is full Internet connectivity), %G_NETWORK_CONNECTIVITY_LIMITED (if +the host has a default route, but appears to be unable to actually +reach the full Internet), or %G_NETWORK_CONNECTIVITY_PORTAL (if the +host is trapped behind a "captive portal" that requires some sort +of login or acknowledgement before allowing full Internet access). + +Note that in the case of %G_NETWORK_CONNECTIVITY_LIMITED and +%G_NETWORK_CONNECTIVITY_PORTAL, it is possible that some sites are +reachable but others are not. In this case, applications can +attempt to connect to remote servers, but should gracefully fall +back to their "offline" behavior if the connection attempt fails. + +Since: 2.44 + + + + + the #GNetworkMonitor + + + + the network connectivity state + + + + Gets the default #GNetworkMonitor for the system. @@ -58407,6 +58476,78 @@ on error + + +Send multiple data messages from @socket in one go. This is the most +complicated and fully-featured version of this call. For easier use, see +g_socket_send(), g_socket_send_to(), and g_socket_send_message(). + +@messages must point to an array of #GOutputMessage structs and +@num_messages must be the length of this array. Each #GOutputMessage +contains an address to send the data to, and a pointer to an array of +#GOutputVector structs to describe the buffers that the data to be sent +for each message will be gathered from. Using multiple #GOutputVectors is +more memory-efficient than manually copying data from multiple sources +into a single buffer, and more network-efficient than making multiple +calls to g_socket_send(). Sending multiple messages in one go avoids the +overhead of making a lot of syscalls in scenarios where a lot of data +packets need to be sent (e.g. high-bandwidth video streaming over RTP/UDP), +or where the same data needs to be sent to multiple recipients. + +@flags modify how the message is sent. The commonly available arguments +for this are available in the #GSocketMsgFlags enum, but the +values there are the same as the system values, and the flags +are passed in as-is, so you can pass in system-specific flags too. + +If the socket is in blocking mode the call will block until there is +space for all the data in the socket queue. If there is no space available +and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error +will be returned if no data was written at all, otherwise the number of +messages sent will be returned. To be notified when space is available, +wait for the %G_IO_OUT condition. Note though that you may still receive +%G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously +notified of a %G_IO_OUT condition. (On Windows in particular, this is +very common due to the way the underlying APIs work.) + +On error -1 is returned and @error is set accordingly. + +Since: 2.44 + + + + + a #GSocket + + + + an array of #GOutputMessage structs + + + + the number of elements in @messages + + + + an int containing #GSocketMsgFlags flags + + + + a %GCancellable or %NULL + + + + #GError for error reporting, or %NULL to ignore. + + + + number of messages sent, or -1 on error. Note that the number of +messages sent may be smaller than @num_messages if the socket is +non-blocking or if @num_messages was larger than UIO_MAXIOV (1024), +in which case the caller may re-try to send the remaining messages. + + + + Tries to send @size bytes from @buffer to @address. If @address is diff --git a/gio/src/gio_enums.defs b/gio/src/gio_enums.defs index 141c1b6..0e68617 100644 --- a/gio/src/gio_enums.defs +++ b/gio/src/gio_enums.defs @@ -1573,6 +1573,25 @@ ) ) +;; Original typedef: +;; typedef enum { +;; G_NETWORK_CONNECTIVITY_LOCAL = 1, +;; G_NETWORK_CONNECTIVITY_LIMITED = 2, +;; G_NETWORK_CONNECTIVITY_PORTAL = 3, +;; G_NETWORK_CONNECTIVITY_FULL = 4 +;; } GNetworkConnectivity; + +(define-enum-extended NetworkConnectivity + (in-module "G") + (c-name "GNetworkConnectivity") + (values + '("local" "G_NETWORK_CONNECTIVITY_LOCAL" "1") + '("limited" "G_NETWORK_CONNECTIVITY_LIMITED" "2") + '("portal" "G_NETWORK_CONNECTIVITY_PORTAL" "3") + '("full" "G_NETWORK_CONNECTIVITY_FULL" "4") + ) +) + ;; From gsettings.h ;; Original typedef: diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs index 1f43a3a..1170f1e 100644 --- a/gio/src/gio_methods.defs +++ b/gio/src/gio_methods.defs @@ -370,6 +370,13 @@ (gtype-id "G_TYPE_NETWORK_MONITOR_NETLINK") ) +(define-object MonitorNM + (in-module "GNetwork") + (parent "GNetworkMonitorNetlink") + (c-name "GNetworkMonitorNM") + (gtype-id "G_TYPE_NETWORK_MONITOR_NM") +) + (define-object Service (in-module "GNetwork") (parent "GObject") @@ -1705,6 +1712,18 @@ ) ) +(define-enum Connectivity + (in-module "GNetwork") + (c-name "GNetworkConnectivity") + (gtype-id "G_TYPE_NETWORK_CONNECTIVITY") + (values + '("local" "G_NETWORK_CONNECTIVITY_LOCAL") + '("limited" "G_NETWORK_CONNECTIVITY_LIMITED") + '("portal" "G_NETWORK_CONNECTIVITY_PORTAL") + '("full" "G_NETWORK_CONNECTIVITY_FULL") + ) +) + (define-flags BindFlags (in-module "GSettings") (c-name "GSettingsBindFlags") @@ -10420,6 +10439,11 @@ (return-type "GType") ) +(define-function g_network_connectivity_get_type + (c-name "g_network_connectivity_get_type") + (return-type "GType") +) + (define-function g_settings_bind_flags_get_type (c-name "g_settings_bind_flags_get_type") (return-type "GType") @@ -12056,6 +12080,12 @@ (return-type "gboolean") ) +(define-method get_connectivity + (of-object "GNetworkMonitor") + (c-name "g_network_monitor_get_connectivity") + (return-type "GNetworkConnectivity") +) + (define-method can_reach (of-object "GNetworkMonitor") (c-name "g_network_monitor_can_reach") @@ -12095,6 +12125,10 @@ +;; From gnetworkmonitornm.h + + + ;; From gnetworkservice.h (define-function g_network_service_get_type @@ -15886,6 +15920,19 @@ ) ) +(define-method send_messages + (of-object "GSocket") + (c-name "g_socket_send_messages") + (return-type "gint") + (parameters + '("GOutputMessage*" "messages") + '("guint" "num_messages") + '("gint" "flags") + '("GCancellable*" "cancellable") + '("GError**" "error") + ) +) + (define-method close (of-object "GSocket") (c-name "g_socket_close") diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs index 114a01f..232072f 100644 --- a/gio/src/gio_signals.defs +++ b/gio/src/gio_signals.defs @@ -1586,6 +1586,35 @@ (construct-only #t) ) +;; From GNetworkMonitor + +(define-signal network-changed + (of-object "GNetworkMonitor") + (return-type "void") + (when "last") + (parameters + '("gboolean" "p0") + ) +) + +(define-property connectivity + (of-object "GNetworkMonitor") + (prop-type "GParamEnum") + (docs "Level of network connectivity") + (readable #t) + (writable #f) + (construct-only #f) +) + +(define-property network-available + (of-object "GNetworkMonitor") + (prop-type "GParamBoolean") + (docs "Whether the network is available") + (readable #t) + (writable #f) + (construct-only #f) +) + ;; From GNetworkService (define-property service diff --git a/gio/src/mount.hg b/gio/src/mount.hg index 18c03b0..7ca1731 100644 --- a/gio/src/mount.hg +++ b/gio/src/mount.hg @@ -1,5 +1,3 @@ -// -*- 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 @@ -217,6 +215,7 @@ public: * does not support content guessing. * * @newin{2,18} + * * @param result An AsyncResult. * @return An array of content types. * @throw Glib::Error diff --git a/gio/src/networkmonitor.ccg b/gio/src/networkmonitor.ccg new file mode 100644 index 0000000..aaa5ee1 --- /dev/null +++ b/gio/src/networkmonitor.ccg @@ -0,0 +1,38 @@ +/* Copyright (C) 2014 The gtkmm 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 +#include +#include "slot_async.h" + +namespace Gio { + +void NetworkMonitor::can_reach_async(const Glib::RefPtr& connectable, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable) +{ + // Create a copy of the slot. + // A pointer to it will be passed through the callback's data parameter + // and deleted in the callback. + SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); + + g_network_monitor_can_reach_async(gobj(), + Glib::unwrap(connectable), + Glib::unwrap(cancellable), + &SignalProxy_async_callback, + slot_copy); +} + +} // namespace Gio diff --git a/gio/src/networkmonitor.hg b/gio/src/networkmonitor.hg new file mode 100644 index 0000000..4c6ee89 --- /dev/null +++ b/gio/src/networkmonitor.hg @@ -0,0 +1,69 @@ +/* Copyright (C) 2014 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 +#include +#include +#include +#include + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/interface_p.h) +_PINCLUDE(gio/gio.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GNetworkMonitorInterface GNetworkMonitorInterface; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +namespace Gio +{ + +_WRAP_ENUM(NetworkConnectivity, GNetworkConnectivity, NO_GTYPE) + + +/** TODO + * + * @newin{2,42} + */ +class NetworkMonitor : public Glib::Interface +{ + _CLASS_INTERFACE(NetworkMonitor, GNetworkMonitor, G_NETWORK_MONITOR, GNetworkMonitorInterface) + +public: + _WRAP_METHOD(static Glib::RefPtr get_default(), g_network_monitor_get_default) + + _WRAP_METHOD(bool get_network_available() const, g_network_monitor_get_network_available) + + _WRAP_METHOD(NetworkConnectivity get_connectivity() const, g_network_monitor_get_connectivity) + + _WRAP_METHOD(bool can_reach(const Glib::RefPtr& connectable, const Glib::RefPtr& cancellable{?}), g_network_monitor_can_reach, errthrow) + + //TODO: + void can_reach_async(const Glib::RefPtr& connectable, const SlotAsyncReady& slot, const Glib::RefPtr& cancellable); + _IGNORE(g_network_monitor_can_reach_async) + + _WRAP_METHOD(bool can_reach_finish(const Glib::RefPtr& result), g_network_monitor_can_reach_finish, errthrow) + + _WRAP_SIGNAL(void network_changed(bool available), "network-changed") + + //TODO: Wrap vfuncs? + + _WRAP_PROPERTY("network-available", bool) + _WRAP_PROPERTY("connectivity", NetworkConnectivity) +}; + +} // namespace Gio diff --git a/gio/src/notification.hg b/gio/src/notification.hg index b2a891f..caf5f94 100644 --- a/gio/src/notification.hg +++ b/gio/src/notification.hg @@ -76,6 +76,7 @@ public: * @a action will be activated with @a target as its parameter. * * @newin{2,40} + * * @param label Label of the button. * @param action An action name. * @param target @a action's parameter. @@ -96,6 +97,7 @@ public: * was sent on is activated. * * @newin{2,40} + * * @param action An action name. * @param target @a action's parameter. */ diff --git a/gio/src/simpleaction.hg b/gio/src/simpleaction.hg index 4765674..4b5b91e 100644 --- a/gio/src/simpleaction.hg +++ b/gio/src/simpleaction.hg @@ -88,6 +88,7 @@ public: * must have the same VariantType as the initial state. * * @newin{2,38} + * * @param name The name of the action. * @param state The initial state of the action. * @return A new SimpleAction. @@ -103,6 +104,7 @@ public: * must also be bool. * * @newin{2,38} + * * @param name The name of the action. * @param state The initial state of the action. * @return A new SimpleAction. @@ -118,6 +120,7 @@ public: /** Creates a new radio action with a string-based target value. * * @newin{2,38} + * * @param name The name of the action. * @param initial_state The initial state of the action. * @return A new SimpleAction. @@ -134,6 +137,7 @@ public: /** Creates a new radio action with an integer-based target value. * * @newin{2,38} + * * @param name The name of the action. * @param initial_state The initial state of the action. * @return A new SimpleAction. diff --git a/gio/src/socket.hg b/gio/src/socket.hg index 55236a4..530a1ab 100644 --- a/gio/src/socket.hg +++ b/gio/src/socket.hg @@ -1,5 +1,3 @@ -// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- - /* Copyright (C) 2009 Jonathon Jongsma * * This library is free software; you can redistribute it and/or @@ -251,6 +249,7 @@ public: * Gio::signal_socket().connect() is a simpler interface to the same functionality. * * @newin{2,42} + * * @param condition A Glib::IOCondition mask to monitor. * @param cancellable A Cancellable. The default value means the source is not cancellable. * @return A newly allocated SocketSource. diff --git a/gio/src/unixfdlist.ccg b/gio/src/unixfdlist.ccg index 4fbed4d..aa26c9c 100644 --- a/gio/src/unixfdlist.ccg +++ b/gio/src/unixfdlist.ccg @@ -1,5 +1,3 @@ -// -*- 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 @@ -24,24 +22,47 @@ namespace Gio { UnixFDList::UnixFDList(const Glib::ArrayHandle& fds) -: _CONSTRUCT("fds", fds.data(), "n_fds", fds.size()) -{} +: + // Mark this class as non-derived to allow C++ vfuncs to be skipped. + Glib::ObjectBase(0), + // g_unix_fd_list_new_from_array() must be called. + // Its parameters don't correspond to properties. + // _CONSTRUCT() + g_unit_fd_list_append() is not an alternative. + // g_unit_fd_list_append() duplicates the file descriptor, + // but g_unix_fd_list_new_from_array() does not. + Glib::Object((GObject*)g_unix_fd_list_new_from_array(fds.data(), fds.size())) +{ +} + +UnixFDList::UnixFDList(const Glib::ArrayHandle& fds, int n_fds) +: + // Mark this class as non-derived to allow C++ vfuncs to be skipped. + Glib::ObjectBase(0), + // g_unix_fd_list_new_from_array() must be called. + // Its parameters don't correspond to properties. + // _CONSTRUCT() + g_unit_fd_list_append() is not an alternative. + // g_unit_fd_list_append() duplicates the file descriptor, + // but g_unix_fd_list_new_from_array() does not. + Glib::Object((GObject*)g_unix_fd_list_new_from_array(fds.data(), n_fds)) +{ +} const Glib::ArrayHandle UnixFDList::peek_fds() const { int length = 0; - const int* fds = g_unix_fd_list_peek_fds(const_cast(gobj()), - &length); - // (length - 1) is used because the array is terminated with a -1. - return Glib::ArrayHandle(fds, length - 1, Glib::OWNERSHIP_NONE); + const int* fds = g_unix_fd_list_peek_fds(const_cast(gobj()), &length); + // The array is terminated with a -1, but that terminating element is + // not included in the length that g_unix_fd_list_peek_fds() returns. + return Glib::ArrayHandle(fds, length, Glib::OWNERSHIP_NONE); } Glib::ArrayHandle UnixFDList::steal_fds() { int length = 0; const int* fds = g_unix_fd_list_steal_fds(gobj(), &length); - // (length - 1) is used because the array is terminated with a -1. - return Glib::ArrayHandle(fds, length - 1, Glib::OWNERSHIP_DEEP); + // The array is terminated with a -1, but that terminating element is + // not included in the length that g_unix_fd_list_steal_fds() returns. + return Glib::ArrayHandle(fds, length, Glib::OWNERSHIP_DEEP); } } // namespace Gio diff --git a/gio/src/unixfdlist.hg b/gio/src/unixfdlist.hg index 4ff3ec4..6525f32 100644 --- a/gio/src/unixfdlist.hg +++ b/gio/src/unixfdlist.hg @@ -1,5 +1,3 @@ -// -*- 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 @@ -26,7 +24,6 @@ _PINCLUDE(glibmm/private/object_p.h) namespace Gio { - /** UnixFDList - An object containing a set of UNIX file descriptors. * A UnixFDList contains a list of file descriptors. It owns the file * descriptors that it contains, closing them when finalized. @@ -49,8 +46,8 @@ protected: explicit UnixFDList(const Glib::ArrayHandle& fds); -#m4 _CONVERSION(`const Glib::ArrayHandle&', `const gint*', `$3.data()') - _WRAP_CTOR(UnixFDList(const Glib::ArrayHandle& fds, int n_fds), g_unix_fd_list_new_from_array) + explicit UnixFDList(const Glib::ArrayHandle& fds, int n_fds); + _IGNORE(g_unix_fd_list_new_from_array) public: _WRAP_METHOD_DOCS_ONLY(g_unix_fd_list_new) diff --git a/gio/src/unixfdmessage.ccg b/gio/src/unixfdmessage.ccg index ec38df4..d112bb6 100644 --- a/gio/src/unixfdmessage.ccg +++ b/gio/src/unixfdmessage.ccg @@ -1,5 +1,3 @@ -// -*- 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 @@ -28,8 +26,9 @@ Glib::ArrayHandle UnixFDMessage::steal_fds() { int length = 0; const int* fds = g_unix_fd_message_steal_fds(gobj(), &length); - // (length - 1) is used because the array is terminated with a -1. - return Glib::ArrayHandle(fds, length - 1, Glib::OWNERSHIP_DEEP); + // The array is terminated with a -1, but that terminating element is + // not included in the length that g_unix_fd_message_steal_fds() returns. + return Glib::ArrayHandle(fds, length, Glib::OWNERSHIP_DEEP); } } // namespace Gio diff --git a/gio/src/unixfdmessage.hg b/gio/src/unixfdmessage.hg index 05a1e10..d54c8e6 100644 --- a/gio/src/unixfdmessage.hg +++ b/gio/src/unixfdmessage.hg @@ -1,5 +1,3 @@ -// -*- 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 @@ -57,12 +55,11 @@ public: _WRAP_METHOD_DOCS_ONLY(g_unix_fd_message_new_with_fd_list) _WRAP_CREATE(const Glib::RefPtr& fd_list) - _WRAP_METHOD(Glib::RefPtr get_fd_list(), g_unix_fd_message_get_fd_list) - _WRAP_METHOD(Glib::RefPtr get_fd_list() const, g_unix_fd_message_get_fd_list, constversion) + _WRAP_METHOD(Glib::RefPtr get_fd_list(), g_unix_fd_message_get_fd_list, refreturn) + _WRAP_METHOD(Glib::RefPtr get_fd_list() const, g_unix_fd_message_get_fd_list, refreturn, constversion) _WRAP_METHOD(bool append_fd(int fd), g_unix_fd_message_append_fd, errthrow) - /** Returns the array of file descriptors that is contained in this object. * * After this call, the descriptors are no longer contained in message. diff --git a/glib/src/datetime.hg b/glib/src/datetime.hg index 601d977..a9c4221 100644 --- a/glib/src/datetime.hg +++ b/glib/src/datetime.hg @@ -95,6 +95,7 @@ public: * TimeSpan that is returned is effectively @a *this - @a other. * * @newin{2,26} + * * @param other The other DateTime. * @return The difference between the two DateTime, as a time * span expressed in microseconds. @@ -106,6 +107,7 @@ public: * as a CompareFunc. * * @newin{2,26} + * * @param other The DateTime to compare with. * @return -1, 0 or 1 if @a *this is less than, equal to or greater * than @a other. @@ -120,6 +122,7 @@ public: * them to the same time zone. * * @newin{2,26} + * * @param other The DateTime to compare with. * @return true if @a *this and @a other are equal. */ diff --git a/glib/src/glib_docs.xml b/glib/src/glib_docs.xml index e0ff2b8..3660e8f 100644 --- a/glib/src/glib_docs.xml +++ b/glib/src/glib_docs.xml @@ -2811,7 +2811,7 @@ a value never returned from g_unichar_get_script() a mark glyph that takes its script from the -i base glyph to which it is attached +base glyph to which it is attached @@ -3314,7 +3314,10 @@ Old South Arabian. Since 2.26 Tirhuta. Since: 2.42 -@G_UNICODE_SCRIPT_WARANG_CITI Warang Citi. Since: 2.42 + + + + Warang Citi. Since: 2.42 @@ -10517,7 +10520,9 @@ Since: 2.36 - + %TRUE on success, %FALSE if there was an error. + + @@ -17158,7 +17163,9 @@ Since: 2.32 - + %TRUE if @key is in @hash_table, %FALSE otherwise. + + @@ -17357,7 +17364,7 @@ key. Use @length to determine the true length if it's possible that %NULL was used as the value for a key. Note: in the common case of a string-keyed #GHashTable, the return -value of this function can be conveniently cast to (gchar **). +value of this function can be conveniently cast to (const gchar **). You should always free the return result with g_free(). In the above-mentioned case of a string-keyed hash table, it may be @@ -28951,7 +28958,9 @@ Since: 2.44 - + %TRUE if strict POSIX is enabled, %FALSE otherwise. + + @@ -29238,6 +29247,10 @@ Since: 2.44 a #GoptionContext + + the new value + + @@ -58402,7 +58415,7 @@ Values of this type can range from #G_MINSSIZE to #G_MAXSSIZE. To print or scan values of this type, use -%G_GSIZE_MODIFIER and/or %G_GSSIZE_FORMAT. +%G_GSSIZE_MODIFIER and/or %G_GSSIZE_FORMAT. diff --git a/glib/src/glib_docs_override.xml b/glib/src/glib_docs_override.xml index 77c4d22..9eee106 100644 --- a/glib/src/glib_docs_override.xml +++ b/glib/src/glib_docs_override.xml @@ -46,6 +46,7 @@ Loads a key file into an empty KeyFile instance. If the file could not be loaded then a FileError or KeyFileError exception is thrown. Since: 2.6 + \throw Glib::FileError \throw Glib::KeyFileError diff --git a/glib/src/keyfile.hg b/glib/src/keyfile.hg index 5f7c199..c976a95 100644 --- a/glib/src/keyfile.hg +++ b/glib/src/keyfile.hg @@ -263,6 +263,7 @@ public: * If @a key cannot be found then it is created. * * @newin{2,12} + * * @param key A key. * @param value An double value. */ diff --git a/glib/src/variant.hg b/glib/src/variant.hg index 0cb1a82..be750d0 100644 --- a/glib/src/variant.hg +++ b/glib/src/variant.hg @@ -144,6 +144,7 @@ public: /** Checks if @a *this and @a other have the same type and value. * * @newin{2,24} + * * @param other The Variant to compare with. * @return true if @a *this and @a other are equal. */ diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc index 213f52e..7fb58f2 100644 --- a/tools/extra_defs_gen/generate_defs_gio.cc +++ b/tools/extra_defs_gen/generate_defs_gio.cc @@ -114,6 +114,7 @@ int main(int, char**) << get_defs(G_TYPE_SRV_TARGET) << get_defs(G_TYPE_RESOLVER) << get_defs(G_TYPE_NETWORK_ADDRESS) + << get_defs(G_TYPE_NETWORK_MONITOR) << get_defs(G_TYPE_NETWORK_SERVICE) << get_defs(G_TYPE_SETTINGS) << get_defs(G_TYPE_SIMPLE_PERMISSION) diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4 index 3d17066..9444c32 100644 --- a/tools/m4/convert_gio.m4 +++ b/tools/m4/convert_gio.m4 @@ -32,6 +32,7 @@ _CONV_ENUM(G,FileType) _CONV_ENUM(G,MountMountFlags) _CONV_ENUM(G,MountOperationResult) _CONV_ENUM(G,MountUnmountFlags) +_CONV_ENUM(G,NetworkConnectivity) _CONV_ENUM(G,OutputStreamSpliceFlags) _CONV_ENUM(G,PasswordSave) _CONV_ENUM(G,ResolverRecordType) @@ -240,6 +241,10 @@ _CONVERSION(`PasswordSave',`GPasswordSave',`($2)$3') #MountOperation #_CONVERSION(`GAskPasswordFlags',`AskPasswordFlags',`($2)$3') +# NetworkMonitor +_CONVERSION(`GNetworkMonitor*',`Glib::RefPtr',`Glib::wrap($3)') + + # Notification _CONVERSION(`GNotification*',`Glib::RefPtr',`Glib::wrap($3)') _CONVERSION(`const Glib::RefPtr&',`GNotification*',__CONVERT_CONST_REFPTR_TO_P) diff --git a/tools/m4/enum.m4 b/tools/m4/enum.m4 index 3ac338b..dc98892 100644 --- a/tools/m4/enum.m4 +++ b/tools/m4/enum.m4 @@ -1,5 +1,6 @@ dnl dnl _ENUM(cpp_type, c_type, value_suffix, `element_list', `flags', `optional_refdoc_comment', 'get_type_function_name') +dnl $1 $2 $3 $4 $5 $6 $7 dnl m4_define(`_ENUM',`dnl _PUSH() @@ -20,6 +21,7 @@ m4_define(`__DOCGROUP_'__MODULE_CANONICAL__`_ENUMS__')dnl dnl dnl /** $6 + * * @ingroup __MODULE_CANONICAL__`'Enums m4_ifelse($3,Flags,`dnl * @par Bitwise operators: diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index 1997945..0e9e66f 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -285,11 +285,11 @@ sub lookup_enum_documentation($$$$) $param =~ s/([a-zA-Z0-9]*(_[a-zA-Z0-9]+)*)_?/$1/g; if(length($desc) > 0) { - $desc =~ s/\n/ /g; - $desc =~ s/ $//; - $desc =~ s/^\s+//; # Chop off leading whitespace + # Chop off leading and trailing whitespace. + $desc =~ s/^\s+//; + $desc =~ s/\s+$//; $desc .= '.' unless($desc =~ /(?:^|\.)$/); - $docs .= "\@var $cpp_enum_name ${param}\n \u${desc}\n\n"; # \u = Convert next char to uppercase + $docs .= "\@var $cpp_enum_name ${param}\n\u${desc}\n\n"; # \u = Convert next char to uppercase } } @@ -514,14 +514,20 @@ sub convert_tags_to_doxygen($) s"\n?(.*?)\n?"&DocsParser::convert_variablelist($1)"esg; # Use our Doxygen @newin alias. - # If Since is not followed by a colon, substitute @newin only if it's - # in a sentence of its own at the end of the string. - s/\bSince:\s*(\d+)\.(\d+)\.(\d+)\b\.?/\@newin{$1,$2,$3}/g; - s/\bSince:\s*(\d+)\.(\d+)\b\.?/\@newin{$1,$2}/g; - s/(\.\s+)Since\s+(\d+)\.(\d+)\.(\d+)\.?$/$1\@newin{$2,$3,$4}/; - s/(\.\s+)Since\s+(\d+)\.(\d+)\.?$/$1\@newin{$2,$3}/; - - s"\b->\b"->"g; + # Accept "Since" with or without a following colon. + # Require the Since clause to be + # - at the end of the string, + # - at the end of a line and followed by a blank line, or + # - followed by "Deprecated". + # If none of these requirements is met, "Since" may be embedded inside + # a function description, referring to only a part of the description. + # See e.g. g_date_time_format() and gdk_cursor_new_from_pixbuf(). + # Doxygen assumes that @newin is followed by a paragraph that describes + # what is new, but we don't use it that way. + my $first_part = '\bSince[:\h]\h*(\d+)\.(\d+)'; # \h == [\t ] (horizontal whitespace) + my $last_part = '\.?(\s*$|\h*\n\h*\n|\s+Deprecated)'; + s/$first_part\.(\d+)$last_part/\@newin{$1,$2,$3}$4/g; + s/$first_part$last_part/\@newin{$1,$2}$3/g; # Doxygen is too dumb to handle — s"—" \@htmlonly—\@endhtmlonly "g; diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index de13f5e..1b12f4e 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -679,7 +679,7 @@ sub output_wrap_enum($$$$$$$) DocsParser::lookup_enum_documentation("$c_type", "$cpp_type", " ", \@flags); # Merge the passed in comment to the existing enum documentation. - $comment = $comment . "\n * " . $enum_docs; + $comment .= "\n * " . $enum_docs if $enum_docs ne ""; my $str = sprintf("_ENUM(%s,%s,%s,\`%s\',\`%s\',\`%s\')dnl\n", $cpp_type,