Imported Upstream version 2.47.92 upstream/2.47.92
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 07:11:06 +0000 (00:11 -0700)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 07:11:06 +0000 (00:11 -0700)
13 files changed:
MSVC_Net2013/glibmm-build-defines.props
NEWS
configure.ac
examples/thread/dispatcher.cc
examples/thread/threadpool.cc
glib/glibmm/propertyproxy_base.h
tests/glibmm_nodetree/main.cc
tests/glibmm_refptr_sigc_bind/main.cc
tools/extra_defs_gen/generate_extra_defs.cc
tools/pm/GtkDefs.pm
tools/pm/Output.pm
tools/pm/Property.pm
tools/pm/WrapParser.pm

index a10404f..5cbde3c 100644 (file)
@@ -16,7 +16,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
-      <AdditionalIncludeDirectories>.\glibmm;..;..\glib;$(GlibEtcInstallRoot)\include\sigc++-2.0;$(GlibEtcInstallRoot)\lib\sigc++-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.\glibmm;..;..\glib;$(GlibEtcInstallRoot)\include\sigc++-2.0;$(GlibEtcInstallRoot)\lib\sigc++-2.0\include;$(GlibEtcInstallRoot)\include\gio-win32-2.0;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
diff --git a/NEWS b/NEWS
index a959548..7639ae1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,24 @@
+2.47.92:
+
+* Adapt to libsigc++-2.0 2.8:
+  - using only the non-deprecated sigc::mem_fun() API.
+  (Kjell Ahlstedt)
+  - using std::ref instead of deprecated sigc::ref.
+  (Murray Cumming)
+  -  Correct bad uses of sigc::bind<1>.
+  (Murray Cumming)
+
+
+gmmproc:
+* defs generation: Mark deprecated signals and properties as such in the
+  generated .defs file.
+* gmmproc: Check if signals and properties are deprecated appropriately
+  (Kjell Ahlstedt)
+
+Build:
+* MSVC builds: Look for includes in include/gio-win32-2.0.
+  (Chun-wei Fan)
+
 2.47.6:
 
 Glib:
index b7b81b2..12af831 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.47.6],
+AC_INIT([glibmm], [2.47.92],
         [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
         [glibmm], [http://www.gtkmm.org/])
 AC_PREREQ([2.59])
@@ -62,9 +62,9 @@ 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.47.6'
+glibreq='2.0 >= 2.47.92'
 
-GLIBMM_MODULES="sigc++-2.0 >= 2.6.0 glib-$glibreq gobject-$glibreq gmodule-$glibreq"
+GLIBMM_MODULES="sigc++-2.0 >= 2.8.0 glib-$glibreq gobject-$glibreq gmodule-$glibreq"
 GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq"
 test "x$glibmm_host_windows" = xyes || GIOMM_MODULES="$GIOMM_MODULES gio-unix-$glibreq"
 
index 9f0f56e..ae9e084 100644 (file)
@@ -161,7 +161,7 @@ Application::Application() : main_loop_(Glib::MainLoop::create()), progress_thre
       progress_threads_[i] = progress;
 
       progress->signal_finished().connect(
-        sigc::bind<1>(sigc::mem_fun(*this, &Application::on_progress_finished), progress));
+        sigc::bind(sigc::mem_fun(*this, &Application::on_progress_finished), progress));
     }
   }
   catch (...)
index 891c565..885962b 100644 (file)
@@ -56,7 +56,7 @@ main(int, char**)
 
   for (auto c = 'a'; c <= 'z'; ++c)
   {
-    pool.push(sigc::bind<1>(sigc::ptr_fun(&print_char), c));
+    pool.push(sigc::bind(sigc::ptr_fun(&print_char), c));
   }
 
   pool.shutdown();
index c939b5c..e8d6290 100644 (file)
@@ -29,7 +29,7 @@ namespace Glib
 
 class ObjectBase;
 
-/// Use the connect() method, with sigc::ptr_fun() or sig::mem_fun() to connect signals to signal
+/// Use the connect() method, with sigc::ptr_fun() or sigc::mem_fun() to connect signals to signal
 /// handlers.
 class SignalProxyProperty : public SignalProxyBase
 {
index d5bdc82..fffdafa 100644 (file)
@@ -83,28 +83,28 @@ main()
    */
 
   tstring.clear();
-  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), sigc::ref(tstring)),
+  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
     Glib::TRAVERSE_PRE_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
   g_assert(tstring == "ABCDEFGHIJK");
   tstring.clear();
