diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2022-04-18 07:22:29 +0900 |
---|---|---|
committer | 坂本 貴史 <o-takashi@sakamocchi.jp> | 2022-04-18 07:25:16 +0900 |
commit | cc0083eeb2b807c63b0f311d1642f579e63407f2 (patch) | |
tree | 534e0bcf31d69adafde54266658831d0bee9445c | |
parent | 115a7e395bfee71704e701d7a6e44fecd8d8379a (diff) | |
download | libhinoko-cc0083eeb2b807c63b0f311d1642f579e63407f2.tar.gz |
fw_iso_resource: make abstract object
Hinoko.FwIsoResource have common functionalities for
Hinoko.FwIsoResourceOnce and Hinoko.FwIsoResourceAuto. It's worth to become
abstract object.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r-- | src/fw_iso_resource.c | 22 | ||||
-rw-r--r-- | src/fw_iso_resource.h | 2 | ||||
-rw-r--r-- | src/hinoko.map | 1 | ||||
-rw-r--r-- | tests/fw-iso-resource | 3 |
4 files changed, 6 insertions, 22 deletions
diff --git a/src/fw_iso_resource.c b/src/fw_iso_resource.c index f8ee66a..8d88374 100644 --- a/src/fw_iso_resource.c +++ b/src/fw_iso_resource.c @@ -10,16 +10,16 @@ /** * HinokoFwIsoResource: - * An object to initiate requests and listen events of isochronous resource allocation/deallocation. + * An abstract object to listen events of isochronous resource allocation/deallocation. * - * A [class@FwIsoResource] is an object to initiate requests and listen events of isochronous - * resource allocation/deallocation by file descriptor owned internally. This object is designed to - * be used for any derived object. + * The [class@FwIsoResource] is an abstract object to listen events of isochronous resource + * allocation/deallocation by file descriptor owned internally. This object is designed to be used + * for any derived object. */ typedef struct { int fd; } HinokoFwIsoResourcePrivate; -G_DEFINE_TYPE_WITH_PRIVATE(HinokoFwIsoResource, hinoko_fw_iso_resource, G_TYPE_OBJECT) +G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(HinokoFwIsoResource, hinoko_fw_iso_resource, G_TYPE_OBJECT) /** * hinoko_fw_iso_resource_error_quark: @@ -138,18 +138,6 @@ static void hinoko_fw_iso_resource_init(HinokoFwIsoResource *self) } /** - * hinoko_fw_iso_resource_new: - * - * Allocate and return an instance of [class@FwIsoResource]. - * - * Returns: A [class@FwIsoResource]. - */ -HinokoFwIsoResource *hinoko_fw_iso_resource_new() -{ - return g_object_new(HINOKO_TYPE_FW_ISO_RESOURCE, NULL); -} - -/** * hinoko_fw_iso_resource_open: * @self: A [class@FwIsoResource]. * @path: A path of any Linux FireWire character device. diff --git a/src/fw_iso_resource.h b/src/fw_iso_resource.h index cbe8f76..85a1861 100644 --- a/src/fw_iso_resource.h +++ b/src/fw_iso_resource.h @@ -45,8 +45,6 @@ struct _HinokoFwIsoResourceClass { guint bandwidth, const GError *error); }; -HinokoFwIsoResource *hinoko_fw_iso_resource_new(); - void hinoko_fw_iso_resource_open(HinokoFwIsoResource *self, const gchar *path, gint open_flag, GError **error); diff --git a/src/hinoko.map b/src/hinoko.map index d6756ca..7683a4e 100644 --- a/src/hinoko.map +++ b/src/hinoko.map @@ -51,7 +51,6 @@ HINOKO_0_3_0 { HINOKO_0_4_0 { global: "hinoko_fw_iso_resource_get_type"; - "hinoko_fw_iso_resource_new"; "hinoko_fw_iso_resource_open"; "hinoko_fw_iso_resource_create_source"; "hinoko_fw_iso_resource_calculate_bandwidth"; diff --git a/tests/fw-iso-resource b/tests/fw-iso-resource index 0c14c1b..0e21af4 100644 --- a/tests/fw-iso-resource +++ b/tests/fw-iso-resource @@ -9,10 +9,9 @@ import gi gi.require_version('Hinoko', '0.0') from gi.repository import Hinoko -target = Hinoko.FwIsoResource() +target = Hinoko.FwIsoResource props = () methods = ( - 'new', 'open', 'create_source', 'calculate_bandwidth', |