/* Copyright (C) 2018 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, see <http://www.gnu.org/licenses/>.
 */

_DEFS(gdkmm,gdk)

#include <glibmm/refptr.h>

_CC_INCLUDE(gdk/gdk.h)

extern "C" typedef struct _GdkFrameTimings GdkFrameTimings;

namespace Gdk
{

/** Object holding timing information for a single frame.
 *
 * A %Gdk::FrameTimings object holds timing information for a single frame
 * of the application’s displays. To retrieve %Gdk::FrameTimings objects,
 * use Gdk::FrameClock::get_timings() or Gdk::FrameClock::get_current_timings().
 * The information in %Gdk::FrameTimings is useful for precise synchronization
 * of video with the event or audio streams, and for measuring
 * quality metrics for the application’s display, such as latency and jitter.
 *
 * @newin{3,94}
 */
class FrameTimings final
{
  // GdkFrameTimings is registered as a boxed type, but it has custom
  // reference-counting instead of copy/free functions, so we use it via RefPtr.
  _CLASS_OPAQUE_REFCOUNTED(FrameTimings, GdkFrameTimings, NONE, gdk_frame_timings_ref, gdk_frame_timings_unref)
  _IGNORE(gdk_frame_timings_ref, gdk_frame_timings_unref)
public:
  _WRAP_METHOD(gint64 get_frame_counter() const, gdk_frame_timings_get_frame_counter)
  _WRAP_METHOD(bool get_complete() const, gdk_frame_timings_get_complete)
  _WRAP_METHOD(gint64 get_frame_time() const, gdk_frame_timings_get_frame_time)
  _WRAP_METHOD(gint64 get_presentation_time() const, gdk_frame_timings_get_presentation_time)
  _WRAP_METHOD(gint64 get_refresh_interval() const, gdk_frame_timings_get_refresh_interval)
  _WRAP_METHOD(gint64 get_predicted_presentation_time() const, gdk_frame_timings_get_predicted_presentation_time)
};

} // namespace Gdk