-  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), sigc::ref(tstring)),
+  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
     Glib::TRAVERSE_POST_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
   g_assert(tstring == "CDEBHIJKGFA");
   tstring.clear();
-  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), sigc::ref(tstring)),
+  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
     Glib::TRAVERSE_IN_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
   g_assert(tstring == "CBDEAHGIJKF");
   tstring.clear();
-  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), sigc::ref(tstring)),
+  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
     Glib::TRAVERSE_LEVEL_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
   g_assert(tstring == "ABFCDEGHIJK");
   tstring.clear();
 
-  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), sigc::ref(tstring)),
+  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
     Glib::TRAVERSE_LEVEL_ORDER, type_nodetree_string::TRAVERSE_LEAVES, -1);
   g_assert(tstring == "CDEHIJK");
   tstring.clear();
-  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), sigc::ref(tstring)),
+  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
     Glib::TRAVERSE_PRE_ORDER, type_nodetree_string::TRAVERSE_NON_LEAVES, -1);
   g_assert(tstring == "ABFG");
   tstring.clear();
@@ -112,7 +112,7 @@ main()
   node_B->reverse_children();
   node_G->reverse_children();
 
-  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), sigc::ref(tstring)),
+  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
     Glib::TRAVERSE_LEVEL_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
   g_assert(tstring == "ABFEDCGKJIH");
   tstring.clear();
@@ -121,9 +121,9 @@ main()
   g_assert(root->node_count(type_nodetree_string::TRAVERSE_ALL) ==
            node->node_count(type_nodetree_string::TRAVERSE_ALL));
   g_assert(root->get_max_height() == node->get_max_height());
-  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), sigc::ref(tstring)),
+  root->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(tstring)),
     Glib::TRAVERSE_IN_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
-  node->traverse(sigc::bind(sigc::ptr_fun(node_build_string), sigc::ref(cstring)),
+  node->traverse(sigc::bind(sigc::ptr_fun(node_build_string), std::ref(cstring)),
     Glib::TRAVERSE_IN_ORDER, type_nodetree_string::TRAVERSE_ALL, -1);
   g_assert(tstring == cstring);
 
index 7d3546a..826b915 100644 (file)
@@ -36,10 +36,10 @@ public:
   {
 // std::cout << "new Test" << std::endl;
 #ifdef ACTIVATE_BUG // See https://bugzilla.gnome.org/show_bug.cgi?id=564005#c15s
-    action->signal_sig1().connect(sigc::bind(sigc::mem_fun(this, &Test::on_sig1), action));
+    action->signal_sig1().connect(sigc::bind(sigc::mem_fun(*this, &Test::on_sig1), action));
 #else
     Glib::RefPtr<Action> action2(new Action);
-    action->signal_sig1().connect(sigc::bind(sigc::mem_fun(this, &Test::on_sig1), action2));
+    action->signal_sig1().connect(sigc::bind(sigc::mem_fun(*this, &Test::on_sig1), action2));
 #endif
   }
 
index 38f2b05..3b5028d 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* generate_extra_defs.cc
  *
  * Copyright (C) 2001 The Free Software Foundation
@@ -47,6 +45,7 @@ get_property_with_node_name(
   bool bReadable = (flags & G_PARAM_READABLE) == G_PARAM_READABLE;
   bool bWritable = (flags & G_PARAM_WRITABLE) == G_PARAM_WRITABLE;
   bool bConstructOnly = (flags & G_PARAM_CONSTRUCT_ONLY) == G_PARAM_CONSTRUCT_ONLY;
+  bool bDeprecated = (flags & G_PARAM_DEPRECATED) == G_PARAM_DEPRECATED;
 
   //#t and #f aren't documented, but I guess that it's correct based on the example in the .defs
   // spec.
@@ -56,6 +55,8 @@ get_property_with_node_name(
   strResult += "  (readable " + (bReadable ? strTrue : strFalse) + ")\n";
   strResult += "  (writable " + (bWritable ? strTrue : strFalse) + ")\n";
   strResult += "  (construct-only " + (bConstructOnly ? strTrue : strFalse) + ")\n";
+  if (bDeprecated)
+    strResult += "  (deprecated #t)\n"; // Default: not deprecated
 
   strResult += ")\n\n"; // close (strNodeName
 
@@ -225,6 +226,9 @@ get_signals(GType gtype, GTypeIsAPointerFunc is_a_pointer_func)
 
         strResult += "  (when \"" + strWhen + "\")\n";
       }
+      bool bDeprecated = (signalQuery.signal_flags & G_SIGNAL_DEPRECATED) == G_SIGNAL_DEPRECATED;
+      if (bDeprecated)
+        strResult += "  (deprecated #t)\n"; // Default: not deprecated
 
       // Loop through the list of parameters:
       const GType* pParameters = signalQuery.param_types;
index 5fdef5a..f4d23be 100644 (file)
@@ -715,7 +715,8 @@ BEGIN { @GtkDefs::Signal::ISA=qw(GtkDefs::Function); }
 #       string rettype;
 #
 #       string when. e.g. first, last, or both.
-#       string entity_type. e.g. method or signal
+#       string entity_type. e.g. vfunc or signal
+#       bool deprecated; # optional
 #    }
 
 # "new" can't have prototype
@@ -770,6 +771,8 @@ sub new
     $$self{rettype} = "void"
   }
 
+  $$self{deprecated} = ($1 eq "#t") if ($def =~ s/\(deprecated (\S+)\)//);
+
   # signals always have a parameter
   push(@{$$self{param_types}}, "$$self{class}*");
   push(@{$$self{param_names}}, "self");
@@ -788,6 +791,13 @@ sub new
   return $self;
 }
 
+# bool get_deprecated()
+sub get_deprecated($)
+{
+  my ($self) = @_;
+  return $$self{deprecated}; # undef, 0 or 1
+}
+
 # bool has_same_types($objFunction)
 # Compares return types and argument types
 sub has_same_types($$)
index 610ab15..df0c9a0 100644 (file)
@@ -85,6 +85,32 @@ sub error
   printf STDERR "Output.pm, $main::source: $format",@_;
 }
 
