source: synfigstudio/trunk/fuentes/src/gui/keymapsettings.h @ 481

Last change on this file since 481 was 481, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 2.4 KB
Line 
1/* === S Y N F I G ========================================================= */
2/*!     \file keymapsettings.h
3**      \brief Defines the structures for managing key map settings
4**
5**      $Id$
6**
7**      \legal
8**      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9**
10**      This package is free software; you can redistribute it and/or
11**      modify it under the terms of the GNU General Public License as
12**      published by the Free Software Foundation; either version 2 of
13**      the License, or (at your option) any later version.
14**
15**      This package is distributed in the hope that it will be useful,
16**      but WITHOUT ANY WARRANTY; without even the implied warranty of
17**      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18**      General Public License for more details.
19**      \endlegal
20*/
21/* ========================================================================= */
22
23/* === S T A R T =========================================================== */
24
25#ifndef __SYNFIG_KEYMAPSETTINGS_H
26#define __SYNFIG_KEYMAPSETTINGS_H
27
28/* === H E A D E R S ======================================================= */
29#include <gtkmm/dialog.h>
30
31#include <set>
32#include <map>
33#include <string>
34
35#include <gtkmm/accelkey.h>
36
37/* === M A C R O S ========================================================= */
38
39/* === T Y P E D E F S ===================================================== */
40
41/* === C L A S S E S & S T R U C T S ======================================= */
42
43namespace studio {
44
45//a dialog for viewing and setting options, though it can also be used just as is
46class KeyMapSettings : public Gtk::Dialog
47{
48        struct AcKeyInfo
49        {
50                guint                           key;
51                Gdk::ModifierType       mod;
52
53                bool                            on;
54
55                AcKeyInfo(guint k = 0, Gdk::ModifierType m = Gdk::ModifierType()):
56                        key(k), mod(m), on() { }
57        };
58
59        //std::map<const char *,AcKeyInfo>      pathmap; //uses string info from paths set
60        //std::set<std::string>                         accelpaths;
61
62        bool unsaved; //Assume as such...
63
64public:
65
66        KeyMapSettings();
67        ~KeyMapSettings();
68
69        //void add_path(const char *path);
70
71        bool set_key(const char *path, guint key, Gdk::ModifierType mod, bool replace = true);
72        bool get_key(const char *path, Gtk::AccelKey *key);
73
74        // These files must be sent a filename without extension (so the key map can be obtained)
75        bool load(const char *filename);
76        bool save(const char *filename);
77};
78
79}; // END of namespace studio
80
81/* === E N D =============================================================== */
82
83#endif
Note: See TracBrowser for help on using the repository browser.