Logo Search packages:      
Sourcecode: libnotify version File versions  Download package

gboolean notify_notification_show ( NotifyNotification *  notification,
GError **  error 

notify_notification_show: : The notification. : The returned error information.

Tells the notification server to display the notification on the screen.

Returns: TRUE if successful. On error, this will return FALSE and set .

Definition at line 735 of file notification.c.

References notify_get_app_name().

      NotifyNotificationPrivate *priv;
      GError *tmp_error = NULL;
      gchar **action_array;
      DBusGProxy *proxy;

      g_return_val_if_fail(notification != NULL, FALSE);
      g_return_val_if_fail(NOTIFY_IS_NOTIFICATION(notification), FALSE);
      g_return_val_if_fail(error == NULL || *error == NULL, FALSE);

      priv = notification->priv;
      proxy = _notify_get_g_proxy();

      if (!priv->signals_registered)
            dbus_g_proxy_connect_signal(proxy, "NotificationClosed",
                                                      notification, NULL);

            dbus_g_proxy_connect_signal(proxy, "ActionInvoked",
                                                      notification, NULL);

            priv->signals_registered = TRUE;

      /* If attached to a widget or status icon, modify x and y in hints */

      action_array = _gslist_to_string_array(priv->actions);

      /* TODO: make this nonblocking */
      dbus_g_proxy_call(proxy, "Notify", &tmp_error,
                                G_TYPE_STRING, notify_get_app_name(),
                                G_TYPE_UINT, priv->id,
                                G_TYPE_STRING, priv->icon_name,
                                G_TYPE_STRING, priv->summary,
                                G_TYPE_STRING, priv->body,
                                G_TYPE_STRV, action_array,
                                dbus_g_type_get_map("GHashTable", G_TYPE_STRING,
                                                              G_TYPE_VALUE), priv->hints,
                                G_TYPE_INT, priv->timeout,
                                G_TYPE_UINT, &priv->id,

      /* Don't free the elements because they are owned by priv->actions */

      if (tmp_error != NULL)
            g_propagate_error(error, tmp_error);
            return FALSE;

      return TRUE;

Generated by  Doxygen 1.6.0   Back to index