Lifecycle controller
[platform/core/uifw/dali-adaptor.git] / adaptors / x11 / virtual-keyboard-impl-x.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include "virtual-keyboard-impl.h"
20
21 // EXTERNAL INCLUDES
22 #include <X11/Xlib.h>
23 #include <Ecore_X.h>
24 #include <algorithm>
25
26 #include <dali/public-api/common/vector-wrapper.h>
27 #include <adaptor.h>
28 #include <dali/integration-api/debug.h>
29
30 // INTERNAL INCLUDES
31 #include <locale-utils.h>
32 #include <imf-manager-impl.h>
33
34
35 namespace Dali
36 {
37
38 namespace Internal
39 {
40
41 namespace Adaptor
42 {
43
44 namespace VirtualKeyboard
45 {
46
47 void RotateTo(int angle)
48 {
49   // Get focus window used by Keyboard and rotate it
50   Display* display = XOpenDisplay(0);
51   if (display)
52   {
53     ::Window focusWindow;
54     int revert;
55     // Get Focus window
56     XGetInputFocus(display, &focusWindow, &revert);
57
58     ecore_x_window_prop_property_set(focusWindow,
59                                       ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
60                                       ECORE_X_ATOM_CARDINAL, 32, &angle, 1);
61     XCloseDisplay(display);
62   }
63 }
64
65 } // namespace VirtualKeyboard
66
67 } // namespace Adaptor
68
69 } // namespace Internal
70
71 } // namespace Dali