MateIconLookup

## MateIconLookup MateIconLookup |

## Synopsis

    #include <libmateui/libmateui.h>

    enum                MateIconLookupFlags;
    enum                MateIconLookupResultFlags;
    char *              mate_icon_lookup                   (GtkIconTheme *icon_theme,
                                                             MateThumbnailFactory *thumbnail_factory,
                                                             const char *file_uri,
                                                             const char *custom_icon,
                                                             MateVFSFileInfo *file_info,
                                                             const char *mime_type,
                                                             MateIconLookupFlags flags,
                                                             MateIconLookupResultFlags *result);
    char *              mate_icon_lookup_sync              (GtkIconTheme *icon_theme,
                                                             MateThumbnailFactory *thumbnail_factory,
                                                             const char *file_uri,
                                                             const char *custom_icon,
                                                             MateIconLookupFlags flags,
                                                             MateIconLookupResultFlags *result);

## Description

## Details

### enum MateIconLookupFlags

    typedef enum {
      MATE_ICON_LOOKUP_FLAGS_NONE = 0,
      MATE_ICON_LOOKUP_FLAGS_EMBEDDING_TEXT = 1<<0,
      MATE_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES = 1<<1,
      MATE_ICON_LOOKUP_FLAGS_ALLOW_SVG_AS_THEMSELVES = 1<<2
    } MateIconLookupFlags;

### enum MateIconLookupResultFlags

    typedef enum {
      MATE_ICON_LOOKUP_RESULT_FLAGS_NONE = 0,
      MATE_ICON_LOOKUP_RESULT_FLAGS_THUMBNAIL = 1<<0
    } MateIconLookupResultFlags;

### mate_icon_lookup ()

    char *              mate_icon_lookup                   (GtkIconTheme *icon_theme,
                                                             MateThumbnailFactory *thumbnail_factory,
                                                             const char *file_uri,
                                                             const char *custom_icon,
                                                             MateVFSFileInfo *file_info,
                                                             const char *mime_type,
                                                             MateIconLookupFlags flags,
                                                             MateIconLookupResultFlags *result);

This function tries to locate an icon in `icon_theme` that can be used to represent the file passed. It can optionally also look for existing thumbnails. It does no I/O, so the lookup should be relatively fast.

If you don't know any information about the file already you can use `mate_icon_lookup_sync()` which gets this information using mate-vfs.

For backwards compatibility, this function also accepts a MateIconTheme instead of a GtkIconTheme.

The following `flags` are valid:

MATE_ICON_LOOKUP_FLAGS_EMBEDDING_TEXT - Return the text icon for scripts. This is useful if you do text embedding in the icons.

MATE_ICON_LOOKUP_FLAGS_SHOW_SMALL_IMAGES_AS_THEMSELVES - Return the filename of the filename itself for small images. Only availible if you pass a thumbnail_factory.

Possible `result` flags:

MATE_ICON_LOOKUP_RESULT_FLAGS_THUMBNAIL - The returned file is a thumbnail.

`icon_theme` : | a GtkIconTheme, or (deprecated) a MateIconTheme
`thumbnail_factory` : | an optional MateThumbnailFactory used to look up thumbnails
`file_uri` : | the uri of the file
`custom_icon` : | optionally the name of a custom icon to try
`file_info` : | information about the file from `mate_vfs_get_file_info()`
`mime_type` : | the mime type of the icon
`flags` : | flags that affect the result of the lookup
`result` : | optionally result flags of the lookups are stored here
Returns : | The name of an icon or an absolute filename of an image to use for the file.

Since 2.2

### mate_icon_lookup_sync ()

    char *              mate_icon_lookup_sync              (GtkIconTheme *icon_theme,
                                                             MateThumbnailFactory *thumbnail_factory,
                                                             const char *file_uri,
                                                             const char *custom_icon,
                                                             MateIconLookupFlags flags,
                                                             MateIconLookupResultFlags *result);

This function tries to locate an icon in `icon_theme` that can be used to represent the file passed. See `mate_icon_lookup()` for more information.

`icon_theme` : | a GtkIconTheme, or (deprecated) a MateIconTheme
`thumbnail_factory` : | an optional MateThumbnailFactory used to look up thumbnails
`file_uri` : | the uri of the file
`custom_icon` : | optionally the name of a custom icon to try
`flags` : | flags that affect the result of the lookup
`result` : | optionally result flags of the lookups are stored here
Returns : | The name of an icon or an absolute filename of an image to use for the file.

Since 2.2