You probably need to read the Skinning Manual. The skinning engine is quite complex and powerful
http://kodi.wiki/view/Skinning_Manual
The window ids are hard coded for built in windows - its only for custom windows that you can define a window id (between 1100 and 1199).
Database is supplied to the view ids defined by the <view> tags in the various MyXXXXX.xml windows depending on what part of the library you are in. ListItem refers to that particular item in the list.
For instance:
Code:
ActivateWindow(videos,videodb://movies/titles/,return)
Will open MyVideoNav.xml at the videodb://movies/titles node of the video library (i.e. all your movies). This will be the content of the list.
There are controls in MyVideoNav.xml that can be used to change how the list is sorted and to cycle through the views you have defined.
The thing you have to remember is that the skinning engine has evolved dramatically over the course of development from xbmp to xbmc to kodi. This started as a homebrew app for a soft or hard modded original xbox (I still have one lying around in a cupboard somewhere that runs Atlantis iirc -- long time since I used it). There has been a lot of effort to consolidate how the skinning engine works but there is still a lot of legacy stuff in there so things can seem a little mismatched or "magic" at times.
I really do recommend starting out by making some modifications on an existing skin, because once you get your head around it, the skinning engine is pretty straightforward for the most part. But if you start with a blank slate you are going to be working very hard just to get things to work as there are many aspects of the skinning engine that can be finicky and if you don't make the right ritual sacrifice the skinning gods will curse you with a blank screen and no explanation why... But seriously, if it were a proper programming language I would suggest going from scratch, but really it is much simpler than even html; but if you don't have the right controls in the right window things will just refuse to work - its a case of everything has to be there or else nothing works.