/* * * Custom Widget demo * * File : DSkin.h * Purpose : Defines the Skin add-on * Author : JLV * Creation : 10/26/04 * Last Update : 10/26/04 * * (C) hexaZen 2004 * * This file is part of a demo application for Zinzala. It can be * used, distributed and modified without limitation. * * * $Id$ */ /* * $Log$ */ #include #include /* * Method : cDSkin * Purpose : Constructor * Inputs : * * const tChar *aPath, path of the skin to load * * Output : none * Side Effects : none * */ cDSkin::cDSkin(const tChar *aPath) : cAddOn(aPath) { if(!iFault) { iFunction = (const tBitmapResource *(*)(tUint16 aResourceID))Find("_Z11GetResourcet"); if(!iFunction) iFault = kErrNotFound; } } /* * Method : GetResourceL * Purpose : Get a resource in the skin * Inputs : * * tSkinResource aResource, Resource to get * * Output : tBitmapResource & * Side Effects : This method can leave if the resource is not found * */ const tBitmapResource &cDSkin::GetResourceL(tSkinResource aResource) { if(!iFault) { const tBitmapResource *lRes; lRes = (*iFunction)((tUint16)aResource); if(lRes) return *lRes; else throw uException(kErrNotFound,"cDSkin::GetResourceL"); } else throw uException(iFault,"cDSkin::GetResourceL"); }