LibreOffice Module vcl (master)  1
svmain.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 #include <sal/log.hxx>
22 
23 #include <cassert>
24 
25 #include <osl/file.hxx>
26 #include <osl/signal.h>
27 
28 #include <desktop/exithelper.h>
29 
32 #include <i18nlangtag/mslangid.hxx>
34 #include <vcl/QueueInfo.hxx>
35 #include <vcl/svapp.hxx>
36 #include <vcl/vclmain.hxx>
37 #include <vcl/wrkwin.hxx>
38 #include <vcl/cvtgrf.hxx>
39 #include <vcl/scheduler.hxx>
40 #include <vcl/image.hxx>
41 #include <vcl/ImageTree.hxx>
42 #include <vcl/settings.hxx>
43 #include <vcl/toolkit/unowrap.hxx>
44 #include <configsettings.hxx>
45 #include <vcl/lazydelete.hxx>
47 #include <vcl/toolkit/dialog.hxx>
48 #include <vcl/menu.hxx>
49 #include <vcl/virdev.hxx>
50 #include <vcl/print.hxx>
51 #include <debugevent.hxx>
52 #include <scrwnd.hxx>
53 
54 #ifdef _WIN32
55 #include <svsys.h>
56 #include <process.h>
57 #include <ole2.h>
58 #else
59 #include <stdlib.h>
60 #endif
61 
62 #ifdef ANDROID
63 #include <cppuhelper/bootstrap.hxx>
64 #include <jni.h>
65 #endif
66 
67 #include <impfontcache.hxx>
68 #include <salinst.hxx>
69 #include <svdata.hxx>
70 #include <vcl/svmain.hxx>
71 #include <dbggui.hxx>
72 #include <accmgr.hxx>
74 #include <print.h>
75 #include <salsys.hxx>
76 #include <saltimer.hxx>
78 
79 #include <config_features.h>
80 #include <config_feature_opencl.h>
81 
82 #include <osl/process.h>
83 #include <com/sun/star/lang/XComponent.hpp>
84 #include <com/sun/star/frame/Desktop.hpp>
85 
86 #ifdef _WIN32
87 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
88 #endif
89 
90 #include <comphelper/lok.hxx>
91 #include <cppuhelper/implbase.hxx>
92 #include <uno/current_context.hxx>
93 
94 #include <opencl/OpenCLZone.hxx>
95 #include <opengl/zone.hxx>
96 #include <skia/zone.hxx>
97 #include <watchdog.hxx>
98 
100 #include <tools/diagnose_ex.h>
101 
102 #if OSL_DEBUG_LEVEL > 0
103 #include <typeinfo>
104 #include <rtl/strbuf.hxx>
105 #endif
106 
107 using namespace ::com::sun::star;
108 
109 static bool g_bIsLeanException;
110 
111 static oslSignalAction VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo)
112 {
113  static volatile bool bIn = false;
114 
115  // if we crash again, bail out immediately
116  if ( bIn || g_bIsLeanException)
117  return osl_Signal_ActCallNextHdl;
118 
120 
121  // UAE
122  if ( (pInfo->Signal == osl_Signal_AccessViolation) ||
123  (pInfo->Signal == osl_Signal_IntegerDivideByZero) ||
124  (pInfo->Signal == osl_Signal_FloatDivideByZero) ||
125  (pInfo->Signal == osl_Signal_DebugBreak) )
126  {
127  nVCLException = ExceptionCategory::System;
128 #if HAVE_FEATURE_OPENGL
129  if (OpenGLZone::isInZone())
131 #endif
132 #if HAVE_FEATURE_SKIA
133  if (SkiaZone::isInZone())
135 #endif
136 #if HAVE_FEATURE_OPENCL
137  if (OpenCLZone::isInZone())
138  {
140 #ifdef _WIN32
141  if (OpenCLInitialZone::isInZone())
142  TerminateProcess(GetCurrentProcess(), EXITHELPER_NORMAL_RESTART);
143 #endif
144  }
145 #endif
146  }
147 
148  // DISPLAY-Unix
149  if ((pInfo->Signal == osl_Signal_User) &&
150  (pInfo->UserSignal == OSL_SIGNAL_USER_X11SUBSYSTEMERROR) )
151  nVCLException = ExceptionCategory::UserInterface;
152 
153  if ( nVCLException != ExceptionCategory::NONE )
154  {
155  bIn = true;
156 
158  if( aLock.isAcquired())
159  {
160  // do not stop timer because otherwise the UAE-Box will not be painted as well
161  ImplSVData* pSVData = ImplGetSVData();
162  if ( pSVData->mpApp )
163  {
166  pSVData->mpApp->Exception( nVCLException );
168  }
169  }
170  bIn = false;
171  }
172 
173  return osl_Signal_ActCallNextHdl;
174 
175 }
176 
178 {
179  // The 'real' SVMain()
180  ImplSVData* pSVData = ImplGetSVData();
181 
182  SAL_WARN_IF( !pSVData->mpApp, "vcl", "no instance of class Application" );
183 
184  int nReturn = EXIT_FAILURE;
185 
186  const bool bWasInitVCL = IsVCLInit();
187  const bool bInit = bWasInitVCL || InitVCL();
188  int nRet = 0;
189  if (!bWasInitVCL && bInit && pSVData->mpDefInst->SVMainHook(&nRet))
190  return nRet;
191 
192  if( bInit )
193  {
194  // call application main
195  pSVData->maAppData.mbInAppMain = true;
196  nReturn = pSVData->mpApp->Main();
197  pSVData->maAppData.mbInAppMain = false;
198  }
199 
200  if( pSVData->mxDisplayConnection.is() )
201  {
202  pSVData->mxDisplayConnection->terminate();
203  pSVData->mxDisplayConnection.clear();
204  }
205 
206  // This is a hack to work around the problem of the asynchronous nature
207  // of bridging accessibility through Java: on shutdown there might still
208  // be some events in the AWT EventQueue, which need the SolarMutex which
209  // - on the other hand - is destroyed in DeInitVCL(). So empty the queue
210  // here ..
211  if( pSVData->mxAccessBridge.is() )
212  {
213  {
214  SolarMutexReleaser aReleaser;
215  pSVData->mxAccessBridge->dispose();
216  }
217  pSVData->mxAccessBridge.clear();
218  }
219 
221  DeInitVCL();
222 
223  return nReturn;
224 }
225 
226 int SVMain()
227 {
228  return ImplSVMain();
229 }
230 
231 // This variable is set when no Application object has been instantiated
232 // before InitVCL is called
233 static Application * pOwnSvApp = nullptr;
234 
235 // Exception handler. pExceptionHandler != NULL => VCL already inited
236 static oslSignalHandler pExceptionHandler = nullptr;
237 
238 namespace {
239 
240 class DesktopEnvironmentContext: public cppu::WeakImplHelper< css::uno::XCurrentContext >
241 {
242 public:
243  explicit DesktopEnvironmentContext( const css::uno::Reference< css::uno::XCurrentContext > & ctx)
244  : m_xNextContext( ctx ) {}
245 
246  // XCurrentContext
247  virtual css::uno::Any SAL_CALL getValueByName( const OUString& Name ) override;
248 
249 private:
250  css::uno::Reference< css::uno::XCurrentContext > m_xNextContext;
251 };
252 
253 }
254 
255 uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const OUString& Name)
256 {
257  uno::Any retVal;
258 
259  if ( Name == "system.desktop-environment" )
260  {
262  }
263  else if( m_xNextContext.is() )
264  {
265  // Call next context in chain if found
266  retVal = m_xNextContext->getValueByName( Name );
267  }
268  return retVal;
269 }
270 
271 bool IsVCLInit()
272 {
273  ImplSVData* pSVData = ImplGetSVData();
274  return pExceptionHandler != nullptr &&
275  pSVData->mpApp != nullptr &&
276  pSVData->mpDefInst != nullptr;
277 }
278 
279 #ifdef DBG_UTIL
280 namespace vclmain
281 {
282  bool isAlive()
283  {
284  return ImplGetSVData()->mpDefInst;
285  }
286 }
287 #endif
288 
289 
290 bool InitVCL()
291 {
292  if (IsVCLInit())
293  {
294  SAL_INFO("vcl.app", "Double initialization of vcl");
295  return true;
296  }
297 
298  if( pExceptionHandler != nullptr )
299  return false;
300 
302 
303  if( !ImplGetSVData()->mpApp )
304  {
305  pOwnSvApp = new Application();
306  }
307 
308  ImplSVData* pSVData = ImplGetSVData();
309 
310  // remember Main-Thread-Id
311  pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier();
312 
313  // Initialize Sal
314  pSVData->mpDefInst = CreateSalInstance();
315  if ( !pSVData->mpDefInst )
316  return false;
317 
318  // Desktop Environment context (to be able to get value of "system.desktop-environment" as soon as possible)
319  css::uno::setCurrentContext(
320  new DesktopEnvironmentContext( css::uno::getCurrentContext() ) );
321 
322  // Initialize application instance (should be done after initialization of VCL SAL part)
323  if (pSVData->mpApp)
324  {
325  // call init to initialize application class
326  // soffice/sfx implementation creates the global service manager
327  pSVData->mpApp->Init();
328  }
329 
330  try
331  {
332  //Now that uno has been bootstrapped we can ask the config what the UI language is so that we can
333  //force that in as $LANGUAGE. That way we can get gtk to render widgets RTL
334  //if we have a RTL UI in an otherwise LTR locale and get gettext using externals (e.g. python)
335  //to match their translations to our preferred UI language
336  OUString aLocaleString(SvtSysLocaleOptions().GetRealUILanguageTag().getGlibcLocaleString(".UTF-8"));
337  if (!aLocaleString.isEmpty())
338  {
339  MsLangId::getSystemUILanguage(); //call this now to pin what the system UI really was
340  OUString envVar("LANGUAGE");
341  osl_setEnvironment(envVar.pData, aLocaleString.pData);
342  }
343  }
344  catch (const uno::Exception &)
345  {
346  TOOLS_INFO_EXCEPTION("vcl.app", "Unable to get ui language:");
347  }
348 
349  pSVData->mpDefInst->AfterAppInit();
350 
351  // Fetch AppFileName and make it absolute before the workdir changes...
352  OUString aExeFileName;
353  osl_getExecutableFile( &aExeFileName.pData );
354 
355  // convert path to native file format
356  OUString aNativeFileName;
357  osl::FileBase::getSystemPathFromFileURL( aExeFileName, aNativeFileName );
358  pSVData->maAppData.mxAppFileName = aNativeFileName;
359 
360  // Initialize global data
361  pSVData->maGDIData.mxScreenFontList = std::make_shared<PhysicalFontCollection>();
362  pSVData->maGDIData.mxScreenFontCache = std::make_shared<ImplFontCache>();
364 
365  g_bIsLeanException = getenv("LO_LEAN_EXCEPTION") != nullptr;
366  // Set exception handler
367  pExceptionHandler = osl_addSignalHandler(VCLExceptionSignal_impl, nullptr);
368 
369 #ifndef NDEBUG
371 #endif
372 
373 #if OSL_DEBUG_LEVEL > 0
375 #endif
376 
377 #ifndef _WIN32
378  // Clear startup notification details for child processes
379  // See https://bugs.freedesktop.org/show_bug.cgi?id=11375 for discussion
380  unsetenv("DESKTOP_STARTUP_ID");
381 #endif
382 
383  return true;
384 }
385 
386 namespace
387 {
388 
394 class VCLUnoWrapperDeleter : public cppu::WeakImplHelper<css::lang::XEventListener>
395 {
396  virtual void SAL_CALL disposing(lang::EventObject const& rSource) override;
397 };
398 
399 void
400 VCLUnoWrapperDeleter::disposing(lang::EventObject const& /* rSource */)
401 {
402  ImplSVData* const pSVData = ImplGetSVData();
403  if (pSVData && pSVData->mpUnoWrapper)
404  {
405  pSVData->mpUnoWrapper->Destroy();
406  pSVData->mpUnoWrapper = nullptr;
407  }
408 }
409 
410 }
411 
412 void DeInitVCL()
413 {
414  // The LOK Windows map container should be empty
416 
417  //rhbz#1444437, when using LibreOffice like a library you can't realistically
418  //tear everything down and recreate them on the next call, there's too many
419  //(c++) singletons that point to stuff that gets deleted during shutdown
420  //which won't be recreated on restart.
422  return;
423 
424  {
425  SolarMutexReleaser r; // unblock threads blocked on that so we can join
426  ::comphelper::JoinAsyncEventNotifiers();
427  }
428  ImplSVData* pSVData = ImplGetSVData();
429 
430  // lp#1560328: clear cache before disposing rest of VCL
431  if(pSVData->mpBlendFrameCache)
432  pSVData->mpBlendFrameCache->m_aLastResult.Clear();
433  pSVData->mbDeInit = true;
434 
436 
437 #if OSL_DEBUG_LEVEL > 0
438  OStringBuffer aBuf( 256 );
439  aBuf.append( "DeInitVCL: some top Windows are still alive\n" );
440  tools::Long nTopWindowCount = Application::GetTopWindowCount();
441  tools::Long nBadTopWindows = nTopWindowCount;
442  for( tools::Long i = 0; i < nTopWindowCount; i++ )
443  {
445  // default window will be destroyed further down
446  // but may still be useful during deinit up to that point
447  if( pWin == pSVData->mpDefaultWin )
448  nBadTopWindows--;
449  else
450  {
451  aBuf.append( "text = \"" );
452  aBuf.append( OUStringToOString( pWin->GetText(), osl_getThreadTextEncoding() ) );
453  aBuf.append( "\" type = \"" );
454  aBuf.append( typeid(*pWin).name() );
455  aBuf.append( "\", ptr = 0x" );
456  aBuf.append( reinterpret_cast<sal_Int64>( pWin ), 16 );
457  aBuf.append( "\n" );
458  }
459  }
460  SAL_WARN_IF( nBadTopWindows!=0, "vcl", aBuf.getStr() );
461 #endif
462 
464 
465  osl_removeSignalHandler( pExceptionHandler);
466  pExceptionHandler = nullptr;
467 
468  // free global data
469  if (pSVData->maGDIData.mpGrfConverter)
470  {
471  delete pSVData->maGDIData.mpGrfConverter;
472  pSVData->maGDIData.mpGrfConverter = nullptr;
473  }
474 
475  pSVData->mpSettingsConfigItem.reset();
476 
477  // prevent unnecessary painting during Scheduler shutdown
478  // as this processes all pending events in debug builds.
480 
482 
483  pSVData->mpWinData->maMsgBoxImgList.clear();
484  pSVData->maCtrlData.maCheckImgList.clear();
485  pSVData->maCtrlData.maRadioImgList.clear();
486  pSVData->maCtrlData.mpDisclosurePlus.reset();
487  pSVData->maCtrlData.mpDisclosureMinus.reset();
488  pSVData->mpDefaultWin.disposeAndClear();
489 
490 #if defined _WIN32
491  // See GetSystemClipboard (vcl/source/treelist/transfer2.cxx):
492  if (auto const comp = css::uno::Reference<css::lang::XComponent>(
493  pSVData->m_xSystemClipboard, css::uno::UNO_QUERY))
494  {
495  SolarMutexReleaser r; // unblock pending "clipboard content changed" notifications
496  comp->dispose(); // will use CWinClipbImpl::s_aMutex
497  }
498  pSVData->m_xSystemClipboard.clear();
499 #endif
500 
501 #ifndef NDEBUG
503 #endif
504 
505  if ( pSVData->mpUnoWrapper )
506  {
507  try
508  {
509  uno::Reference<frame::XDesktop2> const xDesktop = frame::Desktop::create(
511  xDesktop->addEventListener(new VCLUnoWrapperDeleter);
512  }
513  catch (uno::Exception const&)
514  {
515  // ignore
516  }
517  }
518 
519  if( pSVData->mpApp || pSVData->maDeInitHook.IsSet() )
520  {
521  SolarMutexReleaser aReleaser;
522  // call deinit to deinitialize application class
523  // soffice/sfx implementation disposes the global service manager
524  // Warning: After this call you can't call uno services
525  if( pSVData->mpApp )
526  {
527  pSVData->mpApp->DeInit();
528  }
529  if( pSVData->maDeInitHook.IsSet() )
530  {
531  pSVData->maDeInitHook.Call(nullptr);
532  }
533  }
534 
535  if ( pSVData->maAppData.mpSettings )
536  {
537  if ( pSVData->maAppData.mpCfgListener )
538  {
539  pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().RemoveListener( pSVData->maAppData.mpCfgListener );
540  delete pSVData->maAppData.mpCfgListener;
541  }
542 
543  pSVData->maAppData.mpSettings.reset();
544  }
545  if ( pSVData->maAppData.mpAccelMgr )
546  {
547  delete pSVData->maAppData.mpAccelMgr;
548  pSVData->maAppData.mpAccelMgr = nullptr;
549  }
550  pSVData->maAppData.maKeyListeners.clear();
551  pSVData->mpBlendFrameCache.reset();
552 
554 
555  // destroy all Sal interfaces before destroying the instance
556  // and thereby unloading the plugin
557  pSVData->mpSalSystem.reset();
558  assert( !pSVData->maSchedCtx.mpSalTimer );
559  delete pSVData->maSchedCtx.mpSalTimer;
560  pSVData->maSchedCtx.mpSalTimer = nullptr;
561 
562  pSVData->mpDefaultWin = nullptr;
563  pSVData->mpIntroWindow = nullptr;
564  pSVData->maAppData.mpActivePopupMenu = nullptr;
565  pSVData->maAppData.mpWheelWindow = nullptr;
566  pSVData->maGDIData.mpFirstWinGraphics = nullptr;
567  pSVData->maGDIData.mpLastWinGraphics = nullptr;
568  pSVData->maGDIData.mpFirstVirGraphics = nullptr;
569  pSVData->maGDIData.mpLastVirGraphics = nullptr;
570  pSVData->maGDIData.mpFirstPrnGraphics = nullptr;
571  pSVData->maGDIData.mpLastPrnGraphics = nullptr;
572  pSVData->maGDIData.mpFirstVirDev = nullptr;
573  pSVData->maGDIData.mpFirstPrinter = nullptr;
574  pSVData->maFrameData.mpFirstFrame = nullptr;
575  pSVData->maFrameData.mpAppWin = nullptr;
576  pSVData->maFrameData.mpActiveApplicationFrame = nullptr;
577  pSVData->mpWinData->mpCaptureWin = nullptr;
578  pSVData->mpWinData->mpLastDeacWin = nullptr;
579  pSVData->mpWinData->mpFirstFloat = nullptr;
580  pSVData->mpWinData->mpExecuteDialogs.clear();
581  pSVData->mpWinData->mpExtTextInputWin = nullptr;
582  pSVData->mpWinData->mpTrackWin = nullptr;
583  pSVData->mpWinData->mpAutoScrollWin = nullptr;
584  pSVData->mpWinData->mpLastWheelWindow = nullptr;
585 
586  pSVData->maGDIData.mxScreenFontList.reset();
587  pSVData->maGDIData.mxScreenFontCache.reset();
589  { return true; });
590 
592  pSVData->maGDIData.maThemeImageCache.clear();
593 
594  // Deinit Sal
595  if (pSVData->mpDefInst)
596  {
597  DestroySalInstance( pSVData->mpDefInst );
598  pSVData->mpDefInst = nullptr;
599  }
600 
601  if( pOwnSvApp )
602  {
603  delete pOwnSvApp;
604  pOwnSvApp = nullptr;
605  }
606 
608 }
609 
610 namespace {
611 
612 // only one call is allowed
613 struct WorkerThreadData
614 {
615  oslWorkerFunction pWorker;
616  void * pThreadData;
617  WorkerThreadData( oslWorkerFunction pWorker_, void * pThreadData_ )
618  : pWorker( pWorker_ )
619  , pThreadData( pThreadData_ )
620  {
621  }
622 };
623 
624 }
625 
626 #ifdef _WIN32
627 static HANDLE hThreadID = nullptr;
628 static unsigned __stdcall threadmain( void *pArgs )
629 {
630  OleInitialize( nullptr );
631  static_cast<WorkerThreadData*>(pArgs)->pWorker( static_cast<WorkerThreadData*>(pArgs)->pThreadData );
632  delete static_cast<WorkerThreadData*>(pArgs);
633  OleUninitialize();
634  hThreadID = nullptr;
635  return 0;
636 }
637 #else
638 static oslThread hThreadID = nullptr;
639 extern "C"
640 {
641 static void MainWorkerFunction( void* pArgs )
642 {
643  static_cast<WorkerThreadData*>(pArgs)->pWorker( static_cast<WorkerThreadData*>(pArgs)->pThreadData );
644  delete static_cast<WorkerThreadData*>(pArgs);
645  hThreadID = nullptr;
646 }
647 } // extern "C"
648 #endif
649 
650 void CreateMainLoopThread( oslWorkerFunction pWorker, void * pThreadData )
651 {
652 #ifdef _WIN32
653  // sal thread always call CoInitializeEx, so a system dependent implementation is necessary
654 
655  unsigned uThreadID;
656  hThreadID = reinterpret_cast<HANDLE>(_beginthreadex(
657  nullptr, // no security handle
658  0, // stacksize 0 means default
659  threadmain, // thread worker function
660  new WorkerThreadData( pWorker, pThreadData ), // arguments for worker function
661  0, // 0 means: create immediately otherwise use CREATE_SUSPENDED
662  &uThreadID )); // thread id to fill
663 #else
664  hThreadID = osl_createThread( MainWorkerFunction, new WorkerThreadData( pWorker, pThreadData ) );
665 #endif
666 }
667 
669 {
670  if( hThreadID )
671  {
672 #ifdef _WIN32
673  WaitForSingleObject(hThreadID, INFINITE);
674 #else
675  osl_joinWithThread(hThreadID);
676  osl_destroyThread( hThreadID );
677 #endif
678  }
679 }
680 
681 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static vcl::Window * GetTopWindow(tools::Long nIndex)
Get the nth top window.
Definition: svapp.cxx:1077
EXITHELPER_NORMAL_RESTART
std::unique_ptr< SalSystem > mpSalSystem
Definition: svdata.hxx:385
oslThreadIdentifier mnMainThreadId
Definition: svdata.hxx:401
VCL_DLLPUBLIC void shutdown()
a crude form of life cycle control (called from DeInitVCL; otherwise, if the ImplImageTree singleton ...
Definition: ImageTree.cxx:57
tuple ctx
Link< LinkParamNone *, void > maDeInitHook
Definition: svdata.hxx:415
std::pair< Key, Value > key_value_pair_t
static tools::Long GetTopWindowCount()
Return the number of top-level windows being used by the application.
Definition: svapp.cxx:1063
ImplSVAppData maAppData
Definition: svdata.hxx:389
long Long
void disposeAndClear()
Definition: vclptr.hxx:200
VclPtr< OutputDevice > mpLastVirGraphics
Definition: svdata.hxx:214
std::unique_ptr< vcl::SettingsConfigItem > mpSettingsConfigItem
Definition: svdata.hxx:405
VclPtr< PopupMenu > mpActivePopupMenu
Definition: svdata.hxx:144
css::uno::Reference< css::lang::XComponent > mxAccessBridge
Definition: svdata.hxx:404
std::unique_ptr< AllSettings > mpSettings
Definition: svdata.hxx:132
int SVMain()
Definition: svmain.cxx:226
aBuf
void JoinMainLoopThread()
Definition: svmain.cxx:668
SalTimer * mpSalTimer
interface to sal event loop / system timer
Definition: svdata.hxx:369
OUString Name
std::vector< Link< VclWindowEvent &, bool > > maKeyListeners
Definition: svdata.hxx:136
virtual void Exception(ExceptionCategory nCategory)
Handles an error.
Definition: svapp.cxx:241
ImplSVGDIData maGDIData
Definition: svdata.hxx:390
std::optional< OUString > mxAppFileName
Definition: svdata.hxx:140
static const OUString & GetDesktopEnvironment()
Get the desktop environment the process is currently running in.
Definition: svapp.cxx:1585
ImplSVCtrlData maCtrlData
Definition: svdata.hxx:393
void DestroySalInstance(SalInstance *pInst)
Definition: salplug.cxx:283
static VCL_DLLPUBLIC ImageTree & get()
Definition: ImageTree.cxx:16
std::unique_ptr< BlendFrameCache > mpBlendFrameCache
Definition: svdata.hxx:399
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
VclPtr< OutputDevice > mpFirstWinGraphics
Definition: svdata.hxx:211
A helper class that calls Application::ReleaseSolarMutex() in its constructor and restores the mutex ...
Definition: svapp.hxx:1404
static void MainWorkerFunction(void *pArgs)
Definition: svmain.cxx:641
static void hardDisable()
basegfx::SystemDependentDataManager & ImplGetSystemDependentDataManager()
Definition: svdata.cxx:203
static void stop()
Definition: watchdog.cxx:148
VclPtr< VirtualDevice > mpFirstVirDev
Definition: svdata.hxx:217
virtual OUString GetText() const
Definition: window.cxx:3036
static SystemWindowFlags GetSystemWindowMode()
Get the system window mode of dialogs.
Definition: svapp.cxx:1439
ExceptionCategory
void CreateMainLoopThread(oslWorkerFunction pWorker, void *pThreadData)
Definition: svmain.cxx:650
tuple comp
o3tl::lru_map< OUString, BitmapEx > maThemeImageCache
Definition: svdata.hxx:230
VclPtr< ImplWheelWindow > mpWheelWindow
Definition: svdata.hxx:145
virtual void AfterAppInit()
Definition: salinst.hxx:88
GraphicConverter * mpGrfConverter
Definition: svdata.hxx:225
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:76
VclPtr< Printer > mpFirstPrinter
Definition: svdata.hxx:219
void DbgGUIDeInitSolarMutexCheck()
Definition: dbggui.cxx:43
std::vector< VclPtr< Dialog > > mpExecuteDialogs
Stack of dialogs that are Execute()'d - the last one is the top most one.
Definition: svdata.hxx:251
VclPtr< vcl::Window > mpCaptureWin
Definition: svdata.hxx:248
static void hardDisable()
Called from a signal handler or watchdog thread if we get a crash or hang in some GL code...
int i
VclPtr< vcl::Window > mpIntroWindow
Definition: svdata.hxx:397
static oslSignalHandler pExceptionHandler
Definition: svmain.cxx:236
static void SetSystemWindowMode(SystemWindowFlags nMode)
Make a dialog box a system window or not.
Definition: svapp.cxx:1434
static LanguageType getSystemUILanguage()
std::vector< Image > maMsgBoxImgList
Definition: svdata.hxx:255
Mutex aLock
SystemWindowFlags
Definition: svapp.hxx:85
std::unique_ptr< Image > mpDisclosureMinus
Definition: svdata.hxx:273
VclPtr< vcl::Window > mpLastWheelWindow
Definition: svdata.hxx:257
VclPtr< WorkWindow > mpAppWin
Definition: svdata.hxx:239
virtual bool SVMainHook(int *)
Definition: salinst.hxx:89
static void clearTemporaryFontFiles()
Removes all temporary fonts in the path used by fileUrlForTemporaryFont().
LocaleConfigurationListener * mpCfgListener
Definition: svdata.hxx:133
void DeInitVCL()
Definition: svmain.cxx:412
static void hardDisable()
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:230
VclPtr< vcl::Window > mpLastDeacWin
Definition: svdata.hxx:249
o3tl::lru_map< OUString, gfx::DrawRoot > maThemeDrawCommandsCache
Definition: svdata.hxx:231
int ImplSVMain()
Definition: svmain.cxx:177
VclPtr< vcl::Window > mpTrackWin
Definition: svdata.hxx:253
void DbgGUIInitSolarMutexCheck()
Definition: dbggui.cxx:38
ImplSchedulerContext maSchedCtx
Definition: svdata.hxx:388
static bool isInZone()
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
static bool IsLOKWindowsEmpty()
check if LOK Window container is empty
Definition: window.cxx:3183
#define TOOLS_INFO_EXCEPTION(area, stream)
SalInstance * CreateSalInstance()
Definition: salplug.cxx:228
virtual void Init()
Initialize the application itself.
Definition: svapp.cxx:196
VclPtr< vcl::Window > mpExtTextInputWin
Definition: svdata.hxx:252
static bool g_bIsLeanException
Definition: svmain.cxx:109
std::vector< Image > maCheckImgList
Definition: svdata.hxx:270
#define SAL_WARN_IF(condition, area, stream)
std::vector< Image > maRadioImgList
Definition: svdata.hxx:271
ImplSVFrameData maFrameData
Definition: svdata.hxx:391
VclPtr< OutputDevice > mpLastWinGraphics
Definition: svdata.hxx:212
VclPtr< vcl::Window > mpAutoScrollWin
Definition: svdata.hxx:256
#define SAL_INFO(area, stream)
VclPtr< vcl::Window > mpActiveApplicationFrame
Definition: svdata.hxx:238
VclPtr< OutputDevice > mpFirstVirGraphics
Definition: svdata.hxx:213
bool mbDeInit
Definition: svdata.hxx:384
std::shared_ptr< ImplFontCache > mxScreenFontCache
Definition: svdata.hxx:222
Reference< XComponentContext > getProcessComponentContext()
bool InitVCL()
Definition: svmain.cxx:290
bool IsVCLInit()
Definition: svmain.cxx:271
bool isAlive()
Definition: svmain.cxx:282
VclPtr< FloatingWindow > mpFirstFloat
Definition: svdata.hxx:250
std::unique_ptr< Image > mpDisclosurePlus
Definition: svdata.hxx:272
virtual void DeInit()
Deinitialized the application itself.
Definition: svapp.cxx:204
VclPtr< OutputDevice > mpFirstPrnGraphics
Definition: svdata.hxx:215
static oslThread hThreadID
Definition: svmain.cxx:638
static void SAL_DLLPRIVATE ImplDeleteOnDeInit()
Definition: lazydelete.cxx:46
VclPtr< vcl::Window > mpFirstFrame
Definition: svdata.hxx:237
Application * mpApp
Definition: svdata.hxx:382
ImplAccelManager * mpAccelMgr
Definition: svdata.hxx:138
static DebugEventInjector * getCreate()
Definition: debugevent.cxx:257
guard class that uses tryToAcquire() and has isAcquired() to check
Definition: svapp.hxx:1355
VclPtr< OutputDevice > mpLastPrnGraphics
Definition: svdata.hxx:216
lru_scale_cache maScaleCache
Definition: svdata.hxx:223
rtl::Reference< vcl::DisplayConnectionDispatch > mxDisplayConnection
Definition: svdata.hxx:402
static oslSignalAction VCLExceptionSignal_impl(void *, oslSignalInfo *pInfo)
Definition: svmain.cxx:111
UnoWrapperBase * mpUnoWrapper
Definition: svdata.hxx:396
bool mbInAppMain
Definition: svdata.hxx:150
std::shared_ptr< PhysicalFontCollection > mxScreenFontList
Definition: svdata.hxx:221
static void ImplDeInitScheduler()
Definition: scheduler.cxx:101
void remove_if(UnaryPredicate pred)
SalInstance * mpDefInst
Definition: svdata.hxx:381
static Application * pOwnSvApp
Definition: svmain.cxx:233
ImplSVWinData * mpWinData
Definition: svdata.hxx:392
virtual int Main()
Pure virtual entrypoint to the application.
Definition: svapp.cxx:175
VclPtr< WorkWindow > mpDefaultWin
Definition: svdata.hxx:383