mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
main: Use G_DECLARE_FINAL_TYPE to define objet
This commit is contained in:
committed by
Bastien Nocera
parent
18d4aa6d7d
commit
cc4bac3410
10
src/device.c
10
src/device.c
@ -139,7 +139,6 @@ enum fprint_device_signals {
|
|||||||
NUM_SIGNALS,
|
NUM_SIGNALS,
|
||||||
};
|
};
|
||||||
|
|
||||||
static GObjectClass *parent_class = NULL;
|
|
||||||
static guint32 last_id = ~0;
|
static guint32 last_id = ~0;
|
||||||
static guint signals[NUM_SIGNALS] = { 0, };
|
static guint signals[NUM_SIGNALS] = { 0, };
|
||||||
|
|
||||||
@ -214,7 +213,6 @@ static void fprint_device_class_init(FprintDeviceClass *klass)
|
|||||||
|
|
||||||
dbus_g_object_type_install_info(FPRINT_TYPE_DEVICE,
|
dbus_g_object_type_install_info(FPRINT_TYPE_DEVICE,
|
||||||
&dbus_glib_fprint_device_object_info);
|
&dbus_glib_fprint_device_object_info);
|
||||||
parent_class = g_type_class_peek_parent(klass);
|
|
||||||
|
|
||||||
gobject_class->finalize = fprint_device_finalize;
|
gobject_class->finalize = fprint_device_finalize;
|
||||||
gobject_class->set_property = fprint_device_set_property;
|
gobject_class->set_property = fprint_device_set_property;
|
||||||
@ -727,7 +725,7 @@ static void fprint_device_release(FprintDevice *rdev,
|
|||||||
static void verify_cb(FpDevice *dev, GAsyncResult *res, void *user_data)
|
static void verify_cb(FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
struct FprintDevice *rdev = user_data;
|
FprintDevice *rdev = user_data;
|
||||||
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
|
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
|
||||||
gboolean success;
|
gboolean success;
|
||||||
const char *name;
|
const char *name;
|
||||||
@ -775,7 +773,7 @@ static void verify_cb(FpDevice *dev, GAsyncResult *res, void *user_data)
|
|||||||
static void identify_cb(FpDevice *dev, GAsyncResult *res, void *user_data)
|
static void identify_cb(FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
struct FprintDevice *rdev = user_data;
|
FprintDevice *rdev = user_data;
|
||||||
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
|
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
|
||||||
const char *name;
|
const char *name;
|
||||||
gboolean success;
|
gboolean success;
|
||||||
@ -969,7 +967,7 @@ static void enroll_progress_cb(FpDevice *dev,
|
|||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GError *error)
|
GError *error)
|
||||||
{
|
{
|
||||||
struct FprintDevice *rdev = user_data;
|
FprintDevice *rdev = user_data;
|
||||||
const char *name = enroll_result_to_name (FALSE, FALSE, error);
|
const char *name = enroll_result_to_name (FALSE, FALSE, error);
|
||||||
|
|
||||||
g_debug("enroll_stage_cb: result %s", name);
|
g_debug("enroll_stage_cb: result %s", name);
|
||||||
@ -1072,7 +1070,7 @@ fprint_device_create_enroll_template(FprintDevice *rdev, gint finger_num)
|
|||||||
static void enroll_cb(FpDevice *dev, GAsyncResult *res, void *user_data)
|
static void enroll_cb(FpDevice *dev, GAsyncResult *res, void *user_data)
|
||||||
{
|
{
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
struct FprintDevice *rdev = user_data;
|
FprintDevice *rdev = user_data;
|
||||||
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
|
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
|
||||||
g_autoptr(FpPrint) print = NULL;
|
g_autoptr(FpPrint) print = NULL;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|||||||
@ -48,47 +48,23 @@ typedef enum {
|
|||||||
|
|
||||||
/* Manager */
|
/* Manager */
|
||||||
#define FPRINT_TYPE_MANAGER (fprint_manager_get_type())
|
#define FPRINT_TYPE_MANAGER (fprint_manager_get_type())
|
||||||
#define FPRINT_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST((object), FPRINT_TYPE_MANAGER, FprintManager))
|
G_DECLARE_FINAL_TYPE (FprintManager, fprint_manager, FPRINT, MANAGER, GObject)
|
||||||
#define FPRINT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), FPRINT_TYPE_MANAGER, FprintManagerClass))
|
|
||||||
#define FPRINT_IS_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), FPRINT_TYPE_MANAGER))
|
|
||||||
#define FPRINT_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FPRINT_TYPE_MANAGER))
|
|
||||||
#define FPRINT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), FPRINT_TYPE_MANAGER, FprintManagerClass))
|
|
||||||
|
|
||||||
struct FprintManager {
|
struct _FprintManager {
|
||||||
GObject parent;
|
GObject parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FprintManagerClass {
|
|
||||||
GObjectClass parent;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct FprintManager FprintManager;
|
|
||||||
typedef struct FprintManagerClass FprintManagerClass;
|
|
||||||
|
|
||||||
FprintManager *fprint_manager_new(gboolean no_timeout);
|
FprintManager *fprint_manager_new(gboolean no_timeout);
|
||||||
GType fprint_manager_get_type(void);
|
|
||||||
|
|
||||||
/* Device */
|
/* Device */
|
||||||
#define FPRINT_TYPE_DEVICE (fprint_device_get_type())
|
#define FPRINT_TYPE_DEVICE (fprint_device_get_type())
|
||||||
#define FPRINT_DEVICE(object) (G_TYPE_CHECK_INSTANCE_CAST((object), FPRINT_DEVICE_TYPE, FprintDevice))
|
G_DECLARE_FINAL_TYPE (FprintDevice, fprint_device, FPRINT, DEVICE, GObject)
|
||||||
#define FPRINT_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), FPRINT_DEVICE_TYPE, FprintDeviceClass))
|
|
||||||
#define FPRINT_IS_DEVICE(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), FPRINT_TYPE_DEVICE))
|
|
||||||
#define FPRINT_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), FPRINT_TYPE_DEVICE))
|
|
||||||
#define FPRINT_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), FPRINT_TYPE_DEVICE, FprintDeviceClass))
|
|
||||||
|
|
||||||
struct FprintDevice {
|
struct _FprintDevice {
|
||||||
GObject parent;
|
GObject parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FprintDeviceClass {
|
|
||||||
GObjectClass parent;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct FprintDevice FprintDevice;
|
|
||||||
typedef struct FprintDeviceClass FprintDeviceClass;
|
|
||||||
|
|
||||||
FprintDevice *fprint_device_new(FpDevice *dev);
|
FprintDevice *fprint_device_new(FpDevice *dev);
|
||||||
GType fprint_device_get_type(void);
|
|
||||||
guint32 _fprint_device_get_id(FprintDevice *rdev);
|
guint32 _fprint_device_get_id(FprintDevice *rdev);
|
||||||
/* Print */
|
/* Print */
|
||||||
/* TODO */
|
/* TODO */
|
||||||
|
|||||||
@ -44,8 +44,6 @@ typedef struct
|
|||||||
guint timeout_id;
|
guint timeout_id;
|
||||||
} FprintManagerPrivate;
|
} FprintManagerPrivate;
|
||||||
|
|
||||||
static GObjectClass *parent_class = NULL;
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE(FprintManager, fprint_manager, G_TYPE_OBJECT, G_ADD_PRIVATE (FprintManager))
|
G_DEFINE_TYPE_WITH_CODE(FprintManager, fprint_manager, G_TYPE_OBJECT, G_ADD_PRIVATE (FprintManager))
|
||||||
|
|
||||||
static void fprint_manager_finalize(GObject *object)
|
static void fprint_manager_finalize(GObject *object)
|
||||||
@ -55,7 +53,7 @@ static void fprint_manager_finalize(GObject *object)
|
|||||||
g_clear_object (&priv->context);
|
g_clear_object (&priv->context);
|
||||||
g_slist_free(priv->dev_registry);
|
g_slist_free(priv->dev_registry);
|
||||||
|
|
||||||
G_OBJECT_CLASS(parent_class)->finalize(object);
|
G_OBJECT_CLASS(fprint_manager_parent_class)->finalize(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fprint_manager_class_init(FprintManagerClass *klass)
|
static void fprint_manager_class_init(FprintManagerClass *klass)
|
||||||
@ -65,7 +63,6 @@ static void fprint_manager_class_init(FprintManagerClass *klass)
|
|||||||
dbus_g_error_domain_register (FPRINT_ERROR, FPRINT_ERROR_DBUS_INTERFACE, FPRINT_TYPE_ERROR);
|
dbus_g_error_domain_register (FPRINT_ERROR, FPRINT_ERROR_DBUS_INTERFACE, FPRINT_TYPE_ERROR);
|
||||||
|
|
||||||
G_OBJECT_CLASS(klass)->finalize = fprint_manager_finalize;
|
G_OBJECT_CLASS(klass)->finalize = fprint_manager_finalize;
|
||||||
parent_class = g_type_class_peek_parent(klass);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *get_device_path(FprintDevice *rdev)
|
static gchar *get_device_path(FprintDevice *rdev)
|
||||||
|
|||||||
Reference in New Issue
Block a user