Back to index

bamf  0.2.120
Classes | Defines | Typedefs | Functions
bamf-daemon.h File Reference
#include "bamf.h"
#include <glib.h>
#include <glib-object.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _BamfDaemonClass
struct  _BamfDaemon

Defines

#define BAMF_TYPE_DAEMON   (bamf_daemon_get_type ())
#define BAMF_DAEMON(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_DAEMON, BamfDaemon))
#define BAMF_IS_DAEMON(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_DAEMON))
#define BAMF_DAEMON_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), BAMF_TYPE_DAEMON, BamfDaemonClass))
#define BAMF_IS_DAEMON_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), BAMF_TYPE_DAEMON))
#define BAMF_DAEMON_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_DAEMON, BamfDaemonClass))

Typedefs

typedef struct _BamfDaemon
typedef struct _BamfDaemonClass
typedef struct _BamfDaemonPrivate

Functions

GType bamf_daemon_get_type (void) G_GNUC_CONST
void bamf_daemon_start (BamfDaemon *self)
void bamf_daemon_stop (BamfDaemon *self)
gboolean bamf_daemon_is_running (BamfDaemon *self)
BamfDaemon * bamf_daemon_get_default (void)

Class Documentation

struct _BamfDaemonClass

Definition at line 38 of file bamf-daemon.h.

Class Members
GObjectClass parent
struct _BamfDaemon

Definition at line 43 of file bamf-daemon.h.

Class Members
GObject parent
BamfDaemonPrivate * priv

Define Documentation

#define BAMF_DAEMON (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_DAEMON, BamfDaemon))

Definition at line 28 of file bamf-daemon.h.

#define BAMF_DAEMON_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), BAMF_TYPE_DAEMON, BamfDaemonClass))

Definition at line 30 of file bamf-daemon.h.

#define BAMF_DAEMON_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_DAEMON, BamfDaemonClass))

Definition at line 32 of file bamf-daemon.h.

#define BAMF_IS_DAEMON (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_DAEMON))

Definition at line 29 of file bamf-daemon.h.

#define BAMF_IS_DAEMON_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), BAMF_TYPE_DAEMON))

Definition at line 31 of file bamf-daemon.h.

Definition at line 27 of file bamf-daemon.h.


Typedef Documentation

typedef struct _BamfDaemon

Definition at line 34 of file bamf-daemon.h.

typedef struct _BamfDaemonClass

Definition at line 35 of file bamf-daemon.h.

typedef struct _BamfDaemonPrivate

Definition at line 36 of file bamf-daemon.h.


Function Documentation

BamfDaemon* bamf_daemon_get_default ( void  )

Definition at line 209 of file bamf-daemon.c.

{
  if (!BAMF_IS_DAEMON (instance))
    instance = (BamfDaemon *) g_object_new (BAMF_TYPE_DAEMON, NULL);

  return instance;
}

Here is the caller graph for this function:

GType bamf_daemon_get_type ( void  )
gboolean bamf_daemon_is_running ( BamfDaemon *  self)

Definition at line 42 of file bamf-daemon.c.

{
  g_return_val_if_fail (self, FALSE);

  if (self->priv->loop && g_main_loop_is_running (self->priv->loop))
    {
      return TRUE;
    }

  return FALSE;
}

Here is the caller graph for this function:

void bamf_daemon_start ( BamfDaemon *  self)

Definition at line 123 of file bamf-daemon.c.

{
  g_return_if_fail (BAMF_IS_DAEMON (self));

  if (bamf_daemon_is_running (self))
    return;

  g_bus_own_name (G_BUS_TYPE_SESSION, BAMF_DBUS_SERVICE,
                  G_BUS_NAME_OWNER_FLAGS_NONE,
                  (GBusAcquiredCallback) bamf_on_bus_acquired,
                  (GBusNameAcquiredCallback) bamf_on_name_acquired,
                  (GBusNameLostCallback) bamf_on_name_lost,
                  self, NULL);

  g_main_loop_run (self->priv->loop);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void bamf_daemon_stop ( BamfDaemon *  self)

Definition at line 141 of file bamf-daemon.c.

{
  g_return_if_fail (BAMF_IS_DAEMON (self));

  if (self->priv->matcher)
    {
      g_object_unref (self->priv->matcher);
      self->priv->matcher = NULL;
    }

  if (self->priv->control)
    {
      g_object_unref (self->priv->control);
      self->priv->control = NULL;
    }

  if (self->priv->approver)
    {
      g_object_unref (self->priv->approver);
      self->priv->approver = NULL;
    }

  g_main_loop_quit (self->priv->loop);
}

Here is the caller graph for this function: