~charlesk/indicator-location/lp-1231444

« back to all changes in this revision

Viewing changes to src/main.cc

  • Committer: Tarmac
  • Author(s): Charles Kerr
  • Date: 2013-08-26 21:56:17 UTC
  • mfrom: (39.1.29 gmenuify)
  • Revision ID: tarmac-20130826215617-g20m2cijsizb9c54
This implements the frontend of the location indicator.

Approved by Ted Gould, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2013 Canonical Ltd.
 
3
 *
 
4
 * Authors:
 
5
 *   Charles Kerr <charles.kerr@canonical.com>
 
6
 *
 
7
 * This program is free software: you can redistribute it and/or modify it
 
8
 * under the terms of the GNU General Public License version 3, as published
 
9
 * by the Free Software Foundation.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful, but
 
12
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
13
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
14
 * PURPOSE.  See the GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License along
 
17
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#include <locale.h>
 
21
#include <glib/gi18n.h>
 
22
#include <glib.h>
 
23
 
 
24
//#include "controller-ualc.h"
 
25
#include "controller-mock.h"
 
26
#include "service.h"
 
27
 
 
28
static void
 
29
on_name_lost (Service * service G_GNUC_UNUSED, gpointer loop)
 
30
{
 
31
  g_main_loop_quit (static_cast<GMainLoop*>(loop));
 
32
}
 
33
 
 
34
int
 
35
main (int argc G_GNUC_UNUSED, char ** argv G_GNUC_UNUSED)
 
36
{
 
37
  GMainLoop * loop;
 
38
 
 
39
  /* boilerplate i18n */
 
40
  setlocale (LC_ALL, "");
 
41
  bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 
42
  textdomain (GETTEXT_PACKAGE);
 
43
 
 
44
  /* set up the service */
 
45
  loop = g_main_loop_new (nullptr, false);
 
46
  std::shared_ptr<Controller> controller (new MockController());//UbuntuAppLocController ());
 
47
  Service service (controller);
 
48
  service.set_name_lost_callback (on_name_lost, loop);
 
49
  g_main_loop_run (loop);
 
50
 
 
51
  /* cleanup */
 
52
  g_main_loop_unref (loop);
 
53
  return 0;
 
54
}