bump product version to 4.1.6.2
[LibreOffice.git] / vcl / inc / aqua / saldata.hxx
blobd26e616db7006e08a96bf1b9e59a58e914da95cc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _SV_SALDATA_HXX
21 #define _SV_SALDATA_HXX
23 #include "premac.h"
24 #include <Cocoa/Cocoa.h>
25 #include "postmac.h"
27 #include "com/sun/star/uno/Reference.hxx"
29 #include "vcl/ptrstyle.hxx"
31 #include "svdata.hxx"
32 #include "salwtype.hxx"
34 #include <list>
35 #include <vector>
36 #include <map>
37 #include <boost/unordered_set.hpp>
39 #include <cstdio>
40 #include <cstdarg>
42 #include "apple_remote/RemoteMainController.h"
44 class AquaSalInstance;
45 class SalObject;
46 class SalFrame;
47 class SalVirtualDevice;
48 class SalPrinter;
49 class SystemFontList;
51 #define SAL_CLIPRECT_COUNT 16
53 #define VER_TIGER 0x1040
54 #define VER_LEOPARD 0x1050
56 class AquaSalFrame;
57 struct FrameHash : public boost::hash<sal_IntPtr>
59 size_t operator()(const AquaSalFrame* frame) const
60 { return boost::hash<sal_IntPtr>::operator()( reinterpret_cast<const sal_IntPtr>(frame) ); }
63 #define INVALID_CURSOR_PTR (NSCursor*)0xdeadbeef
65 class SalData
67 public:
68 SALTIMERPROC mpTimerProc; // timer callback proc
69 AquaSalInstance *mpFirstInstance; // pointer of first instance
70 std::list<AquaSalFrame*> maFrames; // list of all frames
71 boost::unordered_set<const AquaSalFrame*,FrameHash> maFrameCheck; // for fast check of frame existance
72 std::list<AquaSalFrame*> maPresentationFrames; // list of frames in presentation mode
73 SalObject *mpFirstObject; // pointer of first object window
74 SalVirtualDevice *mpFirstVD; // first VirDev
75 SalPrinter *mpFirstPrinter; // first printing printer
76 SystemFontList *mpFontList;
77 NSStatusItem* mpStatusItem; // one status item that draws all our stati
78 // at the moment this is only one add menu button
80 CGColorSpaceRef mxRGBSpace;
81 CGColorSpaceRef mxGraySpace;
82 CGColorSpaceRef mxP50Space;
83 CGPatternRef mxP50Pattern;
85 std::vector< NSCursor* > maCursors;
86 std::vector< NSMenuItem* > maFallbackMenu;
87 std::map< NSEvent*, bool > maKeyEventAnswer;
89 static oslThreadKey s_aAutoReleaseKey;
91 bool mbIsScrollbarDoubleMax; // TODO: support DoubleMin and DoubleBoth too
92 SInt32 mnSystemVersion; // Store System Version
93 MainController* mpMainController; // Apple Remote
95 NSObject* mpDockIconClickHandler;
96 long mnDPIX; // #i100617# read DPI only once per office life
97 long mnDPIY; // #i100617# read DPI only once per office life
99 com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
100 mxClipboard;
102 SalData();
103 ~SalData();
105 NSCursor* getCursor( PointerStyle i_eStyle );
107 static void ensureThreadAutoreleasePool();
109 static NSStatusItem* getStatusItem();
112 inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = pData; }
113 inline SalData *GetSalData() { return ImplGetSVData()->mpSalData; }
115 sal_Bool ImplSalYieldMutexTryToAcquire();
116 void ImplSalYieldMutexAcquire();
117 void ImplSalYieldMutexRelease();
119 #endif // _SV_SALDATA_HXX
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */