MatewnckPager

## MatewnckPager MatewnckPager — a pager widget, showing the content of workspaces. |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libmatewnck/libmatewnck.h>

    struct              MatewnckPager;
    GtkWidget *         matewnck_pager_new                  (MatewnckScreen *screen);
    void                matewnck_pager_set_screen           (MatewnckPager *pager,
                                                             MatewnckScreen *screen);
    gboolean            matewnck_pager_set_orientation      (MatewnckPager *pager,
                                                             GtkOrientation orientation);
    gboolean            matewnck_pager_set_n_rows           (MatewnckPager *pager,
                                                             int n_rows);
    enum                MatewnckPagerLayoutPolicy;
    void                matewnck_pager_set_layout_policy    (MatewnckPager *pager,
                                                             MatewnckPagerLayoutPolicy policy);
    enum                MatewnckPagerDisplayMode;
    void                matewnck_pager_set_display_mode     (MatewnckPager *pager,
                                                             MatewnckPagerDisplayMode mode);
    void                matewnck_pager_set_show_all         (MatewnckPager *pager,
                                                             gboolean show_all_workspaces);
    void                matewnck_pager_set_shadow_type      (MatewnckPager *pager,
                                                             GtkShadowType shadow_type);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----MatewnckPager

## Implemented Interfaces

MatewnckPager implements AtkImplementorIface and GtkBuildable.

## Description

A MatewnckPager shows a miniature view of the workspaces, representing managed windows by small rectangles, and allows the user to initiate various window manager actions by manipulating these representations. The MatewnckPager offers ways to move windows between workspaces and to change the current workspace.

Alternatively, a MatewnckPager can be configured to only show the names of the workspace instead of their contents.

The MatewnckPager is also responsible for setting the layout of the workspaces. Since only one application can be responsible for setting the layout on a screen, the MatewnckPager automatically tries to obtain the manager selection for the screen and only sets the layout if it owns the manager selection. See `matewnck_pager_set_orientation()` and `matewnck_pager_set_n_rows()` to change the layout.

## Details

### struct MatewnckPager

    struct MatewnckPager;

The MatewnckPager struct contains only private fields and should not be directly accessed.

### matewnck_pager_new ()

    GtkWidget *         matewnck_pager_new                  (MatewnckScreen *screen);

Creates a new MatewnckPager. The MatewnckPager will show the MatewnckWorkspace of the MatewnckScreen it is on.

`screen` : | deprecated argument, can be `NULL`.
Returns : | a newly created MatewnckPager.

### matewnck_pager_set_screen ()

    void                matewnck_pager_set_screen           (MatewnckPager *pager,
                                                             MatewnckScreen *screen);

### Warning

`matewnck_pager_set_screen` has been deprecated since version 2.20 and should not be used in newly-written code.

Does nothing.

`pager` : | a MatewnckPager.
`screen` : | a MatewnckScreen.

Since 2.2

### matewnck_pager_set_orientation ()

    gboolean            matewnck_pager_set_orientation      (MatewnckPager *pager,
                                                             GtkOrientation orientation);

Tries to change the orientation of the layout of MatewnckWorkspace on the MatewnckScreen `pager` is watching. Since no more than one application should set this property of a MatewnckScreen at a time, setting the layout is not guaranteed to work.

If `orientation` is `GTK_ORIENTATION_HORIZONTAL`, the MatewnckWorkspace will be laid out in rows, with the first MatewnckWorkspace in the top left corner.

If `orientation` is `GTK_ORIENTATION_VERTICAL`, the MatewnckWorkspace will be laid out in columns, with the first MatewnckWorkspace in the top left corner.

For example, if the layout contains one row, but the orientation of the layout is vertical, the MatewnckPager will display a column of MatewnckWorkspace.

If `pager` has not been added to a widget hierarchy, the call will fail because `pager` can't know the screen on which to modify the orientation.

`pager` : | a MatewnckPager.
`orientation` : | orientation to use for the layout of MatewnckWorkspace on the MatewnckScreen `pager` is watching.
Returns : | `TRUE` if the layout of MatewnckWorkspace has been successfully changed or did not need to be changed, `FALSE` otherwise.

