Back to index

indicator-session  12.10.0
Functions | Variables
session-service.c File Reference
#include "config.h"
#include <unistd.h>
#include <locale.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gio/gdesktopappinfo.h>
#include <libdbusmenu-glib/server.h>
#include <gtk/gtk.h>
#include <libindicator/indicator-service.h>
#include "session-dbus.h"
#include "session-menu-mgr.h"
#include "shared-names.h"
#include "users-service-dbus.h"

Go to the source code of this file.

Functions

void service_shutdown (IndicatorService *service, gpointer user_data)
static gboolean is_greeter_mode (void)
int main (int argc, char **argv)

Variables

static SessionDbus * session_dbus = NULL
static GMainLoop * mainloop = NULL

Function Documentation

static gboolean is_greeter_mode ( void  ) [inline, static]

Definition at line 64 of file session-service.c.

{
  return !g_strcmp0 (g_getenv ("INDICATOR_GREETER_MODE"), "1");
}

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 72 of file session-service.c.

{
  g_type_init();

  /* Setting up i18n and gettext.
     Apparently we need all of these. */
  setlocale (LC_ALL, "");
  bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
  textdomain (GETTEXT_PACKAGE);

  IndicatorService * service = indicator_service_new_version (INDICATOR_SESSION_DBUS_NAME,
                                                            INDICATOR_SESSION_DBUS_VERSION);
  g_signal_connect (G_OBJECT(service), INDICATOR_SERVICE_SIGNAL_SHUTDOWN,
                    G_CALLBACK(service_shutdown), NULL);

  session_dbus = session_dbus_new();

  SessionMenuMgr * menu_mgr = session_menu_mgr_new (session_dbus, is_greeter_mode());
  DbusmenuServer* server = dbusmenu_server_new (INDICATOR_SESSION_DBUS_OBJECT);
  dbusmenu_server_set_root (server, session_menu_mgr_get_menu (menu_mgr));

  mainloop = g_main_loop_new(NULL, FALSE);
  g_main_loop_run(mainloop);

  return 0;
}

Here is the call graph for this function:

void service_shutdown ( IndicatorService *  service,
gpointer  user_data 
)

Definition at line 54 of file session-service.c.

{
  if (mainloop != NULL)
    {
      g_debug ("Service shutdown");
      g_main_loop_quit (mainloop);
    }
}

Here is the caller graph for this function:


Variable Documentation

GMainLoop* mainloop = NULL [static]

Definition at line 48 of file session-service.c.

SessionDbus* session_dbus = NULL [static]

Definition at line 47 of file session-service.c.