XcmsStoreColor(3X11) AIX (XLIB FUNCTIONS) XcmsStoreColor(3X11) NAME XcmsStoreColor, XcmsStoreColors - set colors SYNTAX Status XcmsStoreColor(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _c_o_l_o_r) Display *_d_i_s_p_l_a_y; Colormap _c_o_l_o_r_m_a_p; XcmsColor *_c_o_l_o_r; Status XcmsStoreColors(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p, _c_o_l_o_r_s, _n_c_o_l_o_r_s, _c_o_m_p_r_e_s_s_i_o_n__f_l_a_g_s__r_e_t_u_r_n) Display *_d_i_s_p_l_a_y; Colormap _c_o_l_o_r_m_a_p; XcmsColor _c_o_l_o_r_s[]; int _n_c_o_l_o_r_s; Bool _c_o_m_p_r_e_s_s_i_o_n__f_l_a_g_s__r_e_t_u_r_n[]; ARGUMENTS _d_i_s_p_l_a_y Specifies the connection to the X server. _c_o_l_o_r Specifies the color cell and the color to store. Values specified in this _X_c_m_s_C_o_l_o_r structure remain unchanged upon return. _c_o_l_o_r_s Specifies the color specification array of _X_c_m_s_C_o_l_o_r structures, each specifying a color cell and the color to store in that cell. Values specified in the array remain unchanged upon return. _c_o_l_o_r_m_a_p Specifies the colormap. _c_o_m_p_r_e_s_s_i_o_n__f_l_a_g_s__r_e_t_u_r_n Specifies an array of Boolean values (or NULL) for returned information that indicates if the color was compressed. For example, if this routine returns _X_c_m_s_S_u_c_c_e_s_s_W_i_t_h_C_o_m_p_r_e_s_s_i_o_n and compression_flags_return[3] is _T_r_u_e, this indi- cates that the fourth color specified in the color specification array was compressed. If you are not interested in knowing which color was compressed when the return value is _X_c_m_s_S_u_c_- _c_e_s_s_W_i_t_h_C_o_m_p_r_e_s_s_i_o_n, then pass a NULL. Otherwise, allocate an array of Boolean values for each ele- ment in the color definition array and pass its address. _n_c_o_l_o_r_s Specifies the number of _X_c_m_s_C_o_l_o_r structures in the color specification array. DESCRIPTION The _X_c_m_s_S_t_o_r_e_C_o_l_o_r function converts the color specified in the _X_c_m_s_C_o_l_o_r structure into RGB values and then uses this Rev. Release 5 Page 1 XcmsStoreColor(3X11) AIX (XLIB FUNCTIONS) XcmsStoreColor(3X11) RGB specification in an _X_C_o_l_o_r structure, whose three flags (_D_o_R_e_d, _D_o_G_r_e_e_n, and _D_o_B_l_u_e) are set, in a call to _X_S_t_o_r_e_C_o_l_o_r to change the color cell specified by the pixel member of the _X_c_m_s_C_o_l_o_r structure. This pixel value must be a valid index for the specified colormap, and the color cell specified by the pixel value must be a read/write cell. If the pixel value is not a valid index, a _B_a_d_V_a_l_u_e error results. If the color cell is unallocated or is allocated read-only, a _B_a_d_A_c_c_e_s_s error results. If the colormap is an installed map for its screen, the changes are visible immediately. Note that _X_S_t_o_r_e_C_o_l_o_r has no return value; therefore, a _X_c_m_s_S_u_c_c_e_s_s return value from this function indicates that the conversion to RGB succeeded and the call to _X_S_t_o_r_e_C_o_l_o_r was made. To obtain the actual color stored, use _X_c_m_s_Q_u_e_r_y_C_o_l_o_r. Due to the screen's hardware limitations or gamut compression, the color stored in the colormap may not be identical to the color specified. _X_c_m_s_S_t_o_r_e_C_o_l_o_r can generate _B_a_d_A_c_c_e_s_s, _B_a_d_C_o_l_o_r, and _B_a_d_- _V_a_l_u_e errors. The _X_c_m_s_S_t_o_r_e_C_o_l_o_r_s function converts the colors specified in the array of _X_c_m_s_C_o_l_o_r structures into RGB values and then uses these RGB specifications in an _X_C_o_l_o_r structures, whose three flags (_D_o_R_e_d, _D_o_G_r_e_e_n, and _D_o_B_l_u_e) are set, in a call to _X_S_t_o_r_e_C_o_l_o_r_s to change the color cells specified by the pixel member of the corresponding _X_c_m_s_C_o_l_o_r structure. Each pixel value must be a valid index for the specified colormap, and the color cell specified by each pixel value must be a read/write cell. If a pixel value is not a valid index, a _B_a_d_V_a_l_u_e error results. If a color cell is unallo- cated or is allocated read-only, a _B_a_d_A_c_c_e_s_s error results. If more than one pixel is in error, the one that gets reported is arbitrary. If the colormap is an installed map for its screen, the changes are visible immediately. Note that _X_S_t_o_r_e_C_o_l_o_r_s has no return value; therefore, a _X_c_m_s_S_u_c_c_e_s_s return value from this function indicates that conversions to RGB succeeded and the call to _X_S_t_o_r_e_C_o_l_o_r_s was made. To obtain the actual colors stored, use _X_c_m_s_Q_u_e_r_y_C_o_l_o_r_s. Due to the screen's hardware limitations or gamut compression, the colors stored in the colormap may not be identical to the colors specified. _X_c_m_s_S_t_o_r_e_C_o_l_o_r_s can generate _B_a_d_A_c_c_e_s_s, _B_a_d_C_o_l_o_r, and _B_a_d_- _V_a_l_u_e errors. DIAGNOSTICS _B_a_d_A_c_c_e_s_s A client attempted to free a color map entry that it did not already allocate. Rev. Release 5 Page 2 XcmsStoreColor(3X11) AIX (XLIB FUNCTIONS) XcmsStoreColor(3X11) _B_a_d_A_c_c_e_s_s A client attempted to store into a read-only color map entry. _B_a_d_C_o_l_o_r A value for a Colormap argument does not name a defined Colormap. _B_a_d_V_a_l_u_e Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can gen- erate this error. SEE ALSO XcmsAllocColor(3X11), XcmsQueryColor(3X11) _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e Rev. Release 5 Page 3