summaryrefslogtreecommitdiff
path: root/src/xsane-device-preferences.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xsane-device-preferences.c')
-rw-r--r--src/xsane-device-preferences.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/xsane-device-preferences.c b/src/xsane-device-preferences.c
index 003cb77..41293e6 100644
--- a/src/xsane-device-preferences.c
+++ b/src/xsane-device-preferences.c
@@ -3,7 +3,7 @@
xsane-device-preferences.c
Oliver Rauch <Oliver.Rauch@rauch-domain.de>
- Copyright (C) 1998-2005 Oliver Rauch
+ Copyright (C) 1998-2007 Oliver Rauch
This file is part of the XSANE package.
This program is free software; you can redistribute it and/or modify
@@ -102,6 +102,10 @@ desc_xsane_device[] =
{"xsane-enhancement-rgb-default", xsane_rc_pref_int, DPOFFSET(enhancement_rgb_default)},
{"xsane-negative", xsane_rc_pref_int, DPOFFSET(negative)},
{"xsane-show-preview", xsane_rc_pref_int, DPOFFSET(show_preview)},
+
+ {"xsane-enable-color-management", xsane_rc_pref_int, DPOFFSET(enable_color_management)},
+ {"xsane-scanner-default-color-icm-profile", xsane_rc_pref_string, DPOFFSET(scanner_default_color_icm_profile)},
+ {"xsane-scanner-default-gray-icm-profile", xsane_rc_pref_string, DPOFFSET(scanner_default_gray_icm_profile)},
};
/* ---------------------------------------------------------------------------------------------------------------- */
@@ -109,7 +113,7 @@ desc_xsane_device[] =
static int xsane_device_preferences_load_values(Wire *w, SANE_Handle device)
{
const SANE_Option_Descriptor *opt;
- SANE_Word *word_array;
+ char *word_array;
SANE_String name, str;
u_long *caused_reload;
SANE_Int num_options;
@@ -193,12 +197,12 @@ static int xsane_device_preferences_load_values(Wire *w, SANE_Handle device)
}
else /* array */
{
- SANE_Int len;
+ SANE_Int len;
- xsane_rc_io_w_array(w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ xsane_rc_io_w_array(w, &len, &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
status = xsane_control_option(device, i, SANE_ACTION_SET_VALUE, word_array, &info);
w->direction = WIRE_FREE;
- xsane_rc_io_w_array(w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ xsane_rc_io_w_array(w, &len, &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
w->direction = WIRE_DECODE;
}
break;
@@ -239,7 +243,7 @@ static int xsane_device_preferences_save_values(Wire *w, SANE_Handle device)
{
const SANE_Option_Descriptor *opt;
size_t word_array_size = 0;
- SANE_Word *word_array = 0;
+ char *word_array = 0;
size_t str_size = 0;
SANE_String str = 0;
SANE_Word word;
@@ -308,7 +312,7 @@ static int xsane_device_preferences_save_values(Wire *w, SANE_Handle device)
}
xsane_rc_io_w_string(w, (SANE_String *) &opt->name);
- xsane_rc_io_w_array(w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ xsane_rc_io_w_array(w, &len, &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
}
break;
@@ -580,6 +584,10 @@ void xsane_device_preferences_load_file(char *filename)
gtk_window_set_default_size(GTK_WINDOW(xsane.preview->top), xsane.preview_dialog_width, xsane.preview_dialog_height);
#endif
+#ifdef HAVE_LIBLCMS
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.enable_color_management_widget), xsane.enable_color_management);
+#endif
+
xsane_update_param(0);
xsane_refresh_dialog();
xsane_enhancement_by_gamma();
@@ -621,7 +629,7 @@ void xsane_device_preferences_load(void)
sprintf(windowname, "%s %s %s", xsane.prog_name, WINDOW_LOAD_SETTINGS, xsane.device_text);
xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, 0, xsane.device_set_filename, ".drc", XSANE_PATH_LOCAL_SANE);
- if (!xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, NULL, FALSE, FALSE, FALSE, FALSE))
+ if (!xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, NULL, NULL, XSANE_FILE_CHOOSER_ACTION_OPEN, FALSE, XSANE_FILE_FILTER_ALL | XSANE_FILE_FILTER_DRC, XSANE_FILE_FILTER_DRC))
{
xsane_device_preferences_load_file(filename);
}
@@ -772,7 +780,7 @@ void xsane_device_preferences_save(void)
sprintf(windowname, "%s %s %s", xsane.prog_name, WINDOW_SAVE_SETTINGS, xsane.device_text);
xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, 0, xsane.device_set_filename, ".drc", XSANE_PATH_LOCAL_SANE);
- if (!xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, NULL, FALSE, FALSE, FALSE, FALSE))
+ if (!xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, NULL, NULL, XSANE_FILE_CHOOSER_ACTION_SAVE, FALSE, XSANE_FILE_FILTER_ALL | XSANE_FILE_FILTER_DRC, XSANE_FILE_FILTER_DRC))
{
xsane_device_preferences_save_file(filename);
}