Bump version to 6.4-15
[LibreOffice.git] / include / vcl / sysdata.hxx
blob89122f51c75d54971794f87c2c704b1dde2877dd
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>
27 #include <config_cairo_canvas.h>
29 #ifdef MACOSX
30 // predeclare the native classes to avoid header/include problems
31 typedef struct CGContext *CGContextRef;
32 typedef struct CGLayer *CGLayerRef;
33 typedef const struct __CTFont * CTFontRef;
34 #ifdef __OBJC__
35 @class NSView;
36 #else
37 class NSView;
38 #endif
39 #endif
41 #ifdef IOS
42 typedef const struct __CTFont * CTFontRef;
43 typedef struct CGContext *CGContextRef;
44 #endif
46 #if defined(_WIN32)
47 #include <prewin.h>
48 #include <windef.h>
49 #include <postwin.h>
50 #endif
52 struct SystemEnvData
54 #if defined(_WIN32)
55 HWND hWnd; // the window hwnd
56 #elif defined( MACOSX )
57 NSView* mpNSView; // the cocoa (NSView *) implementing this object
58 bool mbOpenGL; // use an OpenGL providing NSView
59 #elif defined( ANDROID )
60 // Nothing
61 #elif defined( IOS )
62 // Nothing
63 #elif defined( UNX )
64 enum class Toolkit { Gtk3, Qt5, Gen };
65 enum class Platform { Wayland, Xcb };
67 void* pDisplay; // the relevant display connection
68 unsigned long aWindow; // the window of the object
69 void* pSalFrame; // contains a salframe, if object has one
70 void* pWidget; // the corresponding widget
71 void* pVisual; // the visual in use
72 int nScreen; // the current screen of the window
73 // note: this is a "long" in Xlib *but* in the protocol it's only 32-bit
74 // however, the GTK3 vclplug wants to store pointers in here!
75 sal_IntPtr aShellWindow; // the window of the frame's shell
76 Toolkit toolkit; // the toolkit in use
77 Platform platform; // the windowing system in use
78 #endif
80 SystemEnvData()
81 #if defined(_WIN32)
82 : hWnd(nullptr)
83 #elif defined( MACOSX )
84 : mpNSView(nullptr)
85 , mbOpenGL(false)
86 #elif defined( ANDROID )
87 #elif defined( IOS )
88 #elif defined( UNX )
89 : pDisplay(nullptr)
90 , aWindow(0)
91 , pSalFrame(nullptr)
92 , pWidget(nullptr)
93 , pVisual(nullptr)
94 , nScreen(0)
95 , aShellWindow(0)
96 , toolkit(Toolkit())
97 , platform(Platform())
98 #endif
103 struct SystemParentData
105 sal_uInt32 nSize; // size in bytes of this structure
106 #if defined(_WIN32)
107 HWND hWnd; // the window hwnd
108 #elif defined( MACOSX )
109 NSView* pView; // the cocoa (NSView *) implementing this object
110 #elif defined( ANDROID )
111 // Nothing
112 #elif defined( IOS )
113 // Nothing
114 #elif defined( UNX )
115 long aWindow; // the window of the object
116 bool bXEmbedSupport:1; // decides whether the object in question
117 // should support the XEmbed protocol
118 #endif
121 struct SystemMenuData
123 #if defined(_WIN32)
124 HMENU hMenu; // the menu handle of the menu bar
125 #else
126 // Nothing
127 #endif
130 struct SystemGraphicsData
132 sal_uInt32 nSize; // size in bytes of this structure
133 #if defined(_WIN32)
134 HDC hDC; // handle to a device context
135 HWND hWnd; // optional handle to a window
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 void* pXRenderFormat; // render format for drawable
148 void* pSurface; // the cairo surface when using svp-based backends
149 #endif
150 SystemGraphicsData()
151 : nSize( sizeof( SystemGraphicsData ) )
152 #if defined(_WIN32)
153 , hDC( nullptr )
154 , hWnd( nullptr )
155 #elif defined( MACOSX )
156 , rCGContext( nullptr )
157 #elif defined( ANDROID )
158 // Nothing
159 #elif defined( IOS )
160 , rCGContext( NULL )
161 #elif defined( UNX )
162 , pDisplay( nullptr )
163 , hDrawable( 0 )
164 , pVisual( nullptr )
165 , nScreen( 0 )
166 , pXRenderFormat( nullptr )
167 , pSurface( nullptr )
168 #endif
172 struct SystemWindowData
174 #if defined(_WIN32) // meaningless on Windows
175 #elif defined( MACOSX )
176 bool bOpenGL; // create an OpenGL providing NSView
177 bool bLegacy; // create a 2.1 legacy context, only valid if bOpenGL == true
178 #elif defined( ANDROID )
179 // Nothing
180 #elif defined( IOS )
181 // Nothing
182 #elif defined( UNX )
183 void* pVisual; // the visual to be used
184 bool bClipUsingNativeWidget; // default is false, true will attempt to clip the childwindow with a native widget
185 #endif
188 struct SystemGlyphData
190 sal_uInt32 index;
191 double x;
192 double y;
193 int fallbacklevel;
196 #if ENABLE_CAIRO_CANVAS
198 struct SystemFontData
200 #if defined( UNX )
201 void* nFontId; // native font id
202 int nFontFlags; // native font flags
203 #endif
204 bool bFakeBold; // Does this font need faking the bold style
205 bool bFakeItalic; // Does this font need faking the italic style
206 bool bAntialias; // Should this font be antialiased
207 bool bVerticalCharacterType; // Is the font using vertical character type
209 SystemFontData()
211 #if defined( UNX )
212 nFontId( nullptr ),
213 nFontFlags( 0 ),
214 #endif
215 bFakeBold( false ),
216 bFakeItalic( false ),
217 bAntialias( true ),
218 bVerticalCharacterType( false )
223 #endif // ENABLE_CAIRO_CANVAS
225 typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
227 struct SystemTextLayoutData
229 SystemGlyphDataVector rGlyphData; // glyph data
230 int orientation; // Text orientation
233 #endif // INCLUDED_VCL_SYSDATA_HXX
235 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */