Digg!-
x -

Test Applications


Note: These test applications currently all contain Windows specific code. Once I have versions of LLMozLib that suport Mac OS X and Linux platforms, I'll also endeavor to port these test apps too. I'd really appreciate some help with this!

uBrowser

Here are some brief instructions and a description of what the various controls do.

  • When the application starts it opens the pre-defined home page.

  • You can reposition and resize the application window as you wish

  • You should be able to interact with most sites normally using the mouse and keyboard

  • You can enter a new URL manually by typing into the URL edit field and pressing ENTER (this version of GLUI doesn't support cut/paste unfortunately)

  • Due to a limitation of GLUI (or a limitation of my understanding) I wasn't able to return focus to the UI when you click in the URL edit widget. This meant that once you clicked on a page, you were unable to enter text in the URL widget. A quick fix for this was to disable the URL widget when you click on the page to indicate what's happening and add a 'Focus' button. Not the best solution but it does the job for now.

  • The '<<<' (back), 'HOME' and '>>>' (forward) buttons work as you might expect

  • I've made a list of bookmarks that you can select. I've tried to choose ones that illustrate the wide range of sites and technologies that are supported (AJAX, SHTML, XUL, SVG etc.)

  • You can select the type of geometry that is used to display the page.
    • Cube - writes a different page to each side of the cube
    • Flat - is a single quadrilateral - just like having a regular browser (sort of)
    • Ball - My favorite - completely useless to but there is something I like about it. Google Maps on it looks especially good!
    • Flag - More to demonstrate that it can be done that anything useful. Something quite pleasing about it

  • You can rotate the geometry to a pre-defined position using the buttons at the side. This works best when the cube geometry is selected.

  • You can change the position, orientation and scale of the geometry by clicking on the 'Rotate', 'Translate' and 'Scale' controls. Hold the mouse down over them and move - you'll soon get the idea.

  • If (when) :) you get hopelessly lost, press the 'Reset' button to restore the default view

  • You can change the size of the embedded browser window by pressing the 'small', 'medium' and 'large' buttons. Since, in this application, the browser window is always stretched to fill the geometry, the smaller the browser window, the larger it renders - (if that makes any sense)

  • Pressing the 'Exit' button, as you might expect, quits and returns you to the OS.

  • You'll see status and progress messages at the bottom - just like a real browser!

testGL

This is a much simpler application - it doesn't do much but is much easier to understand that uBrowser. It uses OpenGL to render a single URL onto a polygon which is stretched to the size as the application window. All output is written to the debugging console.

screenGrab

This command line application illustrates how to render a page to memory and then save that page to an file as an image.

  • Usage is: screengrab <url> <width> <height> - for example, screengrab http://news.google.com 4000 4000

  • The output is a 32bit uncompressed Targa (.tga) file. Most image viewers will be able to display them. I use IrfanView - it's great and you can download it here: http://www.irfanview.com

  • I write Targa files because I needed something that supported 32bit RGBA files and as far as I could tell, they are the easiest format to write that supports this. (.ppm doesn't appear to support this bit depth).

  • Notice that the size of the saved page isn't always the same as what was requested - the 800 x 3400 ends up as 801 x 3400. This might be a bug in the Mozilla code since it doesn't appear to be a bit/byte boundary type rounding calculation.

  • This could be the basis of quite a nice page capture application - roll it into a GUI application, add support for other output file types and it'd be quite useful.

  • There are some Win32 specific calls in the code - mostly in screenGrab::eventLoop() - I don't imagine it would be too hard to find similar functions for other OSs and get this working on other platforms.