## RBTrayIcon RBTrayIcon — Notification area icon |

## Synopsis

                        RBTrayIcon;
                        RBTrayIconClass;
    RBTrayIcon *        rb_tray_icon_new                    (GtkUIManager *mgr,
                                                             RBShell *shell);
    void                rb_tray_icon_get_geom               (RBTrayIcon *icon,
                                                             int *x,
                                                             int *y,
                                                             int *width,
                                                             int *height);
    void                rb_tray_icon_notify                 (RBTrayIcon *icon,
                                                             guint timeout,
                                                             const char *primary_markup,
                                                             GdkPixbuf *pixbuf,
                                                             const char *secondary_markup,
                                                             gboolean requested);
    void                rb_tray_icon_cancel_notify          (RBTrayIcon *icon);
    void                rb_tray_icon_set_tooltip_primary_text
                                                            (RBTrayIcon *icon,
                                                             const char *primary_text);
    void                rb_tray_icon_set_tooltip_icon       (RBTrayIcon *icon,
                                                             GdkPixbuf *pixbuf);
    void                rb_tray_icon_set_tooltip_secondary_markup
                                                            (RBTrayIcon *icon,
                                                             const char *secondary_markup);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkBin
                                     +----GtkWindow
                                           +----GtkPlug
                                                 +----EggTrayIcon
                                                       +----RBTrayIcon

## Implemented Interfaces

RBTrayIcon implements AtkImplementorIface and GtkBuildable.

## Properties

      "action-group"             GtkActionGroup*       : Read
      "shell"                    RBShell*              : Read / Write / Construct Only
      "ui-manager"               GtkUIManager*         : Read / Write / Construct Only

## Description

The tray icon handles a few different forms of input:

- left clicking hides and shows the main window
- right clicking brings up a popup menu
- dropping files on the icon adds them to the library
- scroll events change the playback volume

The tooltip for the tray icon consists of an image, the primary text (displayed in bold large type), and the secondary text (which can contain markup).

The tooltip is shown after the mouse pointer has been within the tray icon area for half a second. This delay is only reset once the pointer has been outside the tray icon area for more than one second.

The tray icon can also display notification bubbles (using libnotify). These contain the same set of elements as the tooltip. The tooltip is suppressed while a notification bubble is being displayed. A GConf setting allows the user to disable notification bubbles.

## Details

### RBTrayIcon

    typedef struct _RBTrayIcon RBTrayIcon;

### RBTrayIconClass

    typedef struct {
    	EggTrayIconClass parent_class;
    } RBTrayIconClass;

### rb_tray_icon_new ()

    RBTrayIcon *        rb_tray_icon_new                    (GtkUIManager *mgr,
                                                             RBShell *shell);

`mgr` : | the GtkUIManager
`shell` : | the RBShell
Returns : | the RBTrayIcon

### rb_tray_icon_get_geom ()

    void                rb_tray_icon_get_geom               (RBTrayIcon *icon,
                                                             int *x,
                                                             int *y,
                                                             int *width,
                                                             int *height);

Retrieves the current position and size of the tray icon.

`icon` : | the RBTrayIcon
`x` : | returns the x position of the tray icon
`y` : | returns the y position of the tray icon
`width` : | returns the width of the tray icon
`height` : | returns the height of the tray icon

### rb_tray_icon_notify ()

    void                rb_tray_icon_notify                 (RBTrayIcon *icon,
                                                             guint timeout,
                                                             const char *primary_markup,
                                                             GdkPixbuf *pixbuf,
                                                             const char *secondary_markup,
                                                             gboolean requested);

Displays a notification bubble attached to the tray icon. If the user has disabled notifications, the notification is only displayed if `requested` is `TRUE`.

`icon` : | the RBTrayIcon
`timeout` : | how long the notification should be displayed (in milliseconds)
`primary_markup` : | primary markup to display in the notification
`pixbuf` : | GdkPixbuf to display as the image in the notification
`secondary_markup` : | secondary markup to display in the notification
`requested` : | if `TRUE`, the notification was directly requested by the user

### rb_tray_icon_cancel_notify ()

    void                rb_tray_icon_cancel_notify          (RBTrayIcon *icon);

Cancels any existing notification bubble.

`icon` : | the RBTrayIcon

### rb_tray_icon_set_tooltip_primary_text ()

    void                rb_tray_icon_set_tooltip_primary_text
                                                            (RBTrayIcon *icon,
                                                             const char *primary_text);

Updates the primary (large) text in the tray icon.

`icon` : | the RBTrayIcon
`primary_text` : | the new primary text

### rb_tray_icon_set_tooltip_icon ()

    void                rb_tray_icon_set_tooltip_icon       (RBTrayIcon *icon,
                                                             GdkPixbuf *pixbuf);

Updates the icon in the tooltip.

`icon` : | the RBTrayIcon
`pixbuf` : | a GdkPixbuf to display as the icon in the tooltip

### rb_tray_icon_set_tooltip_secondary_markup ()

    void                rb_tray_icon_set_tooltip_secondary_markup
                                                            (RBTrayIcon *icon,
                                                             const char *secondary_markup);

Updates the secondary text in the tooltip. The secondary text can contain simple markup.

`icon` : | the RBTrayIcon
`secondary_markup` : | markup text to display as the secondary text in the toolip

## Property Details

### The `"action-group"` property

      "action-group"             GtkActionGroup*       : Read

The GtkActionGroup containing action specific to the tray icon

### The `"shell"` property

      "shell"                    RBShell*              : Read / Write / Construct Only

RBShell instance

### The `"ui-manager"` property

      "ui-manager"               GtkUIManager*         : Read / Write / Construct Only

GtkUIManager instance