6 * Copyright 1998-2002 The gtkmm Development Team
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <gtkmm/accelkey.h>
24 #include <gtkmm/accelgroup.h>
30 : key_(GDK_VoidSymbol),
31 mod_((Gdk::ModifierType)0)
35 AccelKey::AccelKey(guint accel_key, Gdk::ModifierType accel_mods,
36 const Glib::ustring& accel_path)
43 AccelKey::AccelKey(const Glib::ustring& accelerator, const Glib::ustring& accel_path)
46 //Get the key and mod by parsing the accelerator string:
47 AccelGroup::parse (accelerator, key_, mod_);
50 AccelKey::AccelKey(const AccelKey& src)
57 AccelKey& AccelKey::operator=(const AccelKey& src)
66 guint AccelKey::get_key() const
71 Gdk::ModifierType AccelKey::get_mod() const
76 Glib::ustring AccelKey::get_path() const
81 bool AccelKey::is_null() const
83 return ( (key_ == GDK_VoidSymbol) || !(get_key() > 0) ); //both seem to be invalid.
86 Glib::ustring AccelKey::get_abbrev() const
88 return AccelGroup::name (key_, mod_);