cosmetic, closes #1467926
This commit is contained in:
parent
a6551852bb
commit
be03b0a3dc
3 changed files with 28 additions and 23 deletions
|
@ -3,6 +3,8 @@ Changes for 0.9.16:
|
|||
*06/04/11:
|
||||
* Fix calculation of prevWorkspace (Mathias)
|
||||
Screen.cc
|
||||
* Cosmetic, close #1467926 (thanx Jonas Koelker)
|
||||
Keys.hh/cc
|
||||
*06/04/09:
|
||||
* Fix label background update with external tabs (Simon)
|
||||
FbWinFrame.cc
|
||||
|
|
10
src/Keys.cc
10
src/Keys.cc
|
@ -111,11 +111,11 @@ Keys::~Keys() {
|
|||
|
||||
/// Destroys the keytree
|
||||
void Keys::deleteTree() {
|
||||
while (!m_keylist.empty()) {
|
||||
if (m_keylist.back())
|
||||
delete m_keylist.back();
|
||||
m_keylist.pop_back();
|
||||
}
|
||||
keylist_t::iterator it = m_keylist.begin();
|
||||
const keylist_t::iterator end = m_keylist.end();
|
||||
for ( ; it != end; it++)
|
||||
delete *it;
|
||||
m_keylist.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
39
src/Keys.hh
39
src/Keys.hh
|
@ -75,40 +75,43 @@ private:
|
|||
void deleteTree();
|
||||
|
||||
void bindKey(unsigned int key, unsigned int mod);
|
||||
|
||||
std::string m_filename;
|
||||
|
||||
class t_key {
|
||||
|
||||
std::string m_filename;
|
||||
|
||||
class t_key;
|
||||
typedef std::vector<t_key*> keylist_t;
|
||||
|
||||
class t_key {
|
||||
public:
|
||||
t_key(unsigned int key, unsigned int mod,
|
||||
t_key(unsigned int key, unsigned int mod,
|
||||
FbTk::RefCount<FbTk::Command> command = FbTk::RefCount<FbTk::Command>(0));
|
||||
t_key(t_key *k);
|
||||
~t_key();
|
||||
|
||||
inline t_key *find(unsigned int key_, unsigned int mod_) {
|
||||
|
||||
t_key *find(unsigned int key_, unsigned int mod_) {
|
||||
for (size_t i = 0; i < keylist.size(); i++) {
|
||||
if (keylist[i]->key == key_ && keylist[i]->mod == FbTk::KeyUtil::instance().isolateModifierMask(mod_))
|
||||
return keylist[i];
|
||||
}
|
||||
return keylist[i];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
inline t_key *find(XKeyEvent &ke) {
|
||||
t_key *find(XKeyEvent &ke) {
|
||||
for (size_t i = 0; i < keylist.size(); i++) {
|
||||
if (keylist[i]->key == ke.keycode &&
|
||||
if (keylist[i]->key == ke.keycode &&
|
||||
keylist[i]->mod == FbTk::KeyUtil::instance().isolateModifierMask(ke.state))
|
||||
return keylist[i];
|
||||
}
|
||||
return keylist[i];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline bool operator == (XKeyEvent &ke) const {
|
||||
|
||||
bool operator == (XKeyEvent &ke) const {
|
||||
return (mod == FbTk::KeyUtil::instance().isolateModifierMask(ke.state) && key == ke.keycode);
|
||||
}
|
||||
|
||||
|
||||
FbTk::RefCount<FbTk::Command> m_command;
|
||||
unsigned int key;
|
||||
unsigned int mod;
|
||||
std::vector<t_key *> keylist;
|
||||
keylist_t keylist;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -117,7 +120,7 @@ private:
|
|||
*/
|
||||
bool mergeTree(t_key *newtree, t_key *basetree=0);
|
||||
|
||||
std::vector<t_key *> m_keylist;
|
||||
keylist_t m_keylist;
|
||||
|
||||
Display *m_display; ///< display connection
|
||||
unsigned int m_current_line;
|
||||
|
|
Loading…
Reference in a new issue