AwnIcon

## AwnIcon AwnIcon |

## Synopsis

                        AwnIconPrivate;
                        AwnIcon;
    GtkWidget *         awn_icon_new                        (void);
    void                awn_icon_set_pos_type               (AwnIcon *icon,
                                                             GtkPositionType position);
    GtkPositionType     awn_icon_get_pos_type               (AwnIcon *icon);
    void                awn_icon_set_offset                 (AwnIcon *icon,
                                                             gint offset);
    gint                awn_icon_get_offset                 (AwnIcon *icon);
    void                awn_icon_set_effect                 (AwnIcon *icon,
                                                             AwnEffect effect);
    void                awn_icon_set_from_pixbuf            (AwnIcon *icon,
                                                             GdkPixbuf *pixbuf);
    void                awn_icon_set_from_context           (AwnIcon *icon,
                                                             cairo_t *ctx);
    void                awn_icon_set_from_surface           (AwnIcon *icon,
                                                             cairo_surface_t *surface);
    void                awn_icon_set_custom_paint           (AwnIcon *icon,
                                                             gint width,
                                                             gint height);
    AwnTooltip*         awn_icon_get_tooltip                (AwnIcon *icon);
    void                awn_icon_set_tooltip_text           (AwnIcon *icon,
                                                             const gchar *text);
    gchar *             awn_icon_get_tooltip_text           (AwnIcon *icon);
    void                awn_icon_set_is_active              (AwnIcon *icon,
                                                             gboolean is_active);
    gboolean            awn_icon_get_is_active              (AwnIcon *icon);
    void                awn_icon_set_indicator_count        (AwnIcon *icon,
                                                             gint count);
    gint                awn_icon_get_indicator_count        (AwnIcon *icon);
    gboolean            awn_icon_get_hover_effects          (AwnIcon *icon);
    void                awn_icon_set_hover_effects          (AwnIcon *icon,
                                                             gboolean enable);
    void                awn_icon_clicked                    (AwnIcon *icon);
    void                awn_icon_middle_clicked             (AwnIcon *icon);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkDrawingArea
                               +----AwnIcon
                                     +----AwnThemedIcon

## Implemented Interfaces

AwnIcon implements AtkImplementorIface, GtkBuildable and AwnOverlayable.

## Properties

      "bind-effects"             gboolean              : Read / Write / Construct Only
      "icon-height"              gint                  : Read / Write
      "icon-width"               gint                  : Read / Write
      "long-press-timeout"       gint                  : Read / Write / Construct

## Signals

      "clicked"                                        : Run First / Action
      "context-menu-popup"                             : Run First / Action
      "long-press"                                     : Run First / Action
      "middle-clicked"                                 : Run First / Action
      "size-changed"                                   : Run First

## Description

## Details

### AwnIconPrivate

    typedef struct _AwnIconPrivate AwnIconPrivate;

### AwnIcon

    typedef struct _AwnIcon AwnIcon;

### awn_icon_new ()

    GtkWidget *         awn_icon_new                        (void);

Creates new AwnIcon.

Returns : | newly created AwnIcon.

### awn_icon_set_pos_type ()

    void                awn_icon_set_pos_type               (AwnIcon *icon,
                                                             GtkPositionType position);

Sets position of the icon.

`icon` : | an AwnIcon.
`position` : | position of the icon.

### awn_icon_get_pos_type ()

    GtkPositionType     awn_icon_get_pos_type               (AwnIcon *icon);

`icon` : | an AwnIcon.
Returns : | current position type set for the icon.

### awn_icon_set_offset ()

    void                awn_icon_set_offset                 (AwnIcon *icon,
                                                             gint offset);

Sets offset of the icon.

`icon` : | an AwnIcon.
`offset` : | new offset for the icon.

### awn_icon_get_offset ()

    gint                awn_icon_get_offset                 (AwnIcon *icon);

`icon` : | an AwnIcon.
Returns : | current offset set for the icon.

### awn_icon_set_effect ()

    void                awn_icon_set_effect                 (AwnIcon *icon,
                                                             AwnEffect effect);

Sets effect on the icon. Note that the effect will loop until `awn_effects_stop()` is called.

`icon` : | an AwnIcon.
`effect` : | AwnEffect to start looping.

### awn_icon_set_from_pixbuf ()

    void                awn_icon_set_from_pixbuf            (AwnIcon *icon,
                                                             GdkPixbuf *pixbuf);

Sets the icon from the given pixbuf. Note that a copy of the pixbuf is made.

`icon` : | an AwnIcon.
`pixbuf` : | a GdkPixbuf.

### awn_icon_set_from_context ()

    void                awn_icon_set_from_context           (AwnIcon *icon,
                                                             cairo_t *ctx);

Extracts the icon from the cairo surface associated with given cairo context. Note that the surface is only referenced, so any later changes made to it will change the icon as well (after a call to `gtk_widget_queue_draw()`).

`icon` : | an AwnIcon.
`ctx` : | a cairo_t.

