2012-12-20 08:49:25 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "ImageMetadata.h"
|
|
|
|
|
|
|
|
#include "RasterImage.h"
|
|
|
|
#include "nsComponentManagerUtils.h"
|
2013-09-07 06:01:08 -07:00
|
|
|
#include "nsISupportsPrimitives.h"
|
2013-09-22 16:14:24 -07:00
|
|
|
#include "nsXPCOMCID.h"
|
2012-12-20 08:49:25 -08:00
|
|
|
|
2014-07-10 08:00:31 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace image {
|
2012-12-20 08:49:25 -08:00
|
|
|
|
|
|
|
void
|
|
|
|
ImageMetadata::SetOnImage(RasterImage* image)
|
|
|
|
{
|
|
|
|
if (mHotspotX != -1 && mHotspotY != -1) {
|
2015-01-19 10:29:00 -08:00
|
|
|
nsCOMPtr<nsISupportsPRUint32> intwrapx =
|
|
|
|
do_CreateInstance(NS_SUPPORTS_PRUINT32_CONTRACTID);
|
|
|
|
nsCOMPtr<nsISupportsPRUint32> intwrapy =
|
|
|
|
do_CreateInstance(NS_SUPPORTS_PRUINT32_CONTRACTID);
|
2012-12-20 08:49:25 -08:00
|
|
|
intwrapx->SetData(mHotspotX);
|
|
|
|
intwrapy->SetData(mHotspotY);
|
|
|
|
image->Set("hotspotX", intwrapx);
|
|
|
|
image->Set("hotspotY", intwrapy);
|
|
|
|
}
|
|
|
|
|
|
|
|
image->SetLoopCount(mLoopCount);
|
|
|
|
}
|
2014-07-10 08:00:31 -07:00
|
|
|
|
|
|
|
} // namespace image
|
|
|
|
} // namespace mozilla
|