2008-09-13 02:42:11 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2008-09-13 02:42:11 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* A class representing three matrices that can be used for style transforms.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsStyleTransformMatrix_h_
|
|
|
|
#define nsStyleTransformMatrix_h_
|
|
|
|
|
|
|
|
#include "nsCSSValue.h"
|
|
|
|
#include "gfxMatrix.h"
|
2011-07-22 15:28:07 -07:00
|
|
|
#include "gfx3DMatrix.h"
|
2008-09-13 02:42:11 -07:00
|
|
|
#include "nsRect.h"
|
|
|
|
|
2010-07-02 21:18:56 -07:00
|
|
|
struct nsCSSValueList;
|
2011-05-25 01:01:11 -07:00
|
|
|
class nsStyleContext;
|
|
|
|
class nsPresContext;
|
2010-07-02 21:18:56 -07:00
|
|
|
|
2008-09-13 02:42:11 -07:00
|
|
|
/**
|
2011-09-26 14:54:45 -07:00
|
|
|
* A helper to generate gfxMatrixes from css transform functions.
|
2008-09-13 02:42:11 -07:00
|
|
|
*/
|
2011-09-26 14:54:45 -07:00
|
|
|
namespace nsStyleTransformMatrix {
|
|
|
|
|
2010-07-02 21:18:56 -07:00
|
|
|
/**
|
|
|
|
* Return the transform function, as an nsCSSKeyword, for the given
|
|
|
|
* nsCSSValue::Array from a transform list.
|
|
|
|
*/
|
2011-09-26 14:54:45 -07:00
|
|
|
nsCSSKeyword TransformFunctionOf(const nsCSSValue::Array* aData);
|
2010-07-02 21:18:56 -07:00
|
|
|
|
2008-09-13 02:42:11 -07:00
|
|
|
/**
|
2011-09-26 14:54:45 -07:00
|
|
|
* Given an nsCSSValueList containing -moz-transform functions,
|
|
|
|
* returns a matrix containing the value of those functions.
|
2008-09-13 02:42:11 -07:00
|
|
|
*
|
2011-09-26 14:54:45 -07:00
|
|
|
* @param aData The nsCSSValueList containing the transform functions
|
2008-09-13 02:42:11 -07:00
|
|
|
* @param aContext The style context, used for unit conversion.
|
|
|
|
* @param aPresContext The presentation context, used for unit conversion.
|
2009-02-04 13:24:18 -08:00
|
|
|
* @param aCanStoreInRuleTree Set to false if the result cannot be cached
|
|
|
|
* in the rule tree, otherwise untouched.
|
2011-07-22 15:28:07 -07:00
|
|
|
* @param aBounds The frame's bounding rectangle.
|
|
|
|
* @param aAppUnitsPerMatrixUnit The number of app units per device pixel.
|
2010-07-02 21:18:56 -07:00
|
|
|
*
|
|
|
|
* aContext and aPresContext may be null if all of the (non-percent)
|
|
|
|
* length values in aData are already known to have been converted to
|
|
|
|
* eCSSUnit_Pixel (as they are in an nsStyleAnimation::Value)
|
2008-09-13 02:42:11 -07:00
|
|
|
*/
|
2011-09-26 14:54:45 -07:00
|
|
|
gfx3DMatrix ReadTransforms(const nsCSSValueList* aList,
|
|
|
|
nsStyleContext* aContext,
|
|
|
|
nsPresContext* aPresContext,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool &aCanStoreInRuleTree,
|
2011-09-26 14:54:45 -07:00
|
|
|
nsRect& aBounds,
|
|
|
|
float aAppUnitsPerMatrixUnit);
|
2008-09-13 02:42:11 -07:00
|
|
|
|
2011-09-26 14:54:45 -07:00
|
|
|
} // namespace nsStyleTransformMatrix
|
2008-09-13 02:42:11 -07:00
|
|
|
|
|
|
|
#endif
|