[Libreoffice-commits] core.git: 2 commits - vcl/headless vcl/inc vcl/osx vcl/source vcl/unx vcl/win
Noel Grandin
noel at peralex.com
Tue May 10 09:35:51 UTC 2016
vcl/headless/svpframe.cxx | 16 ++--
vcl/headless/svpinst.cxx | 6 -
vcl/headless/svpprn.cxx | 2
vcl/inc/headless/svpinst.hxx | 6 -
vcl/inc/osx/salinst.h | 4 -
vcl/inc/salframe.hxx | 4 -
vcl/inc/salwtype.hxx | 99 ++++++++++++-------------
vcl/inc/unx/gendisp.hxx | 8 +-
vcl/inc/unx/salframe.h | 2
vcl/inc/window.h | 3
vcl/osx/salframe.cxx | 20 ++---
vcl/osx/salframeview.mm | 74 +++++++++---------
vcl/osx/salinst.cxx | 2
vcl/osx/salmenu.cxx | 2
vcl/osx/salnsmenu.mm | 8 +-
vcl/osx/vclnsapp.mm | 4 -
vcl/source/app/svapp.cxx | 20 ++---
vcl/source/window/debugevent.cxx | 32 ++++----
vcl/source/window/winproc.cxx | 120 +++++++++++++++---------------
vcl/source/window/wrkwin.cxx | 6 +
vcl/unx/generic/app/gendisp.cxx | 10 +-
vcl/unx/generic/app/i18n_cb.cxx | 8 +-
vcl/unx/generic/app/i18n_ic.cxx | 18 ++--
vcl/unx/generic/app/i18n_status.cxx | 2
vcl/unx/generic/app/saldisp.cxx | 2
vcl/unx/generic/app/salinst.cxx | 2
vcl/unx/generic/app/sm.cxx | 2
vcl/unx/generic/app/wmadaptor.cxx | 2
vcl/unx/generic/gdi/salgdi2.cxx | 4 -
vcl/unx/generic/window/salframe.cxx | 66 ++++++++--------
vcl/unx/generic/window/salobj.cxx | 10 +-
vcl/unx/gtk/gtkdata.cxx | 2
vcl/unx/gtk/gtksalframe.cxx | 88 +++++++++++-----------
vcl/unx/gtk3/gtk3gtkframe.cxx | 74 +++++++++---------
vcl/win/window/salframe.cxx | 142 ++++++++++++++++++------------------
35 files changed, 439 insertions(+), 431 deletions(-)
New commits:
commit 12df0a2ac89cc8da216d2244aa52ca3c291ba93f
Author: Noel Grandin <noel at peralex.com>
Date: Tue May 10 11:03:19 2016 +0200
fix OSX build
after my "WindowStateState scoped enum" conversion.
WorkWindow::IsMinimized needs to check the return code of
SalFrame::GetWindowState, or it can end up reading uninitialised memory.
So mark the member as SAL_WARN_UNUSED_RESULT.
Change-Id: Iaeb132ed2fbf08162dbd7ec2e126dfa679cbda6c
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index dee3639..8bf79f35 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -149,6 +149,8 @@ public:
const SalFrameGeometry& GetUnmirroredGeometry() const { return maGeometry; }
virtual void SetWindowState( const SalFrameState* pState ) = 0;
+ // if this returns false the structure is uninitialised
+ SAL_WARN_UNUSED_RESULT
virtual bool GetWindowState( SalFrameState* pState ) = 0;
virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) = 0;
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index 2ebe8d8..20470a0 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -208,8 +208,10 @@ bool WorkWindow::IsMinimized() const
{
//return mpWindowImpl->mpFrameData->mbMinimized;
SalFrameState aState;
- mpWindowImpl->mpFrame->GetWindowState(&aState);
- return bool(aState.mnState & WindowStateState::Minimized);
+ if (mpWindowImpl->mpFrame->GetWindowState(&aState))
+ return bool(aState.mnState & WindowStateState::Minimized);
+ else
+ return false;
}
bool WorkWindow::SetPluginParent( SystemParentData* pParent )
commit 385ce0323fd6b5c13ab26414d68c6ca2afcfc97d
Author: Noel Grandin <noel at peralex.com>
Date: Tue May 10 10:52:48 2016 +0200
Convert SAL_EVENT to scoped enum
Change-Id: I4e605e7acfe9d4fe409d32f20880b4c0e85a0ea7
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 0b971f4..f8b29f6 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -89,7 +89,7 @@ SvpSalFrame::~SvpSalFrame()
// SAL_DEBUG("SvpSalFrame::~SvpSalFrame: losing focus: " << this);
s_pFocusFrame = nullptr;
// call directly here, else an event for a destroyed frame would be dispatched
- CallCallback( SALEVENT_LOSEFOCUS, nullptr );
+ CallCallback( SalEvent::LoseFocus, nullptr );
// if the handler has not set a new focus frame
// pass focus to another frame, preferably a document style window
if( s_pFocusFrame == nullptr )
@@ -126,7 +126,7 @@ void SvpSalFrame::GetFocus()
s_pFocusFrame->LoseFocus();
// SAL_DEBUG("SvpSalFrame::GetFocus(): " << this);
s_pFocusFrame = this;
- m_pInstance->PostEvent( this, nullptr, SALEVENT_GETFOCUS );
+ m_pInstance->PostEvent( this, nullptr, SalEvent::GetFocus );
}
}
@@ -135,7 +135,7 @@ void SvpSalFrame::LoseFocus()
if( s_pFocusFrame == this )
{
// SAL_DEBUG("SvpSalFrame::LoseFocus: " << this);
- m_pInstance->PostEvent( this, nullptr, SALEVENT_LOSEFOCUS );
+ m_pInstance->PostEvent( this, nullptr, SalEvent::LoseFocus );
s_pFocusFrame = nullptr;
}
}
@@ -159,7 +159,7 @@ void SvpSalFrame::ReleaseGraphics( SalGraphics* pGraphics )
bool SvpSalFrame::PostEvent(ImplSVEvent* pData)
{
- m_pInstance->PostEvent( this, pData, SALEVENT_USEREVENT );
+ m_pInstance->PostEvent( this, pData, SalEvent::UserEvent );
return true;
}
@@ -169,7 +169,7 @@ void SvpSalFrame::PostPaint() const
{
SalPaintEvent aPEvt(0, 0, maGeometry.nWidth, maGeometry.nHeight);
aPEvt.mbImmediateUpdate = false;
- CallCallback( SALEVENT_PAINT, &aPEvt );
+ CallCallback( SalEvent::Paint, &aPEvt );
}
}
@@ -199,7 +199,7 @@ void SvpSalFrame::Show( bool bVisible, bool bNoActivate )
{
// SAL_DEBUG("SvpSalFrame::Show: showing: " << this);
m_bVisible = true;
- m_pInstance->PostEvent( this, nullptr, SALEVENT_RESIZE );
+ m_pInstance->PostEvent( this, nullptr, SalEvent::Resize );
if( ! bNoActivate )
GetFocus();
}
@@ -207,7 +207,7 @@ void SvpSalFrame::Show( bool bVisible, bool bNoActivate )
{
// SAL_DEBUG("SvpSalFrame::Show: hiding: " << this);
m_bVisible = false;
- m_pInstance->PostEvent( this, nullptr, SALEVENT_RESIZE );
+ m_pInstance->PostEvent( this, nullptr, SalEvent::Resize );
LoseFocus();
}
else
@@ -279,7 +279,7 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
}
}
if( m_bVisible )
- m_pInstance->PostEvent( this, nullptr, SALEVENT_RESIZE );
+ m_pInstance->PostEvent( this, nullptr, SalEvent::Resize );
#endif
}
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 0305cee..0bd50fe 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -157,7 +157,7 @@ void SvpSalInstance::CreateWakeupPipe(bool log)
}
}
-void SvpSalInstance::PostEvent(const SalFrame* pFrame, ImplSVEvent* pData, sal_uInt16 nEvent)
+void SvpSalInstance::PostEvent(const SalFrame* pFrame, ImplSVEvent* pData, SalEvent nEvent)
{
{
osl::MutexGuard g(m_aEventGuard);
@@ -191,7 +191,7 @@ void SvpSalInstance::deregisterFrame( SalFrame* pFrame )
{
if( it->m_pFrame == pFrame )
{
- if (it->m_nEvent == SALEVENT_USEREVENT)
+ if (it->m_nEvent == SalEvent::UserEvent)
{
delete static_cast<ImplSVEvent *>(it->m_pData);
}
@@ -338,7 +338,7 @@ SalYieldResult SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents,
if ( isFrameAlive( it->m_pFrame ) )
{
it->m_pFrame->CallCallback( it->m_nEvent, it->m_pData );
- if( it->m_nEvent == SALEVENT_RESIZE )
+ if( it->m_nEvent == SalEvent::Resize )
{
// this would be a good time to post a paint
const SvpSalFrame* pSvpFrame = static_cast<const SvpSalFrame*>(it->m_pFrame);
diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx
index 1d8557f..a966452 100644
--- a/vcl/headless/svpprn.cxx
+++ b/vcl/headless/svpprn.cxx
@@ -257,7 +257,7 @@ void SvpSalInstance::PostPrintersChanged()
const std::list< SalFrame* >& rList = SvpSalInstance::s_pDefaultInstance->getFrames();
for( std::list< SalFrame* >::const_iterator it = rList.begin();
it != rList.end(); ++it )
- SvpSalInstance::s_pDefaultInstance->PostEvent( *it, nullptr, SALEVENT_PRINTERCHANGED );
+ SvpSalInstance::s_pDefaultInstance->PostEvent( *it, nullptr, SalEvent::PrinterChanged );
}
GenPspGraphics *SvpSalInstance::CreatePrintGraphics()
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx
index f39fefd..ae23d71 100644
--- a/vcl/inc/headless/svpinst.hxx
+++ b/vcl/inc/headless/svpinst.hxx
@@ -68,9 +68,9 @@ class VCL_DLLPUBLIC SvpSalInstance : public SalGenericInstance
{
const SalFrame* m_pFrame;
ImplSVEvent* m_pData;
- sal_uInt16 m_nEvent;
+ SalEvent m_nEvent;
- SalUserEvent( const SalFrame* pFrame, ImplSVEvent* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT )
+ SalUserEvent( const SalFrame* pFrame, ImplSVEvent* pData, SalEvent nEvent = SalEvent::UserEvent )
: m_pFrame( pFrame ),
m_pData( pData ),
m_nEvent( nEvent )
@@ -95,7 +95,7 @@ public:
void CloseWakeupPipe(bool log);
void CreateWakeupPipe(bool log);
- void PostEvent(const SalFrame* pFrame, ImplSVEvent* pData, sal_uInt16 nEvent);
+ void PostEvent(const SalFrame* pFrame, ImplSVEvent* pData, SalEvent nEvent);
#ifdef ANDROID
bool PostedEventsInQueue();
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index 972ad7b..9712e9f 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -57,9 +57,9 @@ class AquaSalInstance : public SalInstance
{
AquaSalFrame* mpFrame;
void* mpData;
- sal_uInt16 mnType;
+ SalEvent mnType;
- SalUserEvent( AquaSalFrame* pFrame, void* pData, sal_uInt16 nType ) :
+ SalUserEvent( AquaSalFrame* pFrame, void* pData, SalEvent nType ) :
mpFrame( pFrame ), mpData( pData ), mnType( nType )
{}
};
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index 134a6d6..dee3639 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -269,7 +269,7 @@ public:
// Call the callback set; this sometimes necessary for implementation classes
// that should not know more than necessary about the SalFrame implementation
// (e.g. input methods, printer update handlers).
- long CallCallback( sal_uInt16 nEvent, const void* pEvent ) const
+ long CallCallback( SalEvent nEvent, const void* pEvent ) const
{ return m_pProc ? long(m_pProc( m_pWindow, nEvent, pEvent )) : 0; }
bool PaintsBlocked() const { return m_bPaintsBlocked; }
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index d9c473b..d0adae4 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -34,53 +34,56 @@ enum class InputContextFlags;
enum class WindowStateMask;
enum class WindowStateState;
-#define SALEVENT_MOUSEMOVE ((sal_uInt16)1)
-#define SALEVENT_MOUSELEAVE ((sal_uInt16)2)
-#define SALEVENT_MOUSEBUTTONDOWN ((sal_uInt16)3)
-#define SALEVENT_MOUSEBUTTONUP ((sal_uInt16)4)
-#define SALEVENT_KEYINPUT ((sal_uInt16)5)
-#define SALEVENT_KEYUP ((sal_uInt16)6)
-#define SALEVENT_KEYMODCHANGE ((sal_uInt16)7)
-#define SALEVENT_PAINT ((sal_uInt16)8)
-#define SALEVENT_RESIZE ((sal_uInt16)9)
-#define SALEVENT_GETFOCUS ((sal_uInt16)10)
-#define SALEVENT_LOSEFOCUS ((sal_uInt16)11)
-#define SALEVENT_CLOSE ((sal_uInt16)12)
-#define SALEVENT_SHUTDOWN ((sal_uInt16)13)
-#define SALEVENT_SETTINGSCHANGED ((sal_uInt16)14)
-#define SALEVENT_PRINTERCHANGED ((sal_uInt16)16)
-#define SALEVENT_DISPLAYCHANGED ((sal_uInt16)17)
-#define SALEVENT_FONTCHANGED ((sal_uInt16)18)
-#define SALEVENT_WHEELMOUSE ((sal_uInt16)21)
-#define SALEVENT_USEREVENT ((sal_uInt16)22)
-#define SALEVENT_MOUSEACTIVATE ((sal_uInt16)23)
-#define SALEVENT_EXTTEXTINPUT ((sal_uInt16)24)
-#define SALEVENT_ENDEXTTEXTINPUT ((sal_uInt16)25)
-#define SALEVENT_EXTTEXTINPUTPOS ((sal_uInt16)26)
-#define SALEVENT_INPUTCONTEXTCHANGE ((sal_uInt16)27)
-#define SALEVENT_MOVE ((sal_uInt16)28)
-#define SALEVENT_MOVERESIZE ((sal_uInt16)29)
-#define SALEVENT_CLOSEPOPUPS ((sal_uInt16)30)
-#define SALEVENT_EXTERNALKEYINPUT ((sal_uInt16)31)
-#define SALEVENT_EXTERNALKEYUP ((sal_uInt16)32)
-#define SALEVENT_MENUCOMMAND ((sal_uInt16)33)
-#define SALEVENT_MENUHIGHLIGHT ((sal_uInt16)34)
-#define SALEVENT_MENUACTIVATE ((sal_uInt16)35)
-#define SALEVENT_MENUDEACTIVATE ((sal_uInt16)36)
-#define SALEVENT_EXTERNALMOUSEMOVE ((sal_uInt16)37)
-#define SALEVENT_EXTERNALMOUSEBUTTONDOWN ((sal_uInt16)38)
-#define SALEVENT_EXTERNALMOUSEBUTTONUP ((sal_uInt16)39)
-#define SALEVENT_INPUTLANGUAGECHANGE ((sal_uInt16)40)
-#define SALEVENT_SHOWDIALOG ((sal_uInt16)41)
-#define SALEVENT_MENUBUTTONCOMMAND ((sal_uInt16)42)
-#define SALEVENT_SURROUNDINGTEXTREQUEST ((sal_uInt16)43)
-#define SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE ((sal_uInt16)44)
-#define SALEVENT_STARTRECONVERSION ((sal_uInt16)45)
-#define SALEVENT_EXTERNALZOOM ((sal_uInt16)46)
-#define SALEVENT_EXTERNALSCROLL ((sal_uInt16)47)
-#define SALEVENT_QUERYCHARPOSITION ((sal_uInt16)48)
-#define SALEVENT_SWIPE ((sal_uInt16)49)
-#define SALEVENT_LONGPRESS ((sal_uInt16)50)
+enum class SalEvent {
+ NONE,
+ MouseMove,
+ MouseLeave,
+ MouseButtonDown,
+ MouseButtonUp,
+ KeyInput,
+ KeyUp,
+ KeyModChange,
+ Paint,
+ Resize,
+ GetFocus,
+ LoseFocus,
+ Close,
+ Shutdown,
+ SettingsChanged,
+ PrinterChanged,
+ DisplayChanged,
+ FontChanged,
+ WheelMouse,
+ UserEvent,
+ MouseActivate,
+ ExtTextInput,
+ EndExtTextInput,
+ ExtTextInputPos,
+ InputContextChange,
+ Move,
+ MoveResize,
+ ClosePopups,
+ ExternalKeyInput,
+ ExternalKeyUp,
+ MenuCommand,
+ MenuHighlight,
+ MenuActivate,
+ MenuDeactivate,
+ ExternalMouseMove,
+ ExternalMouseButtonDown,
+ ExternalMouseButtonUp,
+ InputLanguageChange,
+ ShowDialog,
+ MenuButtonCommand,
+ SurroundingTextRequest,
+ SurroundingTextSelectionChange,
+ StartReconversion,
+ ExternalZoom,
+ ExternalScroll,
+ QueryCharPosition,
+ Swipe,
+ LongPress
+};
// MOUSELEAVE must send, when the pointer leave the client area and
// the mouse is not captured
@@ -214,7 +217,7 @@ struct SalQueryCharPositionEvent
long mnCursorBoundHeight; // The cursor bounds corresponding to the character specified by mnCharPos - Height
};
-typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, sal_uInt16 nEvent, const void* pEvent );
+typedef bool (*SALFRAMEPROC)( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
#define SALOBJ_EVENT_GETFOCUS ((sal_uInt16)1)
#define SALOBJ_EVENT_LOSEFOCUS ((sal_uInt16)2)
diff --git a/vcl/inc/unx/gendisp.hxx b/vcl/inc/unx/gendisp.hxx
index fd39952..21e1312 100644
--- a/vcl/inc/unx/gendisp.hxx
+++ b/vcl/inc/unx/gendisp.hxx
@@ -36,10 +36,10 @@ class VCL_DLLPUBLIC SalGenericDisplay
{
SalFrame* m_pFrame;
void* m_pData;
- sal_uInt16 m_nEvent;
+ SalEvent m_nEvent;
SalUserEvent( SalFrame* pFrame, void* pData,
- sal_uInt16 nEvent )
+ SalEvent nEvent )
: m_pFrame( pFrame ),
m_pData( pData ),
m_nEvent( nEvent )
@@ -62,8 +62,8 @@ public:
// Event handling
virtual void PostUserEvent() = 0;
- void SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT );
- void CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent );
+ void SendInternalEvent( SalFrame* pFrame, void* pData, SalEvent nEvent = SalEvent::UserEvent );
+ void CancelInternalEvent( SalFrame* pFrame, void* pData, SalEvent nEvent );
bool DispatchInternalEvent();
bool HasUserEvents() const;
diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h
index 2329b0b..036e7f2 100644
--- a/vcl/inc/unx/salframe.h
+++ b/vcl/inc/unx/salframe.h
@@ -181,7 +181,7 @@ public:
::Window GetShellWindow() const { return mhShellWindow; }
::Window GetForeignParent() const { return mhForeignParent; }
::Window GetStackingWindow() const { return mhStackingWindow; }
- void Close() const { CallCallback( SALEVENT_CLOSE, NULL ); }
+ void Close() const { CallCallback( SalEvent::Close, NULL ); }
SalFrameStyleFlags GetStyle() const { return nStyle_; }
Cursor GetCursor() const { return hCursor_; }
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index ccdd8bf..3adb6fd 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -47,6 +47,7 @@ enum class ActivateModeFlags;
enum class DialogControlFlags;
enum class GetFocusFlags;
enum class ParentClipMode;
+enum class SalEvent;
namespace com { namespace sun { namespace star {
@@ -77,7 +78,7 @@ namespace dnd {
class XDropTarget;
}}}}}
-bool ImplWindowFrameProc( vcl::Window* pInst, sal_uInt16 nEvent, const void* pEvent );
+bool ImplWindowFrameProc( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
#define WINDOW_HITTEST_INSIDE ((sal_uInt16)0x0001)
#define WINDOW_HITTEST_TRANSPARENT ((sal_uInt16)0x0002)
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 2e46815..a084520 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -256,7 +256,7 @@ void AquaSalFrame::screenParametersChanged()
if( mpGraphics )
mpGraphics->updateResolution();
- CallCallback( SALEVENT_DISPLAYCHANGED, nullptr );
+ CallCallback( SalEvent::DisplayChanged, nullptr );
}
SalGraphics* AquaSalFrame::AcquireGraphics()
@@ -283,7 +283,7 @@ void AquaSalFrame::ReleaseGraphics( SalGraphics *pGraphics )
bool AquaSalFrame::PostEvent(ImplSVEvent* pData)
{
- GetSalData()->mpFirstInstance->PostUserEvent( this, SALEVENT_USEREVENT, pData );
+ GetSalData()->mpFirstInstance->PostUserEvent( this, SalEvent::UserEvent, pData );
return TRUE;
}
@@ -400,7 +400,7 @@ void AquaSalFrame::SendPaintEvent( const Rectangle* pRect )
aPaintEvt.mnBoundHeight = pRect->GetHeight();
}
- CallCallback(SALEVENT_PAINT, &aPaintEvt);
+ CallCallback(SalEvent::Paint, &aPaintEvt);
}
void AquaSalFrame::Show(bool bVisible, bool bNoActivate)
@@ -417,7 +417,7 @@ void AquaSalFrame::Show(bool bVisible, bool bNoActivate)
if( mbInitShow )
initShow();
- CallCallback(SALEVENT_RESIZE, nullptr);
+ CallCallback(SalEvent::Resize, nullptr);
// trigger filling our backbuffer
SendPaintEvent();
@@ -579,13 +579,13 @@ void AquaSalFrame::SetWindowState( const SalFrameState* pState )
if( pState->mnMask & (WindowStateMask::X | WindowStateMask::Y) )
{
mbPositioned = true;
- nEvent = SALEVENT_MOVE;
+ nEvent = SalEvent::Move;
}
if( pState->mnMask & (WindowStateMask::Width | WindowStateMask::Height) )
{
mbSized = true;
- nEvent = (nEvent == SALEVENT_MOVE) ? SALEVENT_MOVERESIZE : SALEVENT_RESIZE;
+ nEvent = (nEvent == SalEvent::Move) ? SalEvent::MoveResize : SalEvent::Resize;
}
// send event that we were moved/sized
if( nEvent )
@@ -746,7 +746,7 @@ void AquaSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
UpdateFrameGeometry();
if( mbShown )
- CallCallback( SALEVENT_MOVERESIZE, nullptr );
+ CallCallback( SalEvent::MoveResize, nullptr );
}
else
{
@@ -756,7 +756,7 @@ void AquaSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
UpdateFrameGeometry();
if( mbShown )
- CallCallback( SALEVENT_MOVERESIZE, nullptr );
+ CallCallback( SalEvent::MoveResize, nullptr );
// show the dock and the menubar
[NSMenu setMenuBarVisible:YES];
@@ -1253,13 +1253,13 @@ void AquaSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_u
if (nFlags & (SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y))
{
mbPositioned = true;
- nEvent = SALEVENT_MOVE;
+ nEvent = SalEvent::Move;
}
if (nFlags & (SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT))
{
mbSized = true;
- nEvent = (nEvent == SALEVENT_MOVE) ? SALEVENT_MOVERESIZE : SALEVENT_RESIZE;
+ nEvent = (nEvent == SalEvent::Move) ? SalEvent::MoveResize : SalEvent::Resize;
}
NSRect aFrameRect = [mpNSWindow frame];
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index d4d37c8..246ca40 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -271,7 +271,7 @@ static AquaSalFrame* getMouseContainerFrame()
if( (mpFrame->mpParent && mpFrame->mpParent->GetWindow()->IsInModalMode()) )
AquaSalMenu::enableMainMenu( false );
#endif
- mpFrame->CallCallback( SALEVENT_GETFOCUS, nullptr );
+ mpFrame->CallCallback( SalEvent::GetFocus, nullptr );
mpFrame->SendPaintEvent(); // repaint controls as active
}
}
@@ -283,7 +283,7 @@ static AquaSalFrame* getMouseContainerFrame()
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->CallCallback(SALEVENT_LOSEFOCUS, nullptr);
+ mpFrame->CallCallback(SalEvent::LoseFocus, nullptr);
mpFrame->SendPaintEvent(); // repaint controls as inactive
}
}
@@ -305,7 +305,7 @@ static AquaSalFrame* getMouseContainerFrame()
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
mpFrame->UpdateFrameGeometry();
- mpFrame->CallCallback( SALEVENT_MOVE, nullptr );
+ mpFrame->CallCallback( SalEvent::Move, nullptr );
}
}
@@ -317,7 +317,7 @@ static AquaSalFrame* getMouseContainerFrame()
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
mpFrame->UpdateFrameGeometry();
- mpFrame->CallCallback( SALEVENT_RESIZE, nullptr );
+ mpFrame->CallCallback( SalEvent::Resize, nullptr );
mpFrame->SendPaintEvent();
}
}
@@ -331,7 +331,7 @@ static AquaSalFrame* getMouseContainerFrame()
{
mpFrame->mbShown = false;
mpFrame->UpdateFrameGeometry();
- mpFrame->CallCallback( SALEVENT_RESIZE, nullptr );
+ mpFrame->CallCallback( SalEvent::Resize, nullptr );
}
}
@@ -344,7 +344,7 @@ static AquaSalFrame* getMouseContainerFrame()
{
mpFrame->mbShown = true;
mpFrame->UpdateFrameGeometry();
- mpFrame->CallCallback( SALEVENT_RESIZE, nullptr );
+ mpFrame->CallCallback( SalEvent::Resize, nullptr );
}
}
@@ -357,10 +357,10 @@ static AquaSalFrame* getMouseContainerFrame()
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
// #i84461# end possible input
- mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr );
+ mpFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
if( AquaSalFrame::isAlive( mpFrame ) )
{
- mpFrame->CallCallback( SALEVENT_CLOSE, nullptr );
+ mpFrame->CallCallback( SalEvent::Close, nullptr );
bRet = NO; // application will close the window or not, AppKit shouldn't
}
}
@@ -558,8 +558,8 @@ private:
if( pDispatchFrame )
{
bIsCaptured = true;
- if( nEvent == SALEVENT_MOUSELEAVE ) // no leave events if mouse is captured
- nEvent = SALEVENT_MOUSEMOVE;
+ if( nEvent == SalEvent::MouseLeave ) // no leave events if mouse is captured
+ nEvent = SalEvent::MouseMove;
}
else if( s_pMouseFrame )
pDispatchFrame = s_pMouseFrame;
@@ -643,7 +643,7 @@ private:
}
s_nLastButton = MOUSE_LEFT;
- [self sendMouseEventToFrame:pEvent button:MOUSE_LEFT eventtype:SALEVENT_MOUSEBUTTONDOWN];
+ [self sendMouseEventToFrame:pEvent button:MOUSE_LEFT eventtype:SalEvent::MouseButtonDown];
}
-(void)mouseDragged: (NSEvent*)pEvent
@@ -654,19 +654,19 @@ private:
[mpMouseEventListener mouseDragged: [pEvent copyWithZone: nullptr]];
}
s_nLastButton = MOUSE_LEFT;
- [self sendMouseEventToFrame:pEvent button:MOUSE_LEFT eventtype:SALEVENT_MOUSEMOVE];
+ [self sendMouseEventToFrame:pEvent button:MOUSE_LEFT eventtype:SalEvent::MouseMove];
}
-(void)mouseUp: (NSEvent*)pEvent
{
s_nLastButton = 0;
- [self sendMouseEventToFrame:pEvent button:MOUSE_LEFT eventtype:SALEVENT_MOUSEBUTTONUP];
+ [self sendMouseEventToFrame:pEvent button:MOUSE_LEFT eventtype:SalEvent::MouseButtonUp];
}
-(void)mouseMoved: (NSEvent*)pEvent
{
s_nLastButton = 0;
- [self sendMouseEventToFrame:pEvent button:0 eventtype:SALEVENT_MOUSEMOVE];
+ [self sendMouseEventToFrame:pEvent button:0 eventtype:SalEvent::MouseMove];
}
-(void)mouseEntered: (NSEvent*)pEvent
@@ -676,7 +676,7 @@ private:
// #i107215# the only mouse events we get when inactive are enter/exit
// actually we would like to have all of them, but better none than some
if( [NSApp isActive] )
- [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSEMOVE];
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SalEvent::MouseMove];
}
-(void)mouseExited: (NSEvent*)pEvent
@@ -687,25 +687,25 @@ private:
// #i107215# the only mouse events we get when inactive are enter/exit
// actually we would like to have all of them, but better none than some
if( [NSApp isActive] )
- [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SALEVENT_MOUSELEAVE];
+ [self sendMouseEventToFrame:pEvent button:s_nLastButton eventtype:SalEvent::MouseLeave];
}
-(void)rightMouseDown: (NSEvent*)pEvent
{
s_nLastButton = MOUSE_RIGHT;
- [self sendMouseEventToFrame:pEvent button:MOUSE_RIGHT eventtype:SALEVENT_MOUSEBUTTONDOWN];
+ [self sendMouseEventToFrame:pEvent button:MOUSE_RIGHT eventtype:SalEvent::MouseButtonDown];
}
-(void)rightMouseDragged: (NSEvent*)pEvent
{
s_nLastButton = MOUSE_RIGHT;
- [self sendMouseEventToFrame:pEvent button:MOUSE_RIGHT eventtype:SALEVENT_MOUSEMOVE];
+ [self sendMouseEventToFrame:pEvent button:MOUSE_RIGHT eventtype:SalEvent::MouseMove];
}
-(void)rightMouseUp: (NSEvent*)pEvent
{
s_nLastButton = 0;
- [self sendMouseEventToFrame:pEvent button:MOUSE_RIGHT eventtype:SALEVENT_MOUSEBUTTONUP];
+ [self sendMouseEventToFrame:pEvent button:MOUSE_RIGHT eventtype:SalEvent::MouseButtonUp];
}
-(void)otherMouseDown: (NSEvent*)pEvent
@@ -713,7 +713,7 @@ private:
if( [pEvent buttonNumber] == 2 )
{
s_nLastButton = MOUSE_MIDDLE;
- [self sendMouseEventToFrame:pEvent button:MOUSE_MIDDLE eventtype:SALEVENT_MOUSEBUTTONDOWN];
+ [self sendMouseEventToFrame:pEvent button:MOUSE_MIDDLE eventtype:SalEvent::MouseButtonDown];
}
else
s_nLastButton = 0;
@@ -724,7 +724,7 @@ private:
if( [pEvent buttonNumber] == 2 )
{
s_nLastButton = MOUSE_MIDDLE;
- [self sendMouseEventToFrame:pEvent button:MOUSE_MIDDLE eventtype:SALEVENT_MOUSEMOVE];
+ [self sendMouseEventToFrame:pEvent button:MOUSE_MIDDLE eventtype:SalEvent::MouseMove];
}
else
s_nLastButton = 0;
@@ -734,7 +734,7 @@ private:
{
s_nLastButton = 0;
if( [pEvent buttonNumber] == 2 )
- [self sendMouseEventToFrame:pEvent button:MOUSE_MIDDLE eventtype:SALEVENT_MOUSEBUTTONUP];
+ [self sendMouseEventToFrame:pEvent button:MOUSE_MIDDLE eventtype:SalEvent::MouseButtonUp];
}
- (void)magnifyWithEvent: (NSEvent*)pEvent
@@ -800,7 +800,7 @@ private:
aEvent.mnScrollLines = nDeltaZ;
if( aEvent.mnScrollLines == 0 )
aEvent.mnScrollLines = 1;
- mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ mpFrame->CallCallback( SalEvent::WheelMouse, &aEvent );
}
}
@@ -856,7 +856,7 @@ private:
aEvent.mnDelta = aEvent.mnNotchDelta;
aEvent.mbHorz = TRUE;
aEvent.mnScrollLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL;
- mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ mpFrame->CallCallback( SalEvent::WheelMouse, &aEvent );
}
if( dY != 0.0 && AquaSalFrame::isAlive( mpFrame ))
{
@@ -866,7 +866,7 @@ private:
aEvent.mnDelta = aEvent.mnNotchDelta;
aEvent.mbHorz = FALSE;
aEvent.mnScrollLines = SAL_WHEELMOUSE_EVENT_PAGESCROLL;
- mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ mpFrame->CallCallback( SalEvent::WheelMouse, &aEvent );
}
}
}
@@ -919,7 +919,7 @@ private:
if( aEvent.mnScrollLines == 0 )
aEvent.mnScrollLines = 1;
- mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ mpFrame->CallCallback( SalEvent::WheelMouse, &aEvent );
}
if( dY != 0.0 && AquaSalFrame::isAlive( mpFrame ) )
{
@@ -932,7 +932,7 @@ private:
if( aEvent.mnScrollLines == 0 )
aEvent.mnScrollLines = 1;
- mpFrame->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ mpFrame->CallCallback( SalEvent::WheelMouse, &aEvent );
}
}
}
@@ -1078,9 +1078,9 @@ private:
aEvent.mnCursorPos = aInsertString.getLength();
aEvent.mnCursorFlags = 0;
aEvent.mbOnlyCursor = FALSE;
- mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, &aEvent );
+ mpFrame->CallCallback( SalEvent::ExtTextInput, &aEvent );
if( AquaSalFrame::isAlive( mpFrame ) )
- mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr );
+ mpFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
}
}
else
@@ -1092,9 +1092,9 @@ private:
aEvent.mnCursorPos = 0;
aEvent.mnCursorFlags = 0;
aEvent.mbOnlyCursor = FALSE;
- mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, &aEvent );
+ mpFrame->CallCallback( SalEvent::ExtTextInput, &aEvent );
if( AquaSalFrame::isAlive( mpFrame ) )
- mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr );
+ mpFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
}
mbKeyHandled = true;
@@ -1493,12 +1493,12 @@ private:
aEvent.mnCode = nKeyCode | ImplGetModifierMask( nMod );
aEvent.mnCharCode = aChar;
aEvent.mnRepeat = FALSE;
- nRet = mpFrame->CallCallback( SALEVENT_KEYINPUT, &aEvent );
+ nRet = mpFrame->CallCallback( SalEvent::KeyInput, &aEvent );
std::map< NSEvent*, bool >::iterator it = GetSalData()->maKeyEventAnswer.find( mpLastEvent );
if( it != GetSalData()->maKeyEventAnswer.end() )
it->second = nRet != 0;
if( AquaSalFrame::isAlive( mpFrame ) )
- mpFrame->CallCallback( SALEVENT_KEYUP, &aEvent );
+ mpFrame->CallCallback( SalEvent::KeyUp, &aEvent );
}
return nRet ? YES : NO;
}
@@ -1638,14 +1638,14 @@ private:
aInputEvent.maText = aInsertString;
aInputEvent.mnCursorPos = selRange.location;
aInputEvent.mpTextAttr = &aInputFlags[0];
- mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void *>(&aInputEvent) );
+ mpFrame->CallCallback( SalEvent::ExtTextInput, static_cast<void *>(&aInputEvent) );
} else {
aInputEvent.maText.clear();
aInputEvent.mnCursorPos = 0;
aInputEvent.mnCursorFlags = 0;
aInputEvent.mpTextAttr = nullptr;
- mpFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void *>(&aInputEvent) );
- mpFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr );
+ mpFrame->CallCallback( SalEvent::ExtTextInput, static_cast<void *>(&aInputEvent) );
+ mpFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
}
mbKeyHandled= true;
}
@@ -1711,7 +1711,7 @@ private:
SolarMutexGuard aGuard;
SalExtTextInputPosEvent aPosEvent;
- mpFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, static_cast<void *>(&aPosEvent) );
+ mpFrame->CallCallback( SalEvent::ExtTextInputPos, static_cast<void *>(&aPosEvent) );
NSRect rect;
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 98b11b1..2d57b4a 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -85,7 +85,7 @@ class AquaDelayedSettingsChanged : public Idle
{
SalData* pSalData = GetSalData();
if( ! pSalData->maFrames.empty() )
- pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, nullptr );
+ pSalData->maFrames.front()->CallCallback( SalEvent::SettingsChanged, nullptr );
if( mbInvalidate )
{
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 00f0991..36569a5 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -75,7 +75,7 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = nullptr;
const AquaSalFrame* pFrame = AquaSalMenu::pCurrentMenuBar->mpFrame;
if( pFrame && AquaSalFrame::isAlive( pFrame ) )
{
- pFrame->CallCallback( SALEVENT_SHOWDIALOG, reinterpret_cast<void*>(nDialog) );
+ pFrame->CallCallback( SalEvent::ShowDialog, reinterpret_cast<void*>(nDialog) );
}
}
else
diff --git a/vcl/osx/salnsmenu.mm b/vcl/osx/salnsmenu.mm
index 76aee7a..b30792d 100644
--- a/vcl/osx/salnsmenu.mm
+++ b/vcl/osx/salnsmenu.mm
@@ -49,8 +49,8 @@
aMenuEvt.mpMenu = mpMenu->mpVCLMenu;
if( aMenuEvt.mpMenu )
{
- pFrame->CallCallback(SALEVENT_MENUACTIVATE, &aMenuEvt);
- pFrame->CallCallback(SALEVENT_MENUDEACTIVATE, &aMenuEvt);
+ pFrame->CallCallback(SalEvent::MenuActivate, &aMenuEvt);
+ pFrame->CallCallback(SalEvent::MenuDeactivate, &aMenuEvt);
}
else
OSL_FAIL( "unconnected menu" );
@@ -118,7 +118,7 @@
if( pFrame && AquaSalFrame::isAlive( pFrame ) && ! pFrame->GetWindow()->IsInModalMode() )
{
SalMenuEvent aMenuEvt( mpMenuItem->mnId, mpMenuItem->mpVCLMenu );
- pFrame->CallCallback(SALEVENT_MENUCOMMAND, &aMenuEvt);
+ pFrame->CallCallback(SalEvent::MenuCommand, &aMenuEvt);
}
else if( mpMenuItem->mpVCLMenu )
{
@@ -200,7 +200,7 @@
if( AquaSalMenu::pCurrentMenuBar->mpFrame && AquaSalFrame::isAlive( AquaSalMenu::pCurrentMenuBar->mpFrame ) )
{
SalMenuEvent aMenuEvt( rButtons[i].maButton.mnId, AquaSalMenu::pCurrentMenuBar->mpVCLMenu );
- AquaSalMenu::pCurrentMenuBar->mpFrame->CallCallback(SALEVENT_MENUBUTTONCOMMAND, &aMenuEvt);
+ AquaSalMenu::pCurrentMenuBar->mpFrame->CallCallback(SalEvent::MenuButtonCommand, &aMenuEvt);
}
return;
}
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index 4a84071..14ce7ec 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -405,7 +405,7 @@
{
// the following QueryExit will likely present a message box, activate application
[NSApp activateIgnoringOtherApps: YES];
- aReply = pSalData->maFrames.front()->CallCallback( SALEVENT_SHUTDOWN, nullptr ) ? NSTerminateCancel : NSTerminateNow;
+ aReply = pSalData->maFrames.front()->CallCallback( SalEvent::Shutdown, nullptr ) ? NSTerminateCancel : NSTerminateNow;
}
if( aReply == NSTerminateNow )
@@ -428,7 +428,7 @@
const SalData* pSalData = GetSalData();
if( !pSalData->maFrames.empty() )
- pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, nullptr );
+ pSalData->maFrames.front()->CallCallback( SalEvent::SettingsChanged, nullptr );
}
-(void)screenParametersChanged: (NSNotification*) pNotification
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index f6860e3..6225104 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -966,54 +966,54 @@ IMPL_STATIC_LINK_TYPED( Application, PostEventHandler, void*, pCallData, void )
const SolarMutexGuard aGuard;
ImplPostEventData* pData = static_cast< ImplPostEventData * >( pCallData );
const void* pEventData;
- sal_uLong nEvent;
+ SalEvent nEvent;
ImplSVEvent * const nEventId = pData->mnEventId;
switch( pData->mnEvent )
{
case VCLEVENT_WINDOW_MOUSEMOVE:
- nEvent = SALEVENT_EXTERNALMOUSEMOVE;
+ nEvent = SalEvent::ExternalMouseMove;
pEventData = &pData->maMouseEvent;
break;
case VCLEVENT_WINDOW_MOUSEBUTTONDOWN:
- nEvent = SALEVENT_EXTERNALMOUSEBUTTONDOWN;
+ nEvent = SalEvent::ExternalMouseButtonDown;
pEventData = &pData->maMouseEvent;
break;
case VCLEVENT_WINDOW_MOUSEBUTTONUP:
- nEvent = SALEVENT_EXTERNALMOUSEBUTTONUP;
+ nEvent = SalEvent::ExternalMouseButtonUp;
pEventData = &pData->maMouseEvent;
break;
case VCLEVENT_WINDOW_KEYINPUT:
- nEvent = SALEVENT_EXTERNALKEYINPUT;
+ nEvent = SalEvent::ExternalKeyInput;
pEventData = &pData->maKeyEvent;
break;
case VCLEVENT_WINDOW_KEYUP:
- nEvent = SALEVENT_EXTERNALKEYUP;
+ nEvent = SalEvent::ExternalKeyUp;
pEventData = &pData->maKeyEvent;
break;
case VCLEVENT_WINDOW_ZOOM:
- nEvent = SALEVENT_EXTERNALZOOM;
+ nEvent = SalEvent::ExternalZoom;
pEventData = &pData->maZoomEvent;
break;
case VCLEVENT_WINDOW_SCROLL:
- nEvent = SALEVENT_EXTERNALSCROLL;
+ nEvent = SalEvent::ExternalScroll;
pEventData = &pData->maScrollEvent;
break;
default:
- nEvent = 0;
+ nEvent = SalEvent::NONE;
pEventData = nullptr;
break;
};
if( pData->mpWin && pData->mpWin.get()->mpWindowImpl->mpFrameWindow.get() && pEventData )
- ImplWindowFrameProc( pData->mpWin.get()->mpWindowImpl->mpFrameWindow.get(), (sal_uInt16) nEvent, pEventData );
+ ImplWindowFrameProc( pData->mpWin.get()->mpWindowImpl->mpFrameWindow.get(), nEvent, pEventData );
// remove this event from list of posted events, watch for destruction of internal data
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
diff --git a/vcl/source/window/debugevent.cxx b/vcl/source/window/debugevent.cxx
index 6a101c6..3acf9d6 100644
--- a/vcl/source/window/debugevent.cxx
+++ b/vcl/source/window/debugevent.cxx
@@ -86,23 +86,23 @@ void DebugEventInjector::InjectMenuEvent()
if (!pMenuBar)
return;
- sal_uInt16 nEvents[] = {
- SALEVENT_MENUCOMMAND,
- SALEVENT_MENUCOMMAND,
- SALEVENT_MENUACTIVATE,
- SALEVENT_MENUDEACTIVATE,
- SALEVENT_MENUHIGHLIGHT,
- SALEVENT_MENUCOMMAND,
- SALEVENT_MENUCOMMAND,
- SALEVENT_MENUCOMMAND,
- SALEVENT_MENUBUTTONCOMMAND,
- SALEVENT_MENUBUTTONCOMMAND,
+ SalEvent nEvents[] = {
+ SalEvent::MenuCommand,
+ SalEvent::MenuCommand,
+ SalEvent::MenuActivate,
+ SalEvent::MenuDeactivate,
+ SalEvent::MenuHighlight,
+ SalEvent::MenuCommand,
+ SalEvent::MenuCommand,
+ SalEvent::MenuCommand,
+ SalEvent::MenuButtonCommand,
+ SalEvent::MenuButtonCommand,
};
MenuItemIds aIds;
CollectMenuItemIds( pMenuBar, aIds );
- sal_uInt16 nEvent = nEvents[ (int)(getRandom() * SAL_N_ELEMENTS( nEvents )) ];
+ SalEvent nEvent = nEvents[ (int)(getRandom() * SAL_N_ELEMENTS( nEvents )) ];
SalMenuEvent aEvent = aIds[ getRandom() * aIds.size() ];
bool bHandled = ImplWindowFrameProc( pSysWin, nEvent, &aEvent);
@@ -160,14 +160,14 @@ void DebugEventInjector::InjectTextEvent()
if( getRandom() < 0.05 ) // modifier
aKeyEvent.mnCode |= (sal_uInt16)( getRandom() * KEY_MODIFIERS_MASK ) & KEY_MODIFIERS_MASK;
- bool bHandled = ImplWindowFrameProc( pWindow, SALEVENT_KEYINPUT, &aKeyEvent);
+ bool bHandled = ImplWindowFrameProc( pWindow, SalEvent::KeyInput, &aKeyEvent);
SAL_INFO( "vcl.debugevent",
"Injected key 0x" << std::hex << (int) aKeyEvent.mnCode << std::dec
<< " -> " << bHandled
<< " win " << pWindow );
- ImplWindowFrameProc( pWindow, SALEVENT_KEYUP, &aKeyEvent );
+ ImplWindowFrameProc( pWindow, SalEvent::KeyUp, &aKeyEvent );
}
/*
@@ -242,13 +242,13 @@ void DebugEventInjector::InjectKeyNavEdit()
aKeyEvent.mnCharCode = 0x0; // hopefully unused.
- bool bHandled = ImplWindowFrameProc( pWindow, SALEVENT_KEYINPUT, &aKeyEvent );
+ bool bHandled = ImplWindowFrameProc( pWindow, SalEvent::KeyInput, &aKeyEvent );
SAL_INFO( "vcl.debugevent",
"Injected edit / move key 0x" << std::hex << (int) aKeyEvent.mnCode << std::dec
<< " -> " << bHandled
<< " win " << pWindow );
- ImplWindowFrameProc( pWindow, SALEVENT_KEYUP, &aKeyEvent );
+ ImplWindowFrameProc( pWindow, SalEvent::KeyUp, &aKeyEvent );
}
void DebugEventInjector::Invoke()
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index fe5286d..c16818e 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2032,7 +2032,7 @@ inline bool ImplHandleSalMouseButtonUp( vcl::Window* pWindow, SalMouseEvent* pEv
ImplGetMouseButtonMode( pEvent ) );
}
-static bool ImplHandleMenuEvent( vcl::Window* pWindow, SalMenuEvent* pEvent, sal_uInt16 nEvent )
+static bool ImplHandleMenuEvent( vcl::Window* pWindow, SalMenuEvent* pEvent, SalEvent nEvent )
{
// Find SystemWindow and its Menubar and let it dispatch the command
bool bRet = false;
@@ -2050,19 +2050,19 @@ static bool ImplHandleMenuEvent( vcl::Window* pWindow, SalMenuEvent* pEvent, sal
{
switch( nEvent )
{
- case SALEVENT_MENUACTIVATE:
+ case SalEvent::MenuActivate:
bRet = pMenuBar->HandleMenuActivateEvent( static_cast<Menu*>(pEvent->mpMenu) );
break;
- case SALEVENT_MENUDEACTIVATE:
+ case SalEvent::MenuDeactivate:
bRet = pMenuBar->HandleMenuDeActivateEvent( static_cast<Menu*>(pEvent->mpMenu) );
break;
- case SALEVENT_MENUHIGHLIGHT:
+ case SalEvent::MenuHighlight:
bRet = pMenuBar->HandleMenuHighlightEvent( static_cast<Menu*>(pEvent->mpMenu), pEvent->mnId );
break;
- case SALEVENT_MENUBUTTONCOMMAND:
+ case SalEvent::MenuButtonCommand:
bRet = pMenuBar->HandleMenuButtonEvent( static_cast<Menu*>(pEvent->mpMenu), pEvent->mnId );
break;
- case SALEVENT_MENUCOMMAND:
+ case SalEvent::MenuCommand:
bRet = pMenuBar->HandleMenuCommandEvent( static_cast<Menu*>(pEvent->mpMenu), pEvent->mnId );
break;
default:
@@ -2135,13 +2135,13 @@ static void ImplHandleInputLanguageChange( vcl::Window* pWindow )
ImplCallCommand( pChild, CommandEventId::InputLanguageChange );
}
-static void ImplHandleSalSettings( sal_uInt16 nEvent )
+static void ImplHandleSalSettings( SalEvent nEvent )
{
Application* pApp = GetpApp();
if ( !pApp )
return;
- if ( nEvent == SALEVENT_SETTINGSCHANGED )
+ if ( nEvent == SalEvent::SettingsChanged )
{
AllSettings aSettings = Application::GetSettings();
Application::MergeSystemSettings( aSettings );
@@ -2153,14 +2153,14 @@ static void ImplHandleSalSettings( sal_uInt16 nEvent )
DataChangedEventType nType;
switch ( nEvent )
{
- case SALEVENT_PRINTERCHANGED:
+ case SalEvent::PrinterChanged:
ImplDeletePrnQueueList();
nType = DataChangedEventType::PRINTER;
break;
- case SALEVENT_DISPLAYCHANGED:
+ case SalEvent::DisplayChanged:
nType = DataChangedEventType::DISPLAY;
break;
- case SALEVENT_FONTCHANGED:
+ case SalEvent::FontChanged:
OutputDevice::ImplUpdateAllFontData( true );
nType = DataChangedEventType::FONTS;
break;
@@ -2318,7 +2318,7 @@ static void ImplHandleSalQueryCharPosition( vcl::Window *pWindow,
}
}
-bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void* pEvent )
+bool ImplWindowFrameProc( vcl::Window* _pWindow, SalEvent nEvent, const void* pEvent )
{
DBG_TESTSOLARMUTEX();
@@ -2335,10 +2335,10 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
switch ( nEvent )
{
- case SALEVENT_MOUSEMOVE:
+ case SalEvent::MouseMove:
bRet = ImplHandleSalMouseMove( pWindow, const_cast<SalMouseEvent *>(static_cast<SalMouseEvent const *>(pEvent)) );
break;
- case SALEVENT_EXTERNALMOUSEMOVE:
+ case SalEvent::ExternalMouseMove:
{
MouseEvent const * pMouseEvt = static_cast<MouseEvent const *>(pEvent);
SalMouseEvent aSalMouseEvent;
@@ -2352,13 +2352,13 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
bRet = ImplHandleSalMouseMove( pWindow, &aSalMouseEvent );
}
break;
- case SALEVENT_MOUSELEAVE:
+ case SalEvent::MouseLeave:
bRet = ImplHandleSalMouseLeave( pWindow, const_cast<SalMouseEvent *>(static_cast<SalMouseEvent const *>(pEvent)) );
break;
- case SALEVENT_MOUSEBUTTONDOWN:
+ case SalEvent::MouseButtonDown:
bRet = ImplHandleSalMouseButtonDown( pWindow, const_cast<SalMouseEvent *>(static_cast<SalMouseEvent const *>(pEvent)) );
break;
- case SALEVENT_EXTERNALMOUSEBUTTONDOWN:
+ case SalEvent::ExternalMouseButtonDown:
{
MouseEvent const * pMouseEvt = static_cast<MouseEvent const *>(pEvent);
SalMouseEvent aSalMouseEvent;
@@ -2372,10 +2372,10 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
bRet = ImplHandleSalMouseButtonDown( pWindow, &aSalMouseEvent );
}
break;
- case SALEVENT_MOUSEBUTTONUP:
+ case SalEvent::MouseButtonUp:
bRet = ImplHandleSalMouseButtonUp( pWindow, const_cast<SalMouseEvent *>(static_cast<SalMouseEvent const *>(pEvent)) );
break;
- case SALEVENT_EXTERNALMOUSEBUTTONUP:
+ case SalEvent::ExternalMouseButtonUp:
{
MouseEvent const * pMouseEvt = static_cast<MouseEvent const *>(pEvent);
SalMouseEvent aSalMouseEvent;
@@ -2389,58 +2389,58 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
bRet = ImplHandleSalMouseButtonUp( pWindow, &aSalMouseEvent );
}
break;
- case SALEVENT_MOUSEACTIVATE:
+ case SalEvent::MouseActivate:
bRet = false;
break;
- case SALEVENT_KEYINPUT:
+ case SalEvent::KeyInput:
{
SalKeyEvent const * pKeyEvt = static_cast<SalKeyEvent const *>(pEvent);
bRet = ImplHandleKey( pWindow, MouseNotifyEvent::KEYINPUT,
pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, true );
}
break;
- case SALEVENT_EXTERNALKEYINPUT:
+ case SalEvent::ExternalKeyInput:
{
KeyEvent const * pKeyEvt = static_cast<KeyEvent const *>(pEvent);
bRet = ImplHandleKey( pWindow, MouseNotifyEvent::KEYINPUT,
pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), false );
}
break;
- case SALEVENT_KEYUP:
+ case SalEvent::KeyUp:
{
SalKeyEvent const * pKeyEvt = static_cast<SalKeyEvent const *>(pEvent);
bRet = ImplHandleKey( pWindow, MouseNotifyEvent::KEYUP,
pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, true );
}
break;
- case SALEVENT_EXTERNALKEYUP:
+ case SalEvent::ExternalKeyUp:
{
KeyEvent const * pKeyEvt = static_cast<KeyEvent const *>(pEvent);
bRet = ImplHandleKey( pWindow, MouseNotifyEvent::KEYUP,
pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), false );
}
break;
- case SALEVENT_KEYMODCHANGE:
+ case SalEvent::KeyModChange:
ImplHandleSalKeyMod( pWindow, const_cast<SalKeyModEvent *>(static_cast<SalKeyModEvent const *>(pEvent)) );
break;
- case SALEVENT_INPUTLANGUAGECHANGE:
+ case SalEvent::InputLanguageChange:
ImplHandleInputLanguageChange( pWindow );
break;
- case SALEVENT_MENUACTIVATE:
- case SALEVENT_MENUDEACTIVATE:
- case SALEVENT_MENUHIGHLIGHT:
- case SALEVENT_MENUCOMMAND:
- case SALEVENT_MENUBUTTONCOMMAND:
+ case SalEvent::MenuActivate:
+ case SalEvent::MenuDeactivate:
+ case SalEvent::MenuHighlight:
+ case SalEvent::MenuCommand:
+ case SalEvent::MenuButtonCommand:
bRet = ImplHandleMenuEvent( pWindow, const_cast<SalMenuEvent *>(static_cast<SalMenuEvent const *>(pEvent)), nEvent );
break;
- case SALEVENT_WHEELMOUSE:
+ case SalEvent::WheelMouse:
bRet = ImplHandleWheelEvent( pWindow, *static_cast<const SalWheelMouseEvent*>(pEvent));
break;
- case SALEVENT_PAINT:
+ case SalEvent::Paint:
{
SalPaintEvent const * pPaintEvt = static_cast<SalPaintEvent const *>(pEvent);
@@ -2457,11 +2457,11 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
}
break;
- case SALEVENT_MOVE:
+ case SalEvent::Move:
ImplHandleMove( pWindow );
break;
- case SALEVENT_RESIZE:
+ case SalEvent::Resize:
{
long nNewWidth;
long nNewHeight;
@@ -2470,31 +2470,31 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
}
break;
- case SALEVENT_MOVERESIZE:
+ case SalEvent::MoveResize:
{
SalFrameGeometry g = pWindow->ImplGetWindowImpl()->mpFrame->GetGeometry();
ImplHandleMoveResize( pWindow, g.nWidth, g.nHeight );
}
break;
- case SALEVENT_CLOSEPOPUPS:
+ case SalEvent::ClosePopups:
{
KillOwnPopups( pWindow );
}
break;
- case SALEVENT_GETFOCUS:
+ case SalEvent::GetFocus:
ImplHandleGetFocus( pWindow );
break;
- case SALEVENT_LOSEFOCUS:
+ case SalEvent::LoseFocus:
ImplHandleLoseFocus( pWindow );
break;
- case SALEVENT_CLOSE:
+ case SalEvent::Close:
ImplHandleClose( pWindow );
break;
- case SALEVENT_SHUTDOWN:
+ case SalEvent::Shutdown:
{
static bool bInQueryExit = false;
if( !bInQueryExit )
@@ -2515,18 +2515,18 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
return false;
}
- case SALEVENT_SETTINGSCHANGED:
- case SALEVENT_PRINTERCHANGED:
- case SALEVENT_DISPLAYCHANGED:
- case SALEVENT_FONTCHANGED:
+ case SalEvent::SettingsChanged:
+ case SalEvent::PrinterChanged:
+ case SalEvent::DisplayChanged:
+ case SalEvent::FontChanged:
ImplHandleSalSettings( nEvent );
break;
- case SALEVENT_USEREVENT:
+ case SalEvent::UserEvent:
ImplHandleUserEvent( const_cast<ImplSVEvent *>(static_cast<ImplSVEvent const *>(pEvent)) );
break;
- case SALEVENT_EXTTEXTINPUT:
+ case SalEvent::ExtTextInput:
{
SalExtTextInputEvent const * pEvt = static_cast<SalExtTextInputEvent const *>(pEvent);
bRet = ImplHandleExtTextInput( pWindow,
@@ -2534,25 +2534,25 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
pEvt->mnCursorPos, pEvt->mnCursorFlags );
}
break;
- case SALEVENT_ENDEXTTEXTINPUT:
+ case SalEvent::EndExtTextInput:
bRet = ImplHandleEndExtTextInput( pWindow );
break;
- case SALEVENT_EXTTEXTINPUTPOS:
+ case SalEvent::ExtTextInputPos:
ImplHandleSalExtTextInputPos( pWindow, const_cast<SalExtTextInputPosEvent *>(static_cast<SalExtTextInputPosEvent const *>(pEvent)) );
break;
- case SALEVENT_INPUTCONTEXTCHANGE:
+ case SalEvent::InputContextChange:
bRet = ImplHandleInputContextChange( pWindow, static_cast<SalInputContextChangeEvent const *>(pEvent)->meLanguage );
break;
- case SALEVENT_SHOWDIALOG:
+ case SalEvent::ShowDialog:
{
ShowDialogId nDialogID = static_cast<ShowDialogId>(reinterpret_cast<sal_IntPtr>(pEvent));
bRet = ImplHandleShowDialog( pWindow, nDialogID );
}
break;
- case SALEVENT_SURROUNDINGTEXTREQUEST:
+ case SalEvent::SurroundingTextRequest:
ImplHandleSalSurroundingTextRequest( pWindow, const_cast<SalSurroundingTextRequestEvent *>(static_cast<SalSurroundingTextRequestEvent const *>(pEvent)) );
break;
- case SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE:
+ case SalEvent::SurroundingTextSelectionChange:
{
SalSurroundingTextSelectionChangeEvent const * pEvt
= static_cast<SalSurroundingTextSelectionChangeEvent const *>(pEvent);
@@ -2561,10 +2561,10 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
pEvt->mnEnd );
// Fallthrough really intended?
}
- case SALEVENT_STARTRECONVERSION:
+ case SalEvent::StartReconversion:
ImplHandleStartReconversion( pWindow );
break;
- case SALEVENT_EXTERNALZOOM:
+ case SalEvent::ExternalZoom:
{
ZoomEvent const * pZoomEvent = static_cast<ZoomEvent const *>(pEvent);
SalWheelMouseEvent aSalWheelMouseEvent;
@@ -2580,7 +2580,7 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
bRet = ImplHandleWheelEvent( pWindow, aSalWheelMouseEvent, true );
}
break;
- case SALEVENT_EXTERNALSCROLL:
+ case SalEvent::ExternalScroll:
{
ScrollEvent const * pScrollEvent = static_cast<ScrollEvent const *>(pEvent);
SalWheelMouseEvent aSalWheelMouseEvent;
@@ -2596,22 +2596,22 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, sal_uInt16 nEvent, const void*
}
}
break;
- case SALEVENT_QUERYCHARPOSITION:
+ case SalEvent::QueryCharPosition:
ImplHandleSalQueryCharPosition( pWindow, const_cast<SalQueryCharPositionEvent *>(static_cast<SalQueryCharPositionEvent const *>(pEvent)) );
break;
- case SALEVENT_SWIPE:
+ case SalEvent::Swipe:
bRet = ImplHandleSwipe(pWindow, *static_cast<const SalSwipeEvent*>(pEvent));
break;
- case SALEVENT_LONGPRESS:
+ case SalEvent::LongPress:
bRet = ImplHandleLongPress(pWindow, *static_cast<const SalLongPressEvent*>(pEvent));
break;
#ifdef DBG_UTIL
default:
- SAL_WARN( "vcl.layout", "ImplWindowFrameProc(): unknown event (" << nEvent << ")" );
+ SAL_WARN( "vcl.layout", "ImplWindowFrameProc(): unknown event (" << (int)nEvent << ")" );
break;
#endif
}
diff --git a/vcl/unx/generic/app/gendisp.cxx b/vcl/unx/generic/app/gendisp.cxx
index 6713403..0c7e00b 100644
--- a/vcl/unx/generic/app/gendisp.cxx
+++ b/vcl/unx/generic/app/gendisp.cxx
@@ -45,7 +45,7 @@ void SalGenericDisplay::deregisterFrame( SalFrame* pFrame )
{
if( it->m_pFrame == pFrame )
{
- if (it->m_nEvent == SALEVENT_USEREVENT) {
+ if (it->m_nEvent == SalEvent::UserEvent) {
delete static_cast<ImplSVEvent *>(it->m_pData);
}
it = m_aUserEvents.erase( it );
@@ -61,14 +61,14 @@ void SalGenericDisplay::deregisterFrame( SalFrame* pFrame )
void SalGenericDisplay::emitDisplayChanged()
{
if( !m_aFrames.empty() )
- m_aFrames.front()->CallCallback( SALEVENT_DISPLAYCHANGED, nullptr );
+ m_aFrames.front()->CallCallback( SalEvent::DisplayChanged, nullptr );
}
bool SalGenericDisplay::DispatchInternalEvent()
{
void* pData = nullptr;
SalFrame* pFrame = nullptr;
- sal_uInt16 nEvent = 0;
+ SalEvent nEvent = SalEvent::NONE;
{
osl::MutexGuard g( m_aEventGuard );
@@ -88,7 +88,7 @@ bool SalGenericDisplay::DispatchInternalEvent()
return pFrame != nullptr;
}
-void SalGenericDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
+void SalGenericDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, SalEvent nEvent )
{
osl::MutexGuard g( m_aEventGuard );
@@ -97,7 +97,7 @@ void SalGenericDisplay::SendInternalEvent( SalFrame* pFrame, void* pData, sal_uI
PostUserEvent(); // wakeup the concrete mainloop
}
-void SalGenericDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, sal_uInt16 nEvent )
+void SalGenericDisplay::CancelInternalEvent( SalFrame* pFrame, void* pData, SalEvent nEvent )
{
osl::MutexGuard g( m_aEventGuard );
if( ! m_aUserEvents.empty() )
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx
index 7fea532..1fda95ef 100644
--- a/vcl/unx/generic/app/i18n_cb.cxx
+++ b/vcl/unx/generic/app/i18n_cb.cxx
@@ -61,7 +61,7 @@ PreeditDoneCallback ( XIC, XPointer client_data, XPointer )
if (pPreeditData->eState == ePreeditStatusActive )
{
if( pPreeditData->pFrame )
- pPreeditData->pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr );
+ pPreeditData->pFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
}
pPreeditData->eState = ePreeditStatusStartPending;
}
@@ -369,9 +369,9 @@ PreeditDrawCallback(XIC ic, XPointer client_data,
pPreeditData->aInputEv.mbOnlyCursor = False;
if ( pPreeditData->eState == ePreeditStatusActive && pPreeditData->pFrame )
- pPreeditData->pFrame->CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&pPreeditData->aInputEv));
+ pPreeditData->pFrame->CallCallback(SalEvent::ExtTextInput, static_cast<void*>(&pPreeditData->aInputEv));
if (pPreeditData->aText.nLength == 0 && pPreeditData->pFrame )
- pPreeditData->pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr );
+ pPreeditData->pFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
if (pPreeditData->aText.nLength == 0)
pPreeditData->eState = ePreeditStatusStartPending;
@@ -389,7 +389,7 @@ GetPreeditSpotLocation(XIC ic, XPointer client_data)
preedit_data_t* pPreeditData = reinterpret_cast<preedit_data_t*>(client_data);
if( pPreeditData->pFrame )
- pPreeditData->pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&aPosEvent));
+ pPreeditData->pFrame->CallCallback(SalEvent::ExtTextInputPos, static_cast<void*>(&aPosEvent));
XPoint point;
point.x = aPosEvent.mnX + aPosEvent.mnWidth;
diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx
index 3e52153..d4102fb 100644
--- a/vcl/unx/generic/app/i18n_ic.cxx
+++ b/vcl/unx/generic/app/i18n_ic.cxx
@@ -48,9 +48,9 @@ static void sendEmptyCommit( SalFrame* pFrame )
aEmptyEv.mnCursorPos = 0;
aEmptyEv.mnCursorFlags = 0;
aEmptyEv.mbOnlyCursor = False;
- pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEmptyEv) );
+ pFrame->CallCallback( SalEvent::ExtTextInput, static_cast<void*>(&aEmptyEv) );
if( ! aDel.isDeleted() )
- pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr );
+ pFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
}
// Constructor / Destructor, the InputContext is bound to the SalFrame, as it
@@ -260,7 +260,7 @@ SalI18N_InputContext::SalI18N_InputContext ( SalFrame *pFrame ) :
{
// spot location
SalExtTextInputPosEvent aPosEvent;
- pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&aPosEvent));
+ pFrame->CallCallback(SalEvent::ExtTextInputPos, static_cast<void*>(&aPosEvent));
static XPoint aSpot;
aSpot.x = aPosEvent.mnX + aPosEvent.mnWidth;
@@ -539,8 +539,8 @@ SalI18N_InputContext::CommitKeyEvent(sal_Unicode* pText, sal_Size nLength)
aTextEvent.mnCursorFlags = 0;
aTextEvent.mbOnlyCursor = False;
- maClientData.pFrame->CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aTextEvent));
- maClientData.pFrame->CallCallback(SALEVENT_ENDEXTTEXTINPUT, nullptr);
+ maClientData.pFrame->CallCallback(SalEvent::ExtTextInput, static_cast<void*>(&aTextEvent));
+ maClientData.pFrame->CallCallback(SalEvent::EndExtTextInput, nullptr);
}
#if OSL_DEBUG_LEVEL > 1
else
@@ -555,7 +555,7 @@ SalI18N_InputContext::UpdateSpotLocation()
return -1;
SalExtTextInputPosEvent aPosEvent;
- maClientData.pFrame->CallCallback(SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&aPosEvent));
+ maClientData.pFrame->CallCallback(SalEvent::ExtTextInputPos, static_cast<void*>(&aPosEvent));
XPoint aSpot;
aSpot.x = aPosEvent.mnX + aPosEvent.mnWidth;
@@ -595,7 +595,7 @@ SalI18N_InputContext::SetICFocus( SalFrame* pFocusFrame )
{
sendEmptyCommit(pFocusFrame);
// begin preedit again
- vcl_sal::getSalDisplay(GetGenericData())->SendInternalEvent( pFocusFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
+ vcl_sal::getSalDisplay(GetGenericData())->SendInternalEvent( pFocusFrame, &maClientData.aInputEv, SalEvent::ExtTextInput );
}
XSetICFocus( maContext );
@@ -612,7 +612,7 @@ SalI18N_InputContext::UnsetICFocus( SalFrame* pFrame )
if ( mbUseable && (maContext != nullptr) )
{
// cancel an eventual event posted to begin preedit again
- vcl_sal::getSalDisplay(GetGenericData())->CancelInternalEvent( maClientData.pFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
+ vcl_sal::getSalDisplay(GetGenericData())->CancelInternalEvent( maClientData.pFrame, &maClientData.aInputEv, SalEvent::ExtTextInput );
maClientData.pFrame = nullptr;
XUnsetICFocus( maContext );
}
@@ -635,7 +635,7 @@ SalI18N_InputContext::EndExtTextInput( EndExtTextInputFlags /*nFlags*/ )
if( static_cast<X11SalFrame*>(maClientData.pFrame)->hasFocus() )
{
// begin preedit again
- vcl_sal::getSalDisplay(GetGenericData())->SendInternalEvent( maClientData.pFrame, &maClientData.aInputEv, SALEVENT_EXTTEXTINPUT );
+ vcl_sal::getSalDisplay(GetGenericData())->SendInternalEvent( maClientData.pFrame, &maClientData.aInputEv, SalEvent::ExtTextInput );
}
}
}
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index e30b227..6ed22df 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -197,7 +197,7 @@ Point XIMStatusWindow::updatePosition()
const SystemEnvData* pParentEnvData = m_pLastParent->GetSystemData();
SalExtTextInputPosEvent aPosEvent;
- m_pLastParent->CallCallback( SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&aPosEvent) );
+ m_pLastParent->CallCallback( SalEvent::ExtTextInputPos, static_cast<void*>(&aPosEvent) );
int x, y;
::Window aChild;
XTranslateCoordinates( static_cast<Display*>(pParentEnvData->pDisplay),
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 09c23a0..460c318 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -1965,7 +1965,7 @@ bool SalX11Display::Dispatch( XEvent *pEvent )
{
std::list< SalFrame* >::const_iterator it;
for( it = m_aFrames.begin(); it != m_aFrames.end(); ++it )
- (*it)->CallCallback( SALEVENT_SETTINGSCHANGED, nullptr );
+ (*it)->CallCallback( SalEvent::SettingsChanged, nullptr );
return false;
}
}
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index c94f800..c995a48 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -217,7 +217,7 @@ void X11SalInstance::PostPrintersChanged()
const std::list< SalFrame* >& rList = pDisp->getFrames();
for( std::list< SalFrame* >::const_iterator it = rList.begin();
it != rList.end(); ++it )
- pDisp->SendInternalEvent( *it, nullptr, SALEVENT_PRINTERCHANGED );
+ pDisp->SendInternalEvent( *it, nullptr, SalEvent::PrinterChanged );
}
GenPspGraphics *X11SalInstance::CreatePrintGraphics()
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index dd5389b..4a95813 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -348,7 +348,7 @@ IMPL_STATIC_LINK_NOARG_TYPED( SessionManagerClient, ShutDownHdl, void*, void )
const std::list< SalFrame* >& rFrames = vcl_sal::getSalDisplay(GetGenericData())->getFrames();
SAL_INFO("vcl.sm", (!rFrames.empty() ? "shutdown on first frame" : "shutdown event but no frame"));
if( !rFrames.empty() )
- rFrames.front()->CallCallback( SALEVENT_SHUTDOWN, nullptr );
+ rFrames.front()->CallCallback( SalEvent::Shutdown, nullptr );
}
void SessionManagerClient::DieProc(
diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx
index 08b92be..09e1492 100644
--- a/vcl/unx/generic/app/wmadaptor.cxx
+++ b/vcl/unx/generic/app/wmadaptor.cxx
@@ -2110,7 +2110,7 @@ void NetWMAdaptor::showFullScreen( X11SalFrame* pFrame, bool bFullScreen ) const
pFrame->maGeometry.nWidth = aSize.Width();
pFrame->maGeometry.nHeight = aSize.Height();
}
- pFrame->CallCallback( SALEVENT_MOVERESIZE, nullptr );
+ pFrame->CallCallback( SalEvent::MoveResize, nullptr );
}
}
else WMAdaptor::showFullScreen( pFrame, bFullScreen );
diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx
index 2b54066..2eeb49e 100644
--- a/vcl/unx/generic/gdi/salgdi2.cxx
+++ b/vcl/unx/generic/gdi/salgdi2.cxx
@@ -141,7 +141,7 @@ void X11SalGraphics::YieldGraphicsExpose()
while( XCheckTypedWindowEvent( pDisplay, aWindow, Expose, &aEvent ) )
{
SalPaintEvent aPEvt( aEvent.xexpose.x, aEvent.xexpose.y, aEvent.xexpose.width+1, aEvent.xexpose.height+1 );
- pFrame->CallCallback( SALEVENT_PAINT, &aPEvt );
+ pFrame->CallCallback( SalEvent::Paint, &aPEvt );
}
do
@@ -156,7 +156,7 @@ void X11SalGraphics::YieldGraphicsExpose()
if( pFrame )
{
SalPaintEvent aPEvt( aEvent.xgraphicsexpose.x, aEvent.xgraphicsexpose.y, aEvent.xgraphicsexpose.width+1, aEvent.xgraphicsexpose.height+1 );
- pFrame->CallCallback( SALEVENT_PAINT, &aPEvt );
+ pFrame->CallCallback( SalEvent::Paint, &aPEvt );
}
} while( aEvent.xgraphicsexpose.count != 0 );
}
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 21fcebd..ca95054 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -1281,7 +1281,7 @@ void X11SalFrame::Show( bool bVisible, bool bNoActivate )
);
}
}
- CallCallback( SALEVENT_RESIZE, nullptr );
+ CallCallback( SalEvent::Resize, nullptr );
/*
* sometimes a message box/dialogue is brought up when a frame is not mapped
@@ -1978,11 +1978,11 @@ void X11SalFrame::SetPosSize( const Rectangle &rPosSize )
updateScreenNumber();
if( bSized && ! bMoved )
- CallCallback( SALEVENT_RESIZE, nullptr );
+ CallCallback( SalEvent::Resize, nullptr );
else if( bMoved && ! bSized )
- CallCallback( SALEVENT_MOVE, nullptr );
+ CallCallback( SalEvent::Move, nullptr );
else
- CallCallback( SALEVENT_MOVERESIZE, nullptr );
+ CallCallback( SalEvent::MoveResize, nullptr );
// allow the external status window to reposition
if (mbInputFocus && mpInputContext != nullptr)
@@ -2246,16 +2246,16 @@ X11SalFrame::HandleExtTextEvent (XClientMessageEvent *pEvent)
#else
void* pExtTextEvent = reinterpret_cast<void*>(pEvent->data.l[0]);
#endif
- sal_uInt16 nExtTextEventType = sal_uInt16(pEvent->data.l[2]);
+ SalEvent nExtTextEventType = SalEvent(pEvent->data.l[2]);
CallCallback(nExtTextEventType, pExtTextEvent);
switch (nExtTextEventType)
{
- case SALEVENT_ENDEXTTEXTINPUT:
+ case SalEvent::EndExtTextInput:
break;
- case SALEVENT_EXTTEXTINPUT:
+ case SalEvent::ExtTextInput:
break;
default:
@@ -2586,7 +2586,7 @@ Bool compressWheelEvents( Display*, XEvent* event, XPointer p )
long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
{
SalMouseEvent aMouseEvt = {0, 0, 0, 0, 0};
- sal_uInt16 nEvent = 0;
+ SalEvent nEvent = SalEvent::NONE;
bool bClosePopups = false;
if( nVisibleFloats && pEvent->type == EnterNotify )
@@ -2618,8 +2618,8 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
aMouseEvt.mnButton = 0;
nEvent = LeaveNotify == pEvent->type
- ? SALEVENT_MOUSELEAVE
- : SALEVENT_MOUSEMOVE;
+ ? SalEvent::MouseLeave
+ : SalEvent::MouseMove;
}
else if( pEvent->type == MotionNotify )
{
@@ -2630,7 +2630,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
aMouseEvt.mnButton = 0;
- nEvent = SALEVENT_MOUSEMOVE;
+ nEvent = SalEvent::MouseMove;
if( nVisibleFloats > 0 && mpParent )
{
Cursor aCursor = mpParent->GetCursor();
@@ -2740,8 +2740,8 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
aMouseEvt.mnButton = MOUSE_RIGHT;
nEvent = ButtonPress == pEvent->type
- ? SALEVENT_MOUSEBUTTONDOWN
- : SALEVENT_MOUSEBUTTONUP;
+ ? SalEvent::MouseButtonDown
+ : SalEvent::MouseButtonUp;
}
else if( pEvent->xbutton.button == Button4 ||
pEvent->xbutton.button == Button5 ||
@@ -2787,7 +2787,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
aWheelEvt.mnCode = sal_GetCode( pEvent->xbutton.state );
aWheelEvt.mbHorz = bHoriz;
- nEvent = SALEVENT_WHEELMOUSE;
+ nEvent = SalEvent::WheelMouse;
// --- RTL --- (mirror mouse pos)
if( AllSettings::GetLayoutRTL() )
@@ -2797,7 +2797,7 @@ long X11SalFrame::HandleMouseEvent( XEvent *pEvent )
}
int nRet = 0;
- if( nEvent == SALEVENT_MOUSELEAVE
+ if( nEvent == SalEvent::MouseLeave
|| ( aMouseEvt.mnX < nWidth_ && aMouseEvt.mnX > -1 &&
aMouseEvt.mnY < nHeight_ && aMouseEvt.mnY > -1 )
|| pDisplay_->MouseCaptured( this )
@@ -2871,7 +2871,7 @@ void X11SalFrame::beginUnicodeSequence()
aEv.mnCursorFlags = 0;
aEv.mbOnlyCursor = false;
- CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEv));
+ CallCallback(SalEvent::ExtTextInput, static_cast<void*>(&aEv));
}
}
@@ -2900,7 +2900,7 @@ bool X11SalFrame::appendUnicodeSequence( sal_Unicode c )
aEv.mnCursorFlags = 0;
aEv.mbOnlyCursor = false;
- CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEv));
+ CallCallback(SalEvent::ExtTextInput, static_cast<void*>(&aEv));
bRet = true;
}
else
@@ -2931,13 +2931,13 @@ bool X11SalFrame::endUnicodeSequence()
aEv.mnCursorPos = 0;
aEv.mnCursorFlags = 0;
aEv.mbOnlyCursor = false;
- CallCallback(SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEv));
+ CallCallback(SalEvent::ExtTextInput, static_cast<void*>(&aEv));
}
}
bool bWasInput = !rSeq.isEmpty();
rSeq.clear();
if( bWasInput && ! aDeleteWatch.isDeleted() )
- CallCallback(SALEVENT_ENDEXTTEXTINPUT, nullptr);
+ CallCallback(SalEvent::EndExtTextInput, nullptr);
return bWasInput;
}
@@ -3123,7 +3123,7 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
aModEvt.mnCode = nModCode;
aModEvt.mnTime = pEvent->time;
- int nRet = CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt );
+ int nRet = CallCallback( SalEvent::KeyModChange, &aModEvt );
return nRet;
}
@@ -3248,11 +3248,11 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
if( KeyRelease == pEvent->type )
{
- CallCallback( SALEVENT_KEYUP, &aKeyEvt );
+ CallCallback( SalEvent::KeyUp, &aKeyEvt );
}
else
{
- if ( ! CallCallback(SALEVENT_KEYINPUT, &aKeyEvt) )
+ if ( ! CallCallback(SalEvent::KeyInput, &aKeyEvt) )
{
// independent layer doesn't want to handle key-event, so check
// whether the keycode may have an alternate meaning
@@ -3262,7 +3262,7 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
aKeyEvt.mnCode = aAlternate.nKeyCode | nModCode;
if( aAlternate.nCharCode )
aKeyEvt.mnCharCode = aAlternate.nCharCode;
- CallCallback(SALEVENT_KEYINPUT, &aKeyEvt);
+ CallCallback(SalEvent::KeyInput, &aKeyEvt);
}
}
}
@@ -3324,7 +3324,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
mbInputFocus = True;
ImplSVData* pSVData = ImplGetSVData();
- long nRet = CallCallback( SALEVENT_GETFOCUS, nullptr );
+ long nRet = CallCallback( SalEvent::GetFocus, nullptr );
if ((mpParent != nullptr && nStyle_ == SalFrameStyleFlags::NONE)
&& pSVData->maWinData.mpFirstFloat )
{
@@ -3339,7 +3339,7 @@ long X11SalFrame::HandleFocusEvent( XFocusChangeEvent *pEvent )
mbInputFocus = False;
mbSendExtKeyModChange = false;
mnExtKeyMod = 0;
- return CallCallback( SALEVENT_LOSEFOCUS, nullptr );
+ return CallCallback( SalEvent::LoseFocus, nullptr );
}
}
@@ -3384,7 +3384,7 @@ long X11SalFrame::HandleExposeEvent( XEvent *pEvent )
SalPaintEvent aPEvt( maPaintRegion.Left(), maPaintRegion.Top(), maPaintRegion.GetWidth(), maPaintRegion.GetHeight() );
- CallCallback( SALEVENT_PAINT, &aPEvt );
+ CallCallback( SalEvent::Paint, &aPEvt );
maPaintRegion = Rectangle();
return 1;
@@ -3518,7 +3518,7 @@ long X11SalFrame::HandleSizeEvent( XConfigureEvent *pEvent )
{
maGeometry.nX = pEvent->x;
maGeometry.nY = pEvent->y;
- CallCallback( SALEVENT_MOVE, nullptr );
+ CallCallback( SalEvent::Move, nullptr );
}
return 1;
}
@@ -3553,11 +3553,11 @@ long X11SalFrame::HandleSizeEvent( XConfigureEvent *pEvent )
RestackChildren();
if( bSized && ! bMoved )
- CallCallback( SALEVENT_RESIZE, nullptr );
+ CallCallback( SalEvent::Resize, nullptr );
else if( bMoved && ! bSized )
- CallCallback( SALEVENT_MOVE, nullptr );
+ CallCallback( SalEvent::Move, nullptr );
else if( bMoved && bSized )
- CallCallback( SALEVENT_MOVERESIZE, nullptr );
+ CallCallback( SalEvent::MoveResize, nullptr );
return 1;
}
@@ -3745,7 +3745,7 @@ long X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent )
}
}
if( bResized )
- CallCallback( SALEVENT_RESIZE, nullptr );
+ CallCallback( SalEvent::Resize, nullptr );
GetGenericData()->ErrorTrapPop();
@@ -3925,7 +3925,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
nRet = 1;
if ( mpInputContext != nullptr )
mpInputContext->Map( this );
- CallCallback( SALEVENT_RESIZE, nullptr );
+ CallCallback( SalEvent::Resize, nullptr );
bool bSetFocus = m_bSetFocusOnMap;
/* another workaround for sawfish: if a transient window for the same parent is shown
@@ -3984,7 +3984,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
nRet = 1;
if ( mpInputContext != nullptr )
mpInputContext->Unmap( this );
- CallCallback( SALEVENT_RESIZE, nullptr );
+ CallCallback( SalEvent::Resize, nullptr );
}
break;
diff --git a/vcl/unx/generic/window/salobj.cxx b/vcl/unx/generic/window/salobj.cxx
index 7a3412f..23e531a 100644
--- a/vcl/unx/generic/window/salobj.cxx
+++ b/vcl/unx/generic/window/salobj.cxx
@@ -427,7 +427,7 @@ bool X11SalObject::Dispatch( XEvent* pEvent )
aEvt.mnTime = pEvent->xbutton.time;
aEvt.mnCode = sal_GetCode( pEvent->xbutton.state );
aEvt.mnButton = 0;
- sal_uInt16 nEvent = 0;
+ SalEvent nEvent = SalEvent::NONE;
if( pEvent->type == ButtonPress ||
pEvent->type == ButtonRelease )
{
@@ -438,13 +438,13 @@ bool X11SalObject::Dispatch( XEvent* pEvent )
case Button3: aEvt.mnButton = MOUSE_RIGHT;break;
}
nEvent = (pEvent->type == ButtonPress) ?
- SALEVENT_MOUSEBUTTONDOWN :
- SALEVENT_MOUSEBUTTONUP;
+ SalEvent::MouseButtonDown :
+ SalEvent::MouseButtonUp;
}
else if( pEvent->type == EnterNotify )
- nEvent = SALEVENT_MOUSELEAVE;
+ nEvent = SalEvent::MouseLeave;
else
- nEvent = SALEVENT_MOUSEMOVE;
+ nEvent = SalEvent::MouseMove;
pObject->mpParent->CallCallback( nEvent, &aEvt );
}
else
diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx
index 8dc7908..8db0513 100644
--- a/vcl/unx/gtk/gtkdata.cxx
+++ b/vcl/unx/gtk/gtkdata.cxx
@@ -138,7 +138,7 @@ GdkFilterReturn GtkSalDisplay::filterGdkEvent( GdkXEvent* sys_event,
! m_aFrames.empty()
)
{
- SendInternalEvent( m_aFrames.front(), nullptr, SALEVENT_SETTINGSCHANGED );
+ SendInternalEvent( m_aFrames.front(), nullptr, SalEvent::SettingsChanged );
}
// let's see if one of our frames wants to swallow these events
// get the frame
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index e823172..c2f3c75 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -407,7 +407,7 @@ void GtkSalFrame::doKeyCallback( guint state,
if( bDown )
{
- bool bHandled = CallCallback( SALEVENT_KEYINPUT, &aEvent );
+ bool bHandled = CallCallback( SalEvent::KeyInput, &aEvent );
// #i46889# copy AlternateKeyCode handling from generic plugin
if( ! bHandled )
{
@@ -417,16 +417,16 @@ void GtkSalFrame::doKeyCallback( guint state,
aEvent.mnCode = aAlternate.nKeyCode;
if( aAlternate.nCharCode )
aEvent.mnCharCode = aAlternate.nCharCode;
- CallCallback( SALEVENT_KEYINPUT, &aEvent );
+ CallCallback( SalEvent::KeyInput, &aEvent );
}
}
if( bSendRelease && ! aDel.isDeleted() )
{
- CallCallback( SALEVENT_KEYUP, &aEvent );
+ CallCallback( SalEvent::KeyUp, &aEvent );
}
}
else
- CallCallback( SALEVENT_KEYUP, &aEvent );
+ CallCallback( SalEvent::KeyUp, &aEvent );
}
GtkSalFrame::GtkSalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle )
@@ -1644,7 +1644,7 @@ void GtkSalFrame::Show( bool bVisible, bool bNoActivate )
// the display connection used for clipboard and our connection
Flush();
}
- CallCallback( SALEVENT_RESIZE, nullptr );
+ CallCallback( SalEvent::Resize, nullptr );
TriggerPaintEvent();
}
}
@@ -1792,11 +1792,11 @@ void GtkSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
AllocateFrame();
if( bSized && ! bMoved )
- CallCallback( SALEVENT_RESIZE, nullptr );
+ CallCallback( SalEvent::Resize, nullptr );
else if( bMoved && ! bSized )
- CallCallback( SALEVENT_MOVE, nullptr );
+ CallCallback( SalEvent::Move, nullptr );
else if( bMoved && bSized )
- CallCallback( SALEVENT_MOVERESIZE, nullptr );
+ CallCallback( SalEvent::MoveResize, nullptr );
if (bSized)
TriggerPaintEvent();
@@ -1852,7 +1852,7 @@ void GtkSalFrame::SetWindowState( const SalFrameState* pState )
m_nState = GdkWindowState( m_nState | GDK_WINDOW_STATE_MAXIMIZED );
m_aRestorePosSize = Rectangle( Point( pState->mnX, pState->mnY ),
Size( pState->mnWidth, pState->mnHeight ) );
- CallCallback( SALEVENT_RESIZE, nullptr );
+ CallCallback( SalEvent::Resize, nullptr );
}
else if( pState->mnMask & (WindowStateMask::X | WindowStateMask::Y |
WindowStateMask::Width | WindowStateMask::Height ) )
@@ -2072,7 +2072,7 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, int eType, Rectangle *pSiz
m_bDefaultPos = m_bDefaultSize = false;
updateScreenNumber();
- CallCallback( SALEVENT_MOVERESIZE, nullptr );
+ CallCallback( SalEvent::MoveResize, nullptr );
if( bVisible )
Show( true );
@@ -2708,7 +2708,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent )
maGeometry.nWidth = pEvent->xconfigure.width;
maGeometry.nHeight = pEvent->xconfigure.height;
setMinMaxSize();
- getDisplay()->SendInternalEvent( this, nullptr, SALEVENT_RESIZE );
+ getDisplay()->SendInternalEvent( this, nullptr, SalEvent::Resize );
}
}
else if( m_pForeignTopLevel && pEvent->xconfigure.window == m_aForeignTopLevelWindow )
@@ -2727,7 +2727,7 @@ bool GtkSalFrame::Dispatch( const XEvent* pEvent )
{
maGeometry.nX = x;
maGeometry.nY = y;
- getDisplay()->SendInternalEvent( this, nullptr, SALEVENT_MOVE );
+ getDisplay()->SendInternalEvent( this, nullptr, SalEvent::Move );
}
}
}
@@ -2760,14 +2760,14 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
SalMouseEvent aEvent;
- sal_uInt16 nEventType = 0;
+ SalEvent nEventType = SalEvent::NONE;
switch( pEvent->type )
{
case GDK_BUTTON_PRESS:
- nEventType = SALEVENT_MOUSEBUTTONDOWN;
+ nEventType = SalEvent::MouseButtonDown;
break;
case GDK_BUTTON_RELEASE:
- nEventType = SALEVENT_MOUSEBUTTONUP;
+ nEventType = SalEvent::MouseButtonUp;
break;
default:
return false;
@@ -2838,7 +2838,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
{
pThis->maGeometry.nX = frame_x;
pThis->maGeometry.nY = frame_y;
- pThis->CallCallback( SALEVENT_MOVE, nullptr );
+ pThis->CallCallback( SalEvent::Move, nullptr );
}
}
}
@@ -2875,7 +2875,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
if( AllSettings::GetLayoutRTL() )
aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
- pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ pThis->CallCallback( SalEvent::WheelMouse, &aEvent );
return true;
}
@@ -2897,7 +2897,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
vcl::DeletionListener aDel( pThis );
- pThis->CallCallback( SALEVENT_MOUSEMOVE, &aEvent );
+ pThis->CallCallback( SalEvent::MouseMove, &aEvent );
if( ! aDel.isDeleted() )
{
@@ -2907,7 +2907,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
{
pThis->maGeometry.nX = frame_x;
pThis->maGeometry.nY = frame_y;
- pThis->CallCallback( SALEVENT_MOVE, nullptr );
+ pThis->CallCallback( SalEvent::Move, nullptr );
}
if( ! aDel.isDeleted() )
@@ -2932,7 +2932,7 @@ gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpoi
aEvent.mnCode = GetMouseModCode( pEvent->state );
aEvent.mnButton = 0;
- pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent );
+ pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SalEvent::MouseMove : SalEvent::MouseLeave, &aEvent );
return true;
}
@@ -2944,7 +2944,7 @@ gboolean GtkSalFrame::signalExpose( GtkWidget*, GdkEventExpose* pEvent, gpointer
struct SalPaintEvent aEvent( pEvent->area.x, pEvent->area.y, pEvent->area.width, pEvent->area.height, OpenGLHelper::isVCLOpenGLEnabled() );
- pThis->CallCallback( SALEVENT_PAINT, &aEvent );
+ pThis->CallCallback( SalEvent::Paint, &aEvent );
return false;
}
@@ -3019,11 +3019,11 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp
pThis->AllocateFrame();
if( bMoved && bSized )
- pThis->CallCallback( SALEVENT_MOVERESIZE, nullptr );
+ pThis->CallCallback( SalEvent::MoveResize, nullptr );
else if( bMoved )
- pThis->CallCallback( SALEVENT_MOVE, nullptr );
+ pThis->CallCallback( SalEvent::Move, nullptr );
else if( bSized )
- pThis->CallCallback( SALEVENT_RESIZE, nullptr );
+ pThis->CallCallback( SalEvent::Resize, nullptr );
if (bSized)
pThis->TriggerPaintEvent();
@@ -3064,7 +3064,7 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f
// in the meantime do not propagate focus get/lose if floats are open
if( m_nFloats == 0 )
- pThis->CallCallback( pEvent->in ? SALEVENT_GETFOCUS : SALEVENT_LOSEFOCUS, nullptr );
+ pThis->CallCallback( pEvent->in ? SalEvent::GetFocus : SalEvent::LoseFocus, nullptr );
return false;
}
@@ -3127,7 +3127,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget *pWidget, GdkEvent*, gpointer frame )
GetGenericData()->ErrorTrapPop();
}
- pThis->CallCallback( SALEVENT_RESIZE, nullptr );
+ pThis->CallCallback( SalEvent::Resize, nullptr );
pThis->TriggerPaintEvent();
return false;
@@ -3137,7 +3137,7 @@ gboolean GtkSalFrame::signalUnmap( GtkWidget*, GdkEvent*, gpointer frame )
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
- pThis->CallCallback( SALEVENT_RESIZE, nullptr );
+ pThis->CallCallback( SalEvent::Resize, nullptr );
return false;
}
@@ -3235,7 +3235,7 @@ gboolean GtkSalFrame::signalKey( GtkWidget*, GdkEventKey* pEvent, gpointer frame
aModEvt.mnTime = pEvent->time;
aModEvt.mnModKeyCode = pThis->m_nKeyModifiers;
- pThis->CallCallback( SALEVENT_KEYMODCHANGE, &aModEvt );
+ pThis->CallCallback( SalEvent::KeyModChange, &aModEvt );
}
else
@@ -3262,7 +3262,7 @@ gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
- pThis->CallCallback( SALEVENT_CLOSE, nullptr );
+ pThis->CallCallback( SalEvent::Close, nullptr );
return true;
}
@@ -3278,10 +3278,10 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram
if( pPrevious != nullptr )
{
// signalStyleSet does NOT usually have the gdk lock
- // so post user event to safely dispatch the SALEVENT_SETTINGSCHANGED
+ // so post user event to safely dispatch the SalEvent::SettingsChanged
// note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
- GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_SETTINGSCHANGED );
- GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_FONTCHANGED );
+ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::SettingsChanged );
+ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::FontChanged );
}
/* #i64117# gtk sets a nice background pixmap
@@ -3311,7 +3311,7 @@ gboolean GtkSalFrame::signalWindowState( GtkWidget*, GdkEvent* pEvent, gpointer
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
if( (pThis->m_nState & GDK_WINDOW_STATE_ICONIFIED) != (pEvent->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED ) )
{
- GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_RESIZE );
+ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::Resize );
pThis->TriggerPaintEvent();
}
@@ -3371,7 +3371,7 @@ GtkSalFrame::IMHandler::IMHandler( GtkSalFrame* pFrame )
GtkSalFrame::IMHandler::~IMHandler()
{
// cancel an eventual event posted to begin preedit again
- GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT );
+ GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SalEvent::ExtTextInput );
deleteIMContext();
}
@@ -3418,13 +3418,13 @@ void GtkSalFrame::IMHandler::deleteIMContext()
void GtkSalFrame::IMHandler::doCallEndExtTextInput()
{
m_aInputEvent.mpTextAttr = nullptr;
- m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr );
+ m_pFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
}
void GtkSalFrame::IMHandler::updateIMSpotLocation()
{
SalExtTextInputPosEvent aPosEvent;
- m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, static_cast<void*>(&aPosEvent) );
+ m_pFrame->CallCallback( SalEvent::ExtTextInputPos, static_cast<void*>(&aPosEvent) );
GdkRectangle aArea;
aArea.x = aPosEvent.mnX;
aArea.y = aPosEvent.mnY;
@@ -3446,9 +3446,9 @@ void GtkSalFrame::IMHandler::sendEmptyCommit()
aEmptyEv.mnCursorPos = 0;
aEmptyEv.mnCursorFlags = 0;
aEmptyEv.mbOnlyCursor = False;
- m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void*>(&aEmptyEv) );
+ m_pFrame->CallCallback( SalEvent::ExtTextInput, static_cast<void*>(&aEmptyEv) );
if( ! aDel.isDeleted() )
- m_pFrame->CallCallback( SALEVENT_ENDEXTTEXTINPUT, nullptr );
+ m_pFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
}
void GtkSalFrame::IMHandler::endExtTextInput( EndExtTextInputFlags /*nFlags*/ )
@@ -3467,7 +3467,7 @@ void GtkSalFrame::IMHandler::endExtTextInput( EndExtTextInputFlags /*nFlags*/ )
if( m_bFocused )
{
// begin preedit again
- GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT );
+ GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SalEvent::ExtTextInput );
}
}
}
@@ -3485,7 +3485,7 @@ void GtkSalFrame::IMHandler::focusChanged( bool bFocusIn )
{
sendEmptyCommit();
// begin preedit again
- GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT );
+ GtkSalFrame::getDisplay()->SendInternalEvent( m_pFrame, &m_aInputEvent, SalEvent::ExtTextInput );
}
}
else
@@ -3494,7 +3494,7 @@ void GtkSalFrame::IMHandler::focusChanged( bool bFocusIn )
gtk_im_context_focus_out( m_pIMContext );
GetGenericData()->ErrorTrapPop();
// cancel an eventual event posted to begin preedit again
- GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SALEVENT_EXTTEXTINPUT );
+ GtkSalFrame::getDisplay()->CancelInternalEvent( m_pFrame, &m_aInputEvent, SalEvent::ExtTextInput );
}
}
@@ -3645,7 +3645,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* pContext, gchar* pTex
* never was a preedit and the text is only one character.
*
* In this case there the last ExtText event must have been
- * SALEVENT_ENDEXTTEXTINPUT, either because of a regular commit
+ * SalEvent::EndExtTextInput, either because of a regular commit
* or because there never was a preedit.
*/
bool bSingleCommit = false;
@@ -3665,7 +3665,7 @@ void GtkSalFrame::IMHandler::signalIMCommit( GtkIMContext* pContext, gchar* pTex
}
if( ! bSingleCommit )
{
- pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void*>(&pThis->m_aInputEvent));
+ pThis->m_pFrame->CallCallback( SalEvent::ExtTextInput, static_cast<void*>(&pThis->m_aInputEvent));
if( ! aDel.isDeleted() )
pThis->doCallEndExtTextInput();
}
@@ -3790,7 +3790,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
SolarMutexGuard aGuard;
vcl::DeletionListener aDel( pThis->m_pFrame );
- pThis->m_pFrame->CallCallback( SALEVENT_EXTTEXTINPUT, static_cast<void*>(&pThis->m_aInputEvent));
+ pThis->m_pFrame->CallCallback( SalEvent::ExtTextInput, static_cast<void*>(&pThis->m_aInputEvent));
if( bEndPreedit && ! aDel.isDeleted() )
pThis->doCallEndExtTextInput();
if( ! aDel.isDeleted() )
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index c37911f..2630aa1 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -434,7 +434,7 @@ void GtkSalFrame::doKeyCallback( guint state,
if( bDown )
{
- bool bHandled = CallCallback( SALEVENT_KEYINPUT, &aEvent );
+ bool bHandled = CallCallback( SalEvent::KeyInput, &aEvent );
// #i46889# copy AlternateKeyCode handling from generic plugin
if( ! bHandled )
{
@@ -444,16 +444,16 @@ void GtkSalFrame::doKeyCallback( guint state,
aEvent.mnCode = aAlternate.nKeyCode;
if( aAlternate.nCharCode )
aEvent.mnCharCode = aAlternate.nCharCode;
- CallCallback( SALEVENT_KEYINPUT, &aEvent );
+ CallCallback( SalEvent::KeyInput, &aEvent );
}
}
if( bSendRelease && ! aDel.isDeleted() )
{
- CallCallback( SALEVENT_KEYUP, &aEvent );
+ CallCallback( SalEvent::KeyUp, &aEvent );
}
}
else
- CallCallback( SALEVENT_KEYUP, &aEvent );
+ CallCallback( SalEvent::KeyUp, &aEvent );
}
GtkSalFrame::GtkSalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle )
@@ -2540,14 +2540,14 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
SalMouseEvent aEvent;
- sal_uInt16 nEventType = 0;
+ SalEvent nEventType = SalEvent::NONE;
switch( pEvent->type )
{
case GDK_BUTTON_PRESS:
- nEventType = SALEVENT_MOUSEBUTTONDOWN;
+ nEventType = SalEvent::MouseButtonDown;
break;
case GDK_BUTTON_RELEASE:
- nEventType = SALEVENT_MOUSEBUTTONUP;
+ nEventType = SalEvent::MouseButtonUp;
break;
default:
return false;
@@ -2618,7 +2618,7 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
{
pThis->maGeometry.nX = frame_x;
pThis->maGeometry.nY = frame_y;
- pThis->CallCallback( SALEVENT_MOVE, nullptr );
+ pThis->CallCallback( SalEvent::Move, nullptr );
}
}
}
@@ -2684,7 +2684,7 @@ gboolean GtkSalFrame::signalScroll( GtkWidget*, GdkEvent* pEvent, gpointer frame
if( AllSettings::GetLayoutRTL() )
aEvent.mnX = pThis->maGeometry.nWidth-1-aEvent.mnX;
- pThis->CallCallback( SALEVENT_WHEELMOUSE, &aEvent );
+ pThis->CallCallback( SalEvent::WheelMouse, &aEvent );
return true;
}
@@ -2707,7 +2707,7 @@ void GtkSalFrame::gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdo
aEvent.mnX = x;
aEvent.mnY = y;
- pThis->CallCallback(SALEVENT_SWIPE, &aEvent);
+ pThis->CallCallback(SalEvent::Swipe, &aEvent);
}
}
@@ -2725,7 +2725,7 @@ void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame)
aEvent.mnX = x;
aEvent.mnY = y;
- pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent);
+ pThis->CallCallback(SalEvent::LongPress, &aEvent);
}
}
@@ -2748,7 +2748,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
vcl::DeletionListener aDel( pThis );
- pThis->CallCallback( SALEVENT_MOUSEMOVE, &aEvent );
+ pThis->CallCallback( SalEvent::MouseMove, &aEvent );
if( ! aDel.isDeleted() )
{
@@ -2758,7 +2758,7 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
{
pThis->maGeometry.nX = frame_x;
pThis->maGeometry.nY = frame_y;
- pThis->CallCallback( SALEVENT_MOVE, nullptr );
+ pThis->CallCallback( SalEvent::Move, nullptr );
}
if( ! aDel.isDeleted() )
@@ -2783,7 +2783,7 @@ gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpoi
aEvent.mnCode = GetMouseModCode( pEvent->state );
aEvent.mnButton = 0;
- pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SALEVENT_MOUSEMOVE : SALEVENT_MOUSELEAVE, &aEvent );
+ pThis->CallCallback( (pEvent->type == GDK_ENTER_NOTIFY) ? SalEvent::MouseMove : SalEvent::MouseLeave, &aEvent );
return true;
}
@@ -2830,7 +2830,7 @@ void GtkSalFrame::sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer
pThis->maGeometry.nWidth = pAllocation->width;
pThis->maGeometry.nHeight = pAllocation->height;
pThis->AllocateFrame();
- pThis->CallCallback( SALEVENT_RESIZE, nullptr );
+ pThis->CallCallback( SalEvent::Resize, nullptr );
pThis->TriggerPaintEvent();
}
@@ -2863,7 +2863,7 @@ gboolean GtkSalFrame::signalConfigure(GtkWidget*, GdkEventConfigure* pEvent, gpo
pThis->updateScreenNumber();
if (bMoved)
- pThis->CallCallback(SALEVENT_MOVE, nullptr);
+ pThis->CallCallback(SalEvent::Move, nullptr);
return false;
}
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list