+# void check_deprecation($file_deprecated, $defs_deprecated, $wrap_deprecated,
+#   $entity_name, $entity_type, $wrapper)
+sub check_deprecation($$$$$$)
+{
+  my ($file_deprecated, $defs_deprecated, $wrap_deprecated,
+      $entity_name, $entity_type, $wrapper) = @_;
+
+  # Don't print a warning if the whole .hg file is deprecated.
+  return if ($file_deprecated);
+
+  if ($defs_deprecated && !$wrap_deprecated)
+  {
+    print STDERR "Warning, $main::source: The $entity_name $entity_type" .
+      " is deprecated in the .defs file, but not in _WRAP_$wrapper.\n";
+  }
+  # Uncomment the following lines some time in the future, when most
+  # signal.defs files have been updated with deprecation information.
+  # generate_extra_defs.cc was updated to generate this info soon after
+  # glibmm 2.47.6.
+  #elsif (!$defs_deprecated && $wrap_deprecated)
+  #{
+  #  print STDERR "Warning, $main::source: The $entity_name $entity_type" .
+  #    " is deprecated in _WRAP_$wrapper, but not in the .defs file.\n";
+  #}
+}
+
 sub ifdef($$)
 {
        my ($self, $ifdef) = @_;
@@ -893,11 +919,12 @@ sub output_wrap_any_property($$$$$$$$$$)
 }
 
 # _PROPERTY_PROXY(name, cpp_type)
-# void output_wrap_property($filename, $line_num, $name, $cpp_type, $deprecated, $deprecation_docs)
-sub output_wrap_property($$$$$$$$)
+# void output_wrap_property($filename, $line_num, $name, $cpp_type, $file_deprecated,
+#   $deprecated, $deprecation_docs)
+sub output_wrap_property($$$$$$$$$$)
 {
-  my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $deprecated,
-      $deprecation_docs, $newin) = @_;
+  my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $file_deprecated,
+      $deprecated, $deprecation_docs, $newin) = @_;
 
   my $objProperty = GtkDefs::lookup_property($c_class, $name);
   if($objProperty eq 0) #If the lookup failed:
@@ -906,17 +933,21 @@ sub output_wrap_property($$$$$$$$)
   }
   else
   {
+    Output::check_deprecation($file_deprecated, $objProperty->get_deprecated(),
+      $deprecated, $name, "property", "PROPERTY");
+
     $self->output_wrap_any_property($filename, $line_num, $name, $cpp_type, $c_class,
       $deprecated, $deprecation_docs, $newin, $objProperty, "_PROPERTY_PROXY");
   }
 }
 
 # _CHILD_PROPERTY_PROXY(name, cpp_type)
