// -*- c++ -*-
/* $Id: accelgroup.ccg,v 1.1 2003/01/21 13:38:41 murrayc Exp $ */

/* 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 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 <gtk/gtkaccelgroup.h>


namespace Gtk
{

bool AccelGroup::valid(guint keyval, Gdk::ModifierType modifiers) 
{
  return gtk_accelerator_valid(keyval, (GdkModifierType) modifiers);
}

void AccelGroup::parse(const Glib::ustring& accelerator,
                       guint&               accelerator_key,
                       Gdk::ModifierType&   accelerator_mods)
{
  GdkModifierType mods = GdkModifierType(0);
  gtk_accelerator_parse(accelerator.c_str(), &accelerator_key, &mods);

  accelerator_mods = (Gdk::ModifierType) mods;
}

Glib::ustring AccelGroup::name(guint accelerator_key, Gdk::ModifierType accelerator_mods) 
{
  return gtk_accelerator_name(accelerator_key, (GdkModifierType) accelerator_mods);
}

void AccelGroup::set_default_mod_mask(Gdk::ModifierType default_mod_mask) 
{
  gtk_accelerator_set_default_mod_mask((GdkModifierType) default_mod_mask);
}

Gdk::ModifierType AccelGroup::get_default_mod_mask() 
{
  return (Gdk::ModifierType) gtk_accelerator_get_default_mod_mask();
}

} // namespace Gtk

