Difference between revisions of "Theme Management API"

From WebOS Internals
Jump to navigation Jump to search
(New page: == Theme Management API == This is an initial attempt at hashing out a secure, reliable Theme Management API. One of the main goals is to modify as little as we can of stock Palm files. ...)
 
(1)
Line 1: Line 1:
 
== Theme Management API ==
 
== Theme Management API ==
  
This is an initial attempt at hashing out a secure, reliable Theme Management API.  One of the main goals is to modify as little as we can of stock Palm files.  The first step is launcher icon replacement, which currently consists of overwriting/replacing icon.png files.  
+
This is an initial attempt at hashing out a secure, reliable Theme Management API.  One of the main goals is to modify as little as we can of stock Palm files.   
 
+
   
=== Launcher Icons ===
+
# Create a new theme folder in /media/internal/.themes/thisTheme/
 
+
# In that new folder, place a file for each image that you intend to theme.  
Instead of replacing icon.png files, the new theme API will use C service to call applicationManager/updateLaunchPointIcon {} service method. This will change a launcher icon on the fly.
+
## The new file must be placed in the exact same relative path as before... that is to say, if the file was previously at /usr/palm/images/1.png then the new file must be at /media/internals/.themes/thisTheme/usr/palm/images/1.png  
 
+
#: The new file must have the same name, and be of the same type as the original file.
=== Overwrite CSS classes ===
+
# The themer must include a file for each CSS file that he wants to theme...
 
+
#: If the css file being overridden is an application css, it must be placed in the exact same relative path as it would have been in the application. 
The next part of themeing will be overwriting CSS classes (of any app's stylesheet as well as Palm stock global stylesheets). This will require a small patch to the framework to load a theme's CSS on top of any css being loaded.   
+
#:: If the original application was /usr/palm/applications/phone/stylesheets/phone.css  the theming css must be in /media/internals/.themes/thisTheme//usr/palm/applications/phone/stylesheets/theme.css
 
+
#:: the theming file must ALWAYS be called "theme.css"
=== Theme Designer API ===
 
 
 
In order to accomplish the icon and css replacements/overwrites, designers will put full paths to icon.png files for any app they want to replace the launch icon for inside of their theme directory. They will also put full paths to any CSS file including a class they would like to overwrite in their theme directory.
 
 
 
Each theme will supply a THEME_DIR consisting of these elements, for example a tiny theme that replaced messaging launcher icon and changed the symbol popup selected character color from blue to red would consist of a theme directory we will name tmapi_example will be supplied with the following:
 
 
 
tmapi_example/usr/palm/applications/com.palm.app.messaging/icon.png
 
tmapi_example/usr/palm/frameworks/mojo/submissions/200.72/stylesheets/global.css
 
 
 
The global.css would contain only:
 
 
 
span.selected-char {
 
  color: red;
 
}
 
 
 
 
 
"Installing" the theme would simply be moving the tmapi_example directory to /media/internal/.themes/
 
 
 
.ipk files containing themes installing them /media/internal/.themes will be possible for easy preware installation of themes.
 

Revision as of 21:56, 29 January 2010

Theme Management API

This is an initial attempt at hashing out a secure, reliable Theme Management API. One of the main goals is to modify as little as we can of stock Palm files.

  1. Create a new theme folder in /media/internal/.themes/thisTheme/
  2. In that new folder, place a file for each image that you intend to theme.
    1. The new file must be placed in the exact same relative path as before... that is to say, if the file was previously at /usr/palm/images/1.png then the new file must be at /media/internals/.themes/thisTheme/usr/palm/images/1.png
    The new file must have the same name, and be of the same type as the original file.
  3. The themer must include a file for each CSS file that he wants to theme...
    If the css file being overridden is an application css, it must be placed in the exact same relative path as it would have been in the application.
    If the original application was /usr/palm/applications/phone/stylesheets/phone.css the theming css must be in /media/internals/.themes/thisTheme//usr/palm/applications/phone/stylesheets/theme.css
    the theming file must ALWAYS be called "theme.css"