Git init
[platform/core/appfw/app-core.git] / src / appcore-rotation.c
1 /*
2  *  app-core
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22
23 #include <errno.h>
24 #include <stdlib.h>
25 #include <unistd.h>
26
27 #include <sensor.h>
28 #include <vconf.h>
29
30 #include "appcore-internal.h"
31
32 #define LCD_TYPE_KEY "memory/sensor/lcd_type"
33
34 struct rot_s {
35         int handle;
36         int (*callback) (enum appcore_rm, void *);
37         enum appcore_rm mode;
38         int lock;
39         void *cbdata;
40         int cb_set;
41         int sf_started;
42 };
43 static struct rot_s rot;
44
45 struct rot_evt {
46         enum accelerometer_rotate_state re;
47         enum appcore_rm rm;
48 };
49
50 static struct rot_evt re_to_rm[] = {
51         {
52          ROTATION_EVENT_0,
53           APPCORE_RM_PORTRAIT_NORMAL,
54         },
55         {
56          ROTATION_EVENT_90,
57          APPCORE_RM_LANDSCAPE_NORMAL,
58         },
59         {
60          ROTATION_EVENT_180,
61          APPCORE_RM_PORTRAIT_REVERSE,
62         },
63         {
64          ROTATION_EVENT_270,
65          APPCORE_RM_LANDSCAPE_REVERSE,
66         },
67 };
68
69
70 EXPORT_API int appcore_set_rotation_cb(int (*cb) (enum appcore_rm, void *),
71                                        void *data)
72 {
73         return 0;
74 }
75
76 EXPORT_API int appcore_unset_rotation_cb(void)
77 {
78         return 0;
79 }
80
81 EXPORT_API int appcore_get_rotation_state(enum appcore_rm *curr)
82 {
83         return 0;
84 }
85
86 EXPORT_API int appcore_pause_rotation_cb(void)
87 {
88         return 0;
89 }
90
91 EXPORT_API int appcore_resume_rotation_cb(void)
92 {
93         return 0;
94 }