xref: /AOO41X/main/vcl/inc/vcl/sysdata.hxx (revision bde8a4bd43e7fa360732f30ecf52c869f47a5d51)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SV_SYSDATA_HXX
25 #define _SV_SYSDATA_HXX
26 
27 #include <vector>
28 
29 #ifdef QUARTZ
30 // predeclare the native classes to avoid header/include problems
31 typedef struct CGContext *CGContextRef;
32 typedef struct CGLayer   *CGLayerRef;
33 #ifdef __OBJC__
34 @class NSView;
35 #else
36 class NSView;
37 #endif
38 #endif
39 
40 // -----------------
41 // - SystemEnvData -
42 // -----------------
43 
44 struct SystemEnvData
45 {
46     unsigned long       nSize;          // size in bytes of this structure
47 #if defined( WNT ) || defined( OS2 )
48     HWND                hWnd;           // the window hwnd
49 #elif defined( QUARTZ )
50     NSView*             mpNSView;       // the cocoa (NSView *) implementing this object
51 #elif defined( UNX )
52     void*               pDisplay;       // the relevant display connection
53     long                aWindow;        // the window of the object
54     void*               pSalFrame;      // contains a salframe, if object has one
55     void*               pWidget;        // the corresponding widget
56     void*               pVisual;        // the visual in use
57     int             nScreen;        // the current screen of the window
58     int                 nDepth;         // depth of said visual
59     long                aColormap;      // the colormap being used
60     void*               pAppContext;    // the application context in use
61     long                aShellWindow;   // the window of the frame's shell
62     void*               pShellWidget;   // the frame's shell widget
63 #endif
64 };
65 
66 #define SystemChildData SystemEnvData
67 
68 // --------------------
69 // - SystemParentData -
70 // --------------------
71 
72 struct SystemParentData
73 {
74     unsigned long   nSize;            // size in bytes of this structure
75 #if defined( WNT ) || defined( OS2 )
76     HWND            hWnd;             // the window hwnd
77 #elif defined( QUARTZ )
78     NSView*         pView;            // the cocoa (NSView *) implementing this object
79 #elif defined( UNX )
80     long            aWindow;          // the window of the object
81     bool            bXEmbedSupport:1; // decides whether the object in question
82                                       // should support the XEmbed protocol
83 #endif
84 };
85 
86 // --------------------
87 // - SystemMenuData -
88 // --------------------
89 
90 struct SystemMenuData
91 {
92     unsigned long   nSize;          // size in bytes of this structure
93 #if defined( WNT )
94     HMENU           hMenu;          // the menu handle of the menu bar
95 #elif defined( QUARTZ )
96     //not defined
97 #elif defined( UNX )
98     long            aMenu;          // ???
99 #endif
100 };
101 
102 // --------------------
103 // - SystemGraphicsData -
104 // --------------------
105 
106 struct SystemGraphicsData
107 {
108     unsigned long   nSize;          // size in bytes of this structure
109 #if defined( WNT )
110     HDC             hDC;            // handle to a device context
111 #elif defined( QUARTZ )
112     CGContextRef    rCGContext;     // QUARTZ graphic context
113 #elif defined( UNX )
114     void*           pDisplay;       // the relevant display connection
115     long            hDrawable;      // a drawable
116     void*           pVisual;        // the visual in use
117     int         nScreen;        // the current screen of the drawable
118     int             nDepth;         // depth of said visual
119     long            aColormap;      // the colormap being used
120     void*           pRenderFormat;  // render format for drawable
121 #endif
122 };
123 
124 
125 // --------------------
126 // - SystemWindowData -
127 // --------------------
128 
129 struct SystemWindowData
130 {
131     unsigned long   nSize;          // size in bytes of this structure
132 #if defined( WNT )                  // meaningless on Windows
133 #elif defined( QUARTZ )             // meaningless on Mac OS X / Quartz
134 #elif defined( UNX )
135     void*           pVisual;        // the visual to be used
136 #endif
137 };
138 
139 
140 // --------------------
141 // - SystemGlyphData -
142 // --------------------
143 
144 struct SystemGlyphData
145 {
146     unsigned long        index;
147     double               x;
148     double               y;
149     int                  fallbacklevel;
150 };
151 
152 
153 // --------------------
154 // - SystemFontData -
155 // --------------------
156 
157 struct SystemFontData
158 {
159     unsigned long   nSize;          // size in bytes of this structure
160 #if defined( WNT )
161     HFONT           hFont;          // native font object
162 #elif defined( OS2 )
163     ULONG           hFont;          // native font object
164 #elif defined( QUARTZ )
165     void*           aATSUFontID;    // native font object
166 #elif defined( UNX )
167     void*           nFontId;        // native font id
168     int             nFontFlags;     // native font flags
169 #endif
170     bool            bFakeBold;      // Does this font need faking the bold style
171     bool            bFakeItalic;    // Does this font need faking the italic style
172     bool            bAntialias;     // Should this font be antialiased
173     bool            bVerticalCharacterType;      // Is the font using vertical character type
174 };
175 
176 // --------------------
177 // - SystemTextLayoutData -
178 // --------------------
179 
180 typedef std::vector<SystemGlyphData> SystemGlyphDataVector;
181 
182 struct SystemTextLayoutData
183 {
184     unsigned long   nSize;                      // size in bytes of this structure
185     std::vector<SystemGlyphData> rGlyphData;    // glyph data
186     int             orientation;                // Text orientation
187 };
188 
189 #endif // _SV_SYSDATA_HXX
190 
191