Mir
Macros | Typedefs | Enumerations
common.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __has_feature(x)   0
 
#define __has_extension   __has_feature
 
#define MIR_BYTES_PER_PIXEL(f)
 

Typedefs

typedef enum MirWindowAttrib MirWindowAttrib
 Attributes of a window that the client and server/shell may wish to get or set over the wire. More...
 
typedef enum MirWindowType MirWindowType
 
typedef enum MirWindowState MirWindowState
 
typedef enum MirWindowFocusState MirWindowFocusState
 
typedef enum MirWindowVisibility MirWindowVisibility
 
typedef enum MirLifecycleState MirLifecycleState
 
typedef enum MirPowerMode MirPowerMode
 
typedef enum MirOutputType MirOutputType
 
typedef enum MirPromptSessionState MirPromptSessionState
 
typedef enum MirPixelFormat MirPixelFormat
 32-bit pixel formats (8888): The order of components in the enum matches the order of the components as they would be written in an integer representing a pixel value of that format. More...
 
typedef enum MirOrientation MirOrientation
 Direction relative to the "natural" orientation of the display. More...
 
typedef enum MirMirrorMode MirMirrorMode
 Mirroring axis relative to the "natural" orientation of the display. More...
 
typedef enum MirOrientationMode MirOrientationMode
 
typedef enum MirEdgeAttachment MirEdgeAttachment
 
typedef enum MirPlacementGravity MirPlacementGravity
 Reference point for aligning a surface relative to a rectangle. More...
 
typedef enum MirPlacementHints MirPlacementHints
 Positioning hints for aligning a window relative to a rectangle. More...
 
typedef enum MirResizeEdge MirResizeEdge
 Hints for resizing a window. More...
 
typedef enum MirFormFactor MirFormFactor
 Form factor associated with a physical output. More...
 
typedef enum MirSubpixelArrangement MirSubpixelArrangement
 Physical arrangement of subpixels on the physical output. More...
 
typedef enum MirShellChrome MirShellChrome
 Shell chrome. More...
 
typedef enum MirPointerConfinementState MirPointerConfinementState
 Pointer Confinement. More...
 
typedef enum MirOutputGammaSupported MirOutputGammaSupported
 Supports gamma correction. More...
 
typedef enum MirDepthLayer MirDepthLayer
 Depth layer controls Z ordering of surfaces. More...
 
typedef enum MirFocusMode MirFocusMode
 Focus mode controls how a surface gains and loses focus. More...
 

Enumerations

enum  MirWindowAttrib {
  mir_window_attrib_type , mir_window_attrib_state , mir_window_attrib_swapinterval , mir_window_attrib_focus ,
  mir_window_attrib_dpi , mir_window_attrib_visibility , mir_window_attrib_preferred_orientation , mir_window_attribs
}
 Attributes of a window that the client and server/shell may wish to get or set over the wire. More...
 
enum  MirWindowType {
  mir_window_type_normal , mir_window_type_utility , mir_window_type_dialog , mir_window_type_gloss ,
  mir_window_type_freestyle , mir_window_type_menu , mir_window_type_inputmethod , mir_window_type_satellite ,
  mir_window_type_tip , mir_window_type_decoration , mir_window_types
}
 
enum  MirWindowState {
  mir_window_state_unknown , mir_window_state_restored , mir_window_state_minimized , mir_window_state_maximized ,
  mir_window_state_vertmaximized , mir_window_state_fullscreen , mir_window_state_horizmaximized , mir_window_state_hidden ,
  mir_window_state_attached , mir_window_states
}
 
enum  MirWindowFocusState { mir_window_focus_state_unfocused = 0 , mir_window_focus_state_focused , mir_window_focus_state_active }
 
enum  MirWindowVisibility { mir_window_visibility_occluded = 0 , mir_window_visibility_exposed }
 
enum  MirLifecycleState { mir_lifecycle_state_will_suspend , mir_lifecycle_state_resumed , mir_lifecycle_connection_lost }
 
enum  MirPowerMode { mir_power_mode_on , mir_power_mode_standby , mir_power_mode_suspend , mir_power_mode_off }
 
