Mir
Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
1/*
2 * Simple definitions common to client and server.
3 *
4 * Copyright © 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 2 or 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
19#ifndef MIR_COMMON_H_
20#define MIR_COMMON_H_
21
22//for clang
23#ifndef __has_feature
24 #define __has_feature(x) 0 // Compatibility with non-clang
25#endif
26
27//for clang
28#ifndef __has_extension
29 #define __has_extension __has_feature // Compatibility with pre-3.0
30#endif
31
32/* This is C code. Not C++. */
33
54
69
86
93
99
106
107typedef enum MirPowerMode
108{
109 mir_power_mode_on, /* Display in use. */
110 mir_power_mode_standby, /* Blanked, low power. */
111 mir_power_mode_suspend, /* Blanked, lowest power. */
112 mir_power_mode_off /* Powered down. */
114
115typedef enum MirOutputType
116{
117 mir_output_type_unknown = 0, /* DRM_MODE_CONNECTOR_Unknown */
118 mir_output_type_vga = 1, /* DRM_MODE_CONNECTOR_VGA */
119 mir_output_type_dvii = 2, /* DRM_MODE_CONNECTOR_DVII */
120 mir_output_type_dvid = 3, /* DRM_MODE_CONNECTOR_DVID */
121 mir_output_type_dvia = 4, /* DRM_MODE_CONNECTOR_DVIA */
122 mir_output_type_composite = 5, /* DRM_MODE_CONNECTOR_Composite */
123 mir_output_type_svideo = 6, /* DRM_MODE_CONNECTOR_SVIDEO */
124 mir_output_type_lvds = 7, /* DRM_MODE_CONNECTOR_LVDS */
125 mir_output_type_component = 8, /* DRM_MODE_CONNECTOR_Component */
126 mir_output_type_ninepindin = 9, /* DRM_MODE_CONNECTOR_9PinDIN */
127 mir_output_type_displayport = 10, /* DRM_MODE_CONNECTOR_DisplayPort */
128 mir_output_type_hdmia = 11, /* DRM_MODE_CONNECTOR_HDMIA */
129 mir_output_type_hdmib = 12, /* DRM_MODE_CONNECTOR_HDMIB */
130 mir_output_type_tv = 13, /* DRM_MODE_CONNECTOR_TV */
131 mir_output_type_edp = 14, /* DRM_MODE_CONNECTOR_eDP */
132 mir_output_type_virtual = 15, /* DRM_MODE_CONNECTOR_VIRTUAL */
133 mir_output_type_dsi = 16, /* DRM_MODE_CONNECTOR_DSI */
134 mir_output_type_dpi = 17, /* DRM_MODE_CONNECTOR_DPI */
136
143
162typedef enum MirPixelFormat
163{
174 /*
175 * TODO: Big endian support would require additional formats in order to
176 * composite software surfaces using OpenGL (GL_RGBA/GL_BGRA_EXT):
177 * mir_pixel_format_rgb[ax]_8888
178 * mir_pixel_format_bgr[ax]_8888
179 */
180 mir_pixel_formats /* Note: This is always max format + 1 */
182
183/* This could be improved... https://bugs.launchpad.net/mir/+bug/1236254 */
184#define MIR_BYTES_PER_PIXEL(f) ((f) == mir_pixel_format_bgr_888 ? 3 : \
185 (f) == mir_pixel_format_rgb_888 ? 3 : \
186 (f) == mir_pixel_format_rgb_565 ? 2 : \
187 (f) == mir_pixel_format_rgba_5551 ? 2 : \
188 (f) == mir_pixel_format_rgba_4444 ? 2 : \
189 4)
190
199
207
221
229
230// Inspired by GdkGravity
264
265// Inspired by GdkAnchorHints
322
323
342
355
356
371
380
392
401
418
429
430#endif
MirFocusMode
Focus mode controls how a surface gains and loses focus.
Definition common.h:423
@ mir_focus_mode_grabbing
This mode causes the surface to take focus if possible, and prevents focus from leaving it as long as...
Definition common.h:426
@ mir_focus_mode_disabled
The surface will never be given focus.
Definition common.h:425
@ mir_focus_mode_focusable
The surface can gain and lose focus normally.
Definition common.h:424
MirFormFactor
Form factor associated with a physical output.
Definition common.h:347
@ mir_form_factor_unknown
Definition common.h:348
@ mir_form_factor_projector
Definition common.h:353
@ mir_form_factor_tablet
Definition common.h:350
@ mir_form_factor_phone
Definition common.h:349
@ mir_form_factor_tv
Definition common.h:352
@ mir_form_factor_monitor
Definition common.h:351
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition common.h:193
@ mir_orientation_right
Definition common.h:197
@ mir_orientation_normal
Definition common.h:194
@ mir_orientation_left
Definition common.h:195
@ mir_orientation_inverted
Definition common.h:196
MirResizeEdge
Hints for resizing a window.
Definition common.h:331
@ mir_resize_edge_northeast
Definition common.h:338
@ mir_resize_edge_southwest
Definition common.h:339
@ mir_resize_edge_south
Definition common.h:336
@ mir_resize_edge_southeast
Definition common.h:340
@ mir_resize_edge_north
Definition common.h:335
@ mir_resize_edge_east
Definition common.h:334
@ mir_resize_edge_west
Definition common.h:333
@ mir_resize_edge_none
Definition common.h:332
@ mir_resize_edge_northwest
Definition common.h:337
MirPowerMode
Definition common.h:108
@ mir_power_mode_standby
Definition common.h:110
@ mir_power_mode_suspend
Definition common.h:111
@ mir_power_mode_off
Definition common.h:112
@ mir_power_mode_on
Definition common.h:109
MirPointerConfinementState
Pointer Confinement.
Definition common.h:385
@ mir_pointer_locked_oneshot
Definition common.h:389
@ mir_pointer_unconfined
Definition common.h:386
@ mir_pointer_locked_persistent
Definition common.h:390
@ mir_pointer_confined_oneshot
Definition common.h:387
@ mir_pointer_confined_persistent
Definition common.h:388
MirLifecycleState
Definition common.h:101
@ mir_lifecycle_connection_lost
Definition common.h:104
@ mir_lifecycle_state_will_suspend
Definition common.h:102
@ mir_lifecycle_state_resumed
Definition common.h:103
MirWindowType
Definition common.h:56
@ mir_window_type_menu
Definition common.h:62
@ mir_window_type_satellite
AKA "toolbox"/"toolbar"
Definition common.h:64
@ mir_window_type_decoration
Definition common.h:66
@ mir_window_type_gloss
Definition common.h:60
@ mir_window_type_utility
AKA "floating"
Definition common.h:58
@ mir_window_type_dialog
Definition common.h:59
@ mir_window_types
Definition common.h:67
@ mir_window_type_tip
AKA "tooltip"
Definition common.h:65
@ mir_window_type_normal
AKA "regular"
Definition common.h:57
@ mir_window_type_inputmethod
AKA "OSK" or handwriting etc.
Definition common.h:63
@ mir_window_type_freestyle
Definition common.h:61
MirShellChrome
Shell chrome.
Definition common.h:376
@ mir_shell_chrome_low
Definition common.h:378
@ mir_shell_chrome_normal
Definition common.h:377
MirWindowFocusState
Definition common.h:88
@ mir_window_focus_state_unfocused
Inactive and does not have focus
Definition common.h:89
@ mir_window_focus_state_focused
Active and has keybaord focus
Definition common.h:90
@ mir_window_focus_state_active
Active but does not have keyboard focus
Definition common.h:91
MirWindowState
Definition common.h:71
@ mir_window_state_attached
Used for panels, notifications and other windows attached to output edges.
Definition common.h:83
@ mir_window_state_minimized
Definition common.h:74
@ mir_window_state_horizmaximized
Definition common.h:81
@ mir_window_states
Definition common.h:84
@ mir_window_state_restored
Definition common.h:73
@ mir_window_state_fullscreen
Definition common.h:80
@ mir_window_state_maximized
Definition common.h:75
@ mir_window_state_unknown
Definition common.h:72
@ mir_window_state_hidden
Definition common.h:82
@ mir_window_state_vertmaximized
Definition common.h:76
MirPlacementGravity
Reference point for aligning a surface relative to a rectangle.
Definition common.h:236
@ mir_placement_gravity_east
the reference point is at the middle of the right edge.
Definition common.h:244
@ mir_placement_gravity_northwest
the reference point is at the top left corner.
Definition common.h:253
@ mir_placement_gravity_center
the reference point is at the center.
Definition common.h:238
@ mir_placement_gravity_west
the reference point is at the middle of the left edge.
Definition common.h:241
@ mir_placement_gravity_northeast
the reference point is at the top right corner.
Definition common.h:256
@ mir_placement_gravity_southeast
the reference point is at the lower right corner.
Definition common.h:262
@ mir_placement_gravity_south
the reference point is at the middle of the lower edge.
Definition common.h:250
@ mir_placement_gravity_north
the reference point is in the middle of the top edge.
Definition common.h:247
@ mir_placement_gravity_southwest
the reference point is at the lower left corner.
Definition common.h:259
MirEdgeAttachment
Definition common.h:223
@ mir_edge_attachment_horizontal
Definition common.h:225
@ mir_edge_attachment_vertical
Definition common.h:224
@ mir_edge_attachment_any
Definition common.h:226
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition common.h:163
@ mir_pixel_format_xbgr_8888
Definition common.h:166
@ mir_pixel_format_invalid
Definition common.h:164
@ mir_pixel_format_rgb_888
Definition common.h:170
@ mir_pixel_format_rgb_565
Definition common.h:171
@ mir_pixel_formats
Definition common.h:180
@ mir_pixel_format_rgba_5551
Definition common.h:172
@ mir_pixel_format_abgr_8888
Definition common.h:165
@ mir_pixel_format_xrgb_8888
Definition common.h:168
@ mir_pixel_format_argb_8888
Definition common.h:167
@ mir_pixel_format_bgr_888
Definition common.h:169
@ mir_pixel_format_rgba_4444
Definition common.h:173
MirPlacementHints
Positioning hints for aligning a window relative to a rectangle.
Definition common.h:291
@ mir_placement_hints_slide_any
allow sliding window on both axes
Definition common.h:317
@ mir_placement_hints_flip_x
allow flipping anchors horizontally
Definition common.h:293
@ mir_placement_hints_flip_any
allow flipping anchors on both axes
Definition common.h:314
@ mir_placement_hints_resize_x
allow resizing window horizontally
Definition common.h:305
@ mir_placement_hints_antipodes
allow flipping aux_anchor to opposite corner
Definition common.h:311
@ mir_placement_hints_resize_any
allow resizing window on both axes
Definition common.h:320
@ mir_placement_hints_slide_x
allow sliding window horizontally
Definition common.h:299
@ mir_placement_hints_resize_y
allow resizing window vertically
Definition common.h:308
@ mir_placement_hints_flip_y
allow flipping anchors vertically
Definition common.h:296
@ mir_placement_hints_slide_y
allow sliding window vertically
Definition common.h:302
MirMirrorMode
Mirroring axis relative to the "natural" orientation of the display.
Definition common.h:202
@ mir_mirror_mode_vertical
Definition common.h:204
@ mir_mirror_mode_none
Definition common.h:203
@ mir_mirror_mode_horizontal
Definition common.h:205
MirOutputType
Definition common.h:116
@ mir_output_type_svideo
Definition common.h:123
@ mir_output_type_dpi
Definition common.h:134
@ mir_output_type_composite
Definition common.h:122
@ mir_output_type_hdmia
Definition common.h:128
@ mir_output_type_vga
Definition common.h:118
@ mir_output_type_displayport
Definition common.h:127
@ mir_output_type_component
Definition common.h:125
@ mir_output_type_hdmib
Definition common.h:129
@ mir_output_type_edp
Definition common.h:131
@ mir_output_type_ninepindin
Definition common.h:126
@ mir_output_type_dsi
Definition common.h:133
@ mir_output_type_tv
Definition common.h:130
@ mir_output_type_dvii
Definition common.h:119
@ mir_output_type_virtual
Definition common.h:132
@ mir_output_type_dvid
Definition common.h:120
@ mir_output_type_unknown
Definition common.h:117
@ mir_output_type_lvds
Definition common.h:124
@ mir_output_type_dvia
Definition common.h:121
MirDepthLayer
Depth layer controls Z ordering of surfaces.
Definition common.h:410
@ mir_depth_layer_below
For panels or other controls/decorations below normal windows.
Definition common.h:412
@ mir_depth_layer_above
For panels or notifications that want to be above normal windows.
Definition common.h:415
@ mir_depth_layer_overlay
For overlays such as lock screens (heighest layer)
Definition common.h:416
@ mir_depth_layer_background
For desktop backgrounds and alike (lowest layer)
Definition common.h:411
@ mir_depth_layer_always_on_top
For always-on-top application windows.
Definition common.h:414
@ mir_depth_layer_application
For normal application windows.
Definition common.h:413
MirWindowVisibility
Definition common.h:95
@ mir_window_visibility_exposed
Definition common.h:97
@ mir_window_visibility_occluded
Definition common.h:96
MirWindowAttrib
Attributes of a window that the client and server/shell may wish to get or set over the wire.
Definition common.h:39
@ mir_window_attrib_visibility
Definition common.h:49
@ mir_window_attrib_swapinterval
Definition common.h:43
@ mir_window_attrib_preferred_orientation
Definition common.h:50
@ mir_window_attrib_type
Definition common.h:41
@ mir_window_attribs
Definition common.h:52
@ mir_window_attrib_state
Definition common.h:42
@ mir_window_attrib_focus
Definition common.h:47
@ mir_window_attrib_dpi
Definition common.h:48
MirPromptSessionState
Definition common.h:138
@ mir_prompt_session_state_suspended
Definition common.h:141
@ mir_prompt_session_state_stopped
Definition common.h:139
@ mir_prompt_session_state_started
Definition common.h:140
MirSubpixelArrangement
Physical arrangement of subpixels on the physical output.
Definition common.h:363
@ mir_subpixel_arrangement_horizontal_rgb
Subpixels are arranged horizontally, R, G, B from left to right.
Definition common.h:365
@ mir_subpixel_arrangement_horizontal_bgr
Subpixels are arranged horizontally, B, G, R from left to right.
Definition common.h:366
@ mir_subpixel_arrangement_unknown
Arrangement of subpixels cannot be determined.
Definition common.h:364
@ mir_subpixel_arrangement_vertical_rgb
Subpixels are arranged vertically, R, G, B from top to bottom.
Definition common.h:367
@ mir_subpixel_arrangement_vertical_bgr
Subpixels are arranged vertically, B, G, R from top to bottom.
Definition common.h:368
@ mir_subpixel_arrangement_none
Device does not have regular subpixels.
Definition common.h:369
MirOrientationMode
Definition common.h:209
@ mir_orientation_mode_landscape_any
Definition common.h:216
@ mir_orientation_mode_portrait
Definition common.h:210
@ mir_orientation_mode_any
Definition common.h:218
@ mir_orientation_mode_landscape
Definition common.h:211
@ mir_orientation_mode_portrait_any
Definition common.h:214
@ mir_orientation_mode_portrait_inverted
Definition common.h:212
@ mir_orientation_mode_landscape_inverted
Definition common.h:213
MirOutputGammaSupported
Supports gamma correction.
Definition common.h:397
@ mir_output_gamma_unsupported
Definition common.h:398
@ mir_output_gamma_supported
Definition common.h:399

Copyright © 2012-2025 Canonical Ltd.
Generated on Mon Jan 20 23:24:07 UTC 2025
This documentation is licensed under the GPL version 2 or 3.