Mir
common.h
Go to the documentation of this file.
1 /*
2  * Simple definitions common to client and server.
3  *
4  * Copyright © 2013-2016 Canonical Ltd.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License version 3 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * Author: Daniel van Vugt <daniel.van.vugt@canonical.com>
19  */
20 
21 #ifndef MIR_COMMON_H_
22 #define MIR_COMMON_H_
23 
28 /* This is C code. Not C++. */
29 
34 typedef enum MirSurfaceAttrib
35 {
36  /* Do not specify values...code relies on 0...N ordering. */
44  /* Must be last */
47 
48 typedef enum MirSurfaceType
49 {
63 
64 typedef enum MirSurfaceState
65 {
71  /* mir_surface_state_semimaximized,
72  Omitted for now, since it's functionally a subset of vertmaximized and
73  differs only in the X coordinate. */
79 
80 /* TODO: MirSurfaceFocusState MirSurfaceVisibility and MirLifecycleState use an inconsistent
81  naming convention. */
83 {
87 
89 {
93 
94 typedef enum MirLifecycleState
95 {
100 
101 typedef enum MirPowerMode
102 {
103  mir_power_mode_on, /* Display in use. */
104  mir_power_mode_standby, /* Blanked, low power. */
105  mir_power_mode_suspend, /* Blanked, lowest power. */
106  mir_power_mode_off /* Powered down. */
107 } MirPowerMode;
108 
109 typedef enum MirOutputType
110 {
111  mir_output_type_unknown = 0, /* DRM_MODE_CONNECTOR_Unknown */
112  mir_output_type_vga = 1, /* DRM_MODE_CONNECTOR_VGA */
113  mir_output_type_dvii = 2, /* DRM_MODE_CONNECTOR_DVII */
114  mir_output_type_dvid = 3, /* DRM_MODE_CONNECTOR_DVID */
115  mir_output_type_dvia = 4, /* DRM_MODE_CONNECTOR_DVIA */
116  mir_output_type_composite = 5, /* DRM_MODE_CONNECTOR_Composite */
117  mir_output_type_svideo = 6, /* DRM_MODE_CONNECTOR_SVIDEO */
118  mir_output_type_lvds = 7, /* DRM_MODE_CONNECTOR_LVDS */
119  mir_output_type_component = 8, /* DRM_MODE_CONNECTOR_Component */
120  mir_output_type_ninepindin = 9, /* DRM_MODE_CONNECTOR_9PinDIN */
121  mir_output_type_displayport = 10, /* DRM_MODE_CONNECTOR_DisplayPort */
122  mir_output_type_hdmia = 11, /* DRM_MODE_CONNECTOR_HDMIA */
123  mir_output_type_hdmib = 12, /* DRM_MODE_CONNECTOR_HDMIB */
124  mir_output_type_tv = 13, /* DRM_MODE_CONNECTOR_TV */
125  mir_output_type_edp = 14, /* DRM_MODE_CONNECTOR_eDP */
126  mir_output_type_virtual = 15, /* DRM_MODE_CONNECTOR_VIRTUAL */
127  mir_output_type_dsi = 16, /* DRM_MODE_CONNECTOR_DSI */
128  mir_output_type_dpi = 17, /* DRM_MODE_CONNECTOR_DPI */
129 } MirOutputType;
130 
132 {
137 
156 typedef enum MirPixelFormat
157 {
168  /*
169  * TODO: Big endian support would require additional formats in order to
170  * composite software surfaces using OpenGL (GL_RGBA/GL_BGRA_EXT):
171  * mir_pixel_format_rgb[ax]_8888
172  * mir_pixel_format_bgr[ax]_8888
173  */
174  mir_pixel_formats /* Note: This is always max format + 1 */
176 
177 /* This could be improved... https://bugs.launchpad.net/mir/+bug/1236254 */
178 #define MIR_BYTES_PER_PIXEL(f) ((f) == mir_pixel_format_bgr_888 ? 3 : \
179  (f) == mir_pixel_format_rgb_888 ? 3 : \
180  (f) == mir_pixel_format_rgb_565 ? 2 : \
181  (f) == mir_pixel_format_rgba_5551 ? 2 : \
182  (f) == mir_pixel_format_rgba_4444 ? 2 : \
183  4)
184 
186 typedef enum MirOrientation
187 {
193 
195 typedef enum MirMirrorMode
196 {
200 } MirMirrorMode;
201 
202 typedef enum MirOrientationMode
203 {
215 
216 typedef enum MirEdgeAttachment
217 {
223 
224 // Inspired by GdkGravity
230 {
233 
236 
239 
242 
245 
248 
251 
254 
258 
259 // Inspired by GdkAnchorHints
284 typedef enum MirPlacementHints
285 {
288 
291 
294 
297 
300 
303 
306 
309 
312 
316 
320 typedef enum MirFormFactor
321 {
328 } MirFormFactor;
329 
330 
337 {
345 
349 typedef enum MirShellChrome
350 {
354 
360 {
364 
369 {
373 
376 #endif
the reference point is at the middle of the left edge.
Definition: common.h:235
Arrangement of subpixels cannot be determined.
Definition: common.h:338
allow resizing window on both axes
Definition: common.h:314
Definition: common.h:351
the reference point is at the lower left corner.
Definition: common.h:253
allow sliding window horizontally
Definition: common.h:293
AKA "OSK" or handwriting etc.
Definition: common.h:58
Definition: common.h:38
Definition: common.h:116
Definition: common.h:370
Definition: common.h:55
Definition: common.h:90
Definition: common.h:125
allow sliding window vertically
Definition: common.h:296
allow resizing window horizontally
Definition: common.h:299
Definition: common.h:128
Definition: common.h:69
Definition: common.h:45
Definition: common.h:42
Definition: common.h:324
allow flipping aux_anchor to opposite corner
Definition: common.h:305
the reference point is at the center.
Definition: common.h:232
MirPlacementHints
Positioning hints for aligning a window relative to a rectangle.
Definition: common.h:284
Definition: common.h:371
MirPromptSessionState
Definition: common.h:131
Definition: common.h:135
Definition: common.h:40
Definition: common.h:361
Definition: common.h:124
Definition: common.h:164
Definition: common.h:111
Definition: common.h:98
Definition: common.h:112
Definition: common.h:52
Definition: common.h:37
Definition: common.h:97
Definition: common.h:74
Definition: common.h:96
MirPointerConfinementState
Pointer Confinement.
Definition: common.h:359
Definition: common.h:115
Definition: common.h:91
Definition: common.h:106
Definition: common.h:133
Definition: common.h:84
Definition: common.h:158
Definition: common.h:119
Definition: common.h:218
Definition: common.h:188
Definition: common.h:120
Definition: common.h:162
Definition: common.h:205
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:186
Definition: common.h:208
Definition: common.h:160
the reference point is at the middle of the lower edge.
Definition: common.h:244
MirSubpixelArrangement
Physical arrangement of subpixels on the physical output.
Definition: common.h:336
Definition: common.h:190
Definition: common.h:57
Definition: common.h:70
Definition: common.h:75
Definition: common.h:204
Definition: common.h:134
Definition: common.h:197
Definition: common.h:362
Subpixels are arranged vertically, R, G, B from top to bottom.
Definition: common.h:341
the reference point is in the middle of the top edge.
Definition: common.h:241
Definition: common.h:191
Definition: common.h:105
Definition: common.h:352
Definition: common.h:167
MirSurfaceState
Definition: common.h:64
Definition: common.h:189
Definition: common.h:198
allow resizing window vertically
Definition: common.h:302
AKA "tooltip".
Definition: common.h:60
Definition: common.h:163
Definition: common.h:54
MirOutputGammaSupported
Supports gamma correction.
Definition: common.h:368
the reference point is at the top right corner.
Definition: common.h:250
Definition: common.h:174
Definition: common.h:326
AKA "floating".
Definition: common.h:51
MirMirrorMode
Mirroring axis relative to the "natural" orientation of the display.
Definition: common.h:195
Definition: common.h:166
MirPowerMode
Definition: common.h:101
the reference point is at the top left corner.
Definition: common.h:247
the reference point is at the lower right corner.
Definition: common.h:256
MirSurfaceAttrib
Attributes of a surface that the client and server/shell may wish to get or set over the wire...
Definition: common.h:34
Definition: common.h:61
Definition: common.h:118
MirSurfaceType
Definition: common.h:48
Definition: common.h:53
Definition: common.h:161
Definition: common.h:104
MirFormFactor
Form factor associated with a physical output.
Definition: common.h:320
Definition: common.h:327
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:156
Definition: common.h:77
MirLifecycleState
Definition: common.h:94
Definition: common.h:66
Definition: common.h:199
MirSurfaceFocusState
Definition: common.h:82
MirSurfaceVisibility
Definition: common.h:88
Definition: common.h:114
allow flipping anchors horizontally
Definition: common.h:287
Definition: common.h:322
Definition: common.h:56
MirShellChrome
Shell chrome.
Definition: common.h:349
Definition: common.h:325
Definition: common.h:159
Definition: common.h:210
Device does not have regular subpixels.
Definition: common.h:343
Definition: common.h:117
Definition: common.h:67
allow sliding window on both axes
Definition: common.h:311
Definition: common.h:113
Definition: common.h:121
Definition: common.h:219
Definition: common.h:76
Definition: common.h:39
Definition: common.h:165
Definition: common.h:212
allow flipping anchors vertically
Definition: common.h:290
Definition: common.h:122
MirOrientationMode
Definition: common.h:202
Definition: common.h:103
Definition: common.h:85
MirOutputType
Definition: common.h:109
the reference point is at the middle of the right edge.
Definition: common.h:238
Definition: common.h:41
Definition: common.h:123
Definition: common.h:127
AKA "regular".
Definition: common.h:50
Definition: common.h:323
Subpixels are arranged vertically, B, G, R from top to bottom.
Definition: common.h:342
AKA "toolbox"/"toolbar".
Definition: common.h:59
Definition: common.h:220
allow flipping anchors on both axes
Definition: common.h:308
Definition: common.h:126
Subpixels are arranged horizontally, R, G, B from left to right.
Definition: common.h:339
MirPlacementGravity
Reference point for aligning a surface relative to a rectangle.
Definition: common.h:229
Subpixels are arranged horizontally, B, G, R from left to right.
Definition: common.h:340
MirEdgeAttachment
Definition: common.h:216
Definition: common.h:68

Copyright © 2012-2016 Canonical Ltd.
Generated on Sat Dec 3 12:48:59 UTC 2016