|  |  |  | Libwnck Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Signals | ||||
#include <libwnck/libwnck.h>
                    WnckWorkspace;
WnckScreen*         wnck_workspace_get_screen           (WnckWorkspace *space);
int                 wnck_workspace_get_number           (WnckWorkspace *space);
const char*         wnck_workspace_get_name             (WnckWorkspace *space);
void                wnck_workspace_change_name          (WnckWorkspace *space,
                                                         const char *name);
int                 wnck_workspace_get_width            (WnckWorkspace *space);
int                 wnck_workspace_get_height           (WnckWorkspace *space);
int                 wnck_workspace_get_viewport_x       (WnckWorkspace *space);
int                 wnck_workspace_get_viewport_y       (WnckWorkspace *space);
gboolean            wnck_workspace_is_virtual           (WnckWorkspace *space);
int                 wnck_workspace_get_layout_row       (WnckWorkspace *space);
int                 wnck_workspace_get_layout_column    (WnckWorkspace *space);
WnckWorkspace*      wnck_workspace_get_neighbor         (WnckWorkspace *space,
                                                         WnckMotionDirection direction);
void                wnck_workspace_activate             (WnckWorkspace *space,
                                                         guint32 timestamp);
The WnckWorkspace represents what is called virtual desktops in the EWMH. A workspace is a virtualization of a WnckScreen: only one workspace can be shown on a WnckScreen at a time. It makes it possible, for example, to put windows on different workspaces to organize them.
If the WnckWorkspace size is bigger that the WnckScreen size, the workspace contains a viewport. Viewports are defined in the large desktops section of the EWMH. The notion of workspaces and viewports are quite similar, and generally both are not used at the same time: there are generally either multiple workspaces with no viewport, or one workspace with a viewport. libwnck supports all situations, even multiple workspaces with viewports.
Workspaces are organized according to a layout set on the WnckScreen. See
wnck_screen_try_set_workspace_layout() and
wnck_screen_release_workspace_layout() for more information about the
layout.
The WnckWorkspace objects are always owned by libwnck and must not be referenced or unreferenced.
typedef struct _WnckWorkspace WnckWorkspace;
The WnckWorkspace struct contains only private fields and should not be directly accessed.
WnckScreen* wnck_workspace_get_screen (WnckWorkspace *space);
Gets the WnckScreen space is on.
| 
 | a WnckWorkspace. | 
| Returns : | the WnckScreen spaceis on. The returned WnckScreen is
owned by libwnck and must not be referenced or unreferenced. | 
int wnck_workspace_get_number (WnckWorkspace *space);
Gets the index of space on the WnckScreen to which it belongs. The
first workspace has an index of 0.
| 
 | a WnckWorkspace. | 
| Returns : | the index of spaceon its WnckScreen, or -1 on errors. | 
const char* wnck_workspace_get_name (WnckWorkspace *space);
Gets the human-readable name that should be used to refer to space. If
the user has not set a special name, a fallback like "Workspace 3" will be
used.
| 
 | a WnckWorkspace. | 
| Returns : | the name of space. | 
void wnck_workspace_change_name (WnckWorkspace *space, const char *name);
Changes the name of space.
| 
 | a WnckWorkspace. | 
| 
 | new name for space. | 
Since 2.2
int wnck_workspace_get_width (WnckWorkspace *space);
Gets the width of space.
| 
 | a WnckWorkspace. | 
| Returns : | the width of space. | 
Since 2.4
int wnck_workspace_get_height (WnckWorkspace *space);
Gets the height of space.
| 
 | a WnckWorkspace. | 
| Returns : | the height of space. | 
Since 2.4
int wnck_workspace_get_viewport_x (WnckWorkspace *space);
Gets the X coordinate of the viewport in space.
| 
 | a WnckWorkspace. | 
| Returns : | the X coordinate of the viewport in space, or 0 ifspacedoes not
contain a viewport. | 
Since 2.4
int wnck_workspace_get_viewport_y (WnckWorkspace *space);
Gets the Y coordinate of the viewport in space.
| 
 | a WnckWorkspace. | 
| Returns : | the Y coordinate of the viewport in space, or 0 ifspacedoes not
contain a viewport. | 
Since 2.4
gboolean wnck_workspace_is_virtual (WnckWorkspace *space);
Gets whether space contains a viewport.
| 
 | a WnckWorkspace. | 
| Returns : | TRUEifspacecontains a viewport,FALSEotherwise. | 
Since 2.4
int wnck_workspace_get_layout_row (WnckWorkspace *space);
Gets the row of space in the WnckWorkspace layout. The first row has an
index of 0 and is always the top row, regardless of the starting corner set
for the layout.
| 
 | a WnckWorkspace. | 
| Returns : | the row of spacein the WnckWorkspace layout, or -1 on
errors. | 
Since 2.20
int wnck_workspace_get_layout_column (WnckWorkspace *space);
Gets the column of space in the WnckWorkspace layout. The first column
has an index of 0 and is always the left column, regardless of the starting
corner set for the layout and regardless of the default direction of the
environment (i.e., in both Left-To-Right and Right-To-Left environments).
| 
 | a WnckWorkspace. | 
| Returns : | the column of spacein the WnckWorkspace layout, or -1 on
errors. | 
Since 2.20
WnckWorkspace* wnck_workspace_get_neighbor (WnckWorkspace *space, WnckMotionDirection direction);
Gets the neighbor WnckWorkspace of space in the direction direction.
| 
 | a WnckWorkspace. | 
| 
 | direction in which to search the neighbor. | 
| Returns : | the neighbor WnckWorkspace of spacein thedirectiondirection, orNULLif no such neighbor WnckWorkspace exists. The returned
WnckWorkspace is owned by libwnck and must not be referenced or
unreferenced. | 
Since 2.20
void wnck_workspace_activate (WnckWorkspace *space, guint32 timestamp);
Asks the window manager to make space the active workspace. The window
manager may decide to refuse the request (to not steal the focus if there is
a more recent user activity, for example).
This function existed before 2.10, but the timestamp argument was missing
in earlier versions.
| 
 | a WnckWorkspace. | 
| 
 | the X server timestamp of the user interaction event that caused this call to occur. | 
Since 2.10
"name-changed" signalvoid user_function (WnckWorkspace *space, gpointer user_data) : Run Last
Emitted when the name of space changes.
| 
 | the WnckWorkspace which emitted the signal. | 
| 
 | user data set when the signal handler was connected. |