Back to index

libindicate  12.10.0
Classes | Defines | Typedefs | Functions
server.h File Reference
#include <glib.h>
#include <glib-object.h>
#include <libdbusmenu-glib/server.h>
#include "interests.h"
#include "indicator.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _IndicateServer
struct  _IndicateServerClass

Defines

#define INDICATE_TYPE_SERVER   (indicate_server_get_type ())
#define INDICATE_SERVER(object)   (G_TYPE_CHECK_INSTANCE_CAST ((object), INDICATE_TYPE_SERVER, IndicateServer))
#define INDICATE_IS_SERVER(object)   (G_TYPE_CHECK_INSTANCE_TYPE((object), INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), INDICATE_TYPE_SERVER, IndicateServerClass))
#define INDICATE_IS_SERVER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_GET_CLASS(object)   (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_SERVER, IndicateServerClass))
#define INDICATE_SERVER_INDICATOR_NULL   (0)
#define INDICATE_SERVER_SIGNAL_INDICATOR_ADDED   "indicator-new"
#define INDICATE_SERVER_SIGNAL_INDICATOR_ADDED_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_INDICATOR_ADDED, INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED   "indicator-delete"
#define INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED, INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED   "indicator-modified"
#define INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED, INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_SIGNAL_SERVER_SHOW   "server-show"
#define INDICATE_SERVER_SIGNAL_SERVER_SHOW_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_SERVER_SHOW, INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_SIGNAL_SERVER_HIDE   "server-hide"
#define INDICATE_SERVER_SIGNAL_SERVER_HIDE_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_SERVER_HIDE, INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_SIGNAL_SERVER_DISPLAY   "server-display"
#define INDICATE_SERVER_SIGNAL_SERVER_DISPLAY_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_SERVER_DISPLAY, INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_SIGNAL_INTEREST_ADDED   "interest-added"
#define INDICATE_SERVER_SIGNAL_INTEREST_ADDED_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_INTEREST_ADDED, INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_SIGNAL_INTEREST_REMOVED   "interest-removed"
#define INDICATE_SERVER_SIGNAL_INTEREST_REMOVED_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_INTEREST_REMOVED, INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_SIGNAL_MAX_INDICATORS_CHANGED   "max-indicators-changed"
#define INDICATE_SERVER_SIGNAL_MAX_INDICATORS_CHANGED_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_MAX_INDICATORS_CHANGED, INDICATE_TYPE_SERVER))
#define INDICATE_SERVER_SIGNAL_SERVER_COUNT_CHANGED   "server-count-changed"
#define INDICATE_SERVER_SIGNAL_SERVER_COUNT_CHANGED_ID   (g_signal_lookup(INDICATE_SERVER_SIGNAL_SERVER_COUNT_CHANGED, INDICATE_TYPE_SERVER))

Typedefs

typedef struct _IndicateServer
 IndicateServer:
typedef gboolean(* indicate_server_get_indicator_list_slot_t )(IndicateServer *server, GArray **indicators, GError **error)
 indicate_server_get_indicator_list_slot_t: : (in): Indicator server to query : (out) (transfer container) (array) (element-type IndicateIndicator): The indicators which are visible on this server : An error if #FALSE was returned
typedef gboolean(* indicate_server_get_indicator_property_group_slot_t )(IndicateServer *server, guint id, const gchar **properties, GVariant **value, GError **error)
 indicate_server_get_indicator_property_group_slot_t: : (in): Indicator server to query : (in) (array) (element-type utf8): Property names that you'd like to get values to.
typedef gboolean(* indicate_server_get_indicator_properties_slot_t )(IndicateServer *server, guint id, gchar ***properties, GError **error)
 indicate_server_get_indicator_properties_slot_t: : (in): Indicator server to query : (out) (array) (element-type utf8): Property names that are on this indicator.
typedef struct _IndicateServerClass
 IndicateServerClass: : Parent Class : Slot for #IndicateServer::indicator-added.

Functions

GType indicate_server_get_type (void) G_GNUC_CONST
const gchar * indicate_server_get_path (IndicateServer *server)
 : : The #IndicateServer to get the path of.
void indicate_server_set_dbus_object (const gchar *obj)
void indicate_server_set_desktop_file (IndicateServer *server, const gchar *path)
 indicate_server_set_desktop_file: : The #IndicateServer to set the type of : The new desktop file representing the server
