1967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch/* 2967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * Copyright (C) 2010 Google Inc. All rights reserved. 3967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * 4967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * Redistribution and use in source and binary forms, with or without 5967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * modification, are permitted provided that the following conditions 6967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * are met: 7967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * * Redistributions of source code must retain the above copyright 8967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * notice, this list of conditions and the following disclaimer. 9967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * * Redistributions in binary form must reproduce the above copyright 10967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * notice, this list of conditions and the following disclaimer in the 11967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * documentation and/or other materials provided with the distribution. 12967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * 13967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY 14967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 17967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch */ 25967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 26967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch#include "config.h" 27967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch#include "DeviceOrientation.h" 28967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 29967717af5423377c967781471ee106e2bb4e11c8Ben Murdochnamespace WebCore { 30967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 31967717af5423377c967781471ee106e2bb4e11c8Ben MurdochPassRefPtr<DeviceOrientation> DeviceOrientation::create() 32967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 33967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch return adoptRef(new DeviceOrientation); 34967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 35967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 36967717af5423377c967781471ee106e2bb4e11c8Ben MurdochPassRefPtr<DeviceOrientation> DeviceOrientation::create(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) 37967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 38967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch return adoptRef(new DeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma)); 39967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 40967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 41967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 42967717af5423377c967781471ee106e2bb4e11c8Ben MurdochDeviceOrientation::DeviceOrientation() 43967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch : m_canProvideAlpha(false) 44967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch , m_canProvideBeta(false) 45967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch , m_canProvideGamma(false) 46967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 47967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 48967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 49967717af5423377c967781471ee106e2bb4e11c8Ben MurdochDeviceOrientation::DeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) 50967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch : m_canProvideAlpha(canProvideAlpha) 51967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch , m_canProvideBeta(canProvideBeta) 52967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch , m_canProvideGamma(canProvideGamma) 53967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch , m_alpha(alpha) 54967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch , m_beta(beta) 55967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch , m_gamma(gamma) 56967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 57967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 58967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 59967717af5423377c967781471ee106e2bb4e11c8Ben Murdochdouble DeviceOrientation::alpha() const 60967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 61967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch return m_alpha; 62967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 63967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 64967717af5423377c967781471ee106e2bb4e11c8Ben Murdochdouble DeviceOrientation::beta() const 65967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 66967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch return m_beta; 67967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 68967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 69967717af5423377c967781471ee106e2bb4e11c8Ben Murdochdouble DeviceOrientation::gamma() const 70967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 71967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch return m_gamma; 72967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 73967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 74967717af5423377c967781471ee106e2bb4e11c8Ben Murdochbool DeviceOrientation::canProvideAlpha() const 75967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 76967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch return m_canProvideAlpha; 77967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 78967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 79967717af5423377c967781471ee106e2bb4e11c8Ben Murdochbool DeviceOrientation::canProvideBeta() const 80967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 81967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch return m_canProvideBeta; 82967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 83967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 84967717af5423377c967781471ee106e2bb4e11c8Ben Murdochbool DeviceOrientation::canProvideGamma() const 85967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch{ 86967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch return m_canProvideGamma; 87967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} 88967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch 89967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch} // namespace WebCore 90