/* Copyright (C) 1998-2002 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 <https://www.gnu.org/licenses/>.
 */

_DEFS(gdkmm,gdk)
_CC_INCLUDE(gdk/gdk.h)

#include <gdkmm/types.h>
#include <gdkmm/screen.h>

/* Shadow DELETE macro (from winnt.h).
 */
#if defined(DELETE) && !defined(GTKMM_MACRO_SHADOW_DELETE)
enum { GTKMM_MACRO_DEFINITION_DELETE = DELETE };
#undef DELETE
enum { DELETE = GTKMM_MACRO_DEFINITION_DELETE };
#define DELETE DELETE
#define GTKMM_MACRO_SHADOW_DELETE 1
#endif

#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C" { typedef union _GdkEvent GdkEvent; }
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gdk
{

_WRAP_ENUM(EventType, GdkEventType,
  s#^DOUBLE_BUTTON_PRESS$##,
  s#^2BUTTON_PRESS#DOUBLE_BUTTON_PRESS#,
  s#^TRIPLE_BUTTON_PRESS$##,
  s#^3BUTTON_PRESS#TRIPLE_BUTTON_PRESS#,
  decl_prefix GDKMM_API
)

_WRAP_ENUM(AxisUse, GdkAxisUse, decl_prefix GDKMM_API)
_WRAP_ENUM(AxisFlags, GdkAxisFlags, decl_prefix GDKMM_API)

//TODO: Actually use this class instead of GdkEvent?
class GDKMM_API Event
{
  _CLASS_BOXEDTYPE(Event, GdkEvent, NONE, gdk_event_copy, gdk_event_free, GDKMM_API)
  _CUSTOM_STRUCT_PROTOTYPE
  _IGNORE(gdk_event_copy, gdk_event_free)
public:

  _WRAP_METHOD(static Event get(), gdk_event_get)
  _WRAP_METHOD(static Event peek(), gdk_event_peek)
  _WRAP_METHOD(void put(), gdk_event_put)

  _WRAP_METHOD(static bool events_pending(), gdk_events_pending)

  _WRAP_METHOD(guint32 get_time() const, gdk_event_get_time)
  _WRAP_METHOD(bool get_state(ModifierType& state) const, gdk_event_get_state)
  _WRAP_METHOD(bool get_coords(double& x_win, double& y_win) const, gdk_event_get_coords)
  _WRAP_METHOD(bool get_root_coords(double& x_root, double& y_root) const, gdk_event_get_root_coords)
  _WRAP_METHOD(bool get_axis(AxisUse axis_use, double& value) const, gdk_event_get_axis)
  //_WRAP_METHOD(void	gdk_event_handler_set(GdkEventFunc func, gpointer data, GDestroyNotify  notify), gdk_event_handler_set)

  _WRAP_METHOD(static void set_show_events(bool show_events), gdk_set_show_events)
  _WRAP_METHOD(static bool get_show_events(), gdk_get_show_events)

  _IGNORE(gdk_event_set_screen) //deprecated
  _WRAP_METHOD(Glib::RefPtr<Screen> get_screen(), gdk_event_get_screen, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Screen> get_screen() const, gdk_event_get_screen, refreturn, constversion)
};

} // namespace Gdk
