summaryrefslogtreecommitdiff
path: root/tumbler/tumbler-enum-types.h
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis@xfce.org>2009-05-22 01:48:00 +0200
committerJannis Pohlmann <jannis@xfce.org>2009-05-22 01:48:00 +0200
commitefab2f56c73c1dec60a14c83a5aff6a5620f7bbc (patch)
treeb8fcee37105b2228a6d6aff319d2a111643e2d92 /tumbler/tumbler-enum-types.h
parent2c9ff27c04812b52b4ba9ed02cd1c4c89da9b851 (diff)
downloadtumbler-efab2f56c73c1dec60a14c83a5aff6a5620f7bbc.tar.gz
Add error domain, TumblerThumbnailFlavor and thumbnail helper functions.
This commit adds the TUMBLER_ERROR_DOMAIN and TUMBLER_ERROR defines and a TumblerErrorEnum with currently only containing TUMBLER_ERROR_FAILED. Also new is the TumblerThumbnailFlavor enum type, together with a few utility functions related to creating thumbnails: - tumbler_thumbnail_get_flavors() returns all flavors supported by the current build of tumbler, - tumbler_thumbnail_flavor_get_size() returns the size corresponding to a flavor (e.g. 128 for TUMBLER_THUMBNAIL_FLAVOR_NORMAL), - tumbler_thumbnail_flavor_get_directory() returns a GFile pointing to the flavor directory (e.g. $HOME/.thumbnails/normal/ for TUMBLER_THUMBNAIL_FLAVOR_NORMAL), - tumbler_thumbnail_get_file() returns a GFile pointing to the thumbnail destination file of an URI and a flavor, - tumbler_thumbnail_create_and_open_file() tries to create such a GFile and also tries to open it for writing, returning the GFileOutputStream if possible.
Diffstat (limited to 'tumbler/tumbler-enum-types.h')
-rw-r--r--tumbler/tumbler-enum-types.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/tumbler/tumbler-enum-types.h b/tumbler/tumbler-enum-types.h
new file mode 100644
index 0000000..98465f4
--- /dev/null
+++ b/tumbler/tumbler-enum-types.h
@@ -0,0 +1,46 @@
+/* vi:set et ai sw=2 sts=2 ts=2: */
+/*-
+ * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined (TUMBLER_INSIDE_TUMBLER_H) && !defined (TUMBLER_COMPILATION)
+#error "Only <tumbler/tumbler.h> may be included directly. This file might disappear or change contents."
+#endif
+
+#ifndef __TUMBLER_ENUM_TYPES_H__
+#define __TUMBLER_ENUM_TYPES_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define TUMBLER_TYPE_THUMBNAIL_FLAVOR (tumbler_thumbnail_flavor_get_type ())
+
+typedef enum /*< enum >*/
+{
+ TUMBLER_THUMBNAIL_FLAVOR_INVALID,
+ TUMBLER_THUMBNAIL_FLAVOR_NORMAL,
+ TUMBLER_THUMBNAIL_FLAVOR_LARGE,
+ TUMBLER_THUMBNAIL_FLAVOR_CROPPED,
+} TumblerThumbnailFlavor;
+
+GType tumbler_thumbnail_flavor_get_type (void);
+
+G_END_DECLS
+
+#endif /* !__TUMBLER_ENUM_TYPES_H__ */