1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
27 #include <config_cairo_canvas.h>
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
;
42 typedef const struct __CTFont
* CTFontRef
;
43 typedef struct CGContext
*CGContextRef
;
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 )
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
83 #elif defined( MACOSX )
86 #elif defined( ANDROID )
97 , platform(Platform())
103 struct SystemParentData
105 sal_uInt32 nSize
; // size in bytes of this structure
107 HWND hWnd
; // the window hwnd
108 #elif defined( MACOSX )
109 NSView
* pView
; // the cocoa (NSView *) implementing this object
110 #elif defined( ANDROID )
115 long aWindow
; // the window of the object
116 bool bXEmbedSupport
:1; // decides whether the object in question
117 // should support the XEmbed protocol
121 struct SystemMenuData
124 HMENU hMenu
; // the menu handle of the menu bar
130 struct SystemGraphicsData
132 sal_uInt32 nSize
; // size in bytes of this structure
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 )
141 CGContextRef rCGContext
; // CoreGraphics graphic context
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
151 : nSize( sizeof( SystemGraphicsData
) )
155 #elif defined( MACOSX )
156 , rCGContext( nullptr )
157 #elif defined( ANDROID )
162 , pDisplay( nullptr )
166 , pXRenderFormat( nullptr )
167 , pSurface( nullptr )
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 )
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
188 struct SystemGlyphData
196 #if ENABLE_CAIRO_CANVAS
198 struct SystemFontData
201 void* nFontId
; // native font id
202 int nFontFlags
; // native font flags
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
216 bFakeItalic( false ),
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: */