[pangomm/pangomm-2-46] Coverage: Deprecate create(bytes, n_bytes), max(), to_bytes()



commit 5ec4a8184013dce7b0a667574ab4ce085fde7959
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sun Jan 17 20:00:21 2021 +0100

    Coverage: Deprecate create(bytes, n_bytes), max(), to_bytes()
    
    The corresponding C functions are deprecated in pango.

 pango/src/coverage.ccg | 13 ++-----------
 pango/src/coverage.hg  | 15 ++++++++-------
 2 files changed, 10 insertions(+), 18 deletions(-)
---
diff --git a/pango/src/coverage.ccg b/pango/src/coverage.ccg
index 8bbacbd..dca6d67 100644
--- a/pango/src/coverage.ccg
+++ b/pango/src/coverage.ccg
@@ -20,13 +20,8 @@
 namespace Pango
 {
 
-// Deprecated in pango 1.43, but not in pangomm 2.42.
+_DEPRECATE_IFDEF_START
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-Glib::RefPtr<Coverage> Coverage::create(const guchar* bytes, int n_bytes)
-{
-  return Glib::wrap(pango_coverage_from_bytes(const_cast<guchar*>(bytes), n_bytes));
-}
-
 Glib::ArrayHandle<unsigned char> Coverage::to_bytes() const
 {
   guchar* bytes = 0;
@@ -34,11 +29,7 @@ Glib::ArrayHandle<unsigned char> Coverage::to_bytes() const
   pango_coverage_to_bytes(const_cast<PangoCoverage*>(gobj()), &bytes, &n_bytes);
   return Glib::ArrayHandle<unsigned char>(bytes, n_bytes, Glib::OWNERSHIP_SHALLOW);
 }
-
-void Coverage::max(const Glib::RefPtr<Coverage>& other) const
-{
-  pango_coverage_max(const_cast<PangoCoverage*>(gobj()), Glib::unwrap(other));
-}
 G_GNUC_END_IGNORE_DEPRECATIONS
+_DEPRECATE_IFDEF_END
 
 } /* namespace Pango */
diff --git a/pango/src/coverage.hg b/pango/src/coverage.hg
index a9029d7..2f8d07b 100644
--- a/pango/src/coverage.hg
+++ b/pango/src/coverage.hg
@@ -43,24 +43,25 @@ class PANGOMM_API Coverage final
   _IGNORE(pango_coverage_to_bytes)
 
 public:
-  // pango_coverage_from_bytes(), pango_coverage_to_bytes() and pango_coverage_max()
-  // are deprecated in pango 1.43, but not in pangomm 2.42.
-  //TODO: Deprecate in pangomm 2.44.
-  _WRAP_METHOD_DOCS_ONLY(pango_coverage_from_bytes)
-  static Glib::RefPtr<Coverage> create(const guchar* bytes, int n_bytes);
+  _WRAP_METHOD(static Glib::RefPtr<Coverage> create(const guchar* bytes, int n_bytes),
+    pango_coverage_from_bytes, deprecated "This returns an empty RefPtr.")
 
   //_WRAP_METHOD(Glib::RefPtr<Coverage> copy() const, pango_coverage_copy) //see above
 
   _WRAP_METHOD(CoverageLevel get(int index) const, pango_coverage_get)
   _WRAP_METHOD(void set(int index, CoverageLevel level), pango_coverage_set)
 
-  _WRAP_METHOD_DOCS_ONLY(pango_coverage_max)
-  void max(const Glib::RefPtr<Coverage>& other) const;
+  _WRAP_METHOD(void max(const Glib::RefPtr<Coverage>& other) const,
+    pango_coverage_max, deprecated "This function does nothing.")
 
+_DEPRECATE_IFDEF_START
   /** Convert the coverage map into a flat binary format.
+   *
+   * @deprecated This returns an empty array.
    * @return An array of bytes representing the coverage map.
    */
   Glib::ArrayHandle<unsigned char> to_bytes() const;
+_DEPRECATE_IFDEF_END
 };
 
 } // namespace Pango


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]