void indicate_server_set_type (IndicateServer *server, const gchar *type)
 indicate_server_set_type: : The #IndicateServer to set the type of : The new type of the server
void indicate_server_set_count (IndicateServer *server, guint count)
 indicate_server_set_count: : The #IndicateServer to set the type of : The number of items that the server believes the user would be interested in.
void indicate_server_set_icon_theme (IndicateServer *server, const gchar *name)
void indicate_server_show (IndicateServer *server)
 indicate_server_show: : The #IndicateServer to be shown
void indicate_server_hide (IndicateServer *server)
 indicate_server_hide: : The #IndicateServer to hide.
guint indicate_server_get_next_id (IndicateServer *server)
 indicate_server_get_next_id: : The #IndicateServer the ID will be on
void indicate_server_add_indicator (IndicateServer *server, IndicateIndicator *indicator)
 indicate_server_add_indicator: : The #IndicateServer to add the #IndicateIndictor to.
void indicate_server_remove_indicator (IndicateServer *server, IndicateIndicator *indicator)
 indicate_server_remove_indicator: : The #IndicateServer to remove the #IndicateIndictor from.
IndicateServer * indicate_server_ref_default (void)
 indicate_server_ref_default:
void indicate_server_set_default (IndicateServer *server)
 indicate_server_set_default: : The #IndicateServer that should be used
gboolean indicate_server_check_interest (IndicateServer *server, IndicateInterests interest)
 indicate_server_check_interest: : The #IndicateServer being checked : Which interest type we're checking for
gint indicate_server_get_max_indicators (IndicateServer *server)
 indicate_server_get_max_indicators: : The #IndicateServer being checked
void indicate_server_set_menu (IndicateServer *server, DbusmenuServer *menu)
 indicate_server_set_menu: : The #IndicateServer to use : A #DbusmenuServer object represting the menu

Class Documentation

struct _IndicateServer

Definition at line 84 of file server.h.

Class Members
GObject parent

Define Documentation

#define INDICATE_IS_SERVER (   object)    (G_TYPE_CHECK_INSTANCE_TYPE((object), INDICATE_TYPE_SERVER))

Definition at line 45 of file server.h.

#define INDICATE_IS_SERVER_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), INDICATE_TYPE_SERVER))

Definition at line 47 of file server.h.

#define INDICATE_SERVER (   object)    (G_TYPE_CHECK_INSTANCE_CAST ((object), INDICATE_TYPE_SERVER, IndicateServer))

Definition at line 44 of file server.h.

#define INDICATE_SERVER_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST((klass), INDICATE_TYPE_SERVER, IndicateServerClass))

Definition at line 46 of file server.h.

#define INDICATE_SERVER_GET_CLASS (   object)    (G_TYPE_INSTANCE_GET_CLASS((object), INDICATE_TYPE_SERVER, IndicateServerClass))

Definition at line 48 of file server.h.

Definition at line 50 of file server.h.

#define INDICATE_SERVER_SIGNAL_INDICATOR_ADDED   "indicator-new"

Definition at line 52 of file server.h.

Definition at line 53 of file server.h.

#define INDICATE_SERVER_SIGNAL_INDICATOR_MODIFIED   "indicator-modified"

Definition at line 56 of file server.h.

Definition at line 57 of file server.h.

#define INDICATE_SERVER_SIGNAL_INDICATOR_REMOVED   "indicator-delete"

Definition at line 54 of file server.h.

Definition at line 55 of file server.h.

#define INDICATE_SERVER_SIGNAL_INTEREST_ADDED   "interest-added"

Definition at line 64 of file server.h.

Definition at line 65 of file server.h.

#define INDICATE_SERVER_SIGNAL_INTEREST_REMOVED   "interest-removed"

Definition at line 66 of file server.h.

Definition at line 67 of file server.h.

Definition at line 68 of file server.h.

Definition at line 69 of file server.h.

#define INDICATE_SERVER_SIGNAL_SERVER_COUNT_CHANGED   "server-count-changed"

Definition at line 70 of file server.h.

Definition at line 71 of file server.h.

Definition at line 62 of file server.h.

Definition at line 63 of file server.h.

