![]() |
![]() |
![]() |
Libwnck Reference Manual | ![]() |
---|---|---|---|---|
enum WnckWindowState; enum WnckWindowActions; enum WnckWindowType; WnckWindowPrivate; WnckWindow* wnck_window_get (gulong xwindow); WnckScreen* wnck_window_get_screen (WnckWindow *window); const char* wnck_window_get_name (WnckWindow *window); const char* wnck_window_get_icon_name (WnckWindow *window); WnckApplication* wnck_window_get_application (WnckWindow *window); WnckWindow* wnck_window_get_transient (WnckWindow *window); gulong wnck_window_get_group_leader (WnckWindow *window); gulong wnck_window_get_xid (WnckWindow *window); WnckClassGroup* wnck_window_get_class_group (WnckWindow *window); const char* wnck_window_get_session_id (WnckWindow *window); const char* wnck_window_get_session_id_utf8 (WnckWindow *window); int wnck_window_get_pid (WnckWindow *window); gint wnck_window_get_sort_order (WnckWindow *window); WnckWindowType wnck_window_get_window_type (WnckWindow *window); void wnck_window_set_window_type (WnckWindow *window, WnckWindowType wintype); gboolean wnck_window_is_minimized (WnckWindow *window); gboolean wnck_window_is_maximized_horizontally (WnckWindow *window); gboolean wnck_window_is_maximized_vertically (WnckWindow *window); gboolean wnck_window_is_maximized (WnckWindow *window); gboolean wnck_window_is_shaded (WnckWindow *window); gboolean wnck_window_is_skip_pager (WnckWindow *window); gboolean wnck_window_is_skip_tasklist (WnckWindow *window); gboolean wnck_window_is_fullscreen (WnckWindow *window); gboolean wnck_window_is_sticky (WnckWindow *window); gboolean wnck_window_needs_attention (WnckWindow *window); gboolean wnck_window_or_transient_needs_attention (WnckWindow *window); void wnck_window_set_skip_pager (WnckWindow *window, gboolean skip); void wnck_window_set_skip_tasklist (WnckWindow *window, gboolean skip); void wnck_window_set_fullscreen (WnckWindow *window, gboolean fullscreen); void wnck_window_close (WnckWindow *window, guint32 timestamp); void wnck_window_minimize (WnckWindow *window); void wnck_window_unminimize (WnckWindow *window, guint32 timestamp); void wnck_window_maximize (WnckWindow *window); void wnck_window_unmaximize (WnckWindow *window); void wnck_window_maximize_horizontally (WnckWindow *window); void wnck_window_unmaximize_horizontally (WnckWindow *window); void wnck_window_maximize_vertically (WnckWindow *window); void wnck_window_unmaximize_vertically (WnckWindow *window); void wnck_window_shade (WnckWindow *window); void wnck_window_unshade (WnckWindow *window); void wnck_window_stick (WnckWindow *window); void wnck_window_unstick (WnckWindow *window); void wnck_window_keyboard_move (WnckWindow *window); void wnck_window_keyboard_size (WnckWindow *window); WnckWorkspace* wnck_window_get_workspace (WnckWindow *window); void wnck_window_move_to_workspace (WnckWindow *window, WnckWorkspace *space); gboolean wnck_window_is_pinned (WnckWindow *window); void wnck_window_pin (WnckWindow *window); void wnck_window_unpin (WnckWindow *window); void wnck_window_activate (WnckWindow *window, guint32 timestamp); gboolean wnck_window_is_active (WnckWindow *window); gboolean wnck_window_is_most_recently_activated (WnckWindow *window); void wnck_window_activate_transient (WnckWindow *window, guint32 timestamp); gboolean wnck_window_transient_is_most_recently_activated (WnckWindow *window); GdkPixbuf* wnck_window_get_icon (WnckWindow *window); GdkPixbuf* wnck_window_get_mini_icon (WnckWindow *window); gboolean wnck_window_get_icon_is_fallback (WnckWindow *window); void wnck_window_set_icon_geometry (WnckWindow *window, int x, int y, int width, int height); WnckWindowActions wnck_window_get_actions (WnckWindow *window); WnckWindowState wnck_window_get_state (WnckWindow *window); void wnck_window_get_geometry (WnckWindow *window, int *xp, int *yp, int *widthp, int *heightp); gboolean wnck_window_is_visible_on_workspace (WnckWindow *window, WnckWorkspace *workspace); gboolean wnck_window_is_on_workspace (WnckWindow *window, WnckWorkspace *workspace); gboolean wnck_window_is_in_viewport (WnckWindow *window, WnckWorkspace *workspace);
typedef enum { WNCK_WINDOW_STATE_MINIMIZED = 1 << 0, WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY = 1 << 1, WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY = 1 << 2, WNCK_WINDOW_STATE_SHADED = 1 << 3, WNCK_WINDOW_STATE_SKIP_PAGER = 1 << 4, WNCK_WINDOW_STATE_SKIP_TASKLIST = 1 << 5, WNCK_WINDOW_STATE_STICKY = 1 << 6, WNCK_WINDOW_STATE_HIDDEN = 1 << 7, WNCK_WINDOW_STATE_FULLSCREEN = 1 << 8, WNCK_WINDOW_STATE_DEMANDS_ATTENTION = 1 << 9, WNCK_WINDOW_STATE_URGENT = 1 << 10, WNCK_WINDOW_STATE_ABOVE = 1 << 11 } WnckWindowState;
typedef enum { WNCK_WINDOW_ACTION_MOVE = 1 << 0, WNCK_WINDOW_ACTION_RESIZE = 1 << 1, WNCK_WINDOW_ACTION_SHADE = 1 << 2, WNCK_WINDOW_ACTION_STICK = 1 << 3, WNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY = 1 << 4, WNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY = 1 << 5, WNCK_WINDOW_ACTION_CHANGE_WORKSPACE = 1 << 6, /* includes pin/unpin */ WNCK_WINDOW_ACTION_CLOSE = 1 << 7, WNCK_WINDOW_ACTION_UNMAXIMIZE_HORIZONTALLY = 1 << 8, WNCK_WINDOW_ACTION_UNMAXIMIZE_VERTICALLY = 1 << 9, WNCK_WINDOW_ACTION_UNSHADE = 1 << 10, WNCK_WINDOW_ACTION_UNSTICK = 1 << 11, WNCK_WINDOW_ACTION_MINIMIZE = 1 << 12, WNCK_WINDOW_ACTION_UNMINIMIZE = 1 << 13, WNCK_WINDOW_ACTION_MAXIMIZE = 1 << 14, WNCK_WINDOW_ACTION_UNMAXIMIZE = 1 << 15, WNCK_WINDOW_ACTION_FULLSCREEN = 1 << 16, WNCK_WINDOW_ACTION_ABOVE = 1 << 17 } WnckWindowActions;
typedef enum { WNCK_WINDOW_NORMAL, /* document/app window */ WNCK_WINDOW_DESKTOP, /* desktop background */ WNCK_WINDOW_DOCK, /* panel */ WNCK_WINDOW_DIALOG, /* dialog */ WNCK_WINDOW_MODAL_DIALOG, /* modal dialog */ WNCK_WINDOW_TOOLBAR, /* tearoff toolbar */ WNCK_WINDOW_MENU, /* tearoff menu */ WNCK_WINDOW_UTILITY, /* palette/toolbox window */ WNCK_WINDOW_SPLASHSCREEN /* splash screen */ } WnckWindowType;
WnckWindow* wnck_window_get (gulong xwindow);
Gets a preexisting WnckWindow for the X window xwindow
.
Will not create a WnckWindow if none exists. Robust
against bogus window IDs.
xwindow : |
an Xlib window ID |
Returns : | the WnckWindow for this X window |
WnckScreen* wnck_window_get_screen (WnckWindow *window);
Gets the screen this window is on.
window : |
a WnckWindow |
Returns : | a WnckScreen |
const char* wnck_window_get_name (WnckWindow *window);
Gets the name of the window, as it should be displayed in a pager
or tasklist. Always returns some value, even if the window
hasn't set a name; use wnck_window_has_name()
if you need to know
whether the returned name is "real" or not.
For icons titles, use wnck_window_get_icon_name()
instead.
window : |
a WnckWindow |
Returns : | name of the window |
const char* wnck_window_get_icon_name (WnckWindow *window);
Gets the name of the window, as it should be displayed for an icon.
Always returns some value, even if the window hasn't set a name;
use wnck_window_has_icon_name()
if you need to know if the name is
"real" or not. Contrast with wnck_window_get_name()
, which returns
the window title, not the icon title.
window : |
a WnckWindow |
Returns : | name of the window |
WnckApplication* wnck_window_get_application (WnckWindow *window);
window : |
|
Returns : |
WnckWindow* wnck_window_get_transient (WnckWindow *window);
window : |
|
Returns : |
gulong wnck_window_get_group_leader (WnckWindow *window);
window : |
|
Returns : |
WnckClassGroup* wnck_window_get_class_group (WnckWindow *window);
window : |
|
Returns : |
const char* wnck_window_get_session_id (WnckWindow *window);
Gets the session ID for window
in Latin-1 encoding.
NOTE: this is invalid UTF-8. You can't display this
string in a GTK widget without converting to UTF-8.
See wnck_window_get_session_id_utf8()
.
window : |
a WnckWindow |
Returns : | session ID in Latin-1 |
const char* wnck_window_get_session_id_utf8 (WnckWindow *window);
window : |
|
Returns : |
int wnck_window_get_pid (WnckWindow *window);
Gets the process ID of window
, if available.
window : |
a WnckWindow |
Returns : | PID of window , or 0 if none available
|
gint wnck_window_get_sort_order (WnckWindow *window);
Gets the sort order of window
; used for ordering of the window in
the tasklist. This is defined when the window is created.
window : |
a WnckWindow |
Returns : | sort order of window , or G_MAXINT if none available
|
WnckWindowType wnck_window_get_window_type (WnckWindow *window);
Retrieves the semantic type of the window.
window : |
a WnckWindow |
Returns : | semantic type |
void wnck_window_set_window_type (WnckWindow *window, WnckWindowType wintype);
Sets the semantic type of the window.
window : |
a WnckWindow |
wintype : |
the WnckWindowType type hint |
gboolean wnck_window_is_minimized (WnckWindow *window);
If the window is minimized returns TRUE
. Minimization state
may change anytime a state_changed signal gets emitted.
window : |
a WnckWindow |
Returns : | TRUE if window is minimized
|
gboolean wnck_window_is_maximized_horizontally (WnckWindow *window);
window : |
|
Returns : |
gboolean wnck_window_is_maximized_vertically (WnckWindow *window);
window : |
|
Returns : |
gboolean wnck_window_is_maximized (WnckWindow *window);
As for GDK, "maximized" means both vertically and horizontally. If only one, then the window isn't considered maximized.
window : |
a WnckWindow |
Returns : | TRUE if the window is maximized in both directions
|
gboolean wnck_window_is_skip_pager (WnckWindow *window);
window : |
|
Returns : |
gboolean wnck_window_is_skip_tasklist (WnckWindow *window);
window : |
|
Returns : |
gboolean wnck_window_is_fullscreen (WnckWindow *window);
window : |
|
Returns : |
gboolean wnck_window_is_sticky (WnckWindow *window);
Sticky here means "stuck to the glass," i.e. does not scroll with
the viewport. In GDK/GTK,
e.g. gdk_window_stick()
/gtk_window_stick()
, sticky means stuck to
the glass and _also_ that the window is on all workspaces.
But here it only means the viewport aspect of it.
window : |
a WnckWindow |
Returns : | TRUE if the window is "stuck to the glass"
|
gboolean wnck_window_needs_attention (WnckWindow *window);
If the window needs attention returns TRUE
. This state may change
anytime a state_changed signal gets emitted, as it can depend on flags
such as the demands_attention and is_urgent hints.
window : |
a WnckWindow |
Returns : | TRUE if window needs attention
|
gboolean wnck_window_or_transient_needs_attention (WnckWindow *window);
If the window or one of its transients needs attention returns TRUE
.
This state may change anytime a state_changed signal gets emitted.
window : |
a WnckWindow |
Returns : | TRUE if window or one of its transients needs attention
|
void wnck_window_set_skip_pager (WnckWindow *window, gboolean skip);
window : |
|
skip : |
void wnck_window_set_skip_tasklist (WnckWindow *window, gboolean skip);
window : |
|
skip : |
void wnck_window_set_fullscreen (WnckWindow *window, gboolean fullscreen);
window : |
|
fullscreen : |
void wnck_window_close (WnckWindow *window, guint32 timestamp);
window : |
|
timestamp : |
void wnck_window_unminimize (WnckWindow *window, guint32 timestamp);
window : |
|
timestamp : |
void wnck_window_maximize_horizontally (WnckWindow *window);
window : |
void wnck_window_unmaximize_horizontally (WnckWindow *window);
window : |
void wnck_window_maximize_vertically (WnckWindow *window);
window : |
void wnck_window_unmaximize_vertically (WnckWindow *window);
window : |
WnckWorkspace* wnck_window_get_workspace (WnckWindow *window);
Gets the window's current workspace. If the window is
pinned (on all workspaces), or not on any workspaces,
NULL
may be returned.
window : |
a WnckWindow |
Returns : | single current workspace or NULL
|
void wnck_window_move_to_workspace (WnckWindow *window, WnckWorkspace *space);
window : |
|
space : |
gboolean wnck_window_is_pinned (WnckWindow *window);
TRUE
if the window is on all workspaces. Note that if this
changes, it's signalled by a workspace_changed signal,
not state_changed.
window : |
a WnckWindow |
Returns : | TRUE if on all workspaces
|
void wnck_window_unpin (WnckWindow *window);
Sets window
's workspace to only the currently active workspace,
if the window was previously pinned. If the window wasn't pinned,
doesn't change the window's workspace. If the active workspace
isn't known for some reason (shouldn't happen much), sets the
window's workspace to 0.
window : |
a WnckWindow |
void wnck_window_activate (WnckWindow *window, guint32 timestamp);
Ask the window manager to make window
the active window. The
window manager may choose to raise window
along with focusing it.
window : |
a WnckWindow |
timestamp : |
the X server timestamp of the user interaction event that caused this call to occur |
gboolean wnck_window_is_active (WnckWindow *window);
window : |
a WnckWindow |
Returns : | TRUE if the window is the active window
|
gboolean wnck_window_is_most_recently_activated (WnckWindow *window);
Determines whether window
is the most recently activated window.
The most recently activated window is identical to the active
window for click and sloppy focus methods (since a window is always
active in those cases) but differs slightly for mouse focus since
we often have no window active.
window : |
a WnckWindow |
Returns : | TRUE if window was the most recently activated window
|
void wnck_window_activate_transient (WnckWindow *window, guint32 timestamp);
If window
has transients, activates the most likely transient
instead of the window itself. Otherwise activates window
.
FIXME the ideal behavior of this function is probably to activate
the most recently active window among window
and its transients.
This is probably best implemented on the window manager side.
window : |
a WnckWindow |
timestamp : |
the X server timestamp of the user interaction event that caused this call to occur |
gboolean wnck_window_transient_is_most_recently_activated (WnckWindow *window);
Return whether one of the transients of window
is the most
recently activated window. See
wnck_window_is_most_recently_activated()
for a more complete
description of what is meant by most recently activated. This
function is needed because clicking on the tasklist once will
activate a transient instead of the window itself
(wnck_window_activate_transient), and clicking again should
minimize the window and it's transients. (Not doing this can be
especially annoying in the case of modal dialogs that don't appear
in the tasklist).
window : |
a WnckWindow |
Returns : |
GdkPixbuf* wnck_window_get_mini_icon (WnckWindow *window);
window : |
|
Returns : |
gboolean wnck_window_get_icon_is_fallback (WnckWindow *window);
Checks if we are using a default fallback icon because none was set on the window.
window : |
a WnckWindow |
Returns : | TRUE if icon is a fallback
|
void wnck_window_set_icon_geometry (WnckWindow *window, int x, int y, int width, int height);
Set the icon geometry for a WnckWindow.
window : |
a WnckWindow |
x : |
x coordinate in pixels |
y : |
y coordinate in pixels |
width : |
width in pixels |
height : |
height in pixels |
WnckWindowActions wnck_window_get_actions (WnckWindow *window);
Gets the window operations that should be sensitive for window
.
window : |
a WnckWindow |
Returns : | bitmask of actions the window supports |
WnckWindowState wnck_window_get_state (WnckWindow *window);
Gets the state of a window as a bitmask.
window : |
a WnckWindow |
Returns : | bitmask of active state flags. |
void wnck_window_get_geometry (WnckWindow *window, int *xp, int *yp, int *widthp, int *heightp);
Gets the size and position of the window, as last received in a configure notify (i.e. this call does not round-trip to the server, just gets the last size we were notified of). The X and Y coordinates are relative to the root window.
window : |
a WnckWindow |
xp : |
return location for X coordinate of window |
yp : |
return location for Y coordinate of window |
widthp : |
return location for width of window |
heightp : |
return location for height of window |
gboolean wnck_window_is_visible_on_workspace (WnckWindow *window, WnckWorkspace *workspace);
Like wnck_window_is_on_workspace()
, but also checks that
the window is in a visible state (i.e. not minimized or shaded).
window : |
a WnckWindow |
workspace : |
a WnckWorkspace |
Returns : | TRUE if window appears on workspace in normal state
|
gboolean wnck_window_is_on_workspace (WnckWindow *window, WnckWorkspace *workspace);
window : |
a WnckWindow |
workspace : |
a WnckWorkspace |
Returns : | TRUE if window appears on workspace
|
gboolean wnck_window_is_in_viewport (WnckWindow *window, WnckWorkspace *workspace);
Returns TRUE if the window is inside the current viewport of the given workspace.
window : |
a WnckWindow |
workspace : |
a WnckWorkspace |
Returns : | TRUE if window appears in current viewport
|