diff options
Diffstat (limited to 'vcl/unx/source/window/salframe.cxx')
-rw-r--r-- | vcl/unx/source/window/salframe.cxx | 284 |
1 files changed, 202 insertions, 82 deletions
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index ef813e4fc8d6..dd4ea89c35f5 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -211,7 +211,7 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry ) +void X11SalFrame::Init( sal_uLong nSalFrameStyle, int nScreen, SystemParentData* pParentData, bool bUseGeometry ) { if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() ) nScreen = GetDisplay()->GetDefaultScreenNumber(); @@ -484,8 +484,8 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa } nShowState_ = SHOWSTATE_UNKNOWN; - bViewable_ = TRUE; - bMapped_ = FALSE; + bViewable_ = sal_True; + bMapped_ = sal_False; nVisibility_ = VisibilityFullyObscured; mhWindow = XCreateWindow( GetXDisplay(), aFrameParent, @@ -647,7 +647,7 @@ void X11SalFrame::Init( ULONG nSalFrameStyle, int nScreen, SystemParentData* pPa } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentData* pSystemParent ) +X11SalFrame::X11SalFrame( SalFrame *pParent, sal_uLong nSalFrameStyle, SystemParentData* pSystemParent ) { X11SalData* pSalData = GetX11SalData(); @@ -687,16 +687,16 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentD nHeight_ = 0; nStyle_ = 0; mnExtStyle = 0; - bAlwaysOnTop_ = FALSE; + bAlwaysOnTop_ = sal_False; - // set bViewable_ to TRUE: hack GetClientSize to report something + // set bViewable_ to sal_True: hack GetClientSize to report something // different to 0/0 before first map - bViewable_ = TRUE; - bMapped_ = FALSE; - bDefaultPosition_ = TRUE; + bViewable_ = sal_True; + bMapped_ = sal_False; + bDefaultPosition_ = sal_True; nVisibility_ = VisibilityFullyObscured; m_nWorkArea = 0; - mbInShow = FALSE; + mbInShow = sal_False; m_bXEmbed = false; nScreenSaversTimeout_ = 0; @@ -791,10 +791,10 @@ X11SalFrame::~X11SalFrame() XSelectInput( GetXDisplay(), GetShellWindow(), 0 ); XSelectInput( GetXDisplay(), GetWindow(), 0 ); - ShowFullScreen( FALSE, 0 ); + ShowFullScreen( sal_False, 0 ); if( bMapped_ ) - Show( FALSE ); + Show( sal_False ); if( mpInputContext ) { @@ -951,14 +951,14 @@ void X11SalFrame::updateGraphics( bool bClear ) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Enable( BOOL /*bEnable*/ ) +void X11SalFrame::Enable( sal_Bool /*bEnable*/ ) { // NYI: enable/disable frame } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::SetIcon( USHORT nIcon ) +void X11SalFrame::SetIcon( sal_uInt16 nIcon ) { if ( ! IsChildWindow() ) { @@ -1060,7 +1060,7 @@ void X11SalFrame::SetIcon( USHORT nIcon ) } pHints = &Hints; - BOOL bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen, + sal_Bool bOk = SelectAppIconPixmap( GetDisplay(), m_nScreen, nIcon, iconSize, pHints->icon_pixmap, pHints->icon_mask ); if ( !bOk ) @@ -1133,7 +1133,7 @@ void X11SalFrame::SetMinClientSize( long nWidth, long nHeight ) // Show + Pos (x,y,z) + Size (width,height) // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) +void X11SalFrame::Show( sal_Bool bVisible, sal_Bool bNoActivate ) { if( ( bVisible && bMapped_ ) || ( !bVisible && !bMapped_ ) ) @@ -1151,7 +1151,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) setXEmbedInfo(); if( bVisible ) { - mbInShow = TRUE; + mbInShow = sal_True; if( ! (nStyle_ & SAL_FRAME_STYLE_INTRO) ) { // hide all INTRO frames @@ -1163,12 +1163,12 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) if( pFrame->nStyle_ & SAL_FRAME_STYLE_INTRO ) { if( pFrame->bMapped_ ) - const_cast<X11SalFrame*>(pFrame)->Show( FALSE ); + const_cast<X11SalFrame*>(pFrame)->Show( sal_False ); } } } - // update NET_WM_STATE which may have been deleted due to earlier Show(FALSE) + // update NET_WM_STATE which may have been deleted due to earlier Show(sal_False) if( nShowState_ == SHOWSTATE_HIDDEN ) GetDisplay()->getWMAdaptor()->frameIsMapping( this ); @@ -1177,7 +1177,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) * with the basic dialogue editor, * which shows a frame and instantly hides it again. After that the * editor window is shown and the WM takes this as an opportunity - * to show our hidden transient frame also. So Show( FALSE ) must + * to show our hidden transient frame also. So Show( sal_False ) must * withdraw the frame AND delete the WM_TRANSIENT_FOR property. * In case the frame is shown again, the transient hint must be restored here. */ @@ -1310,7 +1310,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) * plugged windows don't necessarily get the * focus on show because the parent may already be mapped * and have the focus. So try to set the focus - * to the child on Show(TRUE) + * to the child on Show(sal_True) */ if( (nStyle_ & SAL_FRAME_STYLE_PLUG) && ! m_bXEmbed ) XSetInputFocus( GetXDisplay(), @@ -1358,7 +1358,7 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::ToTop( USHORT nFlags ) +void X11SalFrame::ToTop( sal_uInt16 nFlags ) { if( ( nFlags & SAL_FRAME_TOTOP_RESTOREWHENMIN ) && ! ( nStyle_ & SAL_FRAME_STYLE_FLOAT ) @@ -1576,7 +1576,7 @@ void X11SalFrame::updateScreenNumber() } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags ) +void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) { if( nStyle_ & SAL_FRAME_STYLE_PLUG ) return; @@ -1622,7 +1622,7 @@ void X11SalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, USHOR } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::SetAlwaysOnTop( BOOL bOnTop ) +void X11SalFrame::SetAlwaysOnTop( sal_Bool bOnTop ) { if( ! IsOverrideRedirect() ) { @@ -1803,7 +1803,7 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL X11SalFrame::GetWindowState( SalFrameState* pState ) +sal_Bool X11SalFrame::GetWindowState( SalFrameState* pState ) { if( SHOWSTATE_MINIMIZED == nShowState_ ) pState->mnState = SAL_FRAMESTATE_MINIMIZED; @@ -1842,7 +1842,7 @@ BOOL X11SalFrame::GetWindowState( SalFrameState* pState ) pState->mnMask |= _FRAMESTATE_MASK_MAXIMIZED_GEOMETRY; } - return TRUE; + return sal_True; } // ---------------------------------------------------------------------------- @@ -2161,22 +2161,22 @@ void X11SalFrame::SetScreenNumber( unsigned int nNewScreen ) Rectangle aNewScreenRect( GetDisplay()->GetXineramaScreens()[nNewScreen] ); bool bVisible = bMapped_; if( bVisible ) - Show( FALSE ); + Show( sal_False ); maGeometry.nX = aNewScreenRect.Left() + (maGeometry.nX - aOldScreenRect.Left()); maGeometry.nY = aNewScreenRect.Top() + (maGeometry.nY - aOldScreenRect.Top()); createNewWindow( None, m_nScreen ); if( bVisible ) - Show( TRUE ); + Show( sal_True ); maGeometry.nScreenNumber = nNewScreen; } else if( sal_Int32(nNewScreen) < GetDisplay()->GetScreenCount() ) { bool bVisible = bMapped_; if( bVisible ) - Show( FALSE ); + Show( sal_False ); createNewWindow( None, nNewScreen ); if( bVisible ) - Show( TRUE ); + Show( sal_True ); maGeometry.nScreenNumber = nNewScreen; } } @@ -2210,7 +2210,7 @@ void X11SalFrame::updateWMClass() // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) +void X11SalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nScreen ) { if( GetDisplay()->IsXinerama() && GetDisplay()->GetXineramaScreens().size() > 1 ) { @@ -2228,7 +2228,7 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) nStyle_ |= SAL_FRAME_STYLE_PARTIAL_FULLSCREEN; bool bVisible = bMapped_; if( bVisible ) - Show( FALSE ); + Show( sal_False ); maGeometry.nX = aRect.Left(); maGeometry.nY = aRect.Top(); maGeometry.nWidth = aRect.GetWidth(); @@ -2241,7 +2241,7 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) else GetDisplay()->getWMAdaptor()->showFullScreen( this, true ); if( bVisible ) - Show(TRUE); + Show(sal_True); } else @@ -2252,14 +2252,14 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) Rectangle aRect = maRestorePosSize; maRestorePosSize = Rectangle(); if( bVisible ) - Show( FALSE ); + Show( sal_False ); createNewWindow( None, m_nScreen ); if( !aRect.IsEmpty() ) SetPosSize( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y | SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT ); if( bVisible ) - Show( TRUE ); + Show( sal_True ); } } else @@ -2272,12 +2272,12 @@ void X11SalFrame::ShowFullScreen( BOOL bFullScreen, sal_Int32 nScreen ) if( mbFullScreen ) pDisplay_->getWMAdaptor()->showFullScreen( this, false ); if( bVisible ) - Show( FALSE ); + Show( sal_False ); createNewWindow( None, nScreen ); if( mbFullScreen ) pDisplay_->getWMAdaptor()->showFullScreen( this, true ); if( bVisible ) - Show( TRUE ); + Show( sal_True ); } if( mbFullScreen == (bool)bFullScreen ) return; @@ -2362,7 +2362,7 @@ MessageToXAutoLock( Display *p_display, int n_message ) } // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void X11SalFrame::StartPresentation( BOOL bStart ) +void X11SalFrame::StartPresentation( sal_Bool bStart ) { I18NStatus::get().show( !bStart, I18NStatus::presentation ); if ( bStart ) @@ -2380,7 +2380,7 @@ void X11SalFrame::StartPresentation( BOOL bStart ) static bool DPMSExtensionAvailable = #if !defined(SOLARIS) && !defined(AIX) (DPMSQueryExtension(GetXDisplay(), &dummy, &dummy) != 0); - static XLIB_BOOL DPMSEnabled = false; + static sal_Bool DPMSEnabled = false; #else false; bool DPMSEnabled = false; @@ -2559,10 +2559,10 @@ X11SalFrame::HandleExtTextEvent (XClientMessageEvent *pEvent) // PostEvent // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -BOOL X11SalFrame::PostEvent( void *pData ) +sal_Bool X11SalFrame::PostEvent( void *pData ) { GetDisplay()->SendInternalEvent( this, pData ); - return TRUE; + return sal_True; } // Title @@ -2634,7 +2634,7 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext ) // ----------------------------------------------------------------------- -void X11SalFrame::EndExtTextInput( USHORT nFlags ) +void X11SalFrame::EndExtTextInput( sal_uInt16 nFlags ) { if (mpInputContext != NULL) mpInputContext->EndExtTextInput( nFlags ); @@ -2642,20 +2642,20 @@ void X11SalFrame::EndExtTextInput( USHORT nFlags ) // ----------------------------------------------------------------------- -XubString X11SalFrame::GetKeyName( USHORT nKeyCode ) +XubString X11SalFrame::GetKeyName( sal_uInt16 nKeyCode ) { return GetDisplay()->GetKeyName( nKeyCode ); } -XubString X11SalFrame::GetSymbolKeyName( const XubString&, USHORT nKeyCode ) +XubString X11SalFrame::GetSymbolKeyName( const XubString&, sal_uInt16 nKeyCode ) { return GetKeyName( nKeyCode ); } -BOOL X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& ) +sal_Bool X11SalFrame::MapUnicodeToKeyCode( sal_Unicode , LanguageType , KeyCode& ) { // not supported yet - return FALSE; + return sal_False; } LanguageType X11SalFrame::GetInputLanguage() @@ -2683,7 +2683,7 @@ void X11SalFrame::UpdateSettings( AllSettings& rSettings ) pIntegrator->GetSystemLook( rSettings ); } -void X11SalFrame::CaptureMouse( BOOL bCapture ) +void X11SalFrame::CaptureMouse( sal_Bool bCapture ) { nCaptured_ = pDisplay_->CaptureMouse( bCapture ? this : NULL ); } @@ -2714,7 +2714,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen ) { bool bWasVisible = bMapped_; if( bWasVisible ) - Show( FALSE ); + Show( sal_False ); if( nScreen < 0 || nScreen >= GetDisplay()->GetScreenCount() ) nScreen = m_nScreen; @@ -2783,7 +2783,7 @@ void X11SalFrame::createNewWindow( XLIB_Window aNewParent, int nScreen ) } if( bWasVisible ) - Show( TRUE ); + Show( sal_True ); std::list< X11SalFrame* > aChildren = maChildren; for( std::list< X11SalFrame* >::iterator it = aChildren.begin(); it != aChildren.end(); ++it ) @@ -2819,9 +2819,9 @@ void X11SalFrame::Beep( SoundType eSoundType ) // not fully suported // Event Handling // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -static USHORT sal_GetCode( int state ) +static sal_uInt16 sal_GetCode( int state ) { - USHORT nCode = 0; + sal_uInt16 nCode = 0; if( state & Button1Mask ) nCode |= MOUSE_LEFT; @@ -2874,7 +2874,7 @@ SalFrame::SalIndicatorState X11SalFrame::GetIndicatorState() return aState; } -void X11SalFrame::SimulateKeyPress( USHORT nKeyCode ) +void X11SalFrame::SimulateKeyPress( sal_uInt16 nKeyCode ) { GetX11SalData()->GetDisplay()->SimulateKeyPress(nKeyCode); } @@ -2882,7 +2882,7 @@ void X11SalFrame::SimulateKeyPress( USHORT nKeyCode ) long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) { SalMouseEvent aMouseEvt; - USHORT nEvent = 0; + sal_uInt16 nEvent = 0; bool bClosePopups = false; if( nVisibleFloats && pEvent->type == EnterNotify ) @@ -3005,7 +3005,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) } if( ! bInside ) { - // need not take care of the XUngrabPointer in Show( FALSE ) + // need not take care of the XUngrabPointer in Show( sal_False ) // because XUngrabPointer does not produce errors if pointer // is not grabbed XUngrabPointer( GetXDisplay(), CurrentTime ); @@ -3089,7 +3089,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) if( pEvent->type == ButtonRelease ) return 0; - static ULONG nLines = 0; + static sal_uLong nLines = 0; if( ! nLines ) { char* pEnv = getenv( "SAL_WHEELLINES" ); @@ -3151,14 +3151,14 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) // in the independent part. struct KeyAlternate { - USHORT nKeyCode; + sal_uInt16 nKeyCode; sal_Unicode nCharCode; KeyAlternate() : nKeyCode( 0 ), nCharCode( 0 ) {} - KeyAlternate( USHORT nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} + KeyAlternate( sal_uInt16 nKey, sal_Unicode nChar = 0 ) : nKeyCode( nKey ), nCharCode( nChar ) {} }; inline KeyAlternate -GetAlternateKeyCode( const USHORT nKeyCode ) +GetAlternateKeyCode( const sal_uInt16 nKeyCode ) { KeyAlternate aAlternate; @@ -3171,6 +3171,100 @@ GetAlternateKeyCode( const USHORT nKeyCode ) return aAlternate; } +void X11SalFrame::beginUnicodeSequence() +{ + rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() ); + DeletionListener aDeleteWatch( this ); + + if( rSeq.getLength() ) + endUnicodeSequence(); + + rSeq = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "u" ) ); + + if( ! aDeleteWatch.isDeleted() ) + { + sal_uInt16 nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; + SalExtTextInputEvent aEv; + aEv.mnTime = 0; + aEv.maText = rSeq; + aEv.mpTextAttr = &nTextAttr; + aEv.mnCursorPos = 0; + aEv.mnDeltaStart = 0; + aEv.mnCursorFlags = 0; + aEv.mbOnlyCursor = sal_False; + + CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + } +} + +bool X11SalFrame::appendUnicodeSequence( sal_Unicode c ) +{ + bool bRet = false; + rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() ); + if( rSeq.getLength() > 0 ) + { + // range check + if( (c >= sal_Unicode('0') && c <= sal_Unicode('9')) || + (c >= sal_Unicode('a') && c <= sal_Unicode('f')) || + (c >= sal_Unicode('A') && c <= sal_Unicode('F')) ) + { + rtl::OUStringBuffer aBuf( rSeq.getLength() + 1 ); + aBuf.append( rSeq ); + aBuf.append( c ); + rSeq = aBuf.makeStringAndClear(); + std::vector<sal_uInt16> attribs( rSeq.getLength(), SAL_EXTTEXTINPUT_ATTR_UNDERLINE ); + + SalExtTextInputEvent aEv; + aEv.mnTime = 0; + aEv.maText = rSeq; + aEv.mpTextAttr = &attribs[0]; + aEv.mnCursorPos = 0; + aEv.mnDeltaStart = 0; + aEv.mnCursorFlags = 0; + aEv.mbOnlyCursor = sal_False; + + CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + bRet = true; + } + else + bRet = endUnicodeSequence(); + } + else + endUnicodeSequence(); + return bRet; +} + +bool X11SalFrame::endUnicodeSequence() +{ + rtl::OUString& rSeq( GetX11SalData()->GetUnicodeAccumulator() ); + + DeletionListener aDeleteWatch( this ); + if( rSeq.getLength() > 1 && rSeq.getLength() < 6 ) + { + // cut the "u" + rtl::OUString aNumbers( rSeq.copy( 1 ) ); + sal_Int32 nValue = aNumbers.toInt32( 16 ); + if( nValue >= 32 ) + { + sal_uInt16 nTextAttr = SAL_EXTTEXTINPUT_ATTR_UNDERLINE; + SalExtTextInputEvent aEv; + aEv.mnTime = 0; + aEv.maText = rtl::OUString( sal_Unicode(nValue) ); + aEv.mpTextAttr = &nTextAttr; + aEv.mnCursorPos = 0; + aEv.mnDeltaStart = 0; + aEv.mnCursorFlags = 0; + aEv.mbOnlyCursor = sal_False; + CallCallback(SALEVENT_EXTTEXTINPUT, (void*)&aEv); + } + } + bool bWasInput = rSeq.getLength() > 0; + rSeq = rtl::OUString(); + if( bWasInput && ! aDeleteWatch.isDeleted() ) + CallCallback(SALEVENT_ENDEXTTEXTINPUT, NULL); + return bWasInput; +} + // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) { @@ -3205,8 +3299,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) } SalKeyEvent aKeyEvt; - USHORT nKeyCode; - USHORT nModCode = 0; + sal_uInt16 nKeyCode; + sal_uInt16 nModCode = 0; char aDummy; if( pEvent->state & ShiftMask ) @@ -3216,6 +3310,9 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) if( pEvent->state & Mod1Mask ) nModCode |= KEY_MOD2; + if( nModCode != (KEY_SHIFT|KEY_MOD1) ) + endUnicodeSequence(); + if( nKeySym == XK_Shift_L || nKeySym == XK_Shift_R || nKeySym == XK_Control_L || nKeySym == XK_Control_R || nKeySym == XK_Alt_L || nKeySym == XK_Alt_R @@ -3236,8 +3333,8 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) // the event state does not contain ControlMask. In the release // event its the other way round: it does contain the Control mask. // The modifier mode therefore has to be adapted manually. - USHORT nExtModMask = 0; - USHORT nModMask = 0; + sal_uInt16 nExtModMask = 0; + sal_uInt16 nModMask = 0; switch( nKeySym ) { case XK_Control_L: @@ -3320,6 +3417,33 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) if( !nKeyCode && !nLen && !nKeyString) return 0; + DeletionListener aDeleteWatch( this ); + + if( nModCode == (KEY_SHIFT | KEY_MOD1) && pEvent->type == XLIB_KeyPress ) + { + sal_uInt16 nSeqKeyCode = pDisplay_->GetKeyCode( nUnmodifiedKeySym, &aDummy ); + if( nSeqKeyCode == KEY_U ) + { + beginUnicodeSequence(); + return 1; + } + else if( nSeqKeyCode >= KEY_0 && nSeqKeyCode <= KEY_9 ) + { + if( appendUnicodeSequence( sal_Unicode( '0' ) + sal_Unicode(nSeqKeyCode - KEY_0) ) ) + return 1; + } + else if( nSeqKeyCode >= KEY_A && nSeqKeyCode <= KEY_F ) + { + if( appendUnicodeSequence( sal_Unicode( 'a' ) + sal_Unicode(nSeqKeyCode - KEY_A) ) ) + return 1; + } + else + endUnicodeSequence(); + } + + if( aDeleteWatch.isDeleted() ) + return 0; + rtl_TextEncoding nEncoding; if (mpInputContext != NULL && mpInputContext->IsMultiLingual() ) @@ -3378,8 +3502,6 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) nSize = 0; } - DeletionListener aDeleteWatch( this ); - if ( mpInputContext != NULL && mpInputContext->UseContext() && KeyRelease != pEvent->type @@ -3474,9 +3596,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) if( FocusIn == pEvent->type ) { -#ifndef _USE_PRINT_EXTENSION_ GetSalData()->m_pInstance->updatePrinterUpdate(); -#endif mbInputFocus = True; ImplSVData* pSVData = ImplGetSVData(); @@ -3486,7 +3606,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) if ((mpParent != NULL && nStyle_ == 0) && pSVData->maWinData.mpFirstFloat ) { - ULONG nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags(); + sal_uLong nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags(); pSVData->maWinData.mpFirstFloat->SetPopupModeFlags( nMode & ~(FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE)); } @@ -3509,7 +3629,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) long X11SalFrame::HandleExposeEvent( XEvent *pEvent ) { XRectangle aRect = { 0, 0, 0, 0 }; - USHORT nCount = 0; + sal_uInt16 nCount = 0; if( pEvent->type == Expose ) { @@ -3700,9 +3820,9 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) XLIB_Window hWM_Parent; XLIB_Window hRoot, *Children, hDummy; unsigned int nChildren; - BOOL bNone = pDisplay_->GetProperties() + sal_Bool bNone = pDisplay_->GetProperties() & PROPERTY_SUPPORT_WM_Parent_Pixmap_None; - BOOL bAccessParentWindow = ! (pDisplay_->GetProperties() + sal_Bool bAccessParentWindow = ! (pDisplay_->GetProperties() & PROPERTY_FEATURE_TrustedSolaris); static const char* pDisableStackingCheck = getenv( "SAL_DISABLE_STACKING_CHECK" ); @@ -3731,8 +3851,8 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) hWM_Parent = GetShellWindow(); break; } - /* this sometimes happens if a Show(TRUE) is - * immediately followed by Show(FALSE) (which is braindead anyway) + /* this sometimes happens if a Show(sal_True) is + * immediately followed by Show(sal_False) (which is braindead anyway) */ if( hDummy == hWM_Parent ) hDummy = hRoot; @@ -4078,7 +4198,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) if( -1 == nCaptured_ ) { - CaptureMouse( TRUE ); + CaptureMouse( sal_True ); #ifdef DBG_UTIL if( -1 != nCaptured_ ) pDisplay_->PrintEvent( "Captured", pEvent ); @@ -4149,9 +4269,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) XUnmapWindow( GetXDisplay(), GetShellWindow() ); break; } - bMapped_ = TRUE; - bViewable_ = TRUE; - nRet = TRUE; + bMapped_ = sal_True; + bViewable_ = sal_True; + nRet = sal_True; if ( mpInputContext != NULL ) mpInputContext->Map( this ); CallCallback( SALEVENT_RESIZE, NULL ); @@ -4239,7 +4359,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) RestackChildren(); - mbInShow = FALSE; + mbInShow = sal_False; m_bSetFocusOnMap = false; } break; @@ -4247,9 +4367,9 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) case UnmapNotify: if( pEvent->xunmap.window == GetShellWindow() ) { - bMapped_ = FALSE; - bViewable_ = FALSE; - nRet = TRUE; + bMapped_ = sal_False; + bViewable_ = sal_False; + nRet = sal_True; if ( mpInputContext != NULL ) mpInputContext->Unmap( this ); CallCallback( SALEVENT_RESIZE, NULL ); @@ -4264,7 +4384,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) case VisibilityNotify: nVisibility_ = pEvent->xvisibility.state; - nRet = TRUE; + nRet = sal_True; if( bAlwaysOnTop_ && bMapped_ && ! GetDisplay()->getWMAdaptor()->isAlwaysOnTopOK() @@ -4363,7 +4483,7 @@ void X11SalFrame::ResetClipRegion() op, ordering ); } -void X11SalFrame::BeginSetClipRegion( ULONG nRects ) +void X11SalFrame::BeginSetClipRegion( sal_uLong nRects ) { if( m_pClipRectangles ) delete [] m_pClipRectangles; |