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/svapp.hxx>
35 #include <vcl/vclmain.hxx>
36 #include <vcl/wrkwin.hxx>
37 #include <vcl/cvtgrf.hxx>
38 #include <vcl/scheduler.hxx>
39 #include <vcl/image.hxx>
40 #include <vcl/ImageTree.hxx>
41 #include <vcl/settings.hxx>
42 #include <vcl/toolkit/unowrap.hxx>
43 #include <configsettings.hxx>
44 #include <vcl/lazydelete.hxx>
46 #include <vcl/toolkit/dialog.hxx>
47 #include <vcl/menu.hxx>
48 #include <vcl/virdev.hxx>
49 #include <vcl/print.hxx>
50 #include <debugevent.hxx>
51 #include <scrwnd.hxx>
52 
53 #ifdef _WIN32
54 #include <svsys.h>
55 #include <process.h>
56 #include <ole2.h>
57 #else
58 #include <stdlib.h>
59 #endif
60 
61 #ifdef ANDROID
62 #include <cppuhelper/bootstrap.hxx>
63 #include <jni.h>
64 #endif
65 
66 #include <impfontcache.hxx>
67 #include <salinst.hxx>
68 #include <svdata.hxx>
69 #include <vcl/svmain.hxx>
70 #include <dbggui.hxx>
71 #include <accmgr.hxx>
73 #include <print.h>
74 #include <salsys.hxx>
75 #include <saltimer.hxx>
77 
78 #include <config_features.h>
79 #include <config_feature_opencl.h>
80 
81 #include <osl/process.h>
82 #include <com/sun/star/lang/XComponent.hpp>
83 #include <com/sun/star/frame/Desktop.hpp>
84 
85 #include <comphelper/lok.hxx>
86 #include <cppuhelper/implbase.hxx>
87 #include <uno/current_context.hxx>
88 
89 #include <opencl/OpenCLZone.hxx>
90 #include <opengl/zone.hxx>
91 #include <skia/zone.hxx>
92 #include <watchdog.hxx>
93 
95 #include <tools/diagnose_ex.h>
96 
97 #if OSL_DEBUG_LEVEL > 0
98 #include <typeinfo>
99 #include <rtl/strbuf.hxx>
100 #endif
101 
102 using namespace ::com::sun::star;
103 
104 static bool g_bIsLeanException;
105 
106 static oslSignalAction VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo)
107 {
108  static volatile bool bIn = false;
109 
110  // if we crash again, bail out immediately
111  if ( bIn || g_bIsLeanException)
112  return osl_Signal_ActCallNextHdl;
113 
115 
116  // UAE
117  if ( (pInfo->Signal == osl_Signal_AccessViolation) ||
118  (pInfo->Signal == osl_Signal_IntegerDivideByZero) ||
119  (pInfo->Signal == osl_Signal_FloatDivideByZero) ||
120  (pInfo->Signal == osl_Signal_DebugBreak) )
121  {
122  nVCLException = ExceptionCategory::System;
123 #if HAVE_FEATURE_OPENGL
124  if (OpenGLZone::isInZone())
126 #endif
127 #if HAVE_FEATURE_SKIA
128  if (SkiaZone::isInZone())
130 #endif
131 #if HAVE_FEATURE_OPENCL
132  if (OpenCLZone::isInZone())
133  {
135 #ifdef _WIN32
136  if (OpenCLInitialZone::isInZone())
137  TerminateProcess(GetCurrentProcess(), EXITHELPER_NORMAL_RESTART);
138 #endif
139  }
140 #endif
141  }
142 
143  // RC
144  if ((pInfo->Signal == osl_Signal_User) &&
145  (pInfo->UserSignal == OSL_SIGNAL_USER_RESOURCEFAILURE) )
146  nVCLException = ExceptionCategory::ResourceNotLoaded;
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  long nTopWindowCount = Application::GetTopWindowCount();
441  long nBadTopWindows = nTopWindowCount;
442  for( 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( 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 #endif
499 
500 #ifndef NDEBUG
502 #endif
503 
504  if ( pSVData->mpUnoWrapper )
505  {
506  try
507  {
508  uno::Reference<frame::XDesktop2> const xDesktop = frame::Desktop::create(
510  xDesktop->addEventListener(new VCLUnoWrapperDeleter);
511  }
512  catch (uno::Exception const&)
513  {
514  // ignore
515  }
516  }
517 
518  if( pSVData->mpApp || pSVData->maDeInitHook.IsSet() )
519  {
520  SolarMutexReleaser aReleaser;
521  // call deinit to deinitialize application class
522  // soffice/sfx implementation disposes the global service manager
523  // Warning: After this call you can't call uno services
524  if( pSVData->mpApp )
525  {
526  pSVData->mpApp->DeInit();
527  }
528  if( pSVData->maDeInitHook.IsSet() )
529  {
530  pSVData->maDeInitHook.Call(nullptr);
531  }
532  }
533 
534  if ( pSVData->maAppData.mpSettings )
535  {
536  if ( pSVData->maAppData.mpCfgListener )
537  {
538  pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().RemoveListener( pSVData->maAppData.mpCfgListener );
539  delete pSVData->maAppData.mpCfgListener;
540  }
541 
542  pSVData->maAppData.mpSettings.reset();
543  }
544  if ( pSVData->maAppData.mpAccelMgr )
545  {
546  delete pSVData->maAppData.mpAccelMgr;
547  pSVData->maAppData.mpAccelMgr = nullptr;
548  }
549  pSVData->maAppData.maKeyListeners.clear();
550  pSVData->mpBlendFrameCache.reset();
551 
553 
554  // destroy all Sal interfaces before destroying the instance
555  // and thereby unloading the plugin
556  pSVData->mpSalSystem.reset();
557  assert( !pSVData->maSchedCtx.mpSalTimer );
558  delete pSVData->maSchedCtx.mpSalTimer;
559  pSVData->maSchedCtx.mpSalTimer = nullptr;
560 
561  pSVData->mpDefaultWin = nullptr;
562  pSVData->mpIntroWindow = nullptr;
563  pSVData->maAppData.mpActivePopupMenu = nullptr;
564  pSVData->maAppData.mpWheelWindow = nullptr;
565  pSVData->maGDIData.mpFirstWinGraphics = nullptr;
566  pSVData->maGDIData.mpLastWinGraphics = nullptr;
567  pSVData->maGDIData.mpFirstVirGraphics = nullptr;
568  pSVData->maGDIData.mpLastVirGraphics = nullptr;
569  pSVData->maGDIData.mpFirstPrnGraphics = nullptr;
570  pSVData->maGDIData.mpLastPrnGraphics = nullptr;
571  pSVData->maGDIData.mpFirstVirDev = nullptr;
572  pSVData->maGDIData.mpFirstPrinter = nullptr;
573  pSVData->maFrameData.mpFirstFrame = nullptr;
574  pSVData->maFrameData.mpAppWin = nullptr;
575  pSVData->maFrameData.mpActiveApplicationFrame = nullptr;
576  pSVData->mpWinData->mpCaptureWin = nullptr;
577  pSVData->mpWinData->mpLastDeacWin = nullptr;
578  pSVData->mpWinData->mpFirstFloat = nullptr;
579  pSVData->mpWinData->mpExecuteDialogs.clear();
580  pSVData->mpWinData->mpExtTextInputWin = nullptr;
581  pSVData->mpWinData->mpTrackWin = nullptr;
582  pSVData->mpWinData->mpAutoScrollWin = nullptr;
583  pSVData->mpWinData->mpLastWheelWindow = nullptr;
584 
585  pSVData->maGDIData.mxScreenFontList.reset();
586  pSVData->maGDIData.mxScreenFontCache.reset();
588  { return true; });
589 
591  pSVData->maGDIData.maThemeImageCache.clear();
592 
593  // Deinit Sal
594  if (pSVData->mpDefInst)
595  {
596  DestroySalInstance( pSVData->mpDefInst );
597  pSVData->mpDefInst = nullptr;
598  }
599 
600  if( pOwnSvApp )
601  {
602  delete pOwnSvApp;
603  pOwnSvApp = nullptr;
604  }
605 
607 }
608 
609 namespace {
610 
611 // only one call is allowed
612 struct WorkerThreadData
613 {
614  oslWorkerFunction const pWorker;
615  void * const pThreadData;
616  WorkerThreadData( oslWorkerFunction pWorker_, void * pThreadData_ )
617  : pWorker( pWorker_ )
618  , pThreadData( pThreadData_ )
619  {
620  }
621 };
622 
623 }
624 
625 #ifdef _WIN32
626 static HANDLE hThreadID = nullptr;
627 static unsigned __stdcall threadmain( void *pArgs )
628 {
629  OleInitialize( nullptr );
630  static_cast<WorkerThreadData*>(pArgs)->pWorker( static_cast<WorkerThreadData*>(pArgs)->pThreadData );
631  delete static_cast<WorkerThreadData*>(pArgs);
632  OleUninitialize();
633  hThreadID = nullptr;
634  return 0;
635 }
636 #else
637 static oslThread hThreadID = nullptr;
638 extern "C"
639 {
640 static void MainWorkerFunction( void* pArgs )
641 {
642  static_cast<WorkerThreadData*>(pArgs)->pWorker( static_cast<WorkerThreadData*>(pArgs)->pThreadData );
643  delete static_cast<WorkerThreadData*>(pArgs);
644  hThreadID = nullptr;
645 }
646 } // extern "C"
647 #endif
648 
649 void CreateMainLoopThread( oslWorkerFunction pWorker, void * pThreadData )
650 {
651 #ifdef _WIN32
652  // sal thread always call CoInitializeEx, so a system dependent implementation is necessary
653 
654  unsigned uThreadID;
655  hThreadID = reinterpret_cast<HANDLE>(_beginthreadex(
656  nullptr, // no security handle
657  0, // stacksize 0 means default
658  threadmain, // thread worker function
659  new WorkerThreadData( pWorker, pThreadData ), // arguments for worker function
660  0, // 0 means: create immediately otherwise use CREATE_SUSPENDED
661  &uThreadID )); // thread id to fill
662 #else
663  hThreadID = osl_createThread( MainWorkerFunction, new WorkerThreadData( pWorker, pThreadData ) );
664 #endif
665 }
666 
668 {
669  if( hThreadID )
670  {
671 #ifdef _WIN32
672  WaitForSingleObject(hThreadID, INFINITE);
673 #else
674  osl_joinWithThread(hThreadID);
675  osl_destroyThread( hThreadID );
676 #endif
677  }
678 }
679 
680 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
EXITHELPER_NORMAL_RESTART
std::unique_ptr< SalSystem > mpSalSystem
Definition: svdata.hxx:348
o3tl::optional< OUString > mxAppFileName
Definition: svdata.hxx:141
oslThreadIdentifier mnMainThreadId
Definition: svdata.hxx:367
VCL_DLLPUBLIC void shutdown()
a crude form of life cycle control (called from DeInitVCL; otherwise, if the ImplImageTree singleton ...
Definition: ImageTree.cxx:57
static vcl::Window * GetTopWindow(long nIndex)
Get the nth top window.
Definition: svapp.cxx:1082
Link< LinkParamNone *, void > maDeInitHook
Definition: svdata.hxx:381
std::pair< Key, Value > key_value_pair_t
ImplSVAppData maAppData
Definition: svdata.hxx:355
void disposeAndClear()
Definition: vclptr.hxx:200
VclPtr< OutputDevice > mpLastVirGraphics
Definition: svdata.hxx:177
std::unique_ptr< vcl::SettingsConfigItem > mpSettingsConfigItem
Definition: svdata.hxx:371
VclPtr< PopupMenu > mpActivePopupMenu
Definition: svdata.hxx:145
css::uno::Reference< css::lang::XComponent > mxAccessBridge
Definition: svdata.hxx:370
std::unique_ptr< AllSettings > mpSettings
Definition: svdata.hxx:134
int SVMain()
Definition: svmain.cxx:226
aBuf
void JoinMainLoopThread()
Definition: svmain.cxx:667
SalTimer * mpSalTimer
interface to sal event loop / system timer
Definition: svdata.hxx:332
OUString Name
virtual void Exception(ExceptionCategory nCategory)
Handles an error.
Definition: svapp.cxx:234
ImplSVGDIData maGDIData
Definition: svdata.hxx:356
static const OUString & GetDesktopEnvironment()
Get the desktop environment the process is currently running in.
Definition: svapp.cxx:1567
ImplSVCtrlData maCtrlData
Definition: svdata.hxx:359
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:365
VclPtr< OutputDevice > mpFirstWinGraphics
Definition: svdata.hxx:174
A helper class that calls Application::ReleaseSolarMutex() in its constructor and restores the mutex ...
Definition: svapp.hxx:1416
static void MainWorkerFunction(void *pArgs)
Definition: svmain.cxx:640
static void hardDisable()
o3tl::lru_map< SalBitmap *, BitmapEx > maScaleCache
Definition: svdata.hxx:186
basegfx::SystemDependentDataManager & ImplGetSystemDependentDataManager()
Definition: svdata.cxx:202
static void stop()
Definition: watchdog.cxx:147
VclPtr< VirtualDevice > mpFirstVirDev
Definition: svdata.hxx:180
virtual OUString GetText() const
Definition: window.cxx:3106
static SystemWindowFlags GetSystemWindowMode()
Get the system window mode of dialogs.
Definition: svapp.cxx:1421
ExceptionCategory
void CreateMainLoopThread(oslWorkerFunction pWorker, void *pThreadData)
Definition: svmain.cxx:649
tuple comp
o3tl::lru_map< OUString, BitmapEx > maThemeImageCache
Definition: svdata.hxx:193
VclPtr< ImplWheelWindow > mpWheelWindow
Definition: svdata.hxx:146
virtual void AfterAppInit()
Definition: salinst.hxx:91
GraphicConverter * mpGrfConverter
Definition: svdata.hxx:188
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
VclPtr< Printer > mpFirstPrinter
Definition: svdata.hxx:182
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:214
virtual void Destroy()=0
VclPtr< vcl::Window > mpCaptureWin
Definition: svdata.hxx:211
static void hardDisable()
Called from a signal handler or watchdog thread if we get a crash or hang in some GL code...
VclPtr< vcl::Window > mpIntroWindow
Definition: svdata.hxx:363
static long GetTopWindowCount()
Return the number of top-level windows being used by the application.
Definition: svapp.cxx:1068
static oslSignalHandler pExceptionHandler
Definition: svmain.cxx:236
static void SetSystemWindowMode(SystemWindowFlags nMode)
Make a dialog box a system window or not.
Definition: svapp.cxx:1416
static LanguageType getSystemUILanguage()
std::vector< Image > maMsgBoxImgList
Definition: svdata.hxx:218
Mutex aLock
SystemWindowFlags
Definition: svapp.hxx:92
std::unique_ptr< Image > mpDisclosureMinus
Definition: svdata.hxx:236
VclPtr< vcl::Window > mpLastWheelWindow
Definition: svdata.hxx:220
int i
VclPtr< WorkWindow > mpAppWin
Definition: svdata.hxx:202
virtual bool SVMainHook(int *)
Definition: salinst.hxx:92
static void clearTemporaryFontFiles()
Removes all temporary fonts in the path used by fileUrlForTemporaryFont().
LocaleConfigurationListener * mpCfgListener
Definition: svdata.hxx:135
void DeInitVCL()
Definition: svmain.cxx:412
static void hardDisable()
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:237
tuple ctx
VclPtr< vcl::Window > mpLastDeacWin
Definition: svdata.hxx:212
o3tl::lru_map< OUString, gfx::DrawRoot > maThemeDrawCommandsCache
Definition: svdata.hxx:194
int ImplSVMain()
Definition: svmain.cxx:177
VclPtr< vcl::Window > mpTrackWin
Definition: svdata.hxx:216
void DbgGUIInitSolarMutexCheck()
Definition: dbggui.cxx:38
ImplSchedulerContext maSchedCtx
Definition: svdata.hxx:354
static bool isInZone()
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
static bool IsLOKWindowsEmpty()
check if LOK Window container is empty
Definition: window.cxx:3253
#define TOOLS_INFO_EXCEPTION(area, stream)
SalInstance * CreateSalInstance()
Definition: salplug.cxx:228
virtual void Init()
Initialize the application itself.
Definition: svapp.cxx:189
VclPtr< vcl::Window > mpExtTextInputWin
Definition: svdata.hxx:215
static bool g_bIsLeanException
Definition: svmain.cxx:104
std::vector< Image > maCheckImgList
Definition: svdata.hxx:233
#define SAL_WARN_IF(condition, area, stream)
std::vector< Image > maRadioImgList
Definition: svdata.hxx:234
ImplSVFrameData maFrameData
Definition: svdata.hxx:357
VclPtr< OutputDevice > mpLastWinGraphics
Definition: svdata.hxx:175
VclPtr< vcl::Window > mpAutoScrollWin
Definition: svdata.hxx:219
#define SAL_INFO(area, stream)
VclPtr< vcl::Window > mpActiveApplicationFrame
Definition: svdata.hxx:201
VclPtr< OutputDevice > mpFirstVirGraphics
Definition: svdata.hxx:176
bool mbDeInit
Definition: svdata.hxx:347
std::shared_ptr< ImplFontCache > mxScreenFontCache
Definition: svdata.hxx:185
SVAppKeyListeners maKeyListeners
Definition: svdata.hxx:137
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:213
std::unique_ptr< Image > mpDisclosurePlus
Definition: svdata.hxx:235
virtual void DeInit()
Deinitialized the application itself.
Definition: svapp.cxx:197
VclPtr< OutputDevice > mpFirstPrnGraphics
Definition: svdata.hxx:178
static oslThread hThreadID
Definition: svmain.cxx:637
static void SAL_DLLPRIVATE ImplDeleteOnDeInit()
Definition: lazydelete.cxx:46
VclPtr< vcl::Window > mpFirstFrame
Definition: svdata.hxx:200
Application * mpApp
Definition: svdata.hxx:345
ImplAccelManager * mpAccelMgr
Definition: svdata.hxx:139
static DebugEventInjector * getCreate()
Definition: debugevent.cxx:257
guard class that uses tryToAcquire() and has isAcquired() to check
Definition: svapp.hxx:1367
VclPtr< OutputDevice > mpLastPrnGraphics
Definition: svdata.hxx:179
rtl::Reference< vcl::DisplayConnectionDispatch > mxDisplayConnection
Definition: svdata.hxx:368
static oslSignalAction VCLExceptionSignal_impl(void *, oslSignalInfo *pInfo)
Definition: svmain.cxx:106
UnoWrapperBase * mpUnoWrapper
Definition: svdata.hxx:362
bool mbInAppMain
Definition: svdata.hxx:151
std::shared_ptr< PhysicalFontCollection > mxScreenFontList
Definition: svdata.hxx:184
static void ImplDeInitScheduler()
Definition: scheduler.cxx:101
void remove_if(UnaryPredicate pred)
SalInstance * mpDefInst
Definition: svdata.hxx:344
static Application * pOwnSvApp
Definition: svmain.cxx:233
ImplSVWinData * mpWinData
Definition: svdata.hxx:358
virtual int Main()
Pure virtual entrypoint to the application.
Definition: svapp.cxx:172
VclPtr< WorkWindow > mpDefaultWin
Definition: svdata.hxx:346