diff options
author | Julien BLACHE <jblache@debian.org> | 2007-11-22 11:42:18 +0100 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2014-10-03 14:05:42 +0000 |
commit | 95475333e13157b2a9b62c57be7c82d99e0c4460 (patch) | |
tree | 3726327549b591aba1510ff4e56317c12b276243 /src | |
parent | 0db1f3318701235603f80455d7d1e5c1709e5eb1 (diff) | |
parent | 41b1173190f702693b0b4fd2654cf2dc28a447f4 (diff) |
Imported Debian patch 0.995-1debian/0.995-1
Diffstat (limited to 'src')
-rw-r--r-- | src/xsane-back-gtk.c | 44 | ||||
-rw-r--r-- | src/xsane-batch-scan.c | 9 | ||||
-rw-r--r-- | src/xsane-email-project.c | 28 | ||||
-rw-r--r-- | src/xsane-fax-project.c | 25 | ||||
-rw-r--r-- | src/xsane-front-gtk.c | 73 | ||||
-rw-r--r-- | src/xsane-front-gtk.h | 1 | ||||
-rw-r--r-- | src/xsane-gtk-1_x-compat.h | 2 | ||||
-rw-r--r-- | src/xsane-icons.c | 4 | ||||
-rw-r--r-- | src/xsane-icons.h | 12 | ||||
-rw-r--r-- | src/xsane-multipage-project.c | 22 | ||||
-rw-r--r-- | src/xsane-preferences.c | 4 | ||||
-rw-r--r-- | src/xsane-preferences.h | 2 | ||||
-rw-r--r-- | src/xsane-preview.c | 60 | ||||
-rw-r--r-- | src/xsane-preview.h | 8 | ||||
-rw-r--r-- | src/xsane-save.c | 528 | ||||
-rw-r--r-- | src/xsane-scan.c | 19 | ||||
-rw-r--r-- | src/xsane-setup.c | 385 | ||||
-rw-r--r-- | src/xsane-text.h | 108 | ||||
-rw-r--r-- | src/xsane-viewer.c | 18 | ||||
-rw-r--r-- | src/xsane.c | 210 | ||||
-rw-r--r-- | src/xsane.h | 17 |
21 files changed, 798 insertions, 781 deletions
diff --git a/src/xsane-back-gtk.c b/src/xsane-back-gtk.c index 6ed24a4..d74300e 100644 --- a/src/xsane-back-gtk.c +++ b/src/xsane-back-gtk.c @@ -294,6 +294,7 @@ int xsane_back_gtk_make_path(size_t buf_size, char *buf, const char *prog_name, buf[len++] = SLASH; /* OS/2 does not like slash at end of mktemp-path */ } + if (len >= buf_size) { goto filename_too_long; @@ -431,15 +432,7 @@ int xsane_back_gtk_make_path(size_t buf_size, char *buf, const char *prog_name, len += 6; buf[len] = '\0'; -#if 1 fd = mkstemp(buf); /* create unique filename and opens/creates the file */ -#else - mktemp(buf); /* not safe */ - umask(0177); - fd = open(buf, O_WRONLY | O_EXCL | O_CREAT, 0600); - umask(XSANE_DEFAULT_UMASK); /* define new file permissions */ -#endif - if (fd == -1) { xsane_back_gtk_error(ERR_CREATE_TEMP_FILE, FALSE); @@ -937,7 +930,6 @@ void xsane_back_gtk_filetype_menu_set_history(GtkWidget *xsane_filetype_option_m select_item = filetype_nr; } #endif - gtk_option_menu_set_history(GTK_OPTION_MENU(xsane_filetype_option_menu), select_item); } @@ -1908,8 +1900,37 @@ static void xsane_back_gtk_value_update(GtkAdjustment *adj_data, DialogElement * xsane_back_gtk_set_option(opt_num, &val, SANE_ACTION_SET_VALUE); xsane_control_option(xsane.dev, opt_num, SANE_ACTION_GET_VALUE, &new_val, 0); +#if 1 + val = new_val; + switch(opt->type) + { + case SANE_TYPE_INT: + if (new_val != val) + { + adj_data->value = val; + g_signal_emit_by_name(GTK_OBJECT(adj_data), "value_changed"); + } + break; - if (new_val != val) + case SANE_TYPE_FIXED: + if (abs(new_val - val) > 1) /* tolarate 1/65536 error, instead of: if (new_val != val) */ + { + d = SANE_UNFIX(val); + if (opt->unit == SANE_UNIT_MM) + { + d /= preferences.length_unit; + } + adj_data->value = d; + g_signal_emit_by_name(GTK_OBJECT(adj_data), "value_changed"); + } + break; + + default: + break; + } +#endif +#if 0 + if (abs(new_val - val) > 1) /* tolarate 1/65536 error, instead of: if (new_val != val) */ { val = new_val; switch(opt->type) @@ -1932,6 +1953,7 @@ static void xsane_back_gtk_value_update(GtkAdjustment *adj_data, DialogElement * } g_signal_emit_by_name(GTK_OBJECT(adj_data), "value_changed"); } +#endif return; /* value didn't change */ } @@ -2474,7 +2496,7 @@ void xsane_back_gtk_update_scan_window(void) GTK_ADJUSTMENT(elem->data)->value = new_val; } - if (old_val != new_val) + if (old_val != new_val) /* XXX dangerous comparison of doubles, we should allow tiny differences */ { g_signal_emit_by_name(GTK_OBJECT(elem->data), "value_changed"); } diff --git a/src/xsane-batch-scan.c b/src/xsane-batch-scan.c index ff07e0c..85b259c 100644 --- a/src/xsane-batch-scan.c +++ b/src/xsane-batch-scan.c @@ -866,16 +866,15 @@ static void xsane_batch_scan_rename_callback(GtkWidget *widget, gpointer data) xsane_set_window_icon(rename_dialog, 0); /* set the main vbox */ - vbox = gtk_vbox_new(FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 0); + vbox = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 10); gtk_container_add(GTK_CONTAINER(rename_dialog), vbox); gtk_widget_show(vbox); /* set the main hbox */ hbox = gtk_hbox_new(FALSE, 0); - xsane_separator_new(vbox, 2); - gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 5); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(hbox), 0); gtk_widget_show(hbox); gtk_window_set_position(GTK_WINDOW(rename_dialog), GTK_WIN_POS_CENTER); diff --git a/src/xsane-email-project.c b/src/xsane-email-project.c index b36dd59..c7451ee 100644 --- a/src/xsane-email-project.c +++ b/src/xsane-email-project.c @@ -151,12 +151,6 @@ void xsane_email_dialog() gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); gtk_box_pack_start(GTK_BOX(email_scan_vbox), hbox, FALSE, FALSE, 1); -#if 0 - pixmap = gdk_pixmap_create_from_xpm_d(xsane.dialog->window, &mask, xsane.bg_trans, (gchar **) email_xpm); - pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); - gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2); - gdk_drawable_unref(pixmap); -#endif button = xsane_button_new_with_pixmap(xsane.dialog->window, hbox, email_xpm, DESC_EMAIL_PROJECT_BROWSE, (GtkSignalFunc) xsane_email_project_browse_filename_callback, NULL); @@ -170,7 +164,6 @@ void xsane_email_dialog() xsane.project_entry = text; xsane.project_entry_box = hbox; -// gtk_widget_show(pixmapwidget); gtk_widget_show(text); gtk_widget_show(hbox); @@ -548,7 +541,7 @@ static void xsane_email_project_display_status() xsane.email_progress_val = val / 100.0; if (xsane.project_progress_bar) { - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), xsane.email_progress_val); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), xsane.email_progress_val); } DBG(DBG_info, "reading from lockfile: email_status %s, email_progress_val %1.3f\n" , xsane.email_status, xsane.email_progress_val); @@ -578,7 +571,7 @@ static void xsane_email_project_display_status() if (xsane.project_progress_bar) { gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.email_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), xsane.email_progress_val); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), xsane.email_progress_val); } while (gtk_events_pending()) @@ -848,7 +841,7 @@ static void xsane_email_project_load() } gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.email_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), xsane.email_progress_val); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), xsane.email_progress_val); xsane_email_project_display_status(); @@ -943,13 +936,13 @@ void xsane_email_project_save() snprintf(buf, 32, "%s@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", xsane.email_status); /* fill 32 characters status line */ fprintf(projectfile, "%s\n", buf); /* first line is status of email */ gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.email_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } else { fprintf(projectfile, " \n"); /* no email status */ gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } if (xsane.email_receiver) @@ -1311,16 +1304,15 @@ static void xsane_email_entry_rename_callback(GtkWidget *widget, gpointer list) xsane_set_window_icon(rename_dialog, 0); /* set the main vbox */ - vbox = gtk_vbox_new(FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 0); + vbox = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 10); gtk_container_add(GTK_CONTAINER(rename_dialog), vbox); gtk_widget_show(vbox); /* set the main hbox */ hbox = gtk_hbox_new(FALSE, 0); - xsane_separator_new(vbox, 2); - gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 5); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(hbox), 0); gtk_widget_show(hbox); gtk_window_set_position(GTK_WINDOW(rename_dialog), GTK_WIN_POS_CENTER); @@ -1491,7 +1483,7 @@ static void xsane_email_edit_callback(GtkWidget *widget, gpointer list) xsane_copy_file_by_name(outfilename, filename, xsane.multipage_progress_bar, &cancel_save); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); xsane_viewer_new(outfilename, NULL, FALSE, filename, VIEWER_NO_NAME_MODIFICATION, IMAGE_SAVED); } diff --git a/src/xsane-fax-project.c b/src/xsane-fax-project.c index 4b7b770..3f9df8f 100644 --- a/src/xsane-fax-project.c +++ b/src/xsane-fax-project.c @@ -408,7 +408,7 @@ static void xsane_fax_project_load() g_signal_connect(GTK_OBJECT(xsane.fax_receiver_entry), "changed", (GtkSignalFunc) xsane_fax_receiver_changed_callback, NULL); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.fax_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } /* ---------------------------------------------------------------------------------------------------------------------- */ @@ -500,13 +500,13 @@ void xsane_fax_project_save() snprintf(buf, 32, "%s@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", xsane.fax_status); /* fill 32 characters status line */ fprintf(projectfile, "%s\n", buf); /* first line is status of mail */ gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.fax_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } else { fprintf(projectfile, " \n"); /* no mail status */ gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } if (xsane.fax_receiver) @@ -578,7 +578,7 @@ static void xsane_fax_receiver_changed_callback(GtkWidget *widget, gpointer data xsane_fax_project_save(); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.fax_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } /* ----------------------------------------------------------------------------------------------------------------- */ @@ -789,16 +789,15 @@ static void xsane_fax_entry_rename_callback(GtkWidget *widget, gpointer list) xsane_set_window_icon(rename_dialog, 0); /* set the main vbox */ - vbox = gtk_vbox_new(FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 0); + vbox = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 10); gtk_container_add(GTK_CONTAINER(rename_dialog), vbox); gtk_widget_show(vbox); /* set the main hbox */ hbox = gtk_hbox_new(FALSE, 0); - xsane_separator_new(vbox, 2); - gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 5); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(hbox), 0); gtk_widget_show(hbox); gtk_window_set_position(GTK_WINDOW(rename_dialog), GTK_WIN_POS_CENTER); @@ -1106,7 +1105,7 @@ static int xsane_fax_convert_pnm_to_ps(char *source_filename, char *fax_filename /* open progressbar */ snprintf(buf, sizeof(buf), "%s - %s", PROGRESS_CONVERTING_DATA, source_filename); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), buf); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); while (gtk_events_pending()) { @@ -1173,7 +1172,7 @@ static int xsane_fax_convert_pnm_to_ps(char *source_filename, char *fax_filename } gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); while (gtk_events_pending()) { @@ -1325,7 +1324,7 @@ static void xsane_fax_send() xsane.fax_status = strdup(TEXT_FAX_STATUS_QUEUEING_FAX); xsane_fax_project_update_project_status(); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.fax_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); while (pid) { @@ -1362,7 +1361,7 @@ static void xsane_fax_send() xsane.fax_status = strdup(TEXT_FAX_STATUS_FAX_QUEUED); xsane_fax_project_update_project_status(); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.fax_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); xsane_set_sensitivity(TRUE); diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c index 3d98a5b..589aa14 100644 --- a/src/xsane-front-gtk.c +++ b/src/xsane-front-gtk.c @@ -58,6 +58,7 @@ void xsane_progress_cancel(GtkWidget *widget, gpointer data); void xsane_progress_new(char *bar_text, char *info, GtkSignalFunc callback, int *cancel_data_pointer); void xsane_progress_update(gfloat newval); void xsane_progress_clear(); +void xsane_progress_bar_set_fraction(GtkProgressBar *progress_bar, gdouble fraction); GtkWidget *xsane_vendor_pixmap_new(GdkWindow *window, GtkWidget *parent); GtkWidget *xsane_toggle_button_new_with_pixmap(GdkWindow *window, GtkWidget *parent, const char *xpm_d[], const char *desc, int *state, void *xsane_toggle_button_callback); @@ -734,6 +735,49 @@ gint xsane_authorization_callback(SANE_String_Const resource, /* ---------------------------------------------------------------------------------------------------------------------- */ +void xsane_progress_bar_set_fraction(GtkProgressBar *progress_bar, gdouble fraction) +{ + if (fraction < 0.0) + { + fraction = 0.0; + } + + if (fraction > 1.0) + { + fraction = 1.0; + } + +#ifdef HAVE_GTK2 + if ((fraction - gtk_progress_bar_get_fraction(progress_bar) > XSANE_PROGRESS_BAR_MIN_DELTA_PERCENT) || (fraction == 0.0) || (fraction > 0.99)) + { + gtk_progress_bar_set_fraction(progress_bar, fraction); +#if 0 + /* this produces jumping scrollbars when we use it instead of the gtk_main_iteration loop */ + if (GTK_WIDGET_DRAWABLE(progress_bar)) + { + gdk_window_process_updates(progress_bar->progress.widget.window, TRUE); + } +#endif + while (gtk_events_pending()) + { + gtk_main_iteration(); + } + } +#else + if ((fraction - gtk_progress_get_current_percentage(&progress_bar->progress) > XSANE_PROGRESS_BAR_MIN_DELTA_PERCENT) || (fraction == 0.0) || (fraction > 0.99)) + { + gtk_progress_bar_update(progress_bar, fraction); + + while (gtk_events_pending()) + { + gtk_main_iteration(); + } + } +#endif +} + +/* ---------------------------------------------------------------------------------------------------------------------- */ + void xsane_progress_cancel(GtkWidget *widget, gpointer data) { void *cancel_data_pointer; @@ -1015,7 +1059,7 @@ void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, option_menu = gtk_option_menu_new(); xsane_back_gtk_set_tooltip(xsane.tooltips, option_menu, desc); - gtk_box_pack_end(GTK_BOX(parent), option_menu, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(parent), option_menu, TRUE, TRUE, 5); gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu); gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), xsane_option_menu_lookup(menu_items, val)); @@ -1043,7 +1087,7 @@ void xsane_option_menu_new_with_pixmap(GdkWindow *window, GtkBox *parent, const DBG(DBG_proc, "xsane_option_menu_new_with_pixmap\n"); hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(parent, hbox, FALSE, FALSE, 0); + gtk_box_pack_start(parent, hbox, FALSE, FALSE, 2); pixmap = gdk_pixmap_create_from_xpm_d(window, &mask, xsane.bg_trans, (gchar **) xpm_d); pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); @@ -1172,7 +1216,7 @@ void xsane_range_new_with_pixmap(GdkWindow *window, GtkBox *parent, const char * DBG(DBG_proc, "xsane_slider_new_with_pixmap\n"); hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(parent, hbox, FALSE, FALSE, 1); + gtk_box_pack_start(parent, hbox, FALSE, FALSE, 2); pixmap = gdk_pixmap_create_from_xpm_d(window, &mask, xsane.bg_trans, (gchar **) xpm_d); pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); @@ -1303,7 +1347,10 @@ static void xsane_browse_filename_callback(GtkWidget *widget, gpointer data) xsane_back_gtk_filetype_menu_set_history(xsane.filetype_option_menu, preferences.filetype); #ifdef HAVE_LIBLCMS - gtk_option_menu_set_history(GTK_OPTION_MENU(xsane.cms_function_option_menu), preferences.cms_function); + if (xsane.enable_color_management) + { + gtk_option_menu_set_history(GTK_OPTION_MENU(xsane.cms_function_option_menu), preferences.cms_function); + } #endif /* correct length of filename counter if it is shorter than minimum length */ @@ -1424,13 +1471,12 @@ void xsane_outputfilename_new(GtkWidget *vbox) /* first line: disk icon, filename box */ - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); + hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); button = xsane_button_new_with_pixmap(xsane.xsane_window->window, hbox, file_xpm, DESC_BROWSE_FILENAME, (GtkSignalFunc) xsane_browse_filename_callback, NULL); - gtk_widget_add_accelerator(button, "clicked", xsane.accelerator_group, GDK_B, GDK_CONTROL_MASK, DEF_GTK_ACCEL_LOCKED); + gtk_widget_add_accelerator(button, "clicked", xsane.accelerator_group, GDK_F, GDK_MOD1_MASK, DEF_GTK_ACCEL_LOCKED); text = gtk_entry_new(); gtk_widget_set_size_request(text, 80, -1); /* set minimum size */ @@ -1439,7 +1485,7 @@ void xsane_outputfilename_new(GtkWidget *vbox) gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.filename); gtk_entry_set_position(GTK_ENTRY(text), strlen(preferences.filename)); /* set cursor to right position of filename */ - gtk_box_pack_start(GTK_BOX(hbox), text, TRUE, TRUE, 4); + gtk_box_pack_end(GTK_BOX(hbox), text, TRUE, TRUE, 5); g_signal_connect(GTK_OBJECT(text), "changed", (GtkSignalFunc) xsane_outputfilename_changed_callback, NULL); xsane.outputfilename_entry = text; @@ -1450,9 +1496,8 @@ void xsane_outputfilename_new(GtkWidget *vbox) /* second line: Step, Type */ - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 1); + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); /* filename counter step */ @@ -1464,7 +1509,7 @@ void xsane_outputfilename_new(GtkWidget *vbox) xsane_filename_counter_step_option_menu = gtk_option_menu_new(); xsane_back_gtk_set_tooltip(xsane.tooltips, xsane_filename_counter_step_option_menu, DESC_FILENAME_COUNTER_STEP); - gtk_box_pack_start(GTK_BOX(hbox), xsane_filename_counter_step_option_menu, FALSE, FALSE, 2); + gtk_box_pack_start(GTK_BOX(hbox), xsane_filename_counter_step_option_menu, FALSE, FALSE, 5); gtk_widget_show(xsane_filename_counter_step_option_menu); gtk_widget_show(hbox); @@ -1489,7 +1534,7 @@ void xsane_outputfilename_new(GtkWidget *vbox) gtk_option_menu_set_history(GTK_OPTION_MENU(xsane_filename_counter_step_option_menu), select_item); xsane.filetype_option_menu = xsane_back_gtk_filetype_menu_new(preferences.filetype, (GtkSignalFunc) xsane_filetype_callback); - gtk_box_pack_end(GTK_BOX(hbox), xsane.filetype_option_menu, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(hbox), xsane.filetype_option_menu, FALSE, FALSE, 5); gtk_widget_show(xsane.filetype_option_menu); xsane_label = gtk_label_new(TEXT_FILETYPE); /* opposite order because of box_pack_end */ @@ -1810,7 +1855,7 @@ void xsane_change_working_directory(void) sprintf(windowname, "%s %s %s", xsane.prog_name, WINDOW_CHANGE_WORKING_DIR, xsane.device_text); if (getcwd(filename, sizeof(filename))) { -// xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, NULL, TRUE, FALSE, TRUE, FALSE); +/* xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, NULL, TRUE, FALSE, TRUE, FALSE); */ if (chdir(filename)) { char buf[TEXTBUFSIZE]; diff --git a/src/xsane-front-gtk.h b/src/xsane-front-gtk.h index b7752bf..0a181bf 100644 --- a/src/xsane-front-gtk.h +++ b/src/xsane-front-gtk.h @@ -43,6 +43,7 @@ extern void xsane_authorization_button_callback(GtkWidget *widget, gpointer data extern gint xsane_authorization_callback(SANE_String_Const resource, SANE_Char username[SANE_MAX_USERNAME_LEN], SANE_Char password[SANE_MAX_PASSWORD_LEN]); +extern void xsane_progress_bar_set_fraction(GtkProgressBar *progress_bar, gdouble fraction); extern void xsane_progress_cancel(GtkWidget *widget, gpointer data); extern void xsane_progress_new(char *bar_text, char *info, GtkSignalFunc callback, int *cancel_data_pointer); extern void xsane_progress_update(gfloat newval); diff --git a/src/xsane-gtk-1_x-compat.h b/src/xsane-gtk-1_x-compat.h index fea9c18..91be708 100644 --- a/src/xsane-gtk-1_x-compat.h +++ b/src/xsane-gtk-1_x-compat.h @@ -64,5 +64,5 @@ gtk_window_set_policy(widget, FALSE, resizable, FALSE) # define gtk_image_new_from_pixmap(pixmap, mask) \ gtk_pixmap_new(pixmap, mask) -# define gtk_progress_bar_set_ellipsize() /* empty */ +# define gtk_progress_bar_set_ellipsize(pbar, mode) /* empty */ #endif diff --git a/src/xsane-icons.c b/src/xsane-icons.c index ba76144..6b0c9f2 100644 --- a/src/xsane-icons.c +++ b/src/xsane-icons.c @@ -3752,7 +3752,7 @@ const unsigned char cursor_pipette_mask[] = /* --------------------------------------------------- */ -const unsigned char cursor_autoraise_scanarea[] = +const unsigned char cursor_autoraise_scan_area[] = { 0xaa, 0x2a, 0xc1, 0x41, 0xe0, 0x03, 0x81, 0x40, 0x80, 0x00, 0x85, 0x50, 0x86, 0x30, 0x7f, 0x7f, 0x86, 0x30, 0x85, 0x50, 0x80, 0x00, 0x81, 0x40, @@ -3761,7 +3761,7 @@ const unsigned char cursor_autoraise_scanarea[] = /* --------------------------------------------------- */ -const unsigned char cursor_autoraise_scanarea_mask[] = +const unsigned char cursor_autoraise_scan_area_mask[] = { 0xea, 0x2b, 0xe1, 0x43, 0xf0, 0x07, 0xc1, 0x41, 0xc4, 0x11, 0xc7, 0x71, 0xff, 0x7f, 0x7f, 0x7f, 0xff, 0x7f, 0xc7, 0x71, 0xc4, 0x11, 0xc1, 0x41, diff --git a/src/xsane-icons.h b/src/xsane-icons.h index 6f38cfb..2697b52 100644 --- a/src/xsane-icons.h +++ b/src/xsane-icons.h @@ -29,10 +29,10 @@ #define CURSOR_PIPETTE_HEIGHT 16 #define CURSOR_PIPETTE_HOT_X 1 #define CURSOR_PIPETTE_HOT_Y 14 -#define CURSOR_AUTORAISE_SCANAREA_WIDTH 16 -#define CURSOR_AUTORAISE_SCANAREA_HEIGHT 16 -#define CURSOR_AUTORAISE_SCANAREA_HOT_X 7 -#define CURSOR_AUTORAISE_SCANAREA_HOT_Y 7 +#define CURSOR_AUTORAISE_SCAN_AREA_WIDTH 16 +#define CURSOR_AUTORAISE_SCAN_AREA_HEIGHT 16 +#define CURSOR_AUTORAISE_SCAN_AREA_HOT_X 7 +#define CURSOR_AUTORAISE_SCAN_AREA_HOT_Y 7 #define CURSOR_ZOOM_WIDTH 16 #define CURSOR_ZOOM_HEIGHT 16 #define CURSOR_ZOOM_HOT_X 6 @@ -147,8 +147,8 @@ extern const char cursor_pipette_white[]; extern const char cursor_pipette_gray[]; extern const char cursor_pipette_black[]; extern const char cursor_pipette_mask[]; -extern const char cursor_autoraise_scanarea[]; -extern const char cursor_autoraise_scanarea_mask[]; +extern const char cursor_autoraise_scan_area[]; +extern const char cursor_autoraise_scan_area_mask[]; extern const char cursor_zoom[]; extern const char cursor_zoom_mask[]; #endif diff --git a/src/xsane-multipage-project.c b/src/xsane-multipage-project.c index 7d6a565..99b0106 100644 --- a/src/xsane-multipage-project.c +++ b/src/xsane-multipage-project.c @@ -454,7 +454,7 @@ static void xsane_multipage_project_load() } gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } /* ---------------------------------------------------------------------------------------------------------------------- */ @@ -525,13 +525,13 @@ void xsane_multipage_project_save() snprintf(buf, 32, "%s@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", xsane.multipage_status); /* fill 32 characters status line */ fprintf(projectfile, "%s\n", buf); /* first line is status of multipage */ gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } else { fprintf(projectfile, " \n"); /* no multipage status */ gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } if (xsane.multipage_filename) @@ -834,7 +834,7 @@ static void xsane_multipage_edit_callback(GtkWidget *widget, gpointer list) xsane_multipage_project_save(); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); xsane_viewer_new(outfilename, NULL, FALSE, filename, VIEWER_NO_NAME_MODIFICATION, IMAGE_SAVED); } @@ -882,7 +882,7 @@ static void xsane_multipage_save_file() xsane.multipage_status = strdup(TEXT_PROJECT_STATUS_FILE_SAVING); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); snprintf(multipage_filename, sizeof(multipage_filename), "%s%s", preferences.multipage_project, preferences.multipage_filetype); @@ -926,7 +926,7 @@ static void xsane_multipage_save_file() xsane.multipage_status = strdup(TEXT_PROJECT_STATUS_FILE_SAVING_ABORTED); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); return; } } @@ -962,7 +962,7 @@ static void xsane_multipage_save_file() xsane.multipage_status = strdup(TEXT_PROJECT_STATUS_FILE_SAVING_ERROR); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); return; } @@ -993,7 +993,7 @@ static void xsane_multipage_save_file() xsane.multipage_status = strdup(TEXT_PROJECT_STATUS_FILE_SAVING_ERROR); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); return; } } @@ -1012,7 +1012,7 @@ static void xsane_multipage_save_file() xsane.multipage_status = strdup(TEXT_PROJECT_STATUS_FILE_SAVING_ERROR); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); return; } @@ -1049,7 +1049,7 @@ static void xsane_multipage_save_file() snprintf(buf, sizeof(buf), "%s", PROGRESS_PACKING_DATA); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), buf); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); while (gtk_events_pending()) { @@ -1195,7 +1195,7 @@ static void xsane_multipage_save_file() xsane_multipage_project_save(); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); xsane_multipage_project_set_sensitive(TRUE); xsane_set_sensitivity(TRUE); /* allow changing xsane mode */ diff --git a/src/xsane-preferences.c b/src/xsane-preferences.c index 9747404..4f866f1 100644 --- a/src/xsane-preferences.c +++ b/src/xsane-preferences.c @@ -145,7 +145,7 @@ Preferences preferences = 1, /* rgb default */ 0, /* negative */ 1, /* autoenhance_gamma: change gamma value with autoenhance button */ - 1, /* preselect_scanarea after preview scan */ + 1, /* preselect_scan_area after preview scan */ 1, /* auto_correct_colors after preview scan */ GTK_UPDATE_DISCONTINUOUS, /* update policy for gtk frontend sliders */ 0, /* medium_nr */ @@ -264,7 +264,7 @@ desc[] = {"rgb-default", xsane_rc_pref_int, POFFSET(xsane_rgb_default)}, {"negative", xsane_rc_pref_int, POFFSET(xsane_negative)}, {"auto-enhance-gamma", xsane_rc_pref_int, POFFSET(auto_enhance_gamma)}, - {"preselect-scanarea", xsane_rc_pref_int, POFFSET(preselect_scanarea)}, + {"preselect-scan-area", xsane_rc_pref_int, POFFSET(preselect_scan_area)}, {"auto-correct-colors", xsane_rc_pref_int, POFFSET(auto_correct_colors)}, {"gtk-update-policy", xsane_rc_pref_int, POFFSET(gtk_update_policy)}, {"medium-nr", xsane_rc_pref_int, POFFSET(medium_nr)}, diff --git a/src/xsane-preferences.h b/src/xsane-preferences.h index 228548e..720d108 100644 --- a/src/xsane-preferences.h +++ b/src/xsane-preferences.h @@ -194,7 +194,7 @@ typedef struct int xsane_rgb_default; int xsane_negative; int auto_enhance_gamma; /* change gamma value with automatic color correction */ - int preselect_scanarea; /* automatic selection of scanarea after preview scan */ + int preselect_scan_area; /* automatic selection of scan area after preview scan */ int auto_correct_colors; /* automatic color correction after preview scan */ int gtk_update_policy; int medium_nr; diff --git a/src/xsane-preview.c b/src/xsane-preview.c index 45679f1..e8b49a3 100644 --- a/src/xsane-preview.c +++ b/src/xsane-preview.c @@ -180,7 +180,7 @@ static void preview_add_batch(GtkWidget *window, Preview *p); static void preview_pipette_white(GtkWidget *window, gpointer data); static void preview_pipette_gray(GtkWidget *window, gpointer data); static void preview_pipette_black(GtkWidget *window, gpointer data); -static void preview_init_autoraise_scanarea(GtkWidget *window, gpointer data); +static void preview_init_autoraise_scan_area(GtkWidget *window, gpointer data); void preview_select_full_preview_area(Preview *p); static void preview_full_preview_area_callback(GtkWidget *widget, gpointer call_data); static void preview_delete_images_callback(GtkWidget *widget, gpointer call_data); @@ -194,7 +194,7 @@ static void preview_preset_area_callback(GtkWidget *widget, gpointer data); static void preview_rotation_callback(GtkWidget *widget, gpointer data); static void preview_establish_ratio(Preview *p); static void preview_ratio_callback(GtkWidget *widget, gpointer data); -static void preview_autoselect_scanarea_callback(GtkWidget *window, gpointer data); +static void preview_autoselect_scan_area_callback(GtkWidget *window, gpointer data); void preview_display_with_correction(Preview *p); void preview_do_gamma_correction(Preview *p); @@ -209,8 +209,8 @@ void preview_area_resize(Preview *p); gint preview_area_resize_handler(GtkWidget *widget, GdkEvent *event, gpointer data); void preview_update_maximum_output_size(Preview *p); void preview_set_maximum_output_size(Preview *p, float width, float height, int paper_orientation); -void preview_autoraise_scanarea(Preview *p, int preview_x, int preview_y, float *autoselect_coord); -void preview_autoselect_scanarea(Preview *p, float *autoselect_coord); +void preview_autoraise_scan_area(Preview *p, int preview_x, int preview_y, float *autoselect_coord); +void preview_autoselect_scan_area(Preview *p, float *autoselect_coord); void preview_display_valid(Preview *p); /* ---------------------------------------------------------------------------------------------------------------------- */ @@ -699,7 +699,7 @@ static void preview_update_selection(Preview *p) coord[i] = val; } } - else /* backend does not use scanarea options */ + else /* backend does not use scan area options */ { switch (i) { @@ -1875,9 +1875,9 @@ static void preview_scan_done(Preview *p, int save_image) sane_get_parameters(xsane.dev, &xsane.param); /* update xsane.param */ - if ((preferences.preselect_scanarea) && (!p->startimage) && (!xsane.medium_calibration)) + if ((preferences.preselect_scan_area) && (!p->startimage) && (!xsane.medium_calibration)) { - preview_autoselect_scanarea(p, p->selection.coordinate); /* get autoselection coordinates */ + preview_autoselect_scan_area(p, p->selection.coordinate); /* get autoselection coordinates */ preview_draw_selection(p); preview_establish_selection(p); xsane_update_histogram(TRUE /* update_raw */); /* update histogram (necessary because overwritten by preview_update_surface) */ @@ -3777,14 +3777,14 @@ static gint preview_button_press_event_handler(GtkWidget *window, GdkEvent *even } break; - case MODE_AUTORAISE_SCANAREA: + case MODE_AUTORAISE_SCAN_AREA: { - DBG(DBG_info, "autoraise scanarea mode\n"); + DBG(DBG_info, "autoraise scan area mode\n"); if ( ( (((GdkEventButton *)event)->button == 1) || (((GdkEventButton *)event)->button == 2) ) && (p->image_data_raw) ) /* left or middle button */ { - preview_autoraise_scanarea(p, event->button.x, event->button.y, p->selection.coordinate); /* raise selection area */ + preview_autoraise_scan_area(p, event->button.x, event->button.y, p->selection.coordinate); /* raise selection area */ } p->mode = MODE_NORMAL; @@ -4291,8 +4291,8 @@ Preview *preview_new(void) xsane_vseparator_new(p->button_box, 3); - p->full_area = xsane_button_new_with_pixmap(p->top->window, p->button_box, auto_select_preview_area_xpm, DESC_AUTOSELECT_SCANAREA, (GtkSignalFunc) preview_autoselect_scanarea_callback, p); - p->autoraise = xsane_button_new_with_pixmap(p->top->window, p->button_box, auto_raise_preview_area_xpm, DESC_AUTORAISE_SCANAREA, (GtkSignalFunc) preview_init_autoraise_scanarea, p); + p->full_area = xsane_button_new_with_pixmap(p->top->window, p->button_box, auto_select_preview_area_xpm, DESC_AUTOSELECT_SCAN_AREA, (GtkSignalFunc) preview_autoselect_scan_area_callback, p); + p->autoraise = xsane_button_new_with_pixmap(p->top->window, p->button_box, auto_raise_preview_area_xpm, DESC_AUTORAISE_SCAN_AREA, (GtkSignalFunc) preview_init_autoraise_scan_area, p); p->autoselect = xsane_button_new_with_pixmap(p->top->window, p->button_box, full_preview_area_xpm, DESC_FULL_PREVIEW_AREA, (GtkSignalFunc) preview_full_preview_area_callback, p); xsane_vseparator_new(p->button_box, 3); @@ -4419,7 +4419,7 @@ Preview *preview_new(void) xsane_separator_new(middle_vbox, 1); - /* select maximum scanarea */ + /* select maximum scan area */ pixmap = gdk_pixmap_create_from_xpm_d(p->top->window, &mask, xsane.bg_trans, (gchar **) size_xpm); pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); gtk_box_pack_start(GTK_BOX(p->menu_box), pixmapwidget, FALSE, FALSE, 2); @@ -4668,7 +4668,7 @@ void preview_update_surface(Preview *p, int surface_changed) p->show_selection = FALSE; /* at first let's say we have no corrdinate selection */ - for (i = 0; i < 4; ++i) /* test if surface (max vals of scanarea) has changed */ + for (i = 0; i < 4; ++i) /* test if surface (max vals of scan area) has changed */ { /* val = (i & 2) ? INF : -INF; */ val = (i & 2) ? INF : 0; @@ -5564,7 +5564,7 @@ static void preview_pipette_black(GtkWidget *window, gpointer data) /* ---------------------------------------------------------------------------------------------------------------------- */ -static void preview_init_autoraise_scanarea(GtkWidget *window, gpointer data) +static void preview_init_autoraise_scan_area(GtkWidget *window, gpointer data) { Preview *p=data; GdkCursor *cursor; @@ -5573,12 +5573,12 @@ static void preview_init_autoraise_scanarea(GtkWidget *window, gpointer data) GdkPixmap *pixmap; GdkPixmap *mask; - DBG(DBG_proc, "preview_init_autoraise_scanarea\n"); + DBG(DBG_proc, "preview_init_autoraise_scan_area\n"); - p->mode = MODE_AUTORAISE_SCANAREA; + p->mode = MODE_AUTORAISE_SCAN_AREA; - pixmap = gdk_bitmap_create_from_data(p->top->window, cursor_autoraise_scanarea, CURSOR_AUTORAISE_SCANAREA_WIDTH, CURSOR_AUTORAISE_SCANAREA_HEIGHT); - mask = gdk_bitmap_create_from_data(p->top->window, cursor_autoraise_scanarea_mask, CURSOR_AUTORAISE_SCANAREA_WIDTH, CURSOR_AUTORAISE_SCANAREA_HEIGHT); + pixmap = gdk_bitmap_create_from_data(p->top->window, cursor_autoraise_scan_area, CURSOR_AUTORAISE_SCAN_AREA_WIDTH, CURSOR_AUTORAISE_SCAN_AREA_HEIGHT); + mask = gdk_bitmap_create_from_data(p->top->window, cursor_autoraise_scan_area_mask, CURSOR_AUTORAISE_SCAN_AREA_WIDTH, CURSOR_AUTORAISE_SCAN_AREA_HEIGHT); fg.red = 0; fg.green = 0; @@ -5588,7 +5588,7 @@ static void preview_init_autoraise_scanarea(GtkWidget *window, gpointer data) bg.green = 65535; bg.blue = 65535; - cursor = gdk_cursor_new_from_pixmap(pixmap, mask, &fg, &bg, CURSOR_AUTORAISE_SCANAREA_HOT_X, CURSOR_AUTORAISE_SCANAREA_HOT_Y); + cursor = gdk_cursor_new_from_pixmap(pixmap, mask, &fg, &bg, CURSOR_AUTORAISE_SCAN_AREA_HOT_X, CURSOR_AUTORAISE_SCAN_AREA_HOT_Y); gdk_window_set_cursor(p->window->window, cursor); gdk_cursor_unref(cursor); @@ -6190,11 +6190,11 @@ static void preview_ratio_callback(GtkWidget *widget, gpointer data) /* ---------------------------------------------------------------------------------------------------------------------- */ -static void preview_autoselect_scanarea_callback(GtkWidget *window, gpointer data) +static void preview_autoselect_scan_area_callback(GtkWidget *window, gpointer data) { Preview *p=data; - preview_autoselect_scanarea(p, p->selection.coordinate); /* get autoselection coordinates */ + preview_autoselect_scan_area(p, p->selection.coordinate); /* get autoselection coordinates */ preview_draw_selection(p); preview_establish_selection(p); xsane_update_histogram(TRUE /* update raw */); /* update histogram (necessary because overwritten by preview_update_surface */ @@ -7092,7 +7092,7 @@ void preview_set_maximum_output_size(Preview *p, float width, float height, int /* ---------------------------------------------------------------------------------------------------------------------- */ #define AUTORAISE_ERROR 30 -void preview_autoraise_scanarea(Preview *p, int preview_x, int preview_y, float *autoselect_coord) +void preview_autoraise_scan_area(Preview *p, int preview_x, int preview_y, float *autoselect_coord) { int x, y; int image_x, image_y; @@ -7104,7 +7104,7 @@ void preview_autoraise_scanarea(Preview *p, int preview_x, int preview_y, float int top_ok, bottom_ok, left_ok, right_ok; float xscale, yscale; - DBG(DBG_proc, "preview_autoraise_scanarea\n"); + DBG(DBG_proc, "preview_autoraise_scan_area\n"); preview_transform_coordinate_window_to_image(p, preview_x, preview_y, &image_x, &image_y); @@ -7327,7 +7327,7 @@ void preview_autoraise_scanarea(Preview *p, int preview_x, int preview_y, float /* ---------------------------------------------------------------------------------------------------------------------- */ -void preview_autoselect_scanarea(Preview *p, float *autoselect_coord) +void preview_autoselect_scan_area(Preview *p, float *autoselect_coord) { int x, y; int offset; @@ -7338,7 +7338,7 @@ void preview_autoselect_scanarea(Preview *p, float *autoselect_coord) int brightness; int background_white; - DBG(DBG_proc, "preview_autoselect_scanarea\n"); + DBG(DBG_proc, "preview_autoselect_scan_area\n"); /* try to find out background color */ /* add color values at the margins */ @@ -7373,16 +7373,16 @@ void preview_autoselect_scanarea(Preview *p, float *autoselect_coord) } brightness = bright_sum / (2 * (p->image_width + p->image_height) ); - DBG(DBG_info, "preview_autoselect_scanarea: average margin brightness is %d\n", brightness); + DBG(DBG_info, "preview_autoselect_scan_area: average margin brightness is %d\n", brightness); if ( brightness > 128 ) { - DBG(DBG_info, "preview_autoselect_scanarea: background is white\n"); + DBG(DBG_info, "preview_autoselect_scan_area: background is white\n"); background_white = 1; } else { - DBG(DBG_info, "preview_autoselect_scanarea: background is black\n"); + DBG(DBG_info, "preview_autoselect_scan_area: background is black\n"); background_white = 0; } @@ -7505,7 +7505,7 @@ void preview_autoselect_scanarea(Preview *p, float *autoselect_coord) if ( (top >= bottom) || (right <= left) ) /* empty selection: use complete image */ { - DBG(DBG_info, "autoselect_scanarea: empty selection: using complete area\n"); + DBG(DBG_info, "autoselect_scan_area: empty selection: using complete area\n"); top = 0; bottom = p->image_height -1; left = 0; diff --git a/src/xsane-preview.h b/src/xsane-preview.h index a488ce2..9fada8a 100644 --- a/src/xsane-preview.h +++ b/src/xsane-preview.h @@ -43,7 +43,7 @@ enum MODE_PIPETTE_WHITE, MODE_PIPETTE_GRAY, MODE_PIPETTE_BLACK, - MODE_AUTORAISE_SCANAREA, + MODE_AUTORAISE_SCAN_AREA, MODE_ZOOM_IN }; @@ -185,9 +185,9 @@ typedef struct GtkWidget *zoom_in; /* zoom in button */ GtkWidget *zoom_area; /* zoom area button */ GtkWidget *zoom_undo; /* zoom undo button */ - GtkWidget *full_area; /* select full scanarea */ - GtkWidget *autoraise; /* autoraise scanarea */ - GtkWidget *autoselect; /* autoselect scanarea */ + GtkWidget *full_area; /* select full scan area */ + GtkWidget *autoraise; /* autoraise scan area */ + GtkWidget *autoselect; /* autoselect scan area */ GtkWidget *preset_area_option_menu; /* menu for selection of preview area */ GtkWidget *rotation_option_menu; /* menu for selection of rotation */ GtkWidget *ratio_option_menu; /* menu for selection of ratio */ diff --git a/src/xsane-save.c b/src/xsane-save.c index 0109a2c..3d3b4c7 100644 --- a/src/xsane-save.c +++ b/src/xsane-save.c @@ -77,7 +77,11 @@ static void xsane_gimp_run(char *name, int nparams, GimpParam *param, int *nretu GimpPlugInInfo PLUG_IN_INFO = { +#if 1 NULL, /* init_proc */ +#else + xsane_gimp_query, /* init_proc that queries xsane each time gimp is started */ +#endif NULL, /* quit_proc */ xsane_gimp_query, /* query_proc */ xsane_gimp_run, /* run_proc */ @@ -719,12 +723,7 @@ int xsane_copy_file(FILE *outfile, FILE *infile, GtkProgressBar *progress_bar, i size = ftell(infile); fseek(infile, 0, SEEK_SET); - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), 0.0); - - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); while (!feof(infile)) { @@ -735,12 +734,7 @@ int xsane_copy_file(FILE *outfile, FILE *infile, GtkProgressBar *progress_bar, i bytes_sum += bytes; } - gtk_progress_bar_update(progress_bar, (float) bytes_sum / size); /* update progress bar */ - - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) bytes_sum / size); /* update progress bar */ if (ferror(infile)) { @@ -822,12 +816,7 @@ int xsane_copy_file_by_name(char *output_filename, char *input_filename, GtkProg fclose(outfile); gtk_progress_set_format_string(GTK_PROGRESS(progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), 0.0); - - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); return (*cancel_save); } @@ -893,16 +882,21 @@ cmsHTRANSFORM xsane_create_cms_transform(Image_info *image_info, int cms_functio snprintf(buf, sizeof(buf), "%s\n%s %s: %s\n", ERR_CMS_CONVERSION, ERR_CMS_OPEN_ICM_FILE, CMS_SCANNER_ICM, image_info->icm_profile); xsane_back_gtk_error(buf, TRUE); } -#if 0 -{ - LPGAMMATABLE Gamma = cmsBuildGamma(256, 3.0); - hOutProfile = cmsCreateGrayProfile(cmsD50_xyY(), Gamma); - cmsFreeGamma(Gamma); -} -#endif if (cms_function == XSANE_CMS_FUNCTION_CONVERT_TO_SRGB) { - hOutProfile = cmsCreate_sRGBProfile(); + if (image_info->channels == 1) /* == 1 (grayscale) */ + { +#if 1 /* xxx oli */ + LPGAMMATABLE Gamma = cmsBuildGamma(256, 2.2); + + hOutProfile = cmsCreateGrayProfile(cmsD50_xyY(), Gamma); + cmsFreeGamma(Gamma); +#endif + } + else + { + hOutProfile = cmsCreate_sRGBProfile(); + } } else { @@ -1005,11 +999,7 @@ int xsane_save_grayscale_image_as_lineart(FILE *outfile, FILE *imagefile, Image_ } - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); /* update progress bar */ - while (gtk_events_pending()) /* give gtk the chance to display the changes */ - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); /* update progress bar */ if (*cancel_save) { @@ -1107,11 +1097,7 @@ int xsane_save_scaled_image(FILE *outfile, FILE *imagefile, Image_info *image_in { DBG(DBG_info2, "xsane_save_scaled_image: original line %d, new line %d\n", (int) y, y_new); - gtk_progress_bar_update(progress_bar, (float) y / original_image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / original_image_height); if (read_line) { @@ -1295,11 +1281,7 @@ int xsane_save_scaled_image(FILE *outfile, FILE *imagefile, Image_info *image_in for (y = 0; y < new_image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); for (; ((int) original_y) - old_original_y; old_original_y += 1) { @@ -1385,12 +1367,7 @@ int xsane_save_despeckle_image(FILE *outfile, FILE *imagefile, Image_info *image for (y = 0; y < image_info->image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); ymin = y - radius; ymax = y + radius; @@ -1578,11 +1555,7 @@ int xsane_save_blur_image(FILE *outfile, FILE *imagefile, Image_info *image_info for (y = 0; y < image_info->image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); for (x = 0; x < image_info->image_width * image_info->channels; x++) { @@ -1787,11 +1760,7 @@ int xsane_save_blur_image(FILE *outfile, FILE *imagefile, Image_info *image_info for (y = 0; y < image_info->image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); for (x = 0; x < image_info->image_width * image_info->channels; x++) { @@ -1929,11 +1898,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in for (y = 0; y < pixel_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / pixel_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / pixel_height); for (x = 0; x < pixel_width; x++) { @@ -1986,11 +1951,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in for (x=0; x<pixel_width; x++) { - gtk_progress_bar_update(progress_bar, (float) x / pixel_width); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) x / pixel_width); for (y=pixel_height-1; y>=0; y--) { @@ -2040,11 +2001,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in for (y = pixel_height-1; y >= 0; y--) { - gtk_progress_bar_update(progress_bar, (float) (pixel_height - y) / pixel_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) (pixel_height - y) / pixel_height); for (x = pixel_width-1; x >= 0; x--) { @@ -2099,11 +2056,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in for (x = pixel_width-1; x >= 0; x--) { - gtk_progress_bar_update(progress_bar, (float) (pixel_width - x) / pixel_width); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) (pixel_width - x) / pixel_width); for (y = 0; y < pixel_height; y++) { @@ -2152,11 +2105,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in for (y = 0; y < pixel_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / pixel_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / pixel_height); for (x = pixel_width-1; x >= 0; x--) { @@ -2211,11 +2160,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in for (x = 0; x < pixel_width; x++) { - gtk_progress_bar_update(progress_bar, (float) x / pixel_width); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) x / pixel_width); for (y = 0; y < pixel_height; y++) { @@ -2265,11 +2210,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in for (y = pixel_height-1; y >= 0; y--) { - gtk_progress_bar_update(progress_bar, (float) (pixel_height - y) / pixel_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) (pixel_height - y) / pixel_height); for (x = 0; x < pixel_width; x++) { @@ -2324,11 +2265,7 @@ int xsane_save_rotate_image(FILE *outfile, FILE *imagefile, Image_info *image_in for (x = pixel_width-1; x >= 0; x--) { - gtk_progress_bar_update(progress_bar, (float) (pixel_width - x) / pixel_width); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) (pixel_width - x) / pixel_width); for (y = pixel_height-1; y >= 0; y--) { @@ -2439,7 +2376,7 @@ void xsane_save_ps_create_document_header(FILE *outfile, int pages, fprintf(outfile, "%%%%EndComments\n"); fprintf(outfile, "%%%%BeginDocument: xsane.ps\n"); fprintf(outfile, "\n"); -// fprintf(outfile, "/origstate save def\n"); +/* fprintf(outfile, "/origstate save def\n"); */ fprintf(outfile, "20 dict begin\n"); } @@ -2450,7 +2387,7 @@ void xsane_save_ps_create_document_trailer(FILE *outfile, int pages) DBG(DBG_proc, "xsane_save_ps_create_document_trailer\n"); fprintf(outfile, "end\n"); -// fprintf(outfile, "origstate restore\n"); +/* fprintf(outfile, "origstate restore\n"); */ if (pages) { @@ -3050,11 +2987,7 @@ static int xsane_save_ps_pdf_bw(FILE *outfile, FILE *imagefile, Image_info *imag for (y = 0; y < image_info->image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); for (x = 0; x < bytes_per_line; x++) { @@ -3118,11 +3051,13 @@ static int xsane_save_ps_pdf_bw(FILE *outfile, FILE *imagefile, Image_info *imag /* ---------------------------------------------------------------------------------------------------------------------- */ -static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *image_info, int ascii85decode, int flatedecode, cmsHTRANSFORM hTransform, int embed_scanner_icm_profile, GtkProgressBar *progress_bar, int *cancel_save) +static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *image_info, int ascii85decode, int flatedecode, cmsHTRANSFORM hTransform, int do_transform, GtkProgressBar *progress_bar, int *cancel_save) { int x, y; int ret; - unsigned char *line; + unsigned char *line = NULL, *linep = NULL, *line16 = NULL; + int bytes_per_line; + int bytes_per_line16 = 0; #ifdef HAVE_LIBLCMS unsigned char *line_raw = NULL; #endif @@ -3132,7 +3067,42 @@ static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *im *cancel_save = 0; - line = (unsigned char *) malloc(image_info->image_width); + if (image_info->depth > 8) /* reduce 16 bit images to 12 bit */ + { + bytes_per_line16 = image_info->image_width * 2; + + bytes_per_line = (image_info->image_width/2) * 3; + + if (image_info->image_width & 1) + { + bytes_per_line += 2; + } + + DBG(DBG_info, "bytes_per_line16 = %d\n", bytes_per_line16); + DBG(DBG_info, "bytes_per_line = %d\n", bytes_per_line); + + line16 = (unsigned char *) malloc(bytes_per_line16); + + if (line16 == NULL) + { + char buf[TEXTBUFSIZE]; + + snprintf(buf, sizeof(buf), "%s malloc for line16 failed", ERR_DURING_SAVE); + DBG(DBG_error, "%s\n", buf); + xsane_back_gtk_decision(ERR_HEADER_ERROR, (gchar **) error_xpm, buf, BUTTON_OK, NULL, TRUE /* wait */); + *cancel_save = 1; + return (*cancel_save); + } + DBG(DBG_info, "line16 allocated\n"); + } + else + { + bytes_per_line = image_info->image_width; + bytes_per_line16 = image_info->image_width; + DBG(DBG_info, "bytes_per_line = %d\n", bytes_per_line); + } + + line = (unsigned char *) malloc(bytes_per_line); if (line == NULL) { @@ -3145,10 +3115,43 @@ static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *im return (*cancel_save); } + DBG(DBG_info, "line allocated\n"); + +#ifdef HAVE_LIBLCMS + if (do_transform && (hTransform != NULL)) + { + DBG(DBG_info, "Doing CMS color conversion\n"); + + line_raw = (unsigned char *) malloc(bytes_per_line16); + + if (line_raw == NULL) + { + char buf[TEXTBUFSIZE]; + + snprintf(buf, sizeof(buf), "%s malloc for line_raw failed", ERR_DURING_SAVE); + DBG(DBG_error, "%s\n", buf); + xsane_back_gtk_decision(ERR_HEADER_ERROR, (gchar **) error_xpm, buf, BUTTON_OK, NULL, TRUE /* wait */); + + free(line); + + if (line16) + { + free(line16); + } + + *cancel_save = 1; + return (*cancel_save); + } + + DBG(DBG_info, "line_raw allocated\n"); + } +#endif + for (y = 0; y < image_info->image_height; y++) { if (image_info->depth > 8) /* reduce 16 bit images */ { +#if 0 guint16 val; for (x = 0; x < image_info->image_width; x++) @@ -3156,13 +3159,72 @@ static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *im fread(&val, 2, 1, imagefile); line[x] = val/256; } +#endif +#if 1 +#ifdef HAVE_LIBLCMS + if (do_transform && (hTransform != NULL)) + { + fread(line_raw, 2, image_info->image_width, imagefile); + cmsDoTransform(hTransform, line_raw, line16, image_info->image_width); + } + else +#endif + { + fread(line16, 2, image_info->image_width, imagefile); + } + + linep = line; + +#if __BYTE_ORDER == __LITTLE_ENDIAN + for (x = 0; x < image_info->image_width; x=x+2) + { + *linep++ = line16[2*x+1]; /* pixel0 high+middle */ + + if (x == image_info->image_width-1) + { + *linep++ = (line16[2*x+0] & 240); /* pixel0 low */ + break; + } + + *linep++ = (line16[2*x+0] & 240) | (line16[2*x+3] >> 4); /* pixel0 low | pixel1 high */ + *linep++ = ((line16[2*x+3] & 15) << 4) | ((line16[2*x+2] & 240) >> 4); /* pixel1 middle | pixel1 low */ + } +#else + for (x = 0; x < image_info->image_width; x=x+2) + { + *linep++ = line16[2*x+0]; /* pixel0 high+middle */ + + if (x == image_info->image_width-1) + { + *linep++ = (line16[2*x+1] & 240); /* pixel0 low */ + break; + } + + *linep++ = (line16[2*x+1] & 240) | (line16[2*x+2] >> 4); /* pixel0 low | pixel1 high */ + *linep++ = ((line16[2*x+2] & 15) << 4) | ((line16[2*x+3] & 240) >> 4); /* pixel1 middle | pixel1 low */ + } +#endif +#endif } else /* 8 bits/sample */ { +#if 0 for (x = 0; x < image_info->image_width; x++) { line[x] = fgetc(imagefile); } +#endif +#ifdef HAVE_LIBLCMS + if (do_transform && (hTransform != NULL)) + { + fread(line_raw, 1, image_info->image_width, imagefile); + cmsDoTransform(hTransform, line_raw, line, image_info->image_width); + } + else +#endif + { + fread(line, 1, image_info->image_width, imagefile); + } } if (ascii85decode) @@ -3170,23 +3232,23 @@ static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *im #ifdef HAVE_LIBZ if (flatedecode) { - ret = xsane_write_compressed_a85_flatedecode(outfile, line, image_info->image_width, (y == image_info->image_height - 1)); + ret = xsane_write_compressed_a85_flatedecode(outfile, line, bytes_per_line, (y == image_info->image_height - 1)); } else #endif { - ret = xsane_write_compressed_a85(outfile, line, image_info->image_width, (y == image_info->image_height - 1)); + ret = xsane_write_compressed_a85(outfile, line, bytes_per_line, (y == image_info->image_height - 1)); } } #ifdef HAVE_LIBZ else if (flatedecode) { - ret = xsane_write_flatedecode(outfile, line, image_info->image_width, (y == image_info->image_height - 1)); + ret = xsane_write_flatedecode(outfile, line, bytes_per_line, (y == image_info->image_height - 1)); } #endif else { - fwrite(line, image_info->image_width, 1, outfile); + fwrite(line, bytes_per_line, 1, outfile); } if ((ret != 0) || (ferror(outfile))) @@ -3209,11 +3271,7 @@ static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *im break; } - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); if (*cancel_save) { @@ -3221,6 +3279,18 @@ static int xsane_save_ps_pdf_gray(FILE *outfile, FILE *imagefile, Image_info *im } } +#ifdef HAVE_LIBLCMS + if (line_raw) + { + free(line_raw); + } +#endif + + if (line16) + { + free(line16); + } + free(line); return (*cancel_save); @@ -3232,11 +3302,11 @@ static int xsane_save_ps_pdf_color(FILE *outfile, FILE *imagefile, Image_info *i cmsHTRANSFORM hTransform, int do_transform, GtkProgressBar *progress_bar, int *cancel_save) { - int x, y; - int ret; - unsigned char *line = NULL, *linep = NULL, *line16 = NULL; - int bytes_per_line; - int bytes_per_line16 = 0; + int x, y; + int ret; + unsigned char *line = NULL, *linep = NULL, *line16 = NULL; + int bytes_per_line; + int bytes_per_line16 = 0; #ifdef HAVE_LIBLCMS unsigned char *line_raw = NULL; #endif @@ -3331,11 +3401,7 @@ static int xsane_save_ps_pdf_color(FILE *outfile, FILE *imagefile, Image_info *i for (y = 0; y < image_info->image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); linep = line; @@ -4387,11 +4453,7 @@ int xsane_save_jpeg(FILE *outfile, int quality, FILE *imagefile, Image_info *ima for (y = 0; y < image_info->image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); if (image_info->depth == 1) { @@ -4692,11 +4754,7 @@ int xsane_save_tiff_page(TIFF *tiffile, int page, int pages, int quality, FILE * for (y = 0; y < image_info->image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); #ifdef HAVE_LIBLCMS if ((cms_function != XSANE_CMS_FUNCTION_EMBED_SCANNER_ICM_PROFILE) && (hTransform != NULL)) @@ -4944,11 +5002,7 @@ int xsane_save_png(FILE *outfile, int compression, FILE *imagefile, Image_info * for (y = 0; y < image_info->image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); #ifdef HAVE_LIBLCMS if ((cms_function != XSANE_CMS_FUNCTION_EMBED_SCANNER_ICM_PROFILE) && (hTransform != NULL)) @@ -5120,11 +5174,7 @@ int xsane_save_png_16(FILE *outfile, int compression, FILE *imagefile, Image_inf for (y = 0; y < image_info->image_height; y++) { - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); #ifdef HAVE_LIBLCMS if ((cms_function != XSANE_CMS_FUNCTION_EMBED_SCANNER_ICM_PROFILE) && (hTransform != NULL)) @@ -5265,11 +5315,8 @@ static int xsane_save_pnm_16_ascii_gray(FILE *outfile, FILE *imagefile, Image_in count = 0; - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); + if (*cancel_save) { break; @@ -5377,11 +5424,7 @@ static int xsane_save_pnm_16_ascii_color(FILE *outfile, FILE *imagefile, Image_i count = 0; - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); if (*cancel_save) { @@ -5467,11 +5510,7 @@ static int xsane_save_pnm_16_binary_gray(FILE *outfile, FILE *imagefile, Image_i fputc(data[3*x+0] & 255, outfile); } - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); if (ferror(outfile)) { @@ -5572,12 +5611,7 @@ static int xsane_save_pnm_16_binary_color(FILE *outfile, FILE *imagefile, Image_ fputc(data[3*x+2] & 255, outfile); } - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } - + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); if (ferror(outfile)) { @@ -5673,12 +5707,7 @@ static int xsane_save_pnm_8_gray(FILE *outfile, FILE *imagefile, Image_info *ima fputc(data[x], outfile); } - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } - + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); if (ferror(outfile)) { @@ -5775,12 +5804,7 @@ static int xsane_save_pnm_8_color(FILE *outfile, FILE *imagefile, Image_info *im fputc(data[3*x+2], outfile); } - gtk_progress_bar_update(progress_bar, (float) y / image_info->image_height); - while (gtk_events_pending()) - { - gtk_main_iteration(); - } - + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info->image_height); if (ferror(outfile)) { @@ -6028,7 +6052,7 @@ int xsane_save_image_as_text(char *output_filename, char *input_filename, GtkPro if (ocr_progress) /* pipe available */ { - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); while (!feof(ocr_progress)) { @@ -6056,7 +6080,7 @@ int xsane_save_image_as_text(char *output_filename, char *input_filename, GtkPro fprogress = 1.0; } - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), fprogress); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), fprogress); } while (gtk_events_pending()) @@ -6066,7 +6090,7 @@ int xsane_save_image_as_text(char *output_filename, char *input_filename, GtkPro } gtk_progress_set_format_string(GTK_PROGRESS(progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); } else /* no pipe available */ { @@ -6134,12 +6158,7 @@ int xsane_save_image_as(char *output_filename, char *input_filename, int output_ snprintf(buf, sizeof(buf), "%s: %s", PROGRESS_PACKING_DATA, output_filename); gtk_progress_set_format_string(GTK_PROGRESS(progress_bar), buf); - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), 0.0); - - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); xsane_save_image_as_lineart(temporary_filename, input_filename, progress_bar, cancel_save); @@ -6177,12 +6196,7 @@ int xsane_save_image_as(char *output_filename, char *input_filename, int output_ gtk_progress_bar_set_ellipsize(GTK_PROGRESS_BAR(progress_bar), PANGO_ELLIPSIZE_START); /* this is new API, can be removed for old GTK versions */ gtk_progress_set_format_string(GTK_PROGRESS(progress_bar), buf); - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), 0.0); - - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); #ifdef HAVE_LIBTIFF @@ -6329,12 +6343,7 @@ int xsane_save_image_as(char *output_filename, char *input_filename, int output_ } gtk_progress_set_format_string(GTK_PROGRESS(progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), 0.0); - - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); return -2; break; /* switch format == default */ @@ -6354,12 +6363,7 @@ int xsane_save_image_as(char *output_filename, char *input_filename, int output_ } gtk_progress_set_format_string(GTK_PROGRESS(progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), 0.0); - - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); return -2; } @@ -6385,12 +6389,7 @@ int xsane_save_image_as(char *output_filename, char *input_filename, int output_ } gtk_progress_set_format_string(GTK_PROGRESS(progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(progress_bar), 0.0); - - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress_bar), 0.0); return (*cancel_save); } @@ -6905,11 +6904,7 @@ int xsane_transfer_to_gimp(char *input_filename, int apply_ICM_profile, int cms_ tile_offset = 0; } - gtk_progress_bar_update(progress_bar, (float) y / image_info.image_height); /* update progress bar */ - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info.image_height); /* update progress bar */ break; /* leave for j loop */ } @@ -6950,11 +6945,7 @@ int xsane_transfer_to_gimp(char *input_filename, int apply_ICM_profile, int cms_ tile_offset = 0; } - gtk_progress_bar_update(progress_bar, (float) y / image_info.image_height); /* update progress bar */ - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info.image_height); /* update progress bar */ if (*cancel_save) { @@ -6992,11 +6983,7 @@ int xsane_transfer_to_gimp(char *input_filename, int apply_ICM_profile, int cms_ tile_offset = 0; } - gtk_progress_bar_update(progress_bar, (float) y / image_info.image_height); /* update progress bar */ - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info.image_height); /* update progress bar */ if (*cancel_save) { @@ -7044,11 +7031,7 @@ int xsane_transfer_to_gimp(char *input_filename, int apply_ICM_profile, int cms_ tile_offset = 0; } - gtk_progress_bar_update(progress_bar, (float) y / image_info.image_height); /* update progress bar */ - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info.image_height); /* update progress bar */ if (*cancel_save) { @@ -7089,11 +7072,7 @@ int xsane_transfer_to_gimp(char *input_filename, int apply_ICM_profile, int cms_ tile_offset = 0; } - gtk_progress_bar_update(progress_bar, (float) y / image_info.image_height); /* update progress bar */ - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info.image_height); /* update progress bar */ if (*cancel_save) { @@ -7135,11 +7114,7 @@ int xsane_transfer_to_gimp(char *input_filename, int apply_ICM_profile, int cms_ tile_offset = 0; } - gtk_progress_bar_update(progress_bar, (float) y / image_info.image_height); /* update progress bar */ - while (gtk_events_pending()) - { - gtk_main_iteration(); - } + xsane_progress_bar_set_fraction(progress_bar, (float) y / image_info.image_height); /* update progress bar */ } } @@ -7687,6 +7662,9 @@ int write_smtp_header(int fd_socket, char *from, char *to, int auth_type, char * { char buf[1024]; int len; + char to_line[1024]; + char *to_pos = NULL; + char *pos = NULL; len = read(fd_socket, buf, sizeof(buf)); if (len >= 0) @@ -7732,7 +7710,11 @@ int write_smtp_header(int fd_socket, char *from, char *to, int auth_type, char * return -1; } - snprintf(buf, sizeof(buf), "MAIL FROM: %s\r\n", from); + while (from[0] == ' ') + { + from = from + 1; + } + snprintf(buf, sizeof(buf), "MAIL FROM: <%s>\r\n", from); DBG(DBG_info2, "> %s", buf); write(fd_socket, buf, strlen(buf)); len = read(fd_socket, buf, sizeof(buf)); @@ -7754,29 +7736,55 @@ int write_smtp_header(int fd_socket, char *from, char *to, int auth_type, char * xsane_front_gtk_email_project_update_lockfile_status(); return -1; } - + - snprintf(buf, sizeof(buf), "RCPT TO: %s\r\n", to); - DBG(DBG_info2, "> %s", buf); - write(fd_socket, buf, strlen(buf)); - len = read(fd_socket, buf, sizeof(buf)); - if (len >= 0) + strncpy(to_line, to, sizeof(to_line)); /* it is not allowed to modify the "to" string, so we make a copy */ + to_pos = to_line; + while (to_pos != NULL) { - buf[len] = 0; - } - DBG(DBG_info2, "< %s\n", buf); + while (*to_pos == ' ') + { + to_pos = to_pos + 1; + } + pos = strchr(to_pos, ','); - if (buf[0] != '2') - { - DBG(DBG_info, "=> error\n"); + if (pos) + { + *pos = 0; /* end of string marker */ + } - if (xsane.email_status) + snprintf(buf, sizeof(buf), "RCPT TO: <%s>\r\n", to_pos); + + DBG(DBG_info2, "> %s", buf); + write(fd_socket, buf, strlen(buf)); + len = read(fd_socket, buf, sizeof(buf)); + if (len >= 0) { - free(xsane.email_status); + buf[len] = 0; + } + DBG(DBG_info2, "< %s\n", buf); + + if (buf[0] != '2') + { + DBG(DBG_info, "=> error\n"); + + if (xsane.email_status) + { + free(xsane.email_status); + } + xsane.email_status = strdup(TEXT_EMAIL_STATUS_SMTP_ERR_RCPT); + xsane_front_gtk_email_project_update_lockfile_status(); + return -1; + } + + if (pos) + { + to_pos = pos+1; + } + else + { + to_pos = NULL; } - xsane.email_status = strdup(TEXT_EMAIL_STATUS_SMTP_ERR_RCPT); - xsane_front_gtk_email_project_update_lockfile_status(); - return -1; } snprintf(buf, sizeof(buf), "DATA\r\n"); diff --git a/src/xsane-scan.c b/src/xsane-scan.c index 11aff3e..d6e164a 100644 --- a/src/xsane-scan.c +++ b/src/xsane-scan.c @@ -505,6 +505,9 @@ static void xsane_read_image_data(gpointer data, gint source, GdkInputCondition status = sane_read(dev, (SANE_Byte *) buf16, sizeof(buf16), &len); } + DBG(DBG_info, "sane_read returned with status %s\n", XSANE_STRSTATUS(status)); + DBG(DBG_info, "sane_read: len = %d\n", len); + if (!xsane.scanning) /* scan may have been canceled while sane_read was executed */ { @@ -947,7 +950,7 @@ static int xsane_reduce_to_lineart() int abort = 0; /* open progressbar */ - xsane_progress_new(PROGRESS_PACKING_DATA, PROGRESS_TRANSFERING_DATA, (GtkSignalFunc) xsane_cancel_save, &xsane.cancel_save); + xsane_progress_new(PROGRESS_PACKING_DATA, PROGRESS_TRANSFERRING_DATA, (GtkSignalFunc) xsane_cancel_save, &xsane.cancel_save); while (gtk_events_pending()) { gtk_main_iteration(); @@ -1134,7 +1137,7 @@ void xsane_scan_done(SANE_Status status) xsane_read_pnm_header(infile, &image_info); /* open progressbar */ - xsane_progress_new(PROGRESS_ROTATING_DATA, PROGRESS_TRANSFERING_DATA, (GtkSignalFunc) xsane_cancel_save, &xsane.cancel_save); + xsane_progress_new(PROGRESS_ROTATING_DATA, PROGRESS_TRANSFERRING_DATA, (GtkSignalFunc) xsane_cancel_save, &xsane.cancel_save); while (gtk_events_pending()) { gtk_main_iteration(); @@ -1246,7 +1249,7 @@ void xsane_scan_done(SANE_Status status) { /* ok, we have to do a transformation */ /* open progressbar */ - xsane_progress_new(PROGRESS_CONVERTING_DATA, PROGRESS_TRANSFERING_DATA, (GtkSignalFunc) xsane_cancel_save, &xsane.cancel_save); + xsane_progress_new(PROGRESS_CONVERTING_DATA, PROGRESS_TRANSFERRING_DATA, (GtkSignalFunc) xsane_cancel_save, &xsane.cancel_save); while (gtk_events_pending()) { gtk_main_iteration(); @@ -1305,7 +1308,7 @@ void xsane_scan_done(SANE_Status status) } /* open progressbar */ - xsane_progress_new(PROGRESS_CONVERTING_DATA, PROGRESS_TRANSFERING_DATA, (GtkSignalFunc) xsane_cancel_save, &xsane.cancel_save); + xsane_progress_new(PROGRESS_CONVERTING_DATA, PROGRESS_TRANSFERRING_DATA, (GtkSignalFunc) xsane_cancel_save, &xsane.cancel_save); while (gtk_events_pending()) { @@ -1471,7 +1474,7 @@ void xsane_scan_done(SANE_Status status) xsane_multipage_project_save(); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.multipage_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } else if (xsane.xsane_mode == XSANE_FAX) { @@ -1512,7 +1515,7 @@ void xsane_scan_done(SANE_Status status) xsane_fax_project_save(); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.fax_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } #ifdef XSANE_ACTIVATE_EMAIL else if (xsane.xsane_mode == XSANE_EMAIL) @@ -1554,7 +1557,7 @@ void xsane_scan_done(SANE_Status status) xsane_email_project_save(); gtk_progress_set_format_string(GTK_PROGRESS(xsane.project_progress_bar), _(xsane.email_status)); - gtk_progress_bar_update(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(xsane.project_progress_bar), 0.0); } #endif } @@ -1595,7 +1598,7 @@ void xsane_scan_done(SANE_Status status) DBG(DBG_info, "Batch mode end of scan\n"); sane_cancel(xsane.dev); /* we have to call sane_cancel otherwise we are not able to set new parameters */ } -// else if ( ( (status != SANE_STATUS_GOOD) && (status != SANE_STATUS_EOF) ) || (!xsane.batch_loop) ) /* last scan: update histogram */ +/* else if ( ( (status != SANE_STATUS_GOOD) && (status != SANE_STATUS_EOF) ) || (!xsane.batch_loop) ) */ /* last scan: update histogram */ else { DBG(DBG_info, "Normal end of scan\n"); diff --git a/src/xsane-setup.c b/src/xsane-setup.c index 1078604..39ffee6 100644 --- a/src/xsane-setup.c +++ b/src/xsane-setup.c @@ -556,7 +556,7 @@ static void xsane_setup_enhance_apply_changes(GtkWidget *widget, gpointer data) preferences.preview_pipette_range = xsane_setup.preview_pipette_range; xsane_update_bool(xsane_setup.auto_enhance_gamma_button, &preferences.auto_enhance_gamma); - xsane_update_bool(xsane_setup.preselect_scanarea_button, &preferences.preselect_scanarea); + xsane_update_bool(xsane_setup.preselect_scan_area_button, &preferences.preselect_scan_area); xsane_update_bool(xsane_setup.auto_correct_colors_button, &preferences.auto_correct_colors); xsane_update_gamma_curve(TRUE /* update raw */); @@ -569,8 +569,6 @@ static void xsane_setup_color_management_apply_changes(GtkWidget *widget, gpoint { DBG(DBG_proc, "xsane_setup_colormagaement_apply_changes\n"); -// preferences.cms_intent = gtk_option_menu_get_history(GTK_OPTION_MENU(xsane_setup.cms_intent_option_menu)); -// preferences.cms_intent = gtk_option_menu_get_history(GTK_OPTION_MENU(xsane_setup.cms_intent_option_menu)); preferences.cms_intent = (int) gtk_object_get_data(GTK_OBJECT(gtk_menu_get_active(GTK_MENU(gtk_option_menu_get_menu(GTK_OPTION_MENU(xsane_setup.cms_intent_option_menu))))), "Selection"); xsane_update_bool(xsane_setup.cms_bpc_button, &preferences.cms_bpc); @@ -734,7 +732,6 @@ static void xsane_setup_email_apply_changes(GtkWidget *widget, gpointer data) preferences.email_auth_pass[i] ^= 0x53; } -// xsane_update_bool(xsane_setup.email_authentication_entry, &preferences.email_authentication); xsane_update_int(xsane_setup.email_smtp_port_entry, &preferences.email_smtp_port); xsane_update_int(xsane_setup.email_pop3_port_entry, &preferences.email_pop3_port); @@ -1072,7 +1069,7 @@ static void xsane_setup_browse_printer_icm_profile_callback(GtkWidget *widget, g static void xsane_printer_notebook(GtkWidget *notebook) { - GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text, *frame; + GtkWidget *setup_vbox, *vbox, *hbox, *title_hbox, *button_box, *button, *label, *text, *table, *separator; GtkWidget *printer_option_menu; char buf[64]; @@ -1080,27 +1077,23 @@ static void xsane_printer_notebook(GtkWidget *notebook) /* Printer options notebook page */ - setup_vbox = gtk_vbox_new(FALSE, 5); + setup_vbox = gtk_vbox_new(FALSE, 0); label = gtk_label_new(NOTEBOOK_COPY_OPTIONS); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label); gtk_widget_show(setup_vbox); - frame = gtk_frame_new(0); - gtk_container_set_border_width(GTK_CONTAINER(frame), 7); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(frame); - vbox = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(frame), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(setup_vbox), vbox, TRUE, TRUE, 2); /* sizeable framehight, 2 pixels at top and bottom */ + gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); /* 6 pixels left and right */ gtk_widget_show(vbox); + /* printer selection : */ - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + hbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); label = gtk_label_new(TEXT_SETUP_PRINTER_SEL); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); @@ -1125,7 +1118,7 @@ static void xsane_printer_notebook(GtkWidget *notebook) text = gtk_entry_new(); xsane_back_gtk_set_tooltip(xsane.tooltips, text, DESC_PRINTER_NAME); - gtk_widget_set_size_request(text, 250, -1); + gtk_widget_set_size_request(text, 350, -1); gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.printer[preferences.printernr]->name); gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); gtk_widget_show(text); @@ -1143,7 +1136,7 @@ static void xsane_printer_notebook(GtkWidget *notebook) text = gtk_entry_new(); xsane_back_gtk_set_tooltip(xsane.tooltips, text, DESC_PRINTER_COMMAND); - gtk_widget_set_size_request(text, 250, -1); + gtk_widget_set_size_request(text, 350, -1); gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.printer[preferences.printernr]->command); gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); gtk_widget_show(text); @@ -1161,7 +1154,7 @@ static void xsane_printer_notebook(GtkWidget *notebook) text = gtk_entry_new(); xsane_back_gtk_set_tooltip(xsane.tooltips, text, DESC_COPY_NUMBER_OPTION); - gtk_widget_set_size_request(text, 250, -1); + gtk_widget_set_size_request(text, 350, -1); gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.printer[preferences.printernr]->copy_number_option); gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); gtk_widget_show(text); @@ -1171,14 +1164,24 @@ static void xsane_printer_notebook(GtkWidget *notebook) xsane_separator_new(vbox, 2); + table = gtk_table_new(8, 5, FALSE); + gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 2); + gtk_widget_show(table); - /* printer lineart resolution : */ - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + /* title */ + title_hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); + label = gtk_label_new(TEXT_SETUP_SCAN_RESOLUTION_PRINTER); + gtk_box_pack_start(GTK_BOX(title_hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), title_hbox, 0, 1, 0, 1, GTK_FILL, 0, 0 , 0); + gtk_widget_show(label); + gtk_widget_show(title_hbox); + + + /* printer lineart resolution : */ label = gtk_label_new(TEXT_SETUP_PRINTER_LINEART_RES); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 1, 2, 0, 1, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1186,19 +1189,15 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%d", preferences.printer[preferences.printernr]->lineart_resolution); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 1, 2, 1, 2, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_lineart_resolution_entry = text; /* printer grayscale resolution : */ - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - label = gtk_label_new(TEXT_SETUP_PRINTER_GRAYSCALE_RES); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 2, 3, 0, 1, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1206,19 +1205,15 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%d", preferences.printer[preferences.printernr]->grayscale_resolution); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 2, 3, 1, 2, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_grayscale_resolution_entry = text; /* printer color resolution : */ - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - label = gtk_label_new(TEXT_SETUP_PRINTER_COLOR_RES); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 3, 4, 0, 1, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1226,23 +1221,32 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%d", preferences.printer[preferences.printernr]->color_resolution); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 3, 4, 1, 2, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_color_resolution_entry = text; - xsane_separator_new(vbox, 2); + gtk_table_set_row_spacing(GTK_TABLE(table), 1, 4); + separator = gtk_hseparator_new(); + gtk_table_attach(GTK_TABLE(table), separator, 0, 5, 2, 3, GTK_FILL, 0, 0 , 0); + gtk_widget_show(separator); + gtk_table_set_row_spacing(GTK_TABLE(table), 2, 4); - /* printer width: */ + /* title */ + title_hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); + label = gtk_label_new(TEXT_SETUP_PRINTER_PAPER_GEOMETRIE); + gtk_box_pack_start(GTK_BOX(title_hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), title_hbox, 0, 1, 3, 4, GTK_FILL, 0, 0 , 0); + gtk_widget_show(label); + gtk_widget_show(title_hbox); - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - snprintf(buf, sizeof(buf), "%s [%s]:", TEXT_SETUP_PRINTER_WIDTH, xsane_back_gtk_unit_string(SANE_UNIT_MM)); + /* printer width: */ + + snprintf(buf, sizeof(buf), "%s [%s]", TEXT_SETUP_PRINTER_WIDTH, xsane_back_gtk_unit_string(SANE_UNIT_MM)); label = gtk_label_new(buf); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 1, 2, 3, 4, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1250,19 +1254,15 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%4.3f", preferences.printer[preferences.printernr]->width / preferences.length_unit); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 1, 2, 4, 5, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_width_entry = text; /* printer height: */ - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - - snprintf(buf, sizeof(buf), "%s [%s]:", TEXT_SETUP_PRINTER_HEIGHT, xsane_back_gtk_unit_string(SANE_UNIT_MM)); + snprintf(buf, sizeof(buf), "%s [%s]", TEXT_SETUP_PRINTER_HEIGHT, xsane_back_gtk_unit_string(SANE_UNIT_MM)); label = gtk_label_new(buf); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 2, 3, 3, 4, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1270,19 +1270,15 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%4.3f", preferences.printer[preferences.printernr]->height / preferences.length_unit); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 2, 3, 4, 5, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_height_entry = text; /* printer left offset : */ - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - - snprintf(buf, sizeof(buf), "%s [%s]:", TEXT_SETUP_PRINTER_LEFT, xsane_back_gtk_unit_string(SANE_UNIT_MM)); + snprintf(buf, sizeof(buf), "%s [%s]", TEXT_SETUP_PRINTER_LEFT, xsane_back_gtk_unit_string(SANE_UNIT_MM)); label = gtk_label_new(buf); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 3, 4, 3, 4, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1290,19 +1286,15 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%4.3f", preferences.printer[preferences.printernr]->leftoffset / preferences.length_unit); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 3, 4, 4, 5, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_leftoffset_entry = text; /* printer bottom offset : */ - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - - snprintf(buf, sizeof(buf), "%s [%s]:", TEXT_SETUP_PRINTER_BOTTOM, xsane_back_gtk_unit_string(SANE_UNIT_MM)); + snprintf(buf, sizeof(buf), "%s [%s]", TEXT_SETUP_PRINTER_BOTTOM, xsane_back_gtk_unit_string(SANE_UNIT_MM)); label = gtk_label_new(buf); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 4, 5, 3, 4, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1310,22 +1302,31 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%4.3f", preferences.printer[preferences.printernr]->bottomoffset / preferences.length_unit); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 4, 5, 4, 5, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_bottomoffset_entry = text; - xsane_separator_new(vbox, 2); + gtk_table_set_row_spacing(GTK_TABLE(table), 4, 4); + separator = gtk_hseparator_new(); + gtk_table_attach(GTK_TABLE(table), separator, 0, 5, 5, 6, GTK_FILL, 0, 0 , 0); + gtk_widget_show(separator); + gtk_table_set_row_spacing(GTK_TABLE(table), 5, 4); - /* printer gamma: */ + /* title */ + title_hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); + label = gtk_label_new(TEXT_SETUP_PRINTER_GAMMA_CORRECTION); + gtk_box_pack_start(GTK_BOX(title_hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), title_hbox, 0, 1, 6, 7, GTK_FILL, 0, 0 , 0); + gtk_widget_show(label); + gtk_widget_show(title_hbox); - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + + /* printer gamma: */ label = gtk_label_new(TEXT_SETUP_PRINTER_GAMMA); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 1, 2, 6, 7, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1333,18 +1334,14 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 1, 2, 7, 8, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_gamma_entry = text; /* printer gamma red: */ - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - label = gtk_label_new(TEXT_SETUP_PRINTER_GAMMA_RED); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 2, 3, 6, 7, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1352,18 +1349,14 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma_red); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 2, 3, 7, 8, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_gamma_red_entry = text; /* printer gamma green: */ - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - label = gtk_label_new(TEXT_SETUP_PRINTER_GAMMA_GREEN); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 3, 4, 6, 7, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1371,18 +1364,14 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma_green); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 3, 4, 7, 8, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_gamma_green_entry = text; /* printer gamma blue: */ - hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - label = gtk_label_new(TEXT_SETUP_PRINTER_GAMMA_BLUE); - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), label, 4, 5, 6, 7, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(label); text = gtk_entry_new(); @@ -1390,9 +1379,8 @@ static void xsane_printer_notebook(GtkWidget *notebook) gtk_widget_set_size_request(text, 80, -1); snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma_blue); gtk_entry_set_text(GTK_ENTRY(text), (char *) buf); - gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2); + gtk_table_attach(GTK_TABLE(table), text, 4, 5, 7, 8, GTK_SHRINK | GTK_EXPAND, 0, 0 , 0); gtk_widget_show(text); - gtk_widget_show(hbox); xsane_setup.printer_gamma_blue_entry = text; #ifdef HAVE_LIBLCMS @@ -1486,33 +1474,36 @@ static void xsane_printer_notebook(GtkWidget *notebook) #endif - xsane_separator_new(vbox, 4); + xsane_separator_new(vbox, 2); /* "apply" "add printer" "delete printer" */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_widget_show(hbox); -#ifdef HAVE_GTK2 - button = gtk_button_new_from_stock(GTK_STOCK_APPLY); -#else - button = gtk_button_new_with_label(BUTTON_APPLY); -#endif - g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_printer_apply_changes, printer_option_menu); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); - gtk_widget_show(button); + button_box = gtk_hbox_new(/* homogeneous */ TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button_box, FALSE, FALSE, 0); + gtk_widget_show(button_box); button = gtk_button_new_with_label(BUTTON_ADD_PRINTER); g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_printer_new, printer_option_menu); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(button_box), button, TRUE, TRUE, 0); gtk_widget_show(button); button = gtk_button_new_with_label(BUTTON_DELETE_PRINTER); g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_printer_delete, printer_option_menu); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(button_box), button, TRUE, TRUE, 8); gtk_widget_show(button); - gtk_widget_show(hbox); +#ifdef HAVE_GTK2 + button = gtk_button_new_from_stock(GTK_STOCK_APPLY); +#else + button = gtk_button_new_with_label(BUTTON_APPLY); +#endif + g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_printer_apply_changes, printer_option_menu); + gtk_box_pack_start(GTK_BOX(button_box), button, TRUE, TRUE, 0); + gtk_widget_show(button); } /* ---------------------------------------------------------------------------------------------------------------------- */ @@ -1635,7 +1626,7 @@ static void xsane_setup_browse_working_color_space_icm_profile_callback(GtkWidge static void xsane_saving_notebook(GtkWidget *notebook) { - GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text, *frame; + GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text; GtkWidget *filename_counter_len_option_menu, *filename_counter_len_menu, *filename_counter_len_item; char buf[64]; int i, select = 1; @@ -1643,24 +1634,20 @@ static void xsane_saving_notebook(GtkWidget *notebook) DBG(DBG_proc, "xsane_saving_notebook\n"); /* Saving options notebook page */ - setup_vbox = gtk_vbox_new(FALSE, 5); + setup_vbox = gtk_vbox_new(FALSE, 0); label = gtk_label_new(NOTEBOOK_SAVING_OPTIONS); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label); gtk_widget_show(setup_vbox); - frame = gtk_frame_new(0); - gtk_container_set_border_width(GTK_CONTAINER(frame), 7); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(frame); - - vbox = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(frame), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(setup_vbox), vbox, TRUE, TRUE, 2); /* sizeable framehight */ + gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); gtk_widget_show(vbox); + /* tmp path : */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); @@ -1788,7 +1775,7 @@ static void xsane_saving_notebook(GtkWidget *notebook) /* apply button */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_APPLY); @@ -1796,7 +1783,7 @@ static void xsane_saving_notebook(GtkWidget *notebook) button = gtk_button_new_with_label(BUTTON_APPLY); #endif g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_saving_apply_changes, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); gtk_widget_show(hbox); @@ -1806,7 +1793,7 @@ static void xsane_saving_notebook(GtkWidget *notebook) static void xsane_filetype_notebook(GtkWidget *notebook) { - GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *frame; + GtkWidget *setup_vbox, *vbox, *hbox, *button, *label; #ifdef HAVE_LIBTIFF int i, select = 1; @@ -1860,23 +1847,19 @@ static void xsane_filetype_notebook(GtkWidget *notebook) DBG(DBG_proc, "xsane_filetype_notebook\n"); /* Image options notebook page */ - setup_vbox = gtk_vbox_new(FALSE, 5); + setup_vbox = gtk_vbox_new(FALSE, 0); label = gtk_label_new(NOTEBOOK_FILETYPE_OPTIONS); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label); gtk_widget_show(setup_vbox); - frame = gtk_frame_new(0); - gtk_container_set_border_width(GTK_CONTAINER(frame), 7); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(frame); - - vbox = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(frame), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(setup_vbox), vbox, TRUE, TRUE, 2); /* sizeable framehight */ + gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); gtk_widget_show(vbox); + /* reduce 16bit to 8bit */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); @@ -2079,7 +2062,7 @@ static void xsane_filetype_notebook(GtkWidget *notebook) /* apply button */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_APPLY); @@ -2087,7 +2070,7 @@ static void xsane_filetype_notebook(GtkWidget *notebook) button = gtk_button_new_with_label(BUTTON_APPLY); #endif g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_image_apply_changes, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); gtk_widget_show(hbox); @@ -2125,7 +2108,7 @@ static void xsane_fax_notebook_set_faxprogram_default_callback(GtkWidget *widget static void xsane_fax_notebook(GtkWidget *notebook) { - GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text, *frame; + GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text; char buf[64]; int i; @@ -2133,22 +2116,18 @@ static void xsane_fax_notebook(GtkWidget *notebook) /* Fax options notebook page */ - setup_vbox = gtk_vbox_new(FALSE, 5); + setup_vbox = gtk_vbox_new(FALSE, 0); label = gtk_label_new(NOTEBOOK_FAX_OPTIONS); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label); gtk_widget_show(setup_vbox); - frame = gtk_frame_new(0); - gtk_container_set_border_width(GTK_CONTAINER(frame), 7); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(frame); - - vbox = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(frame), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(setup_vbox), vbox, TRUE, TRUE, 2); /* sizeable framehight */ + gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); gtk_widget_show(vbox); + /* faxcommand : */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); @@ -2392,7 +2371,7 @@ static void xsane_fax_notebook(GtkWidget *notebook) /* apply button */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_APPLY); @@ -2400,7 +2379,7 @@ static void xsane_fax_notebook(GtkWidget *notebook) button = gtk_button_new_with_label(BUTTON_APPLY); #endif g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_fax_apply_changes, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); gtk_widget_show(hbox); @@ -2420,7 +2399,7 @@ static void xsane_email_notebook(GtkWidget *notebook) #define AUTHENTICATION_NUMBER 4 - GtkWidget *setup_vbox, *vbox, *pop3_vbox, *hbox, *button, *label, *text, *frame; + GtkWidget *setup_vbox, *vbox, *pop3_vbox, *hbox, *button, *label, *text; GtkWidget *authentication_option_menu, *authentication_menu, *authentication_menu_item; char buf[64]; char *password; @@ -2431,23 +2410,19 @@ static void xsane_email_notebook(GtkWidget *notebook) /* Mail options notebook page */ - setup_vbox = gtk_vbox_new(FALSE, 5); + setup_vbox = gtk_vbox_new(FALSE, 0); label = gtk_label_new(NOTEBOOK_EMAIL_OPTIONS); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label); gtk_widget_show(setup_vbox); - frame = gtk_frame_new(0); - gtk_container_set_border_width(GTK_CONTAINER(frame), 7); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(frame); - - vbox = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(frame), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(setup_vbox), vbox, TRUE, TRUE, 2); /* sizeable framehight */ + gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); gtk_widget_show(vbox); + /* from */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); @@ -2671,7 +2646,7 @@ static void xsane_email_notebook(GtkWidget *notebook) /* apply button */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_APPLY); @@ -2679,7 +2654,7 @@ static void xsane_email_notebook(GtkWidget *notebook) button = gtk_button_new_with_label(BUTTON_APPLY); #endif g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_email_apply_changes, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); gtk_widget_show(hbox); @@ -2690,28 +2665,24 @@ static void xsane_email_notebook(GtkWidget *notebook) static void xsane_ocr_notebook(GtkWidget *notebook) { - GtkWidget *setup_vbox, *vbox, *hbox, *label, *text, *frame, *button; + GtkWidget *setup_vbox, *vbox, *hbox, *label, *text, *button; DBG(DBG_proc, "xsane_ocr_notebook\n"); /* OCR options notebook page */ - setup_vbox = gtk_vbox_new(FALSE, 5); + setup_vbox = gtk_vbox_new(FALSE, 0); label = gtk_label_new(NOTEBOOK_OCR_OPTIONS); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label); gtk_widget_show(setup_vbox); - frame = gtk_frame_new(0); - gtk_container_set_border_width(GTK_CONTAINER(frame), 7); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(frame); - - vbox = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(frame), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(setup_vbox), vbox, TRUE, TRUE, 2); /* sizeable framehight */ + gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); gtk_widget_show(vbox); + /* ocr command : */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); @@ -2823,7 +2794,7 @@ static void xsane_ocr_notebook(GtkWidget *notebook) /* apply button */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_APPLY); @@ -2831,7 +2802,7 @@ static void xsane_ocr_notebook(GtkWidget *notebook) button = gtk_button_new_with_label(BUTTON_APPLY); #endif g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_ocr_apply_changes, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); gtk_widget_show(hbox); } @@ -2840,7 +2811,7 @@ static void xsane_ocr_notebook(GtkWidget *notebook) static void xsane_display_notebook(GtkWidget *notebook) { - GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text, *frame; + GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text; GtkWidget *show_range_mode_option_menu, *show_range_mode_menu, *show_range_mode_item; char buf[64]; int i, select = 1; @@ -2858,22 +2829,18 @@ static void xsane_display_notebook(GtkWidget *notebook) /* Display options notebook page */ - setup_vbox = gtk_vbox_new(FALSE, 5); + setup_vbox = gtk_vbox_new(FALSE, 0); label = gtk_label_new(NOTEBOOK_DISPLAY_OPTIONS); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label); gtk_widget_show(setup_vbox); - frame = gtk_frame_new(0); - gtk_container_set_border_width(GTK_CONTAINER(frame), 7); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(frame); - - vbox = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(frame), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(setup_vbox), vbox, TRUE, TRUE, 2); /* sizeable framehight */ + gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); gtk_widget_show(vbox); + /* main window fixed: */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); @@ -3094,7 +3061,7 @@ static void xsane_display_notebook(GtkWidget *notebook) /* apply button */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_APPLY); @@ -3102,7 +3069,7 @@ static void xsane_display_notebook(GtkWidget *notebook) button = gtk_button_new_with_label(BUTTON_APPLY); #endif g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_display_apply_changes, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); gtk_widget_show(hbox); @@ -3187,7 +3154,7 @@ static void xsane_setup_preview_pipette_range_callback(GtkWidget *widget, gpoint static void xsane_enhance_notebook(GtkWidget *notebook) { - GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text, *frame; + GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text; GtkWidget *lineart_mode_option_menu, *lineart_mode_menu, *lineart_mode_item; GtkWidget *gray_option_menu, *gray_menu, *gray_item; GtkWidget *preview_pipette_range_option_menu, *preview_pipette_range_menu, *preview_pipette_range_item; @@ -3208,22 +3175,18 @@ static void xsane_enhance_notebook(GtkWidget *notebook) /* enhancement options notebook page */ - setup_vbox = gtk_vbox_new(FALSE, 5); + setup_vbox = gtk_vbox_new(FALSE, 0); label = gtk_label_new(NOTEBOOK_ENHANCE_OPTIONS); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label); gtk_widget_show(setup_vbox); - frame = gtk_frame_new(0); - gtk_container_set_border_width(GTK_CONTAINER(frame), 7); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(frame); - - vbox = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(frame), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(setup_vbox), vbox, TRUE, TRUE, 2); /* sizeable framehight */ + gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); gtk_widget_show(vbox); + /* lineart modus menu */ lineart_mode_strings[0].name = MENU_ITEM_LINEART_MODE_STANDARD; lineart_mode_strings[0].number = XSANE_LINEART_STANDARD; @@ -3430,16 +3393,16 @@ static void xsane_enhance_notebook(GtkWidget *notebook) gtk_widget_show(hbox); xsane_setup.auto_enhance_gamma_button = button; - /* autoselect scanarea */ + /* autoselect scan area */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); - button = gtk_check_button_new_with_label(RADIO_BUTTON_PRESELECT_SCANAREA); - xsane_back_gtk_set_tooltip(xsane.tooltips, button, DESC_PRESELECT_SCANAREA); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), preferences.preselect_scanarea); + button = gtk_check_button_new_with_label(RADIO_BUTTON_PRESELECT_SCAN_AREA); + xsane_back_gtk_set_tooltip(xsane.tooltips, button, DESC_PRESELECT_SCAN_AREA); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), preferences.preselect_scan_area); gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 2); gtk_widget_show(button); gtk_widget_show(hbox); - xsane_setup.preselect_scanarea_button = button; + xsane_setup.preselect_scan_area_button = button; /* autocorrect colors */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); @@ -3496,7 +3459,7 @@ static void xsane_enhance_notebook(GtkWidget *notebook) /* apply button */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_APPLY); @@ -3504,7 +3467,7 @@ static void xsane_enhance_notebook(GtkWidget *notebook) button = gtk_button_new_with_label(BUTTON_APPLY); #endif g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_enhance_apply_changes, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); xsane_enhance_notebook_sensitivity(xsane_setup.lineart_mode); @@ -3517,31 +3480,27 @@ static void xsane_enhance_notebook(GtkWidget *notebook) #ifdef HAVE_LIBLCMS static void xsane_color_management_notebook(GtkWidget *notebook) { - GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text, *frame, *option_menu, *menu, *menu_item; + GtkWidget *setup_vbox, *vbox, *hbox, *button, *label, *text, *option_menu, *menu, *menu_item; int selection = 0; DBG(DBG_proc, "xsane_color_management_notebook\n"); /* color management options notebook page */ - setup_vbox = gtk_vbox_new(FALSE, 5); + setup_vbox = gtk_vbox_new(FALSE, 0); label = gtk_label_new(NOTEBOOK_COLOR_MANAGEMENT_OPTIONS); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label); gtk_widget_show(setup_vbox); - frame = gtk_frame_new(0); - gtk_container_set_border_width(GTK_CONTAINER(frame), 7); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(frame); - - vbox = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(frame), vbox); + vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(setup_vbox), vbox, TRUE, TRUE, 2); /* sizeable framehight */ + gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); gtk_widget_show(vbox); + /* black point compensation */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); @@ -3846,7 +3805,7 @@ static void xsane_color_management_notebook(GtkWidget *notebook) /* apply button */ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_APPLY); @@ -3854,7 +3813,7 @@ static void xsane_color_management_notebook(GtkWidget *notebook) button = gtk_button_new_with_label(BUTTON_APPLY); #endif g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_color_management_apply_changes, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0); gtk_widget_show(button); gtk_widget_show(hbox); @@ -3865,7 +3824,7 @@ static void xsane_color_management_notebook(GtkWidget *notebook) void xsane_setup_dialog(GtkWidget *widget, gpointer data) { - GtkWidget *setup_dialog, *setup_vbox, *hbox, *button, *notebook; + GtkWidget *setup_dialog, *setup_vbox, *hbox, *button_box, *button, *notebook; char buf[64]; DBG(DBG_proc, "xsane_setup_dialog\n"); @@ -3913,18 +3872,22 @@ void xsane_setup_dialog(GtkWidget *widget, gpointer data) /* set the main hbox */ hbox = gtk_hbox_new(FALSE, 0); - xsane_separator_new(setup_vbox, 2); - gtk_box_pack_end(GTK_BOX(setup_vbox), hbox, FALSE, FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 5); + gtk_box_pack_end(GTK_BOX(setup_vbox), hbox, FALSE, FALSE, 4); + gtk_container_set_border_width(GTK_CONTAINER(hbox), 4); gtk_widget_show(hbox); + button_box = gtk_hbox_new(TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button_box, FALSE, FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(button_box), 0); + gtk_widget_show(button_box); + #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); #else button = gtk_button_new_with_label(BUTTON_CANCEL); #endif g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_close_setup_dialog_callback, setup_dialog); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(button_box), button, TRUE, TRUE, 8); gtk_widget_show(button); #ifdef HAVE_GTK2 @@ -3934,7 +3897,7 @@ void xsane_setup_dialog(GtkWidget *widget, gpointer data) #endif GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_options_ok_callback, setup_dialog); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(button_box), button, TRUE, TRUE, 0); gtk_widget_grab_default(button); gtk_widget_show(button); diff --git a/src/xsane-text.h b/src/xsane-text.h index 59c6317..6cf74d8 100644 --- a/src/xsane-text.h +++ b/src/xsane-text.h @@ -48,7 +48,7 @@ #define WINDOW_FAX_PROJECT _("fax project") #define WINDOW_FAX_PROJECT_BROWSE _("browse for fax project") #define WINDOW_FAX_RENAME _("rename fax page") -#define WINDOW_FAX_INSERT _("insert ps-file into fax") +#define WINDOW_FAX_INSERT _("insert PS-file into fax") #define WINDOW_EMAIL_PROJECT _("E-mail project") #define WINDOW_EMAIL_PROJECT_BROWSE _("browse for email project") #define WINDOW_EMAIL_RENAME _("rename e-mail image") @@ -161,22 +161,21 @@ #define RADIO_BUTTON_SAVE_DEVPREFS_AT_EXIT _("Save device preferences at exit") #define RADIO_BUTTON_OVERWRITE_WARNING _("Overwrite warning") #define RADIO_BUTTON_SKIP_EXISTING_NRS _("Skip existing filenames") -#define RADIO_BUTTON_SAVE_PS_FLATEDECODED _("Save postscript zlib compressed (ps level 3)") +#define RADIO_BUTTON_SAVE_PS_FLATEDECODED _("Save postscript zlib compressed (PS level 3)") #define RADIO_BUTTON_SAVE_PDF_FLATEDECODED _("Save PDF zlib compressed") -#define RADIO_BUTTON_SAVE_PNM16_AS_ASCII _("Save 16bit pnm in ascii format") +#define RADIO_BUTTON_SAVE_PNM16_AS_ASCII _("Save 16bit PNM in ASCII format") #define RADIO_BUTTON_REDUCE_16BIT_TO_8BIT _("Reduce 16 bit image to 8 bit") #define RADIO_BUTTON_WINDOW_FIXED _("Main window size fixed") #define RADIO_BUTTON_DISABLE_GIMP_PREVIEW_GAMMA _("Disable GIMP preview gamma") #define RADIO_BUTTON_PRIVATE_COLORMAP _("Use private colormap") #define RADIO_BUTTON_AUTOENHANCE_GAMMA _("Autoenhance gamma") -#define RADIO_BUTTON_PRESELECT_SCANAREA _("Preselect scanarea") +#define RADIO_BUTTON_PRESELECT_SCAN_AREA _("Preselect scan area") #define RADIO_BUTTON_AUTOCORRECT_COLORS _("Autocorrect colors") #define RADIO_BUTTON_OCR_USE_GUI_PIPE _("Use GUI progress pipe") #define RADIO_BUTTON_CMS_BPC _("Black point compensation") #define TEXT_SCANNING_DEVICES _("scanning for devices") #define TEXT_AVAILABLE_DEVICES _("Available devices:") -#define TEXT_XSANE_OPTIONS _("XSane options") #define TEXT_FILETYPE _("Type") #define TEXT_CMS_FUNCTION _("Color management function") #define TEXT_SCANNER_BACKEND _("Scanner and backend:") @@ -274,21 +273,24 @@ #define TEXT_SETUP_PRINTER_NAME _("Name:") #define TEXT_SETUP_PRINTER_CMD _("Command:") #define TEXT_SETUP_COPY_NR_OPT _("Copy number option:") -#define TEXT_SETUP_PRINTER_LINEART_RES _("Lineart resolution (dpi):") -#define TEXT_SETUP_PRINTER_GRAYSCALE_RES _("Grayscale resolution (dpi):") -#define TEXT_SETUP_PRINTER_COLOR_RES _("Color resolution (dpi):") -#define TEXT_SETUP_PRINTER_WIDTH _("Width") -#define TEXT_SETUP_PRINTER_HEIGHT _("Height") -#define TEXT_SETUP_PRINTER_LEFT _("Left offset") -#define TEXT_SETUP_PRINTER_BOTTOM _("Bottom offset") -#define TEXT_SETUP_PRINTER_GAMMA _("Printer gamma value:") -#define TEXT_SETUP_PRINTER_GAMMA_RED _("Printer gamma red:") -#define TEXT_SETUP_PRINTER_GAMMA_GREEN _("Printer gamma green:") -#define TEXT_SETUP_PRINTER_GAMMA_BLUE _("Printer gamma blue:") +#define TEXT_SETUP_SCAN_RESOLUTION_PRINTER _("Scan resolution:") +#define TEXT_SETUP_PRINTER_LINEART_RES _("lineart [dpi]") +#define TEXT_SETUP_PRINTER_GRAYSCALE_RES _("grayscale [dpi]") +#define TEXT_SETUP_PRINTER_COLOR_RES _("color [dpi]") +#define TEXT_SETUP_PRINTER_PAPER_GEOMETRIE _("Paper geometrie:") +#define TEXT_SETUP_PRINTER_WIDTH _("width") +#define TEXT_SETUP_PRINTER_HEIGHT _("height") +#define TEXT_SETUP_PRINTER_LEFT _("left offset") +#define TEXT_SETUP_PRINTER_BOTTOM _("bottom offset") +#define TEXT_SETUP_PRINTER_GAMMA_CORRECTION _("Printer gamma:") +#define TEXT_SETUP_PRINTER_GAMMA _("common value") +#define TEXT_SETUP_PRINTER_GAMMA_RED _("red") +#define TEXT_SETUP_PRINTER_GAMMA_GREEN _("green") +#define TEXT_SETUP_PRINTER_GAMMA_BLUE _("blue") #define TEXT_SETUP_PRINTER_EMBED_CSA _("Embed scanner ICM profile as CSA") #define TEXT_SETUP_PRINTER_EMBED_CRD _("Embed printer ICM profile as CRD") #define TEXT_SETUP_PRINTER_CMS_BPC _("Apply black point compensation") -#define TEXT_SETUP_PRINTER_PS_FLATEDECODED _("Create zlib compressed postscript image (ps level 3) for printing") +#define TEXT_SETUP_PRINTER_PS_FLATEDECODED _("Create zlib compressed postscript image (PS level 3) for printing") #define TEXT_SETUP_TMP_PATH _("Temporary directory") #define TEXT_SETUP_IMAGE_PERMISSION _("Image-file permissions") #define TEXT_SETUP_DIR_PERMISSION _("Directory permissions") @@ -324,7 +326,7 @@ #define TEXT_SETUP_FAX_HEIGHT _("Height") #define TEXT_SETUP_FAX_LEFT _("Left offset") #define TEXT_SETUP_FAX_BOTTOM _("Bottom offset") -#define TEXT_SETUP_FAX_PS_FLATEDECODED _("Create zlib compressed postscript image (ps level 3) for fax") +#define TEXT_SETUP_FAX_PS_FLATEDECODED _("Create zlib compressed postscript image (PS level 3) for fax") #define TEXT_SETUP_SMTP_SERVER _("SMTP server:") #define TEXT_SETUP_SMTP_PORT _("SMTP port:") #define TEXT_SETUP_EMAIL_FROM _("From:") @@ -426,8 +428,8 @@ #define MENU_ITEM_COUNTER_LEN_INACTIVE _("inactive") #define MENU_ITEM_TIFF_COMP_NONE _("no compression") #define MENU_ITEM_TIFF_COMP_CCITTRLE _("CCITT 1D Huffman compression") -#define MENU_ITEM_TIFF_COMP_CCITFAX3 _("CCITT Group 3 Fax compression") -#define MENU_ITEM_TIFF_COMP_CCITFAX4 _("CCITT Group 4 Fax compression") +#define MENU_ITEM_TIFF_COMP_CCITFAX3 _("CCITT Group 3 fax compression") +#define MENU_ITEM_TIFF_COMP_CCITFAX4 _("CCITT Group 4 fax compression") #define MENU_ITEM_TIFF_COMP_JPEG _("JPEG DCT compression") #define MENU_ITEM_TIFF_COMP_PACKBITS _("pack bits") #define MENU_ITEM_TIFF_COMP_DEFLATE _("deflate") @@ -467,7 +469,7 @@ #define PROGRESS_RECEIVING_FRAME_DATA _("Receiving %s data") #define PROGRESS_PAGE _("page") -#define PROGRESS_TRANSFERING_DATA _("Transfering image") +#define PROGRESS_TRANSFERRING_DATA _("Transferring image") #define PROGRESS_ROTATING_DATA _("Rotating image") #define PROGRESS_MIRRORING_DATA _("Mirroring image") #define PROGRESS_PACKING_DATA _("Packing image") @@ -487,7 +489,7 @@ #define DESC_XSANE_MODE _("viewer-<Ctrl-v>, save-<Ctrl-s>, photocopy-<Ctrl-c>, " \ "multipage-<Ctrl-m>, fax-<Ctrl-f> or e-mail-<Ctrl-e>") #define DESC_XSANE_MEDIUM _("Select source medium type.\n" \ - "To rename, reorder or delete an entry use context menu (right mouse button).\n"\ + "To rename, reorder or delete an entry use context menu (alternate mouse button).\n"\ "To create a medium enable the option edit medium definition in preferences menu.") #define DESC_FILENAME_COUNTER_STEP _("Value that is added to filenamecounter after scan") @@ -584,22 +586,22 @@ "The printer has to understand postscript level 3!") #define DESC_TMP_PATH _("Path to temp directory") #define DESC_BUTTON_TMP_PATH_BROWSE _("Browse for temporary directory") -#define DESC_JPEG_QUALITY _("Quality in percent if image is saved as jpeg or tiff with jpeg compression") -#define DESC_PNG_COMPRESSION _("Compression if image is saved as png") +#define DESC_JPEG_QUALITY _("Quality in percent if image is saved as JPEG or TIFF with JPEG compression") +#define DESC_PNG_COMPRESSION _("Compression if image is saved as PNG") #define DESC_FILENAME_COUNTER_LEN _("Minimum length of counter in filename") -#define DESC_TIFF_ZIP_COMPRESSION _("Compression rate for zip compressed tiff (deflate)") -#define DESC_TIFF_COMPRESSION_16 _("Compression type if 16 bit image is saved as tiff") -#define DESC_TIFF_COMPRESSION_8 _("Compression type if 8 bit image is saved as tiff") -#define DESC_TIFF_COMPRESSION_1 _("Compression type if lineart image is saved as tiff") +#define DESC_TIFF_ZIP_COMPRESSION _("Compression rate for zip compressed TIFF (deflate)") +#define DESC_TIFF_COMPRESSION_16 _("Compression type if 16 bit image is saved as TIFF") +#define DESC_TIFF_COMPRESSION_8 _("Compression type if 8 bit image is saved as TIFF") +#define DESC_TIFF_COMPRESSION_1 _("Compression type if lineart image is saved as TIFF") #define DESC_SAVE_DEVPREFS_AT_EXIT _("Save device dependant preferences in default file at exit of xsane") #define DESC_OVERWRITE_WARNING _("Warn before overwriting an existing file") #define DESC_SKIP_EXISTING _("If filename counter is automatically increased, used numbers are skipped") #define DESC_SAVE_PS_FLATEDECODED _("compress postscript image with zlib algorithm (flatedecode). " \ "When you want to print such a file your printer has to understand postscript level 3") #define DESC_SAVE_PDF_FLATEDECODED _("compress PDF image with zlib algorithm (flatedecode).") -#define DESC_SAVE_PNM16_AS_ASCII _("When a 16 bit image shall be saved in pnm format then use ascii format " \ +#define DESC_SAVE_PNM16_AS_ASCII _("When a 16 bit image shall be saved in PNM format then use ASCII format " \ "instead of binary format. The binary format is a new format that is not " \ - "supported by all programs. The ascii format is supported by more programs " \ + "supported by all programs. The ASCII format is supported by more programs " \ "but it produces really huge files!!!") #define DESC_REDUCE_16BIT_TO_8BIT _("If scanner sends image with 16 bits/channel save image with 8 bits/channel") #define DESC_PSFILE_WIDTH _("Width of paper for postscript files") @@ -610,7 +612,7 @@ #define DESC_DISABLE_GIMP_PREVIEW_GAMMA _("Disable preview gamma when XSane runs as GIMP plugin") #define DESC_PREVIEW_COLORMAP _("Use an own colormap for preview if display depth is 8 bpp") #define DESC_SHOW_RANGE_MODE _("Select how a range is displayed") -#define DESC_PREVIEW_OVERSAMPLING _("Value with that the calculated preview resolution is multiplied") +#define DESC_PREVIEW_OVERSAMPLING _("Value with which the calculated preview resolution is multiplied") #define DESC_PREVIEW_GAMMA _("Set gamma correction value for preview image") #define DESC_PREVIEW_GAMMA_RED _("Set gamma correction value for red component of preview image") #define DESC_PREVIEW_GAMMA_GREEN _("Set gamma correction value for green component of preview image") @@ -625,9 +627,9 @@ #define DESC_PREVIEW_THRESHOLD_OFF _("Offset to make XSane threshold range and scanner threshold range the same") #define DESC_ADF_PAGES_MAX _("Number of pages to scan") #define DESC_PREVIEW_PIPETTE_RANGE _("dimension of square that is used to average color for pipette function") -#define DESC_DOC_VIEWER _("Enter command to be executed to display helpfiles, must be a html-viewer!") +#define DESC_DOC_VIEWER _("Enter command to be executed to display helpfiles, must be a HTML-viewer!") #define DESC_AUTOENHANCE_GAMMA _("Change gamma value when autoenhancement button is pressed") -#define DESC_PRESELECT_SCANAREA _("Select scanarea after preview scan has finished") +#define DESC_PRESELECT_SCAN_AREA _("Select scan area after preview scan has finished") #define DESC_AUTOCORRECT_COLORS _("Do color correction after preview scan has finished") #define DESC_RENDERING_INTENT _("Select rendering intent for preview and saving") @@ -654,12 +656,12 @@ #define DESC_EMAIL_AUTH_PASS _("password for e-mail server") #define DESC_POP3_SERVER _("IP Address or Domain name of POP3 server") #define DESC_POP3_PORT _("port to connect to POP3 server") -#define DESC_HTML_EMAIL _("E-mail is sent in html mode, place image with: <IMAGE>") -#define DESC_OCR_COMMAND _("Enter command to start ocr program") -#define DESC_OCR_INPUTFILE_OPT _("Enter option of the ocr program to define input file") -#define DESC_OCR_OUTPUTFILE_OPT _("Enter option of the ocr program to define output file") -#define DESC_OCR_USE_GUI_PIPE_OPT _("Define if the ocr program supports gui progress pipe") -#define DESC_OCR_OUTFD_OPT _("Enter option of the ocr program to define output filedescripor in GUI mode") +#define DESC_HTML_EMAIL _("E-mail is sent in HTML mode, place image with: <IMAGE>") +#define DESC_OCR_COMMAND _("Enter command to start OCR program") +#define DESC_OCR_INPUTFILE_OPT _("Enter option of the OCR program to define input file") +#define DESC_OCR_OUTPUTFILE_OPT _("Enter option of the OCR program to define output file") +#define DESC_OCR_USE_GUI_PIPE_OPT _("Define if the OCR program supports gui progress pipe") +#define DESC_OCR_OUTFD_OPT _("Enter option of the OCR program to define output filedescripor in GUI mode") #define DESC_OCR_PROGRESS_KEYWORD _("Define Keyword that is used to mark progress information") #define DESC_PERMISSION_READ _("read") @@ -671,19 +673,19 @@ #define DESC_PIPETTE_GRAY _("Pick gray point") #define DESC_PIPETTE_BLACK _("Pick black point") -#define DESC_ZOOM_FULL _("Use full scanarea") +#define DESC_ZOOM_FULL _("Use full scan area") #define DESC_ZOOM_OUT _("Zoom 20% out") #define DESC_ZOOM_IN _("Click at position to zoom to") #define DESC_ZOOM_AREA _("Zoom into selected area") #define DESC_ZOOM_UNDO _("Undo last zoom") #define DESC_FULL_PREVIEW_AREA _("Select visible area") -#define DESC_AUTOSELECT_SCANAREA _("Autoselect scanarea") -#define DESC_AUTORAISE_SCANAREA _("Autoraise scanarea") +#define DESC_AUTOSELECT_SCAN_AREA _("Autoselect scan area") +#define DESC_AUTORAISE_SCAN_AREA _("Autoraise scan area") #define DESC_DELETE_IMAGES _("Delete preview image cache") #define DESC_PRESET_AREA _("Preset area:\n" \ - "To add new area or edit an existing area use contect menu (right mouse button).") + "To add new area or edit an existing area use context menu (alternate mouse button).") #define DESC_ROTATION _("Rotate preview and scan") #define DESC_RATIO _("Aspect ratio of selection") #define DESC_PAPER_ORIENTATION _("Define image position for printing") @@ -695,9 +697,9 @@ #define DESC_VIEWER_SCALE _("Scale image") #define DESC_VIEWER_DESPECKLE _("Despeckle image") #define DESC_VIEWER_BLUR _("Blur image") -#define DESC_ROTATE90 _("Rotate image 90 degree") -#define DESC_ROTATE180 _("Rotate image 180 degree") -#define DESC_ROTATE270 _("Rotate image 270 degree") +#define DESC_ROTATE90 _("Rotate image 90 degrees") +#define DESC_ROTATE180 _("Rotate image 180 degrees") +#define DESC_ROTATE270 _("Rotate image 270 degrees") #define DESC_MIRROR_X _("Mirror image at vertical axis") #define DESC_MIRROR_Y _("Mirror image at horizontal axis") #define DESC_VIEWER_ZOOM _("Zoom image") @@ -706,8 +708,8 @@ #define DESC_SCALE_FACTOR _("Scale factor") #define DESC_X_SCALE_FACTOR _("X-Scale factor") #define DESC_Y_SCALE_FACTOR _("Y-Scale factor") -#define DESC_SCALE_WIDTH _("Scale image to width [in pixel]") -#define DESC_SCALE_HEIGHT _("Scale image to height [in pixel]") +#define DESC_SCALE_WIDTH _("Scale image to width [pixels]") +#define DESC_SCALE_HEIGHT _("Scale image to height [pixels]") #define DESC_BATCH_LIST_EMPTY _("Empty batch list") #define DESC_BATCH_LIST_SAVE _("Save batch list") #define DESC_BATCH_LIST_LOAD _("Load batch list") @@ -748,7 +750,7 @@ write permissions." ) #define ERR_BAD_DEPTH _("Can't handle depth") #define ERR_UNKNOWN_SAVING_FORMAT _("Unknown file format for saving") #define ERR_OPEN_FAILED _("Failed to open") -#define ERR_CREATE_SECURE_FILE _("Could not create secure file (may be a link does exist):") +#define ERR_CREATE_SECURE_FILE _("Could not create secure file (maybe a link does exist):") #define ERR_FAILED_PRINTER_PIPE _("Failed to open pipe for executing printercommand") #define ERR_FAILED_EXEC_PRINTER_CMD _("Failed to execute printercommand:") #define ERR_FAILED_START_SCANNER _("Failed to start scanner:") @@ -767,7 +769,7 @@ write permissions." ) #define ERR_FAILED_EXEC_DOC_VIEWER _("Failed to execute documentation viewer:") #define ERR_FAILED_EXEC_FAX_VIEWER _("Failed to execute fax viewer:") #define ERR_FAILED_EXEC_FAX_CMD _("Failed to execute fax command:") -#define ERR_FAILED_EXEC_OCR_CMD _("Failed to execute ocr command:") +#define ERR_FAILED_EXEC_OCR_CMD _("Failed to execute OCR command:") #define ERR_BAD_FRAME_FORMAT _("bad frame format") #define ERR_FAILED_SET_RESOLUTION _("unable to set resolution") #define ERR_PASSWORD_FILE_INSECURE _("Password file (%s) is insecure, use permission x00\n") @@ -788,7 +790,7 @@ write permissions." ) #define WARN_NO_VALUE_CONSTRAINT _("warning: option has no value constraint") #define WARN_XSANE_AS_ROOT _("You try to run XSane as ROOT, that really is DANGEROUS!\n\n\ Do not send any bug reports when you\n\ -have any problem while running XSane as root:\n\ +have any problems while running XSane as root:\n\ YOU ARE ALONE!\ ") @@ -877,7 +879,7 @@ The format of [DEVICE] is backendname:devicefile (e.g. umax:/dev/scanner).\n\ "2) Supported devices are busy\n" \ "3) The permissions for the device file do not allow you to use it - try as root\n" \ "4) The backend is not loaded by SANE (man sane-dll)\n" \ - "5) The backend is not configured correct (man sane-\"backendname\")\n" \ + "5) The backend is not configured correctly (man sane-\"backendname\")\n" \ "6) Possibly there is more than one SANE version installed" ) /* strings that are used in structures, so it is not allowed to use _()/gettext() here */ @@ -933,7 +935,7 @@ The format of [DEVICE] is backendname:devicefile (e.g. umax:/dev/scanner).\n\ #define TEXT_EMAIL_STATUS_SENDING N_("Sending e-mail") #define TEXT_EMAIL_STATUS_SENT N_("E-mail has been sent") -#define TEXT_FAX_STATUS_QUEUEING_FAX N_("Queueing Fax") +#define TEXT_FAX_STATUS_QUEUEING_FAX N_("Queueing fax") #define TEXT_FAX_STATUS_FAX_QUEUED N_("Fax is queued") #endif diff --git a/src/xsane-viewer.c b/src/xsane-viewer.c index ef47529..57abd98 100644 --- a/src/xsane-viewer.c +++ b/src/xsane-viewer.c @@ -1095,7 +1095,7 @@ static void xsane_viewer_scale_image(GtkWidget *window, gpointer data) gtk_progress_set_format_string(GTK_PROGRESS(v->progress_bar), PROGRESS_SCALING_DATA); - gtk_progress_bar_update(GTK_PROGRESS_BAR(v->progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(v->progress_bar), 0.0); if (v->bind_scale) { @@ -1108,7 +1108,7 @@ static void xsane_viewer_scale_image(GtkWidget *window, gpointer data) fclose(outfile); gtk_progress_set_format_string(GTK_PROGRESS(v->progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(v->progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(v->progress_bar), 0.0); if (v->undo_filename) { @@ -1177,7 +1177,7 @@ static void xsane_viewer_despeckle_image(GtkWidget *window, gpointer data) gtk_progress_set_format_string(GTK_PROGRESS(v->progress_bar), PROGRESS_DESPECKLING_DATA); - gtk_progress_bar_update(GTK_PROGRESS_BAR(v->progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(v->progress_bar), 0.0); xsane_save_despeckle_image(outfile, infile, &image_info, v->despeckle_radius, v->progress_bar, &v->cancel_save); @@ -1185,7 +1185,7 @@ static void xsane_viewer_despeckle_image(GtkWidget *window, gpointer data) fclose(outfile); gtk_progress_set_format_string(GTK_PROGRESS(v->progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(v->progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(v->progress_bar), 0.0); if (v->undo_filename) { @@ -1254,7 +1254,7 @@ static void xsane_viewer_blur_image(GtkWidget *window, gpointer data) gtk_progress_set_format_string(GTK_PROGRESS(v->progress_bar), PROGRESS_BLURING_DATA); - gtk_progress_bar_update(GTK_PROGRESS_BAR(v->progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(v->progress_bar), 0.0); xsane_save_blur_image(outfile, infile, &image_info, v->blur_radius, v->progress_bar, &v->cancel_save); @@ -1262,7 +1262,7 @@ static void xsane_viewer_blur_image(GtkWidget *window, gpointer data) fclose(outfile); gtk_progress_set_format_string(GTK_PROGRESS(v->progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(v->progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(v->progress_bar), 0.0); if (v->undo_filename) { @@ -1344,7 +1344,7 @@ static void xsane_viewer_rotate(Viewer *v, int rotation) gtk_progress_set_format_string(GTK_PROGRESS(v->progress_bar), PROGRESS_MIRRORING_DATA); } - gtk_progress_bar_update(GTK_PROGRESS_BAR(v->progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(v->progress_bar), 0.0); xsane_save_rotate_image(outfile, infile, &image_info, rotation, v->progress_bar, &v->cancel_save); @@ -1352,7 +1352,7 @@ static void xsane_viewer_rotate(Viewer *v, int rotation) fclose(outfile); gtk_progress_set_format_string(GTK_PROGRESS(v->progress_bar), ""); - gtk_progress_bar_update(GTK_PROGRESS_BAR(v->progress_bar), 0.0); + xsane_progress_bar_set_fraction(GTK_PROGRESS_BAR(v->progress_bar), 0.0); if (v->undo_filename) { @@ -2864,7 +2864,7 @@ Viewer *xsane_viewer_new(char *filename, char *selection_filetype, int allow_red snprintf(buf, sizeof(buf), "%s %s", WINDOW_VIEWER, xsane.device_text); } - xsane_viewer_read_image_header(v); // xxx oli + xsane_viewer_read_image_header(v); v->top = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(v->top), buf); diff --git a/src/xsane.c b/src/xsane.c index 38ee7d1..7c5c5fa 100644 --- a/src/xsane.c +++ b/src/xsane.c @@ -1181,7 +1181,6 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ GtkWidget *xsane_vbox_xsane_modus; GtkWidget *xsane_spinbutton; GtkWidget *xsane_hbox_xsane_enhancement; - GtkWidget *xsane_frame; GtkWidget *xsane_medium_option_menu, *xsane_medium_menu, *xsane_medium_item; GtkWidget *button; GtkWidget *pixmapwidget; @@ -1202,49 +1201,38 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ /* gtk_box_pack_start(GTK_BOX(xsane_hbox), xsane_vbox, FALSE, FALSE, 0); */ /* make scales fixed */ gtk_box_pack_start(GTK_BOX(xsane_hbox), xsane_vbox, TRUE, TRUE, 0); /* make scales sizeable */ - /* XSane Frame */ - - xsane_frame = gtk_frame_new(TEXT_XSANE_OPTIONS); - gtk_container_set_border_width(GTK_CONTAINER(xsane_frame), 4); - gtk_frame_set_shadow_type(GTK_FRAME(xsane_frame), GTK_SHADOW_ETCHED_IN); -/* gtk_box_pack_start(GTK_BOX(xsane_vbox), xsane_frame, FALSE, FALSE, 0); */ /* fixed frameheight */ - gtk_box_pack_start(GTK_BOX(xsane_vbox), xsane_frame, TRUE, TRUE, 0); /* sizeable framehight */ - gtk_widget_show(xsane_frame); - - xsane_vbox_xsane_modus = gtk_vbox_new(FALSE, 1); - gtk_container_add(GTK_CONTAINER(xsane_frame), xsane_vbox_xsane_modus); + xsane_vbox_xsane_modus = gtk_vbox_new(FALSE, 2); + gtk_box_pack_start(GTK_BOX(xsane_vbox), xsane_vbox_xsane_modus, TRUE, TRUE, 0); /* sizeable framehight */ gtk_widget_show(xsane_vbox_xsane_modus); -/* scan copy fax selection */ + /* ADF pages selection */ + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 2); + gtk_widget_show(hbox); + + pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) adf_xpm); + pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); + gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2); + gdk_drawable_unref(pixmap); + gtk_widget_show(pixmapwidget); + /* adf pages maximum */ + adjustment = gtk_adjustment_new(preferences.adf_pages_max, 1, 9999, 1, 10, 1); + xsane_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(adjustment), 0, 0); + gtk_widget_set_size_request(xsane_spinbutton, 55, -1); + gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(xsane_spinbutton), FALSE); + xsane_back_gtk_set_tooltip(xsane.tooltips, xsane_spinbutton, DESC_ADF_PAGES_MAX); + g_signal_connect(GTK_OBJECT(xsane_spinbutton), "changed", (GtkSignalFunc) xsane_adf_pages_max_callback, NULL); + xsane.adf_pages_max_entry = xsane_spinbutton; + gtk_box_pack_start(GTK_BOX(hbox), xsane_spinbutton, FALSE, FALSE, 5); + gtk_widget_show(xsane_spinbutton); + + /* scan copy fax selection, in hbox of ADF pages */ if ( (xsane.mode == XSANE_STANDALONE) && (xsane.mode_selection) ) /* display xsane mode selection menu */ { - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); - gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 1); - - pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) adf_xpm); - pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); - gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2); - gdk_drawable_unref(pixmap); - gtk_widget_show(pixmapwidget); - - /* adf pages maximum */ - adjustment = gtk_adjustment_new(preferences.adf_pages_max, 1, 9999, 1, 10, 1); - xsane_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(adjustment), 0, 0); - gtk_widget_set_size_request(xsane_spinbutton, 55, -1); - gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(xsane_spinbutton), FALSE); - xsane_back_gtk_set_tooltip(xsane.tooltips, xsane_spinbutton, DESC_ADF_PAGES_MAX); - g_signal_connect(GTK_OBJECT(xsane_spinbutton), "changed", (GtkSignalFunc) xsane_adf_pages_max_callback, NULL); - xsane.adf_pages_max_entry = xsane_spinbutton; - gtk_box_pack_start(GTK_BOX(hbox), xsane_spinbutton, FALSE, FALSE, 10); - gtk_widget_show(xsane_spinbutton); - - xsane_modus_menu = gtk_menu_new(); gtk_menu_set_accel_group(GTK_MENU(xsane_modus_menu), xsane.accelerator_group); - xsane_modus_item = gtk_menu_item_new_with_label(MENU_ITEM_VIEWER); gtk_widget_add_accelerator(xsane_modus_item, "activate", xsane.accelerator_group, GDK_V, GDK_CONTROL_MASK, DEF_GTK_MENU_ACCEL_VISIBLE | DEF_GTK_ACCEL_LOCKED); gtk_widget_set_size_request(xsane_modus_item, 60, -1); @@ -1286,7 +1274,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ xsane_modus_option_menu = gtk_option_menu_new(); xsane_back_gtk_set_tooltip(xsane.tooltips, xsane_modus_option_menu, DESC_XSANE_MODE); - gtk_box_pack_end(GTK_BOX(hbox), xsane_modus_option_menu, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(hbox), xsane_modus_option_menu, FALSE, FALSE, 5); gtk_option_menu_set_menu(GTK_OPTION_MENU(xsane_modus_option_menu), xsane_modus_menu); gtk_option_menu_set_history(GTK_OPTION_MENU(xsane_modus_option_menu), xsane.xsane_mode); gtk_widget_show(xsane_modus_option_menu); @@ -1297,8 +1285,6 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ gdk_drawable_unref(pixmap); gtk_widget_show(pixmapwidget); - gtk_widget_show(hbox); - xsane.xsanemode_widget = xsane_modus_option_menu; } @@ -1317,8 +1303,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ GtkWidget *xsane_printer_option_menu, *xsane_printer_menu, *xsane_printer_item; GtkWidget *paper_orientation_option_menu, *paper_orientation_menu, *paper_orientation_item; - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); + hbox = gtk_hbox_new(FALSE, 5); gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 2); pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) printer_xpm); @@ -1328,6 +1313,17 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ gtk_widget_show(pixmapwidget); + /* number of copies */ + adjustment = gtk_adjustment_new(xsane.copy_number, 1, 99, 1, 10, 1); + xsane_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(adjustment), 0, 0); + gtk_widget_set_size_request(xsane_spinbutton, 40, -1); + gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(xsane_spinbutton), FALSE); + xsane_back_gtk_set_tooltip(xsane.tooltips, xsane_spinbutton, DESC_COPY_NUMBER); + xsane.copy_number_entry = xsane_spinbutton; + gtk_box_pack_start(GTK_BOX(hbox), xsane_spinbutton, FALSE, FALSE, 5); + gtk_widget_show(xsane_spinbutton); + + /* printer position */ paper_orientation_menu = gtk_menu_new(); @@ -1402,7 +1398,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ paper_orientation_option_menu = gtk_option_menu_new(); xsane_back_gtk_set_tooltip(xsane.tooltips, paper_orientation_option_menu, DESC_PAPER_ORIENTATION); - gtk_box_pack_end(GTK_BOX(hbox), paper_orientation_option_menu, FALSE, FALSE, 0); + gtk_box_pack_end(GTK_BOX(hbox), paper_orientation_option_menu, FALSE, FALSE, 5); gtk_option_menu_set_menu(GTK_OPTION_MENU(paper_orientation_option_menu), paper_orientation_menu); /* set default selection */ @@ -1441,16 +1437,6 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ gtk_option_menu_set_menu(GTK_OPTION_MENU(xsane_printer_option_menu), xsane_printer_menu); gtk_option_menu_set_history(GTK_OPTION_MENU(xsane_printer_option_menu), preferences.printernr); - - /* number of copies */ - adjustment = gtk_adjustment_new(xsane.copy_number, 1, 99, 1, 10, 1); - xsane_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(adjustment), 0, 0); - gtk_widget_set_size_request(xsane_spinbutton, 40, -1); - gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(xsane_spinbutton), FALSE); - xsane_back_gtk_set_tooltip(xsane.tooltips, xsane_spinbutton, DESC_COPY_NUMBER); - xsane.copy_number_entry = xsane_spinbutton; - gtk_box_pack_start(GTK_BOX(hbox), xsane_spinbutton, FALSE, FALSE, 10); - gtk_widget_show(xsane_spinbutton); } #ifdef HAVE_LIBLCMS @@ -1462,9 +1448,8 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ ) ) { - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); - gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 1); + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 2); gtk_widget_show(hbox); pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) cms_xpm); @@ -1474,7 +1459,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ gtk_widget_show(pixmapwidget); xsane.cms_function_option_menu = xsane_back_gtk_cms_function_menu_new(preferences.cms_function, (GtkSignalFunc) xsane_cms_function_menu_callback); - gtk_box_pack_end(GTK_BOX(hbox), xsane.cms_function_option_menu, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(hbox), xsane.cms_function_option_menu, TRUE, TRUE, 5); gtk_widget_show(xsane.cms_function_option_menu); } #endif @@ -1485,9 +1470,8 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ { if (SANE_OPTION_IS_ACTIVE(opt->cap)) { - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); - gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 1); + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 2); pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) scanner_xpm); pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); @@ -1525,9 +1509,8 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ { if (SANE_OPTION_IS_ACTIVE(opt->cap)) { - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); - gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 1); + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 2); pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) colormode_xpm); pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); @@ -1564,9 +1547,8 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ if ((xsane.param.depth != 1) && (!xsane.enable_color_management)) { /* medium selection */ - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 2); - gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 1); + hbox = gtk_hbox_new(FALSE, 5); + gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 2); if (xsane.medium_calibration) { @@ -1598,7 +1580,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ xsane_medium_option_menu = gtk_option_menu_new(); xsane_back_gtk_set_tooltip(xsane.tooltips, xsane_medium_option_menu, DESC_XSANE_MEDIUM); - gtk_box_pack_end(GTK_BOX(hbox), xsane_medium_option_menu, FALSE, FALSE, 2); + gtk_box_pack_end(GTK_BOX(hbox), xsane_medium_option_menu, TRUE, TRUE, 5); gtk_option_menu_set_menu(GTK_OPTION_MENU(xsane_medium_option_menu), xsane_medium_menu); gtk_option_menu_set_history(GTK_OPTION_MENU(xsane_medium_option_menu), preferences.medium_nr); gtk_widget_show(xsane_medium_option_menu); @@ -1841,12 +1823,10 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */ &xsane.contrast_blue, &xsane.contrast_blue_widget, 0, xsane_gamma_changed, TRUE); } - xsane_separator_new(xsane_vbox_xsane_modus, 2); /* create lower button box (rgb default, negative ,... */ - xsane_hbox_xsane_enhancement = gtk_hbox_new(TRUE, 4); - gtk_container_set_border_width(GTK_CONTAINER(xsane_hbox_xsane_enhancement), 4); - gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), xsane_hbox_xsane_enhancement, FALSE, FALSE, 0); + xsane_hbox_xsane_enhancement = gtk_hbox_new(TRUE, 0); + gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), xsane_hbox_xsane_enhancement, FALSE, FALSE, 3); gtk_widget_show(xsane_hbox_xsane_enhancement); if (xsane.xsane_channels > 1) @@ -1899,7 +1879,7 @@ void xsane_pref_save(void) /* first save xsane-specific preferences: */ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", NULL, NULL, xsane.xsane_rc_set_filename, ".rc", XSANE_PATH_LOCAL_SANE); -// xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", NULL, "xsane", NULL, ".rc", XSANE_PATH_LOCAL_SANE); +/* old version: xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", NULL, "xsane", NULL, ".rc", XSANE_PATH_LOCAL_SANE); */ DBG(DBG_info2, "saving preferences to \"%s\"\n", filename); @@ -1931,7 +1911,7 @@ static int xsane_pref_restore(void) DBG(DBG_proc, "xsane_pref_restore\n"); xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", NULL, NULL, xsane.xsane_rc_set_filename, ".rc", XSANE_PATH_LOCAL_SANE); -// xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", NULL, "xsane", NULL, ".rc", XSANE_PATH_LOCAL_SANE); +/* old version: xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", NULL, "xsane", NULL, ".rc", XSANE_PATH_LOCAL_SANE); */ fd = open(filename, O_RDONLY); if (fd >= 0) @@ -4886,7 +4866,7 @@ void xsane_panel_build() static void xsane_device_dialog(void) { - GtkWidget *vbox, *hbox, *button, *frame, *infobox; + GtkWidget *hbox, *button, *frame, *infobox, *table; GtkWidget *menubar, *menubar_item; GtkStyle *current_style; const gchar *devname; @@ -4906,7 +4886,6 @@ static void xsane_device_dialog(void) devname = xsane.devlist[xsane.selected_dev]->name; -/* status = sane_open(devname, (SANE_Handle *) &xsane.dev); // old version */ status = sane_open(devname, &sane_handle); xsane.dev = sane_handle; @@ -5080,7 +5059,7 @@ static void xsane_device_dialog(void) /* "Help" submenu: */ menubar_item = gtk_menu_item_new_with_label(MENU_HELP); gtk_container_add(GTK_CONTAINER(menubar), menubar_item); - gtk_menu_item_right_justify((GtkMenuItem *) menubar_item); + /* gtk_menu_item_right_justify((GtkMenuItem *) menubar_item); */ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar_item), xsane_help_build_menu()); /* gtk_widget_add_accelerator(menubar_item, "select", xsane.accelerator_group, GDK_H, 0, GTK_ACCEL_VISIBLE | DEF_GTK_ACCEL_LOCKED); */ gtk_widget_show(menubar_item); @@ -5246,55 +5225,50 @@ static void xsane_device_dialog(void) /* create batch_scan dialog */ xsane_create_batch_scan_dialog(xsane.device_text); - /* The bottom area: info frame, progress bar, start and cancel button */ - hbox = gtk_hbox_new(FALSE, 3); - gtk_box_pack_end(GTK_BOX(xsane_window), hbox, FALSE, FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 3); + + /* create the progress bar / info box, scan and cancel button */ + hbox = gtk_hbox_new(FALSE, 6); + gtk_box_pack_end(GTK_BOX(xsane_window), hbox, FALSE, FALSE, 8); gtk_widget_show(hbox); + table = gtk_table_new(2, 2, FALSE); + gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 8); + gtk_widget_show(table); - /* vertical box for info frame and progress bar */ - vbox = gtk_vbox_new(FALSE, 3); - gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 5); - gtk_widget_show(vbox); + gtk_table_set_row_spacings(GTK_TABLE(table), 6); + gtk_table_set_col_spacings(GTK_TABLE(table), 6); /* Info frame */ frame = gtk_frame_new(0); gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); - gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); gtk_widget_show(frame); - - infobox = gtk_hbox_new(FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(infobox), 4); + infobox = gtk_hbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), infobox); gtk_widget_show(infobox); - xsane.info_label = gtk_label_new(TEXT_INFO_BOX); - gtk_box_pack_start(GTK_BOX(infobox), xsane.info_label, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(infobox), xsane.info_label, TRUE, TRUE, 2); gtk_widget_show(xsane.info_label); + gtk_table_attach_defaults(GTK_TABLE(table), frame, 0, 1, 0, 1); + /* progress bar */ xsane.progress_bar = (GtkProgressBar *) gtk_progress_bar_new(); - gtk_box_pack_start(GTK_BOX(vbox), (GtkWidget *) xsane.progress_bar, TRUE, TRUE, 0); gtk_progress_set_show_text(GTK_PROGRESS(xsane.progress_bar), TRUE); gtk_progress_set_format_string(GTK_PROGRESS(xsane.progress_bar), ""); gtk_widget_show(GTK_WIDGET(xsane.progress_bar)); + gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(xsane.progress_bar), 0, 1, 1, 2); - /* vertical box for scan and cancel button */ - vbox = gtk_vbox_new(FALSE, 3); - gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); - gtk_widget_show(vbox); - /* The Scan button */ button = gtk_button_new_with_label(BUTTON_SCAN); xsane_back_gtk_set_tooltip(xsane.tooltips, button, DESC_SCAN_START); gtk_widget_add_accelerator(button, "clicked", xsane.accelerator_group, GDK_Return, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE | DEF_GTK_ACCEL_LOCKED); g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_scan_callback, NULL); - gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 0); gtk_widget_show(button); xsane.start_button = GTK_OBJECT(button); + gtk_table_attach_defaults(GTK_TABLE(table), button, 1, 2, 0, 1); + /* The Cancel button */ #ifdef HAVE_GTK2 @@ -5304,10 +5278,10 @@ static void xsane_device_dialog(void) #endif xsane_back_gtk_set_tooltip(xsane.tooltips, button, DESC_SCAN_CANCEL); gtk_widget_add_accelerator(button, "clicked", xsane.accelerator_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE | DEF_GTK_ACCEL_LOCKED); - gtk_box_pack_start(GTK_BOX(vbox), button, TRUE, TRUE, 0); gtk_widget_show(button); gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE); xsane.cancel_button = GTK_OBJECT(button); + gtk_table_attach_defaults(GTK_TABLE(table), button, 1, 2, 1, 2); /* create backend dependend options */ @@ -5415,7 +5389,7 @@ static int xsane_select_device_by_mouse_callback(GtkWidget * widget, GdkEventBut static void xsane_choose_device(void) { - GtkWidget *main_vbox, *vbox, *hbox, *button, *device_frame, *device_vbox, *pixmapwidget, *label; + GtkWidget *main_vbox, *vbox, *hbox, *button_box, *button, *device_frame, *device_vbox, *pixmapwidget, *label; GdkBitmap *mask = NULL; GdkPixmap *pixmap = NULL; GtkStyle *style; @@ -5462,13 +5436,13 @@ static void xsane_choose_device(void) device_selection_accelerator_group = gtk_accel_group_new(); /* do we have to delete it when dialog is closed ? */ gtk_window_add_accel_group(GTK_WINDOW(xsane.choose_device_dialog), device_selection_accelerator_group); - main_vbox = gtk_vbox_new(FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 0); + main_vbox = gtk_vbox_new(FALSE, 12); + gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 12); gtk_container_add(GTK_CONTAINER(xsane.choose_device_dialog), main_vbox); gtk_widget_show(main_vbox); - vbox = gtk_vbox_new(FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 3); + vbox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 0); gtk_box_pack_start(GTK_BOX(main_vbox), vbox, TRUE, TRUE, 0); gtk_widget_show(vbox); @@ -5481,7 +5455,7 @@ static void xsane_choose_device(void) xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, "xsane-logo", 0, ".xpm", XSANE_PATH_SYSTEM); pixmap = gdk_pixmap_create_from_xpm(xsane.choose_device_dialog->window, &mask, bg_trans, filename); pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); - gtk_box_pack_start(GTK_BOX(vbox), pixmapwidget, FALSE, FALSE, 2); + gtk_box_pack_start(GTK_BOX(vbox), pixmapwidget, FALSE, FALSE, 0); gtk_widget_show(pixmapwidget); gdk_drawable_unref(pixmap); @@ -5490,17 +5464,17 @@ static void xsane_choose_device(void) snprintf(buf, sizeof(buf), "%s %s\n", XSANE_COPYRIGHT_SIGN, XSANE_COPYRIGHT_TXT); label = gtk_label_new(buf); gtk_widget_show(label); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 2); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); /* list the drivers with radiobuttons */ device_frame = gtk_frame_new(TEXT_AVAILABLE_DEVICES); - gtk_container_set_border_width(GTK_CONTAINER(device_frame), 4); - gtk_box_pack_start(GTK_BOX(vbox), device_frame, FALSE, FALSE, 2); + gtk_container_set_border_width(GTK_CONTAINER(device_frame), 0); + gtk_box_pack_start(GTK_BOX(vbox), device_frame, FALSE, FALSE, 0); gtk_widget_show(device_frame); device_vbox = gtk_vbox_new(FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(device_vbox), 3); + gtk_container_set_border_width(GTK_CONTAINER(device_vbox), 6); gtk_container_add(GTK_CONTAINER(device_frame), device_vbox); owner = 0; @@ -5574,13 +5548,17 @@ static void xsane_choose_device(void) } gtk_widget_show(device_vbox); + /* The bottom row of buttons */ - hbox = gtk_hbox_new(FALSE, 5); - xsane_separator_new(main_vbox, 5); - gtk_box_pack_end(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 5); + hbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_end(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(hbox), 0); gtk_widget_show(hbox); + button_box = gtk_hbox_new(TRUE, 0); + gtk_box_pack_end(GTK_BOX(hbox), button_box, FALSE, FALSE, 0); + gtk_widget_show(button_box); + /* The Cancel button */ #ifdef HAVE_GTK2 button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); @@ -5589,7 +5567,7 @@ static void xsane_choose_device(void) #endif gtk_widget_add_accelerator(button, "clicked", device_selection_accelerator_group, GDK_Escape, 0, DEF_GTK_ACCEL_LOCKED); g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_exit, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(button_box), button, TRUE, TRUE, 6); gtk_widget_show(button); /* The OK button */ @@ -5600,7 +5578,7 @@ static void xsane_choose_device(void) #endif GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); g_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_choose_dialog_ok_callback, NULL); - gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(button_box), button, TRUE, TRUE, 0); gtk_widget_grab_default(button); gtk_widget_show(button); @@ -5825,6 +5803,10 @@ static int xsane_init(int argc, char **argv) DBG(DBG_info, "user did not accept eula, we abort\n"); return 1; /* User did not accept eula */ } + else /* User did accept eula */ + { + xsane_pref_save(); + } } xsane_pref_restore_media(); @@ -5965,7 +5947,7 @@ static int xsane_init(int argc, char **argv) static void xsane_help_no_devices(void) { - char buf[512]; + char buf[1024]; snprintf(buf, sizeof(buf), "%s\n\n%s", ERR_NO_DEVICES, HELP_NO_DEVICES); xsane_back_gtk_decision(WINDOW_NO_DEVICES, (gchar**) no_device_xpm, buf, BUTTON_CLOSE, NULL, TRUE); diff --git a/src/xsane.h b/src/xsane.h index 5cde44a..c5beb0e 100644 --- a/src/xsane.h +++ b/src/xsane.h @@ -91,7 +91,7 @@ /* ---------------------------------------------------------------------------------------------------------------------- */ -#define XSANE_VERSION "0.994" +#define XSANE_VERSION "0.995" #define XSANE_AUTHOR "Oliver Rauch" #define XSANE_COPYRIGHT "Oliver Rauch" #define XSANE_DATE "1998-2007" @@ -103,6 +103,7 @@ #define XSANE_DEBUG_ENVIRONMENT "XSANE_DEBUG" +#define XSANE_PROGRESS_BAR_MIN_DELTA_PERCENT 0.025 #define XSANE_DEFAULT_UMASK 0007 #define XSANE_HOLD_TIME 200 #define XSANE_CONTINUOUS_HOLD_TIME 10 @@ -305,6 +306,12 @@ /* ---------------------------------------------------------------------------------------------------------------------- */ +#ifndef PATH_MAX +# define PATH_MAX 1024 +#endif + +/* ---------------------------------------------------------------------------------------------------------------------- */ + enum { XSANE_PATH_LOCAL_SANE = 0, @@ -497,12 +504,6 @@ extern void xsane_interface(int argc, char **argv); extern void xsane_batch_scan_add(void); /* ---------------------------------------------------------------------------------------------------------------------- */ - -#ifndef PATH_MAX -# define PATH_MAX 1024 -#endif - -/* ---------------------------------------------------------------------------------------------------------------------- */ #ifndef TEMP_PATH # define TEMP_PATH /tmp/ #endif @@ -1040,7 +1041,7 @@ typedef struct XsaneSetup GtkWidget *preview_threshold_mul_entry; GtkWidget *preview_threshold_off_entry; GtkWidget *auto_enhance_gamma_button; - GtkWidget *preselect_scanarea_button; + GtkWidget *preselect_scan_area_button; GtkWidget *auto_correct_colors_button; GtkWidget *disable_gimp_preview_gamma_button; GtkWidget *preview_oversampling_entry; |