Phoc.View
Description: Reference for Phoc.View

### Class

# PhocView

#### Description [src]

    class Phoc.View : GObject.Object
      implements Phoc.ChildRoot {
      wlr_box box,
      wlr_box saved,
      bool pending_centering,
      PhocView* parent,
      wl_list stack,
      wl_list parent_link,
      wlr_surface* wlr_surface
    }

A `PhocView` represents a toplevel like an xdg-toplevel or a xwayland window.

#### Hierarchy

#### Ancestors

- GObject

#### Descendants

- PhocXWaylandSurface
- PhocXdgToplevel

#### Implements

- PhocChildRoot

#### Functions

###### phoc_view_from_wlr_surface

Given a `wlr_surface` return the corresponding `PhocView`.

#### Instance methods

###### phoc_view_activate

Performs the necessary steps to make the view itself appear activated and send out the corresponding view related protocol events. Note that this is not enough to actually focus the view for the user See `phoc_seat_set_focus_view()`.

###### phoc_view_add_bling

By adding a `PhocBling` to a view you ensure that it gets rendered just before the view if both the view and the bling are mapped.

###### phoc_view_appear_activated

No description available.

###### phoc_view_arrange

Arrange a view based on it’s current state (floating, tiled or maximized). If the view is neither tiled nor maximized and `center` is `FALSE` this operation is a noop.

###### phoc_view_auto_maximize

Maximize `view` if in auto-maximize mode otherwise do nothing.

###### phoc_view_close

No description available.

###### phoc_view_damage_whole

Add the damage of all surfaces belonging to a `PhocView` to the damaged screen area that needs repaint. This damages the whole `view` (possibly including server side window decorations) ignoring any buffer damage.

###### phoc_view_flush_activation_token

Notifies that the compositor handled processing the activation token and clears it.

###### phoc_view_for_each_surface

No description available.

###### phoc_view_get_activation_token

Get the current activation token.

###### phoc_view_get_alpha

Get the surface’s transparency.

###### phoc_view_get_app_id

Get the view’s app_id (if any).

###### phoc_view_get_blings

Gets the view’s current list of blings.

###### phoc_view_get_box

Get the view’s box in layout coordinates (taking any scale-to-fit scale into account).

###### phoc_view_get_deco_part

No description available.

###### phoc_view_get_fullscreen_output

Gets the output a view is fullscreen on. Returns `NULL` if the view isn’t currently fullscreen.

###### phoc_view_get_geometry

No description available.

###### phoc_view_get_maximized_box

Gets the “visible bounds” that a view will use on a given output when maximized.

###### phoc_view_get_output

If a view spans multiple output it returns the output that the center of the view is on.

###### phoc_view_get_pending_box

Get the view’s box in layout coordinates taking any pending move and resize operations into account. Note that this rounds x,y to their lower values. If there’s currently no update pending we return the current box for convenience.

###### phoc_view_get_pid

No description available.

###### phoc_view_get_scale

Get the surface’s scale.

###### phoc_view_get_scale_to_fit

Returns the `scale-to-fit` if active for this view.

###### phoc_view_get_tile_direction

No description available.

###### phoc_view_get_tiled_box

Gets the “visible bounds” a view will use on a given output when tiled.

###### phoc_view_get_wlr_surface_at

No description available.

###### phoc_view_is_always_on_top

Whether a view is always rendered on top of all other views.

###### phoc_view_is_decorated

Gets whether the view should be decorated server side.

###### phoc_view_is_floating

No description available.

###### phoc_view_is_fullscreen

No description available.

###### phoc_view_is_mapped

Check if a `view` is currently mapped.

###### phoc_view_is_maximized

No description available.

###### phoc_view_is_tiled

No description available.

###### phoc_view_maximize

No description available.

###### phoc_view_move

No description available.

###### phoc_view_move_resize

No description available.

###### phoc_view_move_to_corner

No description available.

###### phoc_view_move_to_next_output

No description available.

###### phoc_view_remove_bling

Removes the given bling from the view.

###### phoc_view_restore

Put a view back into floating state while restoring it’s previous size and position.

###### phoc_view_set_activation_token

Sets the activation token that will be used when activate the view once mapped. It will be cleared once the view got activated.

###### phoc_view_set_always_on_top

Specifies whether the view should be rendered on top of other views.

###### phoc_view_set_app_id

No description available.

###### phoc_view_set_decorated

Sets whether the compositor should draw server side decorations for this window.

###### phoc_view_set_fullscreen

If `fullscreen` is `true`. fullscreens a view on the given output or (if `output` is `NULL`) on the view’s current output. Unfullscreens the `view` if `fullscreens` is `false`.

###### phoc_view_set_scale_to_fit

Turn auto scaling if oversized for this surface on (`TRUE`) or off (`FALSE`).

###### phoc_view_set_visibility

No description available.

###### phoc_view_tile

No description available.

###### phoc_view_update_decorated

No description available.

###### phoc_view_want_auto_maximize

Check if a view needs to be auto-maximized. In phoc’s auto-maximize mode only toplevels should be maximized.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

##### Methods inherited from PhocChildRoot (6)

###### phoc_child_root_add_child

No description available.

###### phoc_child_root_apply_damage

No description available.

###### phoc_child_root_get_box

No description available.

###### phoc_child_root_is_mapped

No description available.

###### phoc_child_root_remove_child

No description available.

###### phoc_child_root_unconstrain_popup

No description available.

#### Properties

###### Phoc.View:activation-token

If not `NULL` this token will be used to activate the view once mapped.

###### Phoc.View:alpha

The view’s transparency.

###### Phoc.View:decorated

Whether the view should have server side window decorations drawn.

###### Phoc.View:is-mapped

Whether the view is currently mapped.

###### Phoc.View:scale-to-fit

