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

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)
  _WRAP_METHOD(void end_frame(), gdk_draw_context_end_frame)
  _WRAP_METHOD(bool is_in_frame() const, gdk_draw_context_is_in_frame)
  _WRAP_METHOD(::Cairo::RefPtr<const ::Cairo::Region> get_frame_region() const, gdk_draw_context_get_frame_region, refreturn)

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

  // There are no signals or vfuncs.
};

} // namespace Gdk