### matewnck_pager_set_n_rows ()

    gboolean            matewnck_pager_set_n_rows           (MatewnckPager *pager,
                                                             int n_rows);

Tries to change the number of rows in the layout of MatewnckWorkspace on the MatewnckScreen `pager` is watching. Since no more than one application should set this property of a MatewnckScreen at a time, setting the layout is not guaranteed to work.

If `pager` has not been added to a widget hierarchy, the call will fail because `pager` can't know the screen on which to modify the layout.

`pager` : | a MatewnckPager.
`n_rows` : | the number of rows to use for the layout of MatewnckWorkspace on the MatewnckScreen `pager` is watching.
Returns : | `TRUE` if the layout of MatewnckWorkspace has been successfully changed or did not need to be changed, `FALSE` otherwise.

### enum MatewnckPagerLayoutPolicy

    typedef enum {
      MATEWNCK_PAGER_LAYOUT_POLICY_AUTOMATIC,
      MATEWNCK_PAGER_LAYOUT_POLICY_WIDTH_FOR_HEIGHT,
      MATEWNCK_PAGER_LAYOUT_POLICY_HEIGHT_FOR_WIDTH
    } MatewnckPagerLayoutPolicy;

Policy defining the geometry management used by a MatewnckPager.

`MATEWNCK_PAGER_LAYOUT_POLICY_AUTOMATIC` | the MatewnckPager geometry management is "height for width" when in vertical orientation, or "width for height" when in horizontal orientation. This is the default behavior.
`MATEWNCK_PAGER_LAYOUT_POLICY_WIDTH_FOR_HEIGHT` | the MatewnckPager calculates its width in proportion to a preset height. This can be used for a vertical MatewnckPager inside a horizontal panel.
`MATEWNCK_PAGER_LAYOUT_POLICY_HEIGHT_FOR_WIDTH` | the MatewnckPager calculates its height in proportion to a preset width. This can be used for a horizontal MatewnckPager inside a vertical panel.

Since 2.32

### matewnck_pager_set_layout_policy ()

    void                matewnck_pager_set_layout_policy    (MatewnckPager *pager,
                                                             MatewnckPagerLayoutPolicy policy);

Sets the layout policy for `pager` to `policy`.

`pager` : | a MatewnckPager.
`policy` : | a layout policy.

Since 2.32

### enum MatewnckPagerDisplayMode

    typedef enum {
      MATEWNCK_PAGER_DISPLAY_NAME,
      MATEWNCK_PAGER_DISPLAY_CONTENT
    } MatewnckPagerDisplayMode;

Mode defining what a MatewnckPager will display.

`MATEWNCK_PAGER_DISPLAY_NAME` | the MatewnckPager will only display the names of the workspaces.
`MATEWNCK_PAGER_DISPLAY_CONTENT` | the MatewnckPager will display a representation for each window in the workspaces.

### matewnck_pager_set_display_mode ()

    void                matewnck_pager_set_display_mode     (MatewnckPager *pager,
                                                             MatewnckPagerDisplayMode mode);

Sets the display mode for `pager` to `mode`.

`pager` : | a MatewnckPager.
`mode` : | a display mode.

### matewnck_pager_set_show_all ()

    void                matewnck_pager_set_show_all         (MatewnckPager *pager,
                                                             gboolean show_all_workspaces);

Sets `pager` to display all MatewnckWorkspace or not, according to `show_all_workspaces`.

`pager` : | a MatewnckPager.
`show_all_workspaces` : | whether to display all MatewnckWorkspace in `pager`.

### matewnck_pager_set_shadow_type ()

    void                matewnck_pager_set_shadow_type      (MatewnckPager *pager,
                                                             GtkShadowType shadow_type);

Sets the shadow type for `pager` to `shadow_type`. The main use of this function is proper integration of MatewnckPager in panels with non-system backgrounds.

`pager` : | a MatewnckPager.
`shadow_type` : | a shadow type.

Since 2.2

## See Also

MatewnckScreen