Wednesday, April 13, 2011

Athena Widget Internet Hunt

My lead programmer decided he would prefer to work on the client user interface, so I decided I would take the other track, the map editor. The map editor is ancient, and uses the X11 Athena Widget set, otherwise lovingly known as Xaw. For those who do not know, X11 has a series of books, volumes 0-8. We have most of the books, but apparently there were two additions of Volume 4, xtoolkitintrinsics. There was the "standard" or rather not so standard edition, last published in 1993, using the Athena Widget set, and the the Motif edition. As you should all know, Motif itself is non-free software. Apparently there are other editions of motif, but that is besides the point, because the ancient crossedit crossfire map editor was written using Athena Widgets, so I wanted to understand how it was put together.


While doing a total re-write using gtk or something would probably be a good idea. I have never used gtk, so I would have no idea where to start, while the wogedit map-editor, is already part way writen. It just needs some tweaking to display tiles properly. So many games do not have map editors even when they should, that I feel a poorly written editor with a bad user interface is much better than none at all.


So, anyway, I spent all of yesterday searching the internet for clues as to where the example problems for the Standard Volume Four, X11 book could be found. I already managed to get a pdf edition (uploaded by the publisher) of the book here. http://www.archive.org/details/xtoolkitintrinsic04nyemiss


The more into the book I read, the more I wanted the example problems already coded for me so I would not have to waste hours of time typing them in wrong. That is actually what took the whole day. I asked on Freenode, the xorg chat channel. Someone commented that they hoped that the code examples were lost along with all interest in that ancient version of ancient X11 widgets.


Unfortunately, it is too late for that, I have an X11 Athena Widget obsession, and I managed to find the example code right here. http://examples.oreilly.com/9781565920132/
Be sure to download xtprog4.tar.Z for the Athena Widget book examples. You can unpack it using the regular tar command.


Admittedly, I wonder sometimes what the Goddess Athena thinks of having her name tacked to an obsolete X11 Widget set.

Saturday, April 2, 2011

Fixxed CFLAGS with a script

I fixed the CFLAGS problem, not by changing the configure or Make process at all, but by running a shell script, after the ./configure, but before the make in order to change one like in each Makefile, notably, the CFLAGS =


I changed CFLAGS = to CFLAGS = -g using a couple shell scripts and a sed naming file. I sent these scripts to everyone who has been active on the wograld project. I thought about posting the scripts here. I suppose I could, but if newbies mess up with them, they could end up deleting the files on the list they created instead of changing one thing about the file, like if they don't have cflagsname in the proper folder.
Maybe I should post them up along with the directions I had. Newbies, you have been warned. These files can also be used to fork projects, but it is suggested you test them before messing up all your files.


Okay, since I guess you have been duly warned now, here are the files. Author is not responsible for use, misuse or abuse of the following. Use at your own risk.


find -name Makefile -type f -print | sed "s#^.#$(pwd)#" > maout.txt


(have mklist.sh mkdebug.sh and cflagsname in the server(or client) subfolder, then type sh ./mklist.sh maout.txt)



cflagsname


# sed comment - This script changes CFLAGS = to CFLAGS = -g
s/^CFLAGS =/CFLAGS = -g/g

mkdebug.sh


#!/bin/sh
file=$1
echo $file
sfile='ug2'
echo $sfile
#!/bin/sh
more $file | sed -f cflagsname > $sfile
more $sfile > $file
touch $sfile
exit 0;


mklist.sh


#!/bin/sh
bfile='ug5'
gfile='ug7'
wc $1 | awk '{print $1}' > $bfile;
count=$(more $bfile);
echo hello newbies;
while [ $count -gt 0 ]
do
echo hi, I got here;
wc $1 | awk '{print $1}' > $bfile;
count=$(more $bfile);
echo $count;
count=`expr $count - 1`
#a="$a-1";
head -n 1 $1 > $bfile;
b=$(more $bfile);
echo $b;
echo $count;
tail -n $count $1 >> $gfile;
sh mkdebug.sh $b;
rm $1;
#rename $gfile $1 $gfile;
#baddwords7 is the proper file
mv $gfile $1;
touch $gfile;
done