2009-10-11

Woopsi Testing and Fixes

Now that I have time again, I’m back to working on Woopsi. Something I haven’t really done yet is any extensive testing of the gadgets. I’ve checked that the obvious functionality works as I develop the system, but not that all of the functionality works for each gadget. To that end, I’m writing tests for each gadget.

So far, the CycleButton and RadioButtonGroup gadgets both have test suites written. The test program checks that the gadgets can be shelved, unshelved, hidden, shown, enabled, disabled, moved, resized, redimensioned (simultaneous move and resize) and that they produce the correct preferred dimensions. The test system also checks that they fire the expected events when interacted with.

The test system has enabled me to identify and fix a number of bugs. The CycleButton now produces the correct values when getPreferredDimensions() is called. The same is true of the RadioButtonGroup. The latter also redraws correctly when resized. Another bug spotted was in the base Gadget class - its enable() and disable() methods weren’t redrawing.

The last bug fixed is in the Gadget::clipRectToHierarchy() method. In the last set of changes I made this function non-recursive, but did so in such a way that the function did not clip a gadget to its immediate parent’s dimensions.

One bug I’ve spotted but haven’t fixed yet involves the show/hide/shelve/unshelve systems. Imagine gadget A overlaps button B but is hidden. Clicking button B shows gadget A. Upon clicking and releasing the button, gadget A is redrawn in place. Button B is then redrawn to show its newly unclicked state, but button B is actually drawn over the top of gadget A. Somewhere along the line, button B’s rect cache isn’t being flushed when it should so it draws over space that no longer belongs to it.

Comments

mrswilson on 2009-10-18 at 15:20 said:

Hi! I would like to develop an application for the DS and found woopsi. I guess that's what I need :) There is one problem though: I am a java-programmer, not a c-programmer. I mean, I will learn C and cpp, but I need examples for that. I still have some problems with makefiles and such things. I usually learn by examples. So, is there a possibility, that you could offer a very simple example or even just a template for an empty project? Including makefile? bambi eyes Greetings from Germany, ...Nicole

Ant on 2009-10-19 at 12:29 said:

If you've downloaded the latest DS sourcecode (the file called "woopsi-src-0.38.zip") from SourceForge, you can find a number of examples already written. Inside the "Woopsi/examples" folder, there are 12 demonstrations of Woopsi, including demos of the calendar gadget, context menu, keyboard and file requester. There's also a small but functional paint program (WPaint) and two Hello World examples. Each folder includes makefiles that will work for any project (though the file requester demo includes minor modifications to include the DS FAT library).

To get up and running with Woopsi (assuming you're using Windows; for other OSs the steps are pretty much the same):

  • Download and install DevKitPro;
  • Download and unzip the latest version of Woopsi to somewhere on your hard disk (ensure that the path does not include spaces, as they still caused problems with DevKitPro last time I checked);
  • Open a DOS prompt and CD into one of the Woopsi examples;
  • Type "make";
  • Open the resultant ROM (from the subdirectory "Release") with a DS emulator of your choice.

The simplest way to create a new Woopsi project is to take one of the existing examples (ie. "helloworld") and modify it as you need to.

mrswilson on 2009-10-21 at 11:44 said:

I had another version of woopsi. Seems to be a mac version. I don’t remember where I got that from. Hm. Your version is better. I have devkitPro already and already made some simple apps with palib, so I guess I will get along with that. I just missed some examples. Thanks a lot! …Nicole

Ant on 2009-10-21 at 13:26 said:

The Mac version is my debugging environment - it was the main download on the SourceForge page until the other day when I realised and changed it to the DS version. It’s next to impossible to debug complicated problems using just a DS or emulator, so the Mac version is set up to use Woopsi’s built-in hardware abstraction layer and compile natively for the Mac. That means I can debug Woopsi as though it was any other native Mac program. The abstraction layer uses SDL, so (with a bit of work getting the environment set up for your OS) Woopsi - and indeed any program that uses Woopsi and doesn’t touch the DS hardware - will happily compile as a native Windows, Linux and OSX binary.

The Mac version doesn’t come with the doxygen documents, examples and other support code.

Feel free to use the forum if you need any help in making Woopsi applications. There isn’t much in the way of documentation at the moment, and won’t be until I’ve got a few more features finished, so the forum is the best way to learn.

mrswilson on 2009-10-21 at 19:54 said:

The best way for me is to learn by examples and a list of all classes and methods (do you call it method in cpp? well you do in java ;) ) Java has something called javadoc. You just write a comment at each function and javadoc generates a whole “documentation” with all classes, subclasses, functions and so on. This seems to be the same thing for cpp: http://www.batchconverter.com/CppDoc-download-10744.shtml I haven’t testet it though. I’m still fighting with more basic things ;) Thanks a lot for your help again! I hope I can present my first app soon ;) …Nicole

Ant on 2009-10-21 at 19:58 said:

C++ doesn’t have an “official” javadoc implementation, but there are a number of unofficial solutions around. Woopsi uses Doxygen to generate documentation, which is included in the “doxygen-docs” folder with Woopsi. Open the “index.html” file in a browser and you’ll see the documentation for virtually every class and method in the system. Doxygen’s syntax is very similar to javadoc, with a few additions.

mrswilson on 2009-10-22 at 07:07 said:

You’re great :)

ant.simianzombie.com » Woopsi 0.39 Released on 2009-10-24 at 14:15 said:

[…] are two important fixes that haven’t been mentioned on the blog before. Firstly, the problem detailed on the 11th in which overlapping gadgets were drawn incorrectly is now […]