LinuxSoftware

Coding and tramping in Aotearoa / New Zealand


Feb 1

My last linux.conf.au day

, , , , david, Friday, 11:29 am

Anthony Baxter, from Google which he referred to as “*cough* company” gave the keynote this morning. He talked on the upcoming release of Python 3.0 which will be a major new revision breaking all backwards compatibility, but which will tidy up the language immensely. He also assured us the 2.x branch will be continue to be supported for at least two more revisions (2.6 and 2.7). He caused much amusement by first saying Impress was not good enough for his presentation and then spending two minutes trying to get whatever proprietary slideshow app it was (something on MacOSX) running. He did have plenty of eye candy in the show.

It was good to catch up with Gord who I went to University with long long ago. He recognised me from this blog which is pretty cool.

I attended the CRFS, C/C++ concurrency, X development and Puppet sessions today. I am definitely going to have a closer look at CRFS and Btrfs when I get back to Auckland. Intel has just released a complete programmers’ reference manual for the 965 and G35 graphics chips.


Jan 12

Reviving old code

, , , david, Saturday, 11:52 pm

Persona was my first X11 app. It’s not much, just a basic address book, but it has been interesting to get it up and running again. I’m creating new project pages for all my various little projects and it seemed appropriate to start with the oldest.

Persona uses the XForms library written by Mark Overmars and T.C. Zhao. (Not to be confused with the XML format). Back around 95 I discovered this library and found it so much easier than trying to write raw Xlib apps. With oval buttons! I wrote a C++ wrapper around it which I thought was pretty nice. And so when I wrote Persona in 99 I used it, even though QT and GTK+ must have been around by then.  XForms is pretty obsolete now, but fortunately it can still be downloaded from its Savannah project page. And it still builds and links against X11 without any problems.

Getting Persona working with modern standardised C++ was the main bit of work. Back when I wrote Persona the C++ standard was still being discussed, things weren’t stable, so there are some work arounds. For example I wanted to use auto_ptr, but I found GCC had removed it as “because the details of the interface are still being discussed by the C++ standardization committee”. I copied in my own copy as djm_memory, but that clashes with the now standardised memory header, so djm_memory had to go.

Some other antiquitisms:

  • I had using std; instead of using namespace std;
  • I was using strstream instead of stringstream – Quietened that down with-Wno-deprecated.

I switched off the GCC warning which drives Nigel nuts, “has virtual functions but non-virtual destructor”, with -Wno-non-virtual-dtor. For me this may really point to a memory leak, but I’m going to ignore that for now.

My XForms wrapper code uses member functions and templates a lot. So I got a lot of error messages like: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. Say ‘&MainForm::prev’ It’s nice when the compiler tells you how to fix your bug. I wonder why they tightened the member function rules up though?

Finally, it lives!

I also rediscovered Persona has a text command mode implemented with Lex and Yacc. I’d forgotten that. Persona will run in text mode if there is no X11 display, or if “-text” is passed on the command line. It’s not very good though, because I never implemented the search command for this mode.

Fonts aren’t the same so I tweaked some of the placements, not much though. This makes me realize XForms didn’t have very good font handling.

Next task: to rewrite Persona with a GTK or wxWidgets interface. Hmmm, maybe not. I’ll just leave Persona as it is, as a piece of LinuxSoftware history.

persona09


« Previous Page