summaryrefslogtreecommitdiffstats
path: root/vcl/unx/generic/app
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/generic/app')
-rw-r--r--vcl/unx/generic/app/i18n_xkb.cxx34
-rw-r--r--vcl/unx/generic/app/keysymnames.cxx6
-rw-r--r--vcl/unx/generic/app/saldisp.cxx40
-rw-r--r--vcl/unx/generic/app/wmadaptor.cxx30
4 files changed, 28 insertions, 82 deletions
diff --git a/vcl/unx/generic/app/i18n_xkb.cxx b/vcl/unx/generic/app/i18n_xkb.cxx
index cb93f48b6bd7..c9e42dda6751 100644
--- a/vcl/unx/generic/app/i18n_xkb.cxx
+++ b/vcl/unx/generic/app/i18n_xkb.cxx
@@ -36,16 +36,10 @@
#include "unx/saldata.hxx"
#include "unx/i18n_xkb.hxx"
-SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display*
-#if __XKeyboardExtension__
-pDisplay
-#endif
-)
- : mbUseExtension( (sal_Bool)__XKeyboardExtension__ ),
+SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* pDisplay )
+ : mbUseExtension( sal_True ),
mnDefaultGroup( 0 )
{
- #if __XKeyboardExtension__
-
mpDisplay = pDisplay;
// allow user to set the default keyboard group idx or to disable the usage
@@ -94,19 +88,11 @@ pDisplay
XkbGetState( mpDisplay, XkbUseCoreKbd, &aStateRecord );
mnGroup = aStateRecord.group;
}
-
- #endif // __XKeyboardExtension__
}
void
-SalI18N_KeyboardExtension::Dispatch( XEvent*
-#if __XKeyboardExtension__
-pEvent
-#endif
-)
+SalI18N_KeyboardExtension::Dispatch( XEvent* pEvent )
{
- #if __XKeyboardExtension__
-
// must the event be handled?
if ( !mbUseExtension
|| (pEvent->type != mnEventBase) )
@@ -130,21 +116,13 @@ pEvent
#endif
break;
}
- #endif // __XKeyboardExtension__
}
-#if __XKeyboardExtension__
sal_uInt32
SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32 nKeyCode,
sal_uInt32 nShiftState,
sal_uInt32 nGroup ) const
-#else
-sal_uInt32
-SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32 ) const
-#endif
{
- #if __XKeyboardExtension__
-
if ( !mbUseExtension )
return NoSymbol;
@@ -153,12 +131,6 @@ SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32
KeySym nKeySymbol;
nKeySymbol = XkbKeycodeToKeysym( mpDisplay, nKeyCode, nGroup, nShiftState );
return nKeySymbol;
-
- #else
-
- return NoSymbol;
-
- #endif // __XKeyboardExtension__
}
diff --git a/vcl/unx/generic/app/keysymnames.cxx b/vcl/unx/generic/app/keysymnames.cxx
index e164d06d5d07..c2db38c2a13a 100644
--- a/vcl/unx/generic/app/keysymnames.cxx
+++ b/vcl/unx/generic/app/keysymnames.cxx
@@ -583,7 +583,7 @@ static const keyboard_layout type6_layout[] =
const char* SalDisplay::GetKeyboardName( bool bRefresh )
{
- if( bRefresh || ! m_aKeyboardName.Len() )
+ if (bRefresh || m_aKeyboardName.isEmpty())
{
#if defined(SOLARIS)
if( IsLocal() )
@@ -665,10 +665,10 @@ const char* SalDisplay::GetKeyboardName( bool bRefresh )
}
}
#endif
- if( ! m_aKeyboardName.Len() )
+ if (m_aKeyboardName.isEmpty())
m_aKeyboardName = "<unknown keyboard>";
}
- return m_aKeyboardName.GetBuffer();
+ 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 358bbc205004..8156b86cab08 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -885,10 +885,7 @@ void SalDisplay::Init()
sscanf( pProperties, "%li", &nProperties_ );
else
{
-#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD || \
- defined NETBSD || defined OPENBSD || defined DRAGONFLY
nProperties_ |= PROPERTY_FEATURE_Maximize;
-#endif
// Server Bugs & Properties
if( GetServerVendor() == vendor_excursion )
{
@@ -909,31 +906,6 @@ void SalDisplay::Init()
if( otherwm == eWindowManager_ ) eWindowManager_ = mwm;
}
else
- if( GetServerVendor() == vendor_xfree )
- {
- nProperties_ |= PROPERTY_BUG_XCopyArea_GXxor;
-#if defined LINUX || defined FREEBSD || defined NETBSD || defined OPENBSD || \
- defined DRAGONFLY
- // otherwm and olwm are a kind of default, which are not detected
- // carefully. if we are running linux (i.e. not netbsd) on an xfree
- // display, fvwm is most probable the wm to choose, confusing with mwm
- // doesn't harm. #57791# start maximized if possible
- if( (otherwm == eWindowManager_)
- || (olwm == eWindowManager_ ))
- {
- eWindowManager_ = fvwm; // ???
- nProperties_ |= PROPERTY_FEATURE_Maximize;
- }
-#else
- if( otherwm == eWindowManager_ ) eWindowManager_ = winmgr;
-#endif
-#if defined SOLARIS && defined SPARC
- nProperties_ |= PROPERTY_BUG_Bitmap_Bit_Order;
- // solaris xlib seems to have problems with putting images
- // in correct bit order to xfree 8 bit displays
-#endif
- }
- else
if( GetServerVendor() == vendor_sun )
{
// nicht alle! (bekannt: nur Sparc II CG3, CG6?)
@@ -2358,7 +2330,7 @@ void SalX11Display::Yield()
if( pXLib_->HasXErrorOccurred() )
{
XFlush( pDisp_ );
- PrintEvent( "SalDisplay::Yield (WasXError)", &aEvent );
+ DbgPrintDisplayEvent("SalDisplay::Yield (WasXError)", &aEvent);
}
#endif
pXLib_->ResetXErrorOccurred();
@@ -2475,14 +2447,13 @@ long SalX11Display::Dispatch( XEvent *pEvent )
return 0;
}
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void SalDisplay::PrintEvent( const ByteString &rComment,
- XEvent *pEvent ) const
+#ifdef DBG_UTIL
+void SalDisplay::DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const
{
if( pEvent->type <= MappingNotify )
{
fprintf( stderr, "[%s] %s s=%d w=%ld\n",
- rComment.GetBuffer(),
+ pComment,
EventNames[pEvent->type],
pEvent->xany.send_event,
pEvent->xany.window );
@@ -2609,11 +2580,12 @@ void SalDisplay::PrintEvent( const ByteString &rComment,
}
else
fprintf( stderr, "[%s] %d s=%d w=%ld\n",
- rComment.GetBuffer(),
+ pComment,
pEvent->type,
pEvent->xany.send_event,
pEvent->xany.window );
}
+#endif
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void SalDisplay::PrintInfo() const
diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx
index ad9b5ee22d6c..7ad584953069 100644
--- a/vcl/unx/generic/app/wmadaptor.cxx
+++ b/vcl/unx/generic/app/wmadaptor.cxx
@@ -228,8 +228,9 @@ WMAdaptor* WMAdaptor::createWMAdaptor( SalDisplay* pSalDisplay )
pAdaptor = new WMAdaptor( pSalDisplay );
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "Window Manager's name is \"%s\"\n",
- ByteString( pAdaptor->getWindowManagerName(), RTL_TEXTENCODING_ISO_8859_1 ).GetBuffer() );
+ fprintf(stderr, "Window Manager's name is \"%s\"\n",
+ rtl::OUStringToOString(pAdaptor->getWindowManagerName(),
+ RTL_TEXTENCODING_UTF8).getStr());
#endif
return pAdaptor;
}
@@ -1075,10 +1076,11 @@ void GnomeWMAdaptor::initAtoms()
void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
{
- ByteString aTitle( rWMName, osl_getThreadTextEncoding() );
+ rtl::OString aTitle(rtl::OUStringToOString(rWMName,
+ osl_getThreadTextEncoding()));
if( ! rWMName.Len() && m_aWMName.EqualsAscii( "Dtwm" ) )
- aTitle = " ";
+ aTitle = rtl::OString(' ');
::rtl::OString aWMLocale;
rtl_Locale* pLocale = NULL;
@@ -1140,7 +1142,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
}
#endif
- char* pT = const_cast<char*>(aTitle.GetBuffer());
+ char* pT = const_cast<char*>(aTitle.getStr());
XTextProperty aProp = { NULL, None, 0, 0 };
if( bTrustXmb )
{
@@ -1151,10 +1153,10 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
&aProp );
}
- unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.GetBuffer();
- Atom nType = aProp.nitems ? aProp.encoding : XA_STRING;
- int nFormat = aProp.nitems ? aProp.format : 8;
- int nBytes = aProp.nitems ? aProp.nitems : aTitle.Len();
+ unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.getStr();
+ Atom nType = aProp.nitems ? aProp.encoding : XA_STRING;
+ int nFormat = aProp.nitems ? aProp.format : 8;
+ int nBytes = aProp.nitems ? aProp.nitems : aTitle.getLength();
const SystemEnvData* pEnv = pFrame->GetSystemData();
XChangeProperty( m_pDisplay,
(XLIB_Window)pEnv->aShellWindow,
@@ -1195,7 +1197,7 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
{
WMAdaptor::setWMName( pFrame, rWMName );
- ByteString aTitle( rWMName, RTL_TEXTENCODING_UTF8 );
+ rtl::OString aTitle(rtl::OUStringToOString(rWMName, RTL_TEXTENCODING_UTF8));
const SystemEnvData* pEnv = pFrame->GetSystemData();
if( m_aWMAtoms[ NET_WM_NAME ] )
XChangeProperty( m_pDisplay,
@@ -1204,8 +1206,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
m_aWMAtoms[ UTF8_STRING ],
8,
PropModeReplace,
- (unsigned char*)aTitle.GetBuffer(),
- aTitle.Len()+1 );
+ (unsigned char*)aTitle.getStr(),
+ aTitle.getLength()+1 );
if( m_aWMAtoms[ NET_WM_ICON_NAME ] )
XChangeProperty( m_pDisplay,
(XLIB_Window)pEnv->aShellWindow,
@@ -1213,8 +1215,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
m_aWMAtoms[ UTF8_STRING ],
8,
PropModeReplace,
- (unsigned char*)aTitle.GetBuffer(),
- aTitle.Len()+1 );
+ (unsigned char*)aTitle.getStr(),
+ aTitle.getLength()+1 );
// The +1 copies the terminating null byte. Although
// the spec says, this should not be necessary
// at least the kwin implementation seems to depend