gnome-scan r595 - in trunk: . doc/ref/tmpl lib modules src
- From: bersace svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-scan r595 - in trunk: . doc/ref/tmpl lib modules src
- Date: Sun, 4 May 2008 14:36:39 +0100 (BST)
Author: bersace
Date: Sun May 4 13:36:38 2008
New Revision: 595
URL: http://svn.gnome.org/viewvc/gnome-scan?rev=595&view=rev
Log:
Rename GSPoint to GnomeScanPoint, GSRectangle to GnomeScanRectangle,
etc.
Modified:
trunk/ChangeLog
trunk/doc/ref/tmpl/gnome-scan-utils.sgml
trunk/lib/gnome-scan-dialog.c
trunk/lib/gnome-scan-param-widget.c
trunk/lib/gnome-scan-preview-plugin-area.c
trunk/lib/gnome-scan-types.c
trunk/lib/gnome-scan-utils.c
trunk/lib/gnome-scan-utils.h
trunk/modules/gsane-meta-param.c
trunk/modules/gsane-meta-param.h
trunk/modules/gsane-scanner.c
trunk/modules/gsfile-scanner.c
trunk/src/flegita-gimp-sink.c
trunk/src/flegita-sink.c
Modified: trunk/doc/ref/tmpl/gnome-scan-utils.sgml
==============================================================================
--- trunk/doc/ref/tmpl/gnome-scan-utils.sgml (original)
+++ trunk/doc/ref/tmpl/gnome-scan-utils.sgml Sun May 4 13:36:38 2008
@@ -55,12 +55,12 @@
</para>
- GS_UNIT_NONE:
- GS_UNIT_PIXEL:
- GS_UNIT_POINT:
- GS_UNIT_MM:
- GS_UNIT_BIT:
- GS_UNIT_DPI:
- GS_UNIT_PERCENT:
- GS_UNIT_MICROSECOND:
+ GNOME_SCAN_UNIT_NONE:
+ GNOME_SCAN_UNIT_PIXEL:
+ GNOME_SCAN_UNIT_POINT:
+ GNOME_SCAN_UNIT_MM:
+ GNOME_SCAN_UNIT_BIT:
+ GNOME_SCAN_UNIT_DPI:
+ GNOME_SCAN_UNIT_PERCENT:
+ GNOME_SCAN_UNIT_MICROSECOND:
Modified: trunk/lib/gnome-scan-dialog.c
==============================================================================
--- trunk/lib/gnome-scan-dialog.c (original)
+++ trunk/lib/gnome-scan-dialog.c Sun May 4 13:36:38 2008
@@ -1238,8 +1238,8 @@
"paper-size");
psps = GS_PARAM_SPEC_PAPER_SIZE (pspec);
ps = psps->enumeration->next->data;
- gint width = (gint) gs_convert (gtk_paper_size_get_width (ps, GTK_UNIT_MM), GS_UNIT_MM, GS_UNIT_PIXEL, PREVIEW_RES);
- gint height = (gint) gs_convert (gtk_paper_size_get_height (ps, GTK_UNIT_MM), GS_UNIT_MM, GS_UNIT_PIXEL, PREVIEW_RES);
+ gint width = (gint) gnome_scan_convert (gtk_paper_size_get_width (ps, GTK_UNIT_MM), GNOME_SCAN_UNIT_MM, GNOME_SCAN_UNIT_PIXEL, PREVIEW_RES);
+ gint height = (gint) gnome_scan_convert (gtk_paper_size_get_height (ps, GTK_UNIT_MM), GNOME_SCAN_UNIT_MM, GNOME_SCAN_UNIT_PIXEL, PREVIEW_RES);
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
FALSE, 8,
Modified: trunk/lib/gnome-scan-param-widget.c
==============================================================================
--- trunk/lib/gnome-scan-param-widget.c (original)
+++ trunk/lib/gnome-scan-param-widget.c Sun May 4 13:36:38 2008
@@ -100,31 +100,31 @@
if (!gspw->shows_unit) {
priv->unit = gtk_label_new(NULL);
switch (gs_param_spec_get_unit (gspw->pspec)) {
- case GS_UNIT_PIXEL:
+ case GNOME_SCAN_UNIT_PIXEL:
/* translator: unit pixel */
unit = _("px");
break;
- case GS_UNIT_BIT:
+ case GNOME_SCAN_UNIT_BIT:
/* translator: unit bit */
unit = _("bit");
break;
- case GS_UNIT_MM:
+ case GNOME_SCAN_UNIT_MM:
/* translator: unit millimeter */
unit = _("mm");
break;
- case GS_UNIT_DPI:
+ case GNOME_SCAN_UNIT_DPI:
/* translator: unit dot per inch */
unit = _("dpi");
break;
- case GS_UNIT_PERCENT:
+ case GNOME_SCAN_UNIT_PERCENT:
/* translator: unit percent */
unit = _("%");
break;
- case GS_UNIT_MICROSECOND:
+ case GNOME_SCAN_UNIT_MICROSECOND:
/* translator: unit microsecond */
unit = _("ms");
break;
- case GS_UNIT_NONE:
+ case GNOME_SCAN_UNIT_NONE:
default:
unit = NULL;
break;
Modified: trunk/lib/gnome-scan-preview-plugin-area.c
==============================================================================
--- trunk/lib/gnome-scan-preview-plugin-area.c (original)
+++ trunk/lib/gnome-scan-preview-plugin-area.c Sun May 4 13:36:38 2008
@@ -30,8 +30,8 @@
GS_DEFINE_PREVIEW_PLUGIN (GnomeScanPreviewPluginArea, gnome_scan_preview_plugin_area,
"origin,page-orientation");
-#define GS_ANCHOR_NONE -1
-#define GS_ANCHOR_OUTSIDE -2
+#define GNOME_SCAN_ANCHOR_NONE -1
+#define GNOME_SCAN_ANCHOR_OUTSIDE -2
typedef enum {
GSPPA_MOVE = 1 << 0,
@@ -118,7 +118,7 @@
GdkRectangle *roi,
GdkRectangle *window)
{
- GtkAnchorType at, res = GS_ANCHOR_NONE;
+ GtkAnchorType at, res = GNOME_SCAN_ANCHOR_NONE;
GdkRectangle *ar;
if (gsppa_point_is_in_rect (point, window)) {
@@ -133,7 +133,7 @@
}
}
else {
- res = GS_ANCHOR_OUTSIDE;
+ res = GNOME_SCAN_ANCHOR_OUTSIDE;
}
return res;
}
@@ -170,7 +170,7 @@
case GTK_ANCHOR_CENTER:
ct = GDK_FLEUR;
break;
- case GS_ANCHOR_NONE:
+ case GNOME_SCAN_ANCHOR_NONE:
ct = GDK_CROSSHAIR;
break;
default:
@@ -196,10 +196,10 @@
switch (at) {
case GTK_ANCHOR_CENTER:
- at = flag & GSPPA_MOVE ? at : GS_ANCHOR_OUTSIDE;
+ at = flag & GSPPA_MOVE ? at : GNOME_SCAN_ANCHOR_OUTSIDE;
break;
- case GS_ANCHOR_NONE:
- at = flag & GSPPA_CREATE ? at : GS_ANCHOR_OUTSIDE;
+ case GNOME_SCAN_ANCHOR_NONE:
+ at = flag & GSPPA_CREATE ? at : GNOME_SCAN_ANCHOR_OUTSIDE;
break;
default:
at = flag & GSPPA_RESIZE ? at : GTK_ANCHOR_CENTER;
@@ -471,22 +471,22 @@
gdouble res = gnome_scan_preview_area_get_resolution (GNOME_SCAN_PREVIEW_AREA (gspp->preview_area));
/* origin */
- GSPoint *o = gnome_scan_settings_get_pointer (s, "origin");
- o->x = gs_convert_to_mm (r.x, GS_UNIT_PIXEL, res);
- o->y = gs_convert_to_mm(r.y, GS_UNIT_PIXEL, res);
+ GnomeScanPoint *o = gnome_scan_settings_get_pointer (s, "origin");
+ o->x = gnome_scan_convert_to_mm (r.x, GNOME_SCAN_UNIT_PIXEL, res);
+ o->y = gnome_scan_convert_to_mm(r.y, GNOME_SCAN_UNIT_PIXEL, res);
/* paper-size (if manual) */
GtkPaperSize *p = gnome_scan_settings_get_boxed (s, "paper-size",
GTK_TYPE_PAPER_SIZE);
if (g_str_equal (gtk_paper_size_get_name(p), "manual")) {
g_debug (G_STRLOC ": new manual paper-size : %.2fx%.2f mm",
- gs_convert (r.width, GS_UNIT_PIXEL, GS_UNIT_MM, res),
- gs_convert (r.height, GS_UNIT_PIXEL, GS_UNIT_MM, res));
+ gnome_scan_convert (r.width, GNOME_SCAN_UNIT_PIXEL, GNOME_SCAN_UNIT_MM, res),
+ gnome_scan_convert (r.height, GNOME_SCAN_UNIT_PIXEL, GNOME_SCAN_UNIT_MM, res));
g_boxed_free (GTK_TYPE_PAPER_SIZE, p);
/* translator: Manual is the name of user defined paper size. */
p = gtk_paper_size_new_custom ("manual", _("Manual"),
- gs_convert (MIN(r.width, r.height), GS_UNIT_PIXEL, GS_UNIT_MM, res),
- gs_convert (MAX(r.width, r.height), GS_UNIT_PIXEL, GS_UNIT_MM, res),
+ gnome_scan_convert (MIN(r.width, r.height), GNOME_SCAN_UNIT_PIXEL, GNOME_SCAN_UNIT_MM, res),
+ gnome_scan_convert (MAX(r.width, r.height), GNOME_SCAN_UNIT_PIXEL, GNOME_SCAN_UNIT_MM, res),
GTK_UNIT_MM);
/* update orientation according to area extent */
GtkPageOrientation or = r.width > r.height ? GTK_PAGE_ORIENTATION_LANDSCAPE : GTK_PAGE_ORIENTATION_PORTRAIT;
@@ -513,7 +513,7 @@
static void
gsppa_set_roi (GnomeScanPreviewPlugin *gspp)
{
- GSPoint *p;
+ GnomeScanPoint *p;
GtkPaperSize *ps;
GtkPageOrientation o;
gint tmp;
@@ -527,18 +527,20 @@
o = gnome_scan_settings_get_enum(gspp->settings, "page-orientation",
GTK_TYPE_PAGE_ORIENTATION);
if (!p) {
- p = g_new0 (GSPoint, 1);
+ p = g_new0 (GnomeScanPoint, 1);
gnome_scan_settings_set_pointer (gspp->settings, "origin", p);
}
- r.x = gs_convert_from_mm (p->x, GS_UNIT_PIXEL, res);
- r.y = gs_convert_from_mm (p->y, GS_UNIT_PIXEL, res);
+ r.x = gnome_scan_convert_from_mm (p->x, GNOME_SCAN_UNIT_PIXEL, res);
+ r.y = gnome_scan_convert_from_mm (p->y, GNOME_SCAN_UNIT_PIXEL, res);
ps = gnome_scan_settings_get_boxed (gspp->settings, "paper-size",
GTK_TYPE_PAPER_SIZE);
- r.width = (gint) gs_convert_from_mm (gtk_paper_size_get_width (ps, GTK_UNIT_MM), GS_UNIT_PIXEL, res);
- r.height = (gint) gs_convert_from_mm (gtk_paper_size_get_height (ps, GTK_UNIT_MM), GS_UNIT_PIXEL, res);
+ r.width = (gint) gnome_scan_convert_from_mm (gtk_paper_size_get_width (ps, GTK_UNIT_MM),
+ GNOME_SCAN_UNIT_PIXEL, res);
+ r.height = (gint) gnome_scan_convert_from_mm (gtk_paper_size_get_height (ps, GTK_UNIT_MM),
+ GNOME_SCAN_UNIT_PIXEL, res);
switch(o) {
case GTK_PAGE_ORIENTATION_LANDSCAPE:
Modified: trunk/lib/gnome-scan-types.c
==============================================================================
--- trunk/lib/gnome-scan-types.c (original)
+++ trunk/lib/gnome-scan-types.c Sun May 4 13:36:38 2008
@@ -59,14 +59,14 @@
{
static GType type = 0;
static const GEnumValue _gs_param_unit_values[] = {
- { GS_UNIT_NONE, "GS_UNIT_NONE", "none" },
- { GS_UNIT_PIXEL, "GS_UNIT_PIXEL", "pixel" },
- { GS_UNIT_POINT, "GS_UNIT_POINT", "point" },
- { GS_UNIT_MM, "GS_UNIT_MM", "mm" },
- { GS_UNIT_BIT, "GS_UNIT_BIT", "bit" },
- { GS_UNIT_DPI, "GS_UNIT_DPI", "dpi" },
- { GS_UNIT_PERCENT, "GS_UNIT_PERCENT", "percent" },
- { GS_UNIT_MICROSECOND, "GS_UNIT_MICROSECOND", "microsecond" },
+ { GNOME_SCAN_UNIT_NONE, "GNOME_SCAN_UNIT_NONE", "gnome-scan-unit-none" },
+ { GNOME_SCAN_UNIT_PIXEL, "GNOME_SCAN_UNIT_PIXEL", "gnome-scan-unit-pixel" },
+ { GNOME_SCAN_UNIT_POINT, "GNOME_SCAN_UNIT_POINT", "gnome-scan-unit-point" },
+ { GNOME_SCAN_UNIT_MM, "GNOME_SCAN_UNIT_MM", "gnome-scan-unit-mm" },
+ { GNOME_SCAN_UNIT_BIT, "GNOME_SCAN_UNIT_BIT", "gnome-scan-unit-bit" },
+ { GNOME_SCAN_UNIT_DPI, "GNOME_SCAN_UNIT_DPI", "gnome-scan-unit-dpi" },
+ { GNOME_SCAN_UNIT_PERCENT, "GNOME_SCAN_UNIT_PERCENT", "gnome-scan-unit-percent" },
+ { GNOME_SCAN_UNIT_MICROSECOND, "GNOME_SCAN_UNIT_MICROSECOND", "gnome-scan-unit-microsecond" },
{ 0, NULL, NULL }
};
Modified: trunk/lib/gnome-scan-utils.c
==============================================================================
--- trunk/lib/gnome-scan-utils.c (original)
+++ trunk/lib/gnome-scan-utils.c Sun May 4 13:36:38 2008
@@ -28,10 +28,10 @@
#include "gnome-scan-utils.h"
#include "gnome-scan-types.h"
-#define GS_WARN_UNSUPPORTED_UNIT(unit) g_warning("%s: Unsupported unit %s.", __FUNCTION__, gs_enum_get_nick_from_value (GNOME_TYPE_SCAN_UNIT, unit))
+#define GNOME_SCAN_WARN_UNSUPPORTED_UNIT(unit) g_warning("%s: Unsupported unit %s.", __FUNCTION__, gnome_scan_enum_get_nick_from_value (GNOME_TYPE_SCAN_UNIT, unit))
const gchar*
-gs_enum_get_nick_from_value (GType type, guint value)
+gnome_scan_enum_get_nick_from_value (GType type, guint value)
{
GEnumClass *klass;
GEnumValue *val;
@@ -44,7 +44,7 @@
}
/**
- * gs_convert:
+ * gnome_scan_convert:
* @val: the value to convert
* @from: the current @val unit
* @to: the target unit fro @val
@@ -54,96 +54,96 @@
* preview area, #GnomeScanner, etc.
**/
gdouble
-gs_convert (gdouble val,
- GnomeScanUnit from,
- GnomeScanUnit to,
- gdouble res)
+gnome_scan_convert (gdouble val,
+ GnomeScanUnit from,
+ GnomeScanUnit to,
+ gdouble res)
{
if (from == to)
return val;
switch (from) {
- case GS_UNIT_NONE:
- case GS_UNIT_BIT:
- case GS_UNIT_PERCENT:
- case GS_UNIT_MICROSECOND:
- case GS_UNIT_DPI:
- GS_WARN_UNSUPPORTED_UNIT(from);
+ case GNOME_SCAN_UNIT_NONE:
+ case GNOME_SCAN_UNIT_BIT:
+ case GNOME_SCAN_UNIT_PERCENT:
+ case GNOME_SCAN_UNIT_MICROSECOND:
+ case GNOME_SCAN_UNIT_DPI:
+ GNOME_SCAN_WARN_UNSUPPORTED_UNIT(from);
return val;
default:
switch (to) {
- case GS_UNIT_NONE:
- case GS_UNIT_BIT:
- case GS_UNIT_PERCENT:
- case GS_UNIT_MICROSECOND:
- case GS_UNIT_DPI:
- GS_WARN_UNSUPPORTED_UNIT(from);
+ case GNOME_SCAN_UNIT_NONE:
+ case GNOME_SCAN_UNIT_BIT:
+ case GNOME_SCAN_UNIT_PERCENT:
+ case GNOME_SCAN_UNIT_MICROSECOND:
+ case GNOME_SCAN_UNIT_DPI:
+ GNOME_SCAN_WARN_UNSUPPORTED_UNIT(from);
return val;
default:
- return gs_convert_from_mm (gs_convert_to_mm (val, from, res),
- to, res);
+ return gnome_scan_convert_from_mm (gnome_scan_convert_to_mm (val, from, res),
+ to, res);
}
}
}
gdouble
-gs_convert_to_mm (gdouble val,
- GnomeScanUnit unit,
- gdouble res)
+gnome_scan_convert_to_mm (gdouble val,
+ GnomeScanUnit unit,
+ gdouble res)
{
switch (unit) {
- case GS_UNIT_NONE:
- case GS_UNIT_BIT:
- case GS_UNIT_PERCENT:
- case GS_UNIT_MICROSECOND:
- case GS_UNIT_DPI:
- GS_WARN_UNSUPPORTED_UNIT(unit);
+ case GNOME_SCAN_UNIT_NONE:
+ case GNOME_SCAN_UNIT_BIT:
+ case GNOME_SCAN_UNIT_PERCENT:
+ case GNOME_SCAN_UNIT_MICROSECOND:
+ case GNOME_SCAN_UNIT_DPI:
+ GNOME_SCAN_WARN_UNSUPPORTED_UNIT(unit);
return val;
- case GS_UNIT_MM:
+ case GNOME_SCAN_UNIT_MM:
return val;
- case GS_UNIT_PIXEL:
+ case GNOME_SCAN_UNIT_PIXEL:
return val * (MM_PER_INCH / res);
}
}
gdouble
-gs_convert_from_mm (gdouble val,
- GnomeScanUnit unit,
- gdouble res)
+gnome_scan_convert_from_mm (gdouble val,
+ GnomeScanUnit unit,
+ gdouble res)
{
switch (unit) {
- case GS_UNIT_NONE:
- case GS_UNIT_BIT:
- case GS_UNIT_PERCENT:
- case GS_UNIT_MICROSECOND:
- case GS_UNIT_DPI:
- GS_WARN_UNSUPPORTED_UNIT(unit);
+ case GNOME_SCAN_UNIT_NONE:
+ case GNOME_SCAN_UNIT_BIT:
+ case GNOME_SCAN_UNIT_PERCENT:
+ case GNOME_SCAN_UNIT_MICROSECOND:
+ case GNOME_SCAN_UNIT_DPI:
+ GNOME_SCAN_WARN_UNSUPPORTED_UNIT(unit);
return val;
- case GS_UNIT_MM:
+ case GNOME_SCAN_UNIT_MM:
return val;
- case GS_UNIT_PIXEL:
+ case GNOME_SCAN_UNIT_PIXEL:
return val / (MM_PER_INCH / res);
}
}
-GSRectangle*
-gs_rectangle_convert (GSRectangle *r,
- GnomeScanUnit from,
- GnomeScanUnit to,
- gdouble res)
+GnomeScanRectangle*
+gnome_scan_rectangle_convert (GnomeScanRectangle *r,
+ GnomeScanUnit from,
+ GnomeScanUnit to,
+ gdouble res)
{
- return gs_rectangle_convert_from_mm (gs_rectangle_convert_to_mm (r, from, res),
- to, res);
+ return gnome_scan_rectangle_convert_from_mm (gnome_scan_rectangle_convert_to_mm (r, from, res),
+ to, res);
}
-GSRectangle*
-gs_rectangle_convert_to_mm (GSRectangle *r,
- GnomeScanUnit unit,
- gdouble res)
+GnomeScanRectangle*
+gnome_scan_rectangle_convert_to_mm (GnomeScanRectangle *r,
+ GnomeScanUnit unit,
+ gdouble res)
{
- GSRectangle*rect = g_new0 (GSRectangle, 1);
-#define conv(var) rect->var = gs_convert_to_mm (r->var, unit, res)
+ GnomeScanRectangle*rect = g_new0 (GnomeScanRectangle, 1);
+#define conv(var) rect->var = gnome_scan_convert_to_mm (r->var, unit, res)
conv(x);
conv(y);
conv(width);
@@ -152,13 +152,13 @@
return rect;
}
-GSRectangle*
-gs_rectangle_convert_from_mm (GSRectangle *r,
- GnomeScanUnit unit,
- gdouble res)
+GnomeScanRectangle*
+gnome_scan_rectangle_convert_from_mm (GnomeScanRectangle *r,
+ GnomeScanUnit unit,
+ gdouble res)
{
- GSRectangle*rect = g_new0 (GSRectangle, 1);
-#define conv(var) rect->var = gs_convert_from_mm (r->var, unit, res)
+ GnomeScanRectangle*rect = g_new0 (GnomeScanRectangle, 1);
+#define conv(var) rect->var = gnome_scan_convert_from_mm (r->var, unit, res)
conv(x);
conv(y);
conv(width);
@@ -167,16 +167,16 @@
return rect;
}
-GSRectangle*
-gs_rectangle_rotate(GSRectangle *r,
- GSRectangle *a,
- guint angle)
+GnomeScanRectangle*
+gnome_scan_rectangle_rotate(GnomeScanRectangle *r,
+ GnomeScanRectangle *a,
+ guint angle)
{
- GSRectangle *res = g_memdup(r, sizeof(GSRectangle));
+ GnomeScanRectangle *res = g_memdup(r, sizeof(GnomeScanRectangle));
angle%= 360;
switch (angle)
- {
+ {
case 0:
break;
case 270:
@@ -199,6 +199,6 @@
g_warning("%s: %i degree rotation is not supported",
__FUNCTION__, angle);
break;
- }
+ }
return res;
}
Modified: trunk/lib/gnome-scan-utils.h
==============================================================================
--- trunk/lib/gnome-scan-utils.h (original)
+++ trunk/lib/gnome-scan-utils.h Sun May 4 13:36:38 2008
@@ -40,29 +40,29 @@
*
* For example:
* <programlisting>
-GS_DEFINE_QUARK (foo_bar, FooBar);
+ GS_DEFINE_QUARK (foo_bar, FooBar);
* </programlisting>
*
* expands to:
*
* <programlisting>
-GQuark
-gs_foo_bar_quark () {
- static GQuark quark = 0;
- if (!quark) {
- quark = g_quark_from_static_string ("FooBar");
- }
- return quark;
-}
+ GQuark
+ gs_foo_bar_quark () {
+ static GQuark quark = 0;
+ if (!quark) {
+ quark = g_quark_from_static_string ("FooBar");
+ }
+ return quark;
+ }
* </programlisting>
**/
-#define GS_DEFINE_QUARK(quark_name, String) GQuark \
-quark_name##_quark () { \
- static GQuark quark = 0; \
- if (!quark) { \
- quark = g_quark_from_static_string (String); } \
- return quark; \
-}
+#define GS_DEFINE_QUARK(quark_name, String) GQuark \
+ quark_name##_quark () { \
+ static GQuark quark = 0; \
+ if (!quark) { \
+ quark = g_quark_from_static_string (String); } \
+ return quark; \
+ }
/**
@@ -79,15 +79,15 @@
gchar **extensions;
};
-typedef struct _GSPoint GSPoint;
-struct _GSPoint
+typedef struct _GnomeScanPoint GnomeScanPoint;
+struct _GnomeScanPoint
{
gdouble x;
gdouble y;
};
-typedef struct _GSRectangle GSRectangle;
-struct _GSRectangle
+typedef struct _GnomeScanRectangle GnomeScanRectangle;
+struct _GnomeScanRectangle
{
gdouble x;
gdouble y;
@@ -99,48 +99,52 @@
* GnomeScanUnit:
**/
typedef enum /*< lowercase_name=gs_param_unit,prefix=GS_UNIT >*/
-{
- GS_UNIT_NONE=-1,
- GS_UNIT_PIXEL=GTK_UNIT_PIXEL,
- GS_UNIT_POINT=GTK_UNIT_POINTS,
- GS_UNIT_MM=GTK_UNIT_MM,
- GS_UNIT_BIT,
- GS_UNIT_DPI,
- GS_UNIT_PERCENT,
- GS_UNIT_MICROSECOND
-} GnomeScanUnit;
+ {
+ GNOME_SCAN_UNIT_NONE=-1,
+ GNOME_SCAN_UNIT_PIXEL=GTK_UNIT_PIXEL,
+ GNOME_SCAN_UNIT_POINT=GTK_UNIT_POINTS,
+ GNOME_SCAN_UNIT_MM=GTK_UNIT_MM,
+ GNOME_SCAN_UNIT_BIT,
+ GNOME_SCAN_UNIT_DPI,
+ GNOME_SCAN_UNIT_PERCENT,
+ GNOME_SCAN_UNIT_MICROSECOND
+ } GnomeScanUnit;
const gchar*
-gs_enum_get_nick_from_value (GType type, guint value);
+gnome_scan_enum_get_nick_from_value (GType type, guint value);
-gdouble gs_convert (gdouble val,
- GnomeScanUnit from,
- GnomeScanUnit to,
- gdouble res);
-
-gdouble gs_convert_to_mm (gdouble val,
- GnomeScanUnit unit,
- gdouble res);
-
-gdouble gs_convert_from_mm (gdouble val,
- GnomeScanUnit unit,
- gdouble res);
-
-GSRectangle* gs_rectangle_convert (GSRectangle *r,
- GnomeScanUnit from,
- GnomeScanUnit to,
- gdouble res);
-GSRectangle* gs_rectangle_convert_to_mm (GSRectangle *r,
- GnomeScanUnit unit,
- gdouble res);
-
-GSRectangle* gs_rectangle_convert_from_mm (GSRectangle *r,
- GnomeScanUnit unit,
- gdouble res);
-
-GSRectangle* gs_rectangle_rotate (GSRectangle *r,
- GSRectangle *a,
- guint angle);
+gdouble gnome_scan_convert (gdouble val,
+ GnomeScanUnit from,
+ GnomeScanUnit to,
+ gdouble res);
+
+gdouble gnome_scan_convert_to_mm (gdouble val,
+ GnomeScanUnit unit,
+ gdouble res);
+
+gdouble gnome_scan_convert_from_mm (gdouble val,
+ GnomeScanUnit unit,
+ gdouble res);
+
+GnomeScanRectangle*
+gnome_scan_rectangle_convert (GnomeScanRectangle *r,
+ GnomeScanUnit from,
+ GnomeScanUnit to,
+ gdouble res);
+GnomeScanRectangle*
+gnome_scan_rectangle_convert_to_mm (GnomeScanRectangle *r,
+ GnomeScanUnit unit,
+ gdouble res);
+
+GnomeScanRectangle*
+gnome_scan_rectangle_convert_from_mm (GnomeScanRectangle *r,
+ GnomeScanUnit unit,
+ gdouble res);
+
+GnomeScanRectangle*
+gnome_scan_rectangle_rotate (GnomeScanRectangle *r,
+ GnomeScanRectangle *a,
+ guint angle);
#define gs_debug_rect(r) g_debug(G_STRLOC ": " #r " = %ix%i+%i+%i", (r)->width, (r)->height, (r)->x, (r)->y)
#define gs_debug_gsrect(r) g_debug(G_STRLOC ": " #r " = %.2fx%.2f+%.2f+%.2f", (r)->width, (r)->height, (r)->x, (r)->y)
Modified: trunk/modules/gsane-meta-param.c
==============================================================================
--- trunk/modules/gsane-meta-param.c (original)
+++ trunk/modules/gsane-meta-param.c Sun May 4 13:36:38 2008
@@ -269,7 +269,7 @@
#undef set_int
/* note: decomposing area in three options orientation, origin and paper-size
- except these optoin to appear in this order. */
+ except these optoin to appear in this order. */
/* ORIENTATION */
pspec = gs_param_spec_page_orientation ("page-orientation", N_("Page Orientation"), N_("Page orientation"),
@@ -331,7 +331,7 @@
enumeration = g_slist_append (enumeration,
gtk_paper_size_new_custom ("manual",
- /* translator: Manual is the name of user defined paper size. */
+ /* translator: Manual is the name of user defined paper size. */
_("Manual"),
w, h,
GTK_UNIT_MM)); /* what if w and h are not mm, but e.g. pixel ? */
@@ -361,16 +361,16 @@
return TRUE;
}
-GdkRectangle*
-gs_rectange_rotate(GdkRectangle *r,
- GdkRectangle *a,
- guint angle)
+GnomeScanRectangle*
+gs_rectangle_rotate(GnomeScanRectangle *r,
+ GnomeScanRectangle *a,
+ guint angle)
{
- GdkRectangle *res = g_memdup(r, sizeof(GdkRectangle));
+ GnomeScanRectangle *res = g_memdup(r, sizeof(GnomeScanRectangle));
angle%= 360;
switch (angle)
- {
+ {
case 0:
break;
case 270:
@@ -393,7 +393,7 @@
g_warning("%s: %i degree rotation is not supported",
__FUNCTION__, angle);
break;
- }
+ }
return res;
}
static SANE_Int
@@ -407,21 +407,21 @@
g_value_init (real, G_TYPE_DOUBLE);
g_value_init (trans, G_PARAM_SPEC_VALUE_TYPE (mpps->tl_x));
g_param_value_set_default (mpps->tl_x, trans);
- GSRectangle *r, *u; /* rotation, unit */
+ GnomeScanRectangle *r, *u; /* rotation, unit */
guint unit = gs_param_spec_get_unit (mpps->tl_x);
#define set_opt(opt,val) g_value_set_double(real,(val)); \
- g_value_transform(real, trans); \
+ g_value_transform(real, trans); \
i=i|gsane_scanner_option_set_value (mp->gss, mpps->opt, trans)
#define get_opt(opt,var) v=gsane_scanner_option_get_value (mp->gss, mpps->opt); \
- g_value_transform(v,real); \
+ g_value_transform(v,real); \
g_free(v); \
var = g_value_get_double(real);
- r = gs_rectangle_rotate (&mpps->roi, &mpps->area, mpps->rotation);
- u = gs_rectangle_convert_from_mm (r, unit, mpps->resolution);
+ r = gnome_scan_rectangle_rotate (&mpps->roi, &mpps->area, mpps->rotation);
+ u = gnome_scan_rectangle_convert_from_mm (r, unit, mpps->resolution);
g_free(r);
set_opt(tl_x, u->x);
@@ -462,10 +462,10 @@
mpps->ps = g_value_get_boxed (value);
switch (gs_param_spec_get_unit (mpps->tl_x)) {
- case GS_UNIT_MM:
+ case GNOME_SCAN_UNIT_MM:
unit = GTK_UNIT_MM;
break;
- case GS_UNIT_PIXEL:
+ case GNOME_SCAN_UNIT_PIXEL:
default:
/* warning: gtk uses hardcoded 72dpi resolution */
unit = GTK_UNIT_PIXEL;
@@ -528,7 +528,7 @@
meta_param_paper_size_get_value (MetaParam *mp, GParamSpec *spec)
{
/* TODO: implement get value : convert SANE value to origin, papersize,
- and orientation */
+ and orientation */
return NULL;
}
@@ -666,7 +666,7 @@
gs_param_spec_set_group (spec, GS_PARAM_GROUP_SCANNER_FRONT);
gs_param_spec_set_domain (spec, gs_param_spec_get_domain (mps->source));
gs_param_spec_set_index (spec, gs_param_spec_get_index (mps->source));
- gs_param_spec_set_unit (spec, GS_UNIT_NONE);
+ gs_param_spec_set_unit (spec, GNOME_SCAN_UNIT_NONE);
g_param_spec_set_qdata (spec, GSANE_META_PARAM_QUARK, mp);
gnome_scan_plugin_params_add (GNOME_SCAN_PLUGIN (mp->gss), spec);
@@ -774,7 +774,7 @@
gs_param_spec_set_index (mpp->preview, 64); /* always last ? */
}
- gs_param_spec_set_unit (mpp->preview, GS_UNIT_NONE);
+ gs_param_spec_set_unit (mpp->preview, GNOME_SCAN_UNIT_NONE);
g_param_spec_set_qdata (mpp->preview, GSANE_META_PARAM_QUARK, mp);
gnome_scan_plugin_params_add (GNOME_SCAN_PLUGIN (mp->gss),
mpp->preview);
Modified: trunk/modules/gsane-meta-param.h
==============================================================================
--- trunk/modules/gsane-meta-param.h (original)
+++ trunk/modules/gsane-meta-param.h Sun May 4 13:36:38 2008
@@ -113,12 +113,12 @@
/* values */
GtkPaperSize *ps;
GtkPageOrientation po;
- GSPoint *origin;
+ GnomeScanPoint *origin;
- guint rotation;
- gdouble resolution;
- GSRectangle roi;
- GSRectangle area;
+ guint rotation;
+ gdouble resolution;
+ GnomeScanRectangle roi;
+ GnomeScanRectangle area;
};
GType meta_param_paper_size_get_type (void) G_GNUC_CONST;
Modified: trunk/modules/gsane-scanner.c
==============================================================================
--- trunk/modules/gsane-scanner.c (original)
+++ trunk/modules/gsane-scanner.c Sun May 4 13:36:38 2008
@@ -783,26 +783,26 @@
/* UNIT */
switch (desc->unit) {
case SANE_UNIT_PIXEL:
- unit = GS_UNIT_PIXEL;
+ unit = GNOME_SCAN_UNIT_PIXEL;
break;
case SANE_UNIT_BIT:
- unit = GS_UNIT_BIT;
+ unit = GNOME_SCAN_UNIT_BIT;
break;
case SANE_UNIT_MM:
- unit = GS_UNIT_MM;
+ unit = GNOME_SCAN_UNIT_MM;
break;
case SANE_UNIT_DPI:
- unit = GS_UNIT_DPI;
+ unit = GNOME_SCAN_UNIT_DPI;
break;
case SANE_UNIT_PERCENT:
- unit = GS_UNIT_PERCENT;
+ unit = GNOME_SCAN_UNIT_PERCENT;
break;
case SANE_UNIT_MICROSECOND:
- unit = GS_UNIT_PERCENT;
+ unit = GNOME_SCAN_UNIT_PERCENT;
break;
case SANE_UNIT_NONE:
default:
- unit = GS_UNIT_NONE;
+ unit = GNOME_SCAN_UNIT_NONE;
break;
}
Modified: trunk/modules/gsfile-scanner.c
==============================================================================
--- trunk/modules/gsfile-scanner.c (original)
+++ trunk/modules/gsfile-scanner.c Sun May 4 13:36:38 2008
@@ -96,7 +96,7 @@
GS_PARAM_GROUP_SCANNER_FRONT,
formats, G_PARAM_WRITABLE);
gs_param_spec_set_domain (pspec, GETTEXT_PACKAGE);
- gs_param_spec_set_unit (pspec, GS_UNIT_NONE);
+ gs_param_spec_set_unit (pspec, GNOME_SCAN_UNIT_NONE);
gnome_scan_plugin_params_add (GNOME_SCAN_PLUGIN (object), pspec);
GNOME_SCANNER (object)->status = GNOME_SCANNER_READY;
}
Modified: trunk/src/flegita-gimp-sink.c
==============================================================================
--- trunk/src/flegita-gimp-sink.c (original)
+++ trunk/src/flegita-gimp-sink.c Sun May 4 13:36:38 2008
@@ -80,7 +80,7 @@
_("Scanned image"),
G_PARAM_WRITABLE);
gs_param_spec_set_domain (pspec, GETTEXT_PACKAGE);
- gs_param_spec_set_unit (pspec, GS_UNIT_NONE);
+ gs_param_spec_set_unit (pspec, GNOME_SCAN_UNIT_NONE);
gnome_scan_plugin_params_add (GNOME_SCAN_PLUGIN (object),
pspec);
}
Modified: trunk/src/flegita-sink.c
==============================================================================
--- trunk/src/flegita-sink.c (original)
+++ trunk/src/flegita-sink.c Sun May 4 13:36:38 2008
@@ -114,7 +114,7 @@
formats,
G_PARAM_WRITABLE);
gs_param_spec_set_domain (pspec, GETTEXT_PACKAGE);
- gs_param_spec_set_unit (pspec, GS_UNIT_NONE);
+ gs_param_spec_set_unit (pspec, GNOME_SCAN_UNIT_NONE);
gnome_scan_plugin_params_add (GNOME_SCAN_PLUGIN (object),
pspec);
@@ -138,7 +138,7 @@
FLEGITA_PARAM_GROUP_PNG_OPTIONS,
min, max, step, val, G_PARAM_WRITABLE);
gs_param_spec_set_domain (pspec, GETTEXT_PACKAGE);
- gs_param_spec_set_unit (pspec, GS_UNIT_NONE);
+ gs_param_spec_set_unit (pspec, GNOME_SCAN_UNIT_NONE);
gnome_scan_plugin_params_add (GNOME_SCAN_PLUGIN (object),
pspec);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]