gtk_widget_destroy(fs->window);
- gtk_window_present(fs->normal_window);
+ gtk_window_present(GTK_WINDOW(fs->normal_window));
g_free(fs);
}
return TRUE;
}
+void write_ushort_option(GString *str, gint indent, const gchar *label, guint16 n)
+{
+ g_string_append_printf(str, "%s = \"%uh\" ", label, n);
+}
+
+gboolean read_ushort_option(const gchar *option, const gchar *label, const gchar *value, guint16 *n)
+{
+ if (g_ascii_strcasecmp(option, label) != 0) return FALSE;
+ if (!n) return FALSE;
+
+ if (g_ascii_isdigit(value[0]))
+ {
+ *n = strtoul(value, NULL, 10);
+ }
+ else
+ {
+ if (g_ascii_strcasecmp(value, "true") == 0)
+ *n = 1;
+ else
+ *n = 0;
+ }
+
+ return TRUE;
+}
+
void write_uint_option(GString *str, gint indent, const gchar *label, guint n)
{
g_string_append_printf(str, "%s = \"%u\" ", label, n);
if (READ_CHAR(*options, image_overlay.template_string)) continue;
if (READ_INT(*options, image_overlay.x)) continue;
if (READ_INT(*options, image_overlay.y)) continue;
- if (READ_INT(*options, image_overlay.text_red)) continue;
- if (READ_INT(*options, image_overlay.text_green)) continue;
- if (READ_INT(*options, image_overlay.text_blue)) continue;
- if (READ_INT(*options, image_overlay.text_alpha)) continue;
- if (READ_INT(*options, image_overlay.background_red)) continue;
- if (READ_INT(*options, image_overlay.background_green)) continue;
- if (READ_INT(*options, image_overlay.background_blue)) continue;
- if (READ_INT(*options, image_overlay.background_alpha)) continue;
+ if (READ_USHORT(*options, image_overlay.text_red)) continue;
+ if (READ_USHORT(*options, image_overlay.text_green)) continue;
+ if (READ_USHORT(*options, image_overlay.text_blue)) continue;
+ if (READ_USHORT(*options, image_overlay.text_alpha)) continue;
+ if (READ_USHORT(*options, image_overlay.background_red)) continue;
+ if (READ_USHORT(*options, image_overlay.background_green)) continue;
+ if (READ_USHORT(*options, image_overlay.background_blue)) continue;
+ if (READ_USHORT(*options, image_overlay.background_alpha)) continue;
if (READ_CHAR(*options, image_overlay.font)) continue;
/* Slideshow options */
gboolean read_color_option(const gchar *option, const gchar *label, const gchar *value, GdkColor *color);
void write_int_option(GString *str, gint indent, const gchar *label, gint n);
gboolean read_int_option(const gchar *option, const gchar *label, const gchar *value, gint *n);
+void write_ushort_option(GString *str, gint indent, const gchar *label, guint16 n);
+gboolean read_ushort_option(const gchar *option, const gchar *label, const gchar *value, guint16 *n);
void write_uint_option(GString *str, gint indent, const gchar *label, guint n);
gboolean read_uint_option(const gchar *option, const gchar *label, const gchar *value, guint *n);
gboolean read_uint_option_clamp(const gchar *option, const gchar *label, const gchar *value, guint *n, guint min, guint max);
#define READ_BOOL(_target_, _name_) read_bool_option(option, #_name_, value, &(_target_)._name_)
#define READ_INT(_target_, _name_) read_int_option(option, #_name_, value, &(_target_)._name_)
#define READ_UINT(_target_, _name_) read_uint_option(option, #_name_, value, &(_target_)._name_)
+#define READ_USHORT(_target_, _name_) read_ushort_option(option, #_name_, value, &(_target_)._name_)
#define READ_INT_CLAMP(_target_, _name_, _min_, _max_) read_int_option_clamp(option, #_name_, value, &(_target_)._name_, _min_, _max_)
#define READ_UINT_CLAMP(_target_, _name_, _min_, _max_) read_uint_option_clamp(option, #_name_, value, &(_target_)._name_, _min_, _max_)
#define READ_INT_UNIT(_target_, _name_, _unit_) read_int_unit_option(option, #_name_, value, &(_target_)._name_, _unit_)
#include "main.h"
#include "view_file.h"
+#include "collect.h"
+#include "collect-table.h"
#include "editors.h"
#include "layout.h"
#include "menu.h"