Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / vcl / inc / aqua / saldata.hxx
blob91d706eca8eeabd2df6aad800767de3774647a64
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 // ------------------
52 // - Some constants -
53 // ------------------
55 #define SAL_CLIPRECT_COUNT 16
57 #define VER_TIGER 0x1040
58 #define VER_LEOPARD 0x1050
60 // -----------
61 // - SalData -
62 // -----------
64 class AquaSalFrame;
65 struct FrameHash : public boost::hash<sal_IntPtr>
67 size_t operator()(const AquaSalFrame* frame) const
68 { return boost::hash<sal_IntPtr>::operator()( reinterpret_cast<const sal_IntPtr>(frame) ); }
71 #define INVALID_CURSOR_PTR (NSCursor*)0xdeadbeef
73 class SalData
75 public:
76 SALTIMERPROC mpTimerProc; // timer callback proc
77 AquaSalInstance *mpFirstInstance; // pointer of first instance
78 std::list<AquaSalFrame*> maFrames; // list of all frames
79 boost::unordered_set<const AquaSalFrame*,FrameHash> maFrameCheck; // for fast check of frame existance
80 std::list<AquaSalFrame*> maPresentationFrames; // list of frames in presentation mode
81 SalObject *mpFirstObject; // pointer of first object window
82 SalVirtualDevice *mpFirstVD; // first VirDev
83 SalPrinter *mpFirstPrinter; // first printing printer
84 SystemFontList *mpFontList;
85 NSStatusItem* mpStatusItem; // one status item that draws all our stati
86 // at the moment this is only one add menu button
88 CGColorSpaceRef mxRGBSpace;
89 CGColorSpaceRef mxGraySpace;
90 CGColorSpaceRef mxP50Space;
91 CGPatternRef mxP50Pattern;
93 std::vector< NSCursor* > maCursors;
94 std::vector< NSMenuItem* > maFallbackMenu;
95 std::map< NSEvent*, bool > maKeyEventAnswer;
97 static oslThreadKey s_aAutoReleaseKey;
99 bool mbIsScrollbarDoubleMax; // TODO: support DoubleMin and DoubleBoth too
100 SInt32 mnSystemVersion; // Store System Version
101 MainController* mpMainController; // Apple Remote
103 NSObject* mpDockIconClickHandler;
104 long mnDPIX; // #i100617# read DPI only once per office life
105 long mnDPIY; // #i100617# read DPI only once per office life
107 com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
108 mxClipboard;
110 SalData();
111 ~SalData();
113 NSCursor* getCursor( PointerStyle i_eStyle );
115 static void ensureThreadAutoreleasePool();
116 static void drainThreadAutoreleasePool();
118 static NSStatusItem* getStatusItem();
121 inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = pData; }
122 inline SalData *GetSalData() { return ImplGetSVData()->mpSalData; }
124 // --- Prototypes ---
126 sal_Bool ImplSalYieldMutexTryToAcquire();
127 void ImplSalYieldMutexAcquire();
128 void ImplSalYieldMutexRelease();
130 #endif // _SV_SALDATA_HXX
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */