/*
 * BEGIN FLOCK GPL
 *
 * Copyright Flock Inc. 2005-2009
 * http://flock.com
 *
 * This file may be used under the terms of the
 * GNU General Public License Version 2 or later (the "GPL"),
 * http://www.gnu.org/licenses/gpl.html
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * END FLOCK GPL
 */

#include "nsIGenericFactory.h"
#include "flockImageScalerImpl.h"
#include "flockAsyncImageScaler.h"
//#include "flockImageTransformService.h"

#include "nsICategoryManager.h"
#include "nsServiceManagerUtils.h"


NS_GENERIC_FACTORY_CONSTRUCTOR(flockImageScalerImpl)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(flockAsyncImageScaler,
  flockAsyncImageScaler::GetSingleton)
//NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(flockImageTransformService,
//    flockImageTransformService::GetSingleton)

/*
static NS_METHOD
flockImageTransformServiceRegister(nsIComponentManager *aCompMgr,
                                   nsIFile *aPath,
                                   const char *registryLocation,
                                   const char *componentType,
                                   const nsModuleComponentInfo *info)
{
    nsresult rv;
    nsCOMPtr<nsICategoryManager> catmgr = 
        do_GetService (NS_CATEGORYMANAGER_CONTRACTID, &rv);
    if (NS_FAILED (rv)) {
        return rv;
    }

    nsXPIDLCString previous;
    rv = catmgr->AddCategoryEntry("flock-startup",
                                  FLOCK_IMAGETRANSFORMSERVICE_CLASSNAME,
                                  "service," FLOCK_IMAGETRANSFORMSERVICE_CONTRACTID,
                                  PR_TRUE, PR_TRUE, getter_Copies(previous));
    NS_ENSURE_SUCCESS(rv, rv);

    return rv;
}

static NS_METHOD
flockImageTransformServiceUnregister(nsIComponentManager *aCompMgr,
                                     nsIFile *aPath,
                                     const char *registryLocation,
                                     const nsModuleComponentInfo *info)
{
    nsresult rv;
    nsCOMPtr<nsICategoryManager> catmgr = 
        do_GetService (NS_CATEGORYMANAGER_CONTRACTID, &rv);
    if (NS_FAILED (rv)) {
        return rv;
    }

    rv = catmgr->DeleteCategoryEntry("flock-startup",
                                     FLOCK_IMAGETRANSFORMSERVICE_CLASSNAME,
                                     PR_TRUE);
    NS_ENSURE_SUCCESS(rv, rv);

    return rv;
}
*/

static nsModuleComponentInfo components[] =
{
  {
    FLOCK_IMAGESCALER_CLASSNAME, 
    FLOCK_IMAGESCALER_CID,
    FLOCK_IMAGESCALER_CONTRACTID,
    flockImageScalerImplConstructor,
  },
    
  {
    FLOCK_ASYNCIMAGESCALER_CLASSNAME,
    FLOCK_ASYNCIMAGESCALER_CID,
    FLOCK_ASYNCIMAGESCALER_CONTRACTID,
    flockAsyncImageScalerConstructor,
  },

/*
  {
    FLOCK_IMAGETRANSFORMSERVICE_CLASSNAME, 
    FLOCK_IMAGETRANSFORMSERVICE_CID,
    FLOCK_IMAGETRANSFORMSERVICE_CONTRACTID,
    flockImageTransformServiceConstructor,
    flockImageTransformServiceRegister,
    flockImageTransformServiceUnregister,
  },
*/

  {0}
};

NS_IMPL_NSGETMODULE(flockImageScalerModule, components)
