Manual Pages for Linux CentOS command on man xcb_get_property_unchecked
MyWebUniversity

Manual Pages for Linux CentOS command on man xcb_get_property_unchecked

xcbgetproperty(3) XCB Requests xcbgetproperty(3)

NAME

xcbgetproperty - Gets a window property SYNOPSIS

#include Request function xcbgetpropertycookiet xcbgetproperty(xcbconnectiont *conn, uint8t delete, xcbwindowt window, xcbatomt property, xcbatomt type, uint32t longoffset, uint32t longlength); Reply datastructure typedef struct xcbgetpropertyreplyt { uint8t responsetype; uint8t format; uint16t sequence; uint32t length; xcbatomt type; uint32t bytesafter; uint32t valuelen; uint8t pad0[12]; } xcbgetpropertyreplyt; Reply function xcbgetpropertyreplyt *xcbgetpropertyreply(xcbconnectiont *conn, xcbgetpropertycookiet cookie, xcbgenericerrort **e); Reply accessors void *xcbgetpropertyvalue(const xcbgetpropertyrequestt *reply); int xcbgetpropertyvaluelength(const xcbgetpropertyreplyt *reply); xcbgenericiteratort xcbgetpropertyvalueend(const xcbgetpropertyreplyt *reply); REQUEST ARGUMENTS conn The XCB connection to X11. delete Whether the property should actually be deleted. For deleting a property, the specified type has to match the actual prop‐ erty type. window The window whose property you want to get. property The property you want to get (an atom). type The type of the property you want to get (an atom). longoffset

Specifies the offset (in 32-bit multiples) in the specified property where the data is to be retrieved. longlength

Specifies how many 32-bit multiples of data should be re‐ trieved (e.g. if you set longlength to 4, you will receive 16 bytes of data). REPLY FIELDS responsetype The type of this reply, in this case XCBGETPROPERTY. This field is also present in the xcbgenericreplyt and can be used to tell replies apart from each other. sequence The sequence number of the last request processed by the X11 server. length The length of the reply, in words (a word is 4 bytes). format Specifies whether the data should be viewed as a list of

8-bit, 16-bit, or 32-bit quantities. Possible values are 8, 16, and 32. This information allows the X server to correctly

perform byte-swap operations as necessary. type The actual type of the property (an atom). bytesafter The number of bytes remaining to be read in the property if a partial read was performed. valuelen The length of value. You should use the corresponding acces‐ sor instead of this field. DESCRIPTION Gets the specified property from the specified window. Properties are for example the window title (WMNAME) or its minimum size (WMNOR‐

MALHINTS). Protocols such as EWMH also use properties - for example

EWMH defines the window title, encoded as UTF-8 string, in the NETWMNAME property. TODO: talk about type TODO: talk about delete TODO: talk about the offset/length thing. what's a valid use case? RETURN VALUE Returns an xcbgetpropertycookiet. Errors have to be handled when calling the reply function xcbgetpropertyreply. If you want to handle errors in the event loop instead, use

xcbgetpropertyunchecked. See xcb-requests(3) for details. ERRORS xcbatomerrort property or type do not refer to a valid atom. xcbvalueerrort The specified longoffset is beyond the actual property length (e.g. the property has a length of 3 bytes and you are setting longoffset to 1, resulting in a byte offset of 4). xcbwindowerrort The specified window does not exist. EXAMPLE /* * Prints the WMNAME property of the window. * */ void myexample(xcbconnectiont *c, xcbwindowt window) { xcbgetpropertycookiet cookie; xcbgetpropertyreplyt *reply; /* These atoms are predefined in the X11 protocol. */ xcbatomt property = XCBATOMWMNAME; xcbatomt type = XCBATOMSTRING; // TODO: a reasonable longlength for WMNAME? cookie = xcbgetproperty(c, 0, window, property, type, 0, 0); if ((reply = xcbgetpropertyreply(c, cookie, NULL))) { int len = xcbgetpropertyvaluelength(reply); if (len == 0) { printf("TODO\n"); free(reply); return; }

printf("WMNAME is %.*s\n", len, (char*)xcbgetpropertyvalue(reply)); } free(reply); } SEE ALSO

xcb-requests(3), xcb-examples(3), xcbinternatom(3), xprop(1) AUTHOR Generated from xproto.xml. Contact xcb@lists.freedesktop.org for cor‐ rections and improvements. X Version 11 libxcb 1.13 xcbgetproperty(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™