summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xsane-back-gtk.c9
-rw-r--r--src/xsane-device-preferences.c1
-rw-r--r--src/xsane-email-project.c2
-rw-r--r--src/xsane-fax-project.c1
-rw-r--r--src/xsane-front-gtk.c18
-rw-r--r--src/xsane-preview.c7
-rw-r--r--src/xsane-text.h1
-rw-r--r--src/xsane-viewer.c4
-rw-r--r--src/xsane.c20
-rw-r--r--src/xsane.h2
10 files changed, 56 insertions, 9 deletions
diff --git a/src/xsane-back-gtk.c b/src/xsane-back-gtk.c
index d74300e..671b02d 100644
--- a/src/xsane-back-gtk.c
+++ b/src/xsane-back-gtk.c
@@ -709,6 +709,7 @@ gint xsane_back_gtk_decision(gchar *title, gchar **xpm_d, gchar *message, gchar
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 10);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
}
/* the message */
@@ -2002,7 +2003,8 @@ void xsane_back_gtk_range_new(GtkWidget *parent, const char *name, gfloat val,
label = gtk_label_new((char *) name);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
- elem->data = gtk_adjustment_new(val, min, max, quant, quant*10, (max-min) * 1e-30);
+ elem->data = gtk_adjustment_new(val, min, max, quant, quant*10, 0);
+ //elem->data = gtk_adjustment_new(val, min, max, quant, quant*10, (max-min) * 1e-30);
/* 1e-30 => hscrollbar has an unwanted side effect: the maximum is not the maximum */
/* of the given range, it is reduced by the page_size, so it has to be very small */
@@ -2121,7 +2123,8 @@ void xsane_back_gtk_value_new(GtkWidget *parent, const char *name, gfloat val,
label = gtk_label_new((char *) name);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
- elem->data = gtk_adjustment_new(val, -1e29, 1e29, 1, 10, 1e-30);
+ elem->data = gtk_adjustment_new(val, -1e29, 1e29, 1, 10, 0);
+ //elem->data = gtk_adjustment_new(val, -1e29, 1e29, 1, 10, 1e-30);
/* spinbutton */
#ifndef HAVE_GTK2
@@ -2612,7 +2615,7 @@ void xsane_back_gtk_set_sensitivity(int sensitive)
continue;
}
- if (!(opt->cap & SANE_CAP_ALWAYS_SETTABLE))
+ // if (!(opt->cap & SANE_CAP_ALWAYS_SETTABLE))
{
gtk_widget_set_sensitive(xsane.element[i].widget, sensitive);
}
diff --git a/src/xsane-device-preferences.c b/src/xsane-device-preferences.c
index ce05cae..011e054 100644
--- a/src/xsane-device-preferences.c
+++ b/src/xsane-device-preferences.c
@@ -603,6 +603,7 @@ void xsane_device_preferences_load_file(char *filename)
#endif
xsane_update_param(0);
+ xsane_set_all_resolutions(); /* XXX test XXX */
xsane_refresh_dialog();
xsane_enhancement_by_gamma();
}
diff --git a/src/xsane-email-project.c b/src/xsane-email-project.c
index c7451ee..87b6574 100644
--- a/src/xsane-email-project.c
+++ b/src/xsane-email-project.c
@@ -183,6 +183,7 @@ void xsane_email_dialog()
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
text = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(text), 128);
@@ -208,6 +209,7 @@ void xsane_email_dialog()
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
text = gtk_entry_new();
xsane_back_gtk_set_tooltip(xsane.tooltips, text, DESC_EMAIL_SUBJECT);
diff --git a/src/xsane-fax-project.c b/src/xsane-fax-project.c
index 3f9df8f..a4095c1 100644
--- a/src/xsane-fax-project.c
+++ b/src/xsane-fax-project.c
@@ -153,6 +153,7 @@ void xsane_fax_dialog()
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
text = gtk_entry_new();
xsane_back_gtk_set_tooltip(xsane.tooltips, text, DESC_FAXRECEIVER);
diff --git a/src/xsane-front-gtk.c b/src/xsane-front-gtk.c
index 589aa14..533655c 100644
--- a/src/xsane-front-gtk.c
+++ b/src/xsane-front-gtk.c
@@ -853,23 +853,24 @@ GtkWidget *xsane_vendor_pixmap_new(GdkWindow *window, GtkWidget *parent)
GtkWidget *pixmapwidget = NULL;
GdkBitmap *mask = NULL;
GdkPixmap *pixmap = NULL;
+ GdkColor *bg_trans = NULL;
if (xsane.devlist[xsane.selected_dev]->vendor)
{
xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", NULL, NULL, xsane.devlist[xsane.selected_dev]->vendor, "-logo.xpm", XSANE_PATH_SYSTEM);
- pixmap = gdk_pixmap_create_from_xpm(window, &mask, xsane.bg_trans, filename);
+ pixmap = gdk_pixmap_create_from_xpm(window, &mask, bg_trans, filename);
}
if (!pixmap) /* vendor logo not available, use backend logo */
{
xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", NULL, NULL, xsane.backend, "-logo.xpm", XSANE_PATH_SYSTEM);
- pixmap = gdk_pixmap_create_from_xpm(window, &mask, xsane.bg_trans, filename);
+ pixmap = gdk_pixmap_create_from_xpm(window, &mask, bg_trans, filename);
}
if (!pixmap) /* backend logo not available, use xsane logo */
{
xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", NULL, NULL, "sane-xsane", "-logo.xpm", XSANE_PATH_SYSTEM);
- pixmap = gdk_pixmap_create_from_xpm(window, &mask, xsane.bg_trans, filename);
+ pixmap = gdk_pixmap_create_from_xpm(window, &mask, bg_trans, filename);
}
if (pixmap) /* ok, we have a pixmap, so letīs show it */
@@ -886,6 +887,7 @@ GtkWidget *xsane_vendor_pixmap_new(GdkWindow *window, GtkWidget *parent)
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask); /* now add the pixmap */
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE /* expand */, FALSE /* fill */, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
gtk_widget_show(pixmapwidget);
}
@@ -912,6 +914,7 @@ GtkWidget *xsane_toggle_button_new_with_pixmap(GdkWindow *window, GtkWidget *par
gtk_container_add(GTK_CONTAINER(button), pixmapwidget);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *state);
g_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_toggle_button_callback, (GtkObject *) state);
@@ -941,6 +944,7 @@ GtkWidget *xsane_button_new_with_pixmap(GdkWindow *window, GtkWidget *parent, co
gtk_container_add(GTK_CONTAINER(button), pixmapwidget);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
if (xsane_button_callback)
{
@@ -1131,7 +1135,8 @@ void xsane_range_new(GtkBox *parent, char *labeltext, const char *desc,
label = gtk_label_new(labeltext);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 1);
- *data = (GtkWidget *) gtk_adjustment_new(*val, min, max, quant, page_step, (max-min) * 1e-30);
+ *data = (GtkWidget *) gtk_adjustment_new(*val, min, max, quant, page_step, 0);
+ // *data = (GtkWidget *) gtk_adjustment_new(*val, min, max, quant, page_step, (max-min) * 1e-30);
/* 1e-30 => hscrollbar has an unwanted side effect: the maximum is not the maximum */
/* of the given range, it is reduced by the page_size, so it has to be very small */
@@ -1223,8 +1228,10 @@ void xsane_range_new_with_pixmap(GdkWindow *window, GtkBox *parent, const char *
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
- *data = (GtkWidget *) gtk_adjustment_new(*val, min, max, quant, page_step, (max-min) * 1e-30);
+ *data = (GtkWidget *) gtk_adjustment_new(*val, min, max, quant, page_step, 0);
+ //*data = (GtkWidget *) gtk_adjustment_new(*val, min, max, quant, page_step, (max-min) * 1e-30);
/* 1e-30 => hscrollbar has an unwanted side effect: the maximum is not the maximum */
/* of the given range, it is reduced by the page_size, so it has to be very small */
@@ -1506,6 +1513,7 @@ void xsane_outputfilename_new(GtkWidget *vbox)
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
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);
diff --git a/src/xsane-preview.c b/src/xsane-preview.c
index e8b49a3..c6122d5 100644
--- a/src/xsane-preview.c
+++ b/src/xsane-preview.c
@@ -4425,6 +4425,7 @@ Preview *preview_new(void)
gtk_box_pack_start(GTK_BOX(p->menu_box), pixmapwidget, FALSE, FALSE, 2);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
preset_area_option_menu = gtk_option_menu_new();
xsane_back_gtk_set_tooltip(xsane.tooltips, preset_area_option_menu, DESC_PRESET_AREA);
@@ -4441,6 +4442,7 @@ Preview *preview_new(void)
gtk_box_pack_start(GTK_BOX(p->menu_box), pixmapwidget, FALSE, FALSE, 2);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
rotation_menu = gtk_menu_new();
@@ -4488,6 +4490,7 @@ Preview *preview_new(void)
gtk_box_pack_start(GTK_BOX(p->menu_box), pixmapwidget, FALSE, FALSE, 2);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
ratio_menu = gtk_menu_new();
@@ -4543,24 +4546,28 @@ Preview *preview_new(void)
gtk_box_pack_start(GTK_BOX(action_box), p->valid_pixmap, FALSE, FALSE, 0);
gtk_widget_show(p->valid_pixmap);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
pixmap = gdk_pixmap_create_from_xpm_d(p->top->window, &mask, xsane.bg_trans, (gchar **) scanning_xpm);
p->scanning_pixmap = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(action_box), p->scanning_pixmap, FALSE, FALSE, 0);
gtk_widget_show(p->scanning_pixmap);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
pixmap = gdk_pixmap_create_from_xpm_d(p->top->window, &mask, xsane.bg_trans, (gchar **) incomplete_xpm);
p->incomplete_pixmap = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(action_box), p->incomplete_pixmap, FALSE, FALSE, 0);
gtk_widget_show(p->incomplete_pixmap);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
pixmap = gdk_pixmap_create_from_xpm_d(p->top->window, &mask, xsane.bg_trans, (gchar **) invalid_xpm);
p->invalid_pixmap = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(action_box), p->invalid_pixmap, FALSE, FALSE, 0);
gtk_widget_show(p->invalid_pixmap);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
/* Start button */
p->start = gtk_button_new_with_label(BUTTON_PREVIEW_ACQUIRE);
diff --git a/src/xsane-text.h b/src/xsane-text.h
index 6cf74d8..fc6bbeb 100644
--- a/src/xsane-text.h
+++ b/src/xsane-text.h
@@ -765,6 +765,7 @@ write permissions." )
#define ERR_UNKNOWN_TYPE _("unknown type")
#define ERR_UNKNOWN_CONSTRAINT_TYPE _("unknown constraint type")
#define ERR_OPTION_NAME_NULL _("Option has empty name (NULL).")
+#define ERR_OPTION_ZERO_SIZE _("Option has zero size.")
#define ERR_BACKEND_BUG _("This is a backend bug. Please inform the author of the backend!")
#define ERR_FAILED_EXEC_DOC_VIEWER _("Failed to execute documentation viewer:")
#define ERR_FAILED_EXEC_FAX_VIEWER _("Failed to execute fax viewer:")
diff --git a/src/xsane-viewer.c b/src/xsane-viewer.c
index 3ca14f6..ac14e71 100644
--- a/src/xsane-viewer.c
+++ b/src/xsane-viewer.c
@@ -687,6 +687,7 @@ static void xsane_viewer_scale_callback(GtkWidget *window, gpointer data)
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 20);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
adjustment_size_x = (GtkAdjustment *) gtk_adjustment_new(v->x_scale_factor * image_info.image_width , 0.01 * image_info.image_width, 4.0 * image_info.image_width, 1.0, 5.0, 0.0);
spinbutton = gtk_spin_button_new(adjustment_size_x, 0, 0);
@@ -703,6 +704,7 @@ static void xsane_viewer_scale_callback(GtkWidget *window, gpointer data)
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 20);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
adjustment_size_y = (GtkAdjustment *) gtk_adjustment_new(v->x_scale_factor * image_info.image_height , 0.01 * image_info.image_height, 4.0 * image_info.image_height, 1.0, 5.0, 0.0);
spinbutton = gtk_spin_button_new(adjustment_size_y, 0, 0);
@@ -749,6 +751,7 @@ static void xsane_viewer_scale_callback(GtkWidget *window, gpointer data)
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 20);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
adjustment_size_x = (GtkAdjustment *) gtk_adjustment_new(v->x_scale_factor * image_info.image_width , 0.01 * image_info.image_width, 4.0 * image_info.image_width, 1.0, 5.0, 0.0);
spinbutton = gtk_spin_button_new(adjustment_size_x, 0, 0);
@@ -787,6 +790,7 @@ static void xsane_viewer_scale_callback(GtkWidget *window, gpointer data)
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 20);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
adjustment_size_y = (GtkAdjustment *) gtk_adjustment_new(v->y_scale_factor * image_info.image_height , 0.01 * image_info.image_height, 4.0 * image_info.image_height, 1.0, 5.0, 0.0);
spinbutton = gtk_spin_button_new(adjustment_size_y, 0, 0);
diff --git a/src/xsane.c b/src/xsane.c
index 8c65e33..66072a4 100644
--- a/src/xsane.c
+++ b/src/xsane.c
@@ -1214,6 +1214,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
gtk_widget_show(pixmapwidget);
/* adf pages maximum */
@@ -1283,6 +1284,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_end(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
gtk_widget_show(pixmapwidget);
xsane.xsanemode_widget = xsane_modus_option_menu;
@@ -1310,6 +1312,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
gtk_widget_show(pixmapwidget);
@@ -1388,6 +1391,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
gtk_container_add(GTK_CONTAINER(paper_orientation_item), pixmapwidget);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
gtk_container_add(GTK_CONTAINER(paper_orientation_menu), paper_orientation_item);
@@ -1456,6 +1460,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
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);
@@ -1477,6 +1482,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
gtk_widget_show(pixmapwidget);
switch (opt->constraint_type)
@@ -1516,6 +1522,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
gtk_widget_show(pixmapwidget);
switch (opt->constraint_type)
@@ -1561,6 +1568,7 @@ GtkWidget *xsane_update_xsane_callback() /* creates the XSane option window */
pixmapwidget = gtk_image_new_from_pixmap(pixmap, mask);
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
gtk_widget_show(pixmapwidget);
xsane_medium_menu = gtk_menu_new();
@@ -3514,6 +3522,7 @@ static void xsane_about_dialog(GtkWidget *widget, gpointer data)
gtk_box_pack_start(GTK_BOX(vbox), pixmapwidget, FALSE, FALSE, 2);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
xsane_separator_new(vbox, 5);
@@ -3618,6 +3627,7 @@ static void xsane_about_translation_dialog(GtkWidget *widget, gpointer data)
gtk_box_pack_start(GTK_BOX(vbox), pixmapwidget, FALSE, FALSE, 2);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
xsane_separator_new(vbox, 5);
@@ -4754,6 +4764,14 @@ void xsane_panel_build()
break;
}
+ if (!opt->size)
+ {
+ DBG(DBG_error, "xsane_panel_build: Option %d, type SANE_TYPE_STRING\n", i);
+ DBG(DBG_error, "=> %s\n", ERR_OPTION_ZERO_SIZE);
+ DBG(DBG_error, "=> %s\n", ERR_BACKEND_BUG);
+ break;
+ }
+
buf = malloc(opt->size);
status = xsane_control_option(xsane.dev, i, SANE_ACTION_GET_VALUE, buf, 0);
if (status != SANE_STATUS_GOOD)
@@ -5459,6 +5477,7 @@ static void xsane_choose_device(void)
gtk_box_pack_start(GTK_BOX(vbox), pixmapwidget, FALSE, FALSE, 0);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
xsane_set_window_icon(xsane.choose_device_dialog, (gchar **) 0);
@@ -5874,6 +5893,7 @@ static int xsane_init(int argc, char **argv)
gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 10);
gtk_widget_show(pixmapwidget);
gdk_drawable_unref(pixmap);
+ gdk_drawable_unref(mask);
/* add text */
snprintf(buf, sizeof(buf), " %s ", TEXT_SCANNING_DEVICES);
diff --git a/src/xsane.h b/src/xsane.h
index 767442c..6aa0f2a 100644
--- a/src/xsane.h
+++ b/src/xsane.h
@@ -91,7 +91,7 @@
/* ---------------------------------------------------------------------------------------------------------------------- */
-#define XSANE_VERSION "0.996"
+#define XSANE_VERSION "0.997"
#define XSANE_AUTHOR "Oliver Rauch"
#define XSANE_COPYRIGHT "Oliver Rauch"
#define XSANE_DATE "1998-2007"