Common API for application window properties/protocols.
More...
#include <netwm.h>
List of all members.
Public Types |
| enum | { PROTOCOLS,
PROTOCOLS2,
PROPERTIES_SIZE
} |
Public Member Functions |
| | NETWinInfo (Display *display, Window window, Window rootWindow, const unsigned long properties[], int properties_size, Role role=Client) |
| | NETWinInfo (Display *display, Window window, Window rootWindow, unsigned long properties, Role role=Client) |
| | NETWinInfo (const NETWinInfo &wininfo) |
| virtual | ~NETWinInfo () |
| const char * | activities () const |
| unsigned long | allowedActions () const |
| const char * | clientMachine () const |
| int | desktop (bool ignore_viewport=false) const |
| void | event (XEvent *event, unsigned long *properties, int properties_size) |
| unsigned long | event (XEvent *event) |
| NETExtendedStrut | extendedStrut () const |
| NETStrut | frameExtents () const |
| NETStrut | frameOverlap () const |
| Window | groupLeader () const |
| Bool | handledIcons () const |
| bool | hasNETSupport () const |
| bool | hasWindowType () const |
| NETIcon | icon (int width=-1, int height=-1) const |
| NETRect | iconGeometry () const |
| const char * | iconName () const |
| const int * | iconSizes () const |
| void | kdeGeometry (NETRect &frame, NETRect &window) |
| MappingState | mappingState () const |
| const char * | name () const |
| unsigned long | opacity () const |
| const NETWinInfo & | operator= (const NETWinInfo &wintinfo) |
| const unsigned long * | passedProperties () const |
| int | pid () const |
| void | setAllowedActions (unsigned long actions) |
| void | setDesktop (int desktop, bool ignore_viewport=false) |
| void | setExtendedStrut (const NETExtendedStrut &extended_strut) |
| void | setFrameExtents (NETStrut strut) |
| void | setFrameOverlap (NETStrut strut) |
| void | setHandledIcons (Bool handled) |
| void | setIcon (NETIcon icon, Bool replace=True) |
| void | setIconGeometry (NETRect geometry) |
| void | setIconName (const char *name) |
| void | setName (const char *name) |
| void | setOpacity (unsigned long opacity) |
| void | setPid (int pid) |
| void | setStartupId (const char *startup_id) |
| void | setState (unsigned long state, unsigned long mask) |
| void | setStrut (NETStrut strut) |
| void | setUserTime (Time time) |
| void | setVisibleIconName (const char *name) |
| void | setVisibleName (const char *visibleName) |
| void | setWindowType (WindowType type) |
| const char * | startupId () const |
| unsigned long | state () const |
| NETStrut | strut () const |
| Window | transientFor () const |
| Time | userTime () const |
| const char * | visibleIconName () const |
| const char * | visibleName () const |
| const char * | windowClassClass () const |
| const char * | windowClassName () const |
| const char * | windowRole () const |
| WindowType | windowType (unsigned long supported_types) const |
Static Public Attributes |
| static const int | OnAllDesktops = NET::OnAllDesktops |
Protected Member Functions |
| virtual void | changeDesktop (int desktop) |
| virtual void | changeState (unsigned long state, unsigned long mask) |
| virtual void | virtual_hook (int id, void *data) |
Detailed Description
Common API for application window properties/protocols.
The NETWinInfo class provides a common API for clients and window managers to set/read/change properties on an application window as defined by the NET Window Manager Specification.
- Author:
- Bradley T. Hughes <bhughes@trolltech.com>
- See also:
- NET
-
NETRootInfo
-
http://www.freedesktop.org/standards/wm-spec/
Definition at line 829 of file netwm.h.
Member Enumeration Documentation
Indexes for the properties array.
- Enumerator:
| PROTOCOLS |
|
| PROTOCOLS2 |
|
| PROPERTIES_SIZE |
|
Definition at line 835 of file netwm.h.
Constructor & Destructor Documentation
| NETWinInfo::NETWinInfo |
( |
Display * |
display, |
|
|
Window |
window, |
|
|
Window |
rootWindow, |
|
|
const unsigned long |
properties[], |
|
|
int |
properties_size, |
|
|
Role |
role = 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. |
Definition at line 2743 of file netwm.cpp.
| NETWinInfo::NETWinInfo |
( |
Display * |
display, |
|
|
Window |
window, |
|
|
Window |
rootWindow, |
|
|
unsigned long |
properties, |
|
|
Role |
role = 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.
Definition at line 2807 of file netwm.cpp.
| NETWinInfo::NETWinInfo |
( |
const NETWinInfo & |
wininfo | ) |
|
| NETWinInfo::~NETWinInfo |
( |
| ) |
[virtual] |
Member Function Documentation
| const char * NETWinInfo::activities |
( |
| ) |
const |
returns a comma-separated list of the activities the window is associated with.
FIXME this might be better as a NETRArray ?
- Since:
- 4.6
Definition at line 4660 of file netwm.cpp.
| unsigned long NETWinInfo::allowedActions |
( |
| ) |
const |
Returns actions that the window manager allows for the window.
Definition at line 4628 of file netwm.cpp.
| virtual void NETWinInfo::changeDesktop |
( |
int |
desktop | ) |
[inline, protected, virtual] |
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 |
Definition at line 1332 of file netwm.h.
| virtual void NETWinInfo::changeState |
( |
unsigned long |
state, |
|
|
unsigned long |
mask |
|
) |
| [inline, protected, virtual] |
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 |
Definition at line 1343 of file netwm.h.
| const char * NETWinInfo::clientMachine |
( |
| ) |
const |
Returns the client machine for the window (i.e.
WM_CLIENT_MACHINE property).
Definition at line 4656 of file netwm.cpp.
| int NETWinInfo::desktop |
( |
bool |
ignore_viewport = false | ) |
const |
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()
Definition at line 4606 of file netwm.cpp.
| void NETWinInfo::event |
( |
XEvent * |
event, |
|
|
unsigned 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 |
Definition at line 3678 of file netwm.cpp.
| unsigned long NETWinInfo::event |
( |
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:
-
- Returns:
- the properties
Definition at line 3671 of file netwm.cpp.
Returns the extended (partial) strut specified by this client.
See _NET_WM_STRUT_PARTIAL in the spec.
Definition at line 4533 of file netwm.cpp.
| NETStrut NETWinInfo::frameExtents |
( |
| ) |
const |
Returns the frame decoration strut, i.e.
the width of the decoration borders.
- Since:
- 4.3
Definition at line 3556 of file netwm.cpp.
| NETStrut NETWinInfo::frameOverlap |
( |
| ) |
const |
Returns the frame overlap strut, i.e.
how far the window frame extends behind the client area on each side.
- Since:
- 4.4
Definition at line 3580 of file netwm.cpp.
| Window NETWinInfo::groupLeader |
( |
| ) |
const |
Returns the leader window for the group the window is in, if any.
Definition at line 4640 of file netwm.cpp.
| Bool NETWinInfo::handledIcons |
( |
| ) |
const |
Returns whether or not this client handles icons.
- Returns:
- true if this client handles icons, false otherwise
Definition at line 4664 of file netwm.cpp.
| bool NETWinInfo::hasNETSupport |
( |
| ) |
const |
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
Definition at line 4632 of file netwm.cpp.
| bool NETWinInfo::hasWindowType |
( |
| ) |
const |
| NETIcon NETWinInfo::icon |
( |
int |
width = -1, |
|
|
int |
height = -1 |
|
) |
| const |
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
Definition at line 3609 of file netwm.cpp.
| NETRect NETWinInfo::iconGeometry |
( |
| ) |
const |
Returns the icon geometry.
- Returns:
- the geometry of the icon
Definition at line 4519 of file netwm.cpp.
| const char * NETWinInfo::iconName |
( |
| ) |
const |
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
Definition at line 4596 of file netwm.cpp.
| const int * NETWinInfo::iconSizes |
( |
| ) |
const |
Returns a list of provided icon sizes.
Each size is pair width,height, terminated with pair 0,0.
- Since:
- 4.3
Definition at line 3613 of file netwm.cpp.
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 |
Definition at line 3584 of file netwm.cpp.
Returns the mapping state for the window (see the NET base class documentation for a description of mapping state).
- Returns:
- the mapping state
Definition at line 4674 of file netwm.cpp.
| const char * NETWinInfo::name |
( |
| ) |
const |
Returns the name of the window in UTF-8 format.
- Returns:
- the name of the window
Definition at line 4586 of file netwm.cpp.
| unsigned long NETWinInfo::opacity |
( |
| ) |
const |
Returns the opacity of the window.
Definition at line 4624 of file netwm.cpp.
Assignment operator.
Ensures that the shared data reference counts are correct.
Definition at line 2892 of file netwm.cpp.
| const unsigned long * NETWinInfo::passedProperties |
( |
| ) |
const |
Returns the properties argument passed to the constructor.
The size is the maximum array size the constructor accepts.
Definition at line 4669 of file netwm.cpp.
| int NETWinInfo::pid |
( |
| ) |
const |
Returns the process id for the client window.
- Returns:
- the process id of the window
Definition at line 4612 of file netwm.cpp.
| void NETWinInfo::setAllowedActions |
( |
unsigned long |
actions | ) |
|
Sets actions that the window manager allows for the window.
Definition at line 3506 of file netwm.cpp.
| void NETWinInfo::setDesktop |
( |
int |
desktop, |
|
|
bool |
ignore_viewport = false |
|
) |
| |
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()
Definition at line 3421 of file netwm.cpp.
Set the extended (partial) strut for the application window.
- Parameters:
-
| extended_strut | the new strut |
Definition at line 2991 of file netwm.cpp.
| void NETWinInfo::setFrameExtents |
( |
NETStrut |
strut | ) |
|
Set the frame decoration strut, i.e.
the width of the decoration borders.
- Parameters:
-
Definition at line 3539 of file netwm.cpp.
| void NETWinInfo::setFrameOverlap |
( |
NETStrut |
strut | ) |
|
Sets the window frame overlap strut, i.e.
how far the window frame extends behind the client area on each side.
Set the strut values to -1 if you want the window frame to cover the whole client area.
The default values are 0.
- Since:
- 4.4
Definition at line 3560 of file netwm.cpp.
| void NETWinInfo::setHandledIcons |
( |
Bool |
handled | ) |
|
Set whether this application window handles icons.
- Parameters:
-
| handled | true if the window handles icons, false otherwise |
Definition at line 3479 of file netwm.cpp.
| void NETWinInfo::setIcon |
( |
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 |
Definition at line 2911 of file netwm.cpp.
| void NETWinInfo::setIconGeometry |
( |
NETRect |
geometry | ) |
|
Set the icon geometry for the application window.
- Parameters:
-
| geometry | the new icon geometry |
Definition at line 2971 of file netwm.cpp.
| void NETWinInfo::setIconName |
( |
const char * |
name | ) |
|
Sets the iconic name for the application window.
- Parameters:
-
Definition at line 3393 of file netwm.cpp.
| void NETWinInfo::setName |
( |
const char * |
name | ) |
|
Sets the name for the application window.
- Parameters:
-
| name | the new name of the window |
Definition at line 3365 of file netwm.cpp.
| void NETWinInfo::setOpacity |
( |
unsigned long |
opacity | ) |
|
Sets opacity (0 = transparent, 0xffffffff = opaque ) on the window.
Definition at line 3498 of file netwm.cpp.
| void NETWinInfo::setPid |
( |
int |
pid | ) |
|
Set the application window's process id.
- Parameters:
-
| pid | the window's process id |
Definition at line 3469 of file netwm.cpp.
| void NETWinInfo::setStartupId |
( |
const char * |
startup_id | ) |
|
Sets the startup notification id id on the window.
Definition at line 3488 of file netwm.cpp.
| void NETWinInfo::setState |
( |
unsigned long |
state, |
|
|
unsigned 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 |
Definition at line 3047 of file netwm.cpp.
| void NETWinInfo::setStrut |
( |
NETStrut |
strut | ) |
|
| void NETWinInfo::setUserTime |
( |
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.
Definition at line 3661 of file netwm.cpp.
| void NETWinInfo::setVisibleIconName |
( |
const char * |
name | ) |
|
For Window Managers only: set the visible iconic name ( i.e.
xterm, xterm <2>, xterm <3>, ... )
- Parameters:
-
| name | the new visible iconic name |
Definition at line 3407 of file netwm.cpp.
| void NETWinInfo::setVisibleName |
( |
const char * |
visibleName | ) |
|
For Window Managers only: set the visible name ( i.e.
xterm, xterm <2>, xterm <3>, ... )
- Parameters:
-
| visibleName | the new visible name |
Definition at line 3379 of file netwm.cpp.
Sets the window type for this client (see the NET base class documentation for a description of the various window types).
- Parameters:
-
Definition at line 3251 of file netwm.cpp.
| const char * NETWinInfo::startupId |
( |
| ) |
const |
Returns the startup notification id of the window.
Definition at line 4620 of file netwm.cpp.
| unsigned long NETWinInfo::state |
( |
| ) |
const |
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
Definition at line 4524 of file netwm.cpp.
- Deprecated:
- use strutPartial() Returns the strut specified by this client.
- Returns:
- the strut of the window
Definition at line 4529 of file netwm.cpp.
| Window NETWinInfo::transientFor |
( |
| ) |
const |
Returns the WM_TRANSIENT_FOR property for the window, i.e.
the mainwindow for this window.
Definition at line 4636 of file netwm.cpp.
| Time NETWinInfo::userTime |
( |
| ) |
const |
Returns the time of last user action on the window, or -1 if not set.
Definition at line 4616 of file netwm.cpp.
| void NETWinInfo::virtual_hook |
( |
int |
id, |
|
|
void * |
data |
|
) |
| [protected, virtual] |
Virtual hook, used to add new "virtual" functions while maintaining binary compatibility.
Unused in this class.
Definition at line 4681 of file netwm.cpp.
| const char * NETWinInfo::visibleIconName |
( |
| ) |
const |
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
Definition at line 4601 of file netwm.cpp.
| const char * NETWinInfo::visibleName |
( |
| ) |
const |
Returns the visible name as set by the window manager in UTF-8 format.
- Returns:
- the visible name of the window
Definition at line 4591 of file netwm.cpp.
| const char * NETWinInfo::windowClassClass |
( |
| ) |
const |
Returns the class component of the window class for the window (i.e.
WM_CLASS property).
Definition at line 4644 of file netwm.cpp.
| const char * NETWinInfo::windowClassName |
( |
| ) |
const |
Returns the name component of the window class for the window (i.e.
WM_CLASS property).
Definition at line 4648 of file netwm.cpp.
| const char * NETWinInfo::windowRole |
( |
| ) |
const |
Returns the window role for the window (i.e.
WM_WINDOW_ROLE property).
Definition at line 4652 of file netwm.cpp.
| NET::WindowType NETWinInfo::windowType |
( |
unsigned long |
supported_types | ) |
const |
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
Definition at line 4571 of file netwm.cpp.
Member Data Documentation
Sentinel value to indicate that the client wishes to be visible on all desktops.
- Returns:
- the value to be on all desktops
Reimplemented from NET.
Definition at line 1322 of file netwm.h.
The documentation for this class was generated from the following files: