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

  1.  
  2.  
  3.  
  4. XDrawLine(3X11)          XLIB FUNCTIONS      XDrawLine(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XDrawLine, XDrawLines, XDrawSegments, XSegment - draw
  9.        lines, polygons, and line structure
  10.  
  11. SSYYNNTTAAXX
  12.        XDrawLine(_d_i_s_p_l_a_y, _d, _g_c, _x_1, _y_1, _x_2, _y_2)
  13.          Display *_d_i_s_p_l_a_y;
  14.          Drawable _d;
  15.          GC _g_c;
  16.          int _x_1, _y_1, _x_2, _y_2;
  17.  
  18.        XDrawLines(_d_i_s_p_l_a_y, _d, _g_c, _p_o_i_n_t_s, _n_p_o_i_n_t_s, _m_o_d_e)
  19.          Display *_d_i_s_p_l_a_y;
  20.          Drawable _d;
  21.          GC _g_c;
  22.          XPoint *_p_o_i_n_t_s;
  23.          int _n_p_o_i_n_t_s;
  24.          int _m_o_d_e;
  25.  
  26.        XDrawSegments(_d_i_s_p_l_a_y, _d, _g_c, _s_e_g_m_e_n_t_s, _n_s_e_g_m_e_n_t_s)
  27.          Display *_d_i_s_p_l_a_y;
  28.          Drawable _d;
  29.          GC _g_c;
  30.          XSegment *_s_e_g_m_e_n_t_s;
  31.          int _n_s_e_g_m_e_n_t_s;
  32.  
  33. AARRGGUUMMEENNTTSS
  34.        _d     Specifies the drawable.
  35.  
  36.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  37.  
  38.        _g_c     Specifies the GC.
  39.  
  40.        _m_o_d_e     Specifies the coordinate mode.     You can pass
  41.          _C_o_o_r_d_M_o_d_e_O_r_i_g_i_n or _C_o_o_r_d_M_o_d_e_P_r_e_v_i_o_u_s.
  42.  
  43.        _n_p_o_i_n_t_s     Specifies the number of points in the array.
  44.  
  45.        _n_s_e_g_m_e_n_t_s Specifies the number of segments in the array.
  46.  
  47.        _p_o_i_n_t_s     Specifies an array of points.
  48.  
  49.        _s_e_g_m_e_n_t_s     Specifies an array of segments.
  50.  
  51.        _x_1
  52.        _y_1
  53.        _x_2
  54.        _y_2     Specify the points (x1, y1) and (x2, y2) to be
  55.          connected.
  56.  
  57. DDEESSCCRRIIPPTTIIOONN
  58.        The _X_D_r_a_w_L_i_n_e function uses the components of the speci-
  59.        fied GC to draw a line between the specified set of points
  60.        (x1, y1) and (x2, y2).  It does not perform joining at
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XDrawLine(3X11)          XLIB FUNCTIONS      XDrawLine(3X11)
  71.  
  72.  
  73.        coincident endpoints.  For any given line, _X_D_r_a_w_L_i_n_e does
  74.        not draw a pixel more than once.     If lines intersect, the
  75.        intersecting pixels are drawn multiple times.
  76.  
  77.        The _X_D_r_a_w_L_i_n_e_s function uses the components of the speci-
  78.        fied GC to draw npoints-1 lines between each pair of
  79.        points (point[i], point[i+1]) in the array of _X_P_o_i_n_t
  80.        structures.  It draws the lines in the order listed in the
  81.        array.  The lines join correctly at all intermediate
  82.        points, and if the first and last points coincide, the
  83.        first and last lines also join correctly.  For any given
  84.        line, _X_D_r_a_w_L_i_n_e_s does not draw a pixel more than once.  If
  85.        thin (zero line-width) lines intersect, the intersecting
  86.        pixels are drawn multiple times.     If wide lines intersect,
  87.        the intersecting pixels are drawn only once, as though the
  88.        entire _P_o_l_y_L_i_n_e protocol request were a single, filled
  89.        shape.  _C_o_o_r_d_M_o_d_e_O_r_i_g_i_n treats all coordinates as relative
  90.        to the origin, and _C_o_o_r_d_M_o_d_e_P_r_e_v_i_o_u_s treats all coordi-
  91.        nates after the first as relative to the previous point.
  92.  
  93.        The _X_D_r_a_w_S_e_g_m_e_n_t_s function draws multiple, unconnected
  94.        lines.  For each segment, _X_D_r_a_w_S_e_g_m_e_n_t_s draws a line
  95.        between (x1, y1) and (x2, y2).  It draws the lines in the
  96.        order listed in the array of _X_S_e_g_m_e_n_t structures and does
  97.        not perform joining at coincident endpoints.  For any
  98.        given line, _X_D_r_a_w_S_e_g_m_e_n_t_s does not draw a pixel more than
  99.        once.  If lines intersect, the intersecting pixels are
  100.        drawn multiple times.
  101.  
  102.        All three functions use these GC components: function,
  103.        plane-mask, line-width, line-style, cap-style, fill-style,
  104.        subwindow-mode, clip-x-origin, clip-y-origin, and clip-
  105.        mask.  The _X_D_r_a_w_L_i_n_e_s function also uses the join-style GC
  106.        component.  All three functions also use these GC mode-
  107.        dependent components: foreground, background, tile, stip-
  108.        ple, tile-stipple-x-origin, tile-stipple-y-origin, dash-
  109.        offset, and dash-list.
  110.  
  111.        _X_D_r_a_w_L_i_n_e, _X_D_r_a_w_L_i_n_e_s, and _X_D_r_a_w_S_e_g_m_e_n_t_s can generate
  112.        _B_a_d_D_r_a_w_a_b_l_e, _B_a_d_G_C, and _B_a_d_M_a_t_c_h errors.     _X_D_r_a_w_L_i_n_e_s can
  113.        also generate a _B_a_d_V_a_l_u_e error.
  114.  
  115. SSTTRRUUCCTTUURREESS
  116.        The _X_S_e_g_m_e_n_t structure contains:
  117.  
  118.        typedef struct {
  119.         short x1, y1, x2, y2;
  120.        } XSegment;
  121.  
  122.        All x and y members are signed integers.     The width and
  123.        height members are 16-bit unsigned integers.  You should
  124.        be careful not to generate coordinates and sizes out of
  125.        the 16-bit ranges, because the protocol only has 16-bit
  126.        fields for these values.
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XDrawLine(3X11)          XLIB FUNCTIONS      XDrawLine(3X11)
  137.  
  138.  
  139. DDIIAAGGNNOOSSTTIICCSS
  140.        _B_a_d_D_r_a_w_a_b_l_e
  141.          A value for a Drawable argument does not name a
  142.          defined Window or Pixmap.
  143.  
  144.        _B_a_d_G_C     A value for a GContext argument does not name a
  145.          defined GContext.
  146.  
  147.        _B_a_d_M_a_t_c_h     An _I_n_p_u_t_O_n_l_y window is used as a Drawable.
  148.  
  149.        _B_a_d_M_a_t_c_h     Some argument or pair of arguments has the cor-
  150.          rect type and range but fails to match in some
  151.          other way required by the request.
  152.  
  153.        _B_a_d_V_a_l_u_e     Some numeric value falls outside the range of
  154.          values accepted by the request.  Unless a spe-
  155.          cific range is specified for an argument, the
  156.          full range defined by the argument's type is
  157.          accepted.  Any argument defined as a set of
  158.          alternatives can generate this error.
  159.  
  160. SSEEEE AALLSSOO
  161.        XDrawArc(3X11), XDrawPoint(3X11), XDrawRectangle(3X11)
  162.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.