/* Copyright (C) 2019 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/>.
 */

_CONFIGINCLUDE(gtkmmconfig.h)

#include <glibmm/interface.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/interface_p.h)
_PINCLUDE(gdk/gdk.h)

#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C"
{
typedef struct _GtkNativeInterface GtkNativeInterface;
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

namespace Gdk
{
class GTKMM_API Surface;
}

namespace Gtk
{
class GTKMM_API Widget;

/** Interface for widgets having surfaces.
 *
 * %Gtk::Native is the interface implemented by all widgets that can provide
 * a Gdk::Surface for widgets to render on.
 *
 * The obvious example of a %Gtk::Native is Gtk::Window.
 *
 * @see Gtk::Root, Gtk::Window
 * @newin{3,96}
 */
class GTKMM_API Native : public Glib::Interface
{
  _CLASS_INTERFACE(Native, GtkNative, GTK_NATIVE, GtkNativeInterface, , , GTKMM_API)

public:
  _WRAP_METHOD(void realize(), gtk_native_realize)
  _WRAP_METHOD(void unrealize(), gtk_native_unrealize)
  _WRAP_METHOD(static Native* get_for_surface(const Glib::RefPtr<const Gdk::Surface>& surface),
    gtk_native_get_for_surface)

  _WRAP_METHOD(Glib::RefPtr<Gdk::Surface> get_surface(), gtk_native_get_surface, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Gdk::Surface> get_surface() const, gtk_native_get_surface, refreturn, constversion)

  //?_WRAP_METHOD(GskRenderer* get_renderer(), gtk_native_get_renderer)
  _WRAP_METHOD(void get_surface_transform(double& x, double& y), gtk_native_get_surface_transform)
};

} // namespace Gtk
