summaryrefslogtreecommitdiff
path: root/thunar/thunar-enum-types.c
diff options
context:
space:
mode:
Diffstat (limited to 'thunar/thunar-enum-types.c')
-rw-r--r--thunar/thunar-enum-types.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/thunar/thunar-enum-types.c b/thunar/thunar-enum-types.c
index 8dc826b9..0db00b44 100644
--- a/thunar/thunar-enum-types.c
+++ b/thunar/thunar-enum-types.c
@@ -284,6 +284,46 @@ thunar_zoom_level_to_thumbnail_size (ThunarZoomLevel zoom_level)
+const gchar*
+thunar_zoom_level_string_from_value (ThunarZoomLevel zoom_level)
+{
+ GEnumClass *enum_class;
+ GEnumValue *enum_value;
+
+ enum_class = g_type_class_ref (THUNAR_TYPE_ZOOM_LEVEL);
+ enum_value = g_enum_get_value (enum_class, zoom_level);
+
+ g_type_class_unref (enum_class);
+
+ if (enum_value == NULL)
+ return NULL;
+
+ return enum_value->value_name;
+}
+
+
+
+gboolean
+thunar_zoom_level_value_from_string (const gchar *value_string,
+ gint *value)
+{
+ GEnumClass *enum_class;
+ GEnumValue *enum_value;
+
+ enum_class = g_type_class_ref (THUNAR_TYPE_ZOOM_LEVEL);
+ enum_value = g_enum_get_value_by_name (enum_class, value_string);
+
+ g_type_class_unref (enum_class);
+
+ if (enum_value == NULL)
+ return FALSE;
+
+ *value = enum_value->value;
+ return TRUE;
+}
+
+
+
GType
thunar_thumbnail_mode_get_type (void)
{