/* Copyright (C) 2016 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(gdkmmconfig.h)

#include <glibmm/object.h>
#include <cairomm/region.h>

_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gdk
{
class GDKMM_API Display;
class GDKMM_API Surface;

/** Drawing context base class.
 *
 * %Gdk::DrawContext is the base object used by contexts implementing different
 * rendering methods, such as GLContext or VulkanContext. It provides
 * shared functionality between those contexts.
 *
 * You will always interact with one of those subclasses.
 *
 * @newin{3,90}
 */
class GDKMM_API DrawContext : public Glib::Object
{
  _CLASS_GOBJECT(DrawContext, GdkDrawContext, GDK_DRAW_CONTEXT, Glib::Object, GObject, , , GDKMM_API)
  _DO_NOT_DERIVE_GTYPE dnl// GdkDrawContext is an internal type
  _ABI_AS_WITH_DERIVED_GTYPE dnl// Remove when we can break ABI

protected:
  /// This constructor is protected because only derived classes shall be instantiated.
  _CTOR_DEFAULT()

public:
  _WRAP_METHOD(Glib::RefPtr<Display> get_display(), gdk_draw_context_get_display, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Display> get_display() const, gdk_draw_context_get_display, refreturn, constversion)
  _WRAP_METHOD(Glib::RefPtr<Surface> get_surface(), gdk_draw_context_get_surface, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Surface> get_surface() const, gdk_draw_context_get_surface, refreturn, constversion)
  _WRAP_METHOD(void begin_frame(const ::Cairo::RefPtr<const ::Cairo::Region>& region), gdk_draw_context_begin_frame,
    deprecated "4.16: Drawing directly to the surface is no longer recommended. Use GskRenderNode and GskRenderer (no C++ equivalents).")
  _WRAP_METHOD(void end_frame(), gdk_draw_context_end_frame,
    deprecated "4.16: Drawing directly to the surface is no longer recommended. Use GskRenderNode and GskRenderer (no C++ equivalents).")
  _WRAP_METHOD(bool is_in_frame() const, gdk_draw_context_is_in_frame,
    deprecated "4.16: Drawing directly to the surface is no longer recommended. Use GskRenderNode and GskRenderer (no C++ equivalents).")
  _WRAP_METHOD(::Cairo::RefPtr<const ::Cairo::Region> get_frame_region() const, gdk_draw_context_get_frame_region, refreturn,
    deprecated "4.16: Drawing directly to the surface is no longer recommended. Use GskRenderNode and GskRenderer (no C++ equivalents).")

  _WRAP_PROPERTY("display", Glib::RefPtr<Display>)
  _WRAP_PROPERTY("surface", Glib::RefPtr<Surface>)

  // There are no signals or vfuncs.
};

} // namespace Gdk
