mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
First pass at adding API docs through gtk-doc
Required a bit of mangling.
This commit is contained in:
committed by
Daniel Drake
parent
26aab5dc28
commit
3cd0a7aeaf
@ -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=$@
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
14
src/main.c
14
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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user