|
a) Name and comments (line 1-3)

The first section of your XML should be a comment section that briefly explains the functionalities of the file. This way it will be easy for others to read and understand your code.
b) Elements definition (line 4-18)

This section defines all the elements in your skin. This is the part that links the graphics to a "bitmap id" that other XML code can refer to. For example, line 11 links a bitmap id, "blue-player.button.previous", to a graphics component in "player/blue/blue-previous.png" file. That bitmap id is also linked to a gamma group called "Buttons". After linking that object to a gamma group, user can adjust the color variance of that object in the preference menu. Therefore, even if that object is blue right now, you can change it so that it'll appear to be a different color.
As your skin becomes more complex, you will have many elements defined in your skin. It will be useful to break the <Elements> definitions into different files. Typically, one would define all the elements in each component in separate files. For example, elements in the main player will be in "player-elements.xml" and elements in the playlist will be in "pledit-elements.xml".
c) Playback Buttons Group Definition (line 19-64)

Sometime a group of objects naturally belong together or are located next to each other. If you move one of them, chances are that you'll be moving the rest of them. The playback buttons is an excellent example. If you want to change the location of those button, rather than moving each element independently, you can define a group and move the group together. A group is a set of objects that can be referred to and manipulated as a whole. It is a like a bag to throw your stuff into. It first must be defined by a <groupdef> tag, then can be located with a <group> tag. In section 2.5, we're going to dissect it even more.

d) Song File Information and Visualization Group Definition (line 65-107)

SongInfo group is another group definition just like the Playback Buttons group. As you can see that the elements defined inside this group is different from the previous one. In this example, we're using elements other than buttons. We're using the layer to set the background color of two areas. A layer is basically an image. Layers can overlay on top of each other. It is similar to a layer in Adobe Photoshop. "Songinfo" and "infoline" are text objects displaying information stored within Winamp3 runtime variables.

e) Main Window: Container and Layout (line 1-3)

Previous sections are all about defining objects. Now we get to start using them. If you read the code, you'll see that there is a container object, a layout object and two group objects. Container is at the top of hierarchy because everything else "lives" in it. Within the container, we have defined a layout and, within the layout, we're using the groups we defined earlier.
Container, layout and group are important concepts and we will go more in depth in subsequent sections. Read on...
|