XDraw(whatever) and floating point - Xwindows

This is a discussion on XDraw(whatever) and floating point - Xwindows ; I haven't seen the evidence conclusively but is it true that XDraw(mumble) accepts only integer values for its inputs? I seem to remember being able to use floating and double operations directly as inputs to those particular functions in HPUX ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: XDraw(whatever) and floating point

  1. XDraw(whatever) and floating point

    I haven't seen the evidence conclusively but is it true that XDraw(mumble)
    accepts only integer values for its inputs? I seem to remember being able
    to use floating and double operations directly as inputs to those particular
    functions in HPUX but yet on the AIX platform it doesn't seem to accept them
    as valid.

    I've been limping along by using typecasts in my code, but I wanted to
    confirm that it/they will only accept integer values.



  2. Re: XDraw(whatever) and floating point

    In comp.windows.x, Eigenvector

    wrote
    on Mon, 11 Sep 2006 17:20:30 -0700
    :
    > I haven't seen the evidence conclusively but is it true that XDraw(mumble)
    > accepts only integer values for its inputs? I seem to remember being able
    > to use floating and double operations directly as inputs to those particular
    > functions in HPUX but yet on the AIX platform it doesn't seem to accept them
    > as valid.
    >
    > I've been limping along by using typecasts in my code, but I wanted to
    > confirm that it/they will only accept integer values.
    >
    >


    These are typical:

    int XDrawString(Display *display, Drawable d, GC gc,
    int x, int y, char *string, int length);

    int XDrawString16(Display *display, Drawable d, GC gc,
    int x, int y, XChar2b *string, int length);

    int XDrawLine(Display *display, Drawable d, GC gc,
    int x1, int y1, int x2, int y2);

    int XDrawLines(Display *display, Drawable d, GC gc,
    XPoint *points, int npoints, int mode);

    int XDrawSegments(Display *display, Drawable d, GC gc,
    XSegment *segments, int nsegments);

    It's worth noting that:

    typedef struct {
    short x1, y1, x2, y2;
    } XSegment;

    typedef struct {
    short x, y;
    } XPoint;

    have some nasty ramifications if one want to properly implement
    large (> 32767) scrollable regions. Also, the ints in the
    above call are probably really shorts, when they're thrown
    out on the network (see /usr/[X11R6/]include/X11/Xproto.h
    for some of the packet; the rest is probably described in
    Volume 0 of O'Reilly).

    There might be an extension now, of course, that allows long ints.
    I for one don't know.

    --
    #191, ewill3@earthlink.net
    Windows Vista. Because it's time to refresh your hardware. Trust us.

+ Reply to Thread