Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!decwrl!decvax!crltrx!max.crl.dec.com!jg From: jg@max.crl.dec.com (Jim Gettys) Newsgroups: comp.windows.x Subject: Re: X region and its data structure Message-ID: <298@crltrx.crl.dec.com> Date: 3 Aug 89 02:49:01 GMT References: <7133@kuhub.cc.ukans.edu> Sender: news@crltrx.crl.dec.com Organization: Cambridge Research Lab, Digital Equipment Corporation Lines: 39 >1. What is the data structure for X region? It is deliberately opaque; i.e. you aren't allowed to find out; it is private to the library. >2. I can create a rectangle or polygon region. How can I creat an ellipse > region? Do I have to find the edge points for the ellipsefirst and then > use XPlolygonRegion? Unfortunately yes; we didn't have time to implement such a routine before X11R1, so left it out. >3. Once a region is set, can I get the region pointer? I mean that I don't > know the clipregion and I don't care, but I want to set a new clipmask > region by intersecting the current clipmask region with a third region. Nope. But you can certainly remember your regions and do the intersection in the client program with the Xlib routines. You wouldn't want to query the server anyway; as usual, never rely on the server for information you could have remembered in the first place, as it saves round trips. >4. It is possible to create an arbitrary region by creating a bitmap first > But when I set this region, the old clipmask region will be destroyed. > Is there a way to keep the old region for later use? ( it is similar to 3) Again, if you've computed your region in the first place, you should have it around for later use when you need it. You could be complaining that there should be an Xlib routine which takes and XImage structure containing a bitmap and turns it into a region for other Xlib use, and I wouldn't necessarily disagree with you, and for cleanlyness's sake, there should probably be such a routine for arcs. If this is what you need, I suspect you could get support for it to be added in a future release. What is in Xlib now is sort of the least we could get away with in region code, given the initial time pressure of the first release. It was nip and tuck getting the original specification implemented at the time. - Jim Gettys