Source1: context-service.service
Source2: org.tizen.context.conf
-# For active window hooking, we need to use 'ecore' mainloop instead of the 'glib' mainloop.
-%define MAINLOOP glib
-
BuildRequires: cmake
BuildRequires: sed
BuildRequires: pkgconfig(libtzplatform-config)
BuildRequires: pkgconfig(notification)
BuildRequires: pkgconfig(capi-system-system-settings)
-%if "%{MAINLOOP}" == "ecore"
-BuildRequires: pkgconfig(ecore)
-%endif
-
BuildRequires: pkgconfig(cynara-creds-gdbus)
BuildRequires: pkgconfig(cynara-client)
BuildRequires: pkgconfig(cynara-session)
export CXXFLAGS+=" -DTIZEN_ENGINEER_MODE"
export FFLAGS+=" -DTIZEN_ENGINEER_MODE"
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DMAINLOOP=%{MAINLOOP}
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
make %{?jobs:-j%jobs}
%install
#include "context_trigger/trigger.h"
#include "server.h"
-#ifdef _USE_ECORE_MAIN_LOOP_
-#include <Ecore.h>
-#else
static GMainLoop *mainloop = NULL;
-#endif
-
static bool started = false;
static ctx::context_manager_impl *context_mgr = NULL;
void ctx::server::initialize()
{
_I("Init MainLoop");
-#ifdef _USE_ECORE_MAIN_LOOP_
- ecore_init();
- ecore_main_loop_glib_integrate();
-#else
mainloop = g_main_loop_new(NULL, FALSE);
-#endif
_I("Init Dbus Connection");
dbus_handle = new(std::nothrow) ctx::dbus_server_impl();
// Start the main loop
_I(CYAN("Launching Context-Service"));
-#ifdef _USE_ECORE_MAIN_LOOP_
- ecore_main_loop_begin();
-#else
g_main_loop_run(mainloop);
-#endif
}
void ctx::server::activate()
_E(RED("Launching Failed"));
// Stop the main loop
-#ifdef _USE_ECORE_MAIN_LOOP_
- ecore_main_loop_quit();
-#else
g_main_loop_quit(mainloop);
-#endif
}
void ctx::server::release()
if (timer_mgr)
timer_mgr->release();
-#ifdef _USE_ECORE_MAIN_LOOP_
- ecore_shutdown();
-#else
g_main_loop_unref(mainloop);
-#endif
delete trigger;
delete context_mgr;
_I("SIGNAL %d received", signo);
// Stop the main loop
-#ifdef _USE_ECORE_MAIN_LOOP_
- ecore_main_loop_quit();
-#else
g_main_loop_quit(mainloop);
-#endif
}
int main(int argc, char* argv[])