NETWinInfo Class Reference
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 |
unsigned long | allowedActions () const |
const char * | clientMachine () const |
int | desktop (bool ignore_viewport=false) const |
unsigned long | event (XEvent *event) |
void | event (XEvent *event, unsigned long *properties, int properties_size) |
NETExtendedStrut | extendedStrut () const |
NETStrut | frameExtents () 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 |
void | kdeGeometry (NETRect &frame, NETRect &window) |
MappingState | mappingState () const |
const char * | name () const |
| NETWinInfo (const NETWinInfo &wininfo) |
| NETWinInfo (Display *display, Window window, Window rootWindow, unsigned long properties, Role role=Client) |
| NETWinInfo (Display *display, Window window, Window rootWindow, const unsigned long properties[], int properties_size, Role role=Client) |
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 | 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 |
virtual | ~NETWinInfo () |
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 795 of file netwm.h.
Member Enumeration Documentation
Indexes for the properties array.
- Enumerator:
-
PROTOCOLS |
|
PROTOCOLS2 |
|
PROPERTIES_SIZE |
|
Definition at line 801 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 2641 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 2703 of file netwm.cpp.
NETWinInfo::NETWinInfo |
( |
const NETWinInfo & |
wininfo |
) |
|
NETWinInfo::~NETWinInfo |
( |
|
) |
[virtual] |
Member Function Documentation
unsigned long NETWinInfo::allowedActions |
( |
|
) |
const |
Returns actions that the window manager allows for the window.
Definition at line 4439 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 1263 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 1274 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 4467 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 4417 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 3524 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 3531 of file netwm.cpp.
Returns the extended (partial) strut specified by this client.
See _NET_WM_STRUT_PARTIAL in the spec.
Definition at line 4344 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 3448 of file netwm.cpp.
Window NETWinInfo::groupLeader |
( |
|
) |
const |
Returns the leader window for the group the window is in, if any.
Definition at line 4451 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 4471 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 4443 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 3477 of file netwm.cpp.
NETRect NETWinInfo::iconGeometry |
( |
|
) |
const |
Returns the icon geometry.
- Returns:
- the geometry of the icon
Definition at line 4330 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 4407 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 3452 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 4481 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 4397 of file netwm.cpp.
unsigned long NETWinInfo::opacity |
( |
|
) |
const |
Returns the opacity of the window.
Definition at line 4435 of file netwm.cpp.
Assignment operator.
Ensures that the shared data reference counts are correct.
Definition at line 2786 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 4476 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 4423 of file netwm.cpp.
void NETWinInfo::setAllowedActions |
( |
unsigned long |
actions |
) |
|
Sets actions that the window manager allows for the window.
Definition at line 3398 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 3313 of file netwm.cpp.
Set the extended (partial) strut for the application window.
- Parameters:
-
| extended_strut | the new strut |
Definition at line 2883 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 3431 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 3371 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 2805 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 2863 of file netwm.cpp.
void NETWinInfo::setIconName |
( |
const char * |
name |
) |
|
Sets the iconic name for the application window.
- Parameters:
-
Definition at line 3285 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 3257 of file netwm.cpp.
void NETWinInfo::setOpacity |
( |
unsigned long |
opacity |
) |
|
Sets opacity (0 = transparent, 0xffffffff = opaque ) on the window.
Definition at line 3390 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 3361 of file netwm.cpp.
void NETWinInfo::setStartupId |
( |
const char * |
startup_id |
) |
|
Sets the startup notification id id
on the window.
Definition at line 3380 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 2939 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 3514 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 3299 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 3271 of file netwm.cpp.
void NETWinInfo::setWindowType |
( |
WindowType |
type |
) |
|
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 3143 of file netwm.cpp.
const char * NETWinInfo::startupId |
( |
|
) |
const |
Returns the startup notification id of the window.
Definition at line 4431 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 4335 of file netwm.cpp.
- Deprecated:
- use strutPartial() Returns the strut specified by this client.
- Returns:
- the strut of the window
Definition at line 4340 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 4447 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 4427 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 4488 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 4412 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 4402 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 4455 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 4459 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 4463 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 4382 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 1253 of file netwm.h.
The documentation for this class was generated from the following files: