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