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  // RC
149  if ((pInfo->Signal == osl_Signal_User) &&
150  (pInfo->UserSignal == OSL_SIGNAL_USER_RESOURCEFAILURE) )
151  nVCLException = ExceptionCategory::ResourceNotLoaded;
152 
153  // DISPLAY-Unix
154  if ((pInfo->Signal == osl_Signal_User) &&
155  (pInfo->UserSignal == OSL_SIGNAL_USER_X11SUBSYSTEMERROR) )
156  nVCLException = ExceptionCategory::UserInterface;
157 
158  if ( nVCLException != ExceptionCategory::NONE )
159  {
160  bIn = true;
161 
163  if( aLock.isAcquired())
164  {
165  // do not stop timer because otherwise the UAE-Box will not be painted as well
166  ImplSVData* pSVData = ImplGetSVData();
167  if ( pSVData->mpApp )
168  {
171  pSVData->mpApp->Exception( nVCLException );
173  }
174  }
175  bIn = false;
176  }
177 
178  return osl_Signal_ActCallNextHdl;
179 
180 }
181 
183 {
184  // The 'real' SVMain()
185  ImplSVData* pSVData = ImplGetSVData();
186 
187  SAL_WARN_IF( !pSVData->mpApp, "vcl", "no instance of class Application" );
188 
189  int nReturn = EXIT_FAILURE;
190 
191  const bool bWasInitVCL = IsVCLInit();
192  const bool bInit = bWasInitVCL || InitVCL();
193  int nRet = 0;
194  if (!bWasInitVCL && bInit && pSVData->mpDefInst->SVMainHook(&nRet))
195  return nRet;
196 
197  if( bInit )
198  {
199  // call application main
200  pSVData->maAppData.mbInAppMain = true;
201  nReturn = pSVData->mpApp->Main();
202  pSVData->maAppData.mbInAppMain = false;
203  }
204 
205  if( pSVData->mxDisplayConnection.is() )
206  {
207  pSVData->mxDisplayConnection->terminate();
208  pSVData->mxDisplayConnection.clear();
209  }
210 
211  // This is a hack to work around the problem of the asynchronous nature
212  // of bridging accessibility through Java: on shutdown there might still
213  // be some events in the AWT EventQueue, which need the SolarMutex which
214  // - on the other hand - is destroyed in DeInitVCL(). So empty the queue
215  // here ..
216  if( pSVData->mxAccessBridge.is() )
217  {
218  {
219  SolarMutexReleaser aReleaser;
220  pSVData->mxAccessBridge->dispose();
221  }
222  pSVData->mxAccessBridge.clear();
223  }
224 
226  DeInitVCL();
227 
228  return nReturn;
229 }
230 
231 int SVMain()
232 {
233  return ImplSVMain();
234 }
235 
236 // This variable is set when no Application object has been instantiated
237 // before InitVCL is called
238 static Application * pOwnSvApp = nullptr;
239 
240 // Exception handler. pExceptionHandler != NULL => VCL already inited
241 static oslSignalHandler pExceptionHandler = nullptr;
242 
243 namespace {
244 
245 class DesktopEnvironmentContext: public cppu::WeakImplHelper< css::uno::XCurrentContext >
246 {
247 public:
248  explicit DesktopEnvironmentContext( const css::uno::Reference< css::uno::XCurrentContext > & ctx)
249  : m_xNextContext( ctx ) {}
250 
251  // XCurrentContext
252  virtual css::uno::Any SAL_CALL getValueByName( const OUString& Name ) override;
253 
254 private:
255  css::uno::Reference< css::uno::XCurrentContext > m_xNextContext;
256 };
257 
258 }
259 
260 uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const OUString& Name)
261 {
262  uno::Any retVal;
263 
264  if ( Name == "system.desktop-environment" )
265  {
267  }
268  else if( m_xNextContext.is() )
269  {
270  // Call next context in chain if found
271  retVal = m_xNextContext->getValueByName( Name );
272  }
273  return retVal;
274 }
275 
276 bool IsVCLInit()
277 {
278  ImplSVData* pSVData = ImplGetSVData();
279  return pExceptionHandler != nullptr &&
280  pSVData->mpApp != nullptr &&
281  pSVData->mpDefInst != nullptr;
282 }
283 
284 #ifdef DBG_UTIL
285 namespace vclmain
286 {
287  bool isAlive()
288  {
289  return ImplGetSVData()->mpDefInst;
290  }
291 }
292 #endif
293 
294 
295 bool InitVCL()
296 {
297  if (IsVCLInit())
298  {
299  SAL_INFO("vcl.app", "Double initialization of vcl");
300  return true;
301  }
302 
303  if( pExceptionHandler != nullptr )
304  return false;
305 
307 
308  if( !ImplGetSVData()->mpApp )
309  {
310  pOwnSvApp = new Application();
311  }
312 
313  ImplSVData* pSVData = ImplGetSVData();
314 
315  // remember Main-Thread-Id
316  pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier();
317 
318  // Initialize Sal
319  pSVData->mpDefInst = CreateSalInstance();
320  if ( !pSVData->mpDefInst )
321  return false;
322 
323  // Desktop Environment context (to be able to get value of "system.desktop-environment" as soon as possible)
324  css::uno::setCurrentContext(
325  new DesktopEnvironmentContext( css::uno::getCurrentContext() ) );
326 
327  // Initialize application instance (should be done after initialization of VCL SAL part)
328  if (pSVData->mpApp)
329  {
330  // call init to initialize application class
331  // soffice/sfx implementation creates the global service manager
332  pSVData->mpApp->Init();
333  }
334 
335  try
336  {
337  //Now that uno has been bootstrapped we can ask the config what the UI language is so that we can
338  //force that in as $LANGUAGE. That way we can get gtk to render widgets RTL
339  //if we have a RTL UI in an otherwise LTR locale and get gettext using externals (e.g. python)
340  //to match their translations to our preferred UI language
341  OUString aLocaleString(SvtSysLocaleOptions().GetRealUILanguageTag().getGlibcLocaleString(".UTF-8"));
342  if (!aLocaleString.isEmpty())
343  {
344  MsLangId::getSystemUILanguage(); //call this now to pin what the system UI really was
345  OUString envVar("LANGUAGE");
346  osl_setEnvironment(envVar.pData, aLocaleString.pData);
347  }
348  }
349  catch (const uno::Exception &)
350  {
351  TOOLS_INFO_EXCEPTION("vcl.app", "Unable to get ui language:");
352  }
353 
354  pSVData->mpDefInst->AfterAppInit();
355 
356  // Fetch AppFileName and make it absolute before the workdir changes...
357  OUString aExeFileName;
358  osl_getExecutableFile( &aExeFileName.pData );
359 
360  // convert path to native file format
361  OUString aNativeFileName;
362  osl::FileBase::getSystemPathFromFileURL( aExeFileName, aNativeFileName );
363  pSVData->maAppData.mxAppFileName = aNativeFileName;
364 
365  // Initialize global data
366  pSVData->maGDIData.mxScreenFontList = std::make_shared<PhysicalFontCollection>();
367  pSVData->maGDIData.mxScreenFontCache = std::make_shared<ImplFontCache>();
369 
370  g_bIsLeanException = getenv("LO_LEAN_EXCEPTION") != nullptr;
371  // Set exception handler
372  pExceptionHandler = osl_addSignalHandler(VCLExceptionSignal_impl, nullptr);
373 
374 #ifndef NDEBUG
376 #endif
377 
378 #if OSL_DEBUG_LEVEL > 0
380 #endif
381 
382 #ifndef _WIN32
383  // Clear startup notification details for child processes
384  // See https://bugs.freedesktop.org/show_bug.cgi?id=11375 for discussion
385  unsetenv("DESKTOP_STARTUP_ID");
386 #endif
387 
388  return true;
389 }
390 
391 namespace
392 {
393 
399 class VCLUnoWrapperDeleter : public cppu::WeakImplHelper<css::lang::XEventListener>
400 {
401  virtual void SAL_CALL disposing(lang::EventObject const& rSource) override;
402 };
403 
404 void
405 VCLUnoWrapperDeleter::disposing(lang::EventObject const& /* rSource */)
406 {
407  ImplSVData* const pSVData = ImplGetSVData();
408  if (pSVData && pSVData->mpUnoWrapper)
409  {
410  pSVData->mpUnoWrapper->Destroy();
411  pSVData->mpUnoWrapper = nullptr;
412  }
413 }
414 
415 }
416 
417 void DeInitVCL()
418 {
419  // The LOK Windows map container should be empty
421 
422  //rhbz#1444437, when using LibreOffice like a library you can't realistically
423  //tear everything down and recreate them on the next call, there's too many
424  //(c++) singletons that point to stuff that gets deleted during shutdown
425  //which won't be recreated on restart.
427  return;
428 
429  {
430  SolarMutexReleaser r; // unblock threads blocked on that so we can join
431  ::comphelper::JoinAsyncEventNotifiers();
432  }
433  ImplSVData* pSVData = ImplGetSVData();
434 
435  // lp#1560328: clear cache before disposing rest of VCL
436  if(pSVData->mpBlendFrameCache)
437  pSVData->mpBlendFrameCache->m_aLastResult.Clear();
438  pSVData->mbDeInit = true;
439 
441 
442 #if OSL_DEBUG_LEVEL > 0
443  OStringBuffer aBuf( 256 );
444  aBuf.append( "DeInitVCL: some top Windows are still alive\n" );
445  long nTopWindowCount = Application::GetTopWindowCount();
446  long nBadTopWindows = nTopWindowCount;
447  for( long i = 0; i < nTopWindowCount; i++ )
448  {
450  // default window will be destroyed further down
451  // but may still be useful during deinit up to that point
452  if( pWin == pSVData->mpDefaultWin )
453  nBadTopWindows--;
454  else
455  {
456  aBuf.append( "text = \"" );
457  aBuf.append( OUStringToOString( pWin->GetText(), osl_getThreadTextEncoding() ) );
458  aBuf.append( "\" type = \"" );
459  aBuf.append( typeid(*pWin).name() );
460  aBuf.append( "\", ptr = 0x" );
461  aBuf.append( reinterpret_cast<sal_Int64>( pWin ), 16 );
462  aBuf.append( "\n" );
463  }
464  }
465  SAL_WARN_IF( nBadTopWindows!=0, "vcl", aBuf.getStr() );
466 #endif
467 
469 
470  osl_removeSignalHandler( pExceptionHandler);
471  pExceptionHandler = nullptr;
472 
473  // free global data
474  if (pSVData->maGDIData.mpGrfConverter)
475  {
476  delete pSVData->maGDIData.mpGrfConverter;
477  pSVData->maGDIData.mpGrfConverter = nullptr;
478  }
479 
480  pSVData->mpSettingsConfigItem.reset();
481 
482  // prevent unnecessary painting during Scheduler shutdown
483  // as this processes all pending events in debug builds.
485 
487 
488  pSVData->mpWinData->maMsgBoxImgList.clear();
489  pSVData->maCtrlData.maCheckImgList.clear();
490  pSVData->maCtrlData.maRadioImgList.clear();
491  pSVData->maCtrlData.mpDisclosurePlus.reset();
492  pSVData->maCtrlData.mpDisclosureMinus.reset();
493  pSVData->mpDefaultWin.disposeAndClear();
494 
495 #if defined _WIN32
496  // See GetSystemClipboard (vcl/source/treelist/transfer2.cxx):
497  if (auto const comp = css::uno::Reference<css::lang::XComponent>(
498  pSVData->m_xSystemClipboard, css::uno::UNO_QUERY))
499  {
500  SolarMutexReleaser r; // unblock pending "clipboard content changed" notifications
501  comp->dispose(); // will use CWinClipbImpl::s_aMutex
502  }
503 #endif
504 
505 #ifndef NDEBUG
507 #endif
508 
509  if ( pSVData->mpUnoWrapper )
510  {
511  try
512  {
513  uno::Reference<frame::XDesktop2> const xDesktop = frame::Desktop::create(
515  xDesktop->addEventListener(new VCLUnoWrapperDeleter);
516  }
517  catch (uno::Exception const&)
518  {
519  // ignore
520  }
521  }
522 
523  if( pSVData->mpApp || pSVData->maDeInitHook.IsSet() )
524  {
525  SolarMutexReleaser aReleaser;
526  // call deinit to deinitialize application class
527  // soffice/sfx implementation disposes the global service manager
528  // Warning: After this call you can't call uno services
529  if( pSVData->mpApp )
530  {
531  pSVData->mpApp->DeInit();
532  }
533  if( pSVData->maDeInitHook.IsSet() )
534  {
535  pSVData->maDeInitHook.Call(nullptr);
536  }
537  }
538 
539  if ( pSVData->maAppData.mpSettings )
540  {
541  if ( pSVData->maAppData.mpCfgListener )
542  {
543  pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().RemoveListener( pSVData->maAppData.mpCfgListener );
544  delete pSVData->maAppData.mpCfgListener;
545  }
546 
547  pSVData->maAppData.mpSettings.reset();
548  }
549  if ( pSVData->maAppData.mpAccelMgr )
550  {
551  delete pSVData->maAppData.mpAccelMgr;
552  pSVData->maAppData.mpAccelMgr = nullptr;
553  }
554  pSVData->maAppData.maKeyListeners.clear();
555  pSVData->mpBlendFrameCache.reset();
556 
558 
559  // destroy all Sal interfaces before destroying the instance
560  // and thereby unloading the plugin
561  pSVData->mpSalSystem.reset();
562  assert( !pSVData->maSchedCtx.mpSalTimer );
563  delete pSVData->maSchedCtx.mpSalTimer;
564  pSVData->maSchedCtx.mpSalTimer = nullptr;
565 
566  pSVData->mpDefaultWin = nullptr;
567  pSVData->mpIntroWindow = nullptr;
568  pSVData->maAppData.mpActivePopupMenu = nullptr;
569  pSVData->maAppData.mpWheelWindow = nullptr;
570  pSVData->maGDIData.mpFirstWinGraphics = nullptr;
571  pSVData->maGDIData.mpLastWinGraphics = nullptr;
572  pSVData->maGDIData.mpFirstVirGraphics = nullptr;
573  pSVData->maGDIData.mpLastVirGraphics = nullptr;
574  pSVData->maGDIData.mpFirstPrnGraphics = nullptr;
575  pSVData->maGDIData.mpLastPrnGraphics = nullptr;
576  pSVData->maGDIData.mpFirstVirDev = nullptr;
577  pSVData->maGDIData.mpFirstPrinter = nullptr;
578  pSVData->maFrameData.mpFirstFrame = nullptr;
579  pSVData->maFrameData.mpAppWin = nullptr;
580  pSVData->maFrameData.mpActiveApplicationFrame = nullptr;
581  pSVData->mpWinData->mpCaptureWin = nullptr;
582  pSVData->mpWinData->mpLastDeacWin = nullptr;
583  pSVData->mpWinData->mpFirstFloat = nullptr;
584  pSVData->mpWinData->mpExecuteDialogs.clear();
585  pSVData->mpWinData->mpExtTextInputWin = nullptr;
586  pSVData->mpWinData->mpTrackWin = nullptr;
587  pSVData->mpWinData->mpAutoScrollWin = nullptr;
588  pSVData->mpWinData->mpLastWheelWindow = nullptr;
589 
590  pSVData->maGDIData.mxScreenFontList.reset();
591  pSVData->maGDIData.mxScreenFontCache.reset();
593  { return true; });
594 
596  pSVData->maGDIData.maThemeImageCache.clear();
597 
598  // Deinit Sal
599  if (pSVData->mpDefInst)
600  {
601  DestroySalInstance( pSVData->mpDefInst );
602  pSVData->mpDefInst = nullptr;
603  }
604 
605  if( pOwnSvApp )
606  {
607  delete pOwnSvApp;
608  pOwnSvApp = nullptr;
609  }
610 
612 }
613 
614 namespace {
615 
616 // only one call is allowed
617 struct WorkerThreadData
618 {
619  oslWorkerFunction pWorker;
620  void * pThreadData;
621  WorkerThreadData( oslWorkerFunction pWorker_, void * pThreadData_ )
622  : pWorker( pWorker_ )
623  , pThreadData( pThreadData_ )
624  {
625  }
626 };
627 
628 }
629 
630 #ifdef _WIN32
631 static HANDLE hThreadID = nullptr;
632 static unsigned __stdcall threadmain( void *pArgs )
633 {
634  OleInitialize( nullptr );
635  static_cast<WorkerThreadData*>(pArgs)->pWorker( static_cast<WorkerThreadData*>(pArgs)->pThreadData );
636  delete static_cast<WorkerThreadData*>(pArgs);
637  OleUninitialize();
638  hThreadID = nullptr;
639  return 0;
640 }
641 #else
642 static oslThread hThreadID = nullptr;
643 extern "C"
644 {
645 static void MainWorkerFunction( void* pArgs )
646 {
647  static_cast<WorkerThreadData*>(pArgs)->pWorker( static_cast<WorkerThreadData*>(pArgs)->pThreadData );
648  delete static_cast<WorkerThreadData*>(pArgs);
649  hThreadID = nullptr;
650 }
651 } // extern "C"
652 #endif
653 
654 void CreateMainLoopThread( oslWorkerFunction pWorker, void * pThreadData )
655 {
656 #ifdef _WIN32
657  // sal thread always call CoInitializeEx, so a system dependent implementation is necessary
658 
659  unsigned uThreadID;
660  hThreadID = reinterpret_cast<HANDLE>(_beginthreadex(
661  nullptr, // no security handle
662  0, // stacksize 0 means default
663  threadmain, // thread worker function
664  new WorkerThreadData( pWorker, pThreadData ), // arguments for worker function
665  0, // 0 means: create immediately otherwise use CREATE_SUSPENDED
666  &uThreadID )); // thread id to fill
667 #else
668  hThreadID = osl_createThread( MainWorkerFunction, new WorkerThreadData( pWorker, pThreadData ) );
669 #endif
670 }
671 
673 {
674  if( hThreadID )
675  {
676 #ifdef _WIN32
677  WaitForSingleObject(hThreadID, INFINITE);
678 #else
679  osl_joinWithThread(hThreadID);
680  osl_destroyThread( hThreadID );
681 #endif
682  }
683 }
684 
685 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
EXITHELPER_NORMAL_RESTART
std::unique_ptr< SalSystem > mpSalSystem
Definition: svdata.hxx:385
oslThreadIdentifier mnMainThreadId
Definition: svdata.hxx:404
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:1090
Link< LinkParamNone *, void > maDeInitHook
Definition: svdata.hxx:418
std::pair< Key, Value > key_value_pair_t
ImplSVAppData maAppData
Definition: svdata.hxx:392
void disposeAndClear()
Definition: vclptr.hxx:200
VclPtr< OutputDevice > mpLastVirGraphics
Definition: svdata.hxx:214
std::unique_ptr< vcl::SettingsConfigItem > mpSettingsConfigItem
Definition: svdata.hxx:408
VclPtr< PopupMenu > mpActivePopupMenu
Definition: svdata.hxx:144
css::uno::Reference< css::lang::XComponent > mxAccessBridge
Definition: svdata.hxx:407
std::unique_ptr< AllSettings > mpSettings
Definition: svdata.hxx:132
int SVMain()
Definition: svmain.cxx:231
aBuf
void JoinMainLoopThread()
Definition: svmain.cxx:672
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:239
ImplSVGDIData maGDIData
Definition: svdata.hxx:393
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:1590
ImplSVCtrlData maCtrlData
Definition: svdata.hxx:396
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:402
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:1421
static void MainWorkerFunction(void *pArgs)
Definition: svmain.cxx:645
static void hardDisable()
basegfx::SystemDependentDataManager & ImplGetSystemDependentDataManager()
Definition: svdata.cxx:203
static void stop()
Definition: watchdog.cxx:147
VclPtr< VirtualDevice > mpFirstVirDev
Definition: svdata.hxx:217
virtual OUString GetText() const
Definition: window.cxx:3085
static SystemWindowFlags GetSystemWindowMode()
Get the system window mode of dialogs.
Definition: svapp.cxx:1444
ExceptionCategory
void CreateMainLoopThread(oslWorkerFunction pWorker, void *pThreadData)
Definition: svmain.cxx:654
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:92
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:400
static long GetTopWindowCount()
Return the number of top-level windows being used by the application.
Definition: svapp.cxx:1076
static oslSignalHandler pExceptionHandler
Definition: svmain.cxx:241
static void SetSystemWindowMode(SystemWindowFlags nMode)
Make a dialog box a system window or not.
Definition: svapp.cxx:1439
static LanguageType getSystemUILanguage()
std::vector< Image > maMsgBoxImgList
Definition: svdata.hxx:255
Mutex aLock
SystemWindowFlags
Definition: svapp.hxx:92
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:93
static void clearTemporaryFontFiles()
Removes all temporary fonts in the path used by fileUrlForTemporaryFont().
LocaleConfigurationListener * mpCfgListener
Definition: svdata.hxx:133
void DeInitVCL()
Definition: svmain.cxx:417
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:249
o3tl::lru_map< OUString, gfx::DrawRoot > maThemeDrawCommandsCache
Definition: svdata.hxx:231
int ImplSVMain()
Definition: svmain.cxx:182
VclPtr< vcl::Window > mpTrackWin
Definition: svdata.hxx:253
void DbgGUIInitSolarMutexCheck()
Definition: dbggui.cxx:38
ImplSchedulerContext maSchedCtx
Definition: svdata.hxx:391
static bool isInZone()
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
static bool IsLOKWindowsEmpty()
check if LOK Window container is empty
Definition: window.cxx:3232
#define TOOLS_INFO_EXCEPTION(area, stream)
SalInstance * CreateSalInstance()
Definition: salplug.cxx:228
virtual void Init()
Initialize the application itself.
Definition: svapp.cxx:194
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:394
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:295
bool IsVCLInit()
Definition: svmain.cxx:276
bool isAlive()
Definition: svmain.cxx:287
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:202
VclPtr< OutputDevice > mpFirstPrnGraphics
Definition: svdata.hxx:215
static oslThread hThreadID
Definition: svmain.cxx:642
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:1372
VclPtr< OutputDevice > mpLastPrnGraphics
Definition: svdata.hxx:216
lru_scale_cache maScaleCache
Definition: svdata.hxx:223
rtl::Reference< vcl::DisplayConnectionDispatch > mxDisplayConnection
Definition: svdata.hxx:405
static oslSignalAction VCLExceptionSignal_impl(void *, oslSignalInfo *pInfo)
Definition: svmain.cxx:111
UnoWrapperBase * mpUnoWrapper
Definition: svdata.hxx:399
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:238
ImplSVWinData * mpWinData
Definition: svdata.hxx:395
virtual int Main()
Pure virtual entrypoint to the application.
Definition: svapp.cxx:173
VclPtr< WorkWindow > mpDefaultWin
Definition: svdata.hxx:383