diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-08-23 18:33:43 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-08-23 19:20:03 +0300 |
commit | 708fc1c187986796861c4dcecba2861ce272dd57 (patch) | |
tree | eddd1b2260db90b6727e69b977a4f48922b6b6b2 | |
parent | f74a6338b3897df49f3041e7ce33453eaba9e2e5 (diff) |
fdo#82577, fdo#82579: Handle Cursor
Put the vcl Cursor in the vcl namespace. Avoids collision with the Xlib Cursor
typedef and some ancient Carbon (?) Cursor typedef on OS X.
Change-Id: I7af770c522b5774c87f58cc079ced9fc1bcc88b0
37 files changed, 99 insertions, 104 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 1fc355911daa..a908480e74d0 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -321,7 +321,7 @@ const Pointer& EditView::GetPointer() const return pImpEditView->GetPointer(); } -Cursor* EditView::GetCursor() const +vcl::Cursor* EditView::GetCursor() const { return pImpEditView->pCursor; } diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 8a484fe06244..e45abb4213b3 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -948,7 +948,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck ) if ( nRealDiffX || nRealDiffY ) { - Cursor* pCrsr = GetCursor(); + vcl::Cursor* pCrsr = GetCursor(); bool bVisCursor = pCrsr->IsVisible(); pCrsr->Hide(); pOutWin->Update(); diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 6a193892e23d..11935c3dd8bc 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -212,7 +212,7 @@ class ImpEditView : public vcl::unohelper::DragAndDropClient private: EditView* pEditView; - Cursor* pCursor; + vcl::Cursor* pCursor; Color* pBackgroundColor; EditEngine* pEditEngine; Window* pOutWin; @@ -318,8 +318,8 @@ public: inline void SetPointer( const Pointer& rPointer ); inline const Pointer& GetPointer(); - inline void SetCursor( const Cursor& rCursor ); - inline Cursor* GetCursor(); + inline void SetCursor( const vcl::Cursor& rCursor ); + inline vcl::Cursor* GetCursor(); void AddDragAndDropListeners(); void RemoveDragAndDropListeners(); @@ -1199,16 +1199,16 @@ inline const Pointer& ImpEditView::GetPointer() return *pPointer; } -inline void ImpEditView::SetCursor( const Cursor& rCursor ) +inline void ImpEditView::SetCursor( const vcl::Cursor& rCursor ) { delete pCursor; - pCursor = new Cursor( rCursor ); + pCursor = new vcl::Cursor( rCursor ); } -inline Cursor* ImpEditView::GetCursor() +inline vcl::Cursor* ImpEditView::GetCursor() { if ( !pCursor ) - pCursor = new Cursor; + pCursor = new vcl::Cursor; return pCursor; } diff --git a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx index 0d8f787be5e5..4b0a5e6671a6 100644 --- a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx +++ b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx @@ -43,7 +43,6 @@ #define Font XLIB_Font #define KeyCode XLIB_KeyCode #define Time XLIB_Time -#define Cursor XLIB_Cursor #define Region XLIB_Region #define String XLIB_String #define Boolean XLIB_Boolean @@ -106,7 +105,6 @@ extern "C" { #undef Font #undef KeyCode #undef Time -#undef Cursor #undef String #undef Region #undef Boolean diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 9f11c216f48c..a6842dd67d3b 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -26,6 +26,7 @@ #include <i18nlangtag/lang.h> #include <tools/color.hxx> #include <tools/gen.hxx> +#include <vcl/cursor.hxx> class EditEngine; class ImpEditEngine; @@ -34,7 +35,6 @@ class SvxSearchItem; class SvxFieldItem; class Window; class Pointer; -class Cursor; class KeyEvent; class MouseEvent; class DropEvent; @@ -132,7 +132,7 @@ public: const Pointer& GetPointer() const; - Cursor* GetCursor() const; + vcl::Cursor* GetCursor() const; void InsertText( const OUString& rNew, bool bSelect = false ); diff --git a/include/postmac.h b/include/postmac.h index 72b074a60c11..a0cc11b34e8d 100644 --- a/include/postmac.h +++ b/include/postmac.h @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#undef Cursor #undef Line #undef Point #undef Polygon diff --git a/include/postx.h b/include/postx.h index 15edbeaa63ec..a55b710e6cea 100644 --- a/include/postx.h +++ b/include/postx.h @@ -27,7 +27,6 @@ /* X Types */ #undef Window #undef Font -#undef Cursor #undef KeyCode #undef Region #undef Icon diff --git a/include/premac.h b/include/premac.h index 1de12522b3b1..f22c1935706d 100644 --- a/include/premac.h +++ b/include/premac.h @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#define Cursor MacOSCursor #define Line MacOSLine #define Point MacOSPoint #define Polygon MacOSPolygon diff --git a/include/prex.h b/include/prex.h index 15950f18152a..995e829b260f 100644 --- a/include/prex.h +++ b/include/prex.h @@ -31,7 +31,6 @@ #define Icon HIDE_XLIB_Icon /* Types from <X11/X.h> that clash, but we do use. */ -#define Cursor XLIB_Cursor #define KeyCode XLIB_KeyCode #define Region XLIB_Region #define Time XLIB_Time diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index cd282eeb6ad6..1e6c1348d044 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -67,7 +67,7 @@ protected: SdrOutliner* pTextEditOutliner; // Na eben der Outliner fuers TextEdit OutlinerView* pTextEditOutlinerView; // die aktuelle View des Outliners Window* pTextEditWin; // passendes Win zu pTextEditOutlinerView - Cursor* pTextEditCursorMerker; // Zum Restaurieren des Cursors am jeweiligen Win + vcl::Cursor* pTextEditCursorMerker; // Zum Restaurieren des Cursors am jeweiligen Win ImpSdrEditPara* pEditPara; // Da hau' ich erstmal alles rein um kompatibel zu bleiben... SdrObject* pMacroObj; SdrPageView* pMacroPV; diff --git a/include/vcl/cursor.hxx b/include/vcl/cursor.hxx index 1030406e437b..0fa4b8277ec5 100644 --- a/include/vcl/cursor.hxx +++ b/include/vcl/cursor.hxx @@ -33,6 +33,9 @@ class Window; #define CURSOR_DIRECTION_LTR ((unsigned char)0x01) #define CURSOR_DIRECTION_RTL ((unsigned char)0x02) +namespace vcl +{ + class VCL_DLLPUBLIC Cursor { private: @@ -98,6 +101,8 @@ private: bool ImplDoHide( bool bStop ); }; +} // namespace vcl + #endif // INCLUDED_VCL_CURSOR_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/textview.hxx b/include/vcl/textview.hxx index 2ead1d8f06e0..e4cd946f190f 100644 --- a/include/vcl/textview.hxx +++ b/include/vcl/textview.hxx @@ -29,7 +29,6 @@ class TextEngine; class OutputDevice; class Window; -class Cursor; class KeyEvent; class MouseEvent; class CommandEvent; diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 40ea0095d165..0e0b18e53ceb 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -28,6 +28,7 @@ #include <tools/wintypes.hxx> #include <rsc/rsc-vcl-shared-types.hxx> #include <vcl/apptypes.hxx> +#include <vcl/cursor.hxx> #include <vcl/inputctx.hxx> #include <vcl/vclevent.hxx> // Only for compatibility - because many people outside haven't included event.hxx @@ -49,7 +50,6 @@ struct SystemEnvData; struct SystemParentData; class ImplBorderWindow; class Timer; -class Cursor; class DockingManager; class ScrollBar; class Bitmap; @@ -332,7 +332,7 @@ struct WindowResHeader class VCL_DLLPUBLIC Window : public OutputDevice, public Resource { - friend class Cursor; + friend class vcl::Cursor; friend class OutputDevice; friend class Application; friend class SystemWindow; @@ -982,8 +982,8 @@ public: void LeaveWait(); bool IsWait() const; - void SetCursor( Cursor* pCursor ); - Cursor* GetCursor() const; + void SetCursor( vcl::Cursor* pCursor ); + vcl::Cursor* GetCursor() const; void SetZoom( const Fraction& rZoom ); const Fraction& GetZoom() const; diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 050c254031f2..3e5021943c57 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -987,7 +987,7 @@ void ScInputHandler::ShowTip( const OUString& rText ) { Point aPos; pTipVisibleParent = pActiveView->GetWindow(); - Cursor* pCur = pActiveView->GetCursor(); + vcl::Cursor* pCur = pActiveView->GetCursor(); if (pCur) aPos = pTipVisibleParent->LogicToPixel( pCur->GetPos() ); aPos = pTipVisibleParent->OutputToScreenPixel( aPos ); @@ -1008,7 +1008,7 @@ void ScInputHandler::ShowTipBelow( const OUString& rText ) { Point aPos; pTipVisibleSecParent = pActiveView->GetWindow(); - Cursor* pCur = pActiveView->GetCursor(); + vcl::Cursor* pCur = pActiveView->GetCursor(); if ( pCur ) { Point aLogicPos = pCur->GetPos(); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index a2e557ee272a..37cf7d53a977 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2324,7 +2324,7 @@ void ScPosWnd::Modify() if (!pWin) pWin = this; Point aPos; - Cursor* pCur = pWin->GetCursor(); + vcl::Cursor* pCur = pWin->GetCursor(); if (pCur) aPos = pWin->LogicToPixel( pCur->GetPos() ); aPos = pWin->OutputToScreenPixel( aPos ); diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx index 02bce31804f2..c9aa6204415e 100644 --- a/sc/source/ui/drawfunc/futext3.cxx +++ b/sc/source/ui/drawfunc/futext3.cxx @@ -114,7 +114,7 @@ void FuText::StopEditMode(bool /*bTextDirection*/) // or ScEndTextEdit (with drawview.hxx) pViewShell->SetDrawTextUndo( 0 ); - Cursor* pCur = pWindow->GetCursor(); + vcl::Cursor* pCur = pWindow->GetCursor(); if( pCur && pCur->IsVisible() ) pCur->Hide(); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 7055bef0f397..48e82b69785c 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -3041,7 +3041,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt ) if ( !bMouse ) { - Cursor* pCur = pEditView->GetCursor(); + vcl::Cursor* pCur = pEditView->GetCursor(); if ( pCur ) { Point aLogicPos = pCur->GetPos(); diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 50066ba15be2..8bba5896dc18 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -156,7 +156,7 @@ void ScTabView::HideAllCursors() if (pGridWin[i]) if (pGridWin[i]->IsVisible()) { - Cursor* pCur = pGridWin[i]->GetCursor(); + vcl::Cursor* pCur = pGridWin[i]->GetCursor(); if (pCur) if (pCur->IsVisible()) pCur->Hide(); @@ -1897,7 +1897,7 @@ void ScTabView::KillEditView( bool bNoPaint ) for (i=0; i<4; i++) if (pGridWin[i] && pGridWin[i]->IsVisible()) { - Cursor* pCur = pGridWin[i]->GetCursor(); + vcl::Cursor* pCur = pGridWin[i]->GetCursor(); if (pCur && pCur->IsVisible()) pCur->Hide(); diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index e8ee21796624..c510207a8a63 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -275,7 +275,7 @@ namespace sdr if(bTargetIsWindow) { Window& rWindow = static_cast< Window& >(rmOutputDevice); - Cursor* pCursor = rWindow.GetCursor(); + vcl::Cursor* pCursor = rWindow.GetCursor(); if(pCursor && pCursor->IsVisible()) { @@ -405,7 +405,7 @@ namespace sdr if(bCursorWasEnabled) { Window& rWindow = static_cast< Window& >(rmOutputDevice); - Cursor* pCursor = rWindow.GetCursor(); + vcl::Cursor* pCursor = rWindow.GetCursor(); if(pCursor) { diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 8210d3ac41b1..ea649b056d94 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -809,7 +809,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally) Window* pTEWin =pTextEditWin; SdrOutliner* pTEOutliner =pTextEditOutliner; OutlinerView* pTEOutlinerView=pTextEditOutlinerView; - Cursor* pTECursorMerker=pTextEditCursorMerker; + vcl::Cursor* pTECursorMerker=pTextEditCursorMerker; SdrUndoManager* pUndoEditUndoManager = 0; bool bNeedToUndoSavedRedoTextEdit(false); @@ -1383,7 +1383,7 @@ bool SdrObjEditView::ImpIsTextEditAllSelected() const void SdrObjEditView::ImpMakeTextCursorAreaVisible() { if (pTextEditOutlinerView!=NULL && pTextEditWin!=NULL) { - Cursor* pCsr=pTextEditWin->GetCursor(); + vcl::Cursor* pCsr=pTextEditWin->GetCursor(); if (pCsr!=NULL) { Size aSiz(pCsr->GetSize()); if (aSiz.Width()!=0 && aSiz.Height()!=0) { diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx index 6dc470370a7c..0d9565c249ae 100644 --- a/sw/inc/viscrs.hxx +++ b/sw/inc/viscrs.hxx @@ -40,7 +40,7 @@ class SwVisCrsr bool m_bIsVisible; bool m_bIsDragCrsr; - Cursor m_aTxtCrsr; + vcl::Cursor m_aTxtCrsr; const SwCrsrShell* m_pCrsrShell; void _SetPosAndShow(); diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 1a0692146548..403906adba7d 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -77,7 +77,7 @@ void SwAnnotationWin::SetPostItText() { //If the cursor was visible, then make it visible again after //changing text, e.g. fdo#33599 - Cursor *pCursor = GetOutlinerView()->GetEditView().GetCursor(); + vcl::Cursor *pCursor = GetOutlinerView()->GetEditView().GetCursor(); bool bCursorVisible = pCursor && pCursor->IsVisible(); //If the new text is the same as the old text, keep the same insertion diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx index 941ca804710d..b83dd99f9f46 100644 --- a/sw/source/uibase/lingu/hhcwrp.cxx +++ b/sw/source/uibase/lingu/hhcwrp.cxx @@ -123,7 +123,7 @@ SwHHCWrapper::~SwHHCWrapper() // I.e. we like to check those too. if ( IsDrawObj() /*&& bLastRet*/ && m_pView->GetWrtShell().HasDrawView() ) { - Cursor *pSave = m_pView->GetWindow()->GetCursor(); + vcl::Cursor *pSave = m_pView->GetWindow()->GetCursor(); { SwKeepConversionDirectionStateContext aContext; diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 9207bee0c5ab..2d77328d1e40 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -257,7 +257,7 @@ protected: // until x bytes - XLIB_Cursor aPointerCache_[POINTER_COUNT]; + Cursor aPointerCache_[POINTER_COUNT]; // Keyboard bool bNumLockFromXS_; // Num Lock handled by X Server @@ -318,7 +318,7 @@ public: Status *pStatus, XIC = NULL ) const; - XLIB_Cursor GetPointer( int ePointerStyle ); + Cursor GetPointer( int ePointerStyle ); virtual int CaptureMouse( SalFrame *pCapture ); void Remove( XEvent *pEvent ); diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h index b4f57e9c0146..0350f1659974 100644 --- a/vcl/inc/unx/salframe.h +++ b/vcl/inc/unx/salframe.h @@ -70,7 +70,7 @@ class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame Pixmap mhBackgroundPixmap; - XLIB_Cursor hCursor_; + Cursor hCursor_; int nCaptured_; // is captured X11SalGraphics *pGraphics_; // current frame graphics @@ -190,7 +190,7 @@ public: long Close() const { return CallCallback( SALEVENT_CLOSE, 0 ); } sal_uIntPtr GetStyle() const { return nStyle_; } - XLIB_Cursor GetCursor() const { return hCursor_; } + Cursor GetCursor() const { return hCursor_; } bool IsCaptured() const { return nCaptured_ == 1; } #if !defined(__synchronous_extinput__) void HandleExtTextEvent (XClientMessageEvent *pEvent); diff --git a/vcl/inc/window.h b/vcl/inc/window.h index e97eabc8d397..3411ee9fbc25 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -27,6 +27,7 @@ #include <cppuhelper/weakref.hxx> #include <list> #include <tools/wintypes.hxx> +#include <vcl/cursor.hxx> #include <vcl/inputctx.hxx> #include <vcl/outdev.hxx> #include <vcl/pointr.hxx> @@ -43,7 +44,6 @@ class FixedText; class Window; class VclSizeGroup; class VirtualDevice; -class Cursor; class PhysicalFontCollection; class ImplFontCache; class VCLXWindow; @@ -229,7 +229,7 @@ public: ImplDelData* mpFirstDel; void* mpUserData; - Cursor* mpCursor; + vcl::Cursor* mpCursor; Pointer maPointer; Fraction maZoom; OUString maText; diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index b1b903a2e6e3..e886e0f6dbfc 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -90,7 +90,7 @@ static FncGetSpecialChars pImplFncGetSpecialChars = NULL; struct DDInfo { - Cursor aCursor; + vcl::Cursor aCursor; Selection aDndStartSel; sal_Int32 nDropPos; bool bStarterOfDD; @@ -241,7 +241,7 @@ bool Edit::set_property(const OString &rKey, const OString &rValue) Edit::~Edit() { delete mpDDInfo; - Cursor* pCursor = GetCursor(); + vcl::Cursor* pCursor = GetCursor(); if ( pCursor ) { SetCursor( NULL ); @@ -337,7 +337,7 @@ void Edit::ImplInit( Window* pParent, WinBits nStyle ) else if ( nStyle & WB_CENTER ) mnAlign = EDIT_ALIGN_CENTER; - SetCursor( new Cursor ); + SetCursor( new vcl::Cursor ); SetPointer( Pointer( POINTER_TEXT ) ); ImplInitSettings( true, true, true ); @@ -511,7 +511,7 @@ void Edit::ImplRepaint(bool bLayout) return; } - Cursor* pCursor = GetCursor(); + vcl::Cursor* pCursor = GetCursor(); bool bVisCursor = pCursor && pCursor->IsVisible(); if ( pCursor ) pCursor->Hide(); @@ -1074,8 +1074,8 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible ) if ( !IsUpdateMode() || ( bOnlyIfVisible && !IsReallyVisible() ) ) return; - Cursor* pCursor = GetCursor(); - OUString aText = ImplGetText(); + vcl::Cursor* pCursor = GetCursor(); + OUString aText = ImplGetText(); long nTextPos = 0; diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx index c9b3b77a0be5..85f3b36938d9 100644 --- a/vcl/source/edit/textdat2.hxx +++ b/vcl/source/edit/textdat2.hxx @@ -271,7 +271,7 @@ public: struct TextDDInfo { - Cursor maCursor; + vcl::Cursor maCursor; TextPaM maDropPos; bool mbStarterOfDD; diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 2be376153832..b607caf7abf9 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -151,7 +151,7 @@ struct ImpTextView Point maStartDocPos; // TextPaM maMBDownPaM; - Cursor* mpCursor; + vcl::Cursor* mpCursor; TextDDInfo* mpDDInfo; @@ -204,7 +204,7 @@ TextView::TextView( TextEngine* pEng, Window* pWindow ) : mpImpl->mpSelEngine->SetSelectionMode( RANGE_SELECTION ); mpImpl->mpSelEngine->EnableDrag( true ); - mpImpl->mpCursor = new Cursor; + mpImpl->mpCursor = new vcl::Cursor; mpImpl->mpCursor->Show(); pWindow->SetCursor( mpImpl->mpCursor ); pWindow->SetInputContext( InputContext( pEng->GetFont(), INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT ) ); diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index 3ccf0601bdca..a64c37a6a5f2 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -115,11 +115,10 @@ static void ImplCursorInvert( ImplCursorData* pData ) pWindow->EnableMapMode( bMapMode ); } -void Cursor::ImplDraw() +void vcl::Cursor::ImplDraw() { if ( mpData && mpData->mpWindow && !mpData->mbCurVisible ) { - // SAL_DEBUG("Cursor::ImplDraw"); Window* pWindow = mpData->mpWindow; mpData->maPixPos = pWindow->LogicToPixel( maPos ); mpData->maPixSize = pWindow->LogicToPixel( maSize ); @@ -140,17 +139,16 @@ void Cursor::ImplDraw() } } -void Cursor::ImplRestore() +void vcl::Cursor::ImplRestore() { if ( mpData && mpData->mbCurVisible ) { - // SAL_DEBUG("Cursor::ImplRestore"); ImplCursorInvert( mpData ); mpData->mbCurVisible = false; } } -void Cursor::ImplDoShow( bool bDrawDirect, bool bRestore ) +void vcl::Cursor::ImplDoShow( bool bDrawDirect, bool bRestore ) { if ( mbVisible ) { @@ -193,7 +191,7 @@ void Cursor::ImplDoShow( bool bDrawDirect, bool bRestore ) } } -bool Cursor::ImplDoHide( bool bSuspend ) +bool vcl::Cursor::ImplDoHide( bool bSuspend ) { bool bWasCurVisible = false; if ( mpData && mpData->mpWindow ) @@ -211,28 +209,28 @@ bool Cursor::ImplDoHide( bool bSuspend ) return bWasCurVisible; } -void Cursor::ImplShow( bool bDrawDirect ) +void vcl::Cursor::ImplShow( bool bDrawDirect ) { ImplDoShow( bDrawDirect, false ); } -void Cursor::ImplHide( bool i_bStopTimer ) +void vcl::Cursor::ImplHide( bool i_bStopTimer ) { assert( i_bStopTimer ); ImplDoHide( !i_bStopTimer ); } -void Cursor::ImplResume( bool bRestore ) +void vcl::Cursor::ImplResume( bool bRestore ) { ImplDoShow( false, bRestore ); } -bool Cursor::ImplSuspend() +bool vcl::Cursor::ImplSuspend() { return ImplDoHide( true ); } -void Cursor::ImplNew() +void vcl::Cursor::ImplNew() { if ( mbVisible && mpData && mpData->mpWindow ) { @@ -248,7 +246,7 @@ void Cursor::ImplNew() } } -IMPL_LINK_NOARG(Cursor, ImplTimerHdl) +IMPL_LINK_NOARG(vcl::Cursor, ImplTimerHdl) { if ( mpData->mbCurVisible ) ImplRestore(); @@ -257,7 +255,7 @@ IMPL_LINK_NOARG(Cursor, ImplTimerHdl) return 0; } -Cursor::Cursor() +vcl::Cursor::Cursor() { mpData = NULL; mpWindow = NULL; @@ -268,7 +266,7 @@ Cursor::Cursor() mbVisible = false; } -Cursor::Cursor( const Cursor& rCursor ) : +vcl::Cursor::Cursor( const Cursor& rCursor ) : maSize( rCursor.maSize ), maPos( rCursor.maPos ) { @@ -281,7 +279,7 @@ Cursor::Cursor( const Cursor& rCursor ) : mbVisible = rCursor.mbVisible; } -Cursor::~Cursor() +vcl::Cursor::~Cursor() { if ( mpData ) { @@ -292,7 +290,7 @@ Cursor::~Cursor() } } -void Cursor::SetStyle( sal_uInt16 nStyle ) +void vcl::Cursor::SetStyle( sal_uInt16 nStyle ) { if ( mnStyle != nStyle ) { @@ -301,7 +299,7 @@ void Cursor::SetStyle( sal_uInt16 nStyle ) } } -void Cursor::Show() +void vcl::Cursor::Show() { if ( !mbVisible ) { @@ -310,7 +308,7 @@ void Cursor::Show() } } -void Cursor::Hide() +void vcl::Cursor::Hide() { if ( mbVisible ) { @@ -319,7 +317,7 @@ void Cursor::Hide() } } -void Cursor::SetWindow( Window* pWindow ) +void vcl::Cursor::SetWindow( Window* pWindow ) { if ( mpWindow != pWindow ) { @@ -328,7 +326,7 @@ void Cursor::SetWindow( Window* pWindow ) } } -void Cursor::SetPos( const Point& rPoint ) +void vcl::Cursor::SetPos( const Point& rPoint ) { if ( maPos != rPoint ) { @@ -337,7 +335,7 @@ void Cursor::SetPos( const Point& rPoint ) } } -void Cursor::SetSize( const Size& rSize ) +void vcl::Cursor::SetSize( const Size& rSize ) { if ( maSize != rSize ) { @@ -346,7 +344,7 @@ void Cursor::SetSize( const Size& rSize ) } } -void Cursor::SetWidth( long nNewWidth ) +void vcl::Cursor::SetWidth( long nNewWidth ) { if ( maSize.Width() != nNewWidth ) { @@ -355,7 +353,7 @@ void Cursor::SetWidth( long nNewWidth ) } } -void Cursor::SetOrientation( short nNewOrientation ) +void vcl::Cursor::SetOrientation( short nNewOrientation ) { if ( mnOrientation != nNewOrientation ) { @@ -364,7 +362,7 @@ void Cursor::SetOrientation( short nNewOrientation ) } } -void Cursor::SetDirection( unsigned char nNewDirection ) +void vcl::Cursor::SetDirection( unsigned char nNewDirection ) { if ( mnDirection != nNewDirection ) { @@ -373,7 +371,7 @@ void Cursor::SetDirection( unsigned char nNewDirection ) } } -Cursor& Cursor::operator=( const Cursor& rCursor ) +vcl::Cursor& vcl::Cursor::operator=( const vcl::Cursor& rCursor ) { maPos = rCursor.maPos; maSize = rCursor.maSize; @@ -386,7 +384,7 @@ Cursor& Cursor::operator=( const Cursor& rCursor ) return *this; } -bool Cursor::operator==( const Cursor& rCursor ) const +bool vcl::Cursor::operator==( const vcl::Cursor& rCursor ) const { return ((maPos == rCursor.maPos) && diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b7166f0390d8..ef1ff62e9ec9 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3130,7 +3130,7 @@ bool Window::HasChildPathFocus( bool bSystemWindow ) const return false; } -void Window::SetCursor( Cursor* pCursor ) +void Window::SetCursor( vcl::Cursor* pCursor ) { if ( mpWindowImpl->mpCursor != pCursor ) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index cabf358f094c..e8126f4afc35 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1311,7 +1311,7 @@ bool Window::IsWait() const return (mpWindowImpl->mnWaitCount != 0); } -Cursor* Window::GetCursor() const +vcl::Cursor* Window::GetCursor() const { return mpWindowImpl->mpCursor; } diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 0763780b4a65..492b7a8f4b97 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1311,7 +1311,7 @@ static void ImplHandleExtTextInputPos( Window* pWindow, rRect = pChildOutDev->ImplLogicToDevicePixel( *pRect ); else { - Cursor* pCursor = pChild->GetCursor(); + vcl::Cursor* pCursor = pChild->GetCursor(); if ( pCursor ) { Point aPos = pChildOutDev->ImplLogicToDevicePixel( pCursor->GetPos() ); diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 91c57069ca54..dc195371d033 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -1438,12 +1438,12 @@ KeySym SalDisplay::GetKeySym( XKeyEvent *pEvent, nXHot = name##curs_x_hot; \ nYHot = name##curs_y_hot -XLIB_Cursor SalDisplay::GetPointer( int ePointerStyle ) +Cursor SalDisplay::GetPointer( int ePointerStyle ) { if( ePointerStyle >= POINTER_COUNT ) return 0; - XLIB_Cursor &aCur = aPointerCache_[ePointerStyle]; + Cursor &aCur = aPointerCache_[ePointerStyle]; if( aCur != None ) return aCur; diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 657003174d3e..a24d373025e9 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -277,7 +277,7 @@ SelectionManager::SelectionManager() : m_aDragRunning.reset(); } -XLIB_Cursor SelectionManager::createCursor( const unsigned char* pPointerData, const unsigned char* pMaskData, int width, int height, int hotX, int hotY ) +Cursor SelectionManager::createCursor( const unsigned char* pPointerData, const unsigned char* pMaskData, int width, int height, int hotX, int hotY ) { Pixmap aPointer; Pixmap aMask; @@ -303,7 +303,7 @@ XLIB_Cursor SelectionManager::createCursor( const unsigned char* pPointerData, c reinterpret_cast<const char*>(pMaskData), width, height ); - XLIB_Cursor aCursor = + Cursor aCursor = XCreatePixmapCursor( m_pDisplay, aPointer, aMask, &aBlack, &aWhite, hotX, @@ -2878,7 +2878,7 @@ sal_Bool SelectionManager::isDragImageSupported() throw(std::exception) sal_Int32 SelectionManager::getDefaultCursor( sal_Int8 dragAction ) throw(std::exception) { - XLIB_Cursor aCursor = m_aNoneCursor; + Cursor aCursor = m_aNoneCursor; if( dragAction & DNDConstants::ACTION_MOVE ) aCursor = m_aMoveCursor; else if( dragAction & DNDConstants::ACTION_COPY ) @@ -3459,7 +3459,7 @@ void SelectionManager::dragDoDispatch() void SelectionManager::setCursor( sal_Int32 cursor, XLIB_Window aDropWindow, XLIB_Time ) { osl::MutexGuard aGuard( m_aMutex ); - if( aDropWindow == m_aDropWindow && XLIB_Cursor(cursor) != m_aCurrentCursor ) + if( aDropWindow == m_aDropWindow && Cursor(cursor) != m_aCurrentCursor ) { if( m_xDragSourceListener.is() && ! m_bDropSent ) { diff --git a/vcl/unx/generic/dtrans/X11_selection.hxx b/vcl/unx/generic/dtrans/X11_selection.hxx index 7c0402a20ef1..4aef1eb4d00b 100644 --- a/vcl/unx/generic/dtrans/X11_selection.hxx +++ b/vcl/unx/generic/dtrans/X11_selection.hxx @@ -313,11 +313,11 @@ namespace x11 { XLIB_Time m_nDragTimestamp; // drag cursors - XLIB_Cursor m_aMoveCursor; - XLIB_Cursor m_aCopyCursor; - XLIB_Cursor m_aLinkCursor; - XLIB_Cursor m_aNoneCursor; - XLIB_Cursor m_aCurrentCursor; + Cursor m_aMoveCursor; + Cursor m_aCopyCursor; + Cursor m_aLinkCursor; + Cursor m_aNoneCursor; + Cursor m_aCurrentCursor; // drag and drop @@ -389,7 +389,7 @@ namespace x11 { void sendDropPosition( bool bForce, XLIB_Time eventXLIB_Time ); bool updateDragAction( int modifierState ); int getXdndVersion( XLIB_Window aXLIB_Window, XLIB_Window& rProxy ); - XLIB_Cursor createCursor( const unsigned char* pPointerData, const unsigned char* pMaskData, int width, int height, int hotX, int hotY ); + Cursor createCursor( const unsigned char* pPointerData, const unsigned char* pMaskData, int width, int height, int hotX, int hotY ); // coordinates on root XLIB_Window void updateDragWindow( int nX, int nY, XLIB_Window aRoot ); diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 55d45552d8fd..f1ebc2ffc656 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -78,7 +78,6 @@ #endif using namespace vcl_sal; -using namespace vcl; #define CLIENT_EVENTS StructureNotifyMask \ | SubstructureNotifyMask \ @@ -898,9 +897,9 @@ X11SalFrame::~X11SalFrame() * check if there is only the status frame left * if so, free it */ - if( ! GetDisplay()->getFrames().empty() && I18NStatus::exists() ) + if( ! GetDisplay()->getFrames().empty() && vcl::I18NStatus::exists() ) { - SalFrame* pStatusFrame = I18NStatus::get().getStatusFrame(); + SalFrame* pStatusFrame = vcl::I18NStatus::get().getStatusFrame(); std::list< SalFrame* >::const_iterator sit = GetDisplay()->getFrames().begin(); if( pStatusFrame && *sit == pStatusFrame @@ -2274,7 +2273,7 @@ MessageToXAutoLock( Display *p_display, int n_message ) void X11SalFrame::StartPresentation( bool bStart ) { - I18NStatus::get().show( !bStart, I18NStatus::presentation ); + vcl::I18NStatus::get().show( !bStart, vcl::I18NStatus::presentation ); if ( bStart ) MessageToXAutoLock( GetXDisplay(), XAUTOLOCK_DISABLE ); else @@ -2486,7 +2485,7 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext ) if (mpInputContext == NULL) { - I18NStatus& rStatus( I18NStatus::get() ); + vcl::I18NStatus& rStatus( vcl::I18NStatus::get() ); rStatus.setParent( this ); mpInputContext = new SalI18N_InputContext( this ); if (mpInputContext->UseContext()) @@ -2801,7 +2800,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent ) nEvent = SALEVENT_MOUSEMOVE; if( nVisibleFloats > 0 && mpParent ) { - XLIB_Cursor aCursor = mpParent->GetCursor(); + Cursor aCursor = mpParent->GetCursor(); if( pEvent->xmotion.x >= 0 && pEvent->xmotion.x < (int)maGeometry.nWidth && pEvent->xmotion.y >= 0 && pEvent->xmotion.y < (int)maGeometry.nHeight ) aCursor = None; @@ -3011,7 +3010,7 @@ GetAlternateKeyCode( const sal_uInt16 nKeyCode ) void X11SalFrame::beginUnicodeSequence() { OUString& rSeq( GetGenericData()->GetUnicodeCommand() ); - DeletionListener aDeleteWatch( this ); + vcl::DeletionListener aDeleteWatch( this ); if( !rSeq.isEmpty() ) endUnicodeSequence(); @@ -3073,7 +3072,7 @@ bool X11SalFrame::endUnicodeSequence() { OUString& rSeq( GetGenericData()->GetUnicodeCommand() ); - DeletionListener aDeleteWatch( this ); + vcl::DeletionListener aDeleteWatch( this ); if( rSeq.getLength() > 1 && rSeq.getLength() < 6 ) { // cut the "u" @@ -3250,7 +3249,7 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent ) if( !nKeyCode && !nLen && !nKeyString) return 0; - DeletionListener aDeleteWatch( this ); + vcl::DeletionListener aDeleteWatch( this ); if( nModCode == (KEY_SHIFT | KEY_MOD1) && pEvent->type == XLIB_KeyPress ) { @@ -3405,7 +3404,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent ) * a lookup choice windows that might have the focus now * mpInputContext->UnsetICFocus( this ); */ - I18NStatus::get().show( false, I18NStatus::focus ); + vcl::I18NStatus::get().show( false, vcl::I18NStatus::focus ); } } @@ -4074,7 +4073,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) // don't set the focus into the IME status window // since this will lead to a parent loss of focus, close status, // reget focus, open status, .... flicker loop - if ( (I18NStatus::get().getStatusFrame() != this) ) + if ( (vcl::I18NStatus::get().getStatusFrame() != this) ) bSetFocus = true; } |