+2004-03-26 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * kbsequence.C (print): adjust
+
+ * kbmap.C (printKeySym): rename and change signature
+ (printKey): use LyXKeySym::print()
+
2004-03-26 Martin Vermeer <martin.vermeer@hut.fi>
* undo.C: add using std::advance to compile for stlport
#include <string>
+#include "key_state.h"
+
/**
* This is a base class for representing a keypress.
* Each frontend has to implement this to provide
* This relies on user to use the right encoding.
*/
virtual char getISOEncoded(std::string const & encoding) const = 0;
+
+ /**
+ * Return a string describing the KeySym with modifier mod.
+ * This should use the native UI format when applicable
+ */
+ virtual std::string const print(key_modifier::state mod) const = 0;
};
+2004-03-26 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * GLyXKeySym.C (print): new method; print a keysym using
+ kb_keymap::printKeySym (should use some native gtk method instead)
+
2004-03-24 Angus Leeming <leeming@lyx.org>
* GMenubar.C (submenuDisabled, onSubMenuActivate): compile fixes
#include <gdk/gdkkeysyms.h>
#include "GLyXKeySym.h"
+#include "kbmap.h"
+
using std::string;
}
+string const GLyXKeySym::print(key_modifier::state mod) const
+{
+ return kb_keymap::printKeySym(*this, mod);
+}
+
+
bool operator==(LyXKeySym const & k1, LyXKeySym const & k2)
{
return static_cast<GLyXKeySym const &>(k1).getKeyval()
virtual bool isModifier() const;
virtual std::string getSymbolName() const;
virtual char getISOEncoded(std::string const & encoding) const;
+ virtual std::string const print(key_modifier::state mod) const;
private:
unsigned int keyval_;
};
+2004-03-25 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * QLyXKeySym.C (print): new method; print a KeySym using Qt syntax
+
2004-03-17 Angus Leeming <leeming@lyx.org>
* Dialogs2.C, lyx_gui.C: remove mention of the forks dialog.
#include "qlkey.h"
#include "qt_helpers.h"
+#include <qaccel.h>
#include <qevent.h>
#include <qtextcodec.h>
}
+string const QLyXKeySym::print(key_modifier::state mod) const
+{
+ int tmpkey = key_;
+
+
+ if (mod & key_modifier::shift)
+ tmpkey += Qt::SHIFT;
+ if (mod & key_modifier::ctrl)
+ tmpkey += Qt::CTRL;
+ if (mod & key_modifier::alt)
+ tmpkey += Qt::ALT;
+
+ return fromqstr(QAccel::keyToString(tmpkey));
+}
+
+
bool QLyXKeySym::isText() const
{
if (text_.isEmpty()) {
* This relies on user to use the right encoding.
*/
virtual char getISOEncoded(std::string const & encoding) const;
+
+ ///
+ virtual std::string const print(key_modifier::state mod) const;
+
///
int key() const {
return key_;
+2004-03-26 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * XLyXKeySym.C (print): new method; print a keysym using
+ kb_keymap::printKeySym.
+
2004-03-17 Angus Leeming <leeming@lyx.org>
* Dialogs2.C, FormForks.[Ch], Makefile.am:
#include "XLyXKeySym.h"
#include "debug.h"
+#include "kbmap.h"
#include <X11/keysym.h>
}
+string const XLyXKeySym::print(key_modifier::state mod) const
+{
+ return kb_keymap::printKeySym(*this, mod);
+}
+
+
bool operator==(LyXKeySym const & k1, LyXKeySym const & k2)
{
return static_cast<XLyXKeySym const &>(k1).keysym()
*/
virtual char getISOEncoded(std::string const & encoding) const;
+ ///
+ virtual std::string const print(key_modifier::state mod) const;
+
///
unsigned int keysym() const {
return keysym_;
using std::string;
-string const kb_keymap::printKeysym(LyXKeySymPtr key,
+string const kb_keymap::printKeySym(LyXKeySym const & key,
key_modifier::state mod)
{
string buf;
- string const s = key->getSymbolName();
+ string const s = key.getSymbolName();
if (mod & key_modifier::shift)
buf += "S-";
string const kb_keymap::printKey(kb_key const & key) const
{
- return printKeysym(key.code, key.mod.first);
+ return key.code->print(key.mod.first);
}
* @param key the key as a keysym
* @param mod the modifiers
*/
- static std::string const printKeysym(LyXKeySymPtr key,
- key_modifier::state mod);
+ static std::string const printKeySym(LyXKeySym const & key,
+ key_modifier::state mod);
typedef std::pair<key_modifier::state, key_modifier::state> modifier_pair;
KeySequence::size_type i, length = sequence.size();
for (i = 0; i < length; ++i) {
- buf += kb_keymap::printKeysym(sequence[i], modifiers[i].first);
+ buf += kb_keymap::printKeySym(*sequence[i], modifiers[i].first);
// append a blank
if (i + 1 < length) {