Mir
common.h
Go to the documentation of this file.
1 /*
2  * Simple definitions common to client and server.
3  *
4  * Copyright © 2013-2014 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 
110 {
115 
134 typedef enum MirPixelFormat
135 {
146  /*
147  * TODO: Big endian support would require additional formats in order to
148  * composite software surfaces using OpenGL (GL_RGBA/GL_BGRA_EXT):
149  * mir_pixel_format_rgb[ax]_8888
150  * mir_pixel_format_bgr[ax]_8888
151  */
152  mir_pixel_formats /* Note: This is always max format + 1 */
154 
155 /* This could be improved... https://bugs.launchpad.net/mir/+bug/1236254 */
156 #define MIR_BYTES_PER_PIXEL(f) ((f) == mir_pixel_format_bgr_888 ? 3 : \
157  (f) == mir_pixel_format_rgb_888 ? 3 : \
158  (f) == mir_pixel_format_rgb_565 ? 2 : \
159  (f) == mir_pixel_format_rgba_5551 ? 2 : \
160  (f) == mir_pixel_format_rgba_4444 ? 2 : \
161  4)
162 
164 typedef enum MirOrientation
165 {
171 
172 typedef enum MirOrientationMode
173 {
185 
186 typedef enum MirEdgeAttachment
187 {
193 
197 typedef enum MirFormFactor
198 {
205 } MirFormFactor;
206 
209 #endif
AKA "OSK" or handwriting etc.
Definition: common.h:58
Definition: common.h:38
Definition: common.h:55
Definition: common.h:90
Definition: common.h:69
Definition: common.h:45
Definition: common.h:42
Definition: common.h:201
MirPromptSessionState
Definition: common.h:109
Definition: common.h:113
Definition: common.h:40
Definition: common.h:142
Definition: common.h:98
Definition: common.h:52
Definition: common.h:37
Definition: common.h:97
Definition: common.h:74
Definition: common.h:96
Definition: common.h:91
Definition: common.h:106
Definition: common.h:111
Definition: common.h:84
Definition: common.h:136
Definition: common.h:188
Definition: common.h:166
Definition: common.h:140
Definition: common.h:175
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:164
Definition: common.h:178
Definition: common.h:138
Definition: common.h:168
Definition: common.h:57
Definition: common.h:70
Definition: common.h:75
Definition: common.h:174
Definition: common.h:112
Definition: common.h:169
Definition: common.h:105
Definition: common.h:145
MirSurfaceState
Definition: common.h:64
Definition: common.h:167
AKA "tooltip".
Definition: common.h:60
Definition: common.h:141
Definition: common.h:54
Definition: common.h:152
Definition: common.h:203
AKA "floating".
Definition: common.h:51
Definition: common.h:144
MirPowerMode
Definition: common.h:101
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
MirSurfaceType
Definition: common.h:48
Definition: common.h:53
Definition: common.h:139
Definition: common.h:104
MirFormFactor
Form factor associated with a physical output.
Definition: common.h:197
Definition: common.h:204
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:134
Definition: common.h:77
MirLifecycleState
Definition: common.h:94
Definition: common.h:66
MirSurfaceFocusState
Definition: common.h:82
MirSurfaceVisibility
Definition: common.h:88
Definition: common.h:199
Definition: common.h:56
Definition: common.h:202
Definition: common.h:137
Definition: common.h:180
Definition: common.h:67
Definition: common.h:189
Definition: common.h:76
Definition: common.h:39
Definition: common.h:143
Definition: common.h:182
MirOrientationMode
Definition: common.h:172
Definition: common.h:103
Definition: common.h:85
Definition: common.h:41
AKA "regular".
Definition: common.h:50
Definition: common.h:200
AKA "toolbox"/"toolbar".
Definition: common.h:59
Definition: common.h:190
MirEdgeAttachment
Definition: common.h:186
Definition: common.h:68

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015