Commit 78646be7 authored by Ronan's avatar Ronan
Browse files

feat(c-wrapper): rename C_STRUCT to C_OBJECT

parent c73614b8
...@@ -169,7 +169,7 @@ static void call_received(SalOp *h) { ...@@ -169,7 +169,7 @@ static void call_received(SalOp *h) {
LinphoneCall *call = linphone_call_new_incoming(lc, fromAddr, toAddr, h); LinphoneCall *call = linphone_call_new_incoming(lc, fromAddr, toAddr, h);
linphone_address_unref(fromAddr); linphone_address_unref(fromAddr);
linphone_address_unref(toAddr); linphone_address_unref(toAddr);
L_GET_PRIVATE_FROM_C_STRUCT(call, Call)->startIncomingNotification(); L_GET_PRIVATE_FROM_C_OBJECT(call, Call)->startIncomingNotification();
} }
static void call_rejected(SalOp *h){ static void call_rejected(SalOp *h){
......
...@@ -80,7 +80,7 @@ static LinphoneChatRoom *_linphone_core_create_chat_room_from_url(LinphoneCore * ...@@ -80,7 +80,7 @@ static LinphoneChatRoom *_linphone_core_create_chat_room_from_url(LinphoneCore *
} }
static bool_t linphone_chat_room_matches(LinphoneChatRoom *cr, const LinphoneAddress *from) { static bool_t linphone_chat_room_matches(LinphoneChatRoom *cr, const LinphoneAddress *from) {
LinphoneAddress *addr = linphone_address_new(L_GET_CPP_PTR_FROM_C_STRUCT(cr)->getPeerAddress().asString().c_str()); LinphoneAddress *addr = linphone_address_new(L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getPeerAddress().asString().c_str());
bool_t result = linphone_address_weak_equal(addr, from); bool_t result = linphone_address_weak_equal(addr, from);
linphone_address_unref(addr); linphone_address_unref(addr);
return result; return result;
...@@ -225,7 +225,7 @@ int linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage ...@@ -225,7 +225,7 @@ int linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage
LinphoneAddress *addr = linphone_address_new(sal_msg->from); LinphoneAddress *addr = linphone_address_new(sal_msg->from);
linphone_address_clean(addr); linphone_address_clean(addr);
LinphoneChatRoom *cr = linphone_core_get_chat_room(lc, addr); LinphoneChatRoom *cr = linphone_core_get_chat_room(lc, addr);
LinphoneReason reason = L_GET_PRIVATE_FROM_C_STRUCT(cr, ChatRoom)->messageReceived(op, sal_msg); LinphoneReason reason = L_GET_PRIVATE_FROM_C_OBJECT(cr, ChatRoom)->messageReceived(op, sal_msg);
linphone_address_unref(addr); linphone_address_unref(addr);
return reason; return reason;
} }
...@@ -235,8 +235,8 @@ int linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage ...@@ -235,8 +235,8 @@ int linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage
void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, uint32_t character, LinphoneCall *call) { void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, uint32_t character, LinphoneCall *call) {
if (linphone_core_realtime_text_enabled(lc)) { if (linphone_core_realtime_text_enabled(lc)) {
std::shared_ptr<LinphonePrivate::RealTimeTextChatRoom> rttcr = std::shared_ptr<LinphonePrivate::RealTimeTextChatRoom> rttcr =
std::static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_STRUCT(cr)); std::static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
L_GET_PRIVATE(rttcr)->realtimeTextReceived(character, call); L_GET_PRIVATE(rttcr)->realtimeTextReceived(character, call);
//L_GET_PRIVATE(std::static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_STRUCT(cr)))->realtimeTextReceived(character, call); //L_GET_PRIVATE(std::static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_OBJECT(cr)))->realtimeTextReceived(character, call);
} }
} }
...@@ -29,5 +29,5 @@ ...@@ -29,5 +29,5 @@
#include "chat/chat-room.h" #include "chat/chat-room.h"
LinphoneChatMessage *linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, const LinphoneContent *initial_content) { LinphoneChatMessage *linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, const LinphoneContent *initial_content) {
return L_GET_CPP_PTR_FROM_C_STRUCT(cr)->createFileTransferMessage(initial_content); return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createFileTransferMessage(initial_content);
} }
...@@ -3205,7 +3205,7 @@ void linphone_core_iterate(LinphoneCore *lc){ ...@@ -3205,7 +3205,7 @@ void linphone_core_iterate(LinphoneCore *lc){
/* Get immediately a reference to next one in case the one we are going to examine is destroyed /* Get immediately a reference to next one in case the one we are going to examine is destroyed
* and removed during linphone_call_start_invite() */ * and removed during linphone_call_start_invite() */
calls = bctbx_list_next(calls); calls = bctbx_list_next(calls);
L_GET_PRIVATE_FROM_C_STRUCT(call, Call)->iterate(current_real_time, one_second_elapsed); L_GET_PRIVATE_FROM_C_OBJECT(call, Call)->iterate(current_real_time, one_second_elapsed);
} }
if (linphone_core_video_preview_enabled(lc)){ if (linphone_core_video_preview_enabled(lc)){
...@@ -3341,7 +3341,7 @@ static bctbx_list_t *make_routes_for_proxy(LinphoneProxyConfig *proxy, const Lin ...@@ -3341,7 +3341,7 @@ static bctbx_list_t *make_routes_for_proxy(LinphoneProxyConfig *proxy, const Lin
ret=bctbx_list_append(ret,sal_address_new(local_route)); ret=bctbx_list_append(ret,sal_address_new(local_route));
} }
if (srv_route){ if (srv_route){
ret=bctbx_list_append(ret,sal_address_clone(L_GET_PRIVATE_FROM_C_STRUCT(srv_route, Address)->getInternalAddress())); ret=bctbx_list_append(ret,sal_address_clone(L_GET_PRIVATE_FROM_C_OBJECT(srv_route, Address)->getInternalAddress()));
} }
if (ret==NULL){ if (ret==NULL){
/*if the proxy address matches the domain part of the destination, then use the same transport /*if the proxy address matches the domain part of the destination, then use the same transport
...@@ -3530,9 +3530,9 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const ...@@ -3530,9 +3530,9 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
if (linphone_call_params_get_local_conference_mode(params) == FALSE) if (linphone_call_params_get_local_conference_mode(params) == FALSE)
#endif #endif
lc->current_call=call; lc->current_call=call;
bool defer = L_GET_PRIVATE_FROM_C_STRUCT(call, Call)->initiateOutgoing(); bool defer = L_GET_PRIVATE_FROM_C_OBJECT(call, Call)->initiateOutgoing();
if (!defer) { if (!defer) {
if (L_GET_PRIVATE_FROM_C_STRUCT(call, Call)->startInvite(nullptr) != 0) { if (L_GET_PRIVATE_FROM_C_OBJECT(call, Call)->startInvite(nullptr) != 0) {
/* The call has already gone to error and released state, so do not return it */ /* The call has already gone to error and released state, so do not return it */
call = nullptr; call = nullptr;
} }
...@@ -6653,7 +6653,7 @@ void linphone_core_set_media_encryption_mandatory(LinphoneCore *lc, bool_t m) { ...@@ -6653,7 +6653,7 @@ void linphone_core_set_media_encryption_mandatory(LinphoneCore *lc, bool_t m) {
} }
void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *params) { void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *params) {
L_GET_CPP_PTR_FROM_C_STRUCT(params)->initDefault(lc); L_GET_CPP_PTR_FROM_C_OBJECT(params)->initDefault(lc);
} }
void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id) { void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id) {
......
...@@ -492,7 +492,7 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *cfg){ ...@@ -492,7 +492,7 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *cfg){
linphone_configure_op(cfg->lc, cfg->op, cfg->identity_address, cfg->sent_headers, FALSE); linphone_configure_op(cfg->lc, cfg->op, cfg->identity_address, cfg->sent_headers, FALSE);
if ((contact=guess_contact_for_register(cfg))) { if ((contact=guess_contact_for_register(cfg))) {
sal_op_set_contact_address(cfg->op, L_GET_PRIVATE_FROM_C_STRUCT(contact, Address)->getInternalAddress()); sal_op_set_contact_address(cfg->op, L_GET_PRIVATE_FROM_C_OBJECT(contact, Address)->getInternalAddress());
linphone_address_unref(contact); linphone_address_unref(contact);
} }
...@@ -503,7 +503,7 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *cfg){ ...@@ -503,7 +503,7 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *cfg){
proxy_string, proxy_string,
cfg->reg_identity, cfg->reg_identity,
cfg->expires, cfg->expires,
cfg->pending_contact ? L_GET_PRIVATE_FROM_C_STRUCT(cfg->pending_contact, Address)->getInternalAddress() : NULL cfg->pending_contact ? L_GET_PRIVATE_FROM_C_OBJECT(cfg->pending_contact, Address)->getInternalAddress() : NULL
)==0) { )==0) {
if (cfg->pending_contact) { if (cfg->pending_contact) {
linphone_address_unref(cfg->pending_contact); linphone_address_unref(cfg->pending_contact);
...@@ -1364,7 +1364,7 @@ const char* linphone_proxy_config_get_transport(const LinphoneProxyConfig *cfg) ...@@ -1364,7 +1364,7 @@ const char* linphone_proxy_config_get_transport(const LinphoneProxyConfig *cfg)
bool_t destroy_route_addr = FALSE; bool_t destroy_route_addr = FALSE;
if (linphone_proxy_config_get_service_route(cfg)) { if (linphone_proxy_config_get_service_route(cfg)) {
route_addr = L_GET_PRIVATE_FROM_C_STRUCT(linphone_proxy_config_get_service_route(cfg), Address)->getInternalAddress(); route_addr = L_GET_PRIVATE_FROM_C_OBJECT(linphone_proxy_config_get_service_route(cfg), Address)->getInternalAddress();
} else if (linphone_proxy_config_get_route(cfg)) { } else if (linphone_proxy_config_get_route(cfg)) {
addr=linphone_proxy_config_get_route(cfg); addr=linphone_proxy_config_get_route(cfg);
} else if(linphone_proxy_config_get_addr(cfg)) { } else if(linphone_proxy_config_get_addr(cfg)) {
......
...@@ -380,7 +380,7 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report, ...@@ -380,7 +380,7 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report,
* (port, transport, maddr), then it is sent directly. * (port, transport, maddr), then it is sent directly.
* Otherwise it is routed as any LinphoneEvent publish, following proxy config policy. * Otherwise it is routed as any LinphoneEvent publish, following proxy config policy.
**/ **/
salAddress = L_GET_PRIVATE_FROM_C_STRUCT(request_uri, Address)->getInternalAddress(); salAddress = L_GET_PRIVATE_FROM_C_OBJECT(request_uri, Address)->getInternalAddress();
if (sal_address_has_uri_param(salAddress, "transport") || if (sal_address_has_uri_param(salAddress, "transport") ||
sal_address_has_uri_param(salAddress, "maddr") || sal_address_has_uri_param(salAddress, "maddr") ||
linphone_address_get_port(request_uri) != 0) { linphone_address_get_port(request_uri) != 0) {
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
// ============================================================================= // =============================================================================
#define GET_MEDIA_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj) #define GET_MEDIA_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_OBJECT(obj)
#define GET_MEDIA_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, MediaSessionParams) #define GET_MEDIA_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_OBJECT(obj, MediaSessionParams)
L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallParams) L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallParams)
...@@ -485,11 +485,11 @@ void linphone_call_params_set_no_user_consent (LinphoneCallParams *params, bool_ ...@@ -485,11 +485,11 @@ void linphone_call_params_set_no_user_consent (LinphoneCallParams *params, bool_
// ============================================================================= // =============================================================================
void *linphone_call_params_get_user_data (const LinphoneCallParams *cp) { void *linphone_call_params_get_user_data (const LinphoneCallParams *cp) {
return L_GET_USER_DATA_FROM_C_STRUCT(cp, MediaSessionParams); return L_GET_USER_DATA_FROM_C_OBJECT(cp, MediaSessionParams);
} }
void linphone_call_params_set_user_data (LinphoneCallParams *cp, void *ud) { void linphone_call_params_set_user_data (LinphoneCallParams *cp, void *ud) {
L_SET_USER_DATA_FROM_C_STRUCT(cp, ud, MediaSessionParams); L_SET_USER_DATA_FROM_C_OBJECT(cp, ud, MediaSessionParams);
} }
LinphoneCallParams *linphone_call_params_ref (LinphoneCallParams *cp) { LinphoneCallParams *linphone_call_params_ref (LinphoneCallParams *cp) {
...@@ -507,7 +507,7 @@ void linphone_call_params_unref (LinphoneCallParams *cp) { ...@@ -507,7 +507,7 @@ void linphone_call_params_unref (LinphoneCallParams *cp) {
LinphoneCallParams *linphone_call_params_new (LinphoneCore *core) { LinphoneCallParams *linphone_call_params_new (LinphoneCore *core) {
LinphoneCallParams *params = _linphone_CallParams_init(); LinphoneCallParams *params = _linphone_CallParams_init();
L_SET_CPP_PTR_FROM_C_STRUCT(params, new LinphonePrivate::MediaSessionParams()); L_SET_CPP_PTR_FROM_C_OBJECT(params, new LinphonePrivate::MediaSessionParams());
GET_MEDIA_CPP_PTR(params)->initDefault(core); GET_MEDIA_CPP_PTR(params)->initDefault(core);
return params; return params;
} }
......
...@@ -28,15 +28,15 @@ ...@@ -28,15 +28,15 @@
// ============================================================================= // =============================================================================
#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj) #define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_OBJECT(obj)
#define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, Call) #define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_OBJECT(obj, Call)
using namespace std; using namespace std;
static void _linphone_call_constructor (LinphoneCall *call); static void _linphone_call_constructor (LinphoneCall *call);
static void _linphone_call_destructor (LinphoneCall *call); static void _linphone_call_destructor (LinphoneCall *call);
L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(Call, L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(Call,
_linphone_call_constructor, _linphone_call_destructor, _linphone_call_constructor, _linphone_call_destructor,
bctbx_list_t *callbacks; /* A list of LinphoneCallCbs object */ bctbx_list_t *callbacks; /* A list of LinphoneCallCbs object */
LinphoneCallCbs *currentCbs; /* The current LinphoneCallCbs object used to call a callback */ LinphoneCallCbs *currentCbs; /* The current LinphoneCallCbs object used to call a callback */
...@@ -601,7 +601,7 @@ bool_t linphone_call_asked_to_autoanswer (LinphoneCall *call) { ...@@ -601,7 +601,7 @@ bool_t linphone_call_asked_to_autoanswer (LinphoneCall *call) {
} }
const LinphoneAddress *linphone_call_get_remote_address (const LinphoneCall *call) { const LinphoneAddress *linphone_call_get_remote_address (const LinphoneCall *call) {
L_SET_CPP_PTR_FROM_C_STRUCT(call->remoteAddressCache, &GET_CPP_PTR(call)->getRemoteAddress()); L_SET_CPP_PTR_FROM_C_OBJECT(call->remoteAddressCache, &GET_CPP_PTR(call)->getRemoteAddress());
return call->remoteAddressCache; return call->remoteAddressCache;
} }
...@@ -690,7 +690,7 @@ int linphone_call_get_duration (const LinphoneCall *call) { ...@@ -690,7 +690,7 @@ int linphone_call_get_duration (const LinphoneCall *call) {
} }
const LinphoneCallParams *linphone_call_get_current_params(LinphoneCall *call) { const LinphoneCallParams *linphone_call_get_current_params(LinphoneCall *call) {
L_SET_CPP_PTR_FROM_C_STRUCT(call->currentParamsCache, GET_CPP_PTR(call)->getCurrentParams()); L_SET_CPP_PTR_FROM_C_OBJECT(call->currentParamsCache, GET_CPP_PTR(call)->getCurrentParams());
return call->currentParamsCache; return call->currentParamsCache;
} }
...@@ -698,7 +698,7 @@ const LinphoneCallParams *linphone_call_get_remote_params(LinphoneCall *call) { ...@@ -698,7 +698,7 @@ const LinphoneCallParams *linphone_call_get_remote_params(LinphoneCall *call) {
const LinphonePrivate::MediaSessionParams *remoteParams = GET_CPP_PTR(call)->getRemoteParams(); const LinphonePrivate::MediaSessionParams *remoteParams = GET_CPP_PTR(call)->getRemoteParams();
if (!remoteParams) if (!remoteParams)
return nullptr; return nullptr;
L_SET_CPP_PTR_FROM_C_STRUCT(call->remoteParamsCache, remoteParams); L_SET_CPP_PTR_FROM_C_OBJECT(call->remoteParamsCache, remoteParams);
return call->remoteParamsCache; return call->remoteParamsCache;
} }
...@@ -936,7 +936,7 @@ LinphoneStatus linphone_call_accept (LinphoneCall *call) { ...@@ -936,7 +936,7 @@ LinphoneStatus linphone_call_accept (LinphoneCall *call) {
} }
LinphoneStatus linphone_call_accept_with_params (LinphoneCall *call, const LinphoneCallParams *params) { LinphoneStatus linphone_call_accept_with_params (LinphoneCall *call, const LinphoneCallParams *params) {
return GET_CPP_PTR(call)->accept(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params) : nullptr); return GET_CPP_PTR(call)->accept(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
} }
LinphoneStatus linphone_call_accept_early_media (LinphoneCall* call) { LinphoneStatus linphone_call_accept_early_media (LinphoneCall* call) {
...@@ -944,11 +944,11 @@ LinphoneStatus linphone_call_accept_early_media (LinphoneCall* call) { ...@@ -944,11 +944,11 @@ LinphoneStatus linphone_call_accept_early_media (LinphoneCall* call) {
} }
LinphoneStatus linphone_call_accept_early_media_with_params (LinphoneCall *call, const LinphoneCallParams *params) { LinphoneStatus linphone_call_accept_early_media_with_params (LinphoneCall *call, const LinphoneCallParams *params) {
return GET_CPP_PTR(call)->acceptEarlyMedia(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params) : nullptr); return GET_CPP_PTR(call)->acceptEarlyMedia(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
} }
LinphoneStatus linphone_call_update (LinphoneCall *call, const LinphoneCallParams *params) { LinphoneStatus linphone_call_update (LinphoneCall *call, const LinphoneCallParams *params) {
return GET_CPP_PTR(call)->update(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params) : nullptr); return GET_CPP_PTR(call)->update(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
} }
LinphoneStatus linphone_call_defer_update (LinphoneCall *call) { LinphoneStatus linphone_call_defer_update (LinphoneCall *call) {
...@@ -971,7 +971,7 @@ LinphoneStatus linphone_call_defer_update (LinphoneCall *call) { ...@@ -971,7 +971,7 @@ LinphoneStatus linphone_call_defer_update (LinphoneCall *call) {
} }
LinphoneStatus linphone_call_accept_update (LinphoneCall *call, const LinphoneCallParams *params) { LinphoneStatus linphone_call_accept_update (LinphoneCall *call, const LinphoneCallParams *params) {
return GET_CPP_PTR(call)->acceptUpdate(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params) : nullptr); return GET_CPP_PTR(call)->acceptUpdate(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
} }
LinphoneStatus linphone_call_transfer (LinphoneCall *call, const char *refer_to) { LinphoneStatus linphone_call_transfer (LinphoneCall *call, const char *refer_to) {
...@@ -1156,7 +1156,7 @@ void linphone_call_set_params (LinphoneCall *call, const LinphoneCallParams *par ...@@ -1156,7 +1156,7 @@ void linphone_call_set_params (LinphoneCall *call, const LinphoneCallParams *par
} }
const LinphoneCallParams *linphone_call_get_params (LinphoneCall *call) { const LinphoneCallParams *linphone_call_get_params (LinphoneCall *call) {
L_SET_CPP_PTR_FROM_C_STRUCT(call->paramsCache, GET_CPP_PTR(call)->getParams()); L_SET_CPP_PTR_FROM_C_OBJECT(call->paramsCache, GET_CPP_PTR(call)->getParams());
return call->paramsCache; return call->paramsCache;
} }
...@@ -1174,11 +1174,11 @@ void linphone_call_unref (LinphoneCall *call) { ...@@ -1174,11 +1174,11 @@ void linphone_call_unref (LinphoneCall *call) {
} }
void *linphone_call_get_user_data (const LinphoneCall *call) { void *linphone_call_get_user_data (const LinphoneCall *call) {
return L_GET_USER_DATA_FROM_C_STRUCT(call, Call); return L_GET_USER_DATA_FROM_C_OBJECT(call, Call);
} }
void linphone_call_set_user_data (LinphoneCall *call, void *ud) { void linphone_call_set_user_data (LinphoneCall *call, void *ud) {
L_SET_USER_DATA_FROM_C_STRUCT(call, ud, Call); L_SET_USER_DATA_FROM_C_OBJECT(call, ud, Call);
} }
// ============================================================================= // =============================================================================
...@@ -1187,9 +1187,9 @@ void linphone_call_set_user_data (LinphoneCall *call, void *ud) { ...@@ -1187,9 +1187,9 @@ void linphone_call_set_user_data (LinphoneCall *call, void *ud) {
LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg) { LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg) {
LinphoneCall *call = L_INIT(Call); LinphoneCall *call = L_INIT(Call);
L_SET_CPP_PTR_FROM_C_STRUCT(call, std::make_shared<LinphonePrivate::Call>(call, lc, LinphoneCallOutgoing, L_SET_CPP_PTR_FROM_C_OBJECT(call, std::make_shared<LinphonePrivate::Call>(call, lc, LinphoneCallOutgoing,
*L_GET_CPP_PTR_FROM_C_STRUCT(from), *L_GET_CPP_PTR_FROM_C_STRUCT(to), *L_GET_CPP_PTR_FROM_C_OBJECT(from), *L_GET_CPP_PTR_FROM_C_OBJECT(to),
cfg, nullptr, L_GET_CPP_PTR_FROM_C_STRUCT(params))); cfg, nullptr, L_GET_CPP_PTR_FROM_C_OBJECT(params)));
call->currentParamsCache = linphone_call_params_new_for_wrapper(); call->currentParamsCache = linphone_call_params_new_for_wrapper();
call->paramsCache = linphone_call_params_new_for_wrapper(); call->paramsCache = linphone_call_params_new_for_wrapper();
call->remoteParamsCache = linphone_call_params_new_for_wrapper(); call->remoteParamsCache = linphone_call_params_new_for_wrapper();
...@@ -1199,8 +1199,8 @@ LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddres ...@@ -1199,8 +1199,8 @@ LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddres
LinphoneCall *linphone_call_new_incoming (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, SalOp *op) { LinphoneCall *linphone_call_new_incoming (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, SalOp *op) {
LinphoneCall *call = L_INIT(Call); LinphoneCall *call = L_INIT(Call);
L_SET_CPP_PTR_FROM_C_STRUCT(call, std::make_shared<LinphonePrivate::Call>(call, lc, LinphoneCallIncoming, L_SET_CPP_PTR_FROM_C_OBJECT(call, std::make_shared<LinphonePrivate::Call>(call, lc, LinphoneCallIncoming,
*L_GET_CPP_PTR_FROM_C_STRUCT(from), *L_GET_CPP_PTR_FROM_C_STRUCT(to), *L_GET_CPP_PTR_FROM_C_OBJECT(from), *L_GET_CPP_PTR_FROM_C_OBJECT(to),
nullptr, op, nullptr)); nullptr, op, nullptr));
call->currentParamsCache = linphone_call_params_new_for_wrapper(); call->currentParamsCache = linphone_call_params_new_for_wrapper();
call->paramsCache = linphone_call_params_new_for_wrapper(); call->paramsCache = linphone_call_params_new_for_wrapper();
......
...@@ -30,15 +30,15 @@ ...@@ -30,15 +30,15 @@
// ============================================================================= // =============================================================================
#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj) #define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_OBJECT(obj)
#define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, ChatMessage, ChatMessage) #define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_OBJECT(obj, ChatMessage, ChatMessage)
using namespace std; using namespace std;
static void _linphone_chat_message_constructor (LinphoneChatMessage *msg); static void _linphone_chat_message_constructor (LinphoneChatMessage *msg);
static void _linphone_chat_message_destructor (LinphoneChatMessage *msg); static void _linphone_chat_message_destructor (LinphoneChatMessage *msg);
L_DECLARE_C_STRUCT_IMPL_WITH_XTORS(ChatMessage, L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(ChatMessage,
_linphone_chat_message_constructor, _linphone_chat_message_destructor, _linphone_chat_message_constructor, _linphone_chat_message_destructor,
LinphoneChatMessageCbs *cbs; LinphoneChatMessageCbs *cbs;
LinphoneChatRoom* chat_room; LinphoneChatRoom* chat_room;
...@@ -92,11 +92,11 @@ void linphone_chat_message_unref (LinphoneChatMessage *msg) { ...@@ -92,11 +92,11 @@ void linphone_chat_message_unref (LinphoneChatMessage *msg) {
} }
void * linphone_chat_message_get_user_data (const LinphoneChatMessage *msg) { void * linphone_chat_message_get_user_data (const LinphoneChatMessage *msg) {
return L_GET_USER_DATA_FROM_C_STRUCT(msg, ChatMessage); return L_GET_USER_DATA_FROM_C_OBJECT(msg, ChatMessage);
} }
void linphone_chat_message_set_user_data (LinphoneChatMessage *msg, void *ud) { void linphone_chat_message_set_user_data (LinphoneChatMessage *msg, void *ud) {
L_SET_USER_DATA_FROM_C_STRUCT(msg, ud, ChatMessage); L_SET_USER_DATA_FROM_C_OBJECT(msg, ud, ChatMessage);
} }
...@@ -309,7 +309,7 @@ void linphone_chat_message_update_state(LinphoneChatMessage *msg, LinphoneChatMe ...@@ -309,7 +309,7 @@ void linphone_chat_message_update_state(LinphoneChatMessage *msg, LinphoneChatMe
linphone_chat_message_store_state(msg); linphone_chat_message_store_state(msg);
if (msg->state == LinphoneChatMessageStateDelivered || msg->state == LinphoneChatMessageStateNotDelivered) { if (msg->state == LinphoneChatMessageStateDelivered || msg->state == LinphoneChatMessageStateNotDelivered) {
L_GET_PRIVATE_FROM_C_STRUCT(msg->chat_room, ChatRoom)->moveTransientMessageToWeakMessages(msg); L_GET_PRIVATE_FROM_C_OBJECT(msg->chat_room, ChatRoom)->moveTransientMessageToWeakMessages(msg);
} }
} }
...@@ -324,7 +324,7 @@ void _linphone_chat_message_resend(LinphoneChatMessage *msg, bool_t ref_msg) { ...@@ -324,7 +324,7 @@ void _linphone_chat_message_resend(LinphoneChatMessage *msg, bool_t ref_msg) {
cr = linphone_chat_message_get_chat_room(msg); cr = linphone_chat_message_get_chat_room(msg);
if (ref_msg) linphone_chat_message_ref(msg); if (ref_msg) linphone_chat_message_ref(msg);
L_GET_CPP_PTR_FROM_C_STRUCT(cr)->sendMessage(msg); L_GET_CPP_PTR_FROM_C_OBJECT(cr)->sendMessage(msg);
} }
void linphone_chat_message_resend(LinphoneChatMessage *msg) { void linphone_chat_message_resend(LinphoneChatMessage *msg) {
...@@ -440,7 +440,7 @@ static char *linphone_chat_message_create_imdn_xml(LinphoneChatMessage *cm, Imdn ...@@ -440,7 +440,7 @@ static char *linphone_chat_message_create_imdn_xml(LinphoneChatMessage *cm, Imdn
void linphone_chat_message_send_imdn(LinphoneChatMessage *cm, ImdnType imdn_type, LinphoneReason reason) { void linphone_chat_message_send_imdn(LinphoneChatMessage *cm, ImdnType imdn_type, LinphoneReason reason) {
char *content = linphone_chat_message_create_imdn_xml(cm, imdn_type, reason); char *content = linphone_chat_message_create_imdn_xml(cm, imdn_type, reason);
if (content) { if (content) {
L_GET_PRIVATE_FROM_C_STRUCT(linphone_chat_message_get_chat_room(cm), ChatRoom)->sendImdn(content, reason); L_GET_PRIVATE_FROM_C_OBJECT(linphone_chat_message_get_chat_room(cm), ChatRoom)->sendImdn(content, reason);
ms_free(content); ms_free(content);
} }
} }
...@@ -465,7 +465,7 @@ void linphone_chat_message_send_display_notification(LinphoneChatMessage *cm) { ...@@ -465,7 +465,7 @@ void linphone_chat_message_send_display_notification(LinphoneChatMessage *cm) {
LinphoneChatRoom *cr = linphone_chat_message_get_chat_room(msg); LinphoneChatRoom *cr = linphone_chat_message_get_chat_room(msg);
if (linphone_core_realtime_text_enabled(linphone_chat_room_get_core(cr))) { if (linphone_core_realtime_text_enabled(linphone_chat_room_get_core(cr))) {
std::shared_ptr<LinphonePrivate::RealTimeTextChatRoom> rttcr = std::shared_ptr<LinphonePrivate::RealTimeTextChatRoom> rttcr =
std::static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_STRUCT(cr)); std::static_pointer_cast<LinphonePrivate::RealTimeTextChatRoom>(L_GET_CPP_PTR_FROM_C_OBJECT(cr));
LinphoneCall *call = rttcr->getCall(); LinphoneCall *call = rttcr->getCall();
LinphoneCore *lc = rttcr->getCore(); LinphoneCore *lc = rttcr->getCore();
const uint32_t new_line = 0x2028; const uint32_t new_line = 0x2028;
...@@ -936,7 +936,7 @@ static void linphone_chat_message_process_response_from_post_file(void *data, co ...@@ -936,7 +936,7 @@ static void linphone_chat_message_process_response_from_post_file(void *data, co
linphone_chat_message_ref(msg); linphone_chat_message_ref(msg);
linphone_chat_message_set_state(msg, LinphoneChatMessageStateFileTransferDone); linphone_chat_message_set_state(msg, LinphoneChatMessageStateFileTransferDone);
_release_http_request(msg); _release_http_request(msg);
L_GET_CPP_PTR_FROM_C_STRUCT(msg->chat_room)->sendMessage(msg); L_GET_CPP_PTR_FROM_C_OBJECT(msg->chat_room)->sendMessage(msg);
file_upload_end_background_task(msg); file_upload_end_background_task(msg);
linphone_chat_message_unref(msg); linphone_chat_message_unref(msg);
} else { } else {
......
...@@ -29,15 +29,15 @@ ...@@ -29,15 +29,15 @@
// ============================================================================= // =============================================================================
#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj) #define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_OBJECT(obj)
#define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, ChatRoom) #define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_OBJECT(obj, ChatRoom)
using namespace std; using namespace std;
static void _linphone_chat_room_constructor (LinphoneChatRoom *cr); static void _linphone_chat_room_constructor (LinphoneChatRoom *cr);
static void _linphone_chat_room_destructor (LinphoneChatRoom *cr); static void _linphone_chat_room_destructor (LinphoneChatRoom *cr);
L_DECLARE_C_STRUCT_IMPL_WITH_XTORS( L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(
ChatRoom, ChatRoom,
_linphone_chat_room_constructor, _linphone_chat_room_destructor, _linphone_chat_room_constructor, _linphone_chat_room_destructor,
LinphoneChatRoomCbs *cbs; LinphoneChatRoomCbs *cbs;
...@@ -211,7 +211,7 @@ LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr) ...@@ -211,7 +211,7 @@ LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr)
LinphoneParticipant *linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr) { LinphoneParticipant *linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr) {
return L_GET_C_BACK_PTR(GET_CPP_PTR(cr)->addParticipant( return L_GET_C_BACK_PTR(GET_CPP_PTR(cr)->addParticipant(
*L_GET_CPP_PTR_FROM_C_STRUCT(addr), nullptr, false), *L_GET_CPP_PTR_FROM_C_OBJECT(addr), nullptr, false),
Participant); Participant);
} }
...@@ -237,7 +237,7 @@ bctbx_list_t *linphone_chat_room_get_participants (const LinphoneChatRoom *cr) { ...@@ -237,7 +237,7 @@ bctbx_list_t *linphone_chat_room_get_participants (const LinphoneChatRoom *cr) {
} }
void linphone_chat_room_remove_participant (LinphoneChatRoom *cr, LinphoneParticipant *participant) { void linphone_chat_room_remove_participant (LinphoneChatRoom *cr, LinphoneParticipant *participant) {
GET_CPP_PTR(cr)->removeParticipant(L_GET_CPP_PTR_FROM_C_STRUCT(participant)); GET_CPP_PTR(cr)->removeParticipant(L_GET_CPP_PTR_FROM_C_OBJECT(participant));
} }
void linphone_chat_room_remove_participants (LinphoneChatRoom *cr, const bctbx_list_t *participants) { void linphone_chat_room_remove_participants (LinphoneChatRoom *cr, const bctbx_list_t *participants) {
...@@ -258,11 +258,11 @@ void linphone_chat_room_unref (LinphoneChatRoom *cr) { ...@@ -258,11 +258,11 @@ void linphone_chat_room_unref (LinphoneChatRoom *cr) {
} }
void *linphone_chat_room_get_user_data (const LinphoneChatRoom *cr) { void *linphone_chat_room_get_user_data (const LinphoneChatRoom *cr) {
return L_GET_USER_DATA_FROM_C_STRUCT(cr, ChatRoom); return L_GET_USER_DATA_FROM_C_OBJECT(cr, ChatRoom);
} }
void linphone_chat_room_set_user_data (LinphoneChatRoom *cr, void *ud) { void linphone_chat_room_set_user_data (LinphoneChatRoom *cr, void *ud) {
L_SET_USER_DATA_FROM_C_STRUCT(cr, ud, ChatRoom); L_SET_USER_DATA_FROM_C_OBJECT(cr, ud, ChatRoom);