| 1 |
/* Copyright (C) 1998-2002 The gtkmm Development Team |
| 2 |
* |
| 3 |
* This library is free software; you can redistribute it and/or |
| 4 |
* modify it under the terms of the GNU Lesser General Public |
| 5 |
* License as published by the Free Software Foundation; either |
| 6 |
* version 2.1 of the License, or (at your option) any later version. |
| 7 |
* |
| 8 |
* This library is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
* Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public |
| 14 |
* License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include <gtk/gtk.h> |
| 18 |
|
| 19 |
|
| 20 |
namespace Gtk |
| 21 |
{ |
| 22 |
|
| 23 |
bool AccelGroup::valid(guint keyval, Gdk::ModifierType modifiers) |
| 24 |
{ |
| 25 |
return gtk_accelerator_valid(keyval, (GdkModifierType) modifiers); |
| 26 |
} |
| 27 |
|
| 28 |
void AccelGroup::parse(const Glib::ustring& accelerator, |
| 29 |
guint& accelerator_key, |
| 30 |
Gdk::ModifierType& accelerator_mods) |
| 31 |
{ |
| 32 |
auto mods = GdkModifierType(0); |
| 33 |
gtk_accelerator_parse(accelerator.c_str(), &accelerator_key, &mods); |
| 34 |
|
| 35 |
accelerator_mods = (Gdk::ModifierType) mods; |
| 36 |
} |
| 37 |
|
| 38 |
Glib::ustring AccelGroup::name(guint accelerator_key, Gdk::ModifierType accelerator_mods) |
| 39 |
{ |
| 40 |
return gtk_accelerator_name(accelerator_key, (GdkModifierType) accelerator_mods); |
| 41 |
} |
| 42 |
|
| 43 |
void AccelGroup::set_default_mod_mask(Gdk::ModifierType default_mod_mask) |
| 44 |
{ |
| 45 |
gtk_accelerator_set_default_mod_mask((GdkModifierType) default_mod_mask); |
| 46 |
} |
| 47 |
|
| 48 |
Gdk::ModifierType AccelGroup::get_default_mod_mask() |
| 49 |
{ |
| 50 |
return (Gdk::ModifierType) gtk_accelerator_get_default_mod_mask(); |
| 51 |
} |
| 52 |
|
| 53 |
} // namespace Gtk |