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>
28 #include <config_cairo_canvas.h>
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
;
43 typedef const struct __CTFont
* CTFontRef
;
44 typedef struct CGContext
*CGContextRef
;
55 unsigned long nSize
; // size in bytes of this structure
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 )
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)
86 #elif defined( MACOSX )
89 #elif defined( ANDROID )
100 , pAppContext(nullptr)
102 , pShellWidget(nullptr)
109 struct SystemParentData
111 unsigned long nSize
; // size in bytes of this structure
113 HWND hWnd
; // the window hwnd
114 #elif defined( MACOSX )
115 NSView
* pView
; // the cocoa (NSView *) implementing this object
116 #elif defined( ANDROID )
121 long aWindow
; // the window of the object
122 bool bXEmbedSupport
:1; // decides whether the object in question
123 // should support the XEmbed protocol
127 struct SystemMenuData
130 HMENU hMenu
; // the menu handle of the menu bar
136 struct SystemGraphicsData
138 unsigned long nSize
; // size in bytes of this structure
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 )
147 CGContextRef rCGContext
; // CoreGraphics graphic context
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
158 : nSize( sizeof( SystemGraphicsData
) )
162 #elif defined( MACOSX )
163 , rCGContext( nullptr )
164 #elif defined( ANDROID )
169 , pDisplay( nullptr )
175 , pXRenderFormat( nullptr )
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 )
192 void* pVisual
; // the visual to be used
196 struct SystemGlyphData
204 #if ENABLE_CAIRO_CANVAS
206 struct SystemFontData
208 unsigned long nSize
; // size in bytes of this structure
210 void* nFontId
; // native font id
211 int nFontFlags
; // native font flags
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
219 : nSize( sizeof( SystemFontData
) )
225 , bFakeItalic( false )
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: */