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

  1.  
  2.  
  3.  
  4. XCreateFontCursor(3X11)      XLIB FUNCTIONS  XCreateFontCursor(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XCreateFontCursor, XCreatePixmapCursor, XCreateGlyphCursor
  9.        - create cursors
  10.  
  11. SSYYNNTTAAXX
  12.        #include <X11/cursorfont.h>
  13.        Cursor XCreateFontCursor(_d_i_s_p_l_a_y, _s_h_a_p_e)
  14.          Display *_d_i_s_p_l_a_y;
  15.          unsigned int _s_h_a_p_e;
  16.  
  17.        Cursor XCreatePixmapCursor(_d_i_s_p_l_a_y, _s_o_u_r_c_e, _m_a_s_k,
  18.        _f_o_r_e_g_r_o_u_n_d___c_o_l_o_r, _b_a_c_k_g_r_o_u_n_d___c_o_l_o_r, _x, _y)
  19.          Display *_d_i_s_p_l_a_y;
  20.          Pixmap _s_o_u_r_c_e;
  21.          Pixmap _m_a_s_k;
  22.          XColor *_f_o_r_e_g_r_o_u_n_d___c_o_l_o_r;
  23.          XColor *_b_a_c_k_g_r_o_u_n_d___c_o_l_o_r;
  24.          unsigned int _x, _y;
  25.  
  26.        Cursor XCreateGlyphCursor(_d_i_s_p_l_a_y, _s_o_u_r_c_e___f_o_n_t, _m_a_s_k___f_o_n_t,
  27.        _s_o_u_r_c_e___c_h_a_r, _m_a_s_k___c_h_a_r,
  28.                   _f_o_r_e_g_r_o_u_n_d___c_o_l_o_r,
  29.        _b_a_c_k_g_r_o_u_n_d___c_o_l_o_r)
  30.          Display *_d_i_s_p_l_a_y;
  31.          Font _s_o_u_r_c_e___f_o_n_t, _m_a_s_k___f_o_n_t;
  32.          unsigned int _s_o_u_r_c_e___c_h_a_r, _m_a_s_k___c_h_a_r;
  33.          XColor *_f_o_r_e_g_r_o_u_n_d___c_o_l_o_r;
  34.          XColor *_b_a_c_k_g_r_o_u_n_d___c_o_l_o_r;
  35.  
  36. AARRGGUUMMEENNTTSS
  37.        _b_a_c_k_g_r_o_u_n_d___c_o_l_o_r
  38.          Specifies the RGB values for the background of
  39.          the source.
  40.  
  41.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  42.  
  43.        _f_o_r_e_g_r_o_u_n_d___c_o_l_o_r
  44.          Specifies the RGB values for the foreground of
  45.          the source.
  46.  
  47.        _m_a_s_k     Specifies the cursor's source bits to be dis-
  48.          played or _N_o_n_e.
  49.  
  50.        _m_a_s_k___c_h_a_r Specifies the glyph character for the mask.
  51.  
  52.        _m_a_s_k___f_o_n_t Specifies the font for the mask glyph or _N_o_n_e.
  53.  
  54.        _s_h_a_p_e     Specifies the shape of the cursor.
  55.  
  56.        _s_o_u_r_c_e     Specifies the shape of the source cursor.
  57.  
  58.        _s_o_u_r_c_e___c_h_a_r
  59.          Specifies the character glyph for the source.
  60.  
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XCreateFontCursor(3X11)      XLIB FUNCTIONS  XCreateFontCursor(3X11)
  71.  
  72.  
  73.        _s_o_u_r_c_e___f_o_n_t
  74.          Specifies the font for the source glyph.
  75.  
  76.        _x
  77.        _y     Specify the x and y coordinates, which indicate
  78.          the hotspot relative to the source's origin.
  79.  
  80. DDEESSCCRRIIPPTTIIOONN
  81.        X provides a set of standard cursor shapes in a special
  82.        font named cursor.  Applications are encouraged to use
  83.        this interface for their cursors because the font can be
  84.        customized for the individual display type.  The shape
  85.        argument specifies which glyph of the standard fonts to
  86.        use.
  87.  
  88.        The hotspot comes from the information stored in the cur-
  89.        sor font.  The initial colors of a cursor are a black
  90.        foreground and a white background (see _X_R_e_c_o_l_o_r_C_u_r_s_o_r).
  91.  
  92.        _X_C_r_e_a_t_e_F_o_n_t_C_u_r_s_o_r can generate _B_a_d_A_l_l_o_c and _B_a_d_V_a_l_u_e
  93.        errors.
  94.  
  95.        The _X_C_r_e_a_t_e_P_i_x_m_a_p_C_u_r_s_o_r function creates a cursor and
  96.        returns the cursor ID associated with it.  The foreground
  97.        and background RGB values must be specified using fore-
  98.        ground_color and background_color, even if the X server
  99.        only has a _S_t_a_t_i_c_G_r_a_y or _G_r_a_y_S_c_a_l_e screen.  The foreground
  100.        color is used for the pixels set to 1 in the source, and
  101.        the background color is used for the pixels set to 0.
  102.        Both source and mask, if specified, must have depth one
  103.        (or a _B_a_d_M_a_t_c_h error results) but can have any root.  The
  104.        mask argument defines the shape of the cursor.  The pixels
  105.        set to 1 in the mask define which source pixels are dis-
  106.        played, and the pixels set to 0 define which pixels are
  107.        ignored.     If no mask is given, all pixels of the source
  108.        are displayed.  The mask, if present, must be the same
  109.        size as the pixmap defined by the source argument, or a
  110.        _B_a_d_M_a_t_c_h error results.    The hotspot must be a point
  111.        within the source, or a _B_a_d_M_a_t_c_h error results.
  112.  
  113.        The components of the cursor can be transformed arbitrar-
  114.        ily to meet display limitations.     The pixmaps can be freed
  115.        immediately if no further explicit references to them are
  116.        to be made.  Subsequent drawing in the source or mask
  117.        pixmap has an undefined effect on the cursor.  The X
  118.        server might or might not make a copy of the pixmap.
  119.  
  120.        _X_C_r_e_a_t_e_P_i_x_m_a_p_C_u_r_s_o_r can generate _B_a_d_A_l_l_o_c and _B_a_d_P_i_x_m_a_p
  121.        errors.
  122.  
  123.        The _X_C_r_e_a_t_e_G_l_y_p_h_C_u_r_s_o_r function is similar to _X_C_r_e_-
  124.        _a_t_e_P_i_x_m_a_p_C_u_r_s_o_r except that the source and mask bitmaps
  125.        are obtained from the specified font glyphs.  The
  126.        source_char must be a defined glyph in source_font, or a
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XCreateFontCursor(3X11)      XLIB FUNCTIONS  XCreateFontCursor(3X11)
  137.  
  138.  
  139.        _B_a_d_V_a_l_u_e error results.    If mask_font is given, mask_char
  140.        must be a defined glyph in mask_font, or a _B_a_d_V_a_l_u_e error
  141.        results.     The mask_font and character are optional.  The
  142.        origins of the source_char and mask_char (if defined)
  143.        glyphs are positioned coincidently and define the hotspot.
  144.        The source_char and mask_char need not have the same
  145.        bounding box metrics, and there is no restriction on the
  146.        placement of the hotspot relative to the bounding boxes.
  147.        If no mask_char is given, all pixels of the source are
  148.        displayed.  You can free the fonts immediately by calling
  149.        _X_F_r_e_e_F_o_n_t if no further explicit references to them are to
  150.        be made.
  151.  
  152.        For 2-byte matrix fonts, the 16-bit value should be formed
  153.        with the byte1 member in the most significant byte and the
  154.        byte2 member in the least significant byte.
  155.  
  156.        _X_C_r_e_a_t_e_G_l_y_p_h_C_u_r_s_o_r can generate _B_a_d_A_l_l_o_c, _B_a_d_F_o_n_t, and
  157.        _B_a_d_V_a_l_u_e errors.
  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_F_o_n_t     A value for a Font or GContext argument does not
  164.          name a defined Font.
  165.  
  166.        _B_a_d_M_a_t_c_h     Some argument or pair of arguments has the cor-
  167.          rect type and range but fails to match in some
  168.          other way required by the request.
  169.  
  170.        _B_a_d_P_i_x_m_a_p A value for a Pixmap argument does not name a
  171.          defined Pixmap.
  172.  
  173.        _B_a_d_V_a_l_u_e     Some numeric value falls outside the range of
  174.          values accepted by the request.  Unless a spe-
  175.          cific range is specified for an argument, the
  176.          full range defined by the argument's type is
  177.          accepted.  Any argument defined as a set of
  178.          alternatives can generate this error.
  179.  
  180. SSEEEE AALLSSOO
  181.        XDefineCursor(3X11), XLoadFont(3X11), XRecolorCursor(3X11)
  182.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.