summaryrefslogtreecommitdiff
authorThomas Arnhold <thomas@arnhold.org>2012-01-27 15:51:04 (GMT)
committer Thomas Arnhold <thomas@arnhold.org>2012-01-28 10:05:47 (GMT)
commit04b9c2f633f0be1b676933943bdd0b1dc58b5471 (patch) (side-by-side diff)
tree4084dcd0575cab68bf41b6a87f1d3aeb35c75468
parent2b507836fc88f294ef55652174b66dc706125599 (diff)
downloadcore-04b9c2f633f0be1b676933943bdd0b1dc58b5471.zip
core-04b9c2f633f0be1b676933943bdd0b1dc58b5471.tar.gz
Remove SalDisplay::GetKeyboardName
This method seems to be useless. The return value (keyboard name) isn't used at any point. And I don't see any point in this method where some implicit call is done to refresh mappings...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--vcl/inc/unx/saldisp.hxx2
-rw-r--r--vcl/unx/generic/app/keysymnames.cxx90
-rw-r--r--vcl/unx/generic/app/saldisp.cxx8
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx7
4 files changed, 3 insertions, 104 deletions
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 3e4eb4e..8c44784 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -323,7 +323,6 @@ protected:
KeySym nShiftKeySym_; // first shift modifier
KeySym nCtrlKeySym_; // first control modifier
KeySym nMod1KeySym_; // first mod1 modifier
- rtl::OString m_aKeyboardName;
vcl_sal::WMAdaptor* m_pWMAdaptor;
@@ -427,7 +426,6 @@ public:
{ mpInputMethod = pInputMethod; }
void SetKbdExtension(SalI18N_KeyboardExtension *pKbdExtension)
{ mpKbdExtension = pKbdExtension; }
- const char* GetKeyboardName( bool bRefresh = false );
::vcl_sal::WMAdaptor* getWMAdaptor() const { return m_pWMAdaptor; }
bool IsXinerama() const { return m_bXinerama; }
const std::vector< Rectangle >& GetXineramaScreens() const { return m_aXineramaScreens; }
diff --git a/vcl/unx/generic/app/keysymnames.cxx b/vcl/unx/generic/app/keysymnames.cxx
index ce6a7e7..f4955a5 100644
--- a/vcl/unx/generic/app/keysymnames.cxx
+++ b/vcl/unx/generic/app/keysymnames.cxx
@@ -215,94 +215,4 @@ static const keyboard_layout type6_layout[] =
#include <stdio.h>
#endif
-const char* SalDisplay::GetKeyboardName( bool bRefresh )
-{
- if (bRefresh || m_aKeyboardName.isEmpty())
- {
-#if defined(SOLARIS)
- if( IsLocal() )
- {
- int kbd = open( "/dev/kbd", O_RDONLY );
- if( kbd >= 0 )
- {
- int kbd_type = 0;
- if( ! ioctl( kbd, KIOCTYPE, &kbd_type ) )
- {
- int kbd_layout = 0;
- if( ! ioctl( kbd, KIOCLAYOUT, &kbd_layout ) )
- {
- const keyboard_layout *p_layout = NULL;
- switch( kbd_type )
- {
- case KB_KLUNK: p_layout = type0_layout; break;
- case KB_SUN3: p_layout = type3_layout; break;
- case KB_SUN4: p_layout = type4_layout; break;
- case KB_USB: p_layout = type6_layout; break;
- case KB_PC: p_layout = type101_layout; break;
- }
-
- if( p_layout )
- {
- while( p_layout->n_layout != -1 )
- {
- if ( p_layout->n_layout == kbd_layout )
- {
- m_aKeyboardName = p_layout->p_description;
- break;
- }
- p_layout++;
- }
- }
- }
- }
- close(kbd);
- }
- }
-#elif !defined(AIX)
- int opcode, event, error;
- int major = XkbMajorVersion, minor = XkbMinorVersion;
- if( XkbQueryExtension( GetDisplay(), &opcode, &event,&error, &major, &minor ) )
- {
- XkbDescPtr pXkbDesc = NULL;
- // try X keyboard extension
- if( (pXkbDesc = XkbGetKeyboard( GetDisplay(), XkbAllComponentsMask, XkbUseCoreKbd )) )
- {
- const char* pAtom = NULL;
- if( pXkbDesc->names->groups[0] )
- {
- pAtom = XGetAtomName( GetDisplay(), pXkbDesc->names->groups[0] );
- m_aKeyboardName = pAtom;
- XFree( (void*)pAtom );
- }
- else
- m_aKeyboardName = "<unknown keyboard>";
-#if OSL_DEBUG_LEVEL > 1
-#define PRINT_ATOM( x ) { if( pXkbDesc->names->x ) { pAtom = XGetAtomName( GetDisplay(), pXkbDesc->names->x ); fprintf( stderr, "%s: %s\n", #x, pAtom ); XFree( (void*)pAtom ); } else fprintf( stderr, "%s: <nil>\n", #x ); }
-
- PRINT_ATOM( keycodes );
- PRINT_ATOM( geometry );
- PRINT_ATOM( symbols );
- PRINT_ATOM( types );
- PRINT_ATOM( compat );
- PRINT_ATOM( phys_symbols );
-
-#define PRINT_ATOM_2( x ) { if( pXkbDesc->names->x[i] ) { pAtom = XGetAtomName( GetDisplay(), pXkbDesc->names->x[i] ); fprintf( stderr, "%s[%d]: %s\n", #x, i, pAtom ); XFree( (void*)pAtom ); } else fprintf( stderr, "%s[%d]: <nil>\n", #x, i ); }
- int i;
- for( i = 0; i < XkbNumVirtualMods; i++ )
- PRINT_ATOM_2( vmods );
- for( i = 0; i < XkbNumIndicators; i++ )
- PRINT_ATOM_2( indicators );
- for( i = 0; i < XkbNumKbdGroups; i++ )
- PRINT_ATOM_2( groups );
-#endif
- XkbFreeKeyboard( pXkbDesc, XkbAllComponentsMask, True );
- }
- }
-#endif
- if (m_aKeyboardName.isEmpty())
- m_aKeyboardName = "<unknown keyboard>";
- }
- return m_aKeyboardName.getStr();
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 41b509b..cae3fafa 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -2170,14 +2170,10 @@ long SalX11Display::Dispatch( XEvent *pEvent )
}
break;
case MappingNotify:
- if( MappingKeyboard == pEvent->xmapping.request ||
- MappingModifier == pEvent->xmapping.request )
+ if( MappingModifier == pEvent->xmapping.request )
{
XRefreshKeyboardMapping( &pEvent->xmapping );
- if( MappingModifier == pEvent->xmapping.request )
- ModifierMapping();
- if( MappingKeyboard == pEvent->xmapping.request ) // refresh mapping
- GetKeyboardName( true );
+ ModifierMapping();
}
break;
case ButtonPress:
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 3685d11..b1bcf8e 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -129,12 +129,7 @@ extern "C" {
void signalKeysChanged( GdkKeymap*, gpointer data )
{
GtkSalDisplay* pDisp = (GtkSalDisplay*)data;
-#if !GTK_CHECK_VERSION(3,0,0)
- pDisp->GetKeyboardName(true);
-#else
- (void)pDisp;
-#warning FIXME: impl. / check signalKeysChanged ...
-#endif
+#warning signalKeysChanged called
}
void signalScreenSizeChanged( GdkScreen* pScreen, gpointer data )