What is the proper way to remove a clip region from GC? - Xwindows

This is a discussion on What is the proper way to remove a clip region from GC? - Xwindows ; What I want to do is remove a clip region (so I can free it) from the GC and continue using the GC without any clip region. How do I do that with XLib? Thanks in advance, Charlie...

+ Reply to Thread
Results 1 to 4 of 4

Thread: What is the proper way to remove a clip region from GC?

  1. What is the proper way to remove a clip region from GC?

    What I want to do is remove a clip region (so I can free it) from the GC and
    continue using the GC without any clip region. How do I do that with XLib?

    Thanks in advance,
    Charlie


  2. Re: What is the proper way to remove a clip region from GC?

    In comp.windows.x, CharlieB

    wrote
    on Sat, 24 Jan 2004 20:41:39 +0000
    :
    > What I want to do is remove a clip region (so I can free it) from the GC and
    > continue using the GC without any clip region. How do I do that with XLib?
    >
    > Thanks in advance,
    > Charlie
    >


    It is unnecessary to reset the GC's clip region prior to destroying
    the region, as the region is converted into a bitmap internally.
    However, one can call XSetClipMask(dpy, gc, None) to disable clipping,
    if one so wishes.

    The behavior of the call

    XSetRegion(dpy, gc, NULL)

    does not appear to be specified, at least in my manpages.

    --
    #191, ewill3@earthlink.net
    It's still legal to go .sigless.

  3. Re: What is the proper way to remove a clip region from GC?

    The Ghost In The Machine wrote:

    > In comp.windows.x, CharlieB
    >
    > wrote
    > on Sat, 24 Jan 2004 20:41:39 +0000
    > :
    >> What I want to do is remove a clip region (so I can free it) from the GC
    >> and continue using the GC without any clip region. How do I do that with
    >> XLib?
    >>
    >> Thanks in advance,
    >> Charlie
    >>

    >
    > It is unnecessary to reset the GC's clip region prior to destroying
    > the region, as the region is converted into a bitmap internally.
    > However, one can call XSetClipMask(dpy, gc, None) to disable clipping,
    > if one so wishes.
    >
    > The behavior of the call
    >
    > XSetRegion(dpy, gc, NULL)
    >
    > does not appear to be specified, at least in my manpages.
    >

    Thanks for the info. I didn't want to try XSetRegion(dpy, gc, NULL) without
    checking first. I forgot about XSetClipMask().

    Thanks again


  4. Re: What is the proper way to remove a clip region from GC?

    The Ghost In The Machine wrote:
    >The behavior of the call
    >
    >XSetRegion(dpy, gc, NULL)
    >
    >does not appear to be specified, at least in my manpages.


    It segfaults.

    The man pages leave a lot to be desired here. A quick look at the
    source reveals several useful factoids:

    - Clipping is always done with rectangles, ie if you specify a pixmap
    it will be converted to the rectangular form. This means that for
    certain clips you may be better off with XSetStipple, which does the
    anding-with-a-bitmap operation.

    - The only way to remove the clipping stage from the pipeline is with
    XSetClipMask (or XChangeGC, which is what XSetClipMask uses).

    - A Region can appear as both source and destination, as in
    XUnionRegion(A, B, A). This is actually a bit faster than creating
    a temporary Region.


+ Reply to Thread