aab11d1c2611d83aaee5ce06003e6dbe075d403e
[apps/livebox/data-provider-master.git] / include / conf.h
1 /*
2  * Copyright 2013  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 struct conf {
18         int width;
19         int height;
20
21         int base_width;
22         int base_height;
23         double minimum_period;
24
25         struct {
26                 char *script;
27                 char *abi;
28                 char *pd_group;
29                 double period;
30                 int pixels;
31         } default_conf;
32
33         struct {
34                 char *name;
35                 char *secured;
36                 char *abi;
37         } launch_key;
38
39         double default_packet_time;
40
41         char *empty_content;
42         char *empty_title;
43
44         char *default_content;
45         char *default_title;
46
47         unsigned long minimum_space;
48
49         char *replace_tag;
50
51         double slave_ttl;
52         double slave_activate_time;
53         double slave_relaunch_time;
54         int slave_relaunch_count;
55
56         int max_log_line;
57         int max_log_file;
58
59         unsigned long sqlite_flush_max;
60
61         struct {
62                 char *conf;
63                 char *image;
64                 char *script;
65                 char *root;
66                 char *script_port;
67                 char *slave_log;
68                 char *reader;
69                 char *always;
70                 char *db;
71                 char *input;
72         } path;
73
74         int max_size_type;
75
76         int slave_max_load;
77
78         double ping_time;
79
80         char *vconf_sys_cluster;
81         int max_pended_ctx_events;
82
83         int use_sw_backend;
84         char *provider_method;
85         int debug_mode;
86         int overwrite_content;
87         int com_core_thread;
88         int use_xmonitor;
89         int premultiplied;
90
91         double scale_width_factor;
92         double scale_height_factor;
93
94         double pd_request_timeout;
95
96         char *emergency_disk;
97         char *services;
98 };
99
100 extern struct conf g_conf;
101
102 extern int conf_loader(void);
103 extern void conf_update_size(void);
104 extern void conf_reset(void);
105 extern void conf_init(void);
106
107 #define BASE_W                  g_conf.base_width
108 #define BASE_H                  g_conf.base_height
109
110 #define CR 13
111 #define LF 10
112
113 #define EMERGENCY_DISK          g_conf.emergency_disk
114 #define SCALE_WIDTH_FACTOR      g_conf.scale_width_factor
115 #define SCALE_HEIGHT_FACTOR     g_conf.scale_height_factor
116
117 #define USE_SW_BACKEND          g_conf.use_sw_backend
118 #define PROVIDER_METHOD         g_conf.provider_method
119 #define DEBUG_MODE              g_conf.debug_mode
120 #define OVERWRITE_CONTENT       g_conf.overwrite_content
121 #define COM_CORE_THREAD         g_conf.com_core_thread
122
123 #define MINIMUM_PERIOD          g_conf.minimum_period
124
125 #define DEFAULT_SCRIPT          g_conf.default_conf.script
126 #define DEFAULT_ABI             g_conf.default_conf.abi
127 #define DEFAULT_GROUP           g_conf.default_conf.pd_group
128 #define DEFAULT_PERIOD          g_conf.default_conf.period
129 #define DEFAULT_PIXELS          g_conf.default_conf.pixels
130 #define PRIORITY_NO_CHANGE      -1.0f
131
132 #define BUNDLE_SLAVE_NAME       g_conf.launch_key.name
133 #define BUNDLE_SLAVE_SECURED    g_conf.launch_key.secured
134 #define BUNDLE_SLAVE_ABI        g_conf.launch_key.abi
135 #define PACKET_TIME             g_conf.default_packet_time
136 #define CONTENT_NO_CHANGE       g_conf.empty_content
137 #define TITLE_NO_CHANGE         g_conf.empty_title
138 #define DEFAULT_TITLE           g_conf.default_title
139 #define DEFAULT_CONTENT         g_conf.default_content
140 #define MINIMUM_SPACE           g_conf.minimum_space
141
142 #define IMAGE_PATH              g_conf.path.image
143 #define SCRIPT_PATH             g_conf.path.script
144 #define SCRIPT_PORT_PATH        g_conf.path.script_port
145 #define CONF_PATH               g_conf.path.conf
146 #define ROOT_PATH               g_conf.path.root
147 #define SLAVE_LOG_PATH          g_conf.path.slave_log
148 #define READER_PATH             g_conf.path.reader
149 #define ALWAYS_PATH             g_conf.path.always
150 #define INPUT_PATH              g_conf.path.input
151
152 #define REPLACE_TAG_APPID       g_conf.replace_tag
153 #define SLAVE_TTL               g_conf.slave_ttl
154 #define SLAVE_ACTIVATE_TIME     g_conf.slave_activate_time
155 #define SLAVE_RELAUNCH_TIME     g_conf.slave_relaunch_time
156 #define SLAVE_RELAUNCH_COUNT    g_conf.slave_relaunch_count
157
158 #define MAX_LOG_LINE            g_conf.max_log_line
159 #define MAX_LOG_FILE            g_conf.max_log_file
160
161 #define SQLITE_FLUSH_MAX        g_conf.sqlite_flush_max
162 #define DBFILE                  g_conf.path.db
163
164 #define PD_REQUEST_TIMEOUT      g_conf.pd_request_timeout
165
166 #define SLAVE_MAX_LOAD          g_conf.slave_max_load
167 #define DEFAULT_PING_TIME       g_conf.ping_time
168 #define PREMULTIPLIED_COLOR     g_conf.premultiplied
169 #define SERVICES                g_conf.services
170
171 #define SERVICE_LIVEBOX         "[livebox]"
172 #define SERVICE_NOTIFICATION    "[notification]"
173 #define SERVICE_BADGE           "[badge]"
174 #define SERVICE_SHORTCUT        "[shortcut]"
175 #define SERVICE_UTILITY         "[utility]"
176 #define SERVICE_FILE            "[file]"
177
178 #define PAUSED_FILE             "/tmp/.live.paused"
179
180 #define MAX_ABI         256
181 #define MAX_PKGNAME     512
182 #define DELAY_TIME      0.0000001f
183 #define DEFAULT_CLUSTER "user,created"
184 #define MINIMUM_REACTIVATION_TIME       10
185
186 #if !defined(VCONFKEY_MASTER_STARTED)
187 #define VCONFKEY_MASTER_STARTED "memory/data-provider-master/started"
188 #endif
189
190 #if !defined(VCONFKEY_MASTER_RESTART_COUNT)
191 #define VCONFKEY_MASTER_RESTART_COUNT   "memory/private/data-provider-master/restart_count"
192 #endif
193
194 #define USE_XMONITOR            g_conf.use_xmonitor
195
196 #define HAPI __attribute__((visibility("hidden")))
197 /*!
198  * EAPI is defined from eina.h
199  */
200
201 /* End of a file */