From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Thu, 13 Jan 2005 00:05:30 -0500 From: Russ Cox To: David Leimbach , 9fans <9fans@cse.psu.edu> Subject: Re: [9fans] plan9port libdraw In-Reply-To: <3e1162e605011220524bc2fe41@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <3e1162e605011213134327baa2@mail.gmail.com> <3e1162e605011220524bc2fe41@mail.gmail.com> Cc: Topicbox-Message-UUID: 2d8fcaa6-eace-11e9-9e20-41e7f4b1d025 > Looking at files like keyboard.c vs x11-keyboard.c a lot of > functions are pretty close to the same except inner I/O > handling functions. Part of my problem is not really knowing > the X11 APIs very well and as a result trying to understand > what some of the code is doing is getting tricky. Note that keyboard.c and mouse.c aren't actually compiled. They're just reference copies of the Plan 9 versions. > I was a decent SDL programmer a few years back but I never > really did much with X11. :) > > Hopefully this will be more educational than frustrating. If what you say about SDL being somewhat model-independent is true, then it shouldn't be too bad. The only files you'll need to provide are equivalents to the x11-*.c in libdraw. Some you can stub out (like x11-cload.c, where you can just remove the if and its body), some will translate fairly directly (like x11-mouse.c and x11-keyboard.c), and others should have the non-X-dependent pieces split out of them (like x11-init.c). In all, though, it's only 2,500 lines of code, so it shouldn't be too bad. And you definitely don't need to understand X. If you have questions, feel free to ask. Russ