WnckPager

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

Stability Level

Unstable, unless otherwise indicated

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── WnckPager

Implemented Interfaces

WnckPager implements AtkImplementorIface and GtkBuildable.

Includes

#include <libwnck/libwnck.h>

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.

Functions

wnck_pager_new ()

GtkWidget *
wnck_pager_new (void);

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

Returns

a newly created WnckPager.


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.

Note that setting the orientation will have an effect on the geometry management: if orientation is GTK_ORIENTATION_HORIZONTAL, GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT will be used as request mode; if orientation is GTK_ORIENTATION_VERTICAL, GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH will be used instead.

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.

Parameters

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.

Parameters

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.


wnck_pager_set_display_mode ()

void
wnck_pager_set_display_mode (WnckPager *pager,
                             WnckPagerDisplayMode mode);

Sets the display mode for pager to mode .

Parameters

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 .

Parameters

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.

Parameters

pager

a WnckPager.

 

shadow_type

a shadow type.

 

Since: 2.2

Types and Values

struct WnckPager

struct WnckPager;

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


enum WnckPagerDisplayMode

Mode defining what a WnckPager will display.

Members

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.

 

See Also

WnckScreen