2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-06 12:12:33 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-07-24 09:03:18 +00:00
|
|
|
|
2013-10-23 19:10:20 +02:00
|
|
|
#ifndef INCLUDED_VCL_SYSDATA_HXX
|
|
|
|
#define INCLUDED_VCL_SYSDATA_HXX
|
2007-07-24 09:03:18 +00:00
|
|
|
|
2009-05-18 12:01:49 +00:00
|
|
|
#include <vector>
|
2011-10-24 14:23:18 +02:00
|
|
|
#include <cstddef>
|
2009-05-18 12:01:49 +00:00
|
|
|
|
2015-06-02 23:52:56 +03:00
|
|
|
#include <config_cairo_canvas.h>
|
|
|
|
|
2013-01-11 11:07:23 +02:00
|
|
|
#ifdef MACOSX
|
2008-06-24 10:39:19 +00:00
|
|
|
// predeclare the native classes to avoid header/include problems
|
|
|
|
typedef struct CGContext *CGContextRef;
|
2009-05-18 12:01:49 +00:00
|
|
|
typedef struct CGLayer *CGLayerRef;
|
2013-01-19 14:22:05 +02:00
|
|
|
typedef const struct __CTFont * CTFontRef;
|
2008-06-24 10:39:19 +00:00
|
|
|
#ifdef __OBJC__
|
|
|
|
@class NSView;
|
|
|
|
#else
|
|
|
|
class NSView;
|
|
|
|
#endif
|
|
|
|
#endif
|
2011-07-14 11:02:21 +03:00
|
|
|
|
|
|
|
#ifdef IOS
|
2012-04-15 08:32:29 +02:00
|
|
|
typedef const struct __CTFont * CTFontRef;
|
2011-07-14 11:02:21 +03:00
|
|
|
typedef struct CGContext *CGContextRef;
|
|
|
|
#endif
|
|
|
|
|
2011-05-21 17:00:45 +03:00
|
|
|
#if defined( WNT )
|
2015-03-23 15:36:47 +01:00
|
|
|
#include <prewin.h>
|
2011-03-26 12:15:56 +00:00
|
|
|
#include <windef.h>
|
2015-03-23 15:36:47 +01:00
|
|
|
#include <postwin.h>
|
2011-03-26 12:15:56 +00:00
|
|
|
#endif
|
2008-06-24 10:39:19 +00:00
|
|
|
|
2007-07-24 09:03:18 +00:00
|
|
|
struct SystemEnvData
|
|
|
|
{
|
|
|
|
unsigned long nSize; // size in bytes of this structure
|
2011-05-21 17:00:45 +03:00
|
|
|
#if defined( WNT )
|
2007-07-24 09:03:18 +00:00
|
|
|
HWND hWnd; // the window hwnd
|
2013-01-11 11:07:23 +02:00
|
|
|
#elif defined( MACOSX )
|
2013-12-02 16:06:37 +00:00
|
|
|
NSView* mpNSView; // the cocoa (NSView *) implementing this object
|
2014-09-01 01:18:09 +02:00
|
|
|
bool mbOpenGL; // use a OpenGL providing NSView
|
2013-03-27 02:11:39 +02:00
|
|
|
#elif defined( ANDROID )
|
|
|
|
// Nothing
|
2013-03-27 00:38:36 +02:00
|
|
|
#elif defined( IOS )
|
|
|
|
// Nothing
|
2008-01-14 15:20:33 +00:00
|
|
|
#elif defined( UNX )
|
2007-07-24 09:03:18 +00:00
|
|
|
void* pDisplay; // the relevant display connection
|
|
|
|
long aWindow; // the window of the object
|
|
|
|
void* pSalFrame; // contains a salframe, if object has one
|
|
|
|
void* pWidget; // the corresponding widget
|
|
|
|
void* pVisual; // the visual in use
|
2013-12-12 20:18:40 +02:00
|
|
|
int nScreen; // the current screen of the window
|
2007-07-24 09:03:18 +00:00
|
|
|
int nDepth; // depth of said visual
|
|
|
|
long aColormap; // the colormap being used
|
|
|
|
void* pAppContext; // the application context in use
|
|
|
|
long aShellWindow; // the window of the frame's shell
|
|
|
|
void* pShellWidget; // the frame's shell widget
|
|
|
|
#endif
|
2014-02-27 11:46:39 +00:00
|
|
|
|
|
|
|
SystemEnvData()
|
|
|
|
: nSize(0)
|
|
|
|
#if defined( WNT )
|
|
|
|
, hWnd(0)
|
|
|
|
#elif defined( MACOSX )
|
|
|
|
, mpNSView(NULL)
|
2014-09-01 01:18:09 +02:00
|
|
|
, mbOpenGL(false)
|
2014-02-27 11:46:39 +00:00
|
|
|
#elif defined( ANDROID )
|
|
|
|
#elif defined( IOS )
|
|
|
|
#elif defined( UNX )
|
|
|
|
, pDisplay(NULL)
|
|
|
|
, aWindow(0)
|
|
|
|
, pSalFrame(NULL)
|
|
|
|
, pWidget(NULL)
|
|
|
|
, pVisual(NULL)
|
|
|
|
, nScreen(0)
|
|
|
|
, nDepth(0)
|
|
|
|
, aColormap(0)
|
|
|
|
, pAppContext(NULL)
|
|
|
|
, aShellWindow(0)
|
|
|
|
, pShellWidget(NULL)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
}
|
2007-07-24 09:03:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SystemParentData
|
|
|
|
{
|
2007-08-30 13:35:02 +00:00
|
|
|
unsigned long nSize; // size in bytes of this structure
|
2011-05-21 17:00:45 +03:00
|
|
|
#if defined( WNT )
|
2007-08-30 13:35:02 +00:00
|
|
|
HWND hWnd; // the window hwnd
|
2013-01-11 11:07:23 +02:00
|
|
|
#elif defined( MACOSX )
|
2008-06-24 10:39:19 +00:00
|
|
|
NSView* pView; // the cocoa (NSView *) implementing this object
|
2013-03-27 02:11:39 +02:00
|
|
|
#elif defined( ANDROID )
|
|
|
|
// Nothing
|
2013-03-27 00:38:36 +02:00
|
|
|
#elif defined( IOS )
|
|
|
|
// Nothing
|
2007-07-24 09:03:18 +00:00
|
|
|
#elif defined( UNX )
|
2007-08-30 13:35:02 +00:00
|
|
|
long aWindow; // the window of the object
|
|
|
|
bool bXEmbedSupport:1; // decides whether the object in question
|
|
|
|
// should support the XEmbed protocol
|
2007-07-24 09:03:18 +00:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SystemMenuData
|
|
|
|
{
|
|
|
|
unsigned long nSize; // size in bytes of this structure
|
|
|
|
#if defined( WNT )
|
|
|
|
HMENU hMenu; // the menu handle of the menu bar
|
2013-01-11 11:07:23 +02:00
|
|
|
#elif defined( MACOSX )
|
2013-03-27 00:38:36 +02:00
|
|
|
// Nothing
|
2013-03-27 02:11:39 +02:00
|
|
|
#elif defined( ANDROID )
|
|
|
|
// Nothing
|
2013-03-27 00:38:36 +02:00
|
|
|
#elif defined( IOS )
|
|
|
|
// Nothing
|
2007-07-24 09:03:18 +00:00
|
|
|
#elif defined( UNX )
|
|
|
|
long aMenu; // ???
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SystemGraphicsData
|
|
|
|
{
|
|
|
|
unsigned long nSize; // size in bytes of this structure
|
|
|
|
#if defined( WNT )
|
|
|
|
HDC hDC; // handle to a device context
|
2015-04-27 16:22:11 +02:00
|
|
|
HWND hWnd; // optional handle to a window
|
2013-03-26 17:26:57 +02:00
|
|
|
#elif defined( MACOSX )
|
2011-07-14 11:02:21 +03:00
|
|
|
CGContextRef rCGContext; // CoreGraphics graphic context
|
2013-03-27 02:11:39 +02:00
|
|
|
#elif defined( ANDROID )
|
|
|
|
// Nothing
|
2013-03-26 17:26:57 +02:00
|
|
|
#elif defined( IOS )
|
2013-12-12 20:20:01 +02:00
|
|
|
CGContextRef rCGContext; // CoreGraphics graphic context
|
2007-07-24 09:03:18 +00:00
|
|
|
#elif defined( UNX )
|
2008-06-24 10:39:19 +00:00
|
|
|
void* pDisplay; // the relevant display connection
|
2007-07-24 09:03:18 +00:00
|
|
|
long hDrawable; // a drawable
|
2008-06-24 10:39:19 +00:00
|
|
|
void* pVisual; // the visual in use
|
|
|
|
int nScreen; // the current screen of the drawable
|
|
|
|
int nDepth; // depth of said visual
|
|
|
|
long aColormap; // the colormap being used
|
2011-01-17 16:06:05 +01:00
|
|
|
void* pXRenderFormat; // render format for drawable
|
2007-07-24 09:03:18 +00:00
|
|
|
#endif
|
2011-10-07 17:29:49 +01:00
|
|
|
SystemGraphicsData()
|
|
|
|
: nSize( sizeof( SystemGraphicsData ) )
|
|
|
|
#if defined( WNT )
|
|
|
|
, hDC( 0 )
|
2015-04-27 16:22:11 +02:00
|
|
|
, hWnd( 0 )
|
2013-03-26 17:26:57 +02:00
|
|
|
#elif defined( MACOSX )
|
2013-12-12 20:20:01 +02:00
|
|
|
, rCGContext( NULL )
|
2013-03-27 02:11:39 +02:00
|
|
|
#elif defined( ANDROID )
|
|
|
|
// Nothing
|
2013-03-26 17:26:57 +02:00
|
|
|
#elif defined( IOS )
|
2013-12-12 20:20:01 +02:00
|
|
|
, rCGContext( NULL )
|
2011-10-07 17:29:49 +01:00
|
|
|
#elif defined( UNX )
|
|
|
|
, pDisplay( NULL )
|
|
|
|
, hDrawable( 0 )
|
|
|
|
, pVisual( NULL )
|
|
|
|
, nScreen( 0 )
|
|
|
|
, nDepth( 0 )
|
|
|
|
, aColormap( 0 )
|
|
|
|
, pXRenderFormat( NULL )
|
|
|
|
#endif
|
|
|
|
{ }
|
2007-07-24 09:03:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SystemWindowData
|
|
|
|
{
|
|
|
|
unsigned long nSize; // size in bytes of this structure
|
|
|
|
#if defined( WNT ) // meaningless on Windows
|
2014-09-01 01:18:09 +02:00
|
|
|
#elif defined( MACOSX )
|
|
|
|
bool bOpenGL; // create a OpenGL providing NSView
|
2014-09-01 23:59:24 +02:00
|
|
|
bool bLegacy; // create a 2.1 legacy context, only valid if bOpenGL == true
|
2013-03-27 02:11:39 +02:00
|
|
|
#elif defined( ANDROID )
|
|
|
|
// Nothing
|
|
|
|
#elif defined( IOS )
|
2013-03-27 00:38:36 +02:00
|
|
|
// Nothing
|
2007-07-24 09:03:18 +00:00
|
|
|
#elif defined( UNX )
|
|
|
|
void* pVisual; // the visual to be used
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2009-05-18 12:01:49 +00:00
|
|
|
struct SystemGlyphData
|
|
|
|
{
|
|
|
|
unsigned long index;
|
|
|
|
double x;
|
|
|
|
double y;
|
2010-12-03 11:00:01 +00:00
|
|
|
int fallbacklevel;
|
2009-05-18 12:01:49 +00:00
|
|
|
};
|
|
|
|
|
2015-06-02 23:52:56 +03:00
|
|
|
#if ENABLE_CAIRO_CANVAS
|
|
|
|
|
2009-05-18 12:01:49 +00:00
|
|
|
struct SystemFontData
|
|
|
|
{
|
|
|
|
unsigned long nSize; // size in bytes of this structure
|
2015-06-02 23:52:56 +03:00
|
|
|
#if defined( UNX )
|
2009-05-18 12:01:49 +00:00
|
|
|
void* nFontId; // native font id
|
|
|
|
int nFontFlags; // native font flags
|
|
|
|
#endif
|
|
|
|
bool bFakeBold; // Does this font need faking the bold style
|
|
|
|
bool bFakeItalic; // Does this font need faking the italic style
|
|
|
|
bool bAntialias; // Should this font be antialiased
|
|
|
|
bool bVerticalCharacterType; // Is the font using vertical character type
|
2011-10-07 17:29:49 +01:00
|
|
|
|
|
|
|
SystemFontData()
|
|
|
|
: nSize( sizeof( SystemFontData ) )
|
2015-06-02 23:52:56 +03:00
|
|
|
#if defined( UNX )
|
2011-10-07 17:29:49 +01:00
|
|
|
, nFontId( NULL )
|
|
|
|
, nFontFlags( 0 )
|
|
|
|
#endif
|
|
|
|
, bFakeBold( false )
|
|
|
|
, bFakeItalic( false )
|
|
|
|
, bAntialias( true )
|
|
|
|
, bVerticalCharacterType( false )
|
|
|
|
{
|
|
|
|
}
|
2009-05-18 12:01:49 +00:00
|
|
|
};
|
|
|
|
|
2015-06-02 23:52:56 +03:00
|
|
|
#endif // ENABLE_CAIRO_CANVAS
|
|
|
|
|
2010-12-03 11:00:01 +00:00
|
|
|
typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
|
2010-12-06 11:28:14 +01:00
|
|
|
|
2009-05-18 12:01:49 +00:00
|
|
|
struct SystemTextLayoutData
|
|
|
|
{
|
2010-12-03 11:00:01 +00:00
|
|
|
unsigned long nSize; // size in bytes of this structure
|
|
|
|
SystemGlyphDataVector rGlyphData; // glyph data
|
|
|
|
int orientation; // Text orientation
|
2009-05-18 12:01:49 +00:00
|
|
|
};
|
|
|
|
|
2013-10-23 19:10:20 +02:00
|
|
|
#endif // INCLUDED_VCL_SYSDATA_HXX
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|