/* Copyright 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gdkmm/device.h>
#include <gdkmm/seat.h>

namespace Gdk
{
bool Event::is_send_event() const
{
  return gobj()->any.send_event;
}

int EventKey::get_scancode() const
{
  return gdk_event_get_scancode(const_cast<GdkEvent*>(Event::gobj()));
}

guint EventButton::get_click_count() const
{
  guint click_count = 0;
  gdk_event_get_click_count(Event::gobj(), &click_count);
  return click_count;
}

bool EventButton::shall_trigger_context_menu() const
{
  return gdk_event_triggers_context_menu(Event::gobj());
}

bool EventButton::get_axis(Gdk::AxisUse axis_use, double& value) const
{
  return gdk_event_get_axis(Event::gobj(), static_cast<GdkAxisUse>(axis_use), &value);
}

bool EventMotion::get_axis(Gdk::AxisUse axis_use, double& value) const
{
  return gdk_event_get_axis(Event::gobj(), static_cast<GdkAxisUse>(axis_use), &value);
}

bool EventTouch::get_axis(Gdk::AxisUse axis_use, double& value) const
{
  return gdk_event_get_axis(Event::gobj(), static_cast<GdkAxisUse>(axis_use), &value);
}

bool EventScroll::is_scroll_stop_event() const
{
  return gobj()->is_stop;
}

bool EventSelection::has_requestor() const
{
  return gobj()->requestor != nullptr;
}

bool EventOwnerChange::has_owner() const
{
  return gobj()->owner != nullptr;
}

bool EventGrabBroken::is_keyboard() const
{
  return gobj()->keyboard;
}

bool EventGrabBroken::is_implicit() const
{
  return gobj()->implicit;
}

bool EventGrabBroken::has_grab_window() const
{
  return gobj()->grab_window != nullptr;
}

} //namespace Gdk
