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