PhoshLayerSurface

PhoshLayerSurface — A GtkWindow rendered as a LayerSurface by the compositor

Functions

Properties

guint anchor Read / Write
guint configured-height Read
guint configured-width Read
int exclusive-zone Read / Write
guint height Read / Write
gboolean kbd-interactivity Read / Write
guint layer Read / Write
gpointer layer-shell Read / Write
int margin-bottom Read / Write
int margin-left Read / Write
int margin-right Read / Write
int margin-top Read / Write
char * namespace Read / Write
guint width Read / Write
gpointer wl-output Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBin
                    ╰── GtkWindow
                        ╰── PhoshLayerSurface
                            ├── PhoshSystemModal
                            ├── PhoshBackground
                            ├── PhoshDragSurface
                            ├── PhoshFader
                            ├── PhoshLockscreen
                            ├── PhoshLockshield
                            ├── PhoshNotificationBanner
                            ╰── PhoshSplash

Implemented Interfaces

PhoshLayerSurface implements AtkImplementorIface and GtkBuildable.

Description

PhoshLayerSurface allows to use a Wayland surface backed by the layer-shell protocol as GtkWindow. This allows to render e.g. panels and backgrounds using GTK.

Functions

phosh_layer_surface_new ()

GtkWidget *
phosh_layer_surface_new (gpointer layer_shell,
                         gpointer wl_output);

phosh_layer_surface_get_layer_surface ()

struct     zwlr_layer_surface_v1 *
phosh_layer_surface_get_layer_surface (PhoshLayerSurface *self);

phosh_layer_surface_get_wl_surface ()

struct     wl_surface *
phosh_layer_surface_get_wl_surface (PhoshLayerSurface *self);

Get the layer wayland surface or NULL if the window is not yet realized.

Parameters

self

The PhoshLayerSurface

 

phosh_layer_surface_set_size ()

void
phosh_layer_surface_set_size (PhoshLayerSurface *self,
                              int width,
                              int height);

Set the size of a layer surface. A value of '-1' indicates 'use old value'

Parameters

self

The PhoshLayerSurface

 

width

the height in pixels

 

height

the width in pixels

 

phosh_layer_surface_set_margins ()

void
phosh_layer_surface_set_margins (PhoshLayerSurface *self,
                                 int top,
                                 int right,
                                 int bottom,
                                 int left);

Set anchor margins of a layer surface.

Parameters

self

The PhoshLayerSurface

 

top

the top margin in pixels

 

right

the right margin in pixels

 

bottom

the bottom margin in pixels

 

left

the left margin in pixels

 

phosh_layer_surface_set_exclusive_zone ()

void
phosh_layer_surface_set_exclusive_zone
                               (PhoshLayerSurface *self,
                                int zone);

Set exclusive zone of a layer surface.

Parameters

self

The PhoshLayerSurface

 

zone

Size of the exclusive zone.

 

phosh_layer_surface_set_kbd_interactivity ()

void
phosh_layer_surface_set_kbd_interactivity
                               (PhoshLayerSurface *self,
                                gboolean interactivity);

phosh_layer_surface_set_layer ()

void
phosh_layer_surface_set_layer (PhoshLayerSurface *self,
                               guint32 layer);

Sets the layer a layer-surface belongs to layer.

Parameters

self

The PhoshLayerSurface

 

layer

The layer.

 

phosh_layer_surface_wl_surface_commit ()

void
phosh_layer_surface_wl_surface_commit (PhoshLayerSurface *self);

Forces a commit of layer surface's state.

Parameters

self

The PhoshLayerSurface

 

phosh_layer_surface_get_margins ()

void
phosh_layer_surface_get_margins (PhoshLayerSurface *self,
                                 int *top,
                                 int *right,
                                 int *bottom,
                                 int *left);

phosh_layer_surface_get_configured_width ()

int
phosh_layer_surface_get_configured_width
                               (PhoshLayerSurface *self);

phosh_layer_surface_get_configured_height ()

int
phosh_layer_surface_get_configured_height
                               (PhoshLayerSurface *self);

Types and Values

PHOSH_TYPE_LAYER_SURFACE

#define PHOSH_TYPE_LAYER_SURFACE                 (phosh_layer_surface_get_type ())

struct PhoshLayerSurfaceClass

struct PhoshLayerSurfaceClass {
  GtkWindowClass parent_class;

  /* Signals
   */
  void (*configured)   (PhoshLayerSurface    *self);
};

Members

configured ()

invoked when layer surface is configured

 

PhoshLayerSurface

typedef struct _PhoshLayerSurface PhoshLayerSurface;

Property Details

The “anchor” property

  “anchor”                   guint

The edges to anchor the surface to.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: 0


The “configured-height” property

  “configured-height”        guint

The height of the layer surface set by the compositor.

Owner: PhoshLayerSurface

Flags: Read

Default value: 0


The “configured-width” property

  “configured-width”         guint

The width of the layer surface set by the compositor.

Owner: PhoshLayerSurface

Flags: Read

Default value: 0


The “exclusive-zone” property

  “exclusive-zone”           int

Set area that is not occluded with other surfaces.

Owner: PhoshLayerSurface

Flags: Read / Write

Allowed values: >= -1

Default value: 0


The “height” property

  “height”                   guint

The height of the layer surface.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: 0


The “kbd-interactivity” property

  “kbd-interactivity”        gboolean

Whether the surface interacts with the keyboard.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: FALSE


The “layer” property

  “layer”                    guint

The layer the surface should be attached to.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: 0


The “layer-shell” property

  “layer-shell”              gpointer

The layer shell wayland global.

Owner: PhoshLayerSurface

Flags: Read / Write


The “margin-bottom” property

  “margin-bottom”            int

Distance away from the bottom anchor point.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: 0


The “margin-left” property

  “margin-left”              int

Distance away from the left anchor point.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: 0


The “margin-right” property

  “margin-right”             int

Distance away from the right anchor point.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: 0


The “margin-top” property

  “margin-top”               int

Distance away from the top anchor point.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: 0


The “namespace” property

  “namespace”                char *

Namespace of the layer surface.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: ""


The “width” property

  “width”                    guint

The width of the layer surface.

Owner: PhoshLayerSurface

Flags: Read / Write

Default value: 0


The “wl-output” property

  “wl-output”                gpointer

The wl_output associated with this surface.

Owner: PhoshLayerSurface

Flags: Read / Write

Signal Details

The “configured” signal

void
user_function (PhoshLayerSurface *self,
               gpointer           user_data)

This signal is emitted once we received the configure event from the compositor.

Parameters

self

The PhoshLayerSurface instance.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last