Kodi Community Forum

Full Version: How do views work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone please explain to me how views work? What is a "view" as opposed to a "window" - my understanding is that they are both just IDs? Are there predefined view IDs for the specific type of view that you are creating, and if so can you please point me in the direction of this list?

Thanks
Really you are using the parent "window", like myvideonav.xml, the "views" like:

Viewtype_Poster.xml
Viewtype_Files.xml
Viewtype_Banner.xml

Are just for organization and ease of coding....

There are no predefined ID's for views but seems like everyone uses id="50" as the file view. Most people use 50-59 for views and if need to branch out use 500 and up. Not a requirement to use 500 and up but after digging thru tons of skins I'd say thats the most common practice..
AaronD: I presume this is for coding up that patch.

If so, just take spiff's diff and alter it as per his comment on trac.

Essentially the following logic is used to determine which view to show in XBMC:

1. We query the ViewModes.db for the appropriate window and path, and retrieve a viewmode integer that is composed of the actual view id from the skin, plus the view <type> from the skin as well (there's about half a dozen different types the skinner can choose from).

2. We then send that to GUIViewControl which runs through the views the skinner has supplied and tries to find one that matches - we first look for the ID and use that. If that fails we try based on type (i.e. we look for a matching view container of the same type). If that fails we fall back to the first one.

You'd basically be changing step 1 above.

Cheers,
Jonathan
jmarshall Wrote:AaronD: I presume this is for coding up that patch.

If so, just take spiff's diff and alter it as per his comment on trac.

Ok, thanks. I just wanted to understand how this part works without just doing anything blind.

mcborzu, thanks.