Commit c671b0fa authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

lib: drop the proxy- prefix from client, device, link, port & node

parent 5c47f1df
Pipeline #100421 passed with stage
in 1 minute and 55 seconds
......@@ -6,12 +6,12 @@
* SPDX-License-Identifier: MIT
*/
#include "proxy-client.h"
#include "client.h"
#include "private.h"
#include <pipewire/pipewire.h>
struct _WpProxyClient
struct _WpClient
{
WpProxy parent;
struct pw_client_info *info;
......@@ -20,39 +20,39 @@ struct _WpProxyClient
struct spa_hook listener;
};
G_DEFINE_TYPE (WpProxyClient, wp_proxy_client, WP_TYPE_PROXY)
G_DEFINE_TYPE (WpClient, wp_client, WP_TYPE_PROXY)
static void
wp_proxy_client_init (WpProxyClient * self)
wp_client_init (WpClient * self)
{
}
static void
wp_proxy_client_finalize (GObject * object)
wp_client_finalize (GObject * object)
{
WpProxyClient *self = WP_PROXY_CLIENT (object);
WpClient *self = WP_CLIENT (object);
g_clear_pointer (&self->info, pw_client_info_free);
G_OBJECT_CLASS (wp_proxy_client_parent_class)->finalize (object);
G_OBJECT_CLASS (wp_client_parent_class)->finalize (object);
}
static gconstpointer
wp_proxy_client_get_info (WpProxy * self)
wp_client_get_info (WpProxy * self)
{
return WP_PROXY_CLIENT (self)->info;
return WP_CLIENT (self)->info;
}
WpProperties *
wp_proxy_client_get_properties (WpProxy * self)
wp_client_get_properties (WpProxy * self)
{
return wp_properties_new_wrap_dict (WP_PROXY_CLIENT (self)->info->props);
return wp_properties_new_wrap_dict (WP_CLIENT (self)->info->props);
}
static void
client_event_info(void *data, const struct pw_client_info *info)
{
WpProxyClient *self = WP_PROXY_CLIENT (data);
WpClient *self = WP_CLIENT (data);
self->info = pw_client_info_update (self->info, info);
g_object_notify (G_OBJECT (self), "info");
......@@ -69,30 +69,29 @@ static const struct pw_client_events client_events = {
};
static void
wp_proxy_client_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
wp_client_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
{
WpProxyClient *self = WP_PROXY_CLIENT (proxy);
WpClient *self = WP_CLIENT (proxy);
pw_client_add_listener ((struct pw_client *) pw_proxy,
&self->listener, &client_events, self);
}
static void
wp_proxy_client_class_init (WpProxyClientClass * klass)
wp_client_class_init (WpClientClass * klass)
{
GObjectClass *object_class = (GObjectClass *) klass;
WpProxyClass *proxy_class = (WpProxyClass *) klass;
object_class->finalize = wp_proxy_client_finalize;
object_class->finalize = wp_client_finalize;
proxy_class->get_info = wp_proxy_client_get_info;
proxy_class->get_properties = wp_proxy_client_get_properties;
proxy_class->get_info = wp_client_get_info;
proxy_class->get_properties = wp_client_get_properties;
proxy_class->pw_proxy_created = wp_proxy_client_pw_proxy_created;
proxy_class->pw_proxy_created = wp_client_pw_proxy_created;
}
void
wp_proxy_client_update_permissions (WpProxyClient * self,
guint n_perm, ...)
wp_client_update_permissions (WpClient * self, guint n_perm, ...)
{
va_list args;
struct pw_permission *perm =
......@@ -105,17 +104,17 @@ wp_proxy_client_update_permissions (WpProxyClient * self,
}
va_end (args);
wp_proxy_client_update_permissions_array (self, n_perm, perm);
wp_client_update_permissions_array (self, n_perm, perm);
}
void
wp_proxy_client_update_permissions_array (WpProxyClient * self,
wp_client_update_permissions_array (WpClient * self,
guint n_perm, const struct pw_permission *permissions)
{
struct pw_client *pwp;
int client_update_permissions_result;
g_return_if_fail (WP_IS_PROXY_CLIENT (self));
g_return_if_fail (WP_IS_CLIENT (self));
pwp = (struct pw_client *) wp_proxy_get_pw_proxy (WP_PROXY (self));
g_return_if_fail (pwp != NULL);
......
......@@ -6,8 +6,8 @@
* SPDX-License-Identifier: MIT
*/
#ifndef __WIREPLUMBER_PROXY_CLIENT_H__
#define __WIREPLUMBER_PROXY_CLIENT_H__
#ifndef __WIREPLUMBER_CLIENT_H__
#define __WIREPLUMBER_CLIENT_H__
#include "proxy.h"
......@@ -15,16 +15,15 @@ G_BEGIN_DECLS
struct pw_permission;
#define WP_TYPE_PROXY_CLIENT (wp_proxy_client_get_type ())
#define WP_TYPE_CLIENT (wp_client_get_type ())
WP_API
G_DECLARE_FINAL_TYPE (WpProxyClient, wp_proxy_client, WP, PROXY_CLIENT, WpProxy)
G_DECLARE_FINAL_TYPE (WpClient, wp_client, WP, CLIENT, WpProxy)
WP_API
void wp_proxy_client_update_permissions (WpProxyClient * self,
guint n_perm, ...);
void wp_client_update_permissions (WpClient * self, guint n_perm, ...);
WP_API
void wp_proxy_client_update_permissions_array (WpProxyClient * self,
void wp_client_update_permissions_array (WpClient * self,
guint n_perm, const struct pw_permission *permissions);
G_END_DECLS
......
......@@ -6,12 +6,12 @@
* SPDX-License-Identifier: MIT
*/
#include "proxy-device.h"
#include "device.h"
#include "private.h"
#include <pipewire/pipewire.h>
struct _WpProxyDevice
struct _WpDevice
{
WpProxy parent;
struct pw_device_info *info;
......@@ -20,37 +20,37 @@ struct _WpProxyDevice
struct spa_hook listener;
};
G_DEFINE_TYPE (WpProxyDevice, wp_proxy_device, WP_TYPE_PROXY)
G_DEFINE_TYPE (WpDevice, wp_device, WP_TYPE_PROXY)
static void
wp_proxy_device_init (WpProxyDevice * self)
wp_device_init (WpDevice * self)
{
}
static void
wp_proxy_device_finalize (GObject * object)
wp_device_finalize (GObject * object)
{
WpProxyDevice *self = WP_PROXY_DEVICE (object);
WpDevice *self = WP_DEVICE (object);
g_clear_pointer (&self->info, pw_device_info_free);
G_OBJECT_CLASS (wp_proxy_device_parent_class)->finalize (object);
G_OBJECT_CLASS (wp_device_parent_class)->finalize (object);
}
static gconstpointer
wp_proxy_device_get_info (WpProxy * self)
wp_device_get_info (WpProxy * self)
{
return WP_PROXY_DEVICE (self)->info;
return WP_DEVICE (self)->info;
}
static WpProperties *
wp_proxy_device_get_properties (WpProxy * self)
wp_device_get_properties (WpProxy * self)
{
return wp_properties_new_wrap_dict (WP_PROXY_DEVICE (self)->info->props);
return wp_properties_new_wrap_dict (WP_DEVICE (self)->info->props);
}
static gint
wp_proxy_device_enum_params (WpProxy * self, guint32 id, guint32 start,
wp_device_enum_params (WpProxy * self, guint32 id, guint32 start,
guint32 num, const struct spa_pod *filter)
{
struct pw_device *pwp;
......@@ -65,7 +65,7 @@ wp_proxy_device_enum_params (WpProxy * self, guint32 id, guint32 start,
}
static gint
wp_proxy_device_set_param (WpProxy * self, guint32 id, guint32 flags,
wp_device_set_param (WpProxy * self, guint32 id, guint32 flags,
const struct spa_pod *param)
{
struct pw_device *pwp;
......@@ -81,7 +81,7 @@ wp_proxy_device_set_param (WpProxy * self, guint32 id, guint32 flags,
static void
device_event_info(void *data, const struct pw_device_info *info)
{
WpProxyDevice *self = WP_PROXY_DEVICE (data);
WpDevice *self = WP_DEVICE (data);
self->info = pw_device_info_update (self->info, info);
g_object_notify (G_OBJECT (self), "info");
......@@ -99,25 +99,25 @@ static const struct pw_device_events device_events = {
};
static void
wp_proxy_device_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
wp_device_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
{
WpProxyDevice *self = WP_PROXY_DEVICE (proxy);
WpDevice *self = WP_DEVICE (proxy);
pw_device_add_listener ((struct pw_device *) pw_proxy,
&self->listener, &device_events, self);
}
static void
wp_proxy_device_class_init (WpProxyDeviceClass * klass)
wp_device_class_init (WpDeviceClass * klass)
{
GObjectClass *object_class = (GObjectClass *) klass;
WpProxyClass *proxy_class = (WpProxyClass *) klass;
object_class->finalize = wp_proxy_device_finalize;
object_class->finalize = wp_device_finalize;
proxy_class->get_info = wp_proxy_device_get_info;
proxy_class->get_properties = wp_proxy_device_get_properties;
proxy_class->enum_params = wp_proxy_device_enum_params;
proxy_class->set_param = wp_proxy_device_set_param;
proxy_class->get_info = wp_device_get_info;
proxy_class->get_properties = wp_device_get_properties;
proxy_class->enum_params = wp_device_enum_params;
proxy_class->set_param = wp_device_set_param;
proxy_class->pw_proxy_created = wp_proxy_device_pw_proxy_created;
proxy_class->pw_proxy_created = wp_device_pw_proxy_created;
}
......@@ -6,16 +6,16 @@
* SPDX-License-Identifier: MIT
*/
#ifndef __WIREPLUMBER_PROXY_LINK_H__
#define __WIREPLUMBER_PROXY_LINK_H__
#ifndef __WIREPLUMBER_DEVICE_H__
#define __WIREPLUMBER_DEVICE_H__
#include "proxy.h"
G_BEGIN_DECLS
#define WP_TYPE_PROXY_LINK (wp_proxy_link_get_type ())
#define WP_TYPE_DEVICE (wp_device_get_type ())
WP_API
G_DECLARE_FINAL_TYPE (WpProxyLink, wp_proxy_link, WP, PROXY_LINK, WpProxy)
G_DECLARE_FINAL_TYPE (WpDevice, wp_device, WP, DEVICE, WpProxy)
G_END_DECLS
......
......@@ -6,12 +6,12 @@
* SPDX-License-Identifier: MIT
*/
#include "proxy-link.h"
#include "link.h"
#include "private.h"
#include <pipewire/pipewire.h>
struct _WpProxyLink
struct _WpLink
{
WpProxy parent;
struct pw_link_info *info;
......@@ -20,39 +20,39 @@ struct _WpProxyLink
struct spa_hook listener;
};
G_DEFINE_TYPE (WpProxyLink, wp_proxy_link, WP_TYPE_PROXY)
G_DEFINE_TYPE (WpLink, wp_link, WP_TYPE_PROXY)
static void
wp_proxy_link_init (WpProxyLink * self)
wp_link_init (WpLink * self)
{
}
static void
wp_proxy_link_finalize (GObject * object)
wp_link_finalize (GObject * object)
{
WpProxyLink *self = WP_PROXY_LINK (object);
WpLink *self = WP_LINK (object);
g_clear_pointer (&self->info, pw_link_info_free);
G_OBJECT_CLASS (wp_proxy_link_parent_class)->finalize (object);
G_OBJECT_CLASS (wp_link_parent_class)->finalize (object);
}
static gconstpointer
wp_proxy_link_get_info (WpProxy * self)
wp_link_get_info (WpProxy * self)
{
return WP_PROXY_LINK (self)->info;
return WP_LINK (self)->info;
}
static WpProperties *
wp_proxy_link_get_properties (WpProxy * self)
wp_link_get_properties (WpProxy * self)
{
return wp_properties_new_wrap_dict (WP_PROXY_LINK (self)->info->props);
return wp_properties_new_wrap_dict (WP_LINK (self)->info->props);
}
static void
link_event_info(void *data, const struct pw_link_info *info)
{
WpProxyLink *self = WP_PROXY_LINK (data);
WpLink *self = WP_LINK (data);
self->info = pw_link_info_update (self->info, info);
g_object_notify (G_OBJECT (self), "info");
......@@ -69,23 +69,23 @@ static const struct pw_link_events link_events = {
};
static void
wp_proxy_link_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
wp_link_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
{
WpProxyLink *self = WP_PROXY_LINK (proxy);
WpLink *self = WP_LINK (proxy);
pw_link_add_listener ((struct pw_link *) pw_proxy,
&self->listener, &link_events, self);
}
static void
wp_proxy_link_class_init (WpProxyLinkClass * klass)
wp_link_class_init (WpLinkClass * klass)
{
GObjectClass *object_class = (GObjectClass *) klass;
WpProxyClass *proxy_class = (WpProxyClass *) klass;
object_class->finalize = wp_proxy_link_finalize;
object_class->finalize = wp_link_finalize;
proxy_class->get_info = wp_proxy_link_get_info;
proxy_class->get_properties = wp_proxy_link_get_properties;
proxy_class->get_info = wp_link_get_info;
proxy_class->get_properties = wp_link_get_properties;
proxy_class->pw_proxy_created = wp_proxy_link_pw_proxy_created;
proxy_class->pw_proxy_created = wp_link_pw_proxy_created;
}
......@@ -6,16 +6,16 @@
* SPDX-License-Identifier: MIT
*/
#ifndef __WIREPLUMBER_PROXY_PORT_H__
#define __WIREPLUMBER_PROXY_PORT_H__
#ifndef __WIREPLUMBER_LINK_H__
#define __WIREPLUMBER_LINK_H__
#include "proxy.h"
G_BEGIN_DECLS
#define WP_TYPE_PROXY_PORT (wp_proxy_port_get_type ())
#define WP_TYPE_LINK (wp_link_get_type ())
WP_API
G_DECLARE_FINAL_TYPE (WpProxyPort, wp_proxy_port, WP, PROXY_PORT, WpProxy)
G_DECLARE_FINAL_TYPE (WpLink, wp_link, WP, LINK, WpProxy)
G_END_DECLS
......
wp_lib_sources = files(
'base-endpoint.c',
'client.c',
'configuration.c',
'core.c',
'device.c',
'endpoint.c',
'error.c',
'exported.c',
'factory.c',
'link.c',
'module.c',
'monitor.c',
'node.c',
'object-manager.c',
'policy.c',
'port.c',
'properties.c',
'proxy.c',
'proxy-client.c',
'proxy-device.c',
'proxy-link.c',
'proxy-node.c',
'proxy-port.c',
'session.c',
'spa-props.c',
)
wp_lib_headers = files(
'base-endpoint.h',
'client.h',
'configuration.h',
'core.h',
'defs.h',
'device.h',
'endpoint.h',
'error.h',
'exported.h',
'factory.h',
'link.h',
'module.h',
'monitor.h',
'node.h',
'object-manager.h',
'policy.h',
'port.h',
'properties.h',
'proxy.h',
'proxy-client.h',
'proxy-device.h',
'proxy-node.h',
'proxy-port.h',
'proxy-link.h',
'session.h',
'wp.h',
)
......
......@@ -12,8 +12,8 @@
#include <spa/utils/result.h>
#include <pipewire/pipewire.h>
#include "proxy-node.h"
#include "proxy-device.h"
#include "node.h"
#include "device.h"
#include "monitor.h"
#include "error.h"
#include "wpenums.h"
......@@ -264,7 +264,7 @@ node_new (struct object *dev, uint32_t id,
node = g_slice_new0 (struct object);
node->self = self;
node->id = id;
node->type = WP_TYPE_PROXY_NODE;
node->type = WP_TYPE_NODE;
node->proxy = g_steal_pointer (&proxy);
return node;
......@@ -329,7 +329,7 @@ device_new (WpMonitor *self, uint32_t id, const gchar *factory_name,
dev = g_slice_new0 (struct object);
dev->self = self;
dev->id = id;
dev->type = WP_TYPE_PROXY_DEVICE;
dev->type = WP_TYPE_DEVICE;
dev->spa_obj = g_steal_pointer (&spa_dev);
dev->properties = g_steal_pointer (&props);
dev->proxy = g_steal_pointer (&proxy);
......
......@@ -6,12 +6,12 @@
* SPDX-License-Identifier: MIT
*/
#include "proxy-node.h"
#include "node.h"
#include "private.h"
#include <pipewire/pipewire.h>
struct _WpProxyNode
struct _WpNode
{
WpProxy parent;
struct pw_node_info *info;
......@@ -20,37 +20,37 @@ struct _WpProxyNode
struct spa_hook listener;
};
G_DEFINE_TYPE (WpProxyNode, wp_proxy_node, WP_TYPE_PROXY)
G_DEFINE_TYPE (WpNode, wp_node, WP_TYPE_PROXY)
static void
wp_proxy_node_init (WpProxyNode * self)
wp_node_init (WpNode * self)
{
}
static void
wp_proxy_node_finalize (GObject * object)
wp_node_finalize (GObject * object)
{
WpProxyNode *self = WP_PROXY_NODE (object);
WpNode *self = WP_NODE (object);
g_clear_pointer (&self->info, pw_node_info_free);
G_OBJECT_CLASS (wp_proxy_node_parent_class)->finalize (object);
G_OBJECT_CLASS (wp_node_parent_class)->finalize (object);
}
static gconstpointer
wp_proxy_node_get_info (WpProxy * self)
wp_node_get_info (WpProxy * self)
{
return WP_PROXY_NODE (self)->info;
return WP_NODE (self)->info;
}
static WpProperties *
wp_proxy_node_get_properties (WpProxy * self)
wp_node_get_properties (WpProxy * self)
{
return wp_properties_new_wrap_dict (WP_PROXY_NODE (self)->info->props);
return wp_properties_new_wrap_dict (WP_NODE (self)->info->props);
}
static gint
wp_proxy_node_enum_params (WpProxy * self, guint32 id, guint32 start,
wp_node_enum_params (WpProxy * self, guint32 id, guint32 start,
guint32 num, const struct spa_pod *filter)
{
struct pw_node *pwp;
......@@ -64,7 +64,7 @@ wp_proxy_node_enum_params (WpProxy * self, guint32 id, guint32 start,
}
static gint
wp_proxy_node_subscribe_params (WpProxy * self, guint32 n_ids, guint32 *ids)
wp_node_subscribe_params (WpProxy * self, guint32 n_ids, guint32 *ids)
{
struct pw_node *pwp;
int node_subscribe_params_result;
......@@ -77,7 +77,7 @@ wp_proxy_node_subscribe_params (WpProxy * self, guint32 n_ids, guint32 *ids)
}
static gint
wp_proxy_node_set_param (WpProxy * self, guint32 id, guint32 flags,
wp_node_set_param (WpProxy * self, guint32 id, guint32 flags,
const struct spa_pod *param)
{
struct pw_node *pwp;
......@@ -93,7 +93,7 @@ wp_proxy_node_set_param (WpProxy * self, guint32 id, guint32 flags,
static void
node_event_info(void *data, const struct pw_node_info *info)
{
WpProxyNode *self = WP_PROXY_NODE (data);
WpNode *self = WP_NODE (data);
self->info = pw_node_info_update (self->info, info);
g_object_notify (G_OBJECT (self), "info");
......@@ -111,26 +111,26 @@ static const struct pw_node_events node_events = {
};
static void
wp_proxy_node_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
wp_node_pw_proxy_created (WpProxy * proxy, struct pw_proxy * pw_proxy)
{
WpProxyNode *self = WP_PROXY_NODE (proxy);
WpNode *self = WP_NODE (proxy);
pw_node_add_listener ((struct pw_node *) pw_proxy,
&self->listener, &node_events, self);
}
static void
wp_proxy_node_class_init (WpProxyNodeClass * klass)
wp_node_class_init (WpNodeClass * klass)
{
GObjectClass *object_class = (GObjectClass *) klass;
WpProxyClass *proxy_class = (WpProxyClass *) klass;
object_class->finalize = wp_proxy_node_finalize;
object_class->finalize = wp_node_finalize;
proxy_class->get_info = wp_proxy_node_get_info;
proxy_class->get_properties = wp_proxy_node_get_properties;
proxy_class->enum_params = wp_proxy_node_enum_params;
proxy_class->subscribe_params = wp_proxy_node_subscribe_params;
proxy_class->set_param = wp_proxy_node_set_param;
proxy_class->get_info = wp_node_get_info;
proxy_class->get_properties = wp_node_get_properties;
proxy_class->enum_params = wp_node_enum_params;
proxy_class->subscribe_params = wp_node_subscribe_params;
proxy_class->set_param = wp_node_set_param;
proxy_class->pw_proxy_created = wp_proxy_node_pw_proxy_created;
proxy_class->pw_proxy_created = wp_node_pw_proxy_created;
}
......@@ -6,16 +6,16 @@
* SPDX-License-Identifier: MIT
*/
#ifndef __WIREPLUMBER_PROXY_NODE_H__
#define __WIREPLUMBER_PROXY_NODE_H__
#ifndef __WIREPLUMBER_NODE_H__
#define __WIREPLUMBER_NODE_H__
#include "proxy.h"
G_BEGIN_DECLS