/* Copyright (C) 2020 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>
#include <gdkmm/monitor.h>

_CC_INCLUDE(gdk/gdk.h)

namespace Gdk
{

/** Information for presenting toplevels.
 *
 * %Toplevel surfaces are sovereign windows that can be presented
 * to the user in various states (maximized, on all workspaces, etc).
 *
 * The %Gdk::ToplevelLayout class contains information that
 * is necessary to do so, and is passed to Gdk::Toplevel::present().
 *
 * @newin{3,98}
 */
class GDKMM_API ToplevelLayout final
{
  // GdkToplevelLayout is actually 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(ToplevelLayout, GdkToplevelLayout, NONE, gdk_toplevel_layout_ref, gdk_toplevel_layout_unref, GDKMM_API)
  _IGNORE(gdk_toplevel_layout_ref, gdk_toplevel_layout_unref)
public:

  _WRAP_METHOD(static Glib::RefPtr<ToplevelLayout> create(), gdk_toplevel_layout_new)
  _WRAP_METHOD(Glib::RefPtr<ToplevelLayout> copy() const, gdk_toplevel_layout_copy)
  _WRAP_METHOD(bool equal(const Glib::RefPtr<const ToplevelLayout>& other) const,
    gdk_toplevel_layout_equal)
  _WRAP_METHOD(void set_maximized(bool maximized = true), gdk_toplevel_layout_set_maximized)
  _WRAP_METHOD(void set_fullscreen(bool fullscreen = true, const Glib::RefPtr<Monitor>& monitor = {}),
    gdk_toplevel_layout_set_fullscreen)
  _WRAP_METHOD(bool get_maximized(bool& maximized) const, gdk_toplevel_layout_get_maximized)
  _WRAP_METHOD(bool get_fullscreen(bool& fullscreen) const, gdk_toplevel_layout_get_fullscreen)
  _WRAP_METHOD(Glib::RefPtr<Monitor> get_fullscreen_monitor(),
    gdk_toplevel_layout_get_fullscreen_monitor, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Monitor> get_fullscreen_monitor() const,
    gdk_toplevel_layout_get_fullscreen_monitor, refreturn, constversion)
  _WRAP_METHOD(void set_resizable(bool resizable = true), gdk_toplevel_layout_set_resizable)
  _WRAP_METHOD(bool get_resizable() const, gdk_toplevel_layout_get_resizable)
};

} // namespace Gdk
