LibreOffice Module vcl (master)  1
osx/saldata.hxx
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 #ifndef INCLUDED_VCL_INC_OSX_SALDATA_HXX
21 #define INCLUDED_VCL_INC_OSX_SALDATA_HXX
22 
23 #include <config_features.h>
24 
25 #include <premac.h>
26 #include <Cocoa/Cocoa.h>
27 #include <postmac.h>
28 
29 #include <com/sun/star/uno/Reference.hxx>
30 
31 #include <vcl/ptrstyle.hxx>
32 
33 #include <svdata.hxx>
34 #include <salwtype.hxx>
35 
36 #include <functional>
37 #include <list>
38 #include <map>
39 #include <unordered_set>
40 #include <vector>
41 #include <o3tl/enumarray.hxx>
42 
43 #include <cstdio>
44 #include <cstdarg>
45 
47 
48 class AquaSalFrame;
49 class AquaSalInstance;
50 class SalObject;
51 class SalFrame;
52 class SalVirtualDevice;
53 class SalPrinter;
54 class SystemFontList;
55 
56 #define SAL_CLIPRECT_COUNT 16
57 #define INVALID_CURSOR_PTR reinterpret_cast<NSCursor*>(0xdeadbeef)
58 
59 // Singleton, instantiated from Application::Application() in
60 // vcl/source/app/svapp.cxx.
61 
62 class SalData
63 {
64 public:
65  SALTIMERPROC mpTimerProc; // timer callback proc
67  std::list<AquaSalFrame*> maPresentationFrames; // list of frames in presentation mode
68  SalObject *mpFirstObject; // pointer of first object window
69  SalVirtualDevice *mpFirstVD; // first VirDev
70  SalPrinter *mpFirstPrinter; // first printing printer
72  NSStatusItem* mpStatusItem; // one status item that draws all our statuses
73  // at the moment this is only one add menu button
74  CGColorSpaceRef mxRGBSpace;
75  CGColorSpaceRef mxGraySpace;
76 
78  std::vector< NSMenuItem* > maFallbackMenu;
79  std::map< NSEvent*, bool > maKeyEventAnswer;
80 
81  static oslThreadKey s_aAutoReleaseKey;
82 
83  bool mbIsScrollbarDoubleMax; // TODO: support DoubleMin and DoubleBoth too
84 #if !HAVE_FEATURE_MACOSX_SANDBOX
86 #endif
88  long mnDPIX; // #i100617# read DPI only once per office life
89  long mnDPIY; // #i100617# read DPI only once per office life
90 
91  css::uno::Reference< css::uno::XInterface > mxClipboard;
92 
93  SalData();
94  ~SalData();
95 
96  NSCursor* getCursor( PointerStyle i_eStyle );
97 
98  static void ensureThreadAutoreleasePool();
99 
100  static NSStatusItem* getStatusItem();
101 };
102 
103 inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = pData; }
104 inline SalData *GetSalData() { return ImplGetSVData()->mpSalData; }
105 
108 
109 #endif // INCLUDED_VCL_INC_OSX_SALDATA_HXX
110 
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool mbIsScrollbarDoubleMax
Definition: osx/saldata.hxx:83
SalData * mpSalData
Definition: svdata.hxx:335
void ImplSalYieldMutexRelease()
static oslThreadKey s_aAutoReleaseKey
Definition: osx/saldata.hxx:81
AquaSalInstance * mpInstance
Definition: osx/saldata.hxx:66
SystemFontList * mpFontList
Definition: osx/saldata.hxx:71
bool ImplSalYieldMutexTryToAcquire()
SalVirtualDevice * mpFirstVD
Definition: osx/saldata.hxx:69
AppleRemoteMainController * mpAppleRemoteMainController
Definition: osx/saldata.hxx:85
std::list< AquaSalFrame * > maPresentationFrames
Definition: osx/saldata.hxx:67
NSObject * mpDockIconClickHandler
Definition: osx/saldata.hxx:87
static NSStatusItem * getStatusItem()
SALTIMERPROC mpTimerProc
Definition: osx/saldata.hxx:65
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:67
long mnDPIY
Definition: osx/saldata.hxx:89
static void ensureThreadAutoreleasePool()
long mnDPIX
Definition: osx/saldata.hxx:88
SalData * GetSalData()
CGColorSpaceRef mxGraySpace
Definition: osx/saldata.hxx:75
CGColorSpaceRef mxRGBSpace
Definition: osx/saldata.hxx:74
NSStatusItem * mpStatusItem
Definition: osx/saldata.hxx:72
std::map< NSEvent *, bool > maKeyEventAnswer
Definition: osx/saldata.hxx:79
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
void(* SALTIMERPROC)()
Definition: salwtype.hxx:270
~SalData()
Definition: salplug.cxx:338
std::vector< NSMenuItem * > maFallbackMenu
Definition: osx/saldata.hxx:78
css::uno::Reference< css::uno::XInterface > mxClipboard
Definition: osx/saldata.hxx:91
NSCursor * getCursor(PointerStyle i_eStyle)
A non-visible drawable/buffer (e.g. an X11 Pixmap).
Definition: salvd.hxx:28
PointerStyle
Definition: ptrstyle.hxx:25
SalData()
Definition: salplug.cxx:332
void SetSalData(SalData *pData)
SalPrinter * mpFirstPrinter
Definition: osx/saldata.hxx:70
SalObject * mpFirstObject
Definition: osx/saldata.hxx:68
o3tl::enumarray< PointerStyle, NSCursor * > maCursors
Definition: osx/saldata.hxx:77