Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SV_SYSDATA_HXX
30 : : #define _SV_SYSDATA_HXX
31 : :
32 : : #include <vector>
33 : : #include <cstddef>
34 : :
35 : : #ifdef QUARTZ
36 : : // predeclare the native classes to avoid header/include problems
37 : : typedef struct CGContext *CGContextRef;
38 : : typedef struct CGLayer *CGLayerRef;
39 : : #ifdef __OBJC__
40 : : @class NSView;
41 : : #else
42 : : class NSView;
43 : : #endif
44 : : #endif
45 : :
46 : : #ifdef IOS
47 : : typedef const struct __CTFont * CTFontRef;
48 : : typedef struct CGContext *CGContextRef;
49 : : typedef struct CGLayer *CGLayerRef;
50 : : #ifdef __OBJC__
51 : : @class UIView;
52 : : #else
53 : : class UIView;
54 : : #endif
55 : : #endif
56 : :
57 : : #if defined( WNT )
58 : : #if _MSC_VER >= 1200
59 : : #pragma warning(push)
60 : : #pragma warning(disable:4201)
61 : : #endif
62 : : #include <windef.h>
63 : : #if _MSC_VER >= 1200
64 : : #pragma warning(pop)
65 : : #endif
66 : : #endif
67 : :
68 : : // -----------------
69 : : // - SystemEnvData -
70 : : // -----------------
71 : :
72 : : struct SystemEnvData
73 : : {
74 : : unsigned long nSize; // size in bytes of this structure
75 : : #if defined( WNT )
76 : : HWND hWnd; // the window hwnd
77 : : #elif defined( QUARTZ )
78 : : NSView* pView; // the cocoa (NSView *) implementing this object
79 : : #elif defined( IOS )
80 : : UIView* pView; // the CocoaTouch (UIView *) implementing this object
81 : : #elif defined( UNX )
82 : : void* pDisplay; // the relevant display connection
83 : : long aWindow; // the window of the object
84 : : void* pSalFrame; // contains a salframe, if object has one
85 : : void* pWidget; // the corresponding widget
86 : : void* pVisual; // the visual in use
87 : : int nScreen; // the current screen of the window
88 : : int nDepth; // depth of said visual
89 : : long aColormap; // the colormap being used
90 : : void* pAppContext; // the application context in use
91 : : long aShellWindow; // the window of the frame's shell
92 : : void* pShellWidget; // the frame's shell widget
93 : : #endif
94 : : };
95 : :
96 : : #define SystemChildData SystemEnvData
97 : :
98 : : // --------------------
99 : : // - SystemParentData -
100 : : // --------------------
101 : :
102 : : struct SystemParentData
103 : : {
104 : : unsigned long nSize; // size in bytes of this structure
105 : : #if defined( WNT )
106 : : HWND hWnd; // the window hwnd
107 : : #elif defined( QUARTZ )
108 : : NSView* pView; // the cocoa (NSView *) implementing this object
109 : : #elif defined( IOS )
110 : : UIView* pView; // the CocoaTouch (UIView *) implementing this object
111 : : #elif defined( UNX )
112 : : long aWindow; // the window of the object
113 : : bool bXEmbedSupport:1; // decides whether the object in question
114 : : // should support the XEmbed protocol
115 : : #endif
116 : : };
117 : :
118 : : // --------------------
119 : : // - SystemMenuData -
120 : : // --------------------
121 : :
122 : : struct SystemMenuData
123 : : {
124 : : unsigned long nSize; // size in bytes of this structure
125 : : #if defined( WNT )
126 : : HMENU hMenu; // the menu handle of the menu bar
127 : : #elif defined( QUARTZ )
128 : : //not defined
129 : : #elif defined( UNX )
130 : : long aMenu; // ???
131 : : #endif
132 : : };
133 : :
134 : : // --------------------
135 : : // - SystemGraphicsData -
136 : : // --------------------
137 : :
138 : : struct SystemGraphicsData
139 : : {
140 : : unsigned long nSize; // size in bytes of this structure
141 : : #if defined( WNT )
142 : : HDC hDC; // handle to a device context
143 : : #elif defined( QUARTZ ) || defined( IOS )
144 : : CGContextRef rCGContext; // CoreGraphics graphic context
145 : : #elif defined( UNX )
146 : : void* pDisplay; // the relevant display connection
147 : : long hDrawable; // a drawable
148 : : void* pVisual; // the visual in use
149 : : int nScreen; // the current screen of the drawable
150 : : int nDepth; // depth of said visual
151 : : long aColormap; // the colormap being used
152 : : void* pXRenderFormat; // render format for drawable
153 : : #endif
154 : 0 : SystemGraphicsData()
155 : : : nSize( sizeof( SystemGraphicsData ) )
156 : : #if defined( WNT )
157 : : , hDC( 0 )
158 : : #elif defined( QUARTZ ) || defined( IOS )
159 : : #elif defined( UNX )
160 : : , pDisplay( NULL )
161 : : , hDrawable( 0 )
162 : : , pVisual( NULL )
163 : : , nScreen( 0 )
164 : : , nDepth( 0 )
165 : : , aColormap( 0 )
166 : 0 : , pXRenderFormat( NULL )
167 : : #endif
168 : 0 : { }
169 : : };
170 : :
171 : :
172 : : // --------------------
173 : : // - SystemWindowData -
174 : : // --------------------
175 : :
176 : : struct SystemWindowData
177 : : {
178 : : unsigned long nSize; // size in bytes of this structure
179 : : #if defined( WNT ) // meaningless on Windows
180 : : #elif defined( QUARTZ ) // meaningless on Mac OS X / Quartz
181 : : #elif defined( IOS ) // and maybe on iOS, too, then
182 : : #elif defined( UNX )
183 : : void* pVisual; // the visual to be used
184 : : #endif
185 : : };
186 : :
187 : :
188 : : // --------------------
189 : : // - SystemGlyphData -
190 : : // --------------------
191 : :
192 : : struct SystemGlyphData
193 : : {
194 : : unsigned long index;
195 : : double x;
196 : : double y;
197 : : int fallbacklevel;
198 : : };
199 : :
200 : :
201 : : // --------------------
202 : : // - SystemFontData -
203 : : // --------------------
204 : : struct SystemFontData
205 : : {
206 : : unsigned long nSize; // size in bytes of this structure
207 : : #if defined( WNT )
208 : : HFONT hFont; // native font object
209 : : #elif defined( QUARTZ )
210 : : #ifdef ENABLE_CORETEXT
211 : : void* rCTFont;
212 : : #else
213 : : void* aATSUFontID; // native font object
214 : : #endif
215 : : #elif defined( IOS )
216 : : CTFontRef rCTFont; // native font object
217 : : #elif defined( UNX )
218 : : void* nFontId; // native font id
219 : : int nFontFlags; // native font flags
220 : : #endif
221 : : bool bFakeBold; // Does this font need faking the bold style
222 : : bool bFakeItalic; // Does this font need faking the italic style
223 : : bool bAntialias; // Should this font be antialiased
224 : : bool bVerticalCharacterType; // Is the font using vertical character type
225 : :
226 : 0 : SystemFontData()
227 : : : nSize( sizeof( SystemFontData ) )
228 : : #if defined( WNT )
229 : : , hFont( 0 )
230 : : #elif defined( QUARTZ )
231 : : #ifdef ENABLE_CORETEXT
232 : : #else
233 : : , aATSUFontID( NULL )
234 : : #endif
235 : : #elif defined( IOS )
236 : : #elif defined( UNX )
237 : : , nFontId( NULL )
238 : : , nFontFlags( 0 )
239 : : #endif
240 : : , bFakeBold( false )
241 : : , bFakeItalic( false )
242 : : , bAntialias( true )
243 : 0 : , bVerticalCharacterType( false )
244 : : {
245 : 0 : }
246 : : };
247 : :
248 : : // --------------------
249 : : // - SystemTextLayoutData -
250 : : // --------------------
251 : :
252 : : typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
253 : :
254 : 0 : struct SystemTextLayoutData
255 : : {
256 : : unsigned long nSize; // size in bytes of this structure
257 : : SystemGlyphDataVector rGlyphData; // glyph data
258 : : int orientation; // Text orientation
259 : : };
260 : :
261 : : #endif // _SV_SYSDATA_HXX
262 : :
263 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|