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

  1.  
  2.  
  3.  
  4. XCreateColormap(3X11)      XLIB FUNCTIONS    XCreateColormap(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XCreateColormap, XCopyColormapAndFree, XFreeColormap,
  9.        XColor - create, copy, or destroy colormaps and color
  10.        structure
  11.  
  12. SSYYNNTTAAXX
  13.        Colormap XCreateColormap(_d_i_s_p_l_a_y, _w, _v_i_s_u_a_l, _a_l_l_o_c)
  14.          Display *_d_i_s_p_l_a_y;
  15.          Window _w;
  16.          Visual *_v_i_s_u_a_l;
  17.          int _a_l_l_o_c;
  18.  
  19.        Colormap XCopyColormapAndFree(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p)
  20.          Display *_d_i_s_p_l_a_y;
  21.          Colormap _c_o_l_o_r_m_a_p;
  22.  
  23.        XFreeColormap(_d_i_s_p_l_a_y, _c_o_l_o_r_m_a_p)
  24.          Display *_d_i_s_p_l_a_y;
  25.          Colormap _c_o_l_o_r_m_a_p;
  26.  
  27. AARRGGUUMMEENNTTSS
  28.        _a_l_l_o_c     Specifies the colormap entries to be allocated.
  29.          You can pass _A_l_l_o_c_N_o_n_e or _A_l_l_o_c_A_l_l.
  30.  
  31.        _c_o_l_o_r_m_a_p     Specifies the colormap that you want to create,
  32.          copy, set, or destroy.
  33.  
  34.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  35.  
  36.        _v_i_s_u_a_l     Specifies a visual type supported on the screen.
  37.          If the visual type is not one supported by the
  38.          screen, a _B_a_d_M_a_t_c_h error results.
  39.  
  40.        _w     Specifies the window on whose screen you want to
  41.          create a colormap.
  42.  
  43. DDEESSCCRRIIPPTTIIOONN
  44.        The _X_C_r_e_a_t_e_C_o_l_o_r_m_a_p function creates a colormap of the
  45.        specified visual type for the screen on which the speci-
  46.        fied window resides and returns the colormap ID associated
  47.        with it.     Note that the specified window is only used to
  48.        determine the screen.
  49.  
  50.        The initial values of the colormap entries are undefined
  51.        for the visual classes _G_r_a_y_S_c_a_l_e, _P_s_e_u_d_o_C_o_l_o_r, and
  52.        _D_i_r_e_c_t_C_o_l_o_r.  For _S_t_a_t_i_c_G_r_a_y, _S_t_a_t_i_c_C_o_l_o_r, and _T_r_u_e_C_o_l_o_r,
  53.        the entries have defined values, but those values are spe-
  54.        cific to the visual and are not defined by X.  For
  55.        _S_t_a_t_i_c_G_r_a_y, _S_t_a_t_i_c_C_o_l_o_r, and _T_r_u_e_C_o_l_o_r, alloc must be
  56.        _A_l_l_o_c_N_o_n_e, or a _B_a_d_M_a_t_c_h error results.    For the other
  57.        visual classes, if alloc is _A_l_l_o_c_N_o_n_e, the colormap ini-
  58.        tially has no allocated entries, and clients can allocate
  59.        them.  For information about the visual types, see section
  60.        3.1.
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XCreateColormap(3X11)      XLIB FUNCTIONS    XCreateColormap(3X11)
  71.  
  72.  
  73.        If alloc is _A_l_l_o_c_A_l_l, the entire colormap is allocated
  74.        writable.  The initial values of all allocated entries are
  75.        undefined.  For _G_r_a_y_S_c_a_l_e and _P_s_e_u_d_o_C_o_l_o_r, the effect is
  76.        as if an _X_A_l_l_o_c_C_o_l_o_r_C_e_l_l_s call returned all pixel values
  77.        from zero to N - 1, where N is the colormap entries value
  78.        in the specified visual.     For _D_i_r_e_c_t_C_o_l_o_r, the effect is
  79.        as if an _X_A_l_l_o_c_C_o_l_o_r_P_l_a_n_e_s call returned a pixel value of
  80.        zero and red_mask, green_mask, and blue_mask values con-
  81.        taining the same bits as the corresponding masks in the
  82.        specified visual.  However, in all cases, none of these
  83.        entries can be freed by using _X_F_r_e_e_C_o_l_o_r_s.
  84.  
  85.        _X_C_r_e_a_t_e_C_o_l_o_r_m_a_p can generate _B_a_d_A_l_l_o_c, _B_a_d_M_a_t_c_h, _B_a_d_V_a_l_u_e,
  86.        and _B_a_d_W_i_n_d_o_w errors.
  87.  
  88.        The _X_C_o_p_y_C_o_l_o_r_m_a_p_A_n_d_F_r_e_e function creates a colormap of
  89.        the same visual type and for the same screen as the speci-
  90.        fied colormap and returns the new colormap ID.  It also
  91.        moves all of the client's existing allocation from the
  92.        specified colormap to the new colormap with their color
  93.        values intact and their read-only or writable characteris-
  94.        tics intact and frees those entries in the specified col-
  95.        ormap.  Color values in other entries in the new colormap
  96.        are undefined.  If the specified colormap was created by
  97.        the client with alloc set to _A_l_l_o_c_A_l_l, the new colormap is
  98.        also created with _A_l_l_o_c_A_l_l, all color values for all
  99.        entries are copied from the specified colormap, and then
  100.        all entries in the specified colormap are freed.     If the
  101.        specified colormap was not created by the client with
  102.        _A_l_l_o_c_A_l_l, the allocations to be moved are all those pixels
  103.        and planes that have been allocated by the client using
  104.        _X_A_l_l_o_c_C_o_l_o_r, _X_A_l_l_o_c_N_a_m_e_d_C_o_l_o_r, _X_A_l_l_o_c_C_o_l_o_r_C_e_l_l_s, or _X_A_l_-
  105.        _l_o_c_C_o_l_o_r_P_l_a_n_e_s and that have not been freed since they
  106.        were allocated.
  107.  
  108.        _X_C_o_p_y_C_o_l_o_r_m_a_p_A_n_d_F_r_e_e can generate _B_a_d_A_l_l_o_c and _B_a_d_C_o_l_o_r
  109.        errors.
  110.  
  111.        The _X_F_r_e_e_C_o_l_o_r_m_a_p function deletes the association between
  112.        the colormap resource ID and the colormap and frees the
  113.        colormap storage.  However, this function has no effect on
  114.        the default colormap for a screen.  If the specified col-
  115.        ormap is an installed map for a screen, it is uninstalled
  116.        (see _X_U_n_i_n_s_t_a_l_l_C_o_l_o_r_m_a_p).  If the specified colormap is
  117.        defined as the colormap for a window (by _X_C_r_e_a_t_e_W_i_n_d_o_w,
  118.        _X_S_e_t_W_i_n_d_o_w_C_o_l_o_r_m_a_p, or _X_C_h_a_n_g_e_W_i_n_d_o_w_A_t_t_r_i_b_u_t_e_s), _X_F_r_e_e_C_o_l_-
  119.        _o_r_m_a_p changes the colormap associated with the window to
  120.        _N_o_n_e and generates a _C_o_l_o_r_m_a_p_N_o_t_i_f_y event.  X does not
  121.        define the colors displayed for a window with a colormap
  122.        of _N_o_n_e.
  123.  
  124.        _X_F_r_e_e_C_o_l_o_r_m_a_p can generate a _B_a_d_C_o_l_o_r error.
  125.  
  126.  
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XCreateColormap(3X11)      XLIB FUNCTIONS    XCreateColormap(3X11)
  137.  
  138.  
  139. SSTTRRUUCCTTUURREESS
  140.        The _X_C_o_l_o_r structure contains:
  141.  
  142.        typedef struct {
  143.         unsigned long pixel;/* pixel value */
  144.         unsigned short red, green, blue;/* rgb values */
  145.         char flags;        /* DoRed, DoGreen, DoBlue */
  146.         char pad;
  147.        } XColor;
  148.  
  149.        The red, green, and blue values are always in the range 0
  150.        to 65535 inclusive, independent of the number of bits
  151.        actually used in the display hardware.  The server scales
  152.        these values down to the range used by the hardware.
  153.        Black is represented by (0,0,0), and white is represented
  154.        by (65535,65535,65535).    In some functions, the flags mem-
  155.        ber controls which of the red, green, and blue members is
  156.        used and can be the inclusive OR of zero or more of _D_o_R_e_d,
  157.        _D_o_G_r_e_e_n, and _D_o_B_l_u_e.
  158.  
  159. DDIIAAGGNNOOSSTTIICCSS
  160.        _B_a_d_A_l_l_o_c     The server failed to allocate the requested
  161.          resource or server memory.
  162.  
  163.        _B_a_d_C_o_l_o_r     A value for a Colormap argument does not name a
  164.          defined Colormap.
  165.  
  166.        _B_a_d_M_a_t_c_h     An _I_n_p_u_t_O_n_l_y window is used as a Drawable.
  167.  
  168.        _B_a_d_M_a_t_c_h     Some argument or pair of arguments has the cor-
  169.          rect type and range but fails to match in some
  170.          other way required by the request.
  171.  
  172.        _B_a_d_V_a_l_u_e     Some numeric value falls outside the range of
  173.          values accepted by the request.  Unless a spe-
  174.          cific range is specified for an argument, the
  175.          full range defined by the argument's type is
  176.          accepted.  Any argument defined as a set of
  177.          alternatives can generate this error.
  178.  
  179.        _B_a_d_W_i_n_d_o_w A value for a Window argument does not name a
  180.          defined Window.
  181.  
  182. SSEEEE AALLSSOO
  183.        XAllocColor(3X11), XChangeWindowAtrributes(3X11), XCre-
  184.        ateWindow(3X11), XQueryColor(3X11), XStoreColors(3X11)
  185.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.