Imported Upstream version 2.39.92 upstream/2.39.92
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 06:43:53 +0000 (23:43 -0700)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 06:43:53 +0000 (23:43 -0700)
NEWS
configure.ac
gio/giomm/contenttype.cc
gio/giomm/contenttype.h
gio/src/application.ccg
gio/src/application.hg
gio/src/gio_docs.xml
gio/src/gio_extra_objects.defs
glib/glibmm/ustring.h
tools/m4/convert_glib.m4

diff --git a/NEWS b/NEWS
index 40e6b92..5491520 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,18 @@
+2.39.92 (unstable):
+
+Gio:
+* Application: Add add_main_option_entry() and add_option_group().
+  (Murray Cumming)
+
+Documentation:
+* Glib::ustring: Say more clearly that it must be only UTF-8.
+  (Kjell Ahlstedt) Bug #681560 (vurentjie)
+
+Build:
+* win32: Surround content_type_get_symbolic_icon() with ifdefs.
+  (Giuseppe Penone)
+
+
 2.39.91 (unstable):
 
 Documenation:
index d0b8ec1..eefddba 100644 (file)
@@ -15,7 +15,7 @@
 ## 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.39.91],
+AC_INIT([glibmm], [2.39.92],
         [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
         [glibmm], [http://www.gtkmm.org/])
 AC_PREREQ([2.59])
@@ -60,7 +60,7 @@ AS_IF([test "x$enable_static" = xyes],
   AC_DEFINE([GIOMM_STATIC_LIB],  [1], [Define if giomm is built as a static library])
 ])
 
-glibreq='2.0 >= 2.39.91'
+glibreq='2.0 >= 2.39.92'
 
 GLIBMM_MODULES="sigc++-2.0 >= 2.2.10 glib-$glibreq gobject-$glibreq gmodule-$glibreq"
 GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq"
index 9168899..a01a487 100644 (file)
@@ -56,6 +56,7 @@ Glib::RefPtr<Gio::Icon> content_type_get_icon(const Glib::ustring& type)
   return retvalue;
 }
 
+#ifdef G_OS_UNIX
 Glib::RefPtr<Gio::Icon> content_type_get_symbolic_icon(const Glib::ustring& type)
 {
   Glib::RefPtr<Icon> retvalue = Glib::wrap(g_content_type_get_symbolic_icon(type.c_str()));
@@ -63,6 +64,7 @@ Glib::RefPtr<Gio::Icon> content_type_get_symbolic_icon(const Glib::ustring& type
     retvalue->reference(); //The function does not do a ref for us.
   return retvalue;
 }
+#endif
 
 bool content_type_can_be_executable(const Glib::ustring& type)
 {
index ee14264..476d916 100644 (file)
@@ -97,6 +97,7 @@ Glib::ustring content_type_get_mime_type(const Glib::ustring& type);
  */
 Glib::RefPtr<Icon> content_type_get_icon(const Glib::ustring& type);
 
+#ifdef G_OS_UNIX
 /**
  * Gets the symbolic icon for a content type.
  *
@@ -106,6 +107,7 @@ Glib::RefPtr<Icon> content_type_get_icon(const Glib::ustring& type);
  * @newin{2,34}
  */
 Glib::RefPtr<Icon> content_type_get_symbolic_icon(const Glib::ustring& type);
+#endif
 
 /**
  * Checks if a content type can be executable. Note that for instance
index 3dee00d..8175d9e 100644 (file)
@@ -21,6 +21,7 @@
 #include <giomm/file.h>
 #include <giomm/actiongroup.h>
 #include <giomm/init.h>
+#include <cstring> // std::memset()
 
 namespace
 {
@@ -207,4 +208,14 @@ void Application::open(const Glib::RefPtr<Gio::File>& file, const Glib::ustring&
   open(files, hint);
 }
 
+void Application::add_main_option_entry(Glib::OptionEntry& entry)
+{
+  //Create a temporary array, just so we can give the correct thing to g_application_add_main_option_entries():
+  GOptionEntry array[2];
+  array[0] = *(entry.gobj()); //Copy contents.
+  std::memset(&array[1], 0, sizeof(GOptionEntry));
+
+  g_application_add_main_option_entries(gobj(), array);
+}
+
 } // namespace Gio
index d8d02ef..327736a 100644 (file)
@@ -27,6 +27,7 @@
 #include <giomm/applicationcommandline.h>
 #include <giomm/file.h>
 #include <glibmm/object.h>
+#include <glibmm/optiongroup.h>
 #include <glibmm/variant.h>
 #include <giomm/dbusconnection.h>
 #include <giomm/notification.h>
@@ -129,6 +130,16 @@ public:
 
   _WRAP_METHOD(void set_action_group(const Glib::RefPtr<ActionGroup>& action_group), g_application_set_action_group)
 
+
+  //TODO: Custom write the documentation for this method?
+  _WRAP_METHOD_DOCS_ONLY(g_application_add_main_option_entries)
+  void add_main_option_entry(Glib::OptionEntry& entry);
+  _IGNORE(g_application_add_main_option_entries)
+
+  _WRAP_METHOD(void add_option_group(Glib::OptionGroup& group), g_application_add_option_group)
+
+
+
   _WRAP_METHOD(bool is_registered() const, g_application_get_is_registered)
   _WRAP_METHOD(bool is_remote() const, g_application_get_is_remote)
 
index 9e25bfd..27e4ce7 100644 (file)
@@ -58791,8 +58791,8 @@ Since: 2.40
 
 <function name="g_subprocess_get_identifier">
 <description>
-On UNIX, returns the process ID as a decimal string.  On Windows,
-returns the result of GetProcessId() also as a string.
+On UNIX, returns the process ID as a decimal string.
+On Windows, returns the result of GetProcessId() also as a string.
 
 </description>
 <parameters>
index fe3c161..acfab9a 100644 (file)
   (gtype-id "G_TYPE_ACTION_GROUP")
 )
 
+(define-object ActionMap
+  (in-module "Gio")
+  (c-name "GActionMap")
+  (gtype-id "G_TYPE_ACTION_MAP")
+)
+
 (define-object DBusConnection
   (in-module "Gio")
   (c-name "GDBusConnection")
index f0fa217..6e09ecd 100644 (file)
@@ -84,6 +84,20 @@ struct IteratorTraits<const T*>
  * the old UTF-8 character and the new one to write could be different.
  * Therefore, any write operation would invalidate all other iterators
  * pointing into the same string.
+ *
+ * The Glib::ustring iterated over must contain only valid UTF-8 data.
+ * If it does not, operator++(), operator-\-() and operator*() may make
+ * accesses outside the bounds of the string. A loop such as the following
+ * one would not stop at the end of the string.
+ * @code
+ * // Bad code! Don't do this!
+ * const char not_utf8[] = { '\x80', '\xef', '\x80', '\x80', '\xef', '\x80' };
+ * const Glib::ustring s(not_utf8, not_utf8 + sizeof not_utf8);
+ * for (Glib::ustring::const_iterator it = s.begin(); it != s.end(); ++it)
+ *   std::cout << *it << std::endl;
+ * @endcode
+ *
+ * @tparam T std::string::iterator or std::string::const_iterator
  */
 template <class T>
 class ustring_Iterator
@@ -156,8 +170,13 @@ gunichar get_unichar_from_std_iterator(std::string::const_iterator pos) G_GNUC_P
  * character, and <tt>std::string::length()</tt> returns the number of bytes
  * rather than characters.  So don't do that without a good reason.
  * @par
+ * Many member functions and operators of Glib::ustring and Glib::ustring_Iterator
+ * assume that the string contains only valid UTF-8 data. If it does not, memory
+ * outside the bounds of the string can be accessed.
+ * @par
  * In a perfect world the C++ Standard Library would contain a UTF-8 string
- * class.  Unfortunately, the C++ standard doesn't mention UTF-8 at all.  Note
+ * class.  Unfortunately, the C++98 standard doesn't mention UTF-8 at all.
+ * C++11 has UTF-8 literals but no UTF-8 string class. Note
  * that std::wstring is not a UTF-8 string class because it contains only
  * fixed-width characters (where width could be 32, 16, or even 8 bits).
  *
index 5df0a27..3dd4e8d 100644 (file)
@@ -122,7 +122,7 @@ _CONVERSION(`GObject*',`Glib::RefPtr<const Glib::ObjectBase>',`Glib::wrap($3)')
 
 dnl OptionGroup
 _CONVERSION(`OptionGroup&',`GOptionGroup*',`($3).gobj()')
-#_CONVERSION(`GOptionGroup*',`OptionGroup',`Glib::wrap(($3), true /* take_copy */)')
+_CONVERSION(`Glib::OptionGroup&',`GOptionGroup*',`($3).gobj()')
 
 dnl Bytes
 _CONVERSION(`GBytes*',`Glib::RefPtr<Glib::Bytes>',`Glib::wrap($3)')