plugins are strange creatures and live a strange life, they are in fact loaded twice before paint is ever called , and as you have both discovered the paint and the action are the easy part
now comes the real *fun* part making it configurable
(these normally call Invalidate)
PE_TIMER (via SetSingleShotTimer)
for PluginEvent rather than WindowEvents etc
there are loads more look for plugin events in the SDK, but don't go trying to capture the up or down keys as thats real hackery.
You are correct that initialize is the only oppurtunity to parse the xml, this is done outside as it were of an actual real instance of your plugin in that it runs outside of home.exe. The first time your plugin loads its parse the xml, this is because the xml parser is very prome to memory leaks so if it happened inside hom.exe as it were then it would bomb your phone so its a helper process on "cold boot" or first load.
then you need to implement
where you save the xml that you have just parsed and other things of interest.
The next time your plugin loads it calls
this loads all the information that you have parsed in intialize and stored in save ............................................ and sets the plugin state (its created in the meantime and loaded whrn the home.exe state is streamed in as it were)
To get the idea of what happening think of a "Helper function" thats sits outside home.exe in this "function" the process is
1. read in xml file
2. Create Plugin
3. Initialize plugin
4. Stream Out/ Save plugin
5. Destroy plugin
The process that occurs within home.exe is different as the plugin reads itself rahter than initialze itself. THis is done so that hom.exe remains responsive (and running) during setting changes.
1. Stream in home.exe state
2. create plugins
3. stream in plugin state
4. handle actions
Once you have all that mastered the next joy is attempting to get the homescreen colours as 2002 doesn't offer the new getcolor function and don't bother going looking for them in syscolor either as the 4 plugin colours aren't saved there either
This has to be saved out into intialize to as there are no apis for it, so you need to know how to ascretain the appropriate colour scheme get the colours out and convert them to syscolors etc.
Plugins are tricky and not the simplest beast to handle or control and memory leaks are a *real* headache you must capture even the small ones as they mount up over a power cycle as it were (home.exe doesn't die till you turn it off, or load a new homescreen) .....
Then I guess its the bgimage support in the format tags and all the default font settings etc as well as those from within your plugin (padding, alignment etc).
oh how we *wish* for a getFormat ............
I hope this has helped and given you an idea on where to start.
I can't help but think the real innovation with a plugin is actullay building one that use the homescreen colours rather than those set in the format tag on a 2002 device.