#define INDICATE_SERVER_SIGNAL_SERVER_HIDE   "server-hide"

Definition at line 60 of file server.h.

Definition at line 61 of file server.h.

#define INDICATE_SERVER_SIGNAL_SERVER_SHOW   "server-show"

Definition at line 58 of file server.h.

Definition at line 59 of file server.h.

Definition at line 43 of file server.h.


Typedef Documentation

typedef struct _IndicateServer

IndicateServer:

This is the object that represents the overall connection between this application and DBus. It acts as the proxy for incomming DBus calls and also sends the appropriate signals on DBus for events happening on other objects locally. It provides some settings that effection how the application as a whole is perceived by listeners of the indicator protocol.

Definition at line 83 of file server.h.

typedef struct _IndicateServerClass

IndicateServerClass: : Parent Class : Slot for #IndicateServer::indicator-added.

: Slot for #IndicateServer::indicator-removed. : Slot for #IndicateServer::indicator-modified. : Slot for #IndicateServer::server-show. : Slot for #IndicateServer::server-hide. : Slot for #IndicateServer::server-display. : Slot for #IndicateServer::interest-added. : Slot for #IndicateServer::interest-removed. : Slot for #IndicateServer::max-indicators-changed. : Slot for #IndicateServer::server-count-changed. : Returns the number of indicators that are visible on the bus. Hidden indicators should not be counted. : List all of the indicators that are visible. : Get a property from a particular indicator. : Get the values for a set of properties as an array of entries, returning an array as well. : Get a list of all the properties that are on a particular indicator. : Respond to someone on the bus asking to show a particular indicator to the user. : An indicator has been visualized by the listener or it hasn't. This function tracks that. : Get the next unused indicator ID. : React to someone signifying that they are interested in this server. : Someone on the bus is no longer interest in this server, remove it's interest. : Check to see if anyone on the bus is interested in this server for a particular feature. : Set the maximum number of indicators that a given listener can display. : Gets the maximum number of indicators from all listeners that care about this server. : Reserved for future use : Reserved for future use : Reserved for future use : Reserved for future use

All of the functions and signals that make up the server class including those that are public API to the application and those that are public API to all of DBus. Subclasses may need to implement a large portion of these.

Definition at line 176 of file server.h.

typedef gboolean(* indicate_server_get_indicator_list_slot_t)(IndicateServer *server, GArray **indicators, GError **error)

indicate_server_get_indicator_list_slot_t: : (in): Indicator server to query : (out) (transfer container) (array) (element-type IndicateIndicator): The indicators which are visible on this server : An error if #FALSE was returned

Gets the list of indicators that are visible for this server.

Return value: Whether the call was successful in getting the list of values in .

Definition at line 101 of file server.h.

typedef gboolean(* indicate_server_get_indicator_properties_slot_t)(IndicateServer *server, guint id, gchar ***properties, GError **error)

indicate_server_get_indicator_properties_slot_t: : (in): Indicator server to query : (out) (array) (element-type utf8): Property names that are on this indicator.

: An error if #FALSE was returned

Gets the list of indicators that are visible for this server.

Return value: Whether the call was successful in getting the property names.

Definition at line 128 of file server.h.

typedef gboolean(* indicate_server_get_indicator_property_group_slot_t)(IndicateServer *server, guint id, const gchar **properties, GVariant **value, GError **error)

indicate_server_get_indicator_property_group_slot_t: : (in): Indicator server to query : (in) (array) (element-type utf8): Property names that you'd like to get values to.

: (out) (transfer full) (array) (element-type utf8): An array of arrays. Needs more typing. : An error if #FALSE was returned

Gets the list of indicators that are visible for this server.

Return value: Whether the call was successful in getting the properties requested.

Definition at line 115 of file server.h.


Function Documentation

void indicate_server_add_indicator ( IndicateServer *  server,
IndicateIndicator *  indicator 
)

indicate_server_add_indicator: : The #IndicateServer to add the #IndicateIndictor to.

: The #IndicateIndicator to add.

This function adds an indicator to the list that are watched by the server . This means that signals that are emitted by the indicator will be picked up and passed via DBus onto listeners of the application.

Definition at line 1352 of file server.c.

