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

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libwnck/libwnck.h>

    struct              WnckPager;
    GtkWidget *         wnck_pager_new                      (WnckScreen *screen);
    void                wnck_pager_set_screen               (WnckPager *pager,
                                                             WnckScreen *screen);
    gboolean            wnck_pager_set_orientation          (WnckPager *pager,
                                                             GtkOrientation orientation);
    gboolean            wnck_pager_set_n_rows               (WnckPager *pager,
                                                             int n_rows);
    enum                WnckPagerLayoutPolicy;
    void                wnck_pager_set_layout_policy        (WnckPager *pager,
                                                             WnckPagerLayoutPolicy policy);
    enum                WnckPagerDisplayMode;
    void                wnck_pager_set_display_mode         (WnckPager *pager,
                                                             WnckPagerDisplayMode mode);
    void                wnck_pager_set_show_all             (WnckPager *pager,
                                                             gboolean show_all_workspaces);
    void                wnck_pager_set_shadow_type          (WnckPager *pager,
                                                             GtkShadowType shadow_type);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----WnckPager

## Implemented Interfaces

WnckPager implements AtkImplementorIface and GtkBuildable.

## Description

A WnckPager 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 WnckPager offers ways to move windows between workspaces and to change the current workspace.

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

The WnckPager 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 WnckPager automatically tries to obtain the manager selection for the screen and only sets the layout if it owns the manager selection. See `wnck_pager_set_orientation()` and `wnck_pager_set_n_rows()` to change the layout.

## Details

### struct WnckPager

    struct WnckPager;

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

### wnck_pager_new ()

    GtkWidget *         wnck_pager_new                      (WnckScreen *screen);

Creates a new WnckPager. The WnckPager will show the WnckWorkspace of the WnckScreen it is on.

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

### wnck_pager_set_screen ()

    void                wnck_pager_set_screen               (WnckPager *pager,
                                                             WnckScreen *screen);

### Warning

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

Does nothing.

`pager` : | a WnckPager.
`screen` : | a WnckScreen.

Since 2.2

### wnck_pager_set_orientation ()

    gboolean            wnck_pager_set_orientation          (WnckPager *pager,
                                                             GtkOrientation orientation);

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

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

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

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

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 WnckPager.
`orientation` : | orientation to use for the layout of WnckWorkspace on the WnckScreen `pager` is watching.
Returns : | `TRUE` if the layout of WnckWorkspace has been successfully changed or did not need to be changed, `FALSE` otherwise.

### wnck_pager_set_n_rows ()

    gboolean            wnck_pager_set_n_rows               (WnckPager *pager,
                                                             int n_rows);

Tries to change the number of rows in the layout of WnckWorkspace on the WnckScreen `pager` is watching. Since no more than one application should set this property of a WnckScreen 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 WnckPager.
`n_rows` : | the number of rows to use for the layout of WnckWorkspace on the WnckScreen `pager` is watching.
Returns : | `TRUE` if the layout of WnckWorkspace has been successfully changed or did not need to be changed, `FALSE` otherwise.

### enum WnckPagerLayoutPolicy

    typedef enum {
      WNCK_PAGER_LAYOUT_POLICY_AUTOMATIC,
      WNCK_PAGER_LAYOUT_POLICY_WIDTH_FOR_HEIGHT,
      WNCK_PAGER_LAYOUT_POLICY_HEIGHT_FOR_WIDTH
    } WnckPagerLayoutPolicy;

Policy defining the geometry management used by a WnckPager.

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

Since 2.32

### wnck_pager_set_layout_policy ()

    void                wnck_pager_set_layout_policy        (WnckPager *pager,
                                                             WnckPagerLayoutPolicy policy);

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

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

Since 2.32

### enum WnckPagerDisplayMode

    typedef enum {
      WNCK_PAGER_DISPLAY_NAME,
      WNCK_PAGER_DISPLAY_CONTENT
    } WnckPagerDisplayMode;

Mode defining what a WnckPager will display.

`WNCK_PAGER_DISPLAY_NAME` | the WnckPager will only display the names of the workspaces.
`WNCK_PAGER_DISPLAY_CONTENT` | the WnckPager will display a representation for each window in the workspaces.

### wnck_pager_set_display_mode ()

    void                wnck_pager_set_display_mode         (WnckPager *pager,
                                                             WnckPagerDisplayMode mode);

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

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

### wnck_pager_set_show_all ()

    void                wnck_pager_set_show_all             (WnckPager *pager,
                                                             gboolean show_all_workspaces);

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

`pager` : | a WnckPager.
`show_all_workspaces` : | whether to display all WnckWorkspace in `pager`.

### wnck_pager_set_shadow_type ()

    void                wnck_pager_set_shadow_type          (WnckPager *pager,
                                                             GtkShadowType shadow_type);

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

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

Since 2.2

## See Also

WnckScreen