public
Description: will be a text classification desktop service
Homepage:
Clone URL: git://github.com/markoa/wordtip.git
wordtip / src / main.cc
100644 38 lines (25 sloc) 0.673 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <signal.h>
#include <iostream>
#include <giomm/init.h>
#include "server.hh"
 
DBus::BusDispatcher dispatcher;
 
void
interrupt_handler(int sig)
{
    std::cout << "shutting down on signal " << sig << std::endl;
    dispatcher.leave();
}
 
 
int
main(int /*argc*/, char** /*argv*/)
{
    std::cout << "wordtip running" << std::endl;
    
    signal(SIGTERM, interrupt_handler);
    signal(SIGINT, interrupt_handler);
 
    Gio::init();
 
    DBus::default_dispatcher = &dispatcher;
 
    DBus::Connection conn = DBus::Connection::SessionBus();
    conn.request_name(wordtip::DBUS_SERVER_NAME);
 
    wordtip::Server server(conn);
 
    dispatcher.enter();
 
    return 0;
}