// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GDKMM_EVENT_H
#define _GDKMM_EVENT_H

#include <glibmm.h>

/* $Id: event.hg,v 1.15 2002/11/14 19:02:36 murrayc Exp $ */

/* event.h
 *
 * 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 Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */


#include <gdkmm/window.h>

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


namespace Gdk
{


// Undefine DELETE macro (previously defined in winnt.h).
#if defined(GTKMM_WIN32) && defined(DELETE)
#  undef  DELETE
#  define GDKMM_UNDEF_DELETE
#endif
/** @addtogroup gdkmmEnums Enums and Flags */

/**
 * @ingroup gdkmmEnums
 */
enum EventType
{
  NOTHING = -1,
  DELETE,
  DESTROY,
  EXPOSE,
  MOTION_NOTIFY,
  BUTTON_PRESS,
  DOUBLE_BUTTON_PRESS,
  TRIPLE_BUTTON_PRESS,
  BUTTON_RELEASE,
  KEY_PRESS,
  KEY_RELEASE,
  ENTER_NOTIFY,
  LEAVE_NOTIFY,
  FOCUS_CHANGE,
  CONFIGURE,
  MAP,
  UNMAP,
  PROPERTY_NOTIFY,
  SELECTION_CLEAR,
  SELECTION_REQUEST,
  SELECTION_NOTIFY,
  PROXIMITY_IN,
  PROXIMITY_OUT,
  DRAG_ENTER,
  DRAG_LEAVE,
  DRAG_MOTION,
  DRAG_STATUS,
  DROP_START,
  DROP_FINISHED,
  CLIENT_EVENT,
  VISIBILITY_NOTIFY,
  NO_EXPOSE,
  SCROLL,
  WINDOW_STATE,
  SETTING
};

} // namespace Gdk


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gdk::EventType> : public Glib::Value_Enum<Gdk::EventType>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gdk
{

// Redefine DELETE macro (previously defined in winnt.h).
#if defined(GTKMM_WIN32) && defined(GDKMM_UNDEF_DELETE)
#  define DELETE (0x00010000L)
#  undef  GDKMM_UNDEF_DELETE
#endif
/**
 * @ingroup gdkmmEnums
 */
enum ExtensionMode
{
  EXTENSION_EVENTS_NONE,
  EXTENSION_EVENTS_ALL,
  EXTENSION_EVENTS_CURSOR
};

} // namespace Gdk


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gdk::ExtensionMode> : public Glib::Value_Enum<Gdk::ExtensionMode>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gdk
{

/**
 * @ingroup gdkmmEnums
 */
enum AxisUse
{
  AXIS_IGNORE,
  AXIS_X,
  AXIS_Y,
  AXIS_PRESSURE,
  AXIS_XTILT,
  AXIS_YTILT,
  AXIS_WHEEL,
  AXIS_LAST
};

} // namespace Gdk


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gdk::AxisUse> : public Glib::Value_Enum<Gdk::AxisUse>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gdk
{


class Event
{
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  typedef Event CppObjectType;
  typedef GdkEvent BaseObjectType;

  static GType get_type() G_GNUC_CONST;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

  Event();

  explicit Event(GdkEvent* castitem, bool make_a_copy = true);

  Event(const Event& src);
  Event& operator=(const Event& src);

  ~Event();

  GdkEvent*       gobj()       { return gobject_; }
  const GdkEvent* gobj() const { return gobject_; }

  // The caller is responsible for freeing it. Use when directly setting fields in structs.
  GdkEvent* gobj_copy() const;

protected:
  GdkEvent* gobject_;

private:

  
public:

  
  static Event get();
  
  static Event peek();
  
  static Event get_graphics_expose(const Glib::RefPtr<Window>& window);
  
  void put();

  
  static bool events_pending();

  
  /** Returns the time stamp from @a event, if there is one; otherwise
   * returns Gdk::CURRENT_TIME. If @a event is <tt>0</tt>, returns Gdk::CURRENT_TIME.
   * @return Time stamp field from @a event.
   */
  guint32 get_time() const;
  
  /** If the event contains a "state" field, puts that field in @a state. Otherwise
   * stores an empty state (0). Returns <tt>true</tt> if there was a state field
   * in the event. @a event may be <tt>0</tt>, in which case it's treated
   * as if the event had no state field.
   * @param state Return location for state.
   * @return <tt>true</tt> if there was a state field in the event.
   */
  bool get_state(ModifierType& state) const;
  
  /** Extract the event window relative x/y coordinates from an event.
   * @param x_win Location to put event window x coordinate.
   * @param y_win Location to put event window y coordinate.
   * @return <tt>true</tt> if the event delivered event window coordinates.
   */
  bool get_coords(double& x_win, double& y_win) const;
  
  /** Extract the root window relative x/y coordinates from an event.
   * @param x_root Location to put root window x coordinate.
   * @param y_root Location to put root window y coordinate.
   * @return <tt>true</tt> if the event delivered root window coordinates.
   */
  bool get_root_coords(double& x_root, double& y_root) const;
  
  /** Extract the axis value for a particular axis use from
   * an event structure.
   * @param axis_use The axis use to look for.
   * @param value Location to store the value found.
   * @return <tt>true</tt> if the specified axis was found, otherwise <tt>false</tt>.
   */
  bool get_axis(AxisUse axis_use, double& value) const;
  //_WRAP_METHOD(void	gdk_event_handler_set(GdkEventFunc func, gpointer data, GDestroyNotify  notify), gdk_event_handler_set)

  
  static void set_show_events(bool show_events);
  
  static bool get_show_events();


};

} // namespace Gdk


namespace Glib
{

/** @relates Gdk::Event */
Gdk::Event wrap(GdkEvent* object, bool take_copy = false);

#ifndef DOXYGEN_SHOULD_SKIP_THIS
template <>
class Value<Gdk::Event> : public Glib::Value_Boxed<Gdk::Event>
{};
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

} // namespace Glib

#endif /* _GDKMM_EVENT_H */

