diff --git a/Makefile.am b/Makefile.am index 2546d59..70972af 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ AUTOMAKE_OPTIONS = dist-bzip2 -SUBDIRS = src data tests pam po +SUBDIRS = src data tests pam doc po EXTRA_DIST = TODO intltool-extract.in intltool-merge.in intltool-update.in diff --git a/autogen.sh b/autogen.sh index 16bc9ec..672f6f4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,7 +2,9 @@ aclocal || exit 1 autoheader || exit 1 glib-gettextize -f -c || exit 1 +gtkdocize --copy || exit 1 intltoolize -c -f || exit 1 +libtoolize -c || exit 1 autoconf || exit 1 automake -a -c || exit 1 ./configure $* diff --git a/configure.ac b/configure.ac index e9b48f7..65cae9c 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,7 @@ AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_HEADERS([config.h]) AC_PREREQ([2.50]) +AC_PROG_LIBTOOL AC_PROG_CC AM_PROG_CC_C_O @@ -47,6 +48,9 @@ AC_MSG_RESULT([$has_pam]) AC_CHECK_PROG([POLKIT_POLICY_FILE_VALIDATE], [polkit-policy-file-validate], [polkit-policy-file-validate]) +AC_PATH_PROG([XSLTPROC], [xsltproc]) +GTK_DOC_CHECK([1.3]) + AS_AC_EXPAND(DATADIR, $datadir) DBUS_SERVICES_DIR="$DATADIR/dbus-1/services" @@ -57,6 +61,14 @@ AC_DEFINE_UNQUOTED(SYSCONFDIR, "$sysconfdir", [Where the configuration file will GNOME_COMPILE_WARNINGS -AC_CONFIG_FILES([Makefile] [src/Makefile] [data/Makefile] [tests/Makefile] [pam/Makefile] [po/Makefile.in]) -AC_OUTPUT - +AC_OUTPUT([ +Makefile +src/Makefile +data/Makefile +tests/Makefile +pam/Makefile +doc/Makefile +doc/version.xml +doc/dbus/Makefile +po/Makefile.in +]) diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..dfe05eb --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,77 @@ + +SUBDIRS = dbus + +NULL = + +AUTOMAKE_OPTIONS = 1.7 + +# The name of the module. +DOC_MODULE=fprintd + +# The top-level SGML file. +DOC_MAIN_SGML_FILE=fprintd-docs.xml + +# Extra options to supply to gtkdoc-scan +SCAN_OPTIONS=--ignore-headers=config.h + +# The directory containing the source code. Relative to $(srcdir) +DOC_SOURCE_DIR=../src + +# Used for dependencies +HFILE_GLOB= +#$(top_srcdir)/policy/*.h +CFILE_GLOB= +#$(top_srcdir)/policy/*.c + +# Headers to ignore +IGNORE_HFILES= \ + $(NULL) + +# CFLAGS and LDFLAGS for compiling scan program. Only needed +# if $(DOC_MODULE).types is non-empty. +INCLUDES = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir)/src \ + $(NULL) + +GTKDOC_LIBS = \ + $(GLIB_LIBS) \ + $(top_builddir)/src/libfprintd.la \ + $(NULL) + +# Extra options to supply to gtkdoc-mkdb +MKDB_OPTIONS=--sgml-mode --output-format=xml + +# Extra options to supply to gtkdoc-mktmpl +MKTMPL_OPTIONS= + +# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE) +content_files = \ + version.xml \ + dbus/net.reactivated.Fprint.Manager.ref.xml \ + dbus/net.reactivated.Fprint.Device.ref.xml \ + $(NULL) + +# Images to copy into HTML directory +HTML_IMAGES = \ + $(NULL) + +# Extra options to supply to gtkdoc-fixref +FIXXREF_OPTIONS= + +MAINTAINERCLEANFILES = \ + *~ \ + Makefile.in \ + fprintd.types \ + fprintd-*.txt \ + $(NULL) + +if ENABLE_GTK_DOC +include $(top_srcdir)/gtk-doc.make +else +EXTRA_DIST = +endif + +# Version information for marking the documentation +EXTRA_DIST += version.xml.in + diff --git a/doc/dbus/Makefile.am b/doc/dbus/Makefile.am new file mode 100644 index 0000000..2162c23 --- /dev/null +++ b/doc/dbus/Makefile.am @@ -0,0 +1,15 @@ + +all : net.reactivated.Fprint.Manager.ref.xml net.reactivated.Fprint.Device.ref.xml + +net.reactivated.Fprint.Manager.ref.xml : $(top_srcdir)/src/manager.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl + echo """" > $@ + $(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@ + +net.reactivated.Fprint.Device.ref.xml : $(top_srcdir)/src/device.xml $(top_srcdir)/doc/dbus/spec-to-docbook.xsl + echo """" > $@ + $(XSLTPROC) $(top_srcdir)/doc/dbus/spec-to-docbook.xsl $< | tail -n +2 >> $@ + +EXTRA_DIST = spec-to-docbook.xsl dbus-introspect-docs.dtd + +clean-local : + rm -f *~ *.ref.xml diff --git a/doc/dbus/dbus-introspect-docs.dtd b/doc/dbus/dbus-introspect-docs.dtd new file mode 100644 index 0000000..ca918fb --- /dev/null +++ b/doc/dbus/dbus-introspect-docs.dtd @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/dbus/spec-to-docbook.xsl b/doc/dbus/spec-to-docbook.xsl new file mode 100644 index 0000000..1864414 --- /dev/null +++ b/doc/dbus/spec-to-docbook.xsl @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + interface + + + + Methods + + + + + + + + + + + Signals + + + + + + + + + + + Implemented Interfaces + + Objects implementing also implements + org.freedesktop.DBus.Introspectable, + org.freedesktop.DBus.Properties + + + + + + + Properties + + + + + + + + + + + Description + + + + + + + Details + + + + + + + + + Signal Details + + + + + + + + + + + Property Details + + + + + + + + + + + + + + + + +: + + + + + + + + + + + + + + + + + + + + + + <anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>:<xsl:value-of select="@name"/></xsl:attribute></anchor>The "<xsl:value-of select="@name"/>" property + +'' + + + + + + + + + + + + + +: + + + + + + + + + + + + + + + + + + + + + <anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>::<xsl:value-of select="@name"/></xsl:attribute></anchor>The <xsl:value-of select="@name"/> signal + + () + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Since + + + + + + + + /> + + + + + + + is deprecated since version and should not be used in newly-written code. Use + + + + + : + + + :: + + + . + + + + + + + + + + + + + + + +instead. + + + + + + + + + + + + + + + + + +See also: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +: + + + + + + + + + + + + Errors + + + + : + + + + + + + + + + + + Permissions + + + + + + + + + + + + + + + + + + <anchor role="function"><xsl:attribute name="id"><xsl:value-of select="$basename"/>.<xsl:value-of select="@name"/></xsl:attribute></anchor><xsl:value-of select="@name"/> () + + () + + + + + + + + + + + + + + + + +:'' + + + + + + + + + + + + +::() + + + + + + + + + + + + +.() + + + + + +'' +, + + + + + +'' +, + + + + + + +'' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/fprintd-docs.xml b/doc/fprintd-docs.xml new file mode 100644 index 0000000..1b2e4ef --- /dev/null +++ b/doc/fprintd-docs.xml @@ -0,0 +1,82 @@ + + +]> + + + fprintd Reference Manual + Version &version; + + + Bastien + Nocera + +
+ hadess@hadess.net +
+
+
+
+ + + 2008 + The DeviceKit-disks Authors + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free + Documentation License, Version 1.1 or any later + version published by the Free Software Foundation with no + Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. You may obtain a copy of the GNU Free + Documentation License from the Free Software + Foundation by visiting their Web site or by writing + to: + +
+ The Free Software Foundation, Inc., + 59 Temple Place - Suite 330, + Boston, MA 02111-1307, + USA +
+
+ + + Many of the names used by companies to distinguish their + products and services are claimed as trademarks. Where those + names appear in any GNOME documentation, and those trademarks + are made aware to the members of the GNOME Documentation + Project, the names have been printed in caps or initial caps. + +
+
+ + + D-Bus API Reference + + + This part documents the D-Bus interface used to access the + fprintd daemon. + + + + + + + + Index + + + + + + License + +FIXME: MISSING XINCLUDE CONTENT + + +
diff --git a/doc/version.xml.in b/doc/version.xml.in new file mode 100644 index 0000000..d78bda9 --- /dev/null +++ b/doc/version.xml.in @@ -0,0 +1 @@ +@VERSION@ diff --git a/src/Makefile.am b/src/Makefile.am index 5b0507b..9ab4ca2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,17 +5,22 @@ CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = manager.xml device.xml fprintd-marshal.list libexec_PROGRAMS = fprintd +noinst_LTLIBRARIES = libfprintd.la + +AM_CFLAGS = $(WARN_CFLAGS) $(FPRINT_CFLAGS) $(DAEMON_CFLAGS) -DLOCALEDIR=\""$(datadir)/locale"\" -DPLUGINDIR=\""$(libdir)/fprintd/modules"\" + +libfprintd_la_SOURCES = \ + manager.c device.c \ + egg-dbus-monitor.c egg-dbus-monitor.h \ + $(MARSHALFILES) \ + fprintd.h +libfprintd_la_LIBADD = $(FPRINT_LIBS) $(DAEMON_LIBS) +libfprintd_la_LDFLAGS = -no-undefined fprintd_SOURCES = \ - main.c fprintd.h \ - manager.c \ - device.c \ - file_storage.c file_storage.h storage.h \ - egg-dbus-monitor.c egg-dbus-monitor.h \ - $(MARSHALFILES) - -fprintd_LDADD = $(FPRINT_LIBS) $(DAEMON_LIBS) -fprintd_CFLAGS = $(WARN_CFLAGS) $(FPRINT_CFLAGS) $(DAEMON_CFLAGS) -DLOCALEDIR=\""$(datadir)/locale"\" -DPLUGINDIR=\""$(libdir)/fprintd/modules"\" + main.c \ + file_storage.c file_storage.h storage.h +fprintd_LDADD = libfprintd.la manager-dbus-glue.h: manager.xml dbus-binding-tool --prefix=fprint_manager --mode=glib-server $< --output=$@ diff --git a/src/fprintd.h b/src/fprintd.h index bed50b6..ce52b0e 100644 --- a/src/fprintd.h +++ b/src/fprintd.h @@ -27,7 +27,6 @@ #define TIMEOUT 30 #define FPRINT_SERVICE_NAME "net.reactivated.Fprint" extern DBusGConnection *fprintd_dbus_conn; -extern gboolean no_timeout; GQuark fprint_error_quark(void); /* Errors */ @@ -66,7 +65,7 @@ struct FprintManagerClass { typedef struct FprintManager FprintManager; typedef struct FprintManagerClass FprintManagerClass; -FprintManager *fprint_manager_new(void); +FprintManager *fprint_manager_new(gboolean no_timeout); GError *fprint_manager_get_error(FprintManager *manager); GType fprint_manager_get_type(void); diff --git a/src/main.c b/src/main.c index e7c29be..7de9ff7 100644 --- a/src/main.c +++ b/src/main.c @@ -33,18 +33,10 @@ #include "storage.h" #include "file_storage.h" -DBusGConnection *fprintd_dbus_conn = NULL; -gboolean no_timeout = FALSE; +extern DBusGConnection *fprintd_dbus_conn; +static gboolean no_timeout = FALSE; static gboolean g_fatal_warnings = FALSE; -GQuark fprint_error_quark(void) -{ - static GQuark quark = 0; - if (!quark) - quark = g_quark_from_static_string("fprintd-error-quark"); - return quark; -} - struct fdsource { GSource source; GSList *pollfds; @@ -353,7 +345,7 @@ int main(int argc, char **argv) /* create the one instance of the Manager object to be shared between * all fprintd users */ - manager = fprint_manager_new(); + manager = fprint_manager_new(no_timeout); error = fprint_manager_get_error (manager); if (error != NULL) { g_error("Couldn't create manager object: %s", error->message); diff --git a/src/manager.c b/src/manager.c index 5c8a3b6..2c1c32e 100644 --- a/src/manager.c +++ b/src/manager.c @@ -27,6 +27,8 @@ #include "fprintd.h" +DBusGConnection *fprintd_dbus_conn; + static gboolean fprint_manager_get_devices(FprintManager *manager, GPtrArray **devices, GError **error); static gboolean fprint_manager_get_default_device(FprintManager *manager, @@ -41,6 +43,7 @@ typedef struct { GError *last_error; GSList *dev_registry; + gboolean no_timeout; guint timeout_id; } FprintManagerPrivate; @@ -105,7 +108,7 @@ fprint_manager_in_use_notified (FprintDevice *rdev, GParamSpec *spec, FprintMana num_devices_used++; } - if (num_devices_used == 0 && !no_timeout) + if (num_devices_used == 0 && !priv->no_timeout) priv->timeout_id = g_timeout_add_seconds (TIMEOUT, (GSourceFunc) fprint_manager_timeout_cb, manager); } @@ -140,13 +143,20 @@ fprint_manager_init (FprintManager *manager) g_free(path); } - if (!no_timeout) + if (!priv->no_timeout) priv->timeout_id = g_timeout_add_seconds (TIMEOUT, (GSourceFunc) fprint_manager_timeout_cb, manager); } -FprintManager *fprint_manager_new(void) +FprintManager *fprint_manager_new(gboolean no_timeout) { - return g_object_new(FPRINT_TYPE_MANAGER, NULL); + FprintManagerPrivate *priv; + GObject *object; + + object = g_object_new(FPRINT_TYPE_MANAGER, NULL); + priv = FPRINT_MANAGER_GET_PRIVATE (object); + priv->no_timeout = no_timeout; + + return FPRINT_MANAGER (object); } GError *fprint_manager_get_error(FprintManager *manager) @@ -192,3 +202,12 @@ static gboolean fprint_manager_get_default_device(FprintManager *manager, return FALSE; } } + +GQuark fprint_error_quark(void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string("fprintd-error-quark"); + return quark; +} +