{
       IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server);

    if (g_slist_find (priv->indicators, indicator) != NULL)
            return;

    priv->indicators = g_slist_prepend(priv->indicators, indicator);

       if (!indicate_indicator_is_visible(indicator)) {
              priv->num_hidden++;
       } else {
              if (priv->registered != 0) {
                     g_dbus_connection_emit_signal(priv->connection,
                                                   NULL, /* dest */
                                                   priv->path,
                                                   INDICATE_DBUS_IFACE,
                                                   "IndicatorNew",
                                                   g_variant_new("(u)", indicate_indicator_get_id(indicator)),
                                                   NULL); /* error */
              }
              g_signal_emit(server, signals[INDICATOR_ADDED], 0, indicate_indicator_get_id(indicator), TRUE);
       }

       g_signal_connect(indicator, INDICATE_INDICATOR_SIGNAL_SHOW, G_CALLBACK(indicator_show_cb), server);
       g_signal_connect(indicator, INDICATE_INDICATOR_SIGNAL_HIDE, G_CALLBACK(indicator_hide_cb), server);
       g_signal_connect(indicator, INDICATE_INDICATOR_SIGNAL_MODIFIED, G_CALLBACK(indicator_modified_cb), server);

       return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean indicate_server_check_interest ( IndicateServer *  server,
IndicateInterests  interest 
)

indicate_server_check_interest: : The #IndicateServer being checked : Which interest type we're checking for

This function looks at all the interest that various listeners have specified that they have for this server and returns whether there is a listener that has the interest specified in .

Return value: TRUE if a listener as the interest otherwise FALSE

Definition at line 2159 of file server.c.

{
       IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server);

       if (class != NULL && class->check_interest != NULL) {
              return class->check_interest (server, interest);
       }

       g_warning("check_interest function not implemented in this server class: %s", G_OBJECT_TYPE_NAME(server));
       return FALSE;
}
gint indicate_server_get_max_indicators ( IndicateServer *  server)

indicate_server_get_max_indicators: : The #IndicateServer being checked

This function looks at everyone listening and determines the max number of indicators that can be shown to anyone.

Return value: A max number or -1 for unlimited.

Definition at line 2181 of file server.c.

{
       IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server);

       if (class != NULL && class->max_indicators_get != NULL) {
              return class->max_indicators_get (server);
       }

       g_warning("get_max_indicators function not implemented in this server class: %s", G_OBJECT_TYPE_NAME(server));
       return -1;
}
guint indicate_server_get_next_id ( IndicateServer *  server)

indicate_server_get_next_id: : The #IndicateServer the ID will be on

Returns the next available unused ID that an indicator can have.

Return value: A valid indicator ID.

Definition at line 2001 of file server.c.

{
       IndicateServerClass * class = INDICATE_SERVER_GET_CLASS(server);

       if (class != NULL && class->get_next_id != NULL) {
              return class->get_next_id (server);
       }

       return 0;
}

Here is the caller graph for this function:

const gchar* indicate_server_get_path ( IndicateServer *  server)

: : The #IndicateServer to get the path of.

Gets DBus object path for the exported server object.

Return value: The servers DBus path.

Definition at line 2021 of file server.c.

{
       IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server);

        g_return_val_if_fail(INDICATE_IS_SERVER(server), NULL);

        return priv->path;
}
GType indicate_server_get_type ( void  )
void indicate_server_hide ( IndicateServer *  server)

indicate_server_hide: : The #IndicateServer to hide.

This function hides the server from DBus so that it does not get signals anymore. This causes the signal #IndicateServer::server-hide to be sent across the bus for all listeners. Also internally it will signal #IndicateServer::interest-removed for all the interests that were currently set for this server.

Definition at line 975 of file server.c.

