Monday, April 28, 2008

A new tag is born

After the lack of success cloning the canvas tag I decided to try and do the same with a less "complicated" tag. The canvas tag involves more files than most tags therefore making it more difficult to setup all the dependencies correctly in the build system. The best tag to clone after the canvas was the button tag. It is simple yet it requires a custom rendering module. I started from scratch once again and followed the same procedure to clone it. I also decided to call the new tag opengl instead of WebOpenGL because it followed the tag naming convention more closely.
The project built successfully and I could see the opengl tag files in the build log. However, the opengl tag did not render like a button but as a label instead. To ensure that the opengl tag was actually being created I inserted print statements in the constructors of both the tag and the tag's custom renderer. I was disappointed to see that nothing was printed when an opengl tag was created. I examined each of the files were I had made entries to inform the builder to create this new tag. I realized that there was one place in which the button tag was referenced but not the opengl tag. I made the appropriate entry and tried again. Viola! This time both print statements were executed. I had created a new HTML tag.
Even though an instance of the custom renderer was being created, the tag was still not displaying as a button. However, because the ultimate goal was to display a pixel map, I knew that further tweaking was involved so I wasn't too worried.
Next: play around with the custom render in order to display a fixed pixel map when the opengl tag is created.

Monday, April 7, 2008

Working with the build system

After reading over the Bakefile documentation I inserted the WebOpenGL filenames into the appropriate file. However, the build system did not pick up the new files. Also, the build started to fail on a file which I did not edit. I reverted the changes that I had made to ensure that it wasn't caused by anything that I had done. However, the build still failed. After several tries I decided to start up again with a clean copy of WebKit. I saved the files I had changed and the ones I had created and downloaded the WebKit source code again. This took about an hour. I then built WebKit using the clean source and it worked fine although it took about another hour.
After some more reading I realized that WebKit was being build on my machine using qmake. This required a different set of files to be edited. I inserted the appropriate entries into the files and was happy to see that the build system did pick up the new WebOpenGL files.
The first build error I got referred to a missing reference on the webOpenGLTag variable. I soon realized that all the HTML tag names were declared in a file called HTMLTagNames.in. I added the entry webOpenGL to this file and was able to get pass the build error. The second error referred to a missing method name reference.
The next step is to find out where this error is coming from, fix it and hopefully complete the build.