xcb_get_property - Online Linux Manual PageSection : 3
Updated : libxcb 1.13.1
Source : X Version 11
Note : XCB Requests

NAMExcb_get_property − Gets a window property

SYNOPSIS#include <xcb/xproto.h>

Request functionxcb_get_property_cookie_t xcb_get_property(xcb_connection_t *conn, uint8_t _delete, xcb_window_t window, xcb_atom_t property, xcb_atom_t type, uint32_t long_offset, uint32_t long_length);

Reply datastructuretypedef struct xcb_get_property_reply_t { uint8_t response_type; uint8_t format; uint16_t sequence; uint32_t length; xcb_atom_t type; uint32_t bytes_after; uint32_t value_len; uint8_t pad0[12]; } xcb_get_property_reply_t;

Reply functionxcb_get_property_reply_t *xcb_get_property_reply(xcb_connection_t *conn, xcb_get_property_cookie_t cookie, xcb_generic_error_t **e);

Reply accessorsvoid *xcb_get_property_value(const xcb_get_property_request_t *reply); int xcb_get_property_value_length(const xcb_get_property_reply_t *reply); xcb_generic_iterator_t xcb_get_property_value_end(const xcb_get_property_reply_t *reply);

REQUEST ARGUMENTSconn 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 property 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). long_offset Specifies the offset (in 32-bit multiples) in the specified property where the data is to be retrieved. long_length Specifies how many 32-bit multiples of data should be retrieved (e.g. if you set long_length to 4, you will receive 16 bytes of data).

REPLY FIELDSresponse_type The type of this reply, in this case XCB_GET_PROPERTY. This field is also present in the xcb_generic_reply_t 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). bytes_after The number of bytes remaining to be read in the property if a partial read was performed. value_len The length of value. You should use the corresponding accessor instead of this field.

DESCRIPTIONGets the specified property from the specified window. Properties are for example the window title (WM_NAME) or its minimum size (WM_NORMAL_HINTS). Protocols such as EWMH also use properties - for example EWMH defines the window title, encoded as UTF-8 string, in the _NET_WM_NAME property. TODO: talk about type TODO: talk about delete TODO: talk about the offset/length thing. what's a valid use case?

RETURN VALUEReturns an xcb_get_property_cookie_t. Errors have to be handled when calling the reply function xcb_get_property_reply. If you want to handle errors in the event loop instead, use xcb_get_property_unchecked. See xcb-requests(3) for details.

ERRORSxcb_atom_error_t property or type do not refer to a valid atom. xcb_value_error_t The specified long_offset is beyond the actual property length (e.g. the property has a length of 3 bytes and you are setting long_offset to 1, resulting in a byte offset of 4). xcb_window_error_t The specified window does not exist.

EXAMPLE/* * Prints the WM_NAME property of the window. * */ void my_example(xcb_connection_t *c, xcb_window_t window) { xcb_get_property_cookie_t cookie; xcb_get_property_reply_t *reply; /* These atoms are predefined in the X11 protocol. */ xcb_atom_t property = XCB_ATOM_WM_NAME; xcb_atom_t type = XCB_ATOM_STRING; // TODO: a reasonable long_length for WM_NAME? cookie = xcb_get_property(c, 0, window, property, type, 0, 0); if ((reply = xcb_get_property_reply(c, cookie, NULL))) { int len = xcb_get_property_value_length(reply); if (len == 0) { printf("TODO\n"); free(reply); return; } printf("WM_NAME is %.*s\n", len, (char*)xcb_get_property_value(reply)); } free(reply); }

SEE ALSOxcb-requests(3), xcb-examples(3), xcb_intern_atom(3), xprop(1)

AUTHORGenerated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.
0
Johanes Gumabo
Data Size   :   19,820 byte
man-xcb_get_property_reply.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 236,800
Visitor ID   :     :  
Visitor IP   :   3.149.29.190   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (rof_nr_x|149|xcb_get_property.3|119|\n");| printf("TODO\\n"); )         (rof_nr_x|149|xcb_get_property.3|123|\n", len,| printf("WM_NAME is %.*s\\n", len, )