Merge "Add manifest and fix spec file."
[apps/core/preloaded/taskmanager.git] / src / taskmanager.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  * 
4  * Licensed under the Flora License, Version 1.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.tizenopensource.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
18
19
20 #ifndef __TASKMANAGER_H__
21 #define __TASKMANAGER_H__
22
23 #include <Elementary.h>
24 #include <Ecore_X.h>
25 #include <utilX.h>
26 #include <bundle.h>
27
28 #if !defined(PACKAGE)
29 #define PACKAGE "taskmanager"
30 #endif
31
32 #ifndef PREFIX
33 #define PREFIX "/opt/apps/org.tizen."PACKAGE
34 #endif
35
36 #if !defined(RESDIR)
37 #       define RESDIR PREFIX"/res"
38 #endif
39
40 #if !defined(LOCALEDIR)
41 #define LOCALEDIR RESDIR"/locale"
42 #endif
43
44 #if !defined(EDJDIR)
45 #define EDJDIR RESDIR"/edje"PACKAGE
46 #endif
47
48 #if !defined(IMAGEDIR)
49 #       define IMAGEDIR RESDIR"/images/"PACKAGE
50 #endif
51
52 #define EDJ_NAME EDJDIR"/taskmgr.edj"
53 #define EDJ_THEME EDJDIR"/theme_taskmanager.edj"
54 #define GRP_TM "task_manager"
55
56 #define S_(str) dgettext("sys_string", str)
57 #define T_(str) dgettext(PACKAGE, str)
58
59 #define _BUF_MAX        256
60 #define _EDJ(x) elm_layout_edje_get(x)
61
62 #define POPUP_TIMER 1.0
63 #define POPUP_TERMINATE_TIMER 1.5
64
65 struct appdata {
66         Evas *evas;
67         Evas_Object *win, *ly, *nv, *gl;
68
69         Evas_Coord root_w, root_h;
70
71         Eina_List *applist[2];
72         /* runapp : 0, history: 1 */
73
74         Ecore_Timer *popup_timer;
75         Evas_Object *popup_ask;
76         Evas_Object *popup_progressbar;
77
78         Ecore_Timer *update_timer;
79         Ecore_Timer *exit_timer;
80
81         double mem_total;
82
83         int mode;
84         int ending;
85         int endcnt;
86 };
87
88 struct _task_info {
89         char *app_name;
90         char *pkg_name;
91         char *icn_path;
92         pid_t pid;
93         struct appdata *ad;
94         double mem, mem_total;
95         double cpu;
96         Elm_Object_Item *it;
97         int category;
98         bundle *b;
99         unsigned int oldutime, oldstime;
100         struct timeval oldtimev;
101 };
102
103         /* MODE_KILL_INUSE = MODE_END_INUSE * 2
104          * MODE_KILL_ALL_INUSE = MODE_END_ALL_INUSE * 2
105          */
106 enum task_mode {
107         MODE_NONE = 0,
108         MODE_END_INUSE,
109         MODE_KILL_INUSE,
110         MODE_END_ALL_INUSE,
111         MODE_DEL_HISTORY,
112         MODE_DEL_ALL_HISTORY,
113         MODE_KILL_ALL_INUSE,
114 };
115
116 enum task_status {
117         TS_INUSE = 0,
118         TS_HISTORY,
119         TS_MAX,
120 };
121
122 Evas_Object *load_edj(Evas_Object *parent, const char *file, const char *group);
123 int _unset_notification_level(Evas_Object *win);
124 int _set_notification_level(Evas_Object *win, Utilx_Notification_Level level);
125 Eina_Bool _exit_cb(void *data);
126
127 #endif
128 /* __TASKMANAGER_H___ */