grab stable branch
[synfig.git] / synfig-studio / tags / stable / src / gtkmm / keymapsettings.h
1 /* === S I N F G =========================================================== */
2 /*!     \file keymapsettings.h
3 **      \brief Defines the structures for managing key map settings
4 **
5 **      $Id: keymapsettings.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
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.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SINFG_KEYMAPSETTINGS_H
25 #define __SINFG_KEYMAPSETTINGS_H
26
27 /* === H E A D E R S ======================================================= */
28 #include <gtkmm/dialog.h>
29
30 #include <set>
31 #include <map>
32 #include <string>
33
34 #include <gtkmm/accelkey.h>
35
36 /* === M A C R O S ========================================================= */
37
38 /* === T Y P E D E F S ===================================================== */
39
40 /* === C L A S S E S & S T R U C T S ======================================= */
41
42 namespace studio {
43
44 //a dialog for viewing and setting options, though it can also be used just as is
45 class KeyMapSettings : public Gtk::Dialog
46 {
47         struct AcKeyInfo
48         {
49                 guint                           key;
50                 Gdk::ModifierType       mod;
51                 
52                 bool                            on;
53                 
54                 AcKeyInfo(guint k = 0, Gdk::ModifierType m = Gdk::ModifierType())
55                 :key(k),mod(m) {}
56         };
57         
58         //std::map<const char *,AcKeyInfo>      pathmap; //uses string info from paths set
59         //std::set<std::string>                         accelpaths;
60         
61         bool unsaved; //Assume as such...
62                 
63 public:
64
65         KeyMapSettings();
66         ~KeyMapSettings();
67
68         //void add_path(const char *path);
69         
70         bool set_key(const char *path, guint key, Gdk::ModifierType mod, bool replace = true);
71         bool get_key(const char *path, Gtk::AccelKey *key);
72
73         // These files must be sent a filename without extension (so the key map can be obtained)
74         bool load(const char *filename);
75         bool save(const char *filename);
76 };
77
78 }; // END of namespace studio
79
80 /* === E N D =============================================================== */
81
82 #endif