/* Copyright 1998-1999 The gtkmm Development Team
 * Copyright 2001      Free Software Foundation
 *
 * 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, see <https://www.gnu.org/licenses/>.
 */

// The g_object_ref() preprocessor macro can't be used in a _CLASS_OPAQUE_REFCOUNTED.
// The g_object_ref() function is fine.
//-- pango/pangomm/coverage.cc: In member function ‘PangoCoverage* Pango::Coverage::gobj_copy() const’:
//-- glib-2.0/gobject/gobject.h:548:28: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
//--   548 | #define g_object_ref(Obj) ((glib_typeof (Obj)) (g_object_ref) (Obj))
//--       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//-- pango/pangomm/coverage.cc:125:3: note: in expansion of macro ‘g_object_ref’
//--   125 |   g_object_ref(gobject);
//--       |   ^~~~~~~~~~~~
// gobject is defined as a const pointer to a non-const object (const auto).
#undef g_object_ref

namespace Pango
{

_DEPRECATE_IFDEF_START
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Glib::ArrayHandle<unsigned char> Coverage::to_bytes() const
{
  guchar* bytes = 0;
  int n_bytes = 0;
  pango_coverage_to_bytes(const_cast<PangoCoverage*>(gobj()), &bytes, &n_bytes);
  return Glib::ArrayHandle<unsigned char>(bytes, n_bytes, Glib::OWNERSHIP_SHALLOW);
}
G_GNUC_END_IGNORE_DEPRECATIONS
_DEPRECATE_IFDEF_END

} /* namespace Pango */
