home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xchangeproperty.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  14.4 KB  |  397 lines

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