While I was using a different style map - I started with a copy of the standard one - the use of absolute paths only bothered me. Now I implemented a new type “File”. The parser checks if there is an attribute called “absolute”. If not, or if it is set to “false”, the path is added to the path of the current document. The style elements in the main xml file work the same.
What do you think about this, @t0neg0d?
Personally, I don’t like spending too much time on grafics and so on. I prefere having someone else to do this. But if this person cannot or should not recompile the whole application, the styles should be usable for a default position, too. Of course not every window has the same position. My solution would be to define a new style element for all those windows. In the code you could create a new Window(screen, (uid,) “elementName”) and it takes position, dimension etc. from the xml.
But this is still not enough for a good solution, the display resolution might change and the whole GUI would no longer be useful. Another case would be huge variety of different display sizes on Android.
I implemented variables, which can be used in the xml files, along with basic math operations. Some standard variable would be app.height and app.width. And hopefully the pixel density for mobile devices can be stored in such a variable too.
All of this is working on my local version, now I could use some feedback on my ideas. If requested, I will upload my code for open use!
PS: While working on the parseStyles method, I saw some strange code. For example you do iterate through the nodeList, but inside the loop you always use item(0). And the file is alwys reloaded. Did I miss the reason for that?