NAME

XcupStoreColors - initialize shareable colormap entries at specific locations

SYNOPSIS


cccc [ _f_l_a_g ... ] _f_i_l_e ... -llXXeexxtt [ _l_i_b_r_a_r_y ... ]
#include 
Status XXccuuppSSttoorreeCCoolloorrss(Display *_d_i_s_p_l_a_y, Colormap _c_o_l_o_r_m_a_p,
XColor *_c_o_l_o_r_s___i_n___o_u_t, int _n_c_o_l_o_r_s);
     

ARGUMENTS

_d_i_s_p_l_a_y Specifies the connection to the X server
_c_o_l_o_r_m_a_p Specifies the colormap
_c_o_l_o_r_s___i_n___o_u_t Specifies and returns the values actually used in the colormap
_n_c_o_l_o_r_s Specifies the number of items in colors_in_out

DESCRIPTION

The _X_c_u_p_S_t_o_r_e_C_o_l_o_r_s function changes the colormap entries of the pixel values in the pixel members of the XColor structures. The colormap entries are allocated as if an AllocColor has been used instead, i.e. the colors are read-only (shareable). _X_c_u_p_S_t_o_r_e_C_o_l_o_r_s returns the number of colors that were successfully allocated in the colormap.

A _V_a_l_u_e error is generated if a pixel is not a valid index into the colormap. A _B_a_d_M_a_t_c_h error is generated if the colormap does not belong to a GrayScale, PseudoColor, or DirectColor visual.

Applications which allocate many colors in a screen's default colormap, e.g. a color-cube or a gray-ramp, should allocate them with _X_C_u_p_S_t_o_r_e_C_o_l_o_r_s. By using XCupStoreColors the colors will be allocated sharable (read-only) and any other application which allocates the same color will share that color cell.

SEE ALSO

XcupQueryVersion(3Xext), XcupGetReservedColormapEntries(3Xext),
_C_o_l_o_r_m_a_p _U_t_i_l_i_z_a_t_i_o_n _P_o_l_i_c_y _a_n_d _E_x_t_e_n_s_i_o_n