Carbide.c++

com.nokia.carbide.cdt.builder
Class ImageMakefileViewPathHelper

java.lang.Object
  extended by com.nokia.carbide.cdt.builder.ImageMakefileViewPathHelper

public class ImageMakefileViewPathHelper
extends java.lang.Object

Helper to resolve paths used in image makefiles.

mifconv has some implicit search paths, as evidenced by this standard comment:

        # NOTE 2: Usually, source paths should not be included in the bitmap
        # definitions. MifConv searches for the icons in all icon directories in a
        # predefined order, which is currently \s60\icons, \s60\bitmaps2.
        # The directory \s60\icons is included in the search only if the feature flag
        # __SCALABLE_ICONS is defined.
        
(We ignore the distinction about __SCALABLE_ICONS and always search this directory.)

This helper class is needed because the to-be-searched files do not have source paths in the makefile, but are resolved in the view into project-relative paths anyway. We need to un-projectize such paths to see if their files are in the standard directories or not and do the reverse when converting back to the view.


Constructor Summary
ImageMakefileViewPathHelper(IImageMakefileData data, ISymbianBuildContext[] configurations)
          Construct an instance using the given image makefile data, to provide the project root, and the build configurations of interest.
ImageMakefileViewPathHelper(IImageMakefileView view, ISymbianBuildContext[] configurations)
          Construct an instance using the given image makefile view, to provide the project root, and the build configurations of interest.
 
Method Summary
 IPath findCandidateImagePath(IPath path)
          Look up a candidate for the image referenced by the path from an IImageSource.
 IPath findCandidateMaskPath(IImageSource imageSource)
          Look up a candidate for the mask referenced by the given IImageSource.
 IPath simplifyStandardImagePath(IPath path)
          Convert a path that may reference an EPOCROOT-relative image file into a view path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageMakefileViewPathHelper

public ImageMakefileViewPathHelper(IImageMakefileView view,
                                   ISymbianBuildContext[] configurations)
Construct an instance using the given image makefile view, to provide the project root, and the build configurations of interest.

Parameters:
view - the non-null image makefile view (does not take ownership)
configurations - the build configurations (may not be null)

ImageMakefileViewPathHelper

public ImageMakefileViewPathHelper(IImageMakefileData data,
                                   ISymbianBuildContext[] configurations)
Construct an instance using the given image makefile data, to provide the project root, and the build configurations of interest.

Parameters:
view - the non-null image makefile view (does not take ownership)
configurations - the build configurations (may not be null)
Method Detail

findCandidateImagePath

public IPath findCandidateImagePath(IPath path)
Look up a candidate for the image referenced by the path from an IImageSource.

This first tries to resolve a relative path to the expected project-relative location, then searches the standard locations. If nothing is found, the non-existing project-relative file is returned. For absolute paths, the path itself (existing or not) is returned.

Parameters:
path - relative or absolute path from a IImageSource
Returns:
path for an existing or candidate file, either relative for project-relative files or absolute for filesystem path

findCandidateMaskPath

public IPath findCandidateMaskPath(IImageSource imageSource)
Look up a candidate for the mask referenced by the given IImageSource. The source's maskpath may be non-null or null. If null, we try to find anything that conceivably goes with the image. If non-null, we look for this file, possibly changing the extension. (Blame this on mifconv.)

The file search behavior otherwise follows findCandidateImagePath(IPath).

Parameters:
path - relative or absolute path from a IImageSource
Returns:
path for an existing or candidate file, either relative for project-relative files or absolute for filesystem path

simplifyStandardImagePath

public IPath simplifyStandardImagePath(IPath path)
Convert a path that may reference an EPOCROOT-relative image file into a view path. Finally, convert the path to one suitable for the view's IImageSource. This is the inverse of #findCandidateImagePath().

Parameters:
path - either a relative path, taken as project-relative, or a full path, which is a filesystem full path
Returns:
if path is absolute and resolves to standard image lookup directory, a file relative to the Makefile; else, the IImageSource-appropriate path.

Carbide.c++