-# void output_wrap_child_property($filename, $line_num, $name, $cpp_type, $deprecated, $deprecation_docs)
-sub output_wrap_child_property($$$$$$$$)
+# void output_wrap_child_property($filename, $line_num, $name, $cpp_type, $file_deprecated,
+#   $deprecated, $deprecation_docs)
+sub output_wrap_child_property($$$$$$$$$$)
 {
-  my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $deprecated,
-      $deprecation_docs, $newin) = @_;
+  my ($self, $filename, $line_num, $name, $cpp_type, $c_class, $file_deprecated,
+      $deprecated, $deprecation_docs, $newin) = @_;
 
   my $objChildProperty = GtkDefs::lookup_child_property($c_class, $name);
   if($objChildProperty eq 0) #If the lookup failed:
@@ -925,6 +956,9 @@ sub output_wrap_child_property($$$$$$$$)
   }
   else
   {
+    Output::check_deprecation($file_deprecated, $objChildProperty->get_deprecated(),
+      $deprecated, $name, "child property", "CHILD_PROPERTY");
+
     $self->output_wrap_any_property($filename, $line_num, $name, $cpp_type, $c_class,
       $deprecated, $deprecation_docs, $newin, $objChildProperty, "_CHILD_PROPERTY_PROXY");
   }
index 8e2a131..265a3f7 100644 (file)
@@ -26,6 +26,7 @@ our @EXPORT_OK;
 #       bool readable;
 #       bool writable;
 #       bool construct_only;
+#       bool deprecated; # optional
 #       string docs;
 #    }
 
@@ -46,6 +47,7 @@ sub new
   $$self{readable} = ($1 eq "#t")       if ($def =~ s/\(readable (\S+)\)//);
   $$self{writable} = ($1 eq "#t")       if ($def =~ s/\(writable (\S+)\)//);
   $$self{construct_only} = ($1 eq "#t") if ($def =~ s/\(construct-only (\S+)\)//);
+  $$self{deprecated} = ($1 eq "#t")     if ($def =~ s/\(deprecated (\S+)\)//);
   $$self{entity_type} = 'property';
 
   # Property documentation:
@@ -110,6 +112,12 @@ sub get_writable($)
   return $$self{writable};
 }
 
+sub get_deprecated($)
+{
+  my ($self) = @_;
+  return $$self{deprecated}; # undef, 0 or 1
+}
+
 sub get_docs($$)
 {
   my ($self, $deprecation_docs, $newin) = @_;
index b33ecb1..65fb936 100644 (file)
@@ -144,7 +144,8 @@ sub parse_and_build_output($)
       # _CLASS_OPAQUE_REFCOUNTED
     }
 
-    if ($token eq "namespace") { $self->on_namespace() };
+    if ($token eq "namespace") { $self->on_namespace(); }
+    if ($token eq "_IS_DEPRECATED") { $$self{deprecated} = 1; }
 
     # After all token manipulations
     if($bAppend)
@@ -1536,7 +1537,7 @@ sub on_wrap_property($)
       $deprecation_docs, $newin) = $self->on_wrap_any_property();
 
   $objOutputter->output_wrap_property($filename, $line_num, $argPropertyName,
-    $argCppType, $$self{c_class}, $argDeprecated, $deprecation_docs, $newin);
+    $argCppType, $$self{c_class}, $$self{deprecated}, $argDeprecated, $deprecation_docs, $newin);
 }
 
 sub on_wrap_child_property($)
@@ -1550,7 +1551,7 @@ sub on_wrap_child_property($)
       $deprecation_docs, $newin) = $self->on_wrap_any_property();
 
   $objOutputter->output_wrap_child_property($filename, $line_num, $argPropertyName,
-    $argCppType, $$self{c_class}, $argDeprecated, $deprecation_docs, $newin);
+    $argCppType, $$self{c_class}, $$self{deprecated}, $argDeprecated, $deprecation_docs, $newin);
 }
 
 sub output_wrap_check($$$$$$)
@@ -1613,6 +1614,9 @@ sub output_wrap_signal($$$$$$$$$$$$$$$$$)
     }
   }
 
+  Output::check_deprecation($$self{deprecated}, $objCSignal->get_deprecated(),
+    $deprecated, $signal_name, "signal", "SIGNAL");
+
   $objOutputter->output_wrap_sig_decl($filename, $line_num, $objCSignal, $objCppSignal,
     $signal_name, $bCustomCCallback, $ifdef, $commentblock,
     $deprecated, $deprecation_docs, $newin, $exceptionHandler,