Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / vcl / sysdata.hxx
blobbb2ddf8b510a7d829e82033de48974e917addc39
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 INCLUDED_VCL_SYSDATA_HXX
21 #define INCLUDED_VCL_SYSDATA_HXX
23 #include <sal/types.h>
25 #include <vector>
26 #include <cstddef>
28 #include <config_cairo_canvas.h>
30 #ifdef MACOSX
31 // predeclare the native classes to avoid header/include problems
32 typedef struct CGContext *CGContextRef;
33 typedef struct CGLayer *CGLayerRef;
34 typedef const struct __CTFont * CTFontRef;
35 #ifdef __OBJC__
36 @class NSView;
37 #else
38 class NSView;
39 #endif
40 #endif
42 #ifdef IOS
43 typedef const struct __CTFont * CTFontRef;
44 typedef struct CGContext *CGContextRef;
45 #endif
47 #if defined(_WIN32)
48 #include <prewin.h>
49 #include <windef.h>
50 #include <postwin.h>
51 #endif
53 struct SystemEnvData
55 unsigned long nSize; // size in bytes of this structure
56 #if defined(_WIN32)
57 HWND hWnd; // the window hwnd
58 #elif defined( MACOSX )
59 NSView* mpNSView; // the cocoa (NSView *) implementing this object
60 bool mbOpenGL; // use a OpenGL providing NSView
61 #elif defined( ANDROID )
62 // Nothing
63 #elif defined( IOS )
64 // Nothing
65 #elif defined( UNX )
66 void* pDisplay; // the relevant display connection
67 long aWindow; // the window of the object
68 void* pSalFrame; // contains a salframe, if object has one
69 void* pWidget; // the corresponding widget
70 void* pVisual; // the visual in use
71 int nScreen; // the current screen of the window
72 int nDepth; // depth of said visual
73 long aColormap; // the colormap being used
74 void* pAppContext; // the application context in use
75 // note: this is a "long" in Xlib *but* in the protocol it's only 32-bit
76 // however, the GTK3 vclplug wants to store pointers in here!
77 sal_IntPtr aShellWindow; // the window of the frame's shell
78 void* pShellWidget; // the frame's shell widget
79 const char* pToolkit; // the toolkit in use (gtk2 vs gtk3)
80 #endif
82 SystemEnvData()
83 : nSize(0)
84 #if defined(_WIN32)
85 , hWnd(nullptr)
86 #elif defined( MACOSX )
87 , mpNSView(nullptr)
88 , mbOpenGL(false)
89 #elif defined( ANDROID )
90 #elif defined( IOS )
91 #elif defined( UNX )
92 , pDisplay(nullptr)
93 , aWindow(0)
94 , pSalFrame(nullptr)
95 , pWidget(nullptr)
96 , pVisual(nullptr)
97 , nScreen(0)
98 , nDepth(0)
99 , aColormap(0)
100 , pAppContext(nullptr)
101 , aShellWindow(0)
102 , pShellWidget(nullptr)
103 , pToolkit(nullptr)
104 #endif
109 struct SystemParentData
111 unsigned long nSize; // size in bytes of this structure
112 #if defined(_WIN32)
113 HWND hWnd; // the window hwnd
114 #elif defined( MACOSX )
115 NSView* pView; // the cocoa (NSView *) implementing this object
116 #elif defined( ANDROID )
117 // Nothing
118 #elif defined( IOS )
119 // Nothing
120 #elif defined( UNX )
121 long aWindow; // the window of the object
122 bool bXEmbedSupport:1; // decides whether the object in question
123 // should support the XEmbed protocol
124 #endif
127 struct SystemMenuData
129 #if defined(_WIN32)
130 HMENU hMenu; // the menu handle of the menu bar
131 #else
132 // Nothing
133 #endif
136 struct SystemGraphicsData
138 unsigned long nSize; // size in bytes of this structure
139 #if defined(_WIN32)
140 HDC hDC; // handle to a device context
141 HWND hWnd; // optional handle to a window
142 #elif defined( MACOSX )
143 CGContextRef rCGContext; // CoreGraphics graphic context
144 #elif defined( ANDROID )
145 // Nothing
146 #elif defined( IOS )
147 CGContextRef rCGContext; // CoreGraphics graphic context
148 #elif defined( UNX )
149 void* pDisplay; // the relevant display connection
150 long hDrawable; // a drawable
151 void* pVisual; // the visual in use
152 int nScreen; // the current screen of the drawable
153 int nDepth; // depth of said visual
154 long aColormap; // the colormap being used
155 void* pXRenderFormat; // render format for drawable
156 #endif
157 SystemGraphicsData()
158 : nSize( sizeof( SystemGraphicsData ) )
159 #if defined(_WIN32)
160 , hDC( nullptr )
161 , hWnd( nullptr )
162 #elif defined( MACOSX )
163 , rCGContext( nullptr )
164 #elif defined( ANDROID )
165 // Nothing
166 #elif defined( IOS )
167 , rCGContext( NULL )
168 #elif defined( UNX )
169 , pDisplay( nullptr )
170 , hDrawable( 0 )
171 , pVisual( nullptr )
172 , nScreen( 0 )
173 , nDepth( 0 )
174 , aColormap( 0 )
175 , pXRenderFormat( nullptr )
176 #endif
180 struct SystemWindowData
182 unsigned long nSize; // size in bytes of this structure
183 #if defined(_WIN32) // meaningless on Windows
184 #elif defined( MACOSX )
185 bool bOpenGL; // create a OpenGL providing NSView
186 bool bLegacy; // create a 2.1 legacy context, only valid if bOpenGL == true
187 #elif defined( ANDROID )
188 // Nothing
189 #elif defined( IOS )
190 // Nothing
191 #elif defined( UNX )
192 void* pVisual; // the visual to be used
193 #endif
196 struct SystemGlyphData
198 unsigned long index;
199 double x;
200 double y;
201 int fallbacklevel;
204 #if ENABLE_CAIRO_CANVAS
206 struct SystemFontData
208 unsigned long nSize; // size in bytes of this structure
209 #if defined( UNX )
210 void* nFontId; // native font id
211 int nFontFlags; // native font flags
212 #endif
213 bool bFakeBold; // Does this font need faking the bold style
214 bool bFakeItalic; // Does this font need faking the italic style
215 bool bAntialias; // Should this font be antialiased
216 bool bVerticalCharacterType; // Is the font using vertical character type
218 SystemFontData()
219 : nSize( sizeof( SystemFontData ) )
220 #if defined( UNX )
221 , nFontId( nullptr )
222 , nFontFlags( 0 )
223 #endif
224 , bFakeBold( false )
225 , bFakeItalic( false )
226 , bAntialias( true )
227 , bVerticalCharacterType( false )
232 #endif // ENABLE_CAIRO_CANVAS
234 typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
236 struct SystemTextLayoutData
238 unsigned long nSize; // size in bytes of this structure
239 SystemGlyphDataVector rGlyphData; // glyph data
240 int orientation; // Text orientation
243 #endif // INCLUDED_VCL_SYSDATA_HXX
245 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */