Phoc – 0
Description: Reference for Phoc-0

### Namespace

# Phoc – 0

Phone Compositor

Version | 0.56.0
Authors | The Phosh Developers
License | GPL-3.0-or-later
Website | https://world.pages.gitlab.gnome.org/Phosh/phoc
Source | https://gitlab.gnome.org/World/Phosh/phoc/

#### Build

pkg-config files | `phoc-0`

#### Dependencies

#### Related libraries

wlroots | Modular Wayland compositor library
| Browse documentation
GLib | General-purpose, portable utility library
| Browse documentation
GObject | The base type system library
| Browse documentation
GIO | GObject Interfaces and Objects, Networking, IPC, and I/O
| Browse documentation

#### Additional documentation

- Getting started with Phoc development
- Classes Hierarchy

#### Classes

CairoTexture |
ColorRect | A colored rectangle to be drawn by the compositor.
Cursor |
DebugControl | DBus Debug control interface.
Desktop | Desktop singleton.
DeviceState | Device state protocol:.
FocusFrame | The colored frame drawn around a focused `PhocView`.
Gesture | `PhocGesture` helps to detect and track ongoing gestures.
GestureDrag | A drag gesture.
GestureSingle | A single touch (or mouse) gesture.
GestureSwipe | `PhocGestureSwipe` is a `PhocGesture` for swipe gestures.
GestureZoom | A zoom gesture.
Input | PhocInput handles new input devices and seats.
InputDevice | Abstract base class for input device like pointers or touch.
Keybindings | Keybindings stored in gsettings.
Keyboard | A keyboard input device.
KeyboardShortcutsInhibit |
LayerShellEffects | Additional effects for layer surfaces.
LayerSurface | A Layer surface backed by the wlr-layer-surface wayland protocol.
LayoutTransaction | Track configures from layer surfaces and emit a signal when all of them have committed new matching buffers.
Output | The output region of a compositor (typically a monitor).
OutputCutouts | Tracks display cutout information. This can be used for providing cutout information to clients and to render an overlay texture showing the devices cutouts.
OutputShield | A shield that covers a whole `PhocOutput`. It can be raised (to cover the whole screen) and lowered to show the screens content.
OutputsStates | An “outputs state” is the current state of all outputs. The `PhocOutputsStates` class tracks these and persists them. Consumers can pass in an `identifier` to lookup up a specific outputs state. The identifier is handled by the caller and should be unique for one set of outputs.
PhoshPrivate | Private protocol to interface with phosh.
Pointer | A pointer input device.
PropertyEaser | Eases properties of a given object.
Renderer | The renderer.
Seat | Represents a seat.
Server | The server singleton.
Spinner | An animated spinner, used to represent indeterminate progress. It is rendered as a `PhocBling`.
StyleManager | The style manager is responsible for providing style information.
Subsurface | A subsurface attached to a `PhocView` or `PhocViewChild`.
Surface | A Wayland wl_surface backed by a wlr_surface.
Switch | A switch device. E.g. a tablet mode switch or laptop lid switch.
Tablet | A tablet input device.
TabletPad |
TimedAnimation | An animation that ends after the given period of time.
Touch | A touch input device.
View | A `PhocView` represents a toplevel like an xdg-toplevel or a xwayland window.
ViewChild | A child of a `PhocView`, e.g. a `PhocXdgPopup` or subsurface.
ViewDeco | The decoration for views using server side decorations.
Workspace | A workspace groups a set of `PhocView`s on an output layout.
WorkspaceIndicator | The workspace indicator.
WorkspaceManager | Manages the workspaces layout. Adds and removes new workspaces.
XdgPopup | A popup as defined in the xdg-shell protocol.
XdgToplevel | An xdg toplevel surface as defined in the xdg-shell protocol. For popups see `PhocXdgPopup`.
XWaylandSurface | An XWayland Surface.
XWaylandUnmanaged | An unmanaged (override_redirect) XWayland surface.
XxCutoutsManager | The cutout manager informs toplevels about display cutouts in their display area.

#### Interfaces

Animatable | Something that can be animated.
Bling | A `PhocBling` is additional render bling such as rectangles or other elements to be drawn by the compositor.
ChildRoot | Implementations of the `PhocChildRoot` interface. Implemented by `PhocView` and `PhocLayerSurface` so both surfaces roles can use the same handling for subsurfaces and popups.

#### Structs

_XxCutoutsEvents |
AlphaLayerSurface | A layer surface with translusency.
Box | `PhocBox` is used to represent a rectangular region. It just wraps `wlr_box` so we can use it in the type system.
Color | `PhocColor` is used to represent a (possibly translucent) color.
Config |
CutoutCorner |
DebugDamageRegion |
DraggableLayerSurface | A draggable layer surface.
DragIcon | The icon used during drag and drop operations.
Event | Input events.
EventSequence | `PhocEventSequence` is an opaque type representing a sequence of related touch events.
GtkShell | A minimal implementation of gtk_shell1 protocol.
GtkSurface | A surface in the gtk_shell1 protocol.
IdleInhibit | Forward idle inhibit to gnome-session.
InputMethodRelay | The relay structure manages the relationship between text-input and input_method interfaces on a given seat.
KeybindingsContext | Additional context to use when parsing keybindings.
KeyCombo | A combination of modifiers and a key describing a keyboard shortcut.
Mode |
OutputConfig | An output configuration. This is used when parsing the config file as well as the outputs states db.
OutputModeConfig |
PointerConstraint |
RenderContext |
SeatView | Structure used by `PhocSeat` and `PhocCursor` to track its views.
StackedLayerSurface | Layer surface stacking.
TabletTool |
TouchPoint | A touch point tracked compositor side.
XdgToplevelDecoration |
XxCutouts |

#### Enumerations

AnimationState |
AnimDir |
CornerPosition |
CursorMode | The mode of the cursor.
DraggableSurfaceState | Drag states of a draggable surface (e.g. a `PhocDraggableLayerSurface`. TODO: Reuse when xdg surface become draggable too.
Easing |
EventFlags | Flags for the `PhocEvent`.
EventSequenceState | Describes the state of a `PhocEventSequence` in a `PhocGesture`.
EventType | Types of events.
OutputAdaptiveSync |
OutputScaleFilter |
PhoshPrivateShellState |
StackedSurfacePos |
SwitchState | State of a switch (e.g. a tablet mode or lid switch).
TouchpadGesturePhase | The phase of a touchpad gesture event. All gestures are guaranteed to begin with an event of type `PHOC_TOUCHPAD_GESTURE_PHASE_BEGIN`, followed by a number of `PHOC_TOUCHPAD_GESTURE_PHASE_UPDATE` (possibly 0).
ViewCorner |
ViewState |
WorkspaceMode |

#### Bitfields

ServerDebugFlags |
ServerFlags |
ViewDecoPart |
ViewTileDirection |
XWaylandSurfaceState |

#### Callbacks

DesktopUnmanagedIter |
DesktopViewIter | The iterator function that is invoked by `phoc_desktop_for_each_view`. The iterator can return `FALSE` if iterating further views should be stopped.
FrameCallback | Callback type for adding a function to update animations. See phoc_animatable_add_frame_callback().
SurfaceIterator | The iterator function that is invoked by the different iterators like `phoc_output_xdg_surface_for_each_surface()` or `phoc_output_layer_surface_for_each_surface()` if the iterated surface overlaps with the output.
WorkspaceViewIter | The iterator function that is invoked by the `phoc_desktop_for_each_view`. The iterator can return `FALSE` if iterating further views should be stopped.

#### Functions

handle_keyboard_shortcuts_inhibit_new_inhibitor |
handle_layer_shell_surface |
handle_output_manager_apply |
handle_output_manager_test |
handle_virtual_keyboard |
handle_virtual_pointer |
handle_xdg_new_dialog |
handle_xdg_shell_toplevel |
handle_xdg_toplevel_decoration |
layer_shell_arrange | Arrange the layer surfaces on the given output.
layer_shell_find_osk | Checks whether the given `PhocOutput` has the on screen keyboard and returns the associated `PhocLayerSurface` if found.
layer_shell_update_focus |
layer_shell_update_osk | When a layer surface gets focus and there’s an OSK we need to make sure the OSK is above that layer as otherwise keyboard input isn’t possible. This can be used to adjust the OSKs layer accordingly.
lerp | Computes the linear interpolation between `a` and `b` for `t`. unstable since: 1.0
maybe_set_cursor |
utils_compute_scale | Compute a suitable output scale based on the physical size and resolution.
utils_fix_transform |
utils_is_damaged |
utils_scale_box | Scales the passed in box by scale.
utils_transform_to_str |
utils_wlr_surface_enter_output |
utils_wlr_surface_leave_output |
utils_wlr_surface_update_scales |
xdg_activation_v1_handle_request_activate |

#### Function Macros

DTRACE_PROBE |
DTRACE_PROBE1 |
DTRACE_PROBE2 |
DTRACE_PROBE3 |
DTRACE_PROBE4 |
DTRACE_PROBE5 |
DTRACE_PROBE6 |
HEX_COLOR | Convenience macros to create a color from components in the [0x0..0xff] range rather than [0.0, 1.0].
PRIV_CONTAINER | Returns a pointer to the instance containing the instance private data `p`.
PRIV_CONTAINER_P | Returns an untyped pointer to the instance containing the instance private data `p`.
trace_mark |
XWAYLAND_SURFACE |

#### Constants

CONFIG_DEFAULT_SEAT_NAME |
EDGE_SNAP_THRESHOLD |
KEYBOARD_PRESSED_KEYSYMS_CAP |
SHELL_REVEAL_POINTER_THRESHOLD |
SHELL_REVEAL_TOUCH_THRESHOLD |
TRACE_CURRENT_TIME |
VIEW_WIN_MARGIN |
XCURSOR_DEFAULT |
XCURSOR_MOVE |
XCURSOR_ROTATE |
XCURSOR_SIZE |