/* 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/>.
 */

#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 Surface;
}

namespace Gtk
{
class 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 Native : public Glib::Interface
{
  _CLASS_INTERFACE(Native, GtkNative, GTK_NATIVE, GtkNativeInterface)

public:
  _WRAP_METHOD(static Widget* get_for_surface(const Glib::RefPtr<const Gdk::Surface>& surface),
    gtk_native_get_for_surface)

  _WRAP_METHOD(void check_resize(), gtk_native_check_resize)

  _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)

protected:
#m4 _CONVERSION(`Glib::RefPtr<Gdk::Surface>', `GdkSurface*', __CONVERT_REFPTR_TO_P)
  _WRAP_VFUNC(Glib::RefPtr<Gdk::Surface> get_surface(), "get_surface", refreturn)
  //?_WRAP_VFUNC(GskRenderer* get_renderer(), "get_renderer")
  _WRAP_VFUNC(void get_surface_transform(int& x, int& y), "get_surface_transform")
  _WRAP_VFUNC(void check_resize(), "check_resize")
};

} // namespace Gtk