If `TRUE` if surface will be scaled down to fit the screen.

###### Phoc.View:state

The window is maximized, tiled or floating.

#### Signals

###### Phoc.View::surface-destroy

Derived classes emit this signal just before dropping their ref so reference holders can react.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct PhocViewClass {
      GObjectClass parent_class;
      void (* move) (
        PhocView* self,
        double x,
        double y
      );
      void (* resize) (
        PhocView* self,
        uint32_t width,
        uint32_t height
      );
      void (* move_resize) (
        PhocView* self,
        double x,
        double y,
        uint32_t width,
        uint32_t height
      );
      bool (* want_scaling) (
        PhocView* self
      );
      bool (* want_auto_maximize) (
        PhocView* self
      );
      void (* set_active) (
        PhocView* self,
        bool active
      );
      void (* set_fullscreen) (
        PhocView* self,
        bool fullscreen
      );
      void (* set_maximized) (
        PhocView* self,
        bool maximized
      );
      void (* set_tiled) (
        PhocView* self,
        bool tiled
      );
      void (* set_suspended) (
        PhocView* self,
        bool suspended
      );
      void (* close) (
        PhocView* self
      );
      void (* for_each_surface) (
        PhocView* self,
        wlr_surface_iterator_func_t iterator,
        void* user_data
      );
      void (* get_geometry) (
        PhocView* self,
        wlr_box* box
      );
      wlr_surface* (* get_wlr_surface_at) (
        PhocView* self,
        double sx,
        double sy,
        double* sub_x,
        double* sub_y
      );
      pid_t (* get_pid) (
        PhocView* self
      );
      float (* get_alpha) (
        PhocView* self
      );

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  The object class structure needs to be the first element in the widget class structure in order for the class mechanism to work correctly. This allows a PhocViewClass pointer to be cast to a GObjectClass pointer.

`move: void (* move) ( PhocView* self, double x, double y )`

  This is called by `PhocView` to move a view to a new position. The implementation is optional.

`resize: void (* resize) ( PhocView* self, uint32_t width, uint32_t height )`

  This is called by `PhocView` to move resize a view.

`move_resize: void (* move_resize) ( PhocView* self, double x, double y, uint32_t width, uint32_t height )`

  This is called by `PhocView` to move and resize a view a the same time.

`want_scaling: bool (* want_scaling) ( PhocView* self )`

  No description available.

`want_auto_maximize: bool (* want_auto_maximize) ( PhocView* self )`

  This is called by `PhocView` to determine if a view should be automatically maximized.

`set_active: void (* set_active) ( PhocView* self, bool active )`

  This is called by `PhocView` to make a view appear active.

`set_fullscreen: void (* set_fullscreen) ( PhocView* self, bool fullscreen )`

  This is called by `PhocView` to fullscreen a view.

`set_maximized: void (* set_maximized) ( PhocView* self, bool maximized )`

  This is called by `PhocView` to maximize a view.

`set_tiled: void (* set_tiled) ( PhocView* self, bool tiled )`

  This is called by `PhocView` to tile a view. The implementation is optional.

`set_suspended: void (* set_suspended) ( PhocView* self, bool suspended )`

  This is called by `PhocView` to indicate that the view is suspended The implementation is optional.

`close: void (* close) ( PhocView* self )`

  This is called by `PhocView` to close a view.

`for_each_surface: void (* for_each_surface) ( PhocView* self, wlr_surface_iterator_func_t iterator, void* user_data )`

  This is used by `PhocView` to iterate over a surface and it’s children. The implementation is optional.

`get_geometry: void (* get_geometry) ( PhocView* self, wlr_box* box )`

  This is called by `PhocView` to get a views geometry. The implementation is optional.

`get_wlr_surface_at: wlr_surface* (* get_wlr_surface_at) ( PhocView* self, double sx, double sy, double* sub_x, double* sub_y )`

  Get the wlr_surface at the give coordinates. The implementation is optional.

`get_pid: pid_t (* get_pid) ( PhocView* self )`

  No description available.

`get_alpha: float (* get_alpha) ( PhocView* self )`

  Get the view’s alpha value.

#### Virtual methods

###### Phoc.ViewClass.close

This is called by `PhocView` to close a view.

###### Phoc.ViewClass.for_each_surface

This is used by `PhocView` to iterate over a surface and it’s children. The implementation is optional.

###### Phoc.ViewClass.get_alpha

Get the surface’s transparency.

###### Phoc.ViewClass.get_geometry

This is called by `PhocView` to get a views geometry. The implementation is optional.

###### Phoc.ViewClass.get_pid

No description available.

###### Phoc.ViewClass.get_wlr_surface_at

Get the wlr_surface at the give coordinates. The implementation is optional.

###### Phoc.ViewClass.move

This is called by `PhocView` to move a view to a new position. The implementation is optional.

###### Phoc.ViewClass.move_resize

This is called by `PhocView` to move and resize a view a the same time.

###### Phoc.ViewClass.resize

This is called by `PhocView` to move resize a view.

###### Phoc.ViewClass.set_active

This is called by `PhocView` to make a view appear active.

###### Phoc.ViewClass.set_fullscreen

This is called by `PhocView` to fullscreen a view.

###### Phoc.ViewClass.set_maximized

This is called by `PhocView` to maximize a view.

###### Phoc.ViewClass.set_suspended

This is called by `PhocView` to indicate that the view is suspended The implementation is optional.

###### Phoc.ViewClass.set_tiled

This is called by `PhocView` to tile a view. The implementation is optional.

###### Phoc.ViewClass.want_auto_maximize

Check if a view needs to be auto-maximized. In phoc’s auto-maximize mode only toplevels should be maximized.

###### Phoc.ViewClass.want_scaling

No description available.