{
       g_return_if_fail(INDICATE_IS_SERVER(server));
       IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server);

       if (!priv->visible)
              return;

       priv->visible = FALSE;

       /* Delete interested parties */
       g_list_foreach(priv->interestedfolks, (GFunc)indicate_server_interested_folks_destroy, NULL);
       g_list_free(priv->interestedfolks);
       priv->interestedfolks = NULL;

       /* Signal the lack of interest */
       guint i;
       for (i = INDICATE_INTEREST_NONE; i < INDICATE_INTEREST_LAST; i++) {
              if (priv->interests[i]) {
                     g_signal_emit(G_OBJECT(server), signals[INTEREST_REMOVED], 0, i, TRUE);
              }
              priv->interests[i] = FALSE;
       }

       /* Signal that we don't have a max */
       priv->max_indicators = MAX_INDICATORS_UNSET;
       g_signal_emit(G_OBJECT(server), signals[MAX_INDICATORS_CHANGED], 0, MAX_INDICATORS_INFINITE, TRUE);

       if (priv->registered != 0) {
              g_dbus_connection_emit_signal(priv->connection,
                                            NULL, /* dest */
                                            priv->path,
                                            INDICATE_DBUS_IFACE,
                                            "ServerHide",
                                            g_variant_new("(s)", priv->type ? priv-> type : ""),
                                            NULL); /* error */
       }
       g_signal_emit(server, signals[SERVER_HIDE], 0, priv->type ? priv->type : "", TRUE);

       return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

IndicateServer* indicate_server_ref_default ( void  )

indicate_server_ref_default:

This function will return a reference to the default #IndicateServer reference if there is one, or it will create one if one had not previously been created. It is recommended that all applications use this function to create a #IndicateServer as it ensure that there is only one per application.

Return value: (transfer full): A reference to the default #IndicateServer instance.

Definition at line 1525 of file server.c.

Here is the caller graph for this function:

void indicate_server_remove_indicator ( IndicateServer *  server,
IndicateIndicator *  indicator 
)

indicate_server_remove_indicator: : The #IndicateServer to remove the #IndicateIndictor from.

: The #IndicateIndicator to remove.

Removes an indicator from being watched by the server so it's signals are no longer watched and set over DBus.

Definition at line 1392 of file server.c.

{
       IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server);

    if (g_slist_find (priv->indicators, indicator) == NULL)
            return;

       priv->indicators = g_slist_remove(priv->indicators, indicator);
       if (indicate_indicator_is_visible(indicator)) {
              if (priv->registered != 0) {
                     g_dbus_connection_emit_signal(priv->connection,
                                                   NULL, /* dest */
                                                   priv->path,
                                                   INDICATE_DBUS_IFACE,
                                                   "IndicatorDelete",
                                                   g_variant_new("(u)", indicate_indicator_get_id(indicator)),
                                                   NULL); /* error */
              }
              g_signal_emit(server, signals[INDICATOR_REMOVED], 0, indicate_indicator_get_id(indicator), TRUE);
       } else {
              priv->num_hidden--;
       }

       g_signal_handlers_disconnect_by_func(indicator, indicator_show_cb, server);
       g_signal_handlers_disconnect_by_func(indicator, indicator_hide_cb, server);
       g_signal_handlers_disconnect_by_func(indicator, indicator_modified_cb, server);

       return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void indicate_server_set_count ( IndicateServer *  server,
guint  count 
)

indicate_server_set_count: : The #IndicateServer to set the type of : The number of items that the server believes the user would be interested in.

A small convience function to set the #IndicateServer:count property on the server. This should represent a number of messages on a particular server. This should not be used at the same time as individual indicators to show information to the users. They sound be used independently.

Definition at line 1482 of file server.c.

{
       GValue value = {0};
       g_value_init(&value, G_TYPE_UINT);
       g_value_set_uint(&value, count);
       g_object_set_property(G_OBJECT(server), "count", &value);
       return;
}
void indicate_server_set_dbus_object ( const gchar *  obj)

Definition at line 1423 of file server.c.

{
       /* TODO */

       return;
}
void indicate_server_set_default ( IndicateServer *  server)

indicate_server_set_default: : The #IndicateServer that should be used

This function is used to set the default #IndicateServer that will be used when creating #IndicateIndicators or for anyone else that calls indicate_server_ref_default(). Typically this is just an instance of #IndicateServer but applications that create a subclass of #IndicateServer should set this as well.

Definition at line 1549 of file server.c.

{
       if (default_indicate_interface_server != NULL) {
              g_warning("Setting a default Indicator Server when one has already been created.  I'm not going to destroy that one, but let it live.  This may create some odd results if you don't know what you're doing.");
       }

       if (server != NULL) {
              default_indicate_interface_server = server;
              g_object_add_weak_pointer(G_OBJECT(default_indicate_interface_server),
                                        (gpointer *)&default_indicate_interface_server);
       }

       return;
}
void indicate_server_set_desktop_file ( IndicateServer *  server,
const gchar *  path 
)

