20 #include <config_features.h>
22 #include <osl/file.hxx>
23 #include <osl/thread.hxx>
24 #include <osl/module.hxx>
25 #include <rtl/ustrbuf.hxx>
62 #include <strings.hrc>
63 #include <strings.hxx>
64 #if OSL_DEBUG_LEVEL > 0
68 #include <com/sun/star/uno/Reference.h>
69 #include <com/sun/star/awt/XToolkit.hpp>
72 #include <osl/process.h>
76 #include <string_view>
135 , maKeyEvent(rKeyEvent)
140 , maMouseEvent(rMouseEvent)
147 , maGestureEvent(rGestureEvent)
156 return pSVData->
mpApp;
162 OUString aVar(
"LIBO_VERSION"), aValue(LIBO_VERSION_DOTTED);
163 osl_setEnvironment(aVar.pData, aValue.pData);
178 SAL_WARN(
"vcl",
"Application is a base class and should be overridden.");
188 return pAppWin->
Close();
211 return static_cast<sal_uInt16
>(osl_getCommandArgCount());
217 osl_getCommandArg( nParam, &aParam.pData );
232 OUString aAppFileName;
233 OUString aExeFileName;
234 osl_getExecutableFile(&aExeFileName.pData);
237 osl::FileBase::getSystemPathFromFileURL(aExeFileName, aAppFileName);
251 Abort(
"Unknown Error");
261 #if OSL_DEBUG_LEVEL > 0
262 bool dumpCore =
true;
264 bool dumpCore =
false;
266 for (sal_uInt16
i = 0;
i != n; ++
i) {
287 return &ReservedKeys[i];
319 const std::vector<vcl::LOKPayloadItem>& )
const
342 if (xWin->IsVisible())
349 bool InjectKeyEvent(
SvStream& rStream)
366 sal_uInt16
nCode, nCharCode;
372 KeyEvent aVCLKeyEvt(nCharCode, nCode);
378 void CloseDialogsAndQuit()
390 mpEventTestingIdle->Start();
406 CloseDialogsAndQuit();
414 SAL_INFO(
"vcl.eventtesting",
"Event Input exhausted, exit next cycle");
448 SAL_WARN(
"vcl.schedule",
"Can't omit DoExecute when running on system event loop!");
464 SAL_INFO(
"vcl.schedule",
"Enter ImplYield: " << (i_bWait ?
"wait" :
"no wait") <<
465 ": " << (i_bAllEvents ?
"all events" :
"one event"));
481 SAL_INFO(
"vcl.schedule",
"Leave ImplYield with return " << bProcessedEvent );
482 return bProcessedEvent;
490 SAL_WARN(
"vcl.schedule",
"Application::Reschedule(" << i_bAllEvents <<
")");
506 if (0 == ++nSanity % 1000)
508 SAL_WARN(
"vcl.schedule",
"ProcessEventsToIdle: " << nSanity);
511 #if OSL_DEBUG_LEVEL > 0
518 for (
int nTaskPriority = 0; nTaskPriority <
PRIO_COUNT; ++nTaskPriority)
521 while (pSchedulerData)
524 if (pSchedulerData->
mpTask)
535 pSchedulerData = pSchedulerData->
mpNext;
555 SAL_WARN(
"vcl.schedule",
"Application::Yield()");
673 InitSettings(pSVData);
686 if (
bool(nChangeFlags) )
717 pClientWin = pTempWin;
724 pFrame = pFrame->
mpWindowImpl->mpFrameData->mpNextFrame;
739 (pVirDev->
GetDPIX() == nOldDPIX) &&
740 (pVirDev->
GetDPIY() == nOldDPIY) )
752 pVirDev = pVirDev->
mpNext;
765 InitSettings(pSVData);
802 pFrame = pFrame->
mpWindowImpl->mpFrameData->mpNextFrame;
842 rVec.erase( std::remove(rVec.begin(), rVec.end(), rKeyListener ), rVec.end() );
855 bool bProcessed =
false;
860 if( rLink.Call( aEvent ) )
874 if( pWin && pKeyEvent )
876 std::unique_ptr<ImplPostEventData> pPostEventData(
new ImplPostEventData( nEvent, pWin, *pKeyEvent ));
880 pPostEventData.get() );
884 pPostEventData->mnEventId = nEventId;
897 if (pWin && pGestureEvent)
899 Point aTransformedPosition(pGestureEvent->
mnX, pGestureEvent->
mnY);
905 sal_Int32(aTransformedPosition.X()),
906 sal_Int32(aTransformedPosition.Y()),
912 std::unique_ptr<ImplPostEventData> pPostEventData(
new ImplPostEventData(nEvent, pWin, aGestureEvent));
916 pPostEventData.get());
920 pPostEventData->mnEventId = nEventId;
930 bool bSuccess =
false;
949 aMouseEvent.
mnX, aMouseEvent.
mnY,
958 aMouseEvent.
mnX, aMouseEvent.
mnY,
974 aMouseEvent.
mnX, aMouseEvent.
mnY,
988 SAL_WARN(
"vcl.layout",
"Application::HandleMouseEvent unknown event (" << static_cast<int>(nEvent) <<
")" );
1001 if( pWin && pMouseEvent )
1015 std::unique_ptr<ImplPostEventData> pPostEventData(
new ImplPostEventData( nEvent, pWin, aTransformedEvent ));
1019 pPostEventData.get() );
1023 pPostEventData->mnEventId = nEventId;
1036 const void* pEventData;
1074 pEventData =
nullptr;
1083 ::std::vector< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() );
1085 while( aIter != svdata->maAppData.maPostedEventList.end() )
1087 if( nEventId == (*aIter).second->mnEventId )
1089 delete (*aIter).second;
1090 aIter = svdata->maAppData.maPostedEventList.erase( aIter );
1103 ::std::vector< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() );
1105 while( aIter != svdata->maAppData.maPostedEventList.end() )
1107 if( pWin == (*aIter).first )
1109 if( (*aIter).second->mnEventId )
1112 delete (*aIter).second;
1113 aIter = svdata->maAppData.maPostedEventList.erase( aIter );
1121 bool bReferenceLink )
1124 if ( pDefWindow ==
nullptr )
1127 std::unique_ptr<ImplSVEvent> pSVEvent(
new ImplSVEvent);
1128 pSVEvent->mpData = pCaller;
1129 pSVEvent->maLink = rLink;
1130 pSVEvent->mpWindow =
nullptr;
1131 pSVEvent->mbCall =
true;
1135 pSVEvent->mpInstanceRef =
static_cast<vcl::Window *
>(rLink.GetInstance());
1138 auto pTmpEvent = pSVEvent.get();
1149 "Application::RemoveUserEvent(): Event is send to a window" );
1151 "Application::RemoveUserEvent(): Event is already removed" );
1155 nUserEvent->
mbCall =
false;
1177 return pWindow->
mpWindowImpl->mpFrameData->mpNextFrame;
1203 if( nIdx == nIndex )
1263 OUStringBuffer aDetails;
1265 const auto appendDetails = [&aDetails](std::u16string_view sep,
auto&& val) {
1266 if (!aDetails.isEmpty() && !sep.empty())
1267 aDetails.append(sep);
1268 aDetails.append(std::move(val));
1271 if (bSelection !=
hwUI) {
1272 appendDetails(
u"; ",
Localize(SV_APP_CPUTHREADS, bLocalize)
1273 + OUString::number(std::thread::hardware_concurrency()));
1277 appendDetails(
u"; ",
Localize(SV_APP_OSVERSION, bLocalize) + aVersion);
1280 if (bSelection !=
hwEnv) {
1281 appendDetails(
u"; ",
Localize(SV_APP_UIRENDER, bLocalize));
1282 #if HAVE_FEATURE_SKIA
1285 switch(SkiaHelper::renderMethodToUse())
1287 case SkiaHelper::RenderVulkan:
1288 appendDetails(
u"",
Localize(SV_APP_SKIA_VULKAN, bLocalize));
1290 case SkiaHelper::RenderMetal:
1291 appendDetails(
u"",
Localize(SV_APP_SKIA_METAL, bLocalize));
1293 case SkiaHelper::RenderRaster:
1294 appendDetails(
u"",
Localize(SV_APP_SKIA_RASTER, bLocalize));
1300 appendDetails(
u"",
Localize(SV_APP_DEFAULT, bLocalize));
1302 #if (defined LINUX || defined _WIN32 || defined MACOSX || defined __FreeBSD__ || defined EMSCRIPTEN)
1307 return aDetails.makeStringAndClear();
1373 SAL_WARN(
"vcl",
"Requesting screen size/pos for screen #" << nScreen <<
" failed");
1379 SAL_WARN(
"vcl",
"Requesting screen size/pos for screen #" << nScreen <<
" returned 0 height.");
1387 (i_rRect.
Top() + i_rRect.
Bottom())/ 2 );
1388 const tools::Long nDX = aRectCenter.X() - i_rPoint.X();
1389 const tools::Long nDY = aRectCenter.Y() - i_rPoint.Y();
1390 return nDX*nDX + nDY*nDY;
1400 unsigned int nBestMatchScreen = 0;
1401 unsigned long nOverlap = 0;
1402 for(
unsigned int i = 0;
i < nScreens;
i++ )
1406 if( aCurScreenRect.
Contains( i_rRect ) )
1410 if( ! aIntersection.IsEmpty() )
1412 const unsigned long nCurOverlap( aIntersection.GetWidth() * aIntersection.GetHeight() );
1413 if( nCurOverlap > nOverlap )
1415 nOverlap = nCurOverlap;
1416 nBestMatchScreen =
i;
1421 return nBestMatchScreen;
1426 tools::Long nDist = std::numeric_limits<tools::Long>::max();
1427 for(
unsigned int i = 0;
i < nScreens;
i++ )
1430 const tools::Long nCurDist( calcDistSquare( aCenter, aCurScreenRect ) );
1431 if( nCurDist < nDist )
1433 nBestMatchScreen =
i;
1437 return nBestMatchScreen;
1502 OSL_FAIL(
"Window hierarchy corrupted!" );
1509 return pWin->
mpWindowImpl->mpFrameWindow->ImplGetWindow();
1517 return pWin->
mpWindowImpl->mpFrameWindow->ImplGetWindow();
1531 return pWin->
mpWindowImpl->mpFrameWindow->ImplGetWindow();
1573 css::uno::Reference< css::awt::XToolkit > xT;
1580 #ifdef DISABLE_DYNLOADING
1593 static bool bAlreadyTriedToCreate =
false;
1594 if ( !pSVData->
mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate )
1596 #ifndef DISABLE_DYNLOADING
1598 aTkLib.loadRelative(&
thisModule, TK_DLL_NAME);
1602 if ( fnCreateWrapper )
1612 bAlreadyTriedToCreate =
true;
1652 if (eOldMode != eNewMode)
1686 bEventTestingMode =
true;
1702 const OUString& sMessage)
1708 SAL_WARN(
"vcl",
"ShowNativeMessageBox returned " << btn);
1716 static const OUString aNone(
"none");
1735 bool bRet = ImplInitAccessBridge();
1742 aMisc.SetEnableATToolSupport(
false );
1761 Reference< ui::dialogs::XFilePicker2 >
1768 Reference< ui::dialogs::XFolderPicker2 >
1787 LibreOfficeKitPollCallback pPollCallback,
1788 LibreOfficeKitWakeCallback pWakeCallback,
static vcl::Window * GetTopWindow(tools::Long nIndex)
Get the nth top window.
static OUString GetDisplayName()
Get the default name of the application for message dialogs and printing.
do not automatically cancel dialogs
#define LINK(Instance, Class, Member)
constexpr sal_uInt16 KEY_4
const OUString & SalGetDesktopEnvironment()
tools::Long GetOutOffYPixel() const
static bool bEventTestingMode
static OUString GetAppName()
Get the application's name.
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK
const LocaleDataWrapper & GetLocaleDataWrapper() const
constexpr sal_uInt16 KEY_7
static void AcquireSolarMutex(sal_uInt32 nCount)
Acquire Solar Mutex(es) for this thread.
oslThreadIdentifier mnMainThreadId
VclPtr< vcl::Window > mpFocusWin
Application()
Default constructor for Application class.
constexpr sal_uInt16 KEY_MOD1
static comphelper::SolarMutex & GetSolarMutex()
Get the Solar Mutex for this thread.
static bool IsUICaptured()
static bool IsMainThread()
Queries whether we are in main thread.
static bool IsInExecute()
Queries whether the application is in the event loop.
std::optional< OUString > mxToolkitName
Link< LinkParamNone *, void > maDeInitHook
static void NotifyAllWindows(DataChangedEvent &rDCEvt)
Notify all windows that the application has changed data.
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
const LanguageTag & GetUILanguageTag() const
VclPtr< VirtualDevice > mpNext
static bool IsBitmapRendering()
Determines if bitmap rendering is enabled.
void NotifyAllChildren(DataChangedEvent &rDCEvt)
static sal_uInt16 GetDispatchLevel()
Return how many events are being dispatched.
virtual void InitFinished()
Finish initialization of the application.
constexpr sal_uInt16 KEY_2
static Help * GetHelp()
Gets the application's help.
static tools::Long GetTopWindowCount()
Return the number of top-level windows being used by the application.
ImplPostEventData(VclEventId nEvent, vcl::Window *pWin, const GestureEvent &rGestureEvent)
static SAL_DLLPRIVATE void ImplInitAppFontData(vcl::Window const *pWindow)
LanguageType getLanguageType(bool bResolveSystem=true) const
std::unique_ptr< sal_Int32[]> pData
virtual bool DoExecute(int &nExitCode)
static void RemoveEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
Remove a VCL event listener from the application.
void SetMiscSettings(const MiscSettings &rSet)
MouseEventModifiers GetMode() const
static size_t GetReservedKeyCodeCount()
Get the number of reserved key codes used by the application.
std::unique_ptr< GraphicConverter > mxGrfConverter
bool ImplWindowFrameProc(vcl::Window *_pWindow, SalEvent nEvent, const void *pEvent)
static const AllSettings & GetSettings()
Gets the application's settings.
constexpr sal_uInt16 KEY_0
virtual bool IsMainThread() const =0
static ImplSVEvent * PostGestureEvent(VclEventId nEvent, vcl::Window *pWin, GestureEvent const *pGestureEvent)
virtual css::uno::Reference< css::ui::dialogs::XFilePicker2 > createFilePicker(const css::uno::Reference< css::uno::XComponentContext > &)
SAL_DLLPRIVATE void SetDPIX(sal_Int32 nDPIX)
bool IsMapModeEnabled() const
Important idle events to be run before processing drawing events.
ImplPostEventData(VclEventId nEvent, vcl::Window *pWin, const KeyEvent &rKeyEvent)
IMPL_STATIC_LINK_NOARG(ImplSVAppData, ImplEndAllPopupsMsg, void *, void)
constexpr sal_uInt16 KEY_F4
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Post a user event to the default window.
const MapMode & GetMapMode() const
static void EndAllPopups()
Cancel all open popups.
static OUString Localize(TranslateId aId, const bool bLocalize)
static bool IsUnifiedDisplay()
Determines if the screens that make up a display are separate or form one large display area...
virtual int ShowNativeMessageBox(const OUString &rTitle, const OUString &rMessage)=0
Idle * mpEventTestingIdle
static OUString GetHWOSConfInfo(const int bSelection=0, bool bLocalize=true)
Get useful OS, Hardware and configuration information, cf.
static void EnableSafeMode()
Set safe mode to enabled.
constexpr sal_uInt16 KEY_F6
static void EndAllDialogs()
Cancel all open dialogs.
virtual unsigned int GetDisplayBuiltInScreen()
constexpr sal_uInt16 KEY_ADD
std::vector< Link< VclWindowEvent &, bool > > maKeyListeners
virtual void Exception(ExceptionCategory nCategory)
Handles an error.
virtual bool AnyInput(VclInputFlags nType)=0
An application can be notified of a number of different events:
static void AddEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
Add a VCL event listener to the application.
ImplSchedulerData * mpFirstSchedulerData[PRIO_COUNT]
list of all active tasks per priority
virtual css::uno::Reference< css::ui::dialogs::XFolderPicker2 > createFolderPicker(const css::uno::Reference< css::uno::XComponentContext > &)
static bool ImplYield(bool i_bWait, bool i_bAllEvents)
static void EnableConsoleOnly()
Enable Console Only mode.
std::optional< OUString > mxAppFileName
virtual bool hasNativeFileSelection() const
static const OUString & GetDesktopEnvironment()
Get the desktop environment the process is currently running in.
static OUString GetCommandLineParam(sal_uInt16 nParam)
Gets a particular command line parameter.
static css::uno::Reference< css::awt::XDisplayConnection > GetDisplayConnection()
GestureEventType meEventType
static bool IsSafeModeEnabled()
Determines if safe mode is enabled.
constexpr sal_uInt16 KEY_F1
static OUString GetOSVersion()
Get the OS version based on the OS specific implementation.
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
constexpr sal_uInt16 KEY_9
weld::Window * GetFrameWeld() const
virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen)=0
sal_uInt16 GetClicks() const
static SAL_DLLPRIVATE vcl::Window * GetDefDialogParent()
static void ImplCallEventListenersApplicationDataChanged(void *pData)
Send event to all VCL application event listeners.
std::vector< ImplPostEventPair > maPostedEventList
virtual bool Close() override
void AcquireYieldMutex(sal_uInt32 nCount=1)
LibreOfficeKitPollCallback mpPollCallback
static void SetFilterHdl(const Link< ConvertData &, bool > &rLink)
Setup a new graphics filter.
virtual unsigned int GetDisplayScreenCount()=0
UnoWrapperBase *(* FN_TkCreateUnoWrapper)()
sal_uInt16 GetButtons() const
static weld::Window * GetDefDialogParent()
Get the default parent window for dialog boxes.
static unsigned int GetDisplayExternalScreen()
Get the display's external screen.
static void Yield()
Process the next event.
void removeListener(const Link< VclSimpleEvent &, void > &rListener)
constexpr sal_uInt16 KEY_1
void SalAbort(const OUString &rErrorText, bool bDumpCore)
constexpr sal_uInt16 KEY_F2
static void RemoveKeyListener(const Link< VclWindowEvent &, bool > &rKeyListener)
Remove a keypress listener from the application.
void numberOfViewsChanged(int count)
#define SV_APP_VCLBACKEND
static void SetAppName(const OUString &rUniqueName)
Set the application's name.
static void Quit()
Quit the program.
VclPtr< VirtualDevice > mpFirstVirDev
ImplSchedulerData * mpNext
Pointer to the next element in list.
static SystemWindowFlags GetSystemWindowMode()
Get the system window mode of dialogs.
virtual void updateMainThread()
Set the app's (somewhat) magic/main-thread to this one.
void Call(VclSimpleEvent &rEvent) const
bool ImplLOKHandleMouseEvent(const VclPtr< vcl::Window > &xWindow, MouseNotifyEvent nEvent, bool, tools::Long nX, tools::Long nY, sal_uInt64, sal_uInt16 nCode, MouseEventModifiers nMode, sal_uInt16 nClicks)
void registerPollCallbacks(LibreOfficeKitPollCallback pPollCallback, LibreOfficeKitWakeCallback pWakeCallback, void *pData)
static void ImplCallEventListeners(VclSimpleEvent &rEvent)
Send event to all VCL application event listeners.
OUString VclResId(TranslateId aId)
static bool IsDialogCancelEnabled()
Determines if dialog cancel mode is enabled.
#define SAL_N_ELEMENTS(arr)
std::locale Create(std::string_view aPrefixName, const LanguageTag &rLocale)
virtual css::uno::Reference< css::awt::XToolkit > GetVCLToolkit()=0
WinBits const WB_INTROWIN
LibreOfficeKitWakeCallback mpWakeCallback
static ImplSVEvent * PostMouseEvent(VclEventId nEvent, vcl::Window *pWin, MouseEvent const *pMouseEvent)
Send mouse event.
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
Remove user event based on event ID.
static vcl::Window * GetFirstTopLevelWindow()
Get the first top-level window of the application.
static bool IsEventTestingModeEnabled()
Determines if event testing mode is enabled.
constexpr sal_uInt16 KEY_5
ImplSVData * ImplGetSVData()
void RemoveAccel(Accelerator const *pAccel)
SalSystem * ImplGetSalSystem()
static tools::Rectangle GetScreenPosSizePixel(unsigned int nScreen)
Get a screen's rectangular area.
VclPtr< vcl::Window > mpCaptureWin
static bool Reschedule(bool bHandleAllCurrentEvents=false)
Attempt to process current pending event(s)
silently cancel any dialogs
static void ShowNativeErrorBox(const OUString &sTitle, const OUString &sMessage)
SvFileStream * mpEventTestInput
comphelper::SolarMutex * GetYieldMutex()
ImplPostEventData(VclEventId nEvent, vcl::Window *pWin, const MouseEvent &rMouseEvent)
void unregisterPollCallbacks()
virtual bool PostEvent(std::unique_ptr< ImplSVEvent > pData)=0
virtual void releaseMainThread()
Disconnect that - good for detaching from the JavaVM on Android.
VclPtr< vcl::Window > mpInstanceRef
void EndAllDialogs(vcl::Window const *pParent)
static bool AnyInput(VclInputFlags nType=VCL_INPUT_ANY)
Determine if there are any pending input events.
static const LocaleDataWrapper & GetAppLocaleDataWrapper()
Get the application's locale data wrapper.
static void SetSystemWindowMode(SystemWindowFlags nMode)
Make a dialog box a system window or not.
virtual OUString getOSVersion()
get information about underlying versions
static void SetSettings(const AllSettings &rSettings)
Sets the application's settings and notifies all windows of the change.
static bool InsertAccel(Accelerator *pAccel)
Insert accelerator.
Task * mpTask
Pointer to VCL Task instance.
static css::uno::Reference< css::ui::dialogs::XFilePicker2 > createFilePicker(const css::uno::Reference< css::uno::XComponentContext > &rServiceManager)
Create a platform specific file picker, if one is available, otherwise return an empty reference...
static void EnableEventTestingMode()
Enables event testing mode.
static void UpdateMainThread()
Update main thread identifier.
VclPtr< WorkWindow > mpAppWin
bool IsMenuFloatingWindow() const
SystemWindowFlags mnSysWinMode
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
static OUString GetToolkitName()
Get the toolkit's name.
static ImplSVEvent * PostKeyEvent(VclEventId nEvent, vcl::Window *pWin, KeyEvent const *pKeyEvent)
Send keypress event.
std::unique_ptr< WindowImpl > mpWindowImpl
constexpr sal_uInt16 KEY_3
LocaleConfigurationListener * mpCfgListener
OUString get(TranslateId sContextAndId, const std::locale &loc)
static sal_uInt64 GetLastInputInterval()
The interval from the last time that input was received.
VclPtr< vcl::Window > mpWin
MouseEventModifiers ImplGetMouseMoveMode(SalMouseEvent const *pEvent)
static bool HandleKey(VclEventId nEvent, vcl::Window *pWin, KeyEvent *pKeyEvent)
Handle keypress event.
std::optional< AllSettings > mxSettings
IMPL_STATIC_LINK(Application, PostEventHandler, void *, pCallData, void)
static bool IsOnSystemEventLoop()
Returns true, if the VCL plugin runs on the system event loop.
sal_uInt32 ReleaseYieldMutexAll()
GestureEvent maGestureEvent
static unsigned int GetScreenCount()
Get the number of screens available for the display.
Base class used mainly for the LibreOffice Desktop class.
static SAL_DLLPRIVATE unsigned int GetBestScreen(const tools::Rectangle &)
Get the "best" screen.
sal_uInt16 GetModifier() const
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
constexpr sal_uInt16 KEY_MOD2
virtual void AppEvent(const ApplicationEvent &rAppEvent)
constexpr sal_uInt16 KEY_F10
VclPtr< vcl::Window > mpTrackWin
SAL_DLLPRIVATE vcl::Window * ImplGetClientWindow() const
static DialogCancelMode GetDialogCancelMode()
Gets the dialog cancel mode for headless environments.
static vcl::Window * GetActiveTopWindow()
Get the "active" top window.
virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString &rAction, const std::vector< vcl::LOKPayloadItem > &rPayload=std::vector< vcl::LOKPayloadItem >()) const override
constexpr sal_uInt16 KEY_6
static bool IsInMain()
Queries whether the application is in "main", i.e.
ImplSchedulerContext maSchedCtx
static void MergeSystemSettings(AllSettings &rSettings)
Set the settings object to the platform/desktop environment system settings.
static sal_uInt16 GetCommandLineParamCount()
Gets the number of command line parameters passed to the application.
SalFrame * ImplGetFrame() const
virtual void Init()
Initialize the application itself.
virtual bool IsUnifiedDisplay()
static void SetDialogCancelMode(DialogCancelMode mode)
Sets the dialog cancel mode for headless environments.
static vcl::Window * GetFocusWindow()
Get the currently focused window.
static void AddToRecentDocumentList(const OUString &rFileUrl, const OUString &rMimeType, const OUString &rDocumentService)
Add a file to the system shells recent document list if there is any.
static void setDeInitHook(Link< LinkParamNone *, void > const &hook)
VCL_DLLPUBLIC bool isVCLSkiaEnabled()
static bool IsInModalMode()
Queries whether application has a modal dialog active.
constexpr sal_uInt16 KEY_8
LibreOfficeKitCallback m_pCallback
static sal_uInt32 ReleaseSolarMutex()
Release Solar Mutex(es) for this thread.
static void Abort(const OUString &rErrorText)
Ends the program prematurely with an error message.
static vcl::Window * GetNextTopLevelWindow(vcl::Window const *pWindow)
Get the next top level window.
static bool IsHeadlessModeEnabled()
Determines if headless mode is enabled.
#define SAL_WARN_IF(condition, area, stream)
static void SetUnoWrapper(UnoWrapperBase *pWrapper)
Sets the application's UNO Wrapper object.
ImplSVFrameData maFrameData
virtual OUString GetText() const override
static void SetHelp(Help *pHelp=nullptr)
Sets up help.
#define SAL_INFO(area, stream)
static css::uno::Reference< css::ui::dialogs::XFolderPicker2 > createFolderPicker(const css::uno::Reference< css::uno::XComponentContext > &rServiceManager)
Create a platform specific folder picker, if one is available, otherwise return an empty reference...
VclPtr< vcl::Window > mpActiveApplicationFrame
TOOLKIT_DLLPUBLIC UnoWrapperBase * CreateUnoWrapper()
::OutputDevice const * GetOutDev() const
static void EnableBitmapRendering()
Enable software-only bitmap rendering.
virtual void AddToRecentDocumentList(const OUString &rFileUrl, const OUString &rMimeType, const OUString &rDocumentService)=0
sal_uInt16 mnDispatchLevel
IMPL_LINK_NOARG(ImplSVAppData, VclEventTestingHdl, Timer *, void)
SAL_DLLPUBLIC_EXPORT void unit_lok_process_events_to_idle()
used by unit tests that test only via the LOK API
PanningOrientation meOrientation
VclEventListeners maEventListeners
cancel any dialogs by std::abort
static bool LOKHandleMouseEvent(VclEventId nEvent, vcl::Window *pWin, const MouseEvent *pEvent)
static void ProcessEventsToIdle()
Process all events until none is pending.
static css::uno::Reference< css::awt::XToolkit > GetVCLToolkit()
Gets the VCL toolkit.
void SetInvokeHandler(const Link< Timer *, void > &rLink)
SAL_DLLPRIVATE void SetDPIY(sal_Int32 nDPIY)
virtual bool QueryExit()
Exit from the application.
const Point & GetPosPixel() const
virtual void OverrideSystemSettings(AllSettings &rSettings)
Sets user settings in settings object to override system settings.
static void EnableHeadlessMode(bool dialogsAreFatal)
Enables headless mode.
void setMaxSize(size_t nMaxSize)
SAL_DLLPRIVATE void ImplUpdateGlobalSettings(AllSettings &rSettings, bool bCallHdl=true) const
MouseEventModifiers ImplGetMouseButtonMode(SalMouseEvent const *pEvent)
VclPtr< FloatingWindow > mpFirstFloat
VclPtr< vcl::Window > mpWindow
virtual void DeInit()
Deinitialized the application itself.
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
DialogCancelMode meDialogCancel
static void RemoveMouseAndKeyEvents(vcl::Window *pWin)
Remove mouse and keypress events from a window...
const MiscSettings & GetMiscSettings() const
reference_type * get() const
Get the body.
VclPtr< vcl::Window > mpFirstFrame
#define SAL_WARN(area, stream)
ImplAccelManager * mpAccelMgr
void SetPriority(TaskPriority ePriority)
static unsigned int GetDisplayBuiltInScreen()
Get the built-in screen.
virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents)=0
Wait for the next event (if bWait) and dispatch it, includes posted events, and timers.
#define DBG_TESTSOLARMUTEX()
std::optional< OUString > mxDisplayName
static UnoWrapperBase * GetUnoWrapper(bool bCreateIfNotExists=true)
Get the application's UNO wrapper object.
std::optional< OUString > mxAppName
lru_scale_cache maScaleCache
static const vcl::KeyCode * GetReservedKeyCode(size_t i)
Get the reserved key code.
rtl::Reference< vcl::DisplayConnectionDispatch > mxDisplayConnection
constexpr sal_uInt16 KEY_MOD3
constexpr sal_uInt16 KEY_SHIFT
bool InsertAccel(Accelerator *pAccel)
virtual ~Application()
Virtual destructor for Application class.
tools::Long GetOutOffXPixel() const
UnoWrapperBase * mpUnoWrapper
vcl::Window * ImplGetDefaultWindow()
Returns either the application window, or the default GL context window.
static OUString GetAppFileName()
Get the name of the file used to start the application.
const char * GetDebugName() const
SAL_DLLPRIVATE sal_Int32 GetDPIY() const
Get the output device's DPI y-axis value.
SAL_DLLPRIVATE AllSettingsFlags GetChangeFlags(const AllSettings &rSettings) const
void EndPopupMode(FloatWinPopupEndFlags nFlags=FloatWinPopupEndFlags::NONE)
static void RemoveAccel(Accelerator const *pAccel)
Remove accelerator.
SAL_DLLPRIVATE sal_Int32 GetDPIX() const
Get the output device's DPI x-axis value.
An idle is a timer to be scheduled immediately.
bool mbInScheduler
Is the Task currently processed / on the stack?
ImplSVWinData * mpWinData
static bool IsQuit()
Has Quit() been called?
static void SetDisplayName(const OUString &rDisplayName)
Set the default name of the application for message dialogs and printing.
void addListener(const Link< VclSimpleEvent &, void > &rListener)
void UpdateSettings(const AllSettings &rSettings, bool bChild=false)
static void Execute()
Run the main event processing loop until it is quit by Quit().
static bool hasNativeFileSelection()
Do we have a native / system file selector available?
static void AddKeyListener(const Link< VclWindowEvent &, bool > &rKeyListener)
Add a keypress listener to the application.
virtual int Main()
Pure virtual entrypoint to the application.