### awn_icon_set_from_surface ()

    void                awn_icon_set_from_surface           (AwnIcon *icon,
                                                             cairo_surface_t *surface);

Sets the icon from the given cairo surface. Note that the surface is only referenced, so any later changes made to it will change the icon as well (after a call to `gtk_widget_queue_draw()`).

`icon` : | an AwnIcon.
`surface` : | a cairo_surface_t.

### awn_icon_set_custom_paint ()

    void                awn_icon_set_custom_paint           (AwnIcon *icon,
                                                             gint width,
                                                             gint height);

Prepares the icon for custom painting (by overriding "expose-event"). Sets proper size requisition, tooltip position, parameters for AwnEffects and may emit size changed signal.

### Note

If there's already an icon set, it is not freed, so if you later disconnect from the "expose-event", a second call to `awn_icon_set_custom_paint()` with the original dimensions of the icon will restore the icon.

`icon` : | an AwnIcon.
`width` : | new width of the icon.
`height` : | new height of the icon.

### awn_icon_get_tooltip ()

    AwnTooltip*         awn_icon_get_tooltip                (AwnIcon *icon);

Gets the AwnTooltip associated with this icon.

`icon` : | an AwnIcon.
Returns : | tooltip widget.

### awn_icon_set_tooltip_text ()

    void                awn_icon_set_tooltip_text           (AwnIcon *icon,
                                                             const gchar *text);

Sets tooltip message.

`icon` : | an AwnIcon.
`text` : | tooltip message.

### awn_icon_get_tooltip_text ()

    gchar *             awn_icon_get_tooltip_text           (AwnIcon *icon);

Gets the message currently set for the associated AwnTooltip. The caller is responsible for freeing the string.

`icon` : | an AwnIcon.
Returns : | currently used message by the associated AwnTooltip.

### awn_icon_set_is_active ()

    void                awn_icon_set_is_active              (AwnIcon *icon,
                                                             gboolean is_active);

Sets whether the icon is active (if it is paints a rectangle around the icon by default).

`icon` : | an AwnIcon.
`is_active` : | value.

### awn_icon_get_is_active ()

    gboolean            awn_icon_get_is_active              (AwnIcon *icon);

Gets whether the icon is active.

`icon` : | an AwnIcon.
Returns : | TRUE if the icon is active, FALSE otherwise.

### awn_icon_set_indicator_count ()

    void                awn_icon_set_indicator_count        (AwnIcon *icon,
                                                             gint count);

Paints an indicator (or multiple) on the border of icon.

`icon` : | an AwnIcon.
`count` : | indicator count.

### awn_icon_get_indicator_count ()

    gint                awn_icon_get_indicator_count        (AwnIcon *icon);

Gets number of indicators set for this icon.

`icon` : | an AwnIcon.
Returns : | number of indicators.

### awn_icon_get_hover_effects ()

    gboolean            awn_icon_get_hover_effects          (AwnIcon *icon);

`icon` : |
Returns : |

### awn_icon_set_hover_effects ()

    void                awn_icon_set_hover_effects          (AwnIcon *icon,
                                                             gboolean enable);

`icon` : |
`enable` : |

### awn_icon_clicked ()

    void                awn_icon_clicked                    (AwnIcon *icon);

`icon` : |

### awn_icon_middle_clicked ()

    void                awn_icon_middle_clicked             (AwnIcon *icon);

`icon` : |

## Property Details

### The `"bind-effects"` property

      "bind-effects"             gboolean              : Read / Write / Construct Only

If set to true, will load and bind effect property values from config client.

Default value: TRUE

### The `"icon-height"` property

      "icon-height"              gint                  : Read / Write

Current icon height.

Allowed values: >= 0

Default value: 0

### The `"icon-width"` property

      "icon-width"               gint                  : Read / Write

Current icon width.

Allowed values: >= 0

Default value: 0

### The `"long-press-timeout"` property

      "long-press-timeout"       gint                  : Read / Write / Construct

Timeout after which long-press signal is emit.

Allowed values: [250,10000]

Default value: 750

## Signal Details

### The `"clicked"` signal

    void                user_function                      (AwnIcon *awnicon,
                                                            gpointer user_data)      : Run First / Action

`awnicon` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"context-menu-popup"` signal

    void                user_function                      (AwnIcon  *awnicon,
                                                            GdkEvent *event,
                                                            gpointer  user_data)      : Run First / Action

`awnicon` : | the object which received the signal.
`event` : |
`user_data` : | user data set when the signal handler was connected.

### The `"long-press"` signal

    void                user_function                      (AwnIcon *awnicon,
                                                            gpointer user_data)      : Run First / Action

`awnicon` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"middle-clicked"` signal

    void                user_function                      (AwnIcon *awnicon,
                                                            gpointer user_data)      : Run First / Action

`awnicon` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"size-changed"` signal

    void                user_function                      (AwnIcon *awnicon,
                                                            gpointer user_data)      : Run First

`awnicon` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.