On Thu, Oct 26, 2000 at 12:03:56AM +0200, Andreas Beck wrote:
> > is it possible to get ggi device's fd
> > (something like the ConnectionNumber() in X)?
> 
> No. Because there is no such thing for most devices. GGI does not go through
> a socket.
> 
> There can also be polled devices that won't trigger a select. This is why
> there is no possibility to get the fds. The intention is to do it the other
> way round: Add targets to LibGII or use the EventSelect function.
> 
> > This would be fine for using it in event loops of other applications 
> > (as tcl for example) where I can't get the filedescriptors (else I 
> > could use ggi's select).
> 
> You mean the other app doesn't give it's fd either ? Tough luck, then.
> 
> You are either back to polling or writing a LibGII target that ties into
> the native system you want to fit in.
> 
> > It does not matter, if this is not portable, it's just for a hack which 
> > should work on UNIX/X.
> 
> For just X it would be possible. It should be trivial to e.g. hack a function
> that calls ConnectionNumber for you into e.g. the wmh extension.

yes it was just easy once I've found <ggi/display/xlib.h>

    fd = ConnectionNumber(XLIB_PRIV(visual)->display)

it's a hack, but it works really nice.

btw.: if I would ever find the time to implement a `filled triangles'
function, would that have any chance of beeing added to libggi?

-- 
   Johannes

Reply via email to