Back to index

unity  6.0.0
Functions | Variables
test_service_main.c File Reference
#include <glib-object.h>
#include "test_service_lens.h"
#include "test_service_model.h"
#include "test_service_hud.h"
#include "test_service_gdbus_wrapper.h"

Go to the source code of this file.

Functions

static void on_bus_aquired (GDBusConnection *conn, const gchar *name, gpointer null)
static void handle_method_call (GDBusConnection *connection, const gchar *sender, const gchar *object_path, const gchar *interface_name, const gchar *method_name, GVariant *parameters, GDBusMethodInvocation *invocation, gpointer user_data)
gint main (gint argc, gchar **argv)

Variables

static GDBusNodeInfo * introspection_data = NULL
static const gchar introspection_xml [] = "</node>"
static const GDBusInterfaceVTable interface_vtable
static GMainLoop * loop_ = NULL
static ServiceLens * lens_ = NULL
static ServiceModel * model_ = NULL
static ServiceHud * hud_ = NULL
static ServiceGDBusWrapper * gdbus_wrapper_ = NULL

Function Documentation

static void handle_method_call ( GDBusConnection *  connection,
const gchar *  sender,
const gchar *  object_path,
const gchar *  interface_name,
const gchar *  method_name,
GVariant *  parameters,
GDBusMethodInvocation *  invocation,
gpointer  user_data 
) [static]

Definition at line 87 of file test_service_main.c.

{
  if (g_strcmp0(method_name, "Exit") == 0)
  {
    g_main_loop_quit(loop_);
  }
}
gint main ( gint  argc,
gchar **  argv 
)

Definition at line 42 of file test_service_main.c.

{
  g_type_init();

  loop_ = g_main_loop_new(NULL, FALSE);

  lens_ = service_lens_new();
  model_ = service_model_new();
  hud_ = service_hud_new();
  gdbus_wrapper_ = service_gdbus_wrapper_new();

  g_bus_own_name(G_BUS_TYPE_SESSION,
                 "com.canonical.Unity.Test",
                 G_BUS_NAME_OWNER_FLAGS_NONE,
                 on_bus_aquired,
                 NULL,
                 NULL,
                 NULL,
                 NULL);

  g_main_loop_run(loop_);
  g_main_loop_unref(loop_);

  //g_object_unref(lens_);
  //g_object_unref(model_);
  g_object_unref(hud_);
  g_dbus_node_info_unref(introspection_data);

  return 0;
}

Here is the call graph for this function:

static void on_bus_aquired ( GDBusConnection *  conn,
const gchar *  name,
gpointer  null 
) [static]

Definition at line 74 of file test_service_main.c.

{
  introspection_data = g_dbus_node_info_new_for_xml(introspection_xml, NULL);
  g_dbus_connection_register_object(conn,
                                    "/com/canonical/unity/test/controller",
                                    introspection_data->interfaces[0],
                                    &interface_vtable,
                                    NULL,
                                    NULL,
                                    NULL);
}

Here is the caller graph for this function:


Variable Documentation

ServiceGDBusWrapper* gdbus_wrapper_ = NULL [static]

Definition at line 40 of file test_service_main.c.

ServiceHud* hud_ = NULL [static]

Definition at line 39 of file test_service_main.c.

const GDBusInterfaceVTable interface_vtable [static]
Initial value:
 
{
  handle_method_call,
  NULL,
  NULL
}

Definition at line 29 of file test_service_main.c.

GDBusNodeInfo* introspection_data = NULL [static]

Definition at line 19 of file test_service_main.c.

const gchar introspection_xml[] = "</node>" [static]

Definition at line 20 of file test_service_main.c.

ServiceLens* lens_ = NULL [static]

Definition at line 37 of file test_service_main.c.

GMainLoop* loop_ = NULL [static]

Definition at line 36 of file test_service_main.c.

ServiceModel* model_ = NULL [static]

Definition at line 38 of file test_service_main.c.