1 /* === S Y N F I G ========================================================= */
2 /*! \file keymapsettings.cpp
3 ** \brief Contains Info for Key Map settings
5 ** $Id: keymapsettings.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include "keymapsettings.h"
33 #include <gtkmm/accelkey.h>
34 #include <gtkmm/accelmap.h>
35 #include <gtk/gtkaccelmap.h>
39 /* === U S I N G =========================================================== */
42 //using namespace etl;
43 //using namespace synfig;
44 using namespace studio;
47 //using namespace Gtk::Menu_Helpers;
49 /* === M A C R O S ========================================================= */
51 /* === G L O B A L S ======================================================= */
53 /* === P R O C E D U R E S ================================================= */
55 /* === M E T H O D S ======================================================= */
57 /* === E N T R Y P O I N T ================================================= */
59 // KeyMapSettings Definitions
60 KeyMapSettings::KeyMapSettings()
64 KeyMapSettings::~KeyMapSettings()
68 bool KeyMapSettings::set_key(const char *path, guint key, Gdk::ModifierType mod, bool replace)
70 if(gtk_accel_map_lookup_entry(path,NULL))
72 return AccelMap::change_entry(path,key,mod,replace);
75 AccelMap::add_entry(path,key,mod);
80 bool KeyMapSettings::get_key(const char *path, AccelKey *key)
83 if(gtk_accel_map_lookup_entry(path,&ac))
85 *key = AccelKey(ac.accel_key,(Gdk::ModifierType)ac.accel_mods,string(path));
92 bool KeyMapSettings::load(const char *filename)
97 AccelMap::load(filename);
102 bool KeyMapSettings::save(const char *filename)
107 AccelMap::save(filename);