Line data Source code
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_SYSDATA_HXX
21 : #define INCLUDED_VCL_SYSDATA_HXX
22 :
23 : #include <vector>
24 : #include <cstddef>
25 :
26 : #ifdef MACOSX
27 : // predeclare the native classes to avoid header/include problems
28 : typedef struct CGContext *CGContextRef;
29 : typedef struct CGLayer *CGLayerRef;
30 : typedef const struct __CTFont * CTFontRef;
31 : #ifdef __OBJC__
32 : @class NSView;
33 : #else
34 : class NSView;
35 : #endif
36 : #endif
37 :
38 : #ifdef IOS
39 : typedef const struct __CTFont * CTFontRef;
40 : typedef struct CGContext *CGContextRef;
41 : #endif
42 :
43 : #if defined( WNT )
44 : #include <windef.h>
45 : #endif
46 :
47 : struct SystemEnvData
48 : {
49 : unsigned long nSize; // size in bytes of this structure
50 : #if defined( WNT )
51 : HWND hWnd; // the window hwnd
52 : #elif defined( MACOSX )
53 : NSView* mpNSView; // the cocoa (NSView *) implementing this object
54 : #elif defined( ANDROID )
55 : // Nothing
56 : #elif defined( IOS )
57 : // Nothing
58 : #elif defined( UNX )
59 : void* pDisplay; // the relevant display connection
60 : long aWindow; // the window of the object
61 : void* pSalFrame; // contains a salframe, if object has one
62 : void* pWidget; // the corresponding widget
63 : void* pVisual; // the visual in use
64 : int nScreen; // the current screen of the window
65 : int nDepth; // depth of said visual
66 : long aColormap; // the colormap being used
67 : void* pAppContext; // the application context in use
68 : long aShellWindow; // the window of the frame's shell
69 : void* pShellWidget; // the frame's shell widget
70 : #endif
71 :
72 0 : SystemEnvData()
73 : : nSize(0)
74 : #if defined( WNT )
75 : , hWnd(0)
76 : #elif defined( MACOSX )
77 : , mpNSView(NULL)
78 : #elif defined( ANDROID )
79 : #elif defined( IOS )
80 : #elif defined( UNX )
81 : , pDisplay(NULL)
82 : , aWindow(0)
83 : , pSalFrame(NULL)
84 : , pWidget(NULL)
85 : , pVisual(NULL)
86 : , nScreen(0)
87 : , nDepth(0)
88 : , aColormap(0)
89 : , pAppContext(NULL)
90 : , aShellWindow(0)
91 0 : , pShellWidget(NULL)
92 : #endif
93 : {
94 0 : }
95 : };
96 :
97 : struct SystemParentData
98 : {
99 : unsigned long nSize; // size in bytes of this structure
100 : #if defined( WNT )
101 : HWND hWnd; // the window hwnd
102 : #elif defined( MACOSX )
103 : NSView* pView; // the cocoa (NSView *) implementing this object
104 : #elif defined( ANDROID )
105 : // Nothing
106 : #elif defined( IOS )
107 : // Nothing
108 : #elif defined( UNX )
109 : long aWindow; // the window of the object
110 : bool bXEmbedSupport:1; // decides whether the object in question
111 : // should support the XEmbed protocol
112 : #endif
113 : };
114 :
115 : struct SystemMenuData
116 : {
117 : unsigned long nSize; // size in bytes of this structure
118 : #if defined( WNT )
119 : HMENU hMenu; // the menu handle of the menu bar
120 : #elif defined( MACOSX )
121 : // Nothing
122 : #elif defined( ANDROID )
123 : // Nothing
124 : #elif defined( IOS )
125 : // Nothing
126 : #elif defined( UNX )
127 : long aMenu; // ???
128 : #endif
129 : };
130 :
131 : struct SystemGraphicsData
132 : {
133 : unsigned long nSize; // size in bytes of this structure
134 : #if defined( WNT )
135 : HDC hDC; // handle to a device context
136 : #elif defined( MACOSX )
137 : CGContextRef rCGContext; // CoreGraphics graphic context
138 : #elif defined( ANDROID )
139 : // Nothing
140 : #elif defined( IOS )
141 : CGContextRef rCGContext; // CoreGraphics graphic context
142 : #elif defined( UNX )
143 : void* pDisplay; // the relevant display connection
144 : long hDrawable; // a drawable
145 : void* pVisual; // the visual in use
146 : int nScreen; // the current screen of the drawable
147 : int nDepth; // depth of said visual
148 : long aColormap; // the colormap being used
149 : void* pXRenderFormat; // render format for drawable
150 : #endif
151 0 : SystemGraphicsData()
152 : : nSize( sizeof( SystemGraphicsData ) )
153 : #if defined( WNT )
154 : , hDC( 0 )
155 : #elif defined( MACOSX )
156 : , rCGContext( NULL )
157 : #elif defined( ANDROID )
158 : // Nothing
159 : #elif defined( IOS )
160 : , rCGContext( NULL )
161 : #elif defined( UNX )
162 : , pDisplay( NULL )
163 : , hDrawable( 0 )
164 : , pVisual( NULL )
165 : , nScreen( 0 )
166 : , nDepth( 0 )
167 : , aColormap( 0 )
168 0 : , pXRenderFormat( NULL )
169 : #endif
170 0 : { }
171 : };
172 :
173 : struct SystemWindowData
174 : {
175 : unsigned long nSize; // size in bytes of this structure
176 : #if defined( WNT ) // meaningless on Windows
177 : #elif defined( MACOSX ) // meaningless on Mac OS X
178 : // Nothing
179 : #elif defined( ANDROID )
180 : // Nothing
181 : #elif defined( IOS )
182 : // Nothing
183 : #elif defined( UNX )
184 : void* pVisual; // the visual to be used
185 : #endif
186 : };
187 :
188 : struct SystemGlyphData
189 : {
190 : unsigned long index;
191 : double x;
192 : double y;
193 : int fallbacklevel;
194 : };
195 :
196 : struct SystemFontData
197 : {
198 : unsigned long nSize; // size in bytes of this structure
199 : #if defined( WNT )
200 : HFONT hFont; // native font object
201 : #elif defined( MACOSX )
202 : #elif defined( UNX )
203 : void* nFontId; // native font id
204 : int nFontFlags; // native font flags
205 : #endif
206 : bool bFakeBold; // Does this font need faking the bold style
207 : bool bFakeItalic; // Does this font need faking the italic style
208 : bool bAntialias; // Should this font be antialiased
209 : bool bVerticalCharacterType; // Is the font using vertical character type
210 :
211 0 : SystemFontData()
212 : : nSize( sizeof( SystemFontData ) )
213 : #if defined( WNT )
214 : , hFont( 0 )
215 : #elif defined( MACOSX )
216 : #elif defined( UNX )
217 : , nFontId( NULL )
218 : , nFontFlags( 0 )
219 : #endif
220 : , bFakeBold( false )
221 : , bFakeItalic( false )
222 : , bAntialias( true )
223 0 : , bVerticalCharacterType( false )
224 : {
225 0 : }
226 : };
227 :
228 : typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
229 :
230 0 : struct SystemTextLayoutData
231 : {
232 : unsigned long nSize; // size in bytes of this structure
233 : SystemGlyphDataVector rGlyphData; // glyph data
234 : int orientation; // Text orientation
235 : };
236 :
237 : #endif // INCLUDED_VCL_SYSDATA_HXX
238 :
239 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|