enum  MirOutputType {
  mir_output_type_unknown = 0 , mir_output_type_vga = 1 , mir_output_type_dvii = 2 , mir_output_type_dvid = 3 ,
  mir_output_type_dvia = 4 , mir_output_type_composite = 5 , mir_output_type_svideo = 6 , mir_output_type_lvds = 7 ,
  mir_output_type_component = 8 , mir_output_type_ninepindin = 9 , mir_output_type_displayport = 10 , mir_output_type_hdmia = 11 ,
  mir_output_type_hdmib = 12 , mir_output_type_tv = 13 , mir_output_type_edp = 14 , mir_output_type_virtual = 15 ,
  mir_output_type_dsi = 16 , mir_output_type_dpi = 17
}
 
enum  MirPromptSessionState { mir_prompt_session_state_stopped = 0 , mir_prompt_session_state_started , mir_prompt_session_state_suspended }
 
enum  MirPixelFormat {
  mir_pixel_format_invalid = 0 , mir_pixel_format_abgr_8888 = 1 , mir_pixel_format_xbgr_8888 = 2 , mir_pixel_format_argb_8888 = 3 ,
  mir_pixel_format_xrgb_8888 = 4 , mir_pixel_format_bgr_888 = 5 , mir_pixel_format_rgb_888 = 6 , mir_pixel_format_rgb_565 = 7 ,
  mir_pixel_format_rgba_5551 = 8 , mir_pixel_format_rgba_4444 = 9 , mir_pixel_formats
}
 32-bit pixel formats (8888): The order of components in the enum matches the order of the components as they would be written in an integer representing a pixel value of that format. More...
 
enum  MirOrientation { mir_orientation_normal = 0 , mir_orientation_left = 90 , mir_orientation_inverted = 180 , mir_orientation_right = 270 }
 Direction relative to the "natural" orientation of the display. More...
 
enum  MirMirrorMode { mir_mirror_mode_none , mir_mirror_mode_vertical , mir_mirror_mode_horizontal }
 Mirroring axis relative to the "natural" orientation of the display. More...
 
enum  MirOrientationMode {
  mir_orientation_mode_portrait = 1 << 0 , mir_orientation_mode_landscape = 1 << 1 , mir_orientation_mode_portrait_inverted = 1 << 2 , mir_orientation_mode_landscape_inverted = 1 << 3 ,
  mir_orientation_mode_portrait_any , mir_orientation_mode_landscape_any , mir_orientation_mode_any
}
 
enum  MirEdgeAttachment { mir_edge_attachment_vertical = 1 << 0 , mir_edge_attachment_horizontal = 1 << 1 , mir_edge_attachment_any }
 
enum  MirPlacementGravity {
  mir_placement_gravity_center = 0 , mir_placement_gravity_west = 1 << 0 , mir_placement_gravity_east = 1 << 1 , mir_placement_gravity_north = 1 << 2 ,
  mir_placement_gravity_south = 1 << 3 , mir_placement_gravity_northwest = mir_placement_gravity_north | mir_placement_gravity_west , mir_placement_gravity_northeast = mir_placement_gravity_north | mir_placement_gravity_east , mir_placement_gravity_southwest = mir_placement_gravity_south | mir_placement_gravity_west ,
  mir_placement_gravity_southeast = mir_placement_gravity_south | mir_placement_gravity_east
}
 Reference point for aligning a surface relative to a rectangle. More...
 
enum  MirPlacementHints {
  mir_placement_hints_flip_x = 1 << 0 , mir_placement_hints_flip_y = 1 << 1 , mir_placement_hints_slide_x = 1 << 2 , mir_placement_hints_slide_y = 1 << 3 ,
  mir_placement_hints_resize_x = 1 << 4 , mir_placement_hints_resize_y = 1 << 5 , mir_placement_hints_antipodes = 1 << 6 , mir_placement_hints_flip_any = mir_placement_hints_flip_x|mir_placement_hints_flip_y ,
  mir_placement_hints_slide_any = mir_placement_hints_slide_x|mir_placement_hints_slide_y , mir_placement_hints_resize_any = mir_placement_hints_resize_x|mir_placement_hints_resize_y
}
 Positioning hints for aligning a window relative to a rectangle. More...
 
enum  MirResizeEdge {
  mir_resize_edge_none = 0 , mir_resize_edge_west = 1 << 0 , mir_resize_edge_east = 1 << 1 , mir_resize_edge_north = 1 << 2 ,
  mir_resize_edge_south = 1 << 3 , mir_resize_edge_northwest = mir_resize_edge_north | mir_resize_edge_west , mir_resize_edge_northeast = mir_resize_edge_north | mir_resize_edge_east , mir_resize_edge_southwest = mir_resize_edge_south | mir_resize_edge_west ,
  mir_resize_edge_southeast = mir_resize_edge_south | mir_resize_edge_east
}
 Hints for resizing a window. More...
 
enum  MirFormFactor {
  mir_form_factor_unknown , mir_form_factor_phone , mir_form_factor_tablet , mir_form_factor_monitor ,
  mir_form_factor_tv , mir_form_factor_projector
}
 Form factor associated with a physical output. More...
 
enum  MirSubpixelArrangement {
  mir_subpixel_arrangement_unknown , mir_subpixel_arrangement_horizontal_rgb , mir_subpixel_arrangement_horizontal_bgr , mir_subpixel_arrangement_vertical_rgb ,
  mir_subpixel_arrangement_vertical_bgr , mir_subpixel_arrangement_none
}
 Physical arrangement of subpixels on the physical output. More...
 
enum  MirShellChrome { mir_shell_chrome_normal , mir_shell_chrome_low }
 Shell chrome. More...
 
enum  MirPointerConfinementState {
  mir_pointer_unconfined , mir_pointer_confined_oneshot , mir_pointer_confined_persistent , mir_pointer_locked_oneshot ,
  mir_pointer_locked_persistent
}
 Pointer Confinement. More...
 
enum  MirOutputGammaSupported { mir_output_gamma_unsupported , mir_output_gamma_supported }
 Supports gamma correction. More...
 
enum  MirDepthLayer {
  mir_depth_layer_background , mir_depth_layer_below , mir_depth_layer_application , mir_depth_layer_always_on_top ,
  mir_depth_layer_above , mir_depth_layer_overlay
}
 Depth layer controls Z ordering of surfaces. More...
 
enum  MirFocusMode { mir_focus_mode_focusable , mir_focus_mode_disabled , mir_focus_mode_grabbing }
 Focus mode controls how a surface gains and loses focus. More...
 

Macro Definition Documentation

◆ __has_extension

#define __has_extension   __has_feature

◆ __has_feature

#define __has_feature (   x)    0

◆ MIR_BYTES_PER_PIXEL

#define MIR_BYTES_PER_PIXEL (   f)
Value:
((f) == mir_pixel_format_bgr_888 ? 3 : \
(f) == mir_pixel_format_rgb_888 ? 3 : \
(f) == mir_pixel_format_rgb_565 ? 2 : \
4)
@ mir_pixel_format_rgb_888
Definition: common.h:170
@ mir_pixel_format_rgb_565
Definition: common.h:171
@ mir_pixel_format_rgba_5551
Definition: common.h:172
@ mir_pixel_format_bgr_888
Definition: common.h:169
@ mir_pixel_format_rgba_4444
Definition: common.h:173

Typedef Documentation

◆ MirDepthLayer

Depth layer controls Z ordering of surfaces.

A surface will always appear on top of surfaces with a lower depth layer, and below those with a higher one. A depth layer can be converted to a number with mir::mir_depth_layer_get_index(). This is useful for creating a list indexed by depth layer, or comparing the height of two layers.

◆ MirEdgeAttachment

◆ MirFocusMode

typedef enum MirFocusMode MirFocusMode

Focus mode controls how a surface gains and loses focus.

◆ MirFormFactor

Form factor associated with a physical output.

◆ MirLifecycleState

◆ MirMirrorMode

Mirroring axis relative to the "natural" orientation of the display.

◆ MirOrientation

Direction relative to the "natural" orientation of the display.

◆ MirOrientationMode

◆ MirOutputGammaSupported

Supports gamma correction.

◆ MirOutputType

◆ MirPixelFormat

32-bit pixel formats (8888): The order of components in the enum matches the order of the components as they would be written in an integer representing a pixel value of that format.

For example; abgr_8888 should be coded as 0xAABBGGRR, which will end up as R,G,B,A in memory on a little endian system, and as A,B,G,R on a big endian system.

24-bit pixel formats (888): These are in literal byte order, regardless of CPU architecture it's always the same. Writing these 3-byte pixels is typically slower than other formats but uses less memory than 32-bit and is endian-independent.

16-bit pixel formats (565/5551/4444): Always interpreted as one 16-bit integer per pixel with components in high-to-low bit order following the format name. These are the fastest formats, however colour quality is visibly lower.

◆ MirPlacementGravity

Reference point for aligning a surface relative to a rectangle.

Each element (surface and rectangle) has a MirPlacementGravity assigned.

◆ MirPlacementHints

Positioning hints for aligning a window relative to a rectangle.

These hints determine how the window should be positioned in the case that the surface would fall off-screen if placed in its ideal position.

For example, mir_placement_hints_flip_x will invert the x component of aux_rect_placement_offset and replace mir_placement_gravity_northwest with mir_placement_gravity_northeast and vice versa if the window extends beyond the left or right edges of the monitor.

If mir_placement_hints_slide_x is set, the window can be shifted horizontally to fit on-screen.

If mir_placement_hints_resize_x is set, the window can be shrunken horizontally to fit.

If mir_placement_hints_antipodes is set then the rect gravity may be substituted with the opposite corner (e.g. mir_placement_gravity_northeast to mir_placement_gravity_southwest) in combination with other options.

When multiple flags are set, flipping should take precedence over sliding, which should take precedence over resizing.

◆ MirPointerConfinementState

Pointer Confinement.

◆ MirPowerMode

typedef enum MirPowerMode MirPowerMode

◆ MirPromptSessionState

◆ MirResizeEdge

Hints for resizing a window.

These values are used to indicate which edge(s) of a surface is being dragged in a resize operation.

◆ MirShellChrome

Shell chrome.

◆ MirSubpixelArrangement

Physical arrangement of subpixels on the physical output.

This is always relative to the “natural” orientation of the display - mir_orientation_normal.

◆ MirWindowAttrib

Attributes of a window that the client and server/shell may wish to get or set over the wire.

◆ MirWindowFocusState

◆ MirWindowState

◆ MirWindowType

◆ MirWindowVisibility

Enumeration Type Documentation

◆ MirDepthLayer

Depth layer controls Z ordering of surfaces.

A surface will always appear on top of surfaces with a lower depth layer, and below those with a higher one. A depth layer can be converted to a number with mir::mir_depth_layer_get_index(). This is useful for creating a list indexed by depth layer, or comparing the height of two layers.

Enumerator
mir_depth_layer_background 

For desktop backgrounds and alike (lowest layer)

mir_depth_layer_below 

For panels or other controls/decorations below normal windows.

mir_depth_layer_application 

For normal application windows.

mir_depth_layer_always_on_top 

For always-on-top application windows.

mir_depth_layer_above 

For panels or notifications that want to be above normal windows.

mir_depth_layer_overlay 

For overlays such as lock screens (heighest layer)

◆ MirEdgeAttachment

Enumerator
mir_edge_attachment_vertical 
mir_edge_attachment_horizontal 
mir_edge_attachment_any 

◆ MirFocusMode

Focus mode controls how a surface gains and loses focus.

Enumerator
mir_focus_mode_focusable 

The surface can gain and lose focus normally.

mir_focus_mode_disabled 

The surface will never be given focus.

mir_focus_mode_grabbing 

This mode causes the surface to take focus if possible, and prevents focus from leaving it as long as it has this mode.

◆ MirFormFactor

Form factor associated with a physical output.

Enumerator
mir_form_factor_unknown 
mir_form_factor_phone 
mir_form_factor_tablet 
mir_form_factor_monitor 
mir_form_factor_tv 
mir_form_factor_projector 

◆ MirLifecycleState

Enumerator
mir_lifecycle_state_will_suspend 
mir_lifecycle_state_resumed 
mir_lifecycle_connection_lost 

◆ MirMirrorMode

Mirroring axis relative to the "natural" orientation of the display.

Enumerator
mir_mirror_mode_none 
mir_mirror_mode_vertical 
mir_mirror_mode_horizontal 

◆ MirOrientation

Direction relative to the "natural" orientation of the display.

Enumerator
mir_orientation_normal 
mir_orientation_left 
mir_orientation_inverted 
mir_orientation_right 

◆ MirOrientationMode

Enumerator
mir_orientation_mode_portrait 
mir_orientation_mode_landscape 
mir_orientation_mode_portrait_inverted 
mir_orientation_mode_landscape_inverted 
mir_orientation_mode_portrait_any 
mir_orientation_mode_landscape_any 
mir_orientation_mode_any 

◆ MirOutputGammaSupported

Supports gamma correction.

Enumerator
mir_output_gamma_unsupported 
mir_output_gamma_supported 

◆ MirOutputType

Enumerator
mir_output_type_unknown 
mir_output_type_vga 
mir_output_type_dvii 
mir_output_type_dvid 
mir_output_type_dvia 
mir_output_type_composite 
mir_output_type_svideo 
mir_output_type_lvds 
mir_output_type_component 
mir_output_type_ninepindin 
mir_output_type_displayport 
mir_output_type_hdmia 
mir_output_type_hdmib 
mir_output_type_tv 
mir_output_type_edp 
mir_output_type_virtual 
mir_output_type_dsi 
mir_output_type_dpi 

◆ MirPixelFormat

32-bit pixel formats (8888): The order of components in the enum matches the order of the components as they would be written in an integer representing a pixel value of that format.

For example; abgr_8888 should be coded as 0xAABBGGRR, which will end up as R,G,B,A in memory on a little endian system, and as A,B,G,R on a big endian system.

24-bit pixel formats (888): These are in literal byte order, regardless of CPU architecture it's always the same. Writing these 3-byte pixels is typically slower than other formats but uses less memory than 32-bit and is endian-independent.

16-bit pixel formats (565/5551/4444): Always interpreted as one 16-bit integer per pixel with components in high-to-low bit order following the format name. These are the fastest formats, however colour quality is visibly lower.

Enumerator
mir_pixel_format_invalid 
mir_pixel_format_abgr_8888 
mir_pixel_format_xbgr_8888 
mir_pixel_format_argb_8888 
mir_pixel_format_xrgb_8888 
mir_pixel_format_bgr_888 
mir_pixel_format_rgb_888 
mir_pixel_format_rgb_565 
mir_pixel_format_rgba_5551 
mir_pixel_format_rgba_4444 
mir_pixel_formats 

◆ MirPlacementGravity

Reference point for aligning a surface relative to a rectangle.

Each element (surface and rectangle) has a MirPlacementGravity assigned.

Enumerator
mir_placement_gravity_center 

the reference point is at the center.

mir_placement_gravity_west 

the reference point is at the middle of the left edge.

mir_placement_gravity_east 

the reference point is at the middle of the right edge.

mir_placement_gravity_north 

the reference point is in the middle of the top edge.

mir_placement_gravity_south 

the reference point is at the middle of the lower edge.

mir_placement_gravity_northwest 

the reference point is at the top left corner.

mir_placement_gravity_northeast 

the reference point is at the top right corner.

mir_placement_gravity_southwest 

the reference point is at the lower left corner.

mir_placement_gravity_southeast 

the reference point is at the lower right corner.

◆ MirPlacementHints

Positioning hints for aligning a window relative to a rectangle.

These hints determine how the window should be positioned in the case that the surface would fall off-screen if placed in its ideal position.

For example, mir_placement_hints_flip_x will invert the x component of aux_rect_placement_offset and replace mir_placement_gravity_northwest with mir_placement_gravity_northeast and vice versa if the window extends beyond the left or right edges of the monitor.

If mir_placement_hints_slide_x is set, the window can be shifted horizontally to fit on-screen.

If mir_placement_hints_resize_x is set, the window can be shrunken horizontally to fit.

If mir_placement_hints_antipodes is set then the rect gravity may be substituted with the opposite corner (e.g. mir_placement_gravity_northeast to mir_placement_gravity_southwest) in combination with other options.

When multiple flags are set, flipping should take precedence over sliding, which should take precedence over resizing.

Enumerator
mir_placement_hints_flip_x 

allow flipping anchors horizontally

mir_placement_hints_flip_y 

allow flipping anchors vertically

mir_placement_hints_slide_x 

allow sliding window horizontally

mir_placement_hints_slide_y 

allow sliding window vertically

mir_placement_hints_resize_x 

allow resizing window horizontally

mir_placement_hints_resize_y 

