|
mate-desktop 1.29.2
Library with common API for various MATE modules
|
#include <glib.h>#include <glib-object.h>#include <time.h>#include <gdk-pixbuf/gdk-pixbuf.h>Data Structures | |
| struct | _MateDesktopThumbnailFactory |
| struct | _MateDesktopThumbnailFactoryClass |
Macros | |
| #define | MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY (mate_desktop_thumbnail_factory_get_type ()) |
| #define | MATE_DESKTOP_THUMBNAIL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY, MateDesktopThumbnailFactory)) |
| #define | MATE_DESKTOP_THUMBNAIL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY, MateDesktopThumbnailFactoryClass)) |
| #define | MATE_DESKTOP_IS_THUMBNAIL_FACTORY(obj) (G_TYPE_INSTANCE_CHECK_TYPE ((obj), MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY)) |
| #define | MATE_DESKTOP_IS_THUMBNAIL_FACTORY_CLASS(klass) (G_TYPE_CLASS_CHECK_CLASS_TYPE ((klass), MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY)) |
Typedefs | |
| typedef struct _MateDesktopThumbnailFactory | MateDesktopThumbnailFactory |
| typedef struct _MateDesktopThumbnailFactoryClass | MateDesktopThumbnailFactoryClass |
| typedef struct _MateDesktopThumbnailFactoryPrivate | MateDesktopThumbnailFactoryPrivate |
Enumerations | |
| enum | MateDesktopThumbnailSize { MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL , MATE_DESKTOP_THUMBNAIL_SIZE_LARGE } |
Functions | |
| GType | mate_desktop_thumbnail_factory_get_type (void) |
| MateDesktopThumbnailFactory * | mate_desktop_thumbnail_factory_new (MateDesktopThumbnailSize size) |
| mate_desktop_thumbnail_factory_new: @size: The thumbnail size to use | |
| char * | mate_desktop_thumbnail_factory_lookup (MateDesktopThumbnailFactory *factory, const char *uri, time_t mtime) |
| mate_desktop_thumbnail_factory_lookup: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mtime: the mtime of the file | |
| gboolean | mate_desktop_thumbnail_factory_has_valid_failed_thumbnail (MateDesktopThumbnailFactory *factory, const char *uri, time_t mtime) |
| mate_desktop_thumbnail_factory_has_valid_failed_thumbnail: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mtime: the mtime of the file | |
| gboolean | mate_desktop_thumbnail_factory_can_thumbnail (MateDesktopThumbnailFactory *factory, const char *uri, const char *mime_type, time_t mtime) |
| mate_desktop_thumbnail_factory_can_thumbnail: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mime_type: the mime type of the file @mtime: the mtime of the file | |
| GdkPixbuf * | mate_desktop_thumbnail_factory_generate_thumbnail (MateDesktopThumbnailFactory *factory, const char *uri, const char *mime_type) |
| mate_desktop_thumbnail_factory_generate_thumbnail: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mime_type: the mime type of the file | |
| void | mate_desktop_thumbnail_factory_save_thumbnail (MateDesktopThumbnailFactory *factory, GdkPixbuf *thumbnail, const char *uri, time_t original_mtime) |
| mate_desktop_thumbnail_factory_save_thumbnail: @factory: a MateDesktopThumbnailFactory @thumbnail: the thumbnail as a pixbuf @uri: the uri of a file @original_mtime: the modification time of the original file | |
| void | mate_desktop_thumbnail_factory_create_failed_thumbnail (MateDesktopThumbnailFactory *factory, const char *uri, time_t mtime) |
| mate_desktop_thumbnail_factory_create_failed_thumbnail: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mtime: the modification time of the file | |
| gboolean | mate_desktop_thumbnail_has_uri (GdkPixbuf *pixbuf, const char *uri) |
| mate_desktop_thumbnail_has_uri: @pixbuf: an loaded thumbnail pixbuf @uri: a uri | |
| gboolean | mate_desktop_thumbnail_is_valid (GdkPixbuf *pixbuf, const char *uri, time_t mtime) |
| mate_desktop_thumbnail_is_valid: @pixbuf: an loaded thumbnail #GdkPixbuf @uri: a uri @mtime: the mtime | |
| char * | mate_desktop_thumbnail_path_for_uri (const char *uri, MateDesktopThumbnailSize size) |
| mate_desktop_thumbnail_path_for_uri: @uri: an uri @size: a thumbnail size | |
| #define MATE_DESKTOP_IS_THUMBNAIL_FACTORY | ( | obj | ) | (G_TYPE_INSTANCE_CHECK_TYPE ((obj), MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY)) |
| #define MATE_DESKTOP_IS_THUMBNAIL_FACTORY_CLASS | ( | klass | ) | (G_TYPE_CLASS_CHECK_CLASS_TYPE ((klass), MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY)) |
| #define MATE_DESKTOP_THUMBNAIL_FACTORY | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY, MateDesktopThumbnailFactory)) |
| #define MATE_DESKTOP_THUMBNAIL_FACTORY_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_CAST ((klass), MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY, MateDesktopThumbnailFactoryClass)) |
| #define MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY (mate_desktop_thumbnail_factory_get_type ()) |
| typedef struct _MateDesktopThumbnailFactory MateDesktopThumbnailFactory |
| gboolean mate_desktop_thumbnail_factory_can_thumbnail | ( | MateDesktopThumbnailFactory * | factory, |
| const char * | uri, | ||
| const char * | mime_type, | ||
| time_t | mtime | ||
| ) |
mate_desktop_thumbnail_factory_can_thumbnail: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mime_type: the mime type of the file @mtime: the mtime of the file
Returns TRUE if this MateDesktopThumbnailFactory can (at least try) to thumbnail this file. Thumbnails or files with failed thumbnails won't be thumbnailed.
Usage of this function is threadsafe.
Return value: TRUE if the file can be thumbnailed.
Since: 2.2
References _MateDesktopThumbnailFactoryPrivate::lock, mate_desktop_thumbnail_factory_has_valid_failed_thumbnail(), mate_desktop_thumbnail_factory_is_disabled(), _MateDesktopThumbnailFactoryPrivate::mime_types_map, _MateDesktopThumbnailFactory::priv, Thumbnailer, and thumbnailer_try_exec().
| void mate_desktop_thumbnail_factory_create_failed_thumbnail | ( | MateDesktopThumbnailFactory * | factory, |
| const char * | uri, | ||
| time_t | mtime | ||
| ) |
mate_desktop_thumbnail_factory_create_failed_thumbnail: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mtime: the modification time of the file
Creates a failed thumbnail for the file so that we don't try to re-thumbnail the file later.
Usage of this function is threadsafe.
Since: 2.2
References make_failed_thumbnail(), save_thumbnail(), and thumbnail_failed_path().
Referenced by create_thumbnail_for_filename().
| GdkPixbuf * mate_desktop_thumbnail_factory_generate_thumbnail | ( | MateDesktopThumbnailFactory * | factory, |
| const char * | uri, | ||
| const char * | mime_type | ||
| ) |
mate_desktop_thumbnail_factory_generate_thumbnail: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mime_type: the mime type of the file
Tries to generate a thumbnail for the specified file. If it succeeds it returns a pixbuf that can be used as a thumbnail.
Usage of this function is threadsafe.
Return value: (transfer full): thumbnail pixbuf if thumbnailing succeeded, NULL otherwise.
Since: 2.2
References expand_thumbnailing_script(), get_preview_thumbnail(), _MateDesktopThumbnailFactoryPrivate::lock, mate_desktop_thumbnail_factory_is_disabled(), MATE_DESKTOP_THUMBNAIL_SIZE_LARGE, _MateDesktopThumbnailFactoryPrivate::mime_types_map, _MateDesktopThumbnailFactory::priv, _MateDesktopThumbnailFactoryPrivate::size, and Thumbnailer.
Referenced by main().
| GType mate_desktop_thumbnail_factory_get_type | ( | void | ) |
| gboolean mate_desktop_thumbnail_factory_has_valid_failed_thumbnail | ( | MateDesktopThumbnailFactory * | factory, |
| const char * | uri, | ||
| time_t | mtime | ||
| ) |
mate_desktop_thumbnail_factory_has_valid_failed_thumbnail: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mtime: the mtime of the file
Tries to locate an failed thumbnail for the file specified. Writing and looking for failed thumbnails is important to avoid to try to thumbnail e.g. broken images several times.
Usage of this function is threadsafe.
Return value: TRUE if there is a failed thumbnail for the file.
Since: 2.2
References lookup_failed_thumbnail_path(), _MateDesktopThumbnailFactory::priv, and _MateDesktopThumbnailFactoryPrivate::size.
Referenced by mate_desktop_thumbnail_factory_can_thumbnail().
| char * mate_desktop_thumbnail_factory_lookup | ( | MateDesktopThumbnailFactory * | factory, |
| const char * | uri, | ||
| time_t | mtime | ||
| ) |
mate_desktop_thumbnail_factory_lookup: @factory: a MateDesktopThumbnailFactory @uri: the uri of a file @mtime: the mtime of the file
Tries to locate an existing thumbnail for the file specified.
Usage of this function is threadsafe.
Return value: (transfer full): The absolute path of the thumbnail, or NULL if none exist.
Since: 2.2
References lookup_thumbnail_path(), _MateDesktopThumbnailFactory::priv, and _MateDesktopThumbnailFactoryPrivate::size.
Referenced by create_thumbnail_for_filename().
| MateDesktopThumbnailFactory * mate_desktop_thumbnail_factory_new | ( | MateDesktopThumbnailSize | size | ) |
mate_desktop_thumbnail_factory_new: @size: The thumbnail size to use
Creates a new MateDesktopThumbnailFactory.
This function must be called on the main thread.
Return value: a new MateDesktopThumbnailFactory
Since: 2.2
References MATE_DESKTOP_TYPE_THUMBNAIL_FACTORY, _MateDesktopThumbnailFactory::priv, and _MateDesktopThumbnailFactoryPrivate::size.
Referenced by main().
| void mate_desktop_thumbnail_factory_save_thumbnail | ( | MateDesktopThumbnailFactory * | factory, |
| GdkPixbuf * | thumbnail, | ||
| const char * | uri, | ||
| time_t | original_mtime | ||
| ) |
mate_desktop_thumbnail_factory_save_thumbnail: @factory: a MateDesktopThumbnailFactory @thumbnail: the thumbnail as a pixbuf @uri: the uri of a file @original_mtime: the modification time of the original file
Saves @thumbnail at the right place. If the save fails a failed thumbnail is written.
Usage of this function is threadsafe.
Since: 2.2
References make_failed_thumbnail(), _MateDesktopThumbnailFactory::priv, save_thumbnail(), _MateDesktopThumbnailFactoryPrivate::size, thumbnail_failed_path(), and thumbnail_path().
Referenced by create_thumbnail_for_filename().
| gboolean mate_desktop_thumbnail_has_uri | ( | GdkPixbuf * | pixbuf, |
| const char * | uri | ||
| ) |
mate_desktop_thumbnail_has_uri: @pixbuf: an loaded thumbnail pixbuf @uri: a uri
Returns whether the thumbnail has the correct uri embedded in the Thumb::URI option in the png.
Return value: TRUE if the thumbnail is for @uri
Since: 2.2
| gboolean mate_desktop_thumbnail_is_valid | ( | GdkPixbuf * | pixbuf, |
| const char * | uri, | ||
| time_t | mtime | ||
| ) |
mate_desktop_thumbnail_is_valid: @pixbuf: an loaded thumbnail #GdkPixbuf @uri: a uri @mtime: the mtime
Returns whether the thumbnail has the correct uri and mtime embedded in the png options.
Return value: TRUE if the thumbnail has the right @uri and @mtime
Since: 2.2
Referenced by validate_thumbnail_path().
| char * mate_desktop_thumbnail_path_for_uri | ( | const char * | uri, |
| MateDesktopThumbnailSize | size | ||
| ) |
mate_desktop_thumbnail_path_for_uri: @uri: an uri @size: a thumbnail size
Returns the filename that a thumbnail of size @size for @uri would have.
Return value: an absolute filename
Since: 2.2
References thumbnail_path().