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

#include <gdkmm/device.h>
#include <gdkmm/devicetool.h>
#include <gdkmm/display.h>
#include <gdkmm/drop.h>
#include <gdkmm/seat.h>
#include <gdkmm/surface.h>

using Type = Gdk::Event::Type;

namespace Gdk
{

std::vector<double> Event::get_axes() const
{
  double* axes = nullptr;
  guint n_axes = 0;
  if (!gdk_event_get_axes(const_cast<GdkEvent*>(gobj()), &axes, &n_axes))
    return {};

  return std::vector<double>(axes, axes + n_axes);
}

std::vector<TimeCoord> Event::get_history() const
{
  guint n_coords = 0;
  GdkTimeCoord* coords = gdk_event_get_history(const_cast<GdkEvent*>(gobj()), &n_coords);
  return Glib::ArrayHandler<TimeCoord, TimeCoordTraits>::array_to_vector(
    coords, n_coords, Glib::OWNERSHIP_DEEP);
}

} // name space Gdk
