Pat's Log
Mon, 02 Jan 2006

New Year, New Stuff
20060101 Welcome to Anno Domini 2006. It's amazing we've gotten this far. 2001 was supposed to be the big year, where we're either waltzing in space Kubrick-style or the world comes to an end, but neither ever happened. And here we are a whole five years later and there has been pretty much zero progress.

The Celestia 1.4.1 work progresses smoothly. I gave in and reluctantly created a splash screen for GTK Celestia. I just checked it in, and it's running very smoothly. So smoothly, that I've actually grown fond of it.

Creating a splash screen was in some ways more and in other ways less difficult than I imagined. The screen was to have alpha transparency and could display start-up progress based on recently-added core code. Figuring out how to do the transparency took a full day of work. It is implemented with Cairo if the composite extension is on, and if it is not, the fallback is to do a screen capture of the area beneath the window and set it as the splash screen's background. This gives the illusion of transparency.

Despite adding around 200ms to the start-up time, the fact that there is a nearly immediate response to clicking the application's icon makes it feel a whole lot more responsive.

The biggest stumbling block was when the code magically started not compiling. "common.h" is included in every one of my source files, but when it was included in the new splash source file, there were bizarre errors in things that had already compiled. It took a few hours of head scratching, but eventually reading the 83,482-line pre-processor output (splash.ii) made it clear:

(...) ControlKey = 0x10, }; enum 0 { ArrowCursor = 0, UpArrowCursor = 1, (...)

Basically, the enum 0 was originally enum CursorShape, but this got included while playing around with cairo and Xlib:

X11/X.h:#define CursorShape 0

While the naming collision is obvious now, GCC did not complain about it, as there is nothing wrong with the define. That said, it is probably why defines are often fully capitalized and prefixed with underscores. It had me tearing out what little hair I have left. I'm quite surprised it has not been an issue before now.


[] | posted @ 03:33 | link

copyright ©2004-2016 pat suwalski