gnome-scan r605 - in trunk: . lib modules
- From: bersace svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-scan r605 - in trunk: . lib modules
- Date: Thu, 8 May 2008 14:58:00 +0100 (BST)
Author: bersace
Date: Thu May 8 13:58:00 2008
New Revision: 605
URL: http://svn.gnome.org/viewvc/gnome-scan?rev=605&view=rev
Log:
Dropped gnome-scan-utils.[hc] in favor of gnome-scan-common.vala.
Removed:
trunk/lib/gnome-scan-utils.c
trunk/lib/gnome-scan-utils.h
Modified:
trunk/ChangeLog
trunk/lib/Makefile.am
trunk/lib/gnome-scan-common.vala
trunk/lib/gnome-scan-dialog.c
trunk/lib/gnome-scan-param-specs.h
trunk/lib/gnome-scan-processor-common.c
trunk/modules/gsane-common.c
trunk/modules/gsane-common.h
trunk/modules/gsfile-scanner.c
Modified: trunk/lib/Makefile.am
==============================================================================
--- trunk/lib/Makefile.am (original)
+++ trunk/lib/Makefile.am Thu May 8 13:58:00 2008
@@ -72,8 +72,6 @@
gnome-scan-paper-size-widget.c \
gnome-scan-page-orientation-widget.h \
gnome-scan-page-orientation-widget.c \
- gnome-scan-utils.h \
- gnome-scan-utils.c \
gnome-scan-preview-sink.h \
gnome-scan-preview-sink.c \
gnome-scan-preview-plugin.h \
@@ -97,7 +95,6 @@
includegs_HEADERS = \
gnome-scan.h \
$(BUILT_HEADER) \
- gnome-scan-utils.h \
gnome-scan-common.h \
gnome-scan-settings.h \
gnome-scan-plugin.h \
Modified: trunk/lib/gnome-scan-common.vala
==============================================================================
--- trunk/lib/gnome-scan-common.vala (original)
+++ trunk/lib/gnome-scan-common.vala Thu May 8 13:58:00 2008
@@ -3,8 +3,6 @@
namespace Gnome {
namespace Scan {
- public const double MM_PER_INCH = 25.4;
-
public enum Unit {
NONE = -1,
PIXEL ,//= Gtk.Unit.PIXEL,
@@ -22,9 +20,33 @@
BUSY
}
+ public struct Point {
+ double x;
+ double y;
+ }
+
+ public struct Format {
+ string name;
+ string description;
+ string domain;
+ string[] mime_types;
+ string[] extensions;
+ }
+
+ private const double MM_PER_INCH = 25.4;
+
+ private string get_enum_nick(GLib.Type enum_type,
+ int value)
+ {
+ EnumClass klass = (EnumClass) enum_type.class_ref();
+ weak EnumValue evalue = klass.get_value(value);
+ return evalue.value_nick;
+ }
+
private void warn_unsupported_unit(Unit unit)
{
- warning("Unit %i conversion not supported.", unit);
+ warning("Unit %s conversion not supported.",
+ get_enum_nick(typeof(Unit), unit));
}
/**
Modified: trunk/lib/gnome-scan-dialog.c
==============================================================================
--- trunk/lib/gnome-scan-dialog.c (original)
+++ trunk/lib/gnome-scan-dialog.c Thu May 8 13:58:00 2008
@@ -196,23 +196,12 @@
/* PREVIEW */
static void gsd_preview_scanner_selected (GnomeScanDialog *gsd);
-GS_DEFINE_QUARK (gsd_page, "page");
-#define GSD_PAGE_QUARK (gsd_page_quark())
-
-GS_DEFINE_QUARK (gsd_group, "group");
-#define GSD_GROUP_QUARK (gsd_group_quark())
-
-GS_DEFINE_QUARK (gsd_table, "table");
-#define GSD_TABLE_QUARK (gsd_table_quark())
-
-GS_DEFINE_QUARK (gsd_widget, "widget");
-#define GSD_WIDGET_QUARK (gsd_widget_quark())
-
-GS_DEFINE_QUARK (gsd_plugin, "plugin");
-#define GSD_PLUGIN_QUARK (gsd_plugin_quark())
-
-GS_DEFINE_QUARK (gsd_label, "label");
-#define GSD_LABEL_QUARK (gsd_label_quark())
+#define GSD_PAGE_QUARK g_quark_from_string("page")
+#define GSD_GROUP_QUARK g_quark_from_string("group")
+#define GSD_TABLE_QUARK g_quark_from_string("table")
+#define GSD_WIDGET_QUARK g_quark_from_string("widget")
+#define GSD_PLUGIN_QUARK g_quark_from_string("plugin")
+#define GSD_LABEL_QUARK g_quark_from_string("label")
G_DEFINE_TYPE (GnomeScanDialog, gnome_scan_dialog, GTK_TYPE_DIALOG);
@@ -837,7 +826,7 @@
gtk_list_store_insert_with_values (priv->scanners, iter, G_MAXINT,
COLUMN_ICON, gnome_scanner_get_icon_name (scanner),
COLUMN_NAME, gnome_scan_plugin_get_name (GNOME_SCAN_PLUGIN (scanner)),
- COLUMN_STATUS, gnome_scanner_get_status_string (GNOME_SCANNER (scanner)),
+ COLUMN_STATUS, gnome_scanner_get_status_string (GNOME_SCAN_SCANNER (scanner)),
COLUMN_OBJECT, scanner,
-1);
g_object_set_data (G_OBJECT (scanner), "iter", iter);
Modified: trunk/lib/gnome-scan-param-specs.h
==============================================================================
--- trunk/lib/gnome-scan-param-specs.h (original)
+++ trunk/lib/gnome-scan-param-specs.h Thu May 8 13:58:00 2008
@@ -85,6 +85,41 @@
return type; \
}
+
+
+/**
+ * GS_DEFINE_QUARK:
+ * @quark_name: function prefix
+ * @String: The string passed to g_quark_from_string()
+ *
+ * Generate a function that generate a static quark from @String.
+ *
+ * For example:
+ * <programlisting>
+ 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;
+ }
+ * </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; \
+ }
+
/* GQuarks */
#define GS_PARAM_GROUP_QUARK (gs_group_quark ())
#define GS_PARAM_DOMAIN_QUARK (gs_domain_quark ())
Modified: trunk/lib/gnome-scan-processor-common.c
==============================================================================
--- trunk/lib/gnome-scan-processor-common.c (original)
+++ trunk/lib/gnome-scan-processor-common.c Thu May 8 13:58:00 2008
@@ -41,8 +41,7 @@
G_DEFINE_TYPE (GnomeScanProcessorCommon, gnome_scan_processor_common, GNOME_SCAN_TYPE_PLUGIN);
-GS_DEFINE_QUARK(gs_param_group_processing_common, N_("Common Processing"));
-#define GS_PARAM_GROUP_PROCESSING_COMMON (gs_param_group_processing_common_quark ())
+#define GS_PARAM_GROUP_PROCESSING_COMMON g_quark_from_string(N_("Common Processing"))
static void
gnome_scan_processor_common_init (GnomeScanProcessorCommon *object)
Modified: trunk/modules/gsane-common.c
==============================================================================
--- trunk/modules/gsane-common.c (original)
+++ trunk/modules/gsane-common.c Thu May 8 13:58:00 2008
@@ -23,8 +23,6 @@
#include "gsane-common.h"
#include <gnome-scan-param-specs.h>
-GS_DEFINE_QUARK(gsane_meta_param, "meta-param");
-
gboolean
gsane_str_matches_strv (const gchar *name, const gchar **names)
{
Modified: trunk/modules/gsane-common.h
==============================================================================
--- trunk/modules/gsane-common.h (original)
+++ trunk/modules/gsane-common.h Thu May 8 13:58:00 2008
@@ -41,7 +41,7 @@
#define gs_debug(...)
#endif
-#define GSANE_META_PARAM_QUARK (gsane_meta_param_quark ())
+#define GSANE_META_PARAM_QUARK g_quark_from_string("meta-param")
GQuark gsane_meta_param_quark () G_GNUC_CONST;
Modified: trunk/modules/gsfile-scanner.c
==============================================================================
--- trunk/modules/gsfile-scanner.c (original)
+++ trunk/modules/gsfile-scanner.c Thu May 8 13:58:00 2008
@@ -137,7 +137,7 @@
"blurb", _("Import from files."),
"icon-name", "gnome-mime-image",
NULL);
- return GNOME_SCANNER (object);
+ return GNOME_SCAN_SCANNER (object);
}
/* INTERNALS */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]