XviewerThumbView: Xviewer Reference Manual

## XviewerThumbView

XviewerThumbView

## Functions

GtkWidget * | xviewer_thumb_view_new ()
void | xviewer_thumb_view_set_model ()
void | xviewer_thumb_view_set_item_height ()
guint | xviewer_thumb_view_get_n_selected ()
XviewerImage * | xviewer_thumb_view_get_first_selected_image ()
GList * | xviewer_thumb_view_get_selected_images ()
void | xviewer_thumb_view_select_single ()
void | xviewer_thumb_view_set_current_image ()
void | xviewer_thumb_view_set_thumbnail_popup ()

## Types and Values

enum | XviewerThumbViewSelectionChange
struct | XviewerThumbView

## Description

## Functions

### xviewer_thumb_view_new ()

    GtkWidget *
    xviewer_thumb_view_new (void);

Creates a new XviewerThumbView object.

#### Returns

a newly created XviewerThumbView.

### xviewer_thumb_view_set_model ()

    void
    xviewer_thumb_view_set_model (XviewerThumbView *thumbview,
                                  XviewerListStore *store);

Sets the XviewerListStore to be used with `thumbview` . If an initial image was set during `store` creation, its thumbnail will be selected and visible.

#### Parameters

thumbview | A XviewerThumbView. |
store | A XviewerListStore. |

### xviewer_thumb_view_set_item_height ()

    void
    xviewer_thumb_view_set_item_height (XviewerThumbView *thumbview,
                                        gint height);

Sets the height of each thumbnail in `thumbview` .

#### Parameters

thumbview | A XviewerThumbView. |
height | The desired height. |

### xviewer_thumb_view_get_n_selected ()

    guint
    xviewer_thumb_view_get_n_selected (XviewerThumbView *thumbview);

Gets the number of images that are currently selected in `thumbview` .

#### Parameters

thumbview | An XviewerThumbView. |

#### Returns

the number of selected images in `thumbview` .

### xviewer_thumb_view_get_first_selected_image ()

    XviewerImage *
    xviewer_thumb_view_get_first_selected_image
                                   (XviewerThumbView *thumbview);

Returns the first selected image. Note that the returned XviewerImage is not ensured to be really the first selected image in `thumbview` , but generally, it will be.

#### Parameters

thumbview | A XviewerThumbView. |

#### Returns

A XviewerImage.

[transfer full]

### xviewer_thumb_view_get_selected_images ()

    GList *
    xviewer_thumb_view_get_selected_images
                                   (XviewerThumbView *thumbview);

Gets a list with the currently selected images. Note that a new reference is hold for each image and the list must be freed with `g_list_free()`.

#### Parameters

thumbview | A XviewerThumbView. |

#### Returns

A newly allocated list of XviewerImage's.

[element-type XviewerImage][transfer full]

### xviewer_thumb_view_select_single ()

    void
    xviewer_thumb_view_select_single (XviewerThumbView *thumbview,
                                      XviewerThumbViewSelectionChange change);

Changes the current selection according to a single movement described by XviewerThumbViewSelectionChange. If there are no thumbnails currently selected, one is selected according to the natural selection according to the XviewerThumbViewSelectionChange used, p.g., when `XVIEWER_THUMB_VIEW_SELECT_RIGHT` is the selected change, the first thumbnail will be selected.

#### Parameters

thumbview | A XviewerThumbView. |
change | A XviewerThumbViewSelectionChange, describing the desired selection change. |

### xviewer_thumb_view_set_current_image ()

    void
    xviewer_thumb_view_set_current_image (XviewerThumbView *thumbview,
                                          XviewerImage *image,
                                          gboolean deselect_other);

Changes the status of a image, marking it as currently selected. If `deselect_other` is `TRUE`, all other selected images will be deselected.

#### Parameters

thumbview | A XviewerThumbView. |
image | The image to be selected. |
deselect_other | Whether to deselect currently selected images. |

### xviewer_thumb_view_set_thumbnail_popup ()

    void
    xviewer_thumb_view_set_thumbnail_popup
                                   (XviewerThumbView *thumbview,
                                    GtkMenu *menu);

Set the contextual menu to be used with the thumbnails in the widget. This can be done only once.

#### Parameters

thumbview | An XviewerThumbView. |
menu | A GtkMenu. |

## Types and Values

### enum XviewerThumbViewSelectionChange

#### Members

XVIEWER_THUMB_VIEW_SELECT_CURRENT |  |
XVIEWER_THUMB_VIEW_SELECT_LEFT |  |
XVIEWER_THUMB_VIEW_SELECT_RIGHT |  |
XVIEWER_THUMB_VIEW_SELECT_FIRST |  |
XVIEWER_THUMB_VIEW_SELECT_LAST |  |
XVIEWER_THUMB_VIEW_SELECT_RANDOM |  |

### struct XviewerThumbView

    struct XviewerThumbView {
    	GtkIconView icon_view;
    	XviewerThumbViewPrivate *priv;
    };