NETWinInfo Class Reference
from PyKDE4.kdeui import *
Inherits: NET
Subclasses: NETWinInfo2
Detailed Description
Enumerations | |
anonymous | { PROTOCOLS, PROTOCOLS2, PROPERTIES_SIZE } |
Attributes | |
int | OnAllDesktops |
int | OnAllDesktops |
Methods | |
__init__ (self, Display display, Window window, Window rootWindow, SIP_PYLIST properties, NET.Role role=NET.Client) | |
__init__ (self, Display display, Window window, Window rootWindow, long properties, NET.Role role=NET.Client) | |
__init__ (self, NETWinInfo wininfo) | |
long | allowedActions (self) |
changeDesktop (self, int desktop) | |
changeState (self, long state, long mask) | |
QString | clientMachine (self) |
int | desktop (self, bool ignore_viewport=0) |
event (self, XEvent event, long properties, int properties_size) | |
long | event (self, XEvent event) |
NETExtendedStrut | extendedStrut (self) |
NETStrut | frameExtents (self) |
Window | groupLeader (self) |
Bool | handledIcons (self) |
bool | hasNETSupport (self) |
bool | hasWindowType (self) |
NETIcon | icon (self, int width=-1, int height=-1) |
NETRect | iconGeometry (self) |
QString | iconName (self) |
int | iconSizes (self) |
kdeGeometry (self, NETRect frame, NETRect window) | |
NET.MappingState | mappingState (self) |
QString | name (self) |
long | opacity (self) |
long | passedProperties (self) |
int | pid (self) |
setAllowedActions (self, long actions) | |
setDesktop (self, int desktop, bool ignore_viewport=0) | |
setExtendedStrut (self, NETExtendedStrut extended_strut) | |
setFrameExtents (self, NETStrut strut) | |
setHandledIcons (self, Bool handled) | |
setIcon (self, NETIcon icon, Bool replace=True) | |
setIconGeometry (self, NETRect geometry) | |
setIconName (self, QString name) | |
setName (self, QString name) | |
setOpacity (self, long opacity) | |
setPid (self, int pid) | |
setStartupId (self, QString startup_id) | |
setState (self, long state, long mask) | |
setStrut (self, NETStrut strut) | |
setUserTime (self, Time time) | |
setVisibleIconName (self, QString name) | |
setVisibleName (self, QString visibleName) | |
setWindowType (self, NET.WindowType type) | |
QString | startupId (self) |
long | state (self) |
NETStrut | strut (self) |
Window | transientFor (self) |
Time | userTime (self) |
virtual_hook (self, int id, void data) | |
QString | visibleIconName (self) |
QString | visibleName (self) |
QString | windowClassClass (self) |
QString | windowClassName (self) |
QString | windowRole (self) |
NET.WindowType | windowType (self, long supported_types) |
Method Documentation
__init__ | ( | self, | ||
Display | display, | |||
Window | window, | |||
Window | rootWindow, | |||
SIP_PYLIST | properties, | |||
NET.Role | role=NET.Client | |||
) |
Create a NETWinInfo object, which will be used to set/read/change information stored on an application window.
- Parameters:
-
display An X11 Display struct. window The Window id of the application window. rootWindow The Window id of the root window. properties An array of elements listing all properties the client is interested in.The elements contain OR'ed values of constants from the NET base class, in the following order: [0]= NET.Property, [1]= NET.Property2. In future versions, the list may be extended. In case you pass less elements, the missing ones will be replaced with default values. properties_size The number of elements in the properties array. role Select the application role. If this argument is omitted, the role will default to Client.
__init__ | ( | self, | ||
Display | display, | |||
Window | window, | |||
Window | rootWindow, | |||
long | properties, | |||
NET.Role | role=NET.Client | |||
) |
This constructor differs from the above one only in the way it accepts the list of properties the client is interested in. The properties argument is equivalent to the first element of the properties array in the above constructor.
__init__ | ( | self, | ||
NETWinInfo | wininfo | |||
) |
Creates a shared copy of the specified NETWinInfo object.
- Parameters:
-
wininfo the NETWinInfo to copy
long allowedActions | ( | self ) |
Returns actions that the window manager allows for the window.
changeDesktop | ( | self, | ||
int | desktop | |||
) |
A Window Manager should subclass NETWinInfo and reimplement this function when it wants to know when a Client made a request to change desktops (ie. move to another desktop).
- Parameters:
-
desktop the number of the desktop
changeState | ( | self, | ||
long | state, | |||
long | mask | |||
) |
A Window Manager should subclass NETWinInfo and reimplement this function when it wants to know when a Client made a request to change state (ie. to Shade / Unshade).
- Parameters:
-
state the new state mask the mask for the state
QString clientMachine | ( | self ) |
Returns the client machine for the window (i.e. WM_CLIENT_MACHINE property).
int desktop | ( | self, | ||
bool | ignore_viewport=0 | |||
) |
Returns the desktop where the window is residing.
NOTE: KDE uses virtual desktops and does not directly support viewport in any way. It is however mapped to virtual desktops if needed.
- Parameters:
-
ignore_viewport if false, viewport is mapped to virtual desktops
- Returns:
- the number of the window's desktop
- See also:
- OnAllDesktops()
event | ( | self, | ||
XEvent | event, | |||
long | properties, | |||
int | properties_size | |||
) |
This function takes the passed XEvent and returns an OR'ed list of NETWinInfo properties that have changed in the properties argument. The new information will be read immediately by the class. The elements of the properties argument are as they would be passed to the constructor, if the array is not large enough, changed properties that don't fit in it won't be listed there (they'll be updated in the class though).
- Parameters:
-
event the event properties properties that changed properties_size size of the passed properties array
long event | ( | self, | ||
XEvent | event | |||
) |
This function takes the pass XEvent and returns an OR'ed list of NETWinInfo properties that have changed. The new information will be read immediately by the class. This overloaded version returns only a single mask, and therefore cannot check state of all properties like the other variant.
- Parameters:
-
event the event
- Returns:
- the properties
NETExtendedStrut extendedStrut | ( | self ) |
Returns the extended (partial) strut specified by this client. See _NET_WM_STRUT_PARTIAL in the spec.
NETStrut frameExtents | ( | self ) |
Returns the frame decoration strut, i.e. the width of the decoration borders.
- Since:
- 4.3
Window groupLeader | ( | self ) |
Returns the leader window for the group the window is in, if any.
Bool handledIcons | ( | self ) |
Returns whether or not this client handles icons.
- Returns:
- true if this client handles icons, false otherwise
bool hasNETSupport | ( | self ) |
Returns true if the window has any window type set, even if the type itself is not known to this implementation. Presence of a window type as specified by the NETWM spec is considered as the window supporting this specification.
- Returns:
- true if the window has support for the NETWM spec
bool hasWindowType | ( | self ) |
This function returns false if the window has not window type specified at all. Used by KWindowInfo.windowType() to return either NET.Normal or NET.Dialog as appropriate as a fallback.
NETIcon icon | ( | self, | ||
int | width=-1, | |||
int | height=-1 | |||
) |
Returns an icon. If width and height are passed, the icon returned will be the closest it can find (the next biggest). If width and height are omitted, then the largest icon in the list is returned.
- Parameters:
-
width the preferred width for the icon, -1 to ignore height the preferred height for the icon, -1 to ignore
- Returns:
- the icon
NETRect iconGeometry | ( | self ) |
Returns the icon geometry.
- Returns:
- the geometry of the icon
QString iconName | ( | self ) |
Returns the iconic name of the window in UTF-8 format. Note that this has nothing to do with icons, but it's for "iconic" representations of the window (taskbars etc.), that should be shown when the window is in iconic state. See description of _NET_WM_ICON_NAME for details.
- Returns:
- the iconic name
int iconSizes | ( | self ) |
Returns a list of provided icon sizes. Each size is pair width,height, terminated with pair 0,0.
- Since:
- 4.3
Places the window frame geometry in frame, and the application window geometry in window. Both geometries are relative to the root window.
- Parameters:
-
frame the geometry for the frame window the geometry for the window
NET.MappingState mappingState | ( | self ) |
Returns the mapping state for the window (see the NET base class documentation for a description of mapping state).
- Returns:
- the mapping state
QString name | ( | self ) |
Returns the name of the window in UTF-8 format.
- Returns:
- the name of the window
long opacity | ( | self ) |
Returns the opacity of the window.
long passedProperties | ( | self ) |
Returns the properties argument passed to the constructor. The size is the maximum array size the constructor accepts.
int pid | ( | self ) |
Returns the process id for the client window.
- Returns:
- the process id of the window
setAllowedActions | ( | self, | ||
long | actions | |||
) |
Sets actions that the window manager allows for the window.
setDesktop | ( | self, | ||
int | desktop, | |||
bool | ignore_viewport=0 | |||
) |
Set which window the desktop is (should be) on.
NOTE: KDE uses virtual desktops and does not directly support viewport in any way. It is however mapped to virtual desktops if needed.
- Parameters:
-
desktop the number of the new desktop ignore_viewport if false, viewport is mapped to virtual desktops
- See also:
- OnAllDesktops()
setExtendedStrut | ( | self, | ||
NETExtendedStrut | extended_strut | |||
) |
Set the extended (partial) strut for the application window.
- Parameters:
-
extended_strut the new strut
setFrameExtents | ( | self, | ||
NETStrut | strut | |||
) |
Set the frame decoration strut, i.e. the width of the decoration borders.
- Parameters:
-
strut the new strut
setHandledIcons | ( | self, | ||
Bool | handled | |||
) |
Set whether this application window handles icons.
- Parameters:
-
handled true if the window handles icons, false otherwise
setIcon | ( | self, | ||
NETIcon | icon, | |||
Bool | replace=True | |||
) |
Set icons for the application window. If replace is True, then the specified icon is defined to be the only icon. If replace is False, then the specified icon is added to a list of icons.
- Parameters:
-
icon the new icon replace true to replace, false to append to the list of icons
setIconGeometry | ( | self, | ||
NETRect | geometry | |||
) |
Set the icon geometry for the application window.
- Parameters:
-
geometry the new icon geometry
setIconName | ( | self, | ||
QString | name | |||
) |
Sets the iconic name for the application window.
- Parameters:
-
name the new iconic name
setName | ( | self, | ||
QString | name | |||
) |
Sets the name for the application window.
- Parameters:
-
name the new name of the window
setOpacity | ( | self, | ||
long | opacity | |||
) |
Sets opacity (0 = transparent, 0xffffffff = opaque ) on the window.
setPid | ( | self, | ||
int | pid | |||
) |
Set the application window's process id.
- Parameters:
-
pid the window's process id
setStartupId | ( | self, | ||
QString | startup_id | |||
) |
Sets the startup notification id id on the window.
setState | ( | self, | ||
long | state, | |||
long | mask | |||
) |
Set the state for the application window (see the NET base class documentation for a description of window state).
- Parameters:
-
state the name state mask the mask for the state
setStrut | ( | self, | ||
NETStrut | strut | |||
) |
- Deprecated:
- use setExtendedStrut() Set the strut for the application window.
- Parameters:
-
strut the new strut
setUserTime | ( | self, | ||
Time | time | |||
) |
Sets user timestamp time on the window (property _NET_WM_USER_TIME). The timestamp is expressed as XServer time. If a window is shown with user timestamp older than the time of the last user action, it won't be activated after being shown, with the special value 0 meaning not to activate the window after being shown.
setVisibleIconName | ( | self, | ||
QString | name | |||
) |
For Window Managers only: set the visible iconic name ( i.e. xterm, xterm <2>, xterm <3>, ... )
- Parameters:
-
name the new visible iconic name
setVisibleName | ( | self, | ||
QString | visibleName | |||
) |
For Window Managers only: set the visible name ( i.e. xterm, xterm <2>, xterm <3>, ... )
- Parameters:
-
visibleName the new visible name
setWindowType | ( | self, | ||
NET.WindowType | type | |||
) |
Sets the window type for this client (see the NET base class documentation for a description of the various window types).
- Parameters:
-
type the window type
QString startupId | ( | self ) |
Returns the startup notification id of the window.
long state | ( | self ) |
Returns the state of the window (see the NET base class documentation for a description of the various states).
- Returns:
- the state of the window
NETStrut strut | ( | self ) |
- Deprecated:
- use strutPartial() Returns the strut specified by this client.
- Returns:
- the strut of the window
Window transientFor | ( | self ) |
Returns the WM_TRANSIENT_FOR property for the window, i.e. the mainwindow for this window.
Time userTime | ( | self ) |
Returns the time of last user action on the window, or -1 if not set.
virtual_hook | ( | self, | ||
int | id, | |||
void | data | |||
) |
Virtual hook, used to add new "virtual" functions while maintaining binary compatibility. Unused in this class.
QString visibleIconName | ( | self ) |
Returns the visible iconic name as set by the window manager in UTF-8 format. Note that this has nothing to do with icons, but it's for "iconic" representations of the window (taskbars etc.), that should be shown when the window is in iconic state. See description of _NET_WM_VISIBLE_ICON_NAME for details.
- Returns:
- the visible iconic name
QString visibleName | ( | self ) |
Returns the visible name as set by the window manager in UTF-8 format.
- Returns:
- the visible name of the window
QString windowClassClass | ( | self ) |
Returns the class component of the window class for the window (i.e. WM_CLASS property).
QString windowClassName | ( | self ) |
Returns the name component of the window class for the window (i.e. WM_CLASS property).
QString windowRole | ( | self ) |
Returns the window role for the window (i.e. WM_WINDOW_ROLE property).
NET.WindowType windowType | ( | self, | ||
long | supported_types | |||
) |
Returns the window type for this client (see the NET base class documentation for a description of the various window types). Since clients may specify several windows types for a window in order to support backwards compatibility and extensions not available in the NETWM spec, you should specify all window types you application supports (see the NET.WindowTypeMask mask values for various window types). This method will return the first window type that is listed in the supported types, or NET.Unknown if none of the window types is supported.
- Returns:
- the type of the window
Attribute Documentation
int OnAllDesktops |
Sentinel value to indicate that the client wishes to be visible on all desktops.
- Returns:
- the value to be on all desktops
int OnAllDesktops |
Enumeration Documentation
anonymous |
Indexes for the properties array.
- Enumerator:
-
PROTOCOLS PROTOCOLS2 PROPERTIES_SIZE