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>
60 #include <strings.hrc>
61 #include <strings.hxx>
62 #if OSL_DEBUG_LEVEL > 0
66 #include <com/sun/star/uno/Reference.h>
67 #include <com/sun/star/awt/XToolkit.hpp>
70 #include <osl/process.h>
74 #include <string_view>
117 typedef UnoWrapperBase* (*FN_TkCreateUnoWrapper)();
133 , maKeyEvent(rKeyEvent)
139 , maMouseEvent(rMouseEvent)
145 , maGestureEvent(rGestureEvent)
154 return pSVData->
mpApp;
160 OUString aVar(
"LIBO_VERSION"), aValue(LIBO_VERSION_DOTTED);
161 osl_setEnvironment(aVar.pData, aValue.pData);
176 SAL_WARN(
"vcl",
"Application is a base class and should be overridden.");
186 return pAppWin->
Close();
209 return static_cast<sal_uInt16
>(osl_getCommandArgCount());
215 osl_getCommandArg( nParam, &aParam.pData );
230 OUString aAppFileName;
231 OUString aExeFileName;
232 osl_getExecutableFile(&aExeFileName.pData);
235 osl::FileBase::getSystemPathFromFileURL(aExeFileName, aAppFileName);
249 Abort(
"Unknown Error");
259 #if OSL_DEBUG_LEVEL > 0
260 bool dumpCore =
true;
262 bool dumpCore =
false;
264 for (sal_uInt16
i = 0;
i != n; ++
i) {
285 return &ReservedKeys[i];
317 const std::vector<vcl::LOKPayloadItem>& )
const
340 if (xWin->IsVisible())
347 bool InjectKeyEvent(
SvStream& rStream)
364 sal_uInt16
nCode, nCharCode;
370 KeyEvent aVCLKeyEvt(nCharCode, nCode);
376 void CloseDialogsAndQuit()
388 mpEventTestingIdle->Start();
404 CloseDialogsAndQuit();
412 SAL_INFO(
"vcl.eventtesting",
"Event Input exhausted, exit next cycle");
453 SAL_INFO(
"vcl.schedule",
"Enter ImplYield: " << (i_bWait ?
"wait" :
"no wait") <<
454 ": " << (i_bAllEvents ?
"all events" :
"one event"));
470 SAL_INFO(
"vcl.schedule",
"Leave ImplYield with return " << bProcessedEvent );
471 return bProcessedEvent;
484 if (0 == ++nSanity % 1000)
486 SAL_WARN(
"vcl.schedule",
"ProcessEventsToIdle: " << nSanity);
489 #if OSL_DEBUG_LEVEL > 0
496 for (
int nTaskPriority = 0; nTaskPriority <
PRIO_COUNT; ++nTaskPriority)
499 while (pSchedulerData)
502 if (pSchedulerData->
mpTask)
507 SAL_WARN(
"vcl.schedule",
"Unprocessed Idle: "
511 pSchedulerData = pSchedulerData->
mpNext;
637 InitSettings(pSVData);
650 if (
bool(nChangeFlags) )
664 nOldDPIX = pFirstFrame->
GetDPIX();
665 nOldDPIY = pFirstFrame->
GetDPIY();
681 pClientWin = pTempWin;
688 pFrame = pFrame->
mpWindowImpl->mpFrameData->mpNextFrame;
696 if ( (pFirstFrame->
GetDPIX() != nOldDPIX) ||
697 (pFirstFrame->
GetDPIY() != nOldDPIY) )
703 (pVirDev->
GetDPIX() == nOldDPIX) &&
704 (pVirDev->
GetDPIY() == nOldDPIY) )
716 pVirDev = pVirDev->
mpNext;
729 InitSettings(pSVData);
766 pFrame = pFrame->
mpWindowImpl->mpFrameData->mpNextFrame;
806 rVec.erase( std::remove(rVec.begin(), rVec.end(), rKeyListener ), rVec.end() );
819 bool bProcessed =
false;
824 if( rLink.Call( aEvent ) )
838 if( pWin && pKeyEvent )
840 std::unique_ptr<ImplPostEventData> pPostEventData(
new ImplPostEventData( nEvent, pWin, *pKeyEvent ));
844 pPostEventData.get() );
848 pPostEventData->mnEventId = nEventId;
861 if (pWin && pGestureEvent)
863 Point aTransformedPosition(pGestureEvent->
mnX, pGestureEvent->
mnY);
869 sal_Int32(aTransformedPosition.X()),
870 sal_Int32(aTransformedPosition.Y()),
876 std::unique_ptr<ImplPostEventData> pPostEventData(
new ImplPostEventData(nEvent, pWin, aGestureEvent));
880 pPostEventData.get());
884 pPostEventData->mnEventId = nEventId;
897 if( pWin && pMouseEvent )
911 std::unique_ptr<ImplPostEventData> pPostEventData(
new ImplPostEventData( nEvent, pWin, aTransformedEvent ));
915 pPostEventData.get() );
919 pPostEventData->mnEventId = nEventId;
932 const void* pEventData;
970 pEventData =
nullptr;
979 ::std::vector< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() );
981 while( aIter != svdata->maAppData.maPostedEventList.end() )
983 if( nEventId == (*aIter).second->mnEventId )
985 delete (*aIter).second;
986 aIter = svdata->maAppData.maPostedEventList.erase( aIter );
999 ::std::vector< ImplPostEventPair >::iterator aIter( svdata->maAppData.maPostedEventList.begin() );
1001 while( aIter != svdata->maAppData.maPostedEventList.end() )
1003 if( pWin == (*aIter).first )
1005 if( (*aIter).second->mnEventId )
1008 delete (*aIter).second;
1009 aIter = svdata->maAppData.maPostedEventList.erase( aIter );
1017 bool bReferenceLink )
1020 if ( pDefWindow ==
nullptr )
1023 std::unique_ptr<ImplSVEvent> pSVEvent(
new ImplSVEvent);
1024 pSVEvent->mpData = pCaller;
1025 pSVEvent->maLink = rLink;
1026 pSVEvent->mpWindow =
nullptr;
1027 pSVEvent->mbCall =
true;
1032 assert(dynamic_cast<vcl::Window *>(
1033 static_cast<OutputDevice *>(rLink.GetInstance())) ==
1035 pSVEvent->mpInstanceRef =
static_cast<vcl::Window *
>(rLink.GetInstance());
1038 auto pTmpEvent = pSVEvent.get();
1049 "Application::RemoveUserEvent(): Event is send to a window" );
1051 "Application::RemoveUserEvent(): Event is already removed" );
1055 nUserEvent->
mbCall =
false;
1077 return pWindow->
mpWindowImpl->mpFrameData->mpNextFrame;
1103 if( nIdx == nIndex )
1142 static OUString
Localize(
const char *pId,
const bool bLocalize)
1153 OUStringBuffer aDetails;
1155 const auto appendDetails = [&aDetails](std::u16string_view sep,
auto&& val) {
1156 if (!aDetails.isEmpty() && !sep.empty())
1157 aDetails.append(sep);
1158 aDetails.append(std::move(val));
1161 if (bSelection !=
hwUI) {
1162 appendDetails(
u"; ",
Localize(SV_APP_CPUTHREADS, bLocalize)
1163 + OUString::number(std::thread::hardware_concurrency()));
1171 appendDetails(
u"; ",
Localize(SV_APP_OSVERSION, bLocalize) + aVersion);
1174 if (bSelection !=
hwEnv) {
1175 appendDetails(
u"; ",
Localize(SV_APP_UIRENDER, bLocalize));
1176 #if HAVE_FEATURE_SKIA
1179 switch(SkiaHelper::renderMethodToUse())
1181 case SkiaHelper::RenderVulkan:
1182 appendDetails(
u"",
Localize(SV_APP_SKIA_VULKAN, bLocalize));
1184 case SkiaHelper::RenderRaster:
1185 appendDetails(
u"",
Localize(SV_APP_SKIA_RASTER, bLocalize));
1191 appendDetails(
u"",
Localize(SV_APP_DEFAULT, bLocalize));
1193 #if (defined LINUX || defined _WIN32 || defined MACOSX || defined __FreeBSD__)
1198 return aDetails.makeStringAndClear();
1264 SAL_WARN(
"vcl",
"Requesting screen size/pos for screen #" << nScreen <<
" failed");
1270 SAL_WARN(
"vcl",
"Requesting screen size/pos for screen #" << nScreen <<
" returned 0 height.");
1278 (i_rRect.
Top() + i_rRect.
Bottom())/ 2 );
1279 const tools::Long nDX = aRectCenter.X() - i_rPoint.X();
1280 const tools::Long nDY = aRectCenter.Y() - i_rPoint.Y();
1281 return nDX*nDX + nDY*nDY;
1291 unsigned int nBestMatchScreen = 0;
1292 unsigned long nOverlap = 0;
1293 for(
unsigned int i = 0;
i < nScreens;
i++ )
1297 if( aCurScreenRect.
IsInside( i_rRect ) )
1301 if( ! aIntersection.IsEmpty() )
1303 const unsigned long nCurOverlap( aIntersection.GetWidth() * aIntersection.GetHeight() );
1304 if( nCurOverlap > nOverlap )
1306 nOverlap = nCurOverlap;
1307 nBestMatchScreen =
i;
1312 return nBestMatchScreen;
1317 tools::Long nDist = std::numeric_limits<tools::Long>::max();
1318 for(
unsigned int i = 0;
i < nScreens;
i++ )
1321 const tools::Long nCurDist( calcDistSquare( aCenter, aCurScreenRect ) );
1322 if( nCurDist < nDist )
1324 nBestMatchScreen =
i;
1328 return nBestMatchScreen;
1393 OSL_FAIL(
"Window hierarchy corrupted!" );
1400 return pWin->
mpWindowImpl->mpFrameWindow->ImplGetWindow();
1408 return pWin->
mpWindowImpl->mpFrameWindow->ImplGetWindow();
1422 return pWin->
mpWindowImpl->mpFrameWindow->ImplGetWindow();
1458 css::uno::Reference< css::awt::XToolkit > xT;
1459 UnoWrapperBase* pWrapper = UnoWrapperBase::GetUnoWrapper();
1461 xT = pWrapper->GetVCLToolkit();
1465 #ifdef DISABLE_DYNLOADING
1475 UnoWrapperBase* UnoWrapperBase::GetUnoWrapper(
bool bCreateIfNotExist )
1478 static bool bAlreadyTriedToCreate =
false;
1479 if ( !pSVData->
mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate )
1481 #ifndef DISABLE_DYNLOADING
1483 aTkLib.loadRelative(&
thisModule, TK_DLL_NAME);
1487 if ( fnCreateWrapper )
1497 bAlreadyTriedToCreate =
true;
1502 void UnoWrapperBase::SetUnoWrapper( UnoWrapperBase* pWrapper )
1537 if (eOldMode != eNewMode)
1571 bEventTestingMode =
true;
1587 const OUString& sMessage)
1593 SAL_WARN(
"vcl",
"ShowNativeMessageBox returned " << btn);
1601 static const OUString aNone(
"none");
1620 bool bRet = ImplInitAccessBridge();
1627 aMisc.SetEnableATToolSupport(
false );
1646 Reference< ui::dialogs::XFilePicker2 >
1653 Reference< ui::dialogs::XFolderPicker2 >
1672 LibreOfficeKitPollCallback pPollCallback,
1673 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()
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.
void SetFilterHdl(const Link< ConvertData &, bool > &rLink)
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
std::unique_ptr< ContentProperties > pData
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
static vcl::Window * GetDefDialogParent()
Get the default parent window for dialog boxes.
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.
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
tools::Long GetOutOffXPixel() const
Important idle events to be run before processing drawing events.
std::unique_ptr< AllSettings > mpSettings
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 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 OUString Localize(const char *pId, const bool bLocalize)
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 OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
constexpr sal_uInt16 KEY_9
virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen)=0
sal_uInt16 GetClicks() const
std::locale Create(const char *pPrefixName, const LanguageTag &rLocale)
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 unsigned int GetDisplayExternalScreen()
Get the display's external screen.
static void Yield()
Process the next event.
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void removeListener(const Link< VclSimpleEvent &, void > &rListener)
constexpr sal_uInt16 KEY_1
void SalAbort(const OUString &rErrorText, bool bDumpCore)
constexpr sal_uInt16 KEY_F2
virtual void Start() override
Activates the timer task.
static void RemoveKeyListener(const Link< VclWindowEvent &, bool > &rKeyListener)
Remove a keypress listener from the application.
#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
void registerPollCallbacks(LibreOfficeKitPollCallback pPollCallback, LibreOfficeKitWakeCallback pWakeCallback, void *pData)
static void ImplCallEventListeners(VclSimpleEvent &rEvent)
Send event to all VCL application event listeners.
static bool IsDialogCancelEnabled()
Determines if dialog cancel mode is enabled.
#define SAL_N_ELEMENTS(arr)
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.
GraphicConverter * mpGrfConverter
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
static sal_uInt64 GetLastInputInterval()
The interval from the last time that input was received.
VclPtr< vcl::Window > mpWin
static bool HandleKey(VclEventId nEvent, vcl::Window *pWin, KeyEvent *pKeyEvent)
Handle keypress event.
IMPL_STATIC_LINK(Application, PostEventHandler, void *, pCallData, void)
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.
tools::Long GetOutOffYPixel() const
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)
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()
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 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.
SAL_DLLPRIVATE void ImplUpdateGlobalSettings(AllSettings &rSettings, bool bCallHdl=true) const
VclPtr< FloatingWindow > mpFirstFloat
VclPtr< vcl::Window > mpWindow
virtual void DeInit()
Deinitialized the application itself.
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
OUString VclResId(const char *pId)
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
OUString get(const char *pContextAndId, const std::locale &loc)
std::optional< OUString > mxAppName
static const vcl::KeyCode * GetReservedKeyCode(size_t i)
Get the reserved key code.
rtl::Reference< vcl::DisplayConnectionDispatch > mxDisplayConnection
constexpr sal_uInt16 KEY_SHIFT
bool InsertAccel(Accelerator *pAccel)
virtual ~Application()
Virtual destructor for Application class.
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.
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 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.