![]() |
![]() |
![]() |
Libwnck Reference Manual | ![]() |
---|---|---|---|---|
#include <libwnck/libwnck.h> WnckWorkspace; 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); 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_calc_workspace_layout()
, wnck_screen_try_set_workspace_layout()
,
wnck_screen_release_workspace_layout()
and
wnck_screen_free_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.
int wnck_workspace_get_number (WnckWorkspace *space);
Returns the index of space
on the WnckScreen to which it belongs. The
first workspace has an index of 0.
space : |
a WnckWorkspace. |
Returns : | the index of space on its WnckScreen, or -1 on errors.
|
const char* wnck_workspace_get_name (WnckWorkspace *space);
Returns 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.
space : |
a WnckWorkspace. |
Returns : | the name of space .
|
void wnck_workspace_change_name (WnckWorkspace *space, const char *name);
Changes the name of space
.
space : |
a WnckWorkspace. |
name : |
new name for space .
|
Since 2.2
int wnck_workspace_get_width (WnckWorkspace *space);
Returns the width of space
.
space : |
a WnckWorkspace. |
Returns : | the width of space .
|
Since 2.4
int wnck_workspace_get_height (WnckWorkspace *space);
Returns the height of space
.
space : |
a WnckWorkspace. |
Returns : | the height of space .
|
Since 2.4
int wnck_workspace_get_viewport_x (WnckWorkspace *space);
Returns the X coordinate of the viewport in space
.
space : |
a WnckWorkspace. |
Returns : | the X coordinate of the viewport in space , or 0 if space does not
contain a viewport.
|
Since 2.4
int wnck_workspace_get_viewport_y (WnckWorkspace *space);
Returns the Y coordinate of the viewport in space
.
space : |
a WnckWorkspace. |
Returns : | the Y coordinate of the viewport in space , or 0 if space does not
contain a viewport.
|
Since 2.4
gboolean wnck_workspace_is_virtual (WnckWorkspace *space);
Returns whether space
contains a viewport.
space : |
a WnckWorkspace. |
Returns : | TRUE if space contains a viewport, FALSE otherwise.
|
Since 2.4
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).
space : |
a WnckWorkspace. |
timestamp : |
the X server timestamp of the user interaction event that caused this call to occur. |
Since 2.10 (@timestamp argument was missing in earlier versions)
void user_function (WnckWorkspace *space, gpointer user_data) : Run Last
Emitted when the name of space
changes.
space : |
the WnckWorkspace which emitted the signal. |
user_data : |
user data set when the signal handler was connected. |