In my mind, one of the most important things when developing anything - from the simplest script to the most complex, multi-tier application with multiple developers - is organization. From understanding existing protocols to creating your own and following them, consistent organization makes everything much more clear, not only to yourself but to others who may have to work with your project.
I find that organizing the files within the theme makes things easier to find later, and makes the purpose of the various files more clear. My theme directory is organized as follows:
ThemeRoot/
- usually a variation of your theme name, this is where all of the files for your theme reside*.xml
- all XML files, including the required base.xml
, menu-ui.xml
, and themeinfo.xml
files, reside at the root of your theme directoryfonts/
- all fonts used in your theme reside herefont1/
font2/
- unless a font is entirely defined in one file (which it never should be - there always should be a license file), store fonts in separate folders with all required filesimages/
- all large-format images (e.g. backgrounds), including your preview image, reside hereicons/
- all small-format images (e.g. menu button images) reside heremenu/
recordings/
music/
- icons that are used on specific screens or for a particular purpose should be separated into foldersshared/
- icons that are used in multiple places can reside in a common locationThe images
and icons
folders certainly can be combined if they each contain only a few files and folders.
Because writing themes really does involve writing code, your code should be organized. My writing style is derived from a lot of different coding styles. There are some coding style suggestions in the MythTV wiki, and I certainly add to them here in this tutorial. Use what you like; ignore what you do not.
I code both on Windows machines and on Linux machines. Color-coding, line numbers, and intelligent indents are must-haves for me, but I really do not need anything more than that for MythTV theme development. So, instead of using a bloated, full-blown IDE, I use a simple but intelligent text editor. On Windows machines, I use Notepad++. On Linux machines, gedit suits me just fine.
Please be courteous when redistributing others' work with your themes. Respect the licenses contained in the work.