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