• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

  • kdecore
kkeyserver_x11.h
1 /*
2  Copyright (C) 2001 Ellis Whitehead <ellis@kde.org>
3 
4  Win32 port:
5  Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef _KKEYSERVER_X11_H
24 #define _KKEYSERVER_X11_H
25 
26 #include "kshortcut.h"
27 #include "kkeynative.h"
28 
34 namespace KKeyServer
35 {
40  enum ExtraModFlag { MODE_SWITCH = 0x2000 };
41 
47  struct KDECORE_EXPORT Sym
48  {
49  public:
51  uint m_sym;
52 
54  Sym()
55  { m_sym = 0; }
60  Sym( uint sym )
61  { m_sym = sym; }
67  Sym( const TQString& s )
68  { init( s ); }
69 
76  bool initQt( int keyQt );
77 
84  bool init( const TQString &s );
85 
90  int qt() const;
91 
95  TQString toStringInternal() const;
96 
101  TQString toString() const;
102 
110  uint getModsRequired() const;
111 
115  uint getSymVariation() const;
116 
120  operator uint() const { return m_sym; }
121 
125  Sym& operator =( uint sym ) { m_sym = sym; return *this; }
126 
127  private:
128  TQString toString( bool bUserSpace ) const;
129 
130  static void capitalizeKeyname( TQString& );
131  };
132 
137  struct KDECORE_EXPORT Key
138  {
140  enum { CODE_FOR_QT = 256 };
141 
143  uint m_code;
144 
146  uint m_mod;
147 
149  uint m_sym;
150 
159  bool init( const KKey& key, bool bQt );
160 
168  bool isNative() const { return m_code != CODE_FOR_QT; }
169 
174  uint code() const { return m_code; }
175 
180  uint mod() const { return m_mod; }
181 
186  uint sym() const { return m_sym; }
187 
192  int keyCodeQt() const { return (int) m_sym; }
193 
198  void setKeycodeQt( int keyQt )
199  { m_code = CODE_FOR_QT; m_sym = keyQt; }
200 
205  Key& operator =( const KKeyNative& key );
206 
218  int compare( const Key& key ) const;
219 
224  bool operator ==( const Key& b ) const
225  { return compare( b ) == 0; }
226 
231  bool operator <( const Key& b ) const
232  { return compare( b ) < 0; }
233 
238  KKey key() const;
239  };
240 
244  struct KDECORE_EXPORT Variations
245  {
246  enum { MAX_VARIATIONS = 4 };
247 
248  Key m_rgkey[MAX_VARIATIONS];
249  uint m_nVariations;
250 
251  Variations() { m_nVariations = 0; }
252 
253  void init( const KKey&, bool bQt );
254 
255  uint count() const { return m_nVariations; }
256  const Key& key( uint i ) const { return m_rgkey[i]; }
257  };
258 
260  KDECORE_EXPORT bool initializeMods();
261 
267  KDECORE_EXPORT uint modX( KKey::ModFlag modFlag );
268 
275  KDECORE_EXPORT bool keyboardHasWinKey();
276 
282  KDECORE_EXPORT uint modXShift();
283 
289  KDECORE_EXPORT uint modXLock();
290 
296  KDECORE_EXPORT uint modXCtrl();
297 
303  KDECORE_EXPORT uint modXAlt();
304 
310  KDECORE_EXPORT uint modXNumLock();
311 
318  KDECORE_EXPORT uint modXWin();
319 
325  KDECORE_EXPORT uint modXScrollLock();
326 
333  KDECORE_EXPORT uint modXModeSwitch();
334 
346  KDECORE_EXPORT uint accelModMaskX();
347 
357  KDECORE_EXPORT bool keyQtToSym( int keyQt, uint& sym );
358 
367  KDECORE_EXPORT bool keyQtToMod( int keyQt, uint& mod );
368 
377  KDECORE_EXPORT bool symToKeyQt( uint sym, int& keyQt );
378 
389  KDECORE_EXPORT bool modToModQt( uint mod, int& modQt );
390 
400  KDECORE_EXPORT bool modToModX( uint mod, uint& modX );
401 
411  //wrapped for win32
412  KDECORE_EXPORT bool modXToModQt( uint modX, int& modQt );
413 
417  KDECORE_EXPORT int qtButtonStateToMod( TQ_ButtonState s );
418 
428  KDECORE_EXPORT bool modXToMod( uint modX, uint& mod );
429 
441  KDECORE_EXPORT bool codeXToSym( uchar codeX, uint modX, uint& symX );
442 
446  KDECORE_EXPORT TQString modToStringInternal( uint mod );
447 
454  KDECORE_EXPORT TQString modToStringUser( uint mod );
455 
462  KDECORE_EXPORT uint stringUserToMod( const TQString& mod );
463 
468  KDECORE_EXPORT bool stringToSymMod( const TQString&, uint& sym, uint& mod );
469 
474  KDECORE_EXPORT void keyQtToKeyX( uint keyCombQt, unsigned char *pKeyCodeX, uint *pKeySymX, uint *pKeyModX );
475 }
476 
477 #endif // !_KKEYSERVER_X11_H

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |