2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file view_logic_orientation_support.cpp
18 * @author Jihoon Chung (jihoon.chung@samsung.com)
22 #include "view_logic_orientation_support.h"
24 #include <dpl/log/log.h>
25 #include <widget_data_types.h>
29 namespace ViewModule {
31 int OrientationSupport::getWinOrientationAngle(int ewkOrientation)
34 if (ewkOrientation & EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY) {
35 angle = OrientationAngle::Window::Portrait::PRIMARY;
36 } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_PRIMARY) {
37 angle = OrientationAngle::Window::Landscape::PRIMARY;
38 } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY) {
39 angle = OrientationAngle::Window::Portrait::SECONDARY;
40 } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_SECONDARY) {
41 angle = OrientationAngle::Window::Landscape::SECONDARY;
43 LogDebug("Wrong orientation value is passed");
49 int OrientationSupport::getW3COrientationAngle(int ewkOrientation)
52 if (ewkOrientation & EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY) {
53 angle = OrientationAngle::W3C::Portrait::PRIMARY;
54 } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_PRIMARY) {
55 angle = OrientationAngle::W3C::Landscape::PRIMARY;
56 } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY) {
57 angle = OrientationAngle::W3C::Portrait::SECONDARY;
58 } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_SECONDARY) {
59 angle = OrientationAngle::W3C::Landscape::SECONDARY;
61 LogDebug("Wrong orientation value is passed");
67 void OrientationSupport::setEwkOrientation(Evas_Object* ewk,
70 LogDebug("setOrientation called");
71 ewk_view_orientation_send(ewk, angle);