nanogui: what is the difference between srvfunc.c and client.c?
Subject:
Re: [nanogui] what is the difference between srvfunc.c and client.c?
From:
Alex Holden ####@####.####
Date:
7 Jun 2005 10:30:28 +0100
Message-Id: <89530E70-2A53-42CA-B784-F6FA0F5A6A5E@linuxhacker.org>
On 7 Jun 2005, at 05:09, Greg Haerr wrote:
> : IIRC it was
> : actually possible to have multiple clients running both inside the
> : server and outside the server at the same time with microwin-aph
> Alex - do you recall how this was actually done?
It doesn't use multi-threading; instead it relies on the "clientlets"
being completely event driven and not blocking the CPU for long
periods of time (co-operative multitasking, in other words). Each
clientlet needed to have a call to their initialisation routine added
to GsInitialize(), and in their initialisation they needed to call
GrRegisterInternClient() to add their event handler function to a
callback list and register for at least one event (otherwise it'll
never get called). The event dispatcher then calls the clientlet's
event handler function whenever it has an event to deliver to it.
Background tasks within clientlets could be accomplished by
requesting periodic timer events.
The code is all in microwin-aph. If you set NANOWM_LINKED_IN in the
config file, the window manager runs inside the server. If you set
INTERNAL_NXEYES_DEMO, then several instances of nxeyes are created
inside the server (I can't remember if nxeyes made it to microwin-
greg- it was itself a nice demonstration of the shaped window support
I added). Both can be used at once, and ordinary network clients
(both the named socket type and the TCP/IP type) can all connect to
the server at the same time. There's lots of other cool features in
microwin-aph that were never folded back into microwin-greg- take a
look at the ChangeLog file in microwin-aph for a list. My favourite
was probably the full alpha channel support and the NanoBreaker game
(which was written to demonstrate the alpha channel stuff).
--
------------ Alex Holden - http://www.alexholden.net/ ------------
If it doesn't work, you're not hitting it with a big enough hammer