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

#include <graphene.h>

namespace
{
graphene_size_t* gdkmm_graphene_size_copy(const graphene_size_t* other)
{
  return graphene_size_init_from_size(graphene_size_alloc(), other);
}
} // anonymous namespace

namespace Gdk
{
namespace Graphene
{

Size::Size(float width, float height)
{
  gobject_ = graphene_size_init(graphene_size_alloc(), width, height);
}

Size::operator bool() const
{
  return gobj();
}

Size Size::scale(float factor) const
{
  Size result(0.0, 0.0);
  graphene_size_scale(gobj(), factor, result.gobj());
  return result;
}

Size Size::interpolate(const Size& b, double factor) const
{
  Size result(0.0, 0.0);
  graphene_size_interpolate(gobj(), b.gobj(), factor, result.gobj());
  return result;
}

} //namespace Graphene
} //namespace Gdk