indicate_server_set_desktop_file: : The #IndicateServer to set the type of : The new desktop file representing the server

This is a convience function to set the #IndicateServer:desktop property of the object. The property can also be set via traditional means, but this one is easier to read.

Definition at line 1440 of file server.c.

{
       GValue value = {0};
       g_value_init(&value, G_TYPE_STRING);
       g_value_set_string(&value, path);
       g_object_set_property(G_OBJECT(server), "desktop", &value);
       return;
}

Here is the caller graph for this function:

void indicate_server_set_icon_theme ( IndicateServer *  server,
const gchar *  name 
)

Definition at line 1502 of file server.c.

{
       GValue value = {0};
       g_value_init(&value, G_TYPE_STRING);
       g_value_set_string(&value, name);
       g_object_set_property(G_OBJECT(server), "icon-theme", &value);
       return;
}

Here is the caller graph for this function:

void indicate_server_set_menu ( IndicateServer *  server,
DbusmenuServer *  menu 
)

indicate_server_set_menu: : The #IndicateServer to use : A #DbusmenuServer object represting the menu

This function sets the internal menu representation for this indicator. It makes it so that when clients ask for information on the menus it'll repospond with the address of this menu.

It is important to note that there is not signal about menus changing. So if the indicator is already visible there is no way that a listener would know about the change, and thus is likely to have the wrong menu (or no menu).

Return value: None.

Definition at line 2210 of file server.c.

{
       g_return_if_fail(INDICATE_IS_SERVER(server));
       IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server);

       if (priv->visible) {
              g_warning("Menu being changed when the indicator is visible.  Listeners will NOT be notified of this change.");
       }

       if (priv->dbusmenu != NULL) {
              g_object_unref(priv->dbusmenu);
              priv->dbusmenu = NULL;
       }

       priv->dbusmenu = menu;
       g_object_ref(priv->dbusmenu);

       return;
}

Here is the caller graph for this function:

void indicate_server_set_type ( IndicateServer *  server,
const gchar *  type 
)

indicate_server_set_type: : The #IndicateServer to set the type of : The new type of the server

This is a convience function to set the #IndicateServer:type property of the object. The property can also be set via traditional means, but this one is easier to read.

Definition at line 1459 of file server.c.

{
       GValue value = {0};
       g_value_init(&value, G_TYPE_STRING);
       g_value_set_string(&value, type);
       g_object_set_property(G_OBJECT(server), "type", &value);
       g_value_unset(&value);
       return;
}

Here is the caller graph for this function:

void indicate_server_show ( IndicateServer *  server)

indicate_server_show: : The #IndicateServer to be shown

This function exports the object onto DBus and shows it to the world. This will be the start of it receiving external signals from DBus. It is likely that, if there are listeners running, there will several #IndicateServer::interest-added signals coming shortly after this function. This function emits the #IndicateServer::server-added signal across the bus.

Definition at line 917 of file server.c.

{
       g_return_if_fail(INDICATE_IS_SERVER(server));
       IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server);

       if (priv->visible) {
              return;
       }

       priv->visible = TRUE;

       if (priv->connection == NULL) {
              return;
       }

       if (priv->registered == 0) {
              GError * error = NULL;
              priv->registered = g_dbus_connection_register_object(priv->connection,
                                                                   priv->path,
                                                                   bus_interface_info,
                                                                   &bus_interface_table,
                                                                   server,
                                                                   NULL,
                                                                   &error);

              if (error != NULL) {
                     g_warning("Unable to export object '%s' with interface '" INDICATE_DBUS_IFACE "' on dbus: %s", priv->path, error->message);
                     g_error_free(error);
                     priv->registered = 0; /* Just to be sure */
                     return;
              }
       }

       if (priv->registered != 0) {
              g_dbus_connection_emit_signal(priv->connection,
                                            NULL, /* dest */
                                            priv->path,
                                            INDICATE_DBUS_IFACE,
                                            "ServerShow",
                                            g_variant_new("(s)", priv->type ? priv-> type : ""),
                                            NULL); /* error */
       }
       g_signal_emit(server, signals[SERVER_SHOW], 0, priv->type ? priv->type : "", TRUE);

       return;
}

Here is the caller graph for this function: