[STYLE] Spec: remove commented requires
[platform/core/system/swap-probe.git] / helper / appfw-tizen.cpp
1 /*
2  *  DA probe
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  *
8  * Jaewon Lim <jaewon81.lim@samsung.com>
9  * Woojin Jung <woojin2.jung@samsung.com>
10  * Juyoung Kim <j0.kim@samsung.com>
11  *
12  * This library is free software; you can redistribute it and/or modify it under
13  * the terms of the GNU Lesser General Public License as published by the
14  * Free Software Foundation; either version 2.1 of the License, or (at your option)
15  * any later version.
16  *
17  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
18  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
19  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
20  * License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with this library; if not, write to the Free Software Foundation, Inc., 51
24  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  *
26  * Contributors:
27  * - S-Core Co., Ltd
28  *
29  */
30
31 #include <app.h>
32 #include <FApp.h>
33 #include "dahelper.h"
34 using namespace Tizen::App;
35
36 #define UNKNOWN_USER_EVENT     5873
37
38 #ifdef __cplusplus
39 extern "C"{
40 #endif
41
42 void application_exit()
43 {
44         App* self = App::GetInstance();
45         if(self != NULL)
46         {
47                 PRINTMSG("EXIT self");
48                 self->Terminate();
49                 // send unknown user event to main thread
50                 // because this cause that main thread execute terminating routine without block
51                 self->SendUserEvent(UNKNOWN_USER_EVENT, NULL);
52         }
53         else
54         {
55                 PRINTMSG("EXIT self - efl_exit >");
56                 app_efl_exit();
57                 if (app_efl_main_flg == 0) {
58                         PRINTMSG("no app_efl_main detected, terminate by exit(0)");
59                         //sleep for flush message to manager
60                         sleep(1);
61                         exit(0);
62                 }
63                 PRINTMSG("EXIT self - efl_exit <");
64         }
65 }
66
67 #ifdef __cplusplus
68 }
69 #endif
70