Changes between Version 1 and Version 2 of IconTutorial


Ignore:
Timestamp:
Dec 27, 2007, 11:53:23 AM (17 years ago)
Author:
cinc
Comment:

Started description of icon ini file

Legend:

Unmodified
Added
Removed
Modified
  • IconTutorial

    v1 v2  
    1 === Icon Tutorial ===
     1= Icon Tutorial =
    22
    3 This page describes how to create icons for the WPS-Wizard icon engine. One of the key features of the engine is that you don't have to paint every single icon in an image manipulation application. Instead there is support for icon composing which means you build your image using several parts which are blended together. For example one choses a base icon and another icon is resized and painted on top of that one and maybe additional text is added. The resulting icon is not stored as an image on  the users system but only the paint commands are recorded and the image is constructed on the fly as soon as the icon is loaded by the system.
     3This page describes how to create icons for the WPS-Wizard icon engine. One of the key features of the engine is that you don't have to paint every single icon in an image manipulation application. Instead there is support for icon composing which means you build your image using several parts which are blended together. For example one choses a base icon and another image is resized and painted on top of that one and maybe additional text is added. The resulting image is not stored as an icon on the users system but only the paint commands are recorded in an initialization file and the image is constructed on the fly as soon as the icon is loaded by the system.[[BR]]
     4The images used for compositing have PNG format so alpha blending can be used.
    45
     6Note: when talking about 'icon' in the following text an icon built by the icon engine is meant not one of the default eCS system icons.
     7
     8
     9== How icons are stored ==
     10
     11The engine uses paint commands recorded in an initialization file which are interpreted during icon loading. A pointer to the folder holding this ini file is stored in the users ini file '''OS2.INI''':
     12
     13
     14{{{
     15   Application key name:  IconTheme
     16   Key name:              IconFolder
     17   Contents:              Path to folder holding the INI file
     18}}}
     19
     20Be sure to keep the spelling for the keys.
     21
     22
     23=== Format of the initialization file ===
     24
     25The name of the initialization file must be:
     26
     27
     28{{{
     29   WPSWIZ-THEME.INI
     30}}}
     31
     32
     33All images used for composing icons are located in the directory holding the ini file or a subdirectory of it. The engine uses the ini file loction as an anchor and searches all parts referenced in paint commands relative to this anchor point.
     34
     35Icons are searched based on the objects class name and the object ID. Custom icons created from the settings notebook of an object are referenced using a numeric key. This is not described here.
     36
     37----
     38
     39For every class in the system there may be a unique icon. This is used when no object specific icon can be found.
     40
     41{{{
     42   Application key name:  Class name, e.g. CWDataFile, WPFolder, AMouse
     43   Key names:             Various, will be described later
     44   Contents:              Paint commands and references to files 
     45}}}
     46
     47Note that the application key name must reflect the exact spelling of the class.
     48
     49----
     50
     51For an object specific icon the object ID is used as the application key:
     52
     53{{{
     54   Application key name:  Object ID, e.g. <XWP_SCREEN>, <WP_OS2SYS>, <WP_DESKTOP>
     55   Key names:             Various, will be described later
     56   Contents:              Paint commands and references to files 
     57}}}
     58
     59The application key must be exactly like the ID, this includes the opening and closing braces.
     60
     61----
     62
     63The Search order for icons is the following:
     64
     65 1. Object specific icon referenced by numeric ID
     66 1. Object specific icon referenced by object ID
     67 1. Class specific icon referenced by class name
     68 1. Object specific eCS icon
     69 1. Class specific eCS icon
     70
     71As can be seen the icon engine will fall back to the eCS icon handling when no engine icon can be found.
     72