allow resizing window vertically

mir_placement_hints_antipodes 

allow flipping aux_anchor to opposite corner

mir_placement_hints_flip_any 

allow flipping anchors on both axes

mir_placement_hints_slide_any 

allow sliding window on both axes

mir_placement_hints_resize_any 

allow resizing window on both axes

◆ MirPointerConfinementState

Pointer Confinement.

Enumerator
mir_pointer_unconfined 
mir_pointer_confined_oneshot 
mir_pointer_confined_persistent 
mir_pointer_locked_oneshot 
mir_pointer_locked_persistent 

◆ MirPowerMode

Enumerator
mir_power_mode_on 
mir_power_mode_standby 
mir_power_mode_suspend 
mir_power_mode_off 

◆ MirPromptSessionState

Enumerator
mir_prompt_session_state_stopped 
mir_prompt_session_state_started 
mir_prompt_session_state_suspended 

◆ MirResizeEdge

Hints for resizing a window.

These values are used to indicate which edge(s) of a surface is being dragged in a resize operation.

Enumerator
mir_resize_edge_none 
mir_resize_edge_west 
mir_resize_edge_east 
mir_resize_edge_north 
mir_resize_edge_south 
mir_resize_edge_northwest 
mir_resize_edge_northeast 
mir_resize_edge_southwest 
mir_resize_edge_southeast 

◆ MirShellChrome

Shell chrome.

Enumerator
mir_shell_chrome_normal 
mir_shell_chrome_low 

◆ MirSubpixelArrangement

Physical arrangement of subpixels on the physical output.

This is always relative to the “natural” orientation of the display - mir_orientation_normal.

Enumerator
mir_subpixel_arrangement_unknown 

Arrangement of subpixels cannot be determined.

mir_subpixel_arrangement_horizontal_rgb 

Subpixels are arranged horizontally, R, G, B from left to right.

mir_subpixel_arrangement_horizontal_bgr 

Subpixels are arranged horizontally, B, G, R from left to right.

mir_subpixel_arrangement_vertical_rgb 

Subpixels are arranged vertically, R, G, B from top to bottom.

mir_subpixel_arrangement_vertical_bgr 

Subpixels are arranged vertically, B, G, R from top to bottom.

mir_subpixel_arrangement_none 

Device does not have regular subpixels.

◆ MirWindowAttrib

Attributes of a window that the client and server/shell may wish to get or set over the wire.

Enumerator
mir_window_attrib_type 
mir_window_attrib_state 
mir_window_attrib_swapinterval 
Deprecated:
Do not listen for events reporting this attribute. Use the "mir_*_get_swapinterval()" functions instead if you wish query its value
mir_window_attrib_focus 
mir_window_attrib_dpi 
mir_window_attrib_visibility 
mir_window_attrib_preferred_orientation 
mir_window_attribs 

◆ MirWindowFocusState

Enumerator
mir_window_focus_state_unfocused 

Inactive and does not have focus

mir_window_focus_state_focused 

Active and has keybaord focus

mir_window_focus_state_active 

Active but does not have keyboard focus

◆ MirWindowState

Enumerator
mir_window_state_unknown 
mir_window_state_restored 
mir_window_state_minimized 
mir_window_state_maximized 
mir_window_state_vertmaximized 
mir_window_state_fullscreen 
mir_window_state_horizmaximized 
mir_window_state_hidden 
mir_window_state_attached 

Used for panels, notifications and other windows attached to output edges.

mir_window_states 

◆ MirWindowType

Enumerator
mir_window_type_normal 

AKA "regular"

mir_window_type_utility 

AKA "floating"

mir_window_type_dialog 
mir_window_type_gloss 
mir_window_type_freestyle 
mir_window_type_menu 
mir_window_type_inputmethod 

AKA "OSK" or handwriting etc.


mir_window_type_satellite 

AKA "toolbox"/"toolbar"

mir_window_type_tip 

AKA "tooltip"

mir_window_type_decoration 
mir_window_types 

◆ MirWindowVisibility

Enumerator
mir_window_visibility_occluded 
mir_window_visibility_exposed 

Copyright © 2012-2023 Canonical Ltd.
Generated on Tue 2 May 10:01:24 UTC 2023
This documentation is licensed under the GPL version 2 or 3.