[sane-devel] Xsane Length unit under View menu

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Wed Sep 19 09:01:14 UTC 2012


Ganapati Hegde writes:

> Hi,

Hi

> 1. For new backend We are trying to access the length unit of the
> geometry group for user defined paper sizes.

Paper sizes have a name like A4 or Letter.  They don't have any units,
that is, they're SANE_UNIT_NONE.

I guess what you are trying to achieve is switching the units for a size
description that's tagged onto the name.  This is not supported by SANE.

> We see that the tl_x ,tl_y ,br_x, br_y is always set in mm, inspite of
> the UI showing text (in) as in the attached screenshot.  Also is there
> any setting that we can inform Xsane to handle this?  We have set the
> Lenght unit in the option descriptor as MM as we sending all values to
> XSane in mm.

XSane has a "Length unit" option in the "View" menu that let's you pick
a preferred display unit.  Internally all geometry handling is done in
terms of SANE_UNIT_MM (or SANE_UNIT_PIXEL).

> 2. For user defined paper sizes, if we change the Geometry, the rect in
> the preview is not getting redrawn.
> Can anyone tell us how to initiate redraw of the rectangle to reflect
> the goemetry cordinates.

When the paper size is changed in the backend, do you update the
well-known geometry options (tl-x, etc.) too?  Do you inform the
frontend that other options may have changed?

You need to do so by or-ing in the SANE_INFO_RELOAD_OPTIONS in the last
argument to sane_control_options(), after checking that the frontend
didn't pass a NULL pointer of course.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom
                 http://www.fsf.org/jf?referrer=1962



More information about the sane-devel mailing list