home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / X11 / XGetWindowProperty.z / XGetWindowProperty
Encoding:
Text File  |  1998-10-30  |  19.2 KB  |  397 lines

  1.  
  2.  
  3.  
  4.      XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XGetWindowProperty, XListProperties, XChangeProperty,
  10.           XRotateWindowProperties, XDeleteProperty - obtain and change
  11.           window properties
  12.  
  13.      SSSSYYYYNNNNTTTTAAAAXXXX
  14.           int XGetWindowProperty(_d_i_s_p_l_a_y, _w, _p_r_o_p_e_r_t_y, _l_o_n_g__o_f_f_s_e_t,
  15.           _l_o_n_g__l_e_n_g_t_h, _d_e_l_e_t_e, _r_e_q__t_y_p_e,
  16.                                   _a_c_t_u_a_l__t_y_p_e__r_e_t_u_r_n,
  17.           _a_c_t_u_a_l__f_o_r_m_a_t__r_e_t_u_r_n, _n_i_t_e_m_s__r_e_t_u_r_n, _b_y_t_e_s__a_f_t_e_r__r_e_t_u_r_n,
  18.                                   _p_r_o_p__r_e_t_u_r_n)
  19.                 Display *_d_i_s_p_l_a_y;
  20.                 Window _w;
  21.                 Atom _p_r_o_p_e_r_t_y;
  22.                 long _l_o_n_g__o_f_f_s_e_t, _l_o_n_g__l_e_n_g_t_h;
  23.                 Bool _d_e_l_e_t_e;
  24.                 Atom _r_e_q__t_y_p_e;
  25.                 Atom *_a_c_t_u_a_l__t_y_p_e__r_e_t_u_r_n;
  26.                 int *_a_c_t_u_a_l__f_o_r_m_a_t__r_e_t_u_r_n;
  27.                 unsigned long *_n_i_t_e_m_s__r_e_t_u_r_n;
  28.                 unsigned long *_b_y_t_e_s__a_f_t_e_r__r_e_t_u_r_n;
  29.                 unsigned char **_p_r_o_p__r_e_t_u_r_n;
  30.  
  31.           Atom *XListProperties(_d_i_s_p_l_a_y, _w, _n_u_m__p_r_o_p__r_e_t_u_r_n)
  32.                 Display *_d_i_s_p_l_a_y;
  33.                 Window _w;
  34.                 int *_n_u_m__p_r_o_p__r_e_t_u_r_n;
  35.  
  36.           XChangeProperty(_d_i_s_p_l_a_y, _w, _p_r_o_p_e_r_t_y, _t_y_p_e, _f_o_r_m_a_t, _m_o_d_e,
  37.           _d_a_t_a, _n_e_l_e_m_e_n_t_s)
  38.                 Display *_d_i_s_p_l_a_y;
  39.                 Window _w;
  40.                 Atom _p_r_o_p_e_r_t_y, _t_y_p_e;
  41.                 int _f_o_r_m_a_t;
  42.                 int _m_o_d_e;
  43.                 unsigned char *_d_a_t_a;
  44.                 int _n_e_l_e_m_e_n_t_s;
  45.  
  46.           XRotateWindowProperties(_d_i_s_p_l_a_y, _w, _p_r_o_p_e_r_t_i_e_s, _n_u_m__p_r_o_p,
  47.           _n_p_o_s_i_t_i_o_n_s)
  48.                 Display *_d_i_s_p_l_a_y;
  49.                 Window _w;
  50.                 Atom _p_r_o_p_e_r_t_i_e_s[];
  51.                 int _n_u_m__p_r_o_p;
  52.                 int _n_p_o_s_i_t_i_o_n_s;
  53.  
  54.           XDeleteProperty(_d_i_s_p_l_a_y, _w, _p_r_o_p_e_r_t_y)
  55.                 Display *_d_i_s_p_l_a_y;
  56.                 Window _w;
  57.                 Atom _p_r_o_p_e_r_t_y;
  58.  
  59.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  60.  
  61.  
  62.  
  63.      PPPPaaaaggggeeee 1111                                          ((((pppprrrriiiinnnntttteeeedddd 4444////33330000////99998888))))
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.           _a_c_t_u_a_l__f_o_r_m_a_t__r_e_t_u_r_n
  75.                     Returns the actual format of the property.
  76.  
  77.           _a_c_t_u_a_l__t_y_p_e__r_e_t_u_r_n
  78.                     Returns the atom identifier  that defines the
  79.                     actual type of the property.
  80.  
  81.           _b_y_t_e_s__a_f_t_e_r__r_e_t_u_r_n
  82.                     Returns the number of bytes remaining to be read
  83.                     in the property if a partial read was performed.
  84.  
  85.           _d_a_t_a      Specifies the property data.
  86.  
  87.           _d_e_l_e_t_e    Specifies a Boolean value that determines whether
  88.                     the property is deleted.
  89.  
  90.           _d_i_s_p_l_a_y   Specifies the connection to the X server.
  91.  
  92.           _f_o_r_m_a_t    Specifies whether the data should be viewed as a
  93.                     list of 8-bit, 16-bit, or 32-bit quantities.
  94.                     Possible values are 8, 16, and 32.  This
  95.                     information allows the X server to correctly
  96.                     perform byte-swap operations as necessary.  If the
  97.                     format is 16-bit or 32-bit, you must explicitly
  98.                     cast your data pointer to an (unsigned char *) in
  99.                     the call to _X_C_h_a_n_g_e_P_r_o_p_e_r_t_y.
  100.  
  101.           _l_o_n_g__l_e_n_g_t_h
  102.                     Specifies the length in 32-bit multiples of the
  103.                     data to be retrieved.
  104.  
  105.           _l_o_n_g__o_f_f_s_e_t
  106.                     Specifies the offset in the specified property (in
  107.                     32-bit quantities) where the data is to be
  108.                     retrieved.
  109.  
  110.           _m_o_d_e      Specifies the mode of the operation.  You can pass
  111.                     _P_r_o_p_M_o_d_e_R_e_p_l_a_c_e, _P_r_o_p_M_o_d_e_P_r_e_p_e_n_d, or
  112.                     _P_r_o_p_M_o_d_e_A_p_p_e_n_d.
  113.  
  114.           _n_e_l_e_m_e_n_t_s Specifies the number of elements of the specified
  115.                     data format.
  116.  
  117.           _n_i_t_e_m_s__r_e_t_u_r_n
  118.                     Returns the actual number of 8-bit, 16-bit, or
  119.                     32-bit items stored in the prop_return data.
  120.  
  121.           _n_u_m__p_r_o_p  Specifies the length of the properties array.
  122.  
  123.           _n_u_m__p_r_o_p__r_e_t_u_r_n
  124.                     Returns the length of the properties array.
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.           _n_p_o_s_i_t_i_o_n_s
  141.                     Specifies the rotation amount.
  142.  
  143.           _p_r_o_p__r_e_t_u_r_n
  144.                     Returns the data in the specified format.
  145.  
  146.           _p_r_o_p_e_r_t_y  Specifies the property name.
  147.  
  148.           _p_r_o_p_e_r_t_i_e_s
  149.                     Specifies the array of properties that are to be
  150.                     rotated.
  151.  
  152.           _r_e_q__t_y_p_e  Specifies the atom identifier associated with the
  153.                     property type or _A_n_y_P_r_o_p_e_r_t_y_T_y_p_e.
  154.  
  155.           _t_y_p_e      Specifies the type of the property.  The X server
  156.                     does not interpret the type but simply passes it
  157.                     back to an application that later calls
  158.                     _X_G_e_t_W_i_n_d_o_w_P_r_o_p_e_r_t_y.
  159.  
  160.           _w         Specifies the window whose property you want to
  161.                     obtain, change, rotate or delete.
  162.  
  163.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  164.           The _X_G_e_t_W_i_n_d_o_w_P_r_o_p_e_r_t_y function returns the actual type of
  165.           the property; the actual format of the property; the number
  166.           of 8-bit, 16-bit, or 32-bit items transferred; the number of
  167.           bytes remaining to be read in the property; and a pointer to
  168.           the data actually returned.  _X_G_e_t_W_i_n_d_o_w_P_r_o_p_e_r_t_y sets the
  169.           return arguments as follows:
  170.  
  171.           +o    If the specified property does not exist for the
  172.                specified window, _X_G_e_t_W_i_n_d_o_w_P_r_o_p_e_r_t_y returns _N_o_n_e to
  173.                actual_type_return and the value zero to
  174.                actual_format_return and bytes_after_return.  The
  175.                nitems_return argument is empty.  In this case, the
  176.                delete argument is ignored.
  177.  
  178.           +o    If the specified property exists but its type does not
  179.                match the specified type, _X_G_e_t_W_i_n_d_o_w_P_r_o_p_e_r_t_y returns
  180.                the actual property type to actual_type_return, the
  181.                actual property format (never zero) to
  182.                actual_format_return, and the property length in bytes
  183.                (even if the actual_format_return is 16 or 32) to
  184.                bytes_after_return.  It also ignores the delete
  185.                argument.  The nitems_return argument is empty.
  186.  
  187.           +o    If the specified property exists and either you assign
  188.                _A_n_y_P_r_o_p_e_r_t_y_T_y_p_e to the req_type argument or the
  189.                specified type matches the actual property type,
  190.                _X_G_e_t_W_i_n_d_o_w_P_r_o_p_e_r_t_y returns the actual property type to
  191.                actual_type_return and the actual property format
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 4/30/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))
  203.  
  204.  
  205.  
  206.                (never zero) to actual_format_return. It also returns a
  207.                value to bytes_after_return and nitems_return, by
  208.                defining the following values:
  209.  
  210.  
  211.                     N = actual length of the stored property in bytes
  212.                          (even if the format is 16 or 32)
  213.                     I = 4 * long_offset
  214.                     T = N - I
  215.                     L = MINIMUM(T, 4 * long_length)
  216.                     A = N - (I + L)
  217.  
  218.                The returned value starts at byte index I in the
  219.                property (indexing from zero), and its length in bytes
  220.                is L.  If the value for long_offset causes L to be
  221.                negative, a _B_a_d_V_a_l_u_e error results. The value of
  222.                bytes_after_return is A, giving the number of trailing
  223.                unread bytes in the stored property.
  224.  
  225.           If the returned format is 8, the returned data is
  226.           represented as a _c_h_a_r array.  If the returned format is 16,
  227.           the returned data is represented as a _s_h_o_r_t array and should
  228.           be cast to that type to obtain the elements.  If the
  229.           returned format is 32, the returned data is represented as a
  230.           _l_o_n_g array and should be cast to that type to obtain the
  231.           elements.
  232.  
  233.           _X_G_e_t_W_i_n_d_o_w_P_r_o_p_e_r_t_y always allocates one extra byte in
  234.           prop_return (even if the property is zero length) and sets
  235.           it to zero so that simple properties consisting of
  236.           characters do not have to be copied into yet another string
  237.           before use.
  238.  
  239.           If delete is _T_r_u_e and bytes_after_return is zero,
  240.           _X_G_e_t_W_i_n_d_o_w_P_r_o_p_e_r_t_y deletes the property from the window and
  241.           generates a _P_r_o_p_e_r_t_y_N_o_t_i_f_y event on the window.
  242.  
  243.           The function returns _S_u_c_c_e_s_s if it executes successfully.
  244.           To free the resulting data, use _X_F_r_e_e.
  245.  
  246.           _X_G_e_t_W_i_n_d_o_w_P_r_o_p_e_r_t_y can generate _B_a_d_A_t_o_m, _B_a_d_V_a_l_u_e, and
  247.           _B_a_d_W_i_n_d_o_w errors.
  248.  
  249.           The _X_L_i_s_t_P_r_o_p_e_r_t_i_e_s function returns a pointer to an array
  250.           of atom properties that are defined for the specified window
  251.           or returns NULL if no properties were found.  To free the
  252.           memory allocated by this function, use _X_F_r_e_e.
  253.  
  254.           _X_L_i_s_t_P_r_o_p_e_r_t_i_e_s can generate a _B_a_d_W_i_n_d_o_w error.
  255.  
  256.           The _X_C_h_a_n_g_e_P_r_o_p_e_r_t_y function alters the property for the
  257.           specified window and causes the X server to generate a
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 4/30/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))
  269.  
  270.  
  271.  
  272.           _P_r_o_p_e_r_t_y_N_o_t_i_f_y event on that window.  _X_C_h_a_n_g_e_P_r_o_p_e_r_t_y
  273.           performs the following:
  274.  
  275.           +o    If mode is _P_r_o_p_M_o_d_e_R_e_p_l_a_c_e, _X_C_h_a_n_g_e_P_r_o_p_e_r_t_y discards
  276.                the previous property value and stores the new data.
  277.  
  278.           +o    If mode is _P_r_o_p_M_o_d_e_P_r_e_p_e_n_d or _P_r_o_p_M_o_d_e_A_p_p_e_n_d,
  279.                _X_C_h_a_n_g_e_P_r_o_p_e_r_t_y inserts the specified data before the
  280.                beginning of the existing data or onto the end of the
  281.                existing data, respectively.  The type and format must
  282.                match the existing property value, or a _B_a_d_M_a_t_c_h error
  283.                results.  If the property is undefined, it is treated
  284.                as defined with the correct type and format with zero-
  285.                length data.
  286.  
  287.           If the specified format is 8, the property data must be a
  288.           _c_h_a_r array.  If the specified format is 16, the property
  289.           data must be a _s_h_o_r_t array.  If the specified format is 32,
  290.           the property data must be a _l_o_n_g array.
  291.  
  292.           The lifetime of a property is not tied to the storing
  293.           client.  Properties remain until explicitly deleted, until
  294.           the window is destroyed, or until the server resets.  For a
  295.           discussion of what happens when the connection to the X
  296.           server is closed, see section 2.6. The maximum size of a
  297.           property is server dependent and can vary dynamically
  298.           depending on the amount of memory the server has available.
  299.           (If there is insufficient space, a _B_a_d_A_l_l_o_c error results.)
  300.  
  301.           _X_C_h_a_n_g_e_P_r_o_p_e_r_t_y can generate _B_a_d_A_l_l_o_c, _B_a_d_A_t_o_m, _B_a_d_M_a_t_c_h,
  302.           _B_a_d_V_a_l_u_e, and _B_a_d_W_i_n_d_o_w errors.
  303.  
  304.           The _X_R_o_t_a_t_e_W_i_n_d_o_w_P_r_o_p_e_r_t_i_e_s function allows you to rotate
  305.           properties on a window and causes the X server to generate
  306.           _P_r_o_p_e_r_t_y_N_o_t_i_f_y events.  If the property names in the
  307.           properties array are viewed as being numbered starting from
  308.           zero and if there are num_prop property names in the list,
  309.           then the value associated with property name I becomes the
  310.           value associated with property name (I + npositions) mod N
  311.           for all I from zero to N - 1.  The effect is to rotate the
  312.           states by npositions places around the virtual ring of
  313.           property names (right for positive npositions, left for
  314.           negative npositions).  If npositions mod N is nonzero, the X
  315.           server generates a _P_r_o_p_e_r_t_y_N_o_t_i_f_y event for each property in
  316.           the order that they are listed in the array.  If an atom
  317.           occurs more than once in the list or no property with that
  318.           name is defined for the window, a _B_a_d_M_a_t_c_h error results.
  319.           If a _B_a_d_A_t_o_m or _B_a_d_M_a_t_c_h error results, no properties are
  320.           changed.
  321.  
  322.           _X_R_o_t_a_t_e_W_i_n_d_o_w_P_r_o_p_e_r_t_i_e_s can generate _B_a_d_A_t_o_m, _B_a_d_M_a_t_c_h, and
  323.           _B_a_d_W_i_n_d_o_w errors.
  324.  
  325.  
  326.  
  327.      Page 5                                          (printed 4/30/98)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXGGGGeeeettttWWWWiiiinnnnddddoooowwwwPPPPrrrrooooppppeeeerrrrttttyyyy((((3333XXXX11111111))))
  335.  
  336.  
  337.  
  338.           The _X_D_e_l_e_t_e_P_r_o_p_e_r_t_y function deletes the specified property
  339.           only if the property was defined on the specified window and
  340.           causes the X server to generate a _P_r_o_p_e_r_t_y_N_o_t_i_f_y event on
  341.           the window unless the property does not exist.
  342.  
  343.           _X_D_e_l_e_t_e_P_r_o_p_e_r_t_y can generate _B_a_d_A_t_o_m and _B_a_d_W_i_n_d_o_w errors.
  344.  
  345.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  346.           _B_a_d_A_l_l_o_c  The server failed to allocate the requested
  347.                     resource or server memory.
  348.  
  349.           _B_a_d_A_t_o_m   A value for an Atom argument does not name a
  350.                     defined Atom.
  351.  
  352.           _B_a_d_V_a_l_u_e  Some numeric value falls outside the range of
  353.                     values accepted by the request.  Unless a specific
  354.                     range is specified for an argument, the full range
  355.                     defined by the argument's type is accepted.  Any
  356.                     argument defined as a set of alternatives can
  357.                     generate this error.
  358.  
  359.           _B_a_d_W_i_n_d_o_w A value for a Window argument does not name a
  360.                     defined Window.
  361.  
  362.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  363.           XFree(3X11), XInternAtom(3X11)
  364.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.      Page 6                                          (printed 4/30/98)
  394.  
  395.  
  396.  
  397.