#define AUTOSTART_ON 1
#define GUI_DPI 300
+#define CONFIGURATION "Configuration"
void _kds_s2000w_handler_opts_write_value_to_json(json_object* value_object, SANE_Value_Type value_type, void* value)
{
kds_s2000w_debug_printf_int(DEBUG, "valid width", h->coord->width);
kds_s2000w_debug_printf_int(DEBUG, "valid height", h->coord->height);
- json_object* config = json_object_object_get(h->current_scanner_config, "Configuration");
+ json_object* config = json_object_object_get(h->current_scanner_config, CONFIGURATION);
json_object* value_object = json_object_object_get(config, IMAGE_OFFSET_X);
json_object_set_int(value_object, h->coord->offset_x);
value_object = json_object_object_get(config, IMAGE_OFFSET_Y);
json_object* capabilities = json_tokener_parse(resp->data);
json_object* default_values = json_object_object_get(capabilities, "Defaults");
json_object* default_config = json_object_new_object();
- json_object_object_add(default_config, "Configuration", default_values);
+ json_object_object_add(default_config, CONFIGURATION, default_values);
json_object_put(h->current_scanner_config);
h->current_scanner_config = NULL;
json_object* config = NULL;
if (h->current_scanner_config == NULL) {
_kds_s2000w_handler_opts_load_options(h);
- config = json_object_object_get(h->current_scanner_config, "Configuration");
+ config = json_object_object_get(h->current_scanner_config, CONFIGURATION);
_kds_s2000w_handler_opts_set_autostart_on(config);
_kds_s2000w_handler_opts_set_options(h);
}
- config = json_object_object_get(h->current_scanner_config, "Configuration");
+ config = json_object_object_get(h->current_scanner_config, CONFIGURATION);
option_descriptor* descriptor = kds_s2000w_option_descriptors_full_get_by_number(option);
if (strcmp(descriptor->config_name, OPTION_COUNT) == 0) {
json_object* config = NULL;
if (h->current_scanner_config == NULL) {
_kds_s2000w_handler_opts_load_options(h);
- config = json_object_object_get(h->current_scanner_config, "Configuration");
+ config = json_object_object_get(h->current_scanner_config, CONFIGURATION);
_kds_s2000w_handler_opts_set_autostart_on(config);
}
if (h->current_scanner_config != NULL)
- config = json_object_object_get(h->current_scanner_config, "Configuration");
+ config = json_object_object_get(h->current_scanner_config, CONFIGURATION);
option_descriptor* descriptor = kds_s2000w_option_descriptors_full_get_by_number(option);
json_object* value_object = json_object_object_get(config, descriptor->config_name);
if (strcmp(descriptor->config_name, RESET) == 0) {
_kds_s2000w_handler_opts_set_option_to_default(h);
- config = json_object_object_get(h->current_scanner_config, "Configuration");
+ config = json_object_object_get(h->current_scanner_config, CONFIGURATION);
_kds_s2000w_handler_opts_set_autostart_on(config);
}