forked from mirrors/linphone-iphone
Merge branch 'master' of git.savannah.nongnu.org:/srv/git/linphone
Conflicts: coreapi/linphonecore.h
This commit is contained in:
commit
a37ec3f5f3
59 changed files with 2457 additions and 2849 deletions
|
|
@ -10,7 +10,7 @@ ORTP_DIR = oRTP
|
|||
endif
|
||||
|
||||
SUBDIRS = m4 pixmaps po $(ORTP_DIR) mediastreamer2\
|
||||
coreapi console gtk-glade share scripts
|
||||
coreapi console gtk share scripts
|
||||
|
||||
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ zip:
|
|||
#add gtk dlls and files
|
||||
make gtk-cherrypick
|
||||
make other-cherrypick
|
||||
cp -f $(top_srcdir)/gtk-glade/gtkrc $(INSTALLDIR_WITH_PREFIX)/.
|
||||
cp -f $(top_srcdir)/gtk/gtkrc $(INSTALLDIR_WITH_PREFIX)/.
|
||||
cp -f $(top_srcdir)/README $(INSTALLDIR_WITH_PREFIX)/.
|
||||
cp -f $(top_srcdir)/COPYING $(INSTALLDIR_WITH_PREFIX)/.
|
||||
cd $(INSTALLDIR_WITH_PREFIX) && zip -r $(ZIPFILE) *
|
||||
|
|
@ -162,7 +162,7 @@ setup.exe: filelist
|
|||
rm -f $(INSTALLDIR_WITH_PREFIX)/$(ISS_SCRIPT)
|
||||
|
||||
newdate:
|
||||
cd gtk-glade && $(MAKE) newdate
|
||||
cd gtk && $(MAKE) newdate
|
||||
|
||||
|
||||
Portfile: $(top_srcdir)/scripts/Portfile.tmpl dist
|
||||
|
|
|
|||
10
TODO
10
TODO
|
|
@ -3,20 +3,12 @@ hot stuff:
|
|||
|
||||
* ice support
|
||||
* run a user given command upon incoming calls
|
||||
* linphonec on win32
|
||||
* RTP inactivity timeout to close lost calls.
|
||||
|
||||
* SIP/TLS and SRTP
|
||||
|
||||
low priority:
|
||||
-------------
|
||||
|
||||
* random RTP ports (to enable direct mapping NAT)
|
||||
* zeroconf support for advertising services (cool stuff!)
|
||||
* have the possibility to define several profiles (config files) and switch between them
|
||||
* display call duration
|
||||
* help tips for the registration box
|
||||
* The length (or duration) of the call could be displayed (see icons2.png)
|
||||
* 2. There could be a sound effect for "busy" - a short "beep-beep-beep" would be sufficient (try http://www.google.com/search?q=busy.wav)
|
||||
* The call history could be a bit more clear (see history.png). And it
|
||||
should be saved somewhere, so you can track your calls if you need to...
|
||||
* move resampling stuff to use speex instead of libresample.
|
||||
|
|
@ -37,7 +37,6 @@ LOCAL_SRC_FILES = \
|
|||
authentication.c \
|
||||
lpconfig.c \
|
||||
chat.c \
|
||||
general_state.c \
|
||||
sipsetup.c \
|
||||
siplogin.c \
|
||||
address.c \
|
||||
|
|
|
|||
11
configure.in
11
configure.in
|
|
@ -1,6 +1,6 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT([linphone],[3.3.99.1],[linphone-developers@nongnu.org])
|
||||
AC_INIT([linphone],[3.3.99.2],[linphone-developers@nongnu.org])
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
dnl Source packaging numbers
|
||||
|
|
@ -135,11 +135,8 @@ AC_ARG_ENABLE(gtk_ui,
|
|||
|
||||
if test "$gtk_ui" = "true" ; then
|
||||
PKG_CHECK_MODULES(LIBGTK, gtk+-2.0 >= 2.4.0 gthread-2.0)
|
||||
PKG_CHECK_MODULES(LIBGLADE, libglade-2.0 >= 2.4.0)
|
||||
AC_SUBST(LIBGTK_CFLAGS)
|
||||
AC_SUBST(LIBGTK_LIBS)
|
||||
AC_SUBST(LIBGLADE_CFLAGS)
|
||||
AC_SUBST(LIBGLADE_LIBS)
|
||||
else
|
||||
echo "GTK interface compilation is disabled."
|
||||
fi
|
||||
|
|
@ -329,8 +326,8 @@ dnl build console if required
|
|||
AM_CONDITIONAL(BUILD_CONSOLE, test x$console_ui = xtrue)
|
||||
dnl special things for arm-linux cross compilation toolchain
|
||||
AM_CONDITIONAL(ARMBUILD, test x$use_arm_toolchain = xyes)
|
||||
dnl compilation of gtk-glade user interface
|
||||
AM_CONDITIONAL(BUILD_GLADE_UI, [test x$gtk_ui = xtrue ] )
|
||||
dnl compilation of gtk user interface
|
||||
AM_CONDITIONAL(BUILD_GTK_UI, [test x$gtk_ui = xtrue ] )
|
||||
AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
|
||||
|
||||
dnl check getenv
|
||||
|
|
@ -438,7 +435,7 @@ coreapi/Makefile
|
|||
coreapi/help/Makefile
|
||||
coreapi/help/Doxyfile
|
||||
coreapi/help/doxygen.dox
|
||||
gtk-glade/Makefile
|
||||
gtk/Makefile
|
||||
console/Makefile
|
||||
share/Makefile
|
||||
share/C/Makefile
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ LPC_COMMAND commands[] = {
|
|||
},
|
||||
{ "staticpic", lpc_cmd_staticpic, "Manage static pictures when nowebcam",
|
||||
"'staticpic set' : Set path to picture that should be used.\n"
|
||||
"'staticpic fps' : Get/set frames per seconds for picture emission.\n"
|
||||
},
|
||||
{ "ipv6", lpc_cmd_ipv6, "Use IPV6",
|
||||
"'ipv6 status' : show ipv6 usage status.\n"
|
||||
|
|
@ -412,6 +413,9 @@ static const char *get_call_status(LinphoneCall *call){
|
|||
return "Paused";
|
||||
}
|
||||
break;
|
||||
case LinphoneCallPausedByRemote:
|
||||
return "Paused by remote";
|
||||
break;
|
||||
case LinphoneCallIncomingReceived:
|
||||
return "Pending";
|
||||
break;
|
||||
|
|
@ -1218,6 +1222,19 @@ lpc_cmd_staticpic(LinphoneCore *lc, char *args)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(arg1, "fps")==0) {
|
||||
if (arg2) {
|
||||
float fps = atof(arg2); /* FIXME: Handle not-a-float */
|
||||
linphone_core_set_static_picture_fps(lc, fps);
|
||||
return 1;
|
||||
} else {
|
||||
float fps;
|
||||
fps = linphone_core_get_static_picture_fps(lc);
|
||||
linphonec_out("Current FPS %f\n", fps);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0; /* Syntax error */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -325,6 +325,9 @@ static void linphonec_call_state_changed(LinphoneCore *lc, LinphoneCall *call, L
|
|||
case LinphoneCallPaused:
|
||||
linphonec_out("Call %i with %s is now paused.\n", id, from);
|
||||
break;
|
||||
case LinphoneCallPausedByRemote:
|
||||
linphonec_out("Call %i has been paused by %s.\n",id,from);
|
||||
break;
|
||||
case LinphoneCallIncomingReceived:
|
||||
linphonec_call_identify(call);
|
||||
id=(long)linphone_call_get_user_pointer (call);
|
||||
|
|
|
|||
|
|
@ -221,6 +221,9 @@ static void call_accepted(SalOp *op){
|
|||
}
|
||||
linphone_call_set_state(call,LinphoneCallPaused,"Call paused");
|
||||
}else{
|
||||
if (lc->vtable.display_status){
|
||||
lc->vtable.display_status(lc,_("Call answered - connected."));
|
||||
}
|
||||
linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)");
|
||||
}
|
||||
linphone_connect_incoming (lc,call);
|
||||
|
|
@ -274,7 +277,7 @@ static void call_updating(SalOp *op){
|
|||
|
||||
if (call->resultdesc && !sal_media_description_empty(call->resultdesc))
|
||||
{
|
||||
if (call->state==LinphoneCallPaused &&
|
||||
if (call->state==LinphoneCallPausedByRemote &&
|
||||
sal_media_description_has_dir(call->resultdesc,SalStreamSendRecv) && strcmp(call->resultdesc->addr,"0.0.0.0")!=0){
|
||||
/*make sure we can be resumed */
|
||||
if (lc->current_call!=NULL && lc->current_call!=call){
|
||||
|
|
@ -291,7 +294,7 @@ static void call_updating(SalOp *op){
|
|||
sal_media_description_has_dir(call->resultdesc,SalStreamRecvOnly) && !strcmp(call->resultdesc->addr,"0.0.0.0")){
|
||||
if(lc->vtable.display_status)
|
||||
lc->vtable.display_status(lc,_("We are being paused..."));
|
||||
linphone_call_set_state (call,LinphoneCallPaused,"Call paused");
|
||||
linphone_call_set_state (call,LinphoneCallPausedByRemote,"Call paused by remote");
|
||||
if (lc->current_call!=call){
|
||||
ms_error("Inconsitency detected: current call is %p but call %p is being paused !",lc->current_call,call);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
linphone
|
||||
Copyright (C) 2000 Simon MORLAT (simon.morlat@free.fr)
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef EXEVENTS_H
|
||||
#define EXEVENTS_H
|
||||
#include <eXosip2/eXosip.h>
|
||||
#include "sdphandler.h"
|
||||
|
||||
|
||||
void linphone_core_process_event(LinphoneCore *lc, eXosip_event_t *ev);
|
||||
|
||||
/* these are the SdpHandler callbacks: we are called in to be aware of the content
|
||||
of the SDP messages exchanged */
|
||||
|
||||
int linphone_set_audio_offer(sdp_context_t *ctx);
|
||||
int linphone_set_video_offer(sdp_context_t *ctx);
|
||||
int linphone_accept_audio_offer(sdp_context_t *ctx,sdp_payload_t *payload);
|
||||
int linphone_accept_video_offer(sdp_context_t *ctx,sdp_payload_t *payload);
|
||||
int linphone_read_audio_answer(sdp_context_t *ctx,sdp_payload_t *payload);
|
||||
int linphone_read_video_answer(sdp_context_t *ctx,sdp_payload_t *payload);
|
||||
|
||||
void linphone_core_text_received(LinphoneCore *lc, eXosip_event_t *ev);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* File: general_state.c
|
||||
*
|
||||
* Copyright (C) 2006, 2007 Thomas Reitmayr <treitmayr@yahoo.com>
|
||||
*
|
||||
****************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "linphonecore.h"
|
||||
#include "private.h"
|
||||
#if 0
|
||||
static const char *_gstates_text[] = {
|
||||
"GSTATE_POWER_OFF", /* 0 */
|
||||
"GSTATE_POWER_STARTUP", /* 1 */
|
||||
"GSTATE_POWER_ON", /* 2 */
|
||||
"GSTATE_POWER_SHUTDOWN", /* 3 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
||||
"GSTATE_REG_NONE", /* 10 */
|
||||
"GSTATE_REG_OK", /* 11 */
|
||||
"GSTATE_REG_FAILED", /* 12 */
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
|
||||
"GSTATE_CALL_IDLE", /* 20 */
|
||||
"GSTATE_CALL_OUT_INVITE", /* 21 */
|
||||
"GSTATE_CALL_OUT_CONNECTED", /* 22 */
|
||||
"GSTATE_CALL_IN_INVITE", /* 23 */
|
||||
"GSTATE_CALL_IN_CONNECTED", /* 24 */
|
||||
"GSTATE_CALL_END", /* 25 */
|
||||
"GSTATE_CALL_ERROR" /* 26 */
|
||||
};
|
||||
#endif
|
||||
|
||||
/* set the initial states */
|
||||
void gstate_initialize(LinphoneCore *lc) {
|
||||
lc->gstate_power = GSTATE_POWER_OFF;
|
||||
lc->gstate_reg = GSTATE_REG_NONE;
|
||||
lc->gstate_call = GSTATE_CALL_IDLE;
|
||||
}
|
||||
|
||||
gstate_t linphone_core_get_state(const LinphoneCore *lc, gstate_group_t group){
|
||||
switch(group){
|
||||
case GSTATE_GROUP_POWER:
|
||||
return lc->gstate_power;
|
||||
case GSTATE_GROUP_REG:
|
||||
return lc->gstate_reg;
|
||||
case GSTATE_GROUP_CALL:
|
||||
return lc->gstate_call;
|
||||
}
|
||||
return GSTATE_INVALID;
|
||||
}
|
||||
|
||||
static void linphone_core_set_state(LinphoneCore *lc, gstate_group_t group, gstate_t new_state){
|
||||
switch(group){
|
||||
case GSTATE_GROUP_POWER:
|
||||
lc->gstate_power=new_state;
|
||||
break;
|
||||
case GSTATE_GROUP_REG:
|
||||
lc->gstate_reg=new_state;
|
||||
break;
|
||||
case GSTATE_GROUP_CALL:
|
||||
lc->gstate_call=new_state;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void gstate_new_state(struct _LinphoneCore *lc,
|
||||
gstate_t new_state,
|
||||
LinphoneGeneralStateContext gctx,
|
||||
const char *message) {
|
||||
LinphoneGeneralState states_arg;
|
||||
|
||||
/* determine the affected group */
|
||||
if (new_state < GSTATE_REG_NONE)
|
||||
states_arg.group = GSTATE_GROUP_POWER;
|
||||
else if (new_state < GSTATE_CALL_IDLE)
|
||||
states_arg.group = GSTATE_GROUP_REG;
|
||||
else
|
||||
states_arg.group = GSTATE_GROUP_CALL;
|
||||
|
||||
/* store the new state while remembering the old one */
|
||||
states_arg.new_state = new_state;
|
||||
states_arg.old_state = linphone_core_get_state(lc,states_arg.group);
|
||||
linphone_core_set_state(lc, states_arg.group,new_state);
|
||||
states_arg.message = message;
|
||||
|
||||
/*printf("gstate_new_state: %s\t-> %s\t(%s)\n",
|
||||
_gstates_text[states_arg.old_state],
|
||||
_gstates_text[states_arg.new_state],
|
||||
message);*/
|
||||
|
||||
/* call the virtual method */
|
||||
if (lc->vtable.general_state)
|
||||
lc->vtable.general_state(lc, &states_arg, gctx);
|
||||
|
||||
/* immediately proceed to idle state */
|
||||
if (new_state == GSTATE_CALL_END ||
|
||||
new_state == GSTATE_CALL_ERROR)
|
||||
gstate_new_state(lc, GSTATE_CALL_IDLE, gctx, NULL);
|
||||
}
|
||||
|
||||
|
|
@ -38,7 +38,8 @@ helloworld_SOURCES=helloworld.c
|
|||
|
||||
helloworld_LDADD=$(top_builddir)/coreapi/liblinphone.la
|
||||
|
||||
INCLUDES=-I$(top_srcdir)/coreapi
|
||||
INCLUDES=-I$(top_srcdir)/coreapi \
|
||||
-I$(top_srcdir)/mediastreamer2/include
|
||||
|
||||
AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \
|
||||
$(ORTP_CFLAGS) \
|
||||
|
|
|
|||
120
coreapi/help/helloworld.c
Normal file
120
coreapi/help/helloworld.c
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
|
||||
/*
|
||||
linphone
|
||||
Copyright (C) 2010 Belledonne Communications SARL
|
||||
(simon.morlat@linphone.org)
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
This program is a _very_ simple usage example of liblinphone.
|
||||
It just takes a sip-uri as first argument and attempts to call it
|
||||
*/
|
||||
|
||||
#include <linphonecore.h>
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
static bool_t running=TRUE;
|
||||
|
||||
static void stop(int signum){
|
||||
running=FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call state notification callback
|
||||
*/
|
||||
static void call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *msg){
|
||||
switch(cstate){
|
||||
case LinphoneCallOutgoingRinging:
|
||||
printf("It is now ringing remotely !\n");
|
||||
break;
|
||||
case LinphoneCallOutgoingEarlyMedia:
|
||||
printf("Receiving some early media\n");
|
||||
break;
|
||||
case LinphoneCallConnected:
|
||||
printf("We are connected !\n");
|
||||
break;
|
||||
case LinphoneCallStreamsRunning:
|
||||
printf("Media streams established !\n");
|
||||
break;
|
||||
case LinphoneCallEnd:
|
||||
printf("Call is terminated.\n");
|
||||
break;
|
||||
case LinphoneCallError:
|
||||
printf("Call failure !");
|
||||
break;
|
||||
default:
|
||||
printf("Unhandled notification %i\n",cstate);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
LinphoneCoreVTable vtable={0};
|
||||
LinphoneCore *lc;
|
||||
LinphoneCall *call=NULL;
|
||||
const char *dest=NULL;
|
||||
|
||||
/* take the destination sip uri from the command line arguments */
|
||||
if (argc>1){
|
||||
dest=argv[1];
|
||||
}
|
||||
|
||||
signal(SIGINT,stop);
|
||||
|
||||
/*
|
||||
Fill the LinphoneCoreVTable with application callbacks.
|
||||
All are optional. Here we only use the call_state_changed callbacks
|
||||
in order to get notifications about the progress of the call.
|
||||
*/
|
||||
vtable.call_state_changed=call_state_changed;
|
||||
|
||||
/*
|
||||
Instanciate a LinphoneCore object given the LinphoneCoreVTable
|
||||
*/
|
||||
lc=linphone_core_new(&vtable,NULL,NULL,NULL);
|
||||
|
||||
if (dest){
|
||||
/*
|
||||
Place an outgoing call
|
||||
*/
|
||||
call=linphone_core_invite(lc,dest);
|
||||
if (call==NULL){
|
||||
printf("Could not place call to %s\n",dest);
|
||||
goto end;
|
||||
}else printf("Call to %s is in progress...",dest);
|
||||
linphone_call_ref(call);
|
||||
}
|
||||
/* main loop for receiving notifications and doing background linphonecore work: */
|
||||
while(running){
|
||||
linphone_core_iterate(lc);
|
||||
ms_usleep(50000);
|
||||
}
|
||||
if (call && linphone_call_get_state(call)!=LinphoneCallEnd){
|
||||
/* terminate the call */
|
||||
printf("Terminating the call...\n");
|
||||
linphone_core_terminate_call(lc,call);
|
||||
/*at this stage we don't need the call object */
|
||||
linphone_call_unref(call);
|
||||
}
|
||||
|
||||
end:
|
||||
printf("Shutting down...\n");
|
||||
linphone_core_destroy(lc);
|
||||
printf("Exited\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -229,17 +229,23 @@ static void linphone_call_set_terminated(LinphoneCall *call){
|
|||
|
||||
void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const char *message){
|
||||
LinphoneCore *lc=call->core;
|
||||
bool_t finalize_call=FALSE;
|
||||
if (call->state!=cstate){
|
||||
if (cstate!=LinphoneCallRefered){
|
||||
/*LinphoneCallRefered is rather an event, not a state.
|
||||
Indeed it does not change the state of the call (still paused or running)*/
|
||||
call->state=cstate;
|
||||
}
|
||||
if (cstate==LinphoneCallEnd || cstate==LinphoneCallError){
|
||||
finalize_call=TRUE;
|
||||
linphone_call_ref(call);
|
||||
linphone_call_set_terminated (call);
|
||||
}
|
||||
if (lc->vtable.call_state_changed)
|
||||
lc->vtable.call_state_changed(lc,call,cstate,message);
|
||||
if (finalize_call)
|
||||
linphone_call_unref(call);
|
||||
}
|
||||
if (call->state==LinphoneCallEnd || call->state==LinphoneCallError)
|
||||
linphone_call_set_terminated (call);
|
||||
}
|
||||
|
||||
static void linphone_call_destroy(LinphoneCall *obj)
|
||||
|
|
@ -287,8 +293,9 @@ void linphone_call_ref(LinphoneCall *obj){
|
|||
**/
|
||||
void linphone_call_unref(LinphoneCall *obj){
|
||||
obj->refcnt--;
|
||||
if (obj->refcnt==0)
|
||||
if (obj->refcnt==0){
|
||||
linphone_call_destroy(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -369,6 +376,14 @@ bool_t linphone_call_has_transfer_pending(const LinphoneCall *call){
|
|||
return call->refer_pending;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns call's duration in seconds.
|
||||
**/
|
||||
int linphone_call_get_duration(const LinphoneCall *call){
|
||||
if (call->media_start_time==0) return 0;
|
||||
return time(NULL)-call->media_start_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
**/
|
||||
|
|
@ -562,7 +577,6 @@ static RtpProfile *make_profile(LinphoneCore *lc, const SalMediaDescription *md,
|
|||
number=payload_type_get_number(pt);
|
||||
if (rtp_profile_get_payload(prof,number)!=NULL){
|
||||
ms_warning("A payload type with number %i already exists in profile !",number);
|
||||
payload_type_destroy(pt);
|
||||
}else
|
||||
rtp_profile_set_payload(prof,number,pt);
|
||||
}
|
||||
|
|
@ -589,7 +603,7 @@ void linphone_call_start_media_streams(LinphoneCall *call){
|
|||
{
|
||||
const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc,
|
||||
SalProtoRtpAvp,SalAudio);
|
||||
if (stream){
|
||||
if (stream && stream->dir!=SalStreamInactive){
|
||||
MSSndCard *playcard=lc->sound_conf.lsd_card ?
|
||||
lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard;
|
||||
MSSndCard *captcard=lc->sound_conf.capt_sndcard;
|
||||
|
|
@ -647,7 +661,7 @@ void linphone_call_start_media_streams(LinphoneCall *call){
|
|||
video_preview_stop(lc->previewstream);
|
||||
lc->previewstream=NULL;
|
||||
}
|
||||
if (stream) {
|
||||
if (stream && stream->dir!=SalStreamInactive) {
|
||||
const char *addr=stream->addr[0]!='\0' ? stream->addr : call->resultdesc->addr;
|
||||
call->video_profile=make_profile(lc,call->resultdesc,stream,&used_pt);
|
||||
if (used_pt!=-1){
|
||||
|
|
|
|||
|
|
@ -300,15 +300,10 @@ bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call){
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
int linphone_core_get_call_duration(LinphoneCall *call){
|
||||
if (call==NULL) return 0;
|
||||
if (call->media_start_time==0) return 0;
|
||||
return time(NULL)-call->media_start_time;
|
||||
}
|
||||
|
||||
int linphone_core_get_current_call_duration(const LinphoneCore *lc){
|
||||
LinphoneCall *call=linphone_core_get_current_call((LinphoneCore *)lc);
|
||||
return linphone_core_get_call_duration(call);
|
||||
if (call) return linphone_call_get_duration(call);
|
||||
return -1;
|
||||
}
|
||||
|
||||
const LinphoneAddress *linphone_core_get_current_call_remote_address(struct _LinphoneCore *lc){
|
||||
|
|
@ -1702,7 +1697,7 @@ void linphone_core_iterate(LinphoneCore *lc){
|
|||
if (lc->previewstream==NULL && lc->calls==NULL)
|
||||
toggle_video_preview(lc,TRUE);
|
||||
#ifdef VIDEO_ENABLED
|
||||
else video_stream_iterate(lc->previewstream);
|
||||
if (lc->previewstream) video_stream_iterate(lc->previewstream);
|
||||
#endif
|
||||
}else{
|
||||
if (lc->previewstream!=NULL)
|
||||
|
|
@ -2288,11 +2283,6 @@ int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *the_call)
|
|||
{
|
||||
LinphoneCall *call = the_call;
|
||||
|
||||
if(linphone_core_get_current_call(lc) != call)
|
||||
{
|
||||
ms_error("The call asked to be paused was not the current on");
|
||||
return -1;
|
||||
}
|
||||
if (sal_call_hold(call->op,TRUE) != 0)
|
||||
{
|
||||
if (lc->vtable.display_warning)
|
||||
|
|
@ -2306,6 +2296,21 @@ int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *the_call)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pause all currently running calls.
|
||||
**/
|
||||
int linphone_core_pause_all_calls(LinphoneCore *lc){
|
||||
const MSList *elem;
|
||||
for(elem=lc->calls;elem!=NULL;elem=elem->next){
|
||||
LinphoneCall *call=(LinphoneCall *)elem->data;
|
||||
LinphoneCallState cs=linphone_call_get_state(call);
|
||||
if (cs==LinphoneCallStreamsRunning && cs==LinphoneCallPausedByRemote){
|
||||
linphone_core_pause_call(lc,call);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resumes the call.
|
||||
*
|
||||
|
|
@ -2317,7 +2322,7 @@ int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *the_call)
|
|||
LinphoneCall *call = the_call;
|
||||
|
||||
if(call->state!=LinphoneCallPaused ){
|
||||
ms_warning("we cannot resume a call when the communication is not established");
|
||||
ms_warning("we cannot resume a call that has not been established and paused before");
|
||||
return -1;
|
||||
}
|
||||
if(linphone_core_get_current_call(lc) != NULL){
|
||||
|
|
@ -3106,8 +3111,8 @@ const char *linphone_core_get_video_device(const LinphoneCore *lc){
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
static VideoStream * get_active_video_stream(LinphoneCore *lc){
|
||||
VideoStream *vs = NULL;
|
||||
LinphoneCall *call=linphone_core_get_current_call (lc);
|
||||
/* Select the video stream from the call in the first place */
|
||||
|
|
@ -3118,7 +3123,13 @@ int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
|
|||
if (vs == NULL && lc->previewstream) {
|
||||
vs = lc->previewstream;
|
||||
}
|
||||
|
||||
return vs;
|
||||
}
|
||||
#endif
|
||||
|
||||
int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
VideoStream *vs=get_active_video_stream(lc);
|
||||
/* If we have a video stream (either preview, either from call), we
|
||||
have a source and it is using the static picture filter, then
|
||||
force the filter to use that picture. */
|
||||
|
|
@ -3128,7 +3139,6 @@ int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
|
|||
(void *)path);
|
||||
}
|
||||
}
|
||||
|
||||
/* Tell the static image filter to use that image from now on so
|
||||
that the image will be used next time it has to be read */
|
||||
ms_static_image_set_default_image(path);
|
||||
|
|
@ -3138,6 +3148,48 @@ int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int linphone_core_set_static_picture_fps(LinphoneCore *lc, float fps) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
VideoStream *vs = NULL;
|
||||
|
||||
vs=get_active_video_stream(lc);
|
||||
|
||||
/* If we have a video stream (either preview, either from call), we
|
||||
have a source and it is using the static picture filter, then
|
||||
force the filter to use that picture. */
|
||||
if (vs && vs->source) {
|
||||
if (ms_filter_get_id(vs->source) == MS_STATIC_IMAGE_ID) {
|
||||
ms_filter_call_method(vs->source, MS_FILTER_SET_FPS,(void *)&fps);
|
||||
}
|
||||
}
|
||||
#else
|
||||
ms_warning("Video support not compiled.");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
float linphone_core_get_static_picture_fps(LinphoneCore *lc) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
VideoStream *vs = NULL;
|
||||
vs=get_active_video_stream(lc);
|
||||
/* If we have a video stream (either preview, either from call), we
|
||||
have a source and it is using the static picture filter, then
|
||||
force the filter to use that picture. */
|
||||
if (vs && vs->source) {
|
||||
if (ms_filter_get_id(vs->source) == MS_STATIC_IMAGE_ID) {
|
||||
|
||||
float fps;
|
||||
|
||||
ms_filter_call_method(vs->source, MS_FILTER_GET_FPS,(void *)&fps);
|
||||
return fps;
|
||||
}
|
||||
}
|
||||
#else
|
||||
ms_warning("Video support not compiled.");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the native window handle of the video window, casted as an unsigned long.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -160,7 +160,25 @@ char * linphone_call_log_to_str(LinphoneCallLog *cl);
|
|||
**/
|
||||
struct _LinphoneCall;
|
||||
typedef struct _LinphoneCall LinphoneCall;
|
||||
enum _LinphoneCallState;
|
||||
|
||||
typedef enum _LinphoneCallState{
|
||||
LinphoneCallIdle,
|
||||
LinphoneCallIncomingReceived,
|
||||
LinphoneCallOutgoingInit,
|
||||
LinphoneCallOutgoingProgress,
|
||||
LinphoneCallOutgoingRinging,
|
||||
LinphoneCallOutgoingEarlyMedia,
|
||||
LinphoneCallConnected,
|
||||
LinphoneCallStreamsRunning,
|
||||
LinphoneCallPausing,
|
||||
LinphoneCallPaused,
|
||||
LinphoneCallResuming,
|
||||
LinphoneCallRefered,
|
||||
LinphoneCallError,
|
||||
LinphoneCallEnd,
|
||||
LinphoneCallPausedByRemote
|
||||
} LinphoneCallState;
|
||||
|
||||
|
||||
enum _LinphoneCallState linphone_call_get_state(const LinphoneCall *call);
|
||||
bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call);
|
||||
|
|
@ -173,6 +191,7 @@ void linphone_call_unref(LinphoneCall *call);
|
|||
LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call);
|
||||
const char *linphone_call_get_refer_to(const LinphoneCall *call);
|
||||
bool_t linphone_call_has_transfer_pending(const LinphoneCall *call);
|
||||
int linphone_call_get_duration(const LinphoneCall *call);
|
||||
void *linphone_call_get_user_pointer(LinphoneCall *call);
|
||||
void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
|
||||
|
||||
|
|
@ -365,23 +384,6 @@ void linphone_chat_room_destroy(LinphoneChatRoom *cr);
|
|||
void linphone_chat_room_set_user_data(LinphoneChatRoom *cr, void * ud);
|
||||
void * linphone_chat_room_get_user_data(LinphoneChatRoom *cr);
|
||||
|
||||
typedef enum _LinphoneCallState{
|
||||
LinphoneCallIdle,
|
||||
LinphoneCallIncomingReceived,
|
||||
LinphoneCallOutgoingInit,
|
||||
LinphoneCallOutgoingProgress,
|
||||
LinphoneCallOutgoingRinging,
|
||||
LinphoneCallOutgoingEarlyMedia,
|
||||
LinphoneCallConnected,
|
||||
LinphoneCallStreamsRunning,
|
||||
LinphoneCallPausing,
|
||||
LinphoneCallPaused,
|
||||
LinphoneCallResuming,
|
||||
LinphoneCallRefered,
|
||||
LinphoneCallError,
|
||||
LinphoneCallEnd,
|
||||
} LinphoneCallState;
|
||||
|
||||
typedef enum _LinphoneGlobalState{
|
||||
LinphoneGlobalOff,
|
||||
LinphoneGlobalStartup,
|
||||
|
|
@ -526,6 +528,8 @@ int linphone_core_terminate_all_calls(LinphoneCore *lc);
|
|||
|
||||
int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call);
|
||||
|
||||
int linphone_core_pause_all_calls(LinphoneCore *lc);
|
||||
|
||||
int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *call);
|
||||
|
||||
LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, const char *remote_address);
|
||||
|
|
@ -760,6 +764,10 @@ const char *linphone_core_get_video_device(const LinphoneCore *lc);
|
|||
/* Set static picture to be used when "Static picture" is the video device */
|
||||
int linphone_core_set_static_picture(LinphoneCore *lc, const char *path);
|
||||
|
||||
/* Set and get frame rate for static picture */
|
||||
int linphone_core_set_static_picture_fps(LinphoneCore *lc, float fps);
|
||||
float linphone_core_get_static_picture_fps(LinphoneCore *lc);
|
||||
|
||||
/*function to be used for eventually setting window decorations (icons, title...)*/
|
||||
unsigned long linphone_core_get_native_video_window_id(const LinphoneCore *lc);
|
||||
|
||||
|
|
|
|||
|
|
@ -77,16 +77,32 @@ public:
|
|||
vTable.display_status = displayStatusCb;
|
||||
vTable.display_message = displayMessageCb;
|
||||
vTable.display_warning = displayMessageCb;
|
||||
vTable.general_state = generalStateChange;
|
||||
vTable.global_state_changed = globalStateChange;
|
||||
vTable.registration_state_changed = registrationState;
|
||||
vTable.call_state_changed = callState;
|
||||
|
||||
listernerClass = (jclass)env->NewGlobalRef(env->GetObjectClass( alistener));
|
||||
/*displayStatus(LinphoneCore lc,String message);*/
|
||||
displayStatusId = env->GetMethodID(listernerClass,"displayStatus","(Lorg/linphone/core/LinphoneCore;Ljava/lang/String;)V");
|
||||
/*void generalState(LinphoneCore lc,int state); */
|
||||
generalStateId = env->GetMethodID(listernerClass,"generalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GeneralState;Ljava/lang/String;)V");
|
||||
globalStateId = env->GetMethodID(listernerClass,"globalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GlobalState;Ljava/lang/String;)V");
|
||||
globalStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$GlobalState"));
|
||||
globalStateFromIntId = env->GetStaticMethodID(globalStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$GlobalState;");
|
||||
/*registrationState(LinphoneCore lc, LinphoneProxyConfig cfg, LinphoneCore.RegistrationState cstate, String smessage);*/
|
||||
registrationStateId = env->GetMethodID(listernerClass,"registrationState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneProxyConfig;Lorg/linphone/core/LinphoneCore$RegistrationState;Ljava/lang/String;)V");
|
||||
registrationStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$RegistrationState"));
|
||||
registrationStateFromIntId = env->GetStaticMethodID(registrationStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$RegistrationState;");
|
||||
/*callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State cstate,String message);*/
|
||||
callStateId = env->GetMethodID(listernerClass,"callState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;Lorg/linphone/core/LinphoneCall$State;Ljava/lang/String;)V");
|
||||
callStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCall$State"));
|
||||
callStateFromIntId = env->GetStaticMethodID(callStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCall$State;");
|
||||
|
||||
proxyClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneProxyConfigImpl"));
|
||||
proxyCtrId = env->GetMethodID(proxyClass,"<init>", "(J)V");
|
||||
|
||||
callClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCallImpl"));
|
||||
callCtrId = env->GetMethodID(callClass,"<init>", "(J)V");
|
||||
|
||||
generalStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$GeneralState"));
|
||||
generalStateFromIntId = env->GetStaticMethodID(generalStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$GeneralState;");
|
||||
}
|
||||
|
||||
~LinphoneCoreData() {
|
||||
|
|
@ -103,10 +119,26 @@ public:
|
|||
jobject userdata;
|
||||
|
||||
jclass listernerClass;
|
||||
jclass generalStateClass;
|
||||
jmethodID displayStatusId;
|
||||
jmethodID generalStateId;
|
||||
jmethodID generalStateFromIntId;
|
||||
|
||||
jclass globalStateClass;
|
||||
jmethodID globalStateId;
|
||||
jmethodID globalStateFromIntId;
|
||||
|
||||
jclass registrationStateClass;
|
||||
jmethodID registrationStateId;
|
||||
jmethodID registrationStateFromIntId;
|
||||
|
||||
jclass callStateClass;
|
||||
jmethodID callStateId;
|
||||
jmethodID callStateFromIntId;
|
||||
|
||||
jclass proxyClass;
|
||||
jmethodID proxyCtrId;
|
||||
|
||||
jclass callClass;
|
||||
jmethodID callCtrId;
|
||||
|
||||
LinphoneCoreVTable vTable;
|
||||
|
||||
static void showInterfaceCb(LinphoneCore *lc) {
|
||||
|
|
@ -134,7 +166,7 @@ public:
|
|||
static void authInfoRequested(LinphoneCore *lc, const char *realm, const char *username) {
|
||||
|
||||
}
|
||||
static void generalStateChange(LinphoneCore *lc, LinphoneGeneralState *gstate) {
|
||||
static void globalStateChange(LinphoneCore *lc, LinphoneGlobalState gstate,const char* message) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
|
|
@ -143,11 +175,42 @@ public:
|
|||
}
|
||||
LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
|
||||
env->CallVoidMethod(lcData->listener
|
||||
,lcData->generalStateId
|
||||
,lcData->globalStateId
|
||||
,lcData->core
|
||||
,env->CallStaticObjectMethod(lcData->generalStateClass,lcData->generalStateFromIntId,gstate->new_state),
|
||||
gstate->message ? env->NewStringUTF(gstate->message) : NULL);
|
||||
,env->CallStaticObjectMethod(lcData->globalStateClass,lcData->globalStateFromIntId,gstate),
|
||||
message ? env->NewStringUTF(message) : NULL);
|
||||
}
|
||||
static void registerStateChange(LinphoneCore *lc, LinphoneProxyConfig proxy,LinphoneRegistrationState state,const char* message) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
ms_error("cannot attach VM\n");
|
||||
return;
|
||||
}
|
||||
LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
|
||||
env->CallVoidMethod(lcData->listener
|
||||
,lcData->registrationStateId
|
||||
,lcData->core
|
||||
,env->NewObject(proxyClass,proxyCtrId,proxy)
|
||||
,env->CallStaticObjectMethod(lcData->registrationStateClass,lcData->registrationStateFromIntId,state),
|
||||
message ? env->NewStringUTF(message) : NULL);
|
||||
}
|
||||
static void callStateChange(LinphoneCore *lc, LinphoneCall call,LinphoneCallState *state,const char* message) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
if (result != 0) {
|
||||
ms_error("cannot attach VM\n");
|
||||
return;
|
||||
}
|
||||
LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
|
||||
env->CallVoidMethod(lcData->listener
|
||||
,lcData->callStateId
|
||||
,lcData->core
|
||||
,env->NewObject(callClass,callCtrId,call)
|
||||
,env->CallStaticObjectMethod(lcData->callStateClass,lcData->callStateFromIntId,state),
|
||||
message ? env->NewStringUTF(message) : NULL);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv* env
|
||||
|
|
@ -232,25 +295,27 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_iterate( JNIEnv* env
|
|||
,jlong lc) {
|
||||
linphone_core_iterate((LinphoneCore*)lc);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_invite( JNIEnv* env
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_invite( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
,jstring juri) {
|
||||
const char* uri = env->GetStringUTFChars(juri, NULL);
|
||||
linphone_core_invite((LinphoneCore*)lc,uri);
|
||||
LinphoneCall lCall = linphone_core_invite((LinphoneCore*)lc,uri);
|
||||
env->ReleaseStringUTFChars(juri, uri);
|
||||
return (jlong)lCall;
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_inviteAddress( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
,jlong to) {
|
||||
linphone_core_invite_address((LinphoneCore*)lc,(LinphoneAddress*)to);
|
||||
return (jlong) linphone_core_invite_address((LinphoneCore*)lc,(LinphoneAddress*)to);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateCall( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
linphone_core_terminate_call((LinphoneCore*)lc,NULL);
|
||||
,jlong lc
|
||||
,jlong call) {
|
||||
linphone_core_terminate_call((LinphoneCore*)lc,(LinphoneCall*)call);
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getRemoteAddress( JNIEnv* env
|
||||
|
|
@ -272,9 +337,10 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInComingInvitePend
|
|||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_acceptCall( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
,jlong lc
|
||||
,jlong call) {
|
||||
|
||||
linphone_core_accept_call((LinphoneCore*)lc,NULL);
|
||||
linphone_core_accept_call((LinphoneCore*)lc,(LinphoneCall*)call);
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getCallLog( JNIEnv* env
|
||||
|
|
@ -477,6 +543,7 @@ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setDialPrefix(JNI
|
|||
env->ReleaseStringUTFChars(jprefix, prefix);
|
||||
}
|
||||
|
||||
|
||||
//Auth Info
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneAuthInfoImpl_newLinphoneAuthInfo(JNIEnv* env
|
||||
|
|
@ -612,3 +679,43 @@ extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env
|
|||
ms_free(value);
|
||||
return jvalue;
|
||||
}
|
||||
//LinphoneCall
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_ref(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
linphone_call_ref((LinphoneCall*)ptr);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_unref(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
linphone_call_unref((LinphoneCall*)ptr);
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getCallLog( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return (jlong)linphone_call_get_call_log((LinphoneCall*)ptr);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isIncoming( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return linphone_call_get_dir((LinphoneCall*)ptr)==LinphoneCallIncoming?JNI_TRUE:JNI_FALSE;
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getRemoteAddress( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return (jlong)linphone_call_get_remote_address((LinphoneCall*)ptr);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getState( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return (jint)linphone_call_get_state((LinphoneCall*)ptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,21 @@ static bool_t only_telephone_event(const MSList *l){
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static SalStreamDir compute_dir(SalStreamDir local, SalStreamDir answered){
|
||||
SalStreamDir res=local;
|
||||
if (local==SalStreamSendRecv){
|
||||
if (answered==SalStreamRecvOnly){
|
||||
res=SalStreamSendOnly;
|
||||
}else if (answered==SalStreamSendOnly){
|
||||
res=SalStreamRecvOnly;
|
||||
}
|
||||
}
|
||||
if (answered==SalStreamInactive){
|
||||
res=SalStreamInactive;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static void initiate_outgoing(const SalStreamDescription *local_offer,
|
||||
const SalStreamDescription *remote_answer,
|
||||
SalStreamDescription *result){
|
||||
|
|
@ -105,7 +120,7 @@ static void initiate_outgoing(const SalStreamDescription *local_offer,
|
|||
result->payloads=match_payloads(local_offer->payloads,remote_answer->payloads,TRUE);
|
||||
result->proto=local_offer->proto;
|
||||
result->type=local_offer->type;
|
||||
result->dir=local_offer->dir;
|
||||
result->dir=compute_dir(local_offer->dir,remote_answer->dir);
|
||||
|
||||
if (result->payloads && !only_telephone_event(result->payloads)){
|
||||
strcpy(result->addr,remote_answer->addr);
|
||||
|
|
|
|||
|
|
@ -1,694 +0,0 @@
|
|||
/*
|
||||
* Linphone is sip (RFC3261) compatible internet phone.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "sdphandler.h"
|
||||
#include <osipparser2/osip_port.h>
|
||||
#include <osipparser2/sdp_message.h>
|
||||
#include <eXosip2/eXosip.h>
|
||||
#include "linphonecore.h"
|
||||
#include "ortp/b64.h"
|
||||
|
||||
#define keywordcmp(key,str) strncmp(key,str,strlen(key))
|
||||
|
||||
|
||||
#define sstrdup_sprintf ms_strdup_printf
|
||||
|
||||
#define eXosip_trace(loglevel,args) do \
|
||||
{ \
|
||||
char *__strmsg; \
|
||||
__strmsg=ms_strdup_printf args ; \
|
||||
OSIP_TRACE(osip_trace(__FILE__,__LINE__,(loglevel),NULL,"%s\n",__strmsg)); \
|
||||
osip_free (__strmsg); \
|
||||
}while (0);
|
||||
|
||||
|
||||
static char *make_relay_session_id(const char *username, const char *relay){
|
||||
/*ideally this should be a hash of the parameters with a random part*/
|
||||
char tmp[128];
|
||||
int s1=(int)random();
|
||||
int s2=(int)random();
|
||||
long long int res=((long long int)s1)<<32 | (long long int) s2;
|
||||
void *src=&res;
|
||||
b64_encode(src, sizeof(long long int), tmp, sizeof(tmp));
|
||||
return osip_strdup(tmp);
|
||||
}
|
||||
|
||||
char * int_2char(int a){
|
||||
char *p=osip_malloc(16);
|
||||
snprintf(p,16,"%i",a);
|
||||
return p;
|
||||
}
|
||||
|
||||
/* return the value of attr "field" for payload pt at line pos (field=rtpmap,fmtp...)*/
|
||||
char *sdp_message_a_attr_value_get_with_pt(sdp_message_t *sdp,int pos,int pt,const char *field)
|
||||
{
|
||||
int i,tmppt=0,scanned=0;
|
||||
char *tmp;
|
||||
sdp_attribute_t *attr;
|
||||
for (i=0;(attr=sdp_message_attribute_get(sdp,pos,i))!=NULL;i++){
|
||||
if (keywordcmp(field,attr->a_att_field)==0 && attr->a_att_value!=NULL){
|
||||
int nb = sscanf(attr->a_att_value,"%i %n",&tmppt,&scanned);
|
||||
/* the return value may depend on how %n is interpreted by the libc: see manpage*/
|
||||
if (nb == 1 || nb==2 ){
|
||||
if (pt==tmppt){
|
||||
tmp=attr->a_att_value+scanned;
|
||||
if (strlen(tmp)>0)
|
||||
return tmp;
|
||||
}
|
||||
}else eXosip_trace(OSIP_WARNING,("sdp has a strange a= line (%s) nb=%i",attr->a_att_value,nb));
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* return the value of attr "field" */
|
||||
char *sdp_message_a_attr_value_get(sdp_message_t *sdp,int pos,const char *field)
|
||||
{
|
||||
int i;
|
||||
sdp_attribute_t *attr;
|
||||
for (i=0;(attr=sdp_message_attribute_get(sdp,pos,i))!=NULL;i++){
|
||||
if (keywordcmp(field,attr->a_att_field)==0 && attr->a_att_value!=NULL){
|
||||
return attr->a_att_value;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int _sdp_message_get_a_ptime(sdp_message_t *sdp, int mline){
|
||||
int i,ret;
|
||||
sdp_attribute_t *attr;
|
||||
for (i=0;(attr=sdp_message_attribute_get(sdp,mline,i))!=NULL;i++){
|
||||
if (keywordcmp("ptime",attr->a_att_field)==0){
|
||||
int nb = sscanf(attr->a_att_value,"%i",&ret);
|
||||
/* the return value may depend on how %n is interpreted by the libc: see manpage*/
|
||||
if (nb == 1){
|
||||
return ret;
|
||||
}else eXosip_trace(OSIP_WARNING,("sdp has a strange a=ptime line (%s) ",attr->a_att_value));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sdp_payload_init (sdp_payload_t * payload)
|
||||
{
|
||||
memset (payload, 0, sizeof (sdp_payload_t));
|
||||
return 0;
|
||||
}
|
||||
|
||||
sdp_context_t *sdp_handler_create_context(sdp_handler_t *handler, const char *localip, const char *username, const char *relay){
|
||||
sdp_context_t *ctx=osip_malloc(sizeof(sdp_context_t));
|
||||
memset(ctx,0,sizeof(sdp_context_t));
|
||||
if (localip!=NULL) ctx->localip=osip_strdup(localip);
|
||||
ctx->username=osip_strdup(username);
|
||||
ctx->handler=handler;
|
||||
if (relay){
|
||||
ctx->relay=osip_strdup(relay);
|
||||
ctx->relay_session_id=make_relay_session_id(username,relay);
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
void sdp_context_set_user_pointer(sdp_context_t * ctx, void* up){
|
||||
ctx->reference=up;
|
||||
}
|
||||
|
||||
void *sdp_context_get_user_pointer(sdp_context_t * ctx){
|
||||
return ctx->reference;
|
||||
}
|
||||
|
||||
int sdp_context_get_status(sdp_context_t* ctx){
|
||||
return ctx->negoc_status;
|
||||
}
|
||||
|
||||
/* generate a template sdp */
|
||||
sdp_message_t *
|
||||
sdp_context_generate_template (sdp_context_t * ctx)
|
||||
{
|
||||
sdp_message_t *local;
|
||||
int inet6;
|
||||
|
||||
sdp_message_init (&local);
|
||||
if (strchr(ctx->localip,':')!=NULL){
|
||||
inet6=1;
|
||||
}else inet6=0;
|
||||
if (!inet6){
|
||||
sdp_message_v_version_set (local, osip_strdup ("0"));
|
||||
sdp_message_o_origin_set (local, osip_strdup (ctx->username),
|
||||
osip_strdup ("123456"), osip_strdup ("654321"),
|
||||
osip_strdup ("IN"), osip_strdup ("IP4"),
|
||||
osip_strdup (ctx->localip));
|
||||
sdp_message_s_name_set (local, osip_strdup ("A conversation"));
|
||||
sdp_message_c_connection_add (local, -1,
|
||||
osip_strdup ("IN"), osip_strdup ("IP4"),
|
||||
osip_strdup (ctx->localip), NULL, NULL);
|
||||
sdp_message_t_time_descr_add (local, osip_strdup ("0"), osip_strdup ("0"));
|
||||
}else{
|
||||
sdp_message_v_version_set (local, osip_strdup ("0"));
|
||||
sdp_message_o_origin_set (local, osip_strdup (ctx->username),
|
||||
osip_strdup ("123456"), osip_strdup ("654321"),
|
||||
osip_strdup ("IN"), osip_strdup ("IP6"),
|
||||
osip_strdup (ctx->localip));
|
||||
sdp_message_s_name_set (local, osip_strdup ("A conversation"));
|
||||
sdp_message_c_connection_add (local, -1,
|
||||
osip_strdup ("IN"), osip_strdup ("IP6"),
|
||||
osip_strdup (ctx->localip), NULL, NULL);
|
||||
sdp_message_t_time_descr_add (local, osip_strdup ("0"), osip_strdup ("0"));
|
||||
}
|
||||
return local;
|
||||
}
|
||||
|
||||
static void add_relay_info(sdp_message_t *sdp, int mline, const char *relay, const char *relay_session_id){
|
||||
|
||||
if (relay) sdp_message_a_attribute_add(sdp, mline,
|
||||
osip_strdup ("relay-addr"),osip_strdup(relay));
|
||||
if (relay_session_id) sdp_message_a_attribute_add(sdp, mline,
|
||||
osip_strdup ("relay-session-id"), osip_strdup(relay_session_id));
|
||||
}
|
||||
|
||||
/* to add payloads to the offer, must be called inside the write_offer callback */
|
||||
void
|
||||
sdp_context_add_payload (sdp_context_t * ctx, sdp_payload_t * payload, char *media)
|
||||
{
|
||||
sdp_message_t *offer = ctx->offer;
|
||||
char *attr_field;
|
||||
if (!ctx->incb)
|
||||
{
|
||||
eXosip_trace (OSIP_ERROR,
|
||||
("You must not call sdp_context_add_*_payload outside the write_offer callback\n"));
|
||||
#if !defined(_WIN32_WCE)
|
||||
abort();
|
||||
#else
|
||||
exit(-1);
|
||||
#endif /*_WIN32_WCE*/
|
||||
|
||||
}
|
||||
if (payload->proto == NULL)
|
||||
payload->proto = "RTP/AVP";
|
||||
/*printf("payload->line=%i payload->pt=%i\n",payload->line, payload->pt);*/
|
||||
if (sdp_message_m_media_get (offer, payload->line) == NULL)
|
||||
{
|
||||
/*printf("Adding new mline %s \n",media);*/
|
||||
/* need a new line */
|
||||
sdp_message_m_media_add (offer, osip_strdup (media),
|
||||
int_2char (payload->localport), NULL,
|
||||
osip_strdup (payload->proto));
|
||||
if (ctx->relay){
|
||||
add_relay_info(offer,payload->line,ctx->relay,ctx->relay_session_id);
|
||||
}
|
||||
}
|
||||
sdp_message_m_payload_add (offer, payload->line, int_2char (payload->pt));
|
||||
if (payload->a_rtpmap != NULL)
|
||||
{
|
||||
attr_field =
|
||||
sstrdup_sprintf ("%i %s", payload->pt,
|
||||
payload->a_rtpmap);
|
||||
sdp_message_a_attribute_add (offer, payload->line,
|
||||
osip_strdup ("rtpmap"), attr_field);
|
||||
}
|
||||
if (payload->a_fmtp != NULL)
|
||||
{
|
||||
attr_field =
|
||||
sstrdup_sprintf ("%i %s", payload->pt,
|
||||
payload->a_fmtp);
|
||||
sdp_message_a_attribute_add (offer, payload->line, osip_strdup ("fmtp"),
|
||||
attr_field);
|
||||
}
|
||||
if (payload->b_as_bandwidth != 0)
|
||||
{
|
||||
if (sdp_message_bandwidth_get(offer,payload->line,0)==NULL){
|
||||
attr_field =
|
||||
sstrdup_sprintf ("%i", payload->b_as_bandwidth);
|
||||
sdp_message_b_bandwidth_add (offer, payload->line, osip_strdup ("AS"),
|
||||
attr_field);
|
||||
}
|
||||
}
|
||||
if (payload->a_ptime !=0) {
|
||||
attr_field = sstrdup_sprintf ("%i", payload->a_ptime);
|
||||
sdp_message_a_attribute_add(offer, payload->line,osip_strdup ("ptime"),attr_field);
|
||||
ms_message("adding ptime [%s]",attr_field);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
sdp_context_add_audio_payload (sdp_context_t * ctx, sdp_payload_t * payload)
|
||||
{
|
||||
sdp_context_add_payload (ctx, payload, "audio");
|
||||
}
|
||||
|
||||
void
|
||||
sdp_context_add_video_payload (sdp_context_t * ctx, sdp_payload_t * payload)
|
||||
{
|
||||
sdp_context_add_payload (ctx, payload, "video");
|
||||
}
|
||||
|
||||
char *
|
||||
sdp_context_get_offer ( sdp_context_t * ctx)
|
||||
{
|
||||
sdp_message_t *offer;
|
||||
sdp_handler_t *sdph=ctx->handler;
|
||||
char *tmp;
|
||||
|
||||
offer = sdp_context_generate_template (ctx);
|
||||
/* add audio codecs */
|
||||
ctx->offer = offer;
|
||||
ctx->incb = 1;
|
||||
if (sdph->set_audio_codecs != NULL)
|
||||
sdph->set_audio_codecs (ctx);
|
||||
if (sdph->set_video_codecs != NULL)
|
||||
sdph->set_video_codecs (ctx);
|
||||
ctx->incb = 0;
|
||||
sdp_message_to_str(offer,&tmp);
|
||||
ctx->offerstr=tmp;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
/* refuse the line */
|
||||
static void refuse_mline(sdp_message_t *answer,char *mtype,char *proto, int mline)
|
||||
{
|
||||
sdp_message_m_media_add (answer,
|
||||
osip_strdup (mtype),
|
||||
int_2char (0), NULL,
|
||||
osip_strdup (proto));
|
||||
/* add a payload just to comply with sdp RFC.*/
|
||||
sdp_message_m_payload_add(answer,mline,int_2char(0));
|
||||
}
|
||||
|
||||
static char * parse_relay_addr(char *addr, int *port)
|
||||
{
|
||||
char *semicolon=NULL;
|
||||
char *p;
|
||||
|
||||
*port=56789;
|
||||
semicolon=strchr(addr,':');
|
||||
for (p=addr+strlen(addr)-1;p>addr;p--){
|
||||
if (*p==':') {
|
||||
semicolon=p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (semicolon){
|
||||
*port=atoi(semicolon+1);
|
||||
*semicolon='\0';
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
sdp_context_get_answer ( sdp_context_t *ctx,sdp_message_t *remote)
|
||||
{
|
||||
sdp_message_t *answer=NULL;
|
||||
char *mtype=NULL, *tmp=NULL;
|
||||
char *proto=NULL, *port=NULL, *pt=NULL;
|
||||
int i, j, ncodec, m_lines_accepted = 0;
|
||||
int err;
|
||||
sdp_payload_t payload;
|
||||
sdp_payload_t init_payload;
|
||||
sdp_handler_t *sdph=ctx->handler;
|
||||
sdp_bandwidth_t *sbw=NULL;
|
||||
char *relay;
|
||||
|
||||
tmp = sdp_message_c_addr_get (remote, 0, 0);
|
||||
if (tmp == NULL)
|
||||
tmp = sdp_message_c_addr_get (remote, -1, 0);
|
||||
if (ctx->localip==NULL) {
|
||||
/* NULL means guess, otherwise we use the address given as localip */
|
||||
ctx->localip=osip_malloc(128);
|
||||
eXosip_guess_localip(strchr(tmp,':') ? AF_INET6 : AF_INET,ctx->localip,128);
|
||||
}
|
||||
else eXosip_trace(OSIP_INFO1,("Using firewall address in sdp."));
|
||||
|
||||
answer = sdp_context_generate_template (ctx);
|
||||
|
||||
/* for each m= line */
|
||||
for (i = 0; !sdp_message_endof_media (remote, i); i++){
|
||||
sdp_payload_init(&init_payload);
|
||||
mtype = sdp_message_m_media_get (remote, i);
|
||||
proto = sdp_message_m_proto_get (remote, i);
|
||||
port = sdp_message_m_port_get (remote, i);
|
||||
init_payload.remoteport = osip_atoi (port);
|
||||
init_payload.proto = proto;
|
||||
init_payload.line = i;
|
||||
init_payload.c_addr = sdp_message_c_addr_get (remote, i, 0);
|
||||
if (init_payload.c_addr == NULL)
|
||||
init_payload.c_addr = sdp_message_c_addr_get (remote, -1, 0);
|
||||
/*parse relay address if given*/
|
||||
relay=sdp_message_a_attr_value_get(remote,i,"relay-addr");
|
||||
if (relay){
|
||||
init_payload.relay_host=parse_relay_addr(relay,&init_payload.relay_port);
|
||||
}
|
||||
init_payload.relay_session_id=sdp_message_a_attr_value_get(remote,i,"relay-session-id");
|
||||
/* get application specific bandwidth, if any */
|
||||
for(j=0;(sbw=sdp_message_bandwidth_get(remote,i,j))!=NULL;j++){
|
||||
if (strcasecmp(sbw->b_bwtype,"AS")==0) init_payload.b_as_bandwidth=atoi(sbw->b_bandwidth);
|
||||
}
|
||||
init_payload.a_ptime=_sdp_message_get_a_ptime(remote,i);
|
||||
if (keywordcmp ("audio", mtype) == 0)
|
||||
{
|
||||
if (sdph->accept_audio_codecs != NULL)
|
||||
{
|
||||
ncodec = 0;
|
||||
/* for each payload type */
|
||||
for (j = 0;
|
||||
((pt =
|
||||
sdp_message_m_payload_get (remote, i,
|
||||
j)) != NULL); j++)
|
||||
{
|
||||
memcpy(&payload,&init_payload,sizeof(payload));
|
||||
payload.pt = osip_atoi (pt);
|
||||
/* get the rtpmap associated to this codec, if any */
|
||||
payload.a_rtpmap =
|
||||
sdp_message_a_attr_value_get_with_pt
|
||||
(remote, i, payload.pt,
|
||||
"rtpmap");
|
||||
/* get the fmtp, if any */
|
||||
payload.a_fmtp =
|
||||
sdp_message_a_attr_value_get_with_pt
|
||||
(remote, i, payload.pt,
|
||||
"fmtp");
|
||||
|
||||
/* ask the application if this codec is supported */
|
||||
err = sdph->accept_audio_codecs (ctx,
|
||||
&payload);
|
||||
if (err == 0)
|
||||
{
|
||||
ncodec++;
|
||||
/* codec accepted */
|
||||
if (ncodec == 1)
|
||||
{
|
||||
/* first codec accepted, setup the line */
|
||||
sdp_message_m_media_add
|
||||
(answer,
|
||||
osip_strdup
|
||||
(mtype),
|
||||
int_2char
|
||||
(payload.
|
||||
localport),
|
||||
NULL,
|
||||
osip_strdup
|
||||
(proto));
|
||||
/* and accept the remote relay addr if we planned to use our own */
|
||||
if (ctx->relay!=NULL && relay){
|
||||
add_relay_info(answer,i,relay,payload.relay_session_id);
|
||||
}
|
||||
}
|
||||
/* add the payload, rtpmap, fmtp */
|
||||
sdp_message_m_payload_add (answer, i,
|
||||
int_2char
|
||||
(payload.
|
||||
pt));
|
||||
if (payload.a_rtpmap != NULL)
|
||||
{
|
||||
sdp_message_a_attribute_add
|
||||
(answer, i,
|
||||
osip_strdup
|
||||
("rtpmap"),
|
||||
sstrdup_sprintf
|
||||
("%i %s",
|
||||
payload.pt,
|
||||
payload.
|
||||
a_rtpmap));
|
||||
}
|
||||
if (payload.a_fmtp != NULL)
|
||||
{
|
||||
sdp_message_a_attribute_add
|
||||
(answer, i,
|
||||
osip_strdup
|
||||
("fmtp"),
|
||||
sstrdup_sprintf
|
||||
("%i %s",
|
||||
payload.pt,
|
||||
payload.
|
||||
a_fmtp));
|
||||
}
|
||||
if (payload.b_as_bandwidth !=
|
||||
0)
|
||||
{
|
||||
if (sdp_message_bandwidth_get(answer,i,0)==NULL)
|
||||
sdp_message_b_bandwidth_add
|
||||
(answer, i,
|
||||
osip_strdup
|
||||
("AS"),
|
||||
sstrdup_sprintf
|
||||
("%i",
|
||||
payload.
|
||||
b_as_bandwidth));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ncodec == 0)
|
||||
{
|
||||
/* refuse the line */
|
||||
refuse_mline(answer,mtype,proto,i);
|
||||
|
||||
}
|
||||
else
|
||||
m_lines_accepted++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* refuse this line (leave port to 0) */
|
||||
refuse_mline(answer,mtype,proto,i);
|
||||
}
|
||||
|
||||
}
|
||||
else if (keywordcmp ("video", mtype) == 0)
|
||||
{
|
||||
if (sdph->accept_video_codecs != NULL)
|
||||
{
|
||||
ncodec = 0;
|
||||
/* for each payload type */
|
||||
for (j = 0;
|
||||
((pt =
|
||||
sdp_message_m_payload_get (remote, i,
|
||||
j)) != NULL); j++)
|
||||
{
|
||||
memcpy(&payload,&init_payload,sizeof(payload));
|
||||
payload.pt = osip_atoi (pt);
|
||||
/* get the rtpmap associated to this codec, if any */
|
||||
payload.a_rtpmap =
|
||||
sdp_message_a_attr_value_get_with_pt
|
||||
(remote, i, payload.pt,
|
||||
"rtpmap");
|
||||
/* get the fmtp, if any */
|
||||
payload.a_fmtp =
|
||||
sdp_message_a_attr_value_get_with_pt
|
||||
(remote, i, payload.pt,
|
||||
"fmtp");
|
||||
/* ask the application if this codec is supported */
|
||||
err = sdph->accept_video_codecs (ctx,
|
||||
&payload);
|
||||
if (err == 0 )
|
||||
{
|
||||
ncodec++;
|
||||
/* codec accepted */
|
||||
if (ncodec == 1)
|
||||
{
|
||||
/* first codec accepted, setup the line */
|
||||
sdp_message_m_media_add
|
||||
(answer,
|
||||
osip_strdup
|
||||
(mtype),
|
||||
int_2char
|
||||
(payload.localport), NULL,
|
||||
osip_strdup
|
||||
(proto));
|
||||
/* and accept the remote relay addr if we planned to use our own */
|
||||
if (ctx->relay!=NULL && relay){
|
||||
add_relay_info(answer,i,relay,payload.relay_session_id);
|
||||
}
|
||||
}
|
||||
/* add the payload, rtpmap, fmtp */
|
||||
sdp_message_m_payload_add (answer, i,
|
||||
int_2char
|
||||
(payload.
|
||||
pt));
|
||||
if (payload.a_rtpmap != NULL)
|
||||
{
|
||||
sdp_message_a_attribute_add
|
||||
(answer, i,
|
||||
osip_strdup
|
||||
("rtpmap"),
|
||||
sstrdup_sprintf
|
||||
("%i %s",
|
||||
payload.pt,
|
||||
payload.
|
||||
a_rtpmap));
|
||||
}
|
||||
if (payload.a_fmtp != NULL)
|
||||
{
|
||||
sdp_message_a_attribute_add
|
||||
(answer, i,
|
||||
osip_strdup
|
||||
("fmtp"),
|
||||
sstrdup_sprintf
|
||||
("%i %s",
|
||||
payload.pt,
|
||||
payload.
|
||||
a_fmtp));
|
||||
}
|
||||
if (payload.b_as_bandwidth !=0)
|
||||
{
|
||||
if (sdp_message_bandwidth_get(answer,i,0)==NULL)
|
||||
sdp_message_b_bandwidth_add
|
||||
(answer, i,
|
||||
osip_strdup
|
||||
("AS"),
|
||||
sstrdup_sprintf
|
||||
("%i",
|
||||
payload.
|
||||
b_as_bandwidth));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ncodec == 0)
|
||||
{
|
||||
/* refuse the line */
|
||||
refuse_mline(answer,mtype,proto,i);
|
||||
}
|
||||
else
|
||||
m_lines_accepted++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* refuse the line */
|
||||
refuse_mline(answer,mtype,proto,i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ctx->answer!=NULL)
|
||||
sdp_message_free(ctx->answer);
|
||||
ctx->answer = answer;
|
||||
if (m_lines_accepted > 0){
|
||||
ctx->negoc_status = 200;
|
||||
sdp_message_to_str(answer,&tmp);
|
||||
if (ctx->answerstr!=NULL)
|
||||
osip_free(ctx->answerstr);
|
||||
ctx->answerstr=tmp;
|
||||
return tmp;
|
||||
}else{
|
||||
ctx->negoc_status = 415;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
sdp_context_read_answer (sdp_context_t *ctx, sdp_message_t *remote)
|
||||
{
|
||||
char *mtype;
|
||||
char *proto, *port, *pt;
|
||||
int i, j,err;
|
||||
char *relay;
|
||||
sdp_payload_t payload,arg_payload;
|
||||
sdp_handler_t *sdph=ctx->handler;
|
||||
sdp_bandwidth_t *sbw=NULL;
|
||||
/* for each m= line */
|
||||
for (i = 0; !sdp_message_endof_media (remote, i); i++)
|
||||
{
|
||||
sdp_payload_init(&payload);
|
||||
mtype = sdp_message_m_media_get (remote, i);
|
||||
proto = sdp_message_m_proto_get (remote, i);
|
||||
port = sdp_message_m_port_get (remote, i);
|
||||
payload.remoteport = osip_atoi (port);
|
||||
payload.localport = osip_atoi (sdp_message_m_port_get (ctx->offer, i));
|
||||
payload.proto = proto;
|
||||
payload.line = i;
|
||||
payload.c_addr = sdp_message_c_addr_get (remote, i, 0);
|
||||
if (payload.c_addr == NULL)
|
||||
payload.c_addr = sdp_message_c_addr_get (remote, -1, 0);
|
||||
/*parse relay address if given*/
|
||||
relay=sdp_message_a_attr_value_get(remote,i,"relay-addr");
|
||||
if (relay){
|
||||
payload.relay_host=parse_relay_addr(relay,&payload.relay_port);
|
||||
}
|
||||
payload.relay_session_id=sdp_message_a_attr_value_get(remote,i,"relay-session-id");
|
||||
for(j=0;(sbw=sdp_message_bandwidth_get(remote,i,j))!=NULL;++j){
|
||||
if (strcasecmp(sbw->b_bwtype,"AS")==0) payload.b_as_bandwidth=atoi(sbw->b_bandwidth);
|
||||
}
|
||||
payload.a_ptime=_sdp_message_get_a_ptime(remote,i);
|
||||
if (keywordcmp ("audio", mtype) == 0)
|
||||
{
|
||||
if (sdph->get_audio_codecs != NULL)
|
||||
{
|
||||
/* for each payload type */
|
||||
for (j = 0;
|
||||
((pt =
|
||||
sdp_message_m_payload_get (remote, i,
|
||||
j)) != NULL); j++)
|
||||
{
|
||||
payload.pt = osip_atoi (pt);
|
||||
/* get the rtpmap associated to this codec, if any */
|
||||
payload.a_rtpmap =
|
||||
sdp_message_a_attr_value_get_with_pt
|
||||
(remote, i, payload.pt,
|
||||
"rtpmap");
|
||||
/* get the fmtp, if any */
|
||||
payload.a_fmtp =
|
||||
sdp_message_a_attr_value_get_with_pt
|
||||
(remote, i, payload.pt,
|
||||
"fmtp");
|
||||
/* ask the application if this codec is supported */
|
||||
memcpy(&arg_payload,&payload,sizeof(payload));
|
||||
err = sdph->get_audio_codecs (ctx,
|
||||
&arg_payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (keywordcmp ("video", mtype) == 0)
|
||||
{
|
||||
if (sdph->get_video_codecs != NULL)
|
||||
{
|
||||
/* for each payload type */
|
||||
for (j = 0;
|
||||
((pt =
|
||||
sdp_message_m_payload_get (remote, i,
|
||||
j)) != NULL); j++)
|
||||
{
|
||||
payload.pt = osip_atoi (pt);
|
||||
/* get the rtpmap associated to this codec, if any */
|
||||
payload.a_rtpmap =
|
||||
sdp_message_a_attr_value_get_with_pt
|
||||
(remote, i, payload.pt,
|
||||
"rtpmap");
|
||||
/* get the fmtp, if any */
|
||||
payload.a_fmtp =
|
||||
sdp_message_a_attr_value_get_with_pt
|
||||
(remote, i, payload.pt,
|
||||
"fmtp");
|
||||
/* ask the application if this codec is supported */
|
||||
memcpy(&arg_payload,&payload,sizeof(payload));
|
||||
err = sdph->get_video_codecs (ctx,
|
||||
&arg_payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void sdp_context_free(sdp_context_t *ctx){
|
||||
osip_free(ctx->localip);
|
||||
osip_free(ctx->username);
|
||||
if (ctx->offer!=NULL) sdp_message_free(ctx->offer);
|
||||
if (ctx->answer!=NULL) sdp_message_free(ctx->answer);
|
||||
if (ctx->offerstr!=NULL) osip_free(ctx->offerstr);
|
||||
if (ctx->answerstr!=NULL) osip_free(ctx->answerstr);
|
||||
if (ctx->relay!=NULL) osip_free(ctx->relay);
|
||||
if (ctx->relay_session_id!=NULL) osip_free(ctx->relay_session_id);
|
||||
osip_free(ctx);
|
||||
}
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
/*
|
||||
* Linphone is sip (RFC3261) compatible internet phone.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef SDP_HANDLER_H
|
||||
#define SDP_HANDLER_H
|
||||
|
||||
#include <osipparser2/sdp_message.h>
|
||||
#include "linphonecore.h"
|
||||
|
||||
typedef struct _sdp_payload
|
||||
{
|
||||
int line; /* the index of the m= line */
|
||||
int pt; /*payload type */
|
||||
int localport;
|
||||
int remoteport;
|
||||
int b_as_bandwidth; /* application specific bandwidth */
|
||||
char *proto;
|
||||
char *c_nettype;
|
||||
char *c_addrtype;
|
||||
char *c_addr;
|
||||
char *c_addr_multicast_ttl;
|
||||
char *c_addr_multicast_int;
|
||||
char *a_rtpmap;
|
||||
char *a_fmtp;
|
||||
char *relay_host;
|
||||
int relay_port;
|
||||
char *relay_session_id;
|
||||
int a_ptime;
|
||||
} sdp_payload_t;
|
||||
|
||||
typedef struct _sdp_context sdp_context_t;
|
||||
|
||||
typedef int (*sdp_handler_read_codec_func_t) (struct _sdp_context *,
|
||||
sdp_payload_t *);
|
||||
typedef int (*sdp_handler_write_codec_func_t) (struct _sdp_context *);
|
||||
|
||||
typedef struct _sdp_handler
|
||||
{
|
||||
sdp_handler_read_codec_func_t accept_audio_codecs; /*from remote sdp */
|
||||
sdp_handler_read_codec_func_t accept_video_codecs; /*from remote sdp */
|
||||
sdp_handler_write_codec_func_t set_audio_codecs; /*to local sdp */
|
||||
sdp_handler_write_codec_func_t set_video_codecs; /*to local sdp */
|
||||
sdp_handler_read_codec_func_t get_audio_codecs; /*from incoming answer */
|
||||
sdp_handler_read_codec_func_t get_video_codecs; /*from incoming answer */
|
||||
} sdp_handler_t;
|
||||
|
||||
|
||||
typedef enum _sdp_context_state
|
||||
{
|
||||
SDP_CONTEXT_STATE_INIT,
|
||||
SDP_CONTEXT_STATE_NEGOCIATION_OPENED,
|
||||
SDP_CONTEXT_STATE_NEGOCIATION_CLOSED
|
||||
} sdp_context_state_t;
|
||||
|
||||
struct _sdp_context
|
||||
{
|
||||
sdp_handler_t *handler;
|
||||
char *localip;
|
||||
char *username;
|
||||
void *reference;
|
||||
sdp_message_t *offer; /* the local sdp to be used for outgoing request */
|
||||
char *offerstr;
|
||||
sdp_message_t *answer; /* the local sdp generated from an inc request */
|
||||
char *answerstr;
|
||||
char *relay;
|
||||
char *relay_session_id;
|
||||
int negoc_status; /* in sip code */
|
||||
int incb;
|
||||
sdp_context_state_t state;
|
||||
};
|
||||
|
||||
/* create a context for a sdp negociation: localip is the ip address to be used in the sdp message, can
|
||||
be a firewall address.
|
||||
It can be null when negociating for an incoming offer; In that case it will be guessed. */
|
||||
sdp_context_t *sdp_handler_create_context(sdp_handler_t *handler, const char *localip, const char *username, const char *relay);
|
||||
void sdp_context_set_user_pointer(sdp_context_t * ctx, void* up);
|
||||
void *sdp_context_get_user_pointer(sdp_context_t * ctx);
|
||||
void sdp_context_add_audio_payload( sdp_context_t * ctx, sdp_payload_t * payload);
|
||||
void sdp_context_add_video_payload( sdp_context_t * ctx, sdp_payload_t * payload);
|
||||
char * sdp_context_get_offer(sdp_context_t *ctx);
|
||||
char * sdp_context_get_answer(sdp_context_t* ctx, sdp_message_t *remote_offer);
|
||||
int sdp_context_get_status(sdp_context_t* ctx);
|
||||
void sdp_context_read_answer(sdp_context_t *ctx, sdp_message_t *remote_answer);
|
||||
void sdp_context_free(sdp_context_t *ctx);
|
||||
|
||||
int sdp_payload_init (sdp_payload_t * payload);
|
||||
#endif
|
||||
|
|
@ -1,259 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2009 Simon MORLAT (simon.morlat@linphone.org)
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
/*
|
||||
* C Implementation: incall_frame
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
*
|
||||
* Author: Simon Morlat <simon.morlat@linphone.org>, (C) 2009
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
|
||||
gboolean linphone_gtk_use_in_call_view(){
|
||||
static int val=-1;
|
||||
if (val==-1) val=linphone_gtk_get_ui_config_int("use_incall_view",1);
|
||||
return val;
|
||||
}
|
||||
|
||||
void linphone_gtk_show_in_call_view(void){
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
|
||||
GtkWidget *in_call_frame=linphone_gtk_get_widget(main_window,"in_call_frame");
|
||||
gint idx;
|
||||
|
||||
/* Make the in call frame visible and arrange for the notebook to
|
||||
show that page */
|
||||
gtk_widget_show(in_call_frame);
|
||||
idx = gtk_notebook_page_num(notebook, in_call_frame);
|
||||
if (idx >= 0) {
|
||||
gtk_notebook_set_current_page(notebook, idx);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_show_idle_view(void){
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
|
||||
GtkWidget *idle_frame=linphone_gtk_get_widget(main_window,"idle_frame");
|
||||
GtkWidget *in_call_frame=linphone_gtk_get_widget(main_window,"in_call_frame");
|
||||
gint idx;
|
||||
|
||||
/* Switch back to the idle frame page, maybe we should have
|
||||
remembered where we were in gtk_show_in_call_view() to switch
|
||||
back to that page of the notebook, but this should do in most
|
||||
cases. */
|
||||
gtk_widget_show(idle_frame); /* Make sure it is visible... */
|
||||
idx = gtk_notebook_page_num(notebook, idle_frame);
|
||||
if (idx >= 0) {
|
||||
gtk_notebook_set_current_page(notebook, idx);
|
||||
gtk_widget_hide(in_call_frame);
|
||||
}
|
||||
}
|
||||
|
||||
void display_peer_name_in_label(GtkWidget *label, const char *uri){
|
||||
LinphoneAddress *from;
|
||||
const char *displayname=NULL;
|
||||
char *id=NULL;
|
||||
char *uri_label;
|
||||
|
||||
if (uri==NULL) {
|
||||
ms_error("Strange: in call with nobody ?");
|
||||
return;
|
||||
}
|
||||
|
||||
from=linphone_address_new(uri);
|
||||
if (from!=NULL){
|
||||
displayname=linphone_address_get_display_name(from);
|
||||
id=linphone_address_as_string_uri_only(from);
|
||||
}else id=ms_strdup(uri);
|
||||
|
||||
if (displayname!=NULL){
|
||||
uri_label=g_markup_printf_escaped("<span size=\"large\">%s</span>\n<i>%s</i>",
|
||||
displayname,id);
|
||||
}else
|
||||
uri_label=g_markup_printf_escaped("<span size=\"large\"><i>%s</i></span>\n",id);
|
||||
gtk_label_set_markup(GTK_LABEL(label),uri_label);
|
||||
ms_free(id);
|
||||
g_free(uri_label);
|
||||
if (from!=NULL) linphone_address_destroy(from);
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_set_calling(const char *uri){
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *status=linphone_gtk_get_widget(main_window,"in_call_status");
|
||||
GtkWidget *callee=linphone_gtk_get_widget(main_window,"in_call_uri");
|
||||
GtkWidget *duration=linphone_gtk_get_widget(main_window,"in_call_duration");
|
||||
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
|
||||
GdkPixbufAnimation *pbuf=create_pixbuf_animation("calling_anim.gif");
|
||||
|
||||
gtk_label_set_markup(GTK_LABEL(status),_("<b>Calling...</b>"));
|
||||
display_peer_name_in_label(callee,uri);
|
||||
|
||||
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
|
||||
if (pbuf!=NULL){
|
||||
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_INFO,GTK_ICON_SIZE_DIALOG);
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_set_in_call(){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *status=linphone_gtk_get_widget(main_window,"in_call_status");
|
||||
GtkWidget *callee=linphone_gtk_get_widget(main_window,"in_call_uri");
|
||||
GtkWidget *duration=linphone_gtk_get_widget(main_window,"in_call_duration");
|
||||
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
|
||||
GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
|
||||
const LinphoneAddress *uri=linphone_core_get_current_call_remote_address(lc);
|
||||
char *tmp=linphone_address_as_string(uri);
|
||||
display_peer_name_in_label(callee,tmp);
|
||||
ms_free(tmp);
|
||||
|
||||
gtk_label_set_markup(GTK_LABEL(status),_("<b>In call with</b>"));
|
||||
|
||||
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
|
||||
if (pbuf!=NULL){
|
||||
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_INFO,GTK_ICON_SIZE_DIALOG);
|
||||
linphone_gtk_enable_mute_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"incall_mute")),TRUE);
|
||||
linphone_gtk_enable_hold_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"hold_call")),TRUE);
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_update_duration(int duration){
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *duration_label=linphone_gtk_get_widget(main_window,"in_call_duration");
|
||||
char tmp[256]={0};
|
||||
int seconds=duration%60;
|
||||
int minutes=(duration/60)%60;
|
||||
int hours=duration/3600;
|
||||
snprintf(tmp,sizeof(tmp)-1,_("%02i::%02i::%02i"),hours,minutes,seconds);
|
||||
gtk_label_set_text(GTK_LABEL(duration_label),tmp);
|
||||
}
|
||||
|
||||
static gboolean in_call_view_terminated(){
|
||||
linphone_gtk_show_idle_view();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_terminate(const char *error_msg){
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *status=linphone_gtk_get_widget(main_window,"in_call_status");
|
||||
GtkWidget *animation=linphone_gtk_get_widget(main_window,"in_call_animation");
|
||||
GdkPixbuf *pbuf=create_pixbuf(linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png"));
|
||||
|
||||
if (error_msg==NULL)
|
||||
gtk_label_set_markup(GTK_LABEL(status),_("<b>Call ended.</b>"));
|
||||
else{
|
||||
char *msg=g_markup_printf_escaped("<span color=\"red\"><b>%s</b></span>",error_msg);
|
||||
gtk_label_set_markup(GTK_LABEL(status),msg);
|
||||
g_free(msg);
|
||||
}
|
||||
if (pbuf!=NULL){
|
||||
gtk_image_set_from_pixbuf(GTK_IMAGE(animation),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}
|
||||
linphone_gtk_enable_mute_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"incall_mute")),FALSE);
|
||||
linphone_gtk_enable_hold_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,"hold_call")),FALSE);
|
||||
g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,NULL);
|
||||
}
|
||||
|
||||
void linphone_gtk_draw_mute_button(GtkToggleButton *button, gboolean active){
|
||||
if (active){
|
||||
GtkWidget *image=create_pixmap("mic_muted.png");
|
||||
gtk_button_set_label(GTK_BUTTON(button),_("Unmute"));
|
||||
if (image!=NULL) {
|
||||
gtk_button_set_image(GTK_BUTTON(button),image);
|
||||
gtk_widget_show(image);
|
||||
}
|
||||
}else{
|
||||
GtkWidget *image=create_pixmap("mic_active.png");
|
||||
gtk_button_set_label(GTK_BUTTON(button),_("Mute"));
|
||||
if (image!=NULL) {
|
||||
gtk_button_set_image(GTK_BUTTON(button),image);
|
||||
gtk_widget_show(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_mute_toggled(GtkToggleButton *button){
|
||||
gboolean active=gtk_toggle_button_get_active(button);
|
||||
linphone_core_mute_mic(linphone_gtk_get_core(),active);
|
||||
linphone_gtk_draw_mute_button(button,active);
|
||||
}
|
||||
|
||||
void linphone_gtk_enable_mute_button(GtkToggleButton *button, gboolean sensitive)
|
||||
{
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(button),sensitive);
|
||||
linphone_gtk_draw_mute_button(button,FALSE);
|
||||
}
|
||||
|
||||
void linphone_gtk_draw_hold_button(GtkToggleButton *button, gboolean active){
|
||||
if (active){
|
||||
GtkWidget *image=create_pixmap("hold_off.png");
|
||||
gtk_button_set_label(GTK_BUTTON(button),_("HoldOff"));
|
||||
if (image!=NULL) {
|
||||
gtk_button_set_image(GTK_BUTTON(button),image);
|
||||
gtk_widget_show(image);
|
||||
}
|
||||
}else{
|
||||
GtkWidget *image=create_pixmap("hold_on.png");
|
||||
gtk_button_set_label(GTK_BUTTON(button),_("HoldOn"));
|
||||
if (image!=NULL) {
|
||||
gtk_button_set_image(GTK_BUTTON(button),image);
|
||||
gtk_widget_show(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_hold_toggled(GtkToggleButton *button){
|
||||
gboolean active=gtk_toggle_button_get_active(button);
|
||||
|
||||
if(active)
|
||||
{
|
||||
LinphoneCall *call=linphone_core_get_current_call (linphone_gtk_get_core());
|
||||
if (call==NULL) return;
|
||||
linphone_core_pause_call(linphone_gtk_get_core(),call);
|
||||
}
|
||||
else
|
||||
{
|
||||
const MSList *calls=linphone_core_get_calls(linphone_gtk_get_core());
|
||||
if (calls==NULL) return;
|
||||
if (ms_list_size(calls)>1){
|
||||
g_warning("Simultaneously calls not yet implemented in gtk ui.");
|
||||
return;
|
||||
}
|
||||
/*we are supposed to have only one */
|
||||
linphone_core_resume_call(linphone_gtk_get_core(),(LinphoneCall*)calls->data);
|
||||
}
|
||||
linphone_gtk_draw_hold_button(button,active);
|
||||
}
|
||||
|
||||
void linphone_gtk_enable_hold_button(GtkToggleButton *button, gboolean sensitive){
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(button),sensitive);
|
||||
linphone_gtk_draw_hold_button(button,FALSE);
|
||||
}
|
||||
0
gtk-glade/.gitignore → gtk/.gitignore
vendored
0
gtk-glade/.gitignore → gtk/.gitignore
vendored
|
|
@ -1,15 +1,14 @@
|
|||
GLADE_FILES= about.glade \
|
||||
main.glade \
|
||||
password.glade \
|
||||
contact.glade \
|
||||
incoming_call.glade \
|
||||
parameters.glade \
|
||||
sip_account.glade \
|
||||
chatroom.glade \
|
||||
call_logs.glade \
|
||||
log.glade \
|
||||
buddylookup.glade \
|
||||
waiting.glade
|
||||
UI_FILES= about.ui \
|
||||
main.ui \
|
||||
password.ui \
|
||||
contact.ui \
|
||||
parameters.ui \
|
||||
sip_account.ui \
|
||||
chatroom.ui \
|
||||
call_logs.ui \
|
||||
log.ui \
|
||||
buddylookup.ui \
|
||||
waiting.ui
|
||||
|
||||
PIXMAPS= \
|
||||
stock_people.png
|
||||
|
|
@ -18,13 +17,13 @@ LINPHONE_ICO_RC_FILE=linphone.rc
|
|||
LINPHONE_ICO_FILE=linphone.ico
|
||||
|
||||
EXTRA_DIST= $(PIXMAPS) \
|
||||
$(GLADE_FILES) \
|
||||
$(UI_FILES) \
|
||||
linphone.iss \
|
||||
$(LINPHONE_ICO_RC_FILE) \
|
||||
$(LINPHONE_ICO_FILE)
|
||||
|
||||
|
||||
if BUILD_GLADE_UI
|
||||
if BUILD_GTK_UI
|
||||
|
||||
BUILT_SOURCES=version_date.h
|
||||
|
||||
|
|
@ -49,8 +48,7 @@ linphone_3_SOURCES= \
|
|||
linphone_3_LDADD=$(top_builddir)/oRTP/src/libortp.la \
|
||||
$(top_builddir)/mediastreamer2/src/libmediastreamer.la \
|
||||
$(top_builddir)/coreapi/liblinphone.la \
|
||||
$(LIBGTK_LIBS) $(INTLLIBS) \
|
||||
$(LIBGLADE_LIBS)
|
||||
$(LIBGTK_LIBS) $(INTLLIBS)
|
||||
|
||||
|
||||
if BUILD_WIN32
|
||||
|
|
@ -64,13 +62,8 @@ else
|
|||
linphone_3_LDFLAGS=-export-dynamic
|
||||
endif
|
||||
|
||||
gladedir=$(datadir)/linphone
|
||||
glade_DATA=$(GLADE_FILES) $(PIXMAPS) $(top_srcdir)/COPYING
|
||||
|
||||
#all-local: gtk-linphone.ui
|
||||
|
||||
#gtk-linphone.ui: gtk-linphone.glade
|
||||
# gtk-builder-convert gtk-linphone.glade $@
|
||||
uidir=$(datadir)/linphone
|
||||
ui_DATA=$(UI_FILES) $(PIXMAPS) $(top_srcdir)/COPYING
|
||||
|
||||
endif
|
||||
|
||||
|
|
@ -78,7 +71,7 @@ endif
|
|||
AM_CFLAGS= -DIN_LINPHONE -I$(top_srcdir)/coreapi/ \
|
||||
-I$(top_srcdir)/mediastreamer2/include/ \
|
||||
$(ORTP_CFLAGS) \
|
||||
$(LIBGLADE_CFLAGS) $(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(IPV6_CFLAGS) \
|
||||
$(STRICT_OPTIONS) $(LIBGTK_CFLAGS) $(IPV6_CFLAGS) \
|
||||
$(OSIP_CFLAGS)
|
||||
|
||||
|
||||
|
|
@ -1,14 +1,13 @@
|
|||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 2.12 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkAboutDialog" id="about">
|
||||
<object class="GtkAboutDialog" id="about">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">About linphone</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="icon">linphone2.png</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<property name="program_name">Linphone</property>
|
||||
|
|
@ -35,7 +34,7 @@ hu: anonymous
|
|||
<property name="artists">Icons by kerosine.fr</property>
|
||||
<signal name="response" handler="linphone_gtk_about_response"/>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox8">
|
||||
<object class="GtkVBox" id="dialog-vbox8">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
|
|
@ -44,18 +43,18 @@ hu: anonymous
|
|||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area7">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area7">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">end</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,94 +1,94 @@
|
|||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 2.16 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkDialog" id="buddylookup">
|
||||
<object class="GtkDialog" id="buddylookup">
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Search contacts in directory</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="icon">linphone2.png</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<signal name="response" handler="gtk_widget_destroy"/>
|
||||
<signal handler="gtk_widget_destroy" name="response"/>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame1">
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox2">
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="keyword">
|
||||
<object class="GtkEntry" id="keyword">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_focus">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_keyword_changed"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_keyword_changed" name="changed"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">automatic</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">etched-in</property>
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="search_results">
|
||||
<object class="GtkTreeView" id="search_results">
|
||||
<property name="width_request">512</property>
|
||||
<property name="height_request">140</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<signal name="row_activated" handler="linphone_gtk_buddy_lookup_contact_activated"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_buddy_lookup_contact_activated" name="row_activated"/>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkProgressBar" id="progressbar">
|
||||
<object class="GtkProgressBar" id="progressbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="activity_mode">True</property>
|
||||
<property name="show_text">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<object class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="add_buddy">
|
||||
<object class="GtkButton" id="add_buddy">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_add_buddy_from_database"/>
|
||||
<signal handler="linphone_gtk_add_buddy_from_database" name="clicked"/>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1">
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
|
|
@ -96,17 +96,17 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Add to my list</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
|
|
@ -114,34 +114,31 @@
|
|||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Search somebody</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
|
|
@ -150,14 +147,14 @@
|
|||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<?xml version="1.0"?>
|
||||
<!--Generated with glade3 3.4.5 on Wed Jul 30 17:55:28 2008 -->
|
||||
<glade-interface>
|
||||
<widget class="GtkDialog" id="call_logs">
|
||||
<interface>
|
||||
<object class="GtkDialog" id="call_logs">
|
||||
<property name="width_request">500</property>
|
||||
<property name="height_request">370</property>
|
||||
<property name="border_width">5</property>
|
||||
|
|
@ -12,55 +11,57 @@
|
|||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<child>
|
||||
<widget class="GtkTextView" id="logtextview">
|
||||
<object class="GtkTextView" id="logtextview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button1">
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="label" translatable="yes">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="response_id">0</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
<action-widgets>
|
||||
<action-widget response="0">button1</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,69 +1,67 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<?xml version="1.0"?>
|
||||
<!--Generated with glade3 3.4.5 on Wed Jul 30 15:51:13 2008 -->
|
||||
<glade-interface>
|
||||
<widget class="GtkWindow" id="chatroom">
|
||||
<signal name="destroy" handler="linphone_gtk_chat_destroyed"/>
|
||||
<interface>
|
||||
<object class="GtkWindow" id="chatroom">
|
||||
<signal handler="linphone_gtk_chat_destroyed" name="destroy"/>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkTextView" id="textlog">
|
||||
<object class="GtkTextView" id="textlog">
|
||||
<property name="width_request">200</property>
|
||||
<property name="height_request">200</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="text_entry">
|
||||
<object class="GtkEntry" id="text_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_focus">True</property>
|
||||
<signal name="activate" handler="linphone_gtk_send_text"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_send_text" name="activate"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="send">
|
||||
<object class="GtkButton" id="send">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="linphone_gtk_send_text"/>
|
||||
<signal handler="linphone_gtk_send_text" name="clicked"/>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2">
|
||||
<object class="GtkHBox" id="hbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1">
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-ok</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Send</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">7</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
|
|
@ -71,30 +69,29 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<object class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button1">
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="label" translatable="yes">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="linphone_gtk_chat_close"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_chat_close" name="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 2.16 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkDialog" id="contact">
|
||||
<object class="GtkDialog" id="contact">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
|
|
@ -10,46 +10,46 @@
|
|||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox7">
|
||||
<object class="GtkVBox" id="dialog-vbox7">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame17">
|
||||
<object class="GtkFrame" id="frame17">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment17">
|
||||
<object class="GtkAlignment" id="alignment17">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox13">
|
||||
<object class="GtkVBox" id="vbox13">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="table7">
|
||||
<object class="GtkTable" id="table7">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label45">
|
||||
<object class="GtkLabel" id="label45">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Name</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label46">
|
||||
<object class="GtkLabel" id="label46">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">SIP Address</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
|
|
@ -57,11 +57,11 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="name">
|
||||
<object class="GtkEntry" id="name">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
|
|
@ -69,11 +69,11 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="sip_address">
|
||||
<object class="GtkEntry" id="sip_address">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
|
|
@ -82,14 +82,14 @@
|
|||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="show_presence">
|
||||
<object class="GtkCheckButton" id="show_presence">
|
||||
<property name="label" translatable="yes">Show this contact presence status</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
|
@ -97,13 +97,13 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="allow_presence">
|
||||
<object class="GtkCheckButton" id="allow_presence">
|
||||
<property name="label" translatable="yes">Allow this contact to see my presence status</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
|
@ -111,46 +111,43 @@
|
|||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label47">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label47">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes"><b>Contact information</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area7">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area7">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="cancel_button">
|
||||
<object class="GtkButton" id="cancel_button">
|
||||
<property name="label" translatable="yes">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_contact_cancel"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_contact_cancel" name="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
|
|
@ -158,29 +155,29 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="ok_button">
|
||||
<object class="GtkButton" id="ok_button">
|
||||
<property name="label" translatable="yes">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_contact_ok"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_contact_ok" name="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
</object>
|
||||
</interface>
|
||||
308
gtk/incall_view.c
Normal file
308
gtk/incall_view.c
Normal file
|
|
@ -0,0 +1,308 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2009 Simon MORLAT (simon.morlat@linphone.org)
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
/*
|
||||
* C Implementation: incall_frame
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
*
|
||||
* Author: Simon Morlat <simon.morlat@linphone.org>, (C) 2009
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
|
||||
gboolean linphone_gtk_use_in_call_view(){
|
||||
static int val=-1;
|
||||
if (val==-1) val=linphone_gtk_get_ui_config_int("use_incall_view",1);
|
||||
return val;
|
||||
}
|
||||
|
||||
LinphoneCall *linphone_gtk_get_currently_displayed_call(){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window ();
|
||||
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
|
||||
const MSList *calls=linphone_core_get_calls(lc);
|
||||
if (!linphone_gtk_use_in_call_view() || ms_list_size(calls)==1){
|
||||
if (calls) return (LinphoneCall*)calls->data;
|
||||
}else{
|
||||
int idx=gtk_notebook_get_current_page (notebook);
|
||||
GtkWidget *page=gtk_notebook_get_nth_page(notebook,idx);
|
||||
if (page!=NULL){
|
||||
LinphoneCall *call=(LinphoneCall*)g_object_get_data(G_OBJECT(page),"call");
|
||||
return call;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GtkWidget *make_tab_header(int number){
|
||||
GtkWidget *w=gtk_hbox_new (FALSE,0);
|
||||
GtkWidget *i=create_pixmap ("status-green.png");
|
||||
GtkWidget *l;
|
||||
gchar *text=g_strdup_printf("Call %i",number);
|
||||
l=gtk_label_new (text);
|
||||
gtk_box_pack_start (GTK_BOX(w),i,FALSE,FALSE,0);
|
||||
gtk_box_pack_end(GTK_BOX(w),l,TRUE,TRUE,0);
|
||||
gtk_widget_show_all(w);
|
||||
return w;
|
||||
}
|
||||
|
||||
void linphone_gtk_create_in_call_view(LinphoneCall *call){
|
||||
GtkWidget *call_view=linphone_gtk_create_widget("main","in_call_frame");
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window ();
|
||||
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
|
||||
static int call_index=1;
|
||||
int idx;
|
||||
|
||||
if (ms_list_size(linphone_core_get_calls(linphone_gtk_get_core()))==1){
|
||||
/*this is the only call at this time */
|
||||
call_index=1;
|
||||
}
|
||||
g_object_set_data(G_OBJECT(call_view),"call",call);
|
||||
linphone_call_set_user_pointer (call,call_view);
|
||||
linphone_call_ref(call);
|
||||
gtk_notebook_append_page (notebook,call_view,make_tab_header(call_index));
|
||||
gtk_widget_show(call_view);
|
||||
idx = gtk_notebook_page_num(notebook, call_view);
|
||||
gtk_notebook_set_current_page(notebook, idx);
|
||||
call_index++;
|
||||
}
|
||||
|
||||
void linphone_gtk_remove_in_call_view(LinphoneCall *call){
|
||||
GtkWidget *w=(GtkWidget*)linphone_call_get_user_pointer (call);
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window ();
|
||||
GtkWidget *nb=linphone_gtk_get_widget(main_window,"viewswitch");
|
||||
int idx;
|
||||
g_return_if_fail(w!=NULL);
|
||||
idx=gtk_notebook_page_num(GTK_NOTEBOOK(nb),w);
|
||||
gtk_notebook_remove_page (GTK_NOTEBOOK(nb),idx);
|
||||
gtk_widget_destroy(w);
|
||||
linphone_call_set_user_pointer (call,NULL);
|
||||
linphone_call_unref(call);
|
||||
gtk_notebook_set_current_page(GTK_NOTEBOOK(nb), 0);
|
||||
}
|
||||
|
||||
static void display_peer_name_in_label(GtkWidget *label, const LinphoneAddress *from){
|
||||
const char *displayname=NULL;
|
||||
const char *id;
|
||||
char *uri_label;
|
||||
displayname=linphone_address_get_display_name(from);
|
||||
id=linphone_address_as_string_uri_only(from);
|
||||
|
||||
if (displayname!=NULL){
|
||||
uri_label=g_markup_printf_escaped("<span size=\"large\">%s</span>\n<i>%s</i>",
|
||||
displayname,id);
|
||||
}else
|
||||
uri_label=g_markup_printf_escaped("<span size=\"large\"><i>%s</i></span>\n",id);
|
||||
gtk_label_set_markup(GTK_LABEL(label),uri_label);
|
||||
g_free(uri_label);
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_set_calling(LinphoneCall *call){
|
||||
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
|
||||
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
|
||||
GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
|
||||
GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
|
||||
GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
|
||||
GdkPixbufAnimation *pbuf=create_pixbuf_animation("calling_anim.gif");
|
||||
|
||||
gtk_label_set_markup(GTK_LABEL(status),_("<b>Calling...</b>"));
|
||||
display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
|
||||
|
||||
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
|
||||
if (pbuf!=NULL){
|
||||
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_FIND,GTK_ICON_SIZE_DIALOG);
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call, bool_t with_pause){
|
||||
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
|
||||
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
|
||||
GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
|
||||
GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
|
||||
GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
|
||||
GdkPixbufAnimation *pbuf=create_pixbuf_animation("calling_anim.gif");
|
||||
GtkWidget *answer_button;
|
||||
|
||||
gtk_label_set_markup(GTK_LABEL(status),_("<b>Incoming call</b>"));
|
||||
gtk_widget_show_all(linphone_gtk_get_widget(callview,"answer_decline_panel"));
|
||||
display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
|
||||
|
||||
answer_button=linphone_gtk_get_widget(callview,"accept_call");
|
||||
gtk_button_set_image(GTK_BUTTON(answer_button),
|
||||
create_pixmap (linphone_gtk_get_ui_config("start_call_icon","startcall-green.png")));
|
||||
if (with_pause){
|
||||
gtk_button_set_label(GTK_BUTTON(answer_button),
|
||||
_("Pause all calls\nand answer"));
|
||||
}else gtk_button_set_label(GTK_BUTTON(answer_button),_("Answer"));
|
||||
gtk_button_set_image(GTK_BUTTON(linphone_gtk_get_widget(callview,"decline_call")),
|
||||
create_pixmap (linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png")));
|
||||
|
||||
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
|
||||
if (pbuf!=NULL){
|
||||
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_EXECUTE,GTK_ICON_SIZE_DIALOG);
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
|
||||
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
|
||||
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
|
||||
GtkWidget *callee=linphone_gtk_get_widget(callview,"in_call_uri");
|
||||
GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
|
||||
GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
|
||||
GdkPixbufAnimation *pbuf=create_pixbuf_animation("incall_anim.gif");
|
||||
GtkWidget *holdbutton;
|
||||
|
||||
display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
|
||||
|
||||
gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
|
||||
gtk_label_set_markup(GTK_LABEL(status),_("<b>In call with</b>"));
|
||||
|
||||
gtk_label_set_text(GTK_LABEL(duration),_("00::00::00"));
|
||||
if (pbuf!=NULL){
|
||||
gtk_image_set_from_animation(GTK_IMAGE(animation),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}else gtk_image_set_from_stock(GTK_IMAGE(animation),GTK_STOCK_EXECUTE,GTK_ICON_SIZE_DIALOG);
|
||||
linphone_gtk_enable_mute_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),TRUE);
|
||||
holdbutton=linphone_gtk_get_widget(callview,"hold_call");
|
||||
linphone_gtk_enable_hold_button(GTK_TOGGLE_BUTTON(holdbutton),TRUE);
|
||||
g_object_set_data(G_OBJECT(holdbutton),"call",call);
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_set_paused(LinphoneCall *call){
|
||||
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
|
||||
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
|
||||
gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
|
||||
gtk_label_set_markup(GTK_LABEL(status),_("<b>Paused call with</b>"));
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_update_duration(LinphoneCall *call){
|
||||
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
|
||||
GtkWidget *duration_label=linphone_gtk_get_widget(callview,"in_call_duration");
|
||||
int duration=linphone_call_get_duration(call);
|
||||
char tmp[256]={0};
|
||||
int seconds=duration%60;
|
||||
int minutes=(duration/60)%60;
|
||||
int hours=duration/3600;
|
||||
snprintf(tmp,sizeof(tmp)-1,_("%02i::%02i::%02i"),hours,minutes,seconds);
|
||||
gtk_label_set_text(GTK_LABEL(duration_label),tmp);
|
||||
}
|
||||
|
||||
static gboolean in_call_view_terminated(LinphoneCall *call){
|
||||
linphone_gtk_remove_in_call_view(call);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg){
|
||||
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
|
||||
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
|
||||
GtkWidget *animation=linphone_gtk_get_widget(callview,"in_call_animation");
|
||||
GdkPixbuf *pbuf=create_pixbuf(linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png"));
|
||||
|
||||
if (error_msg==NULL)
|
||||
gtk_label_set_markup(GTK_LABEL(status),_("<b>Call ended.</b>"));
|
||||
else{
|
||||
char *msg=g_markup_printf_escaped("<span color=\"red\"><b>%s</b></span>",error_msg);
|
||||
gtk_label_set_markup(GTK_LABEL(status),msg);
|
||||
g_free(msg);
|
||||
}
|
||||
if (pbuf!=NULL){
|
||||
gtk_image_set_from_pixbuf(GTK_IMAGE(animation),pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}
|
||||
gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
|
||||
linphone_gtk_enable_mute_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),FALSE);
|
||||
linphone_gtk_enable_hold_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(callview,"hold_call")),FALSE);
|
||||
g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,call);
|
||||
}
|
||||
|
||||
void linphone_gtk_draw_mute_button(GtkToggleButton *button, gboolean active){
|
||||
if (active){
|
||||
GtkWidget *image=create_pixmap("mic_muted.png");
|
||||
gtk_button_set_label(GTK_BUTTON(button),_("Unmute"));
|
||||
if (image!=NULL) {
|
||||
gtk_button_set_image(GTK_BUTTON(button),image);
|
||||
gtk_widget_show(image);
|
||||
}
|
||||
}else{
|
||||
GtkWidget *image=create_pixmap("mic_active.png");
|
||||
gtk_button_set_label(GTK_BUTTON(button),_("Mute"));
|
||||
if (image!=NULL) {
|
||||
gtk_button_set_image(GTK_BUTTON(button),image);
|
||||
gtk_widget_show(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_mute_toggled(GtkToggleButton *button){
|
||||
gboolean active=gtk_toggle_button_get_active(button);
|
||||
linphone_core_mute_mic(linphone_gtk_get_core(),active);
|
||||
linphone_gtk_draw_mute_button(button,active);
|
||||
}
|
||||
|
||||
void linphone_gtk_enable_mute_button(GtkToggleButton *button, gboolean sensitive)
|
||||
{
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(button),sensitive);
|
||||
linphone_gtk_draw_mute_button(button,FALSE);
|
||||
}
|
||||
|
||||
void linphone_gtk_draw_hold_button(GtkToggleButton *button, gboolean active){
|
||||
if (active){
|
||||
GtkWidget *image=create_pixmap("hold_off.png");
|
||||
gtk_button_set_label(GTK_BUTTON(button),_("Resume"));
|
||||
if (image!=NULL) {
|
||||
gtk_button_set_image(GTK_BUTTON(button),image);
|
||||
gtk_widget_show(image);
|
||||
}
|
||||
}else{
|
||||
GtkWidget *image=create_pixmap("hold_on.png");
|
||||
gtk_button_set_label(GTK_BUTTON(button),_("Pause"));
|
||||
if (image!=NULL) {
|
||||
gtk_button_set_image(GTK_BUTTON(button),image);
|
||||
gtk_widget_show(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_hold_toggled(GtkToggleButton *button){
|
||||
gboolean active=gtk_toggle_button_get_active(button);
|
||||
LinphoneCall *call=(LinphoneCall*)g_object_get_data(G_OBJECT(button),"call");
|
||||
if(active)
|
||||
{
|
||||
linphone_core_pause_call(linphone_gtk_get_core(),call);
|
||||
}
|
||||
else
|
||||
{
|
||||
linphone_core_resume_call(linphone_gtk_get_core(),call);
|
||||
}
|
||||
linphone_gtk_draw_hold_button(button,active);
|
||||
}
|
||||
|
||||
void linphone_gtk_enable_hold_button(GtkToggleButton *button, gboolean sensitive){
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(button),sensitive);
|
||||
linphone_gtk_draw_hold_button(button,FALSE);
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 2.16 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkDialog" id="incoming_call">
|
||||
<object class="GtkDialog" id="incoming_call">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="type">popup</property>
|
||||
|
|
@ -13,84 +13,81 @@
|
|||
<property name="urgency_hint">True</property>
|
||||
<property name="deletable">False</property>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox8">
|
||||
<object class="GtkVBox" id="dialog-vbox8">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame16">
|
||||
<object class="GtkFrame" id="frame16">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment16">
|
||||
<object class="GtkAlignment" id="alignment16">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="message">
|
||||
<object class="GtkLabel" id="message">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Incoming call from</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label43">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label43">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Incoming call</property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area7">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area7">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">spread</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="accept_call">
|
||||
<object class="GtkButton" id="accept_call">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<signal name="clicked" handler="linphone_gtk_accept_call"/>
|
||||
<signal handler="linphone_gtk_accept_call" name="clicked"/>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox17">
|
||||
<object class="GtkHBox" id="hbox17">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image12">
|
||||
<object class="GtkImage" id="image12">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="stock">gtk-yes</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label44">
|
||||
<object class="GtkLabel" id="label44">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Accept</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
|
|
@ -98,53 +95,53 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="decline_cal">
|
||||
<object class="GtkButton" id="decline_cal">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<signal name="clicked" handler="linphone_gtk_decline_call"/>
|
||||
<signal handler="linphone_gtk_decline_call" name="clicked"/>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox20">
|
||||
<object class="GtkHBox" id="hbox20">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image13">
|
||||
<object class="GtkImage" id="image13">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="stock">gtk-no</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="decline_call">
|
||||
<object class="GtkLabel" id="decline_call">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Decline</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -48,6 +48,8 @@ GdkPixbuf *_gdk_pixbuf_new_from_memory_at_scale(const void *data, gint len, gint
|
|||
|
||||
GtkWidget *linphone_gtk_create_window(const char *window_name);
|
||||
GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name);
|
||||
GtkWidget *linphone_gtk_create_widget(const char *filename, const char *widget_name);
|
||||
|
||||
LinphoneCore *linphone_gtk_get_core(void);
|
||||
GtkWidget *linphone_gtk_get_main_window();
|
||||
void linphone_gtk_display_something(GtkMessageType type,const gchar *message);
|
||||
|
|
@ -85,12 +87,14 @@ void linphone_gtk_show_directory_search(void);
|
|||
|
||||
/*functions controlling the different views*/
|
||||
gboolean linphone_gtk_use_in_call_view();
|
||||
void linphone_gtk_show_in_call_view(void);
|
||||
void linphone_gtk_show_idle_view(void);
|
||||
void linphone_gtk_in_call_view_set_calling(const char *uri);
|
||||
void linphone_gtk_in_call_view_set_in_call(void);
|
||||
void linphone_gtk_in_call_view_update_duration(int duration);
|
||||
void linphone_gtk_in_call_view_terminate(const char *error_msg);
|
||||
LinphoneCall *linphone_gtk_get_currently_displayed_call();
|
||||
void linphone_gtk_create_in_call_view(LinphoneCall *call);
|
||||
void linphone_gtk_in_call_view_set_calling(LinphoneCall *call);
|
||||
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call);
|
||||
void linphone_gtk_in_call_view_update_duration(LinphoneCall *call);
|
||||
void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg);
|
||||
void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call, bool_t with_pause);
|
||||
void linphone_gtk_in_call_view_set_paused(LinphoneCall *call);
|
||||
void linphone_gtk_enable_mute_button(GtkToggleButton *button, gboolean sensitive);
|
||||
void linphone_gtk_enable_hold_button(GtkToggleButton *button, gboolean sensitive);
|
||||
|
||||
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
|
@ -1,24 +1,24 @@
|
|||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<!-- interface-requires gtk+ 2.16 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.16"/>
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkDialog" id="log">
|
||||
<object class="GtkDialog" id="log">
|
||||
<property name="width_request">540</property>
|
||||
<property name="height_request">290</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Linphone debug window</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="icon">linphone2.png</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="deletable">False</property>
|
||||
<property name="has_separator">False</property>
|
||||
<signal name="response" handler="gtk_widget_hide"/>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
|
|
@ -27,48 +27,51 @@
|
|||
<property name="window_placement_set">True</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<widget class="GtkTextView" id="textview">
|
||||
<object class="GtkTextView" id="textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">word</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button1">
|
||||
<property name="label" translatable="yes">gtk-close</property>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_log_hide"/>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
<action-widgets>
|
||||
<action-widget response="0">button1</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -213,14 +213,6 @@ static void linphone_gtk_log_file(OrtpLogLevel lev, const char *msg)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static gboolean delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
|
||||
{
|
||||
gtk_widget_hide (widget);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void linphone_gtk_log_hide(){
|
||||
if (log_window)
|
||||
gtk_widget_hide(log_window);
|
||||
|
|
@ -234,7 +226,7 @@ void linphone_gtk_create_log_window(void){
|
|||
gtk_text_buffer_create_tag(b,"orange","foreground","orange",NULL);
|
||||
/*prevent the log window from being destroyed*/
|
||||
g_signal_connect (G_OBJECT (log_window), "delete-event",
|
||||
G_CALLBACK (delete_event_cb), NULL);
|
||||
G_CALLBACK (gtk_widget_hide_on_delete), log_window);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#define USE_LIBGLADE 1
|
||||
//#define USE_LIBGLADE 1
|
||||
|
||||
#define VIDEOSELFVIEW_DEFAULT 1
|
||||
|
||||
|
|
@ -42,7 +42,6 @@ static LinphoneCore *the_core=NULL;
|
|||
static GtkWidget *the_ui=NULL;
|
||||
|
||||
static void linphone_gtk_show(LinphoneCore *lc);
|
||||
static void linphone_gtk_inv_recv(LinphoneCore *lc, LinphoneCall *call);
|
||||
static void linphone_gtk_notify_recv(LinphoneCore *lc, LinphoneFriend * fid);
|
||||
static void linphone_gtk_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf, const char *url);
|
||||
static void linphone_gtk_auth_info_requested(LinphoneCore *lc, const char *realm, const char *username);
|
||||
|
|
@ -53,7 +52,7 @@ static void linphone_gtk_display_url(LinphoneCore *lc, const char *msg, const ch
|
|||
static void linphone_gtk_call_log_updated(LinphoneCore *lc, LinphoneCallLog *cl);
|
||||
static void linphone_gtk_refer_received(LinphoneCore *lc, const char *refer_to);
|
||||
static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cs, const char *msg);
|
||||
static gboolean linphone_gtk_auto_answer(GtkWidget *incall_window);
|
||||
static gboolean linphone_gtk_auto_answer(LinphoneCall *call);
|
||||
|
||||
|
||||
static gboolean verbose=0;
|
||||
|
|
@ -107,7 +106,7 @@ static GOptionEntry linphone_options[]={
|
|||
};
|
||||
|
||||
#define INSTALLED_XML_DIR PACKAGE_DATA_DIR "/linphone"
|
||||
#define BUILD_TREE_XML_DIR "gtk-glade"
|
||||
#define BUILD_TREE_XML_DIR "gtk"
|
||||
|
||||
#ifndef WIN32
|
||||
#define CONFIG_FILE ".linphonerc"
|
||||
|
|
@ -279,12 +278,78 @@ GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){
|
|||
|
||||
#else
|
||||
|
||||
static int get_ui_file(const char *name, char *path, int pathsize){
|
||||
snprintf(path,pathsize,"%s/%s.ui",BUILD_TREE_XML_DIR,name);
|
||||
if (access(path,F_OK)!=0){
|
||||
snprintf(path,pathsize,"%s/%s.ui",INSTALLED_XML_DIR,name);
|
||||
if (access(path,F_OK)!=0){
|
||||
g_error("Could not locate neither %s/%s.ui and %s/%s.ui .",BUILD_TREE_XML_DIR,name,
|
||||
INSTALLED_XML_DIR,name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
GtkWidget *linphone_gtk_create_window(const char *window_name){
|
||||
GError* error = NULL;
|
||||
GtkBuilder* builder = gtk_builder_new ();
|
||||
char path[512];
|
||||
GtkWidget *w;
|
||||
|
||||
if (get_ui_file(window_name,path,sizeof(path))==-1) return NULL;
|
||||
|
||||
if (!gtk_builder_add_from_file (builder, path, &error)){
|
||||
g_error("Couldn't load builder file: %s", error->message);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
w=GTK_WIDGET(gtk_builder_get_object (builder,window_name));
|
||||
if (w==NULL){
|
||||
g_error("Could not retrieve '%s' window from xml file",window_name);
|
||||
return NULL;
|
||||
}
|
||||
g_object_set_data(G_OBJECT(w),"builder",builder);
|
||||
gtk_builder_connect_signals(builder,w);
|
||||
linphone_gtk_configure_window(w,window_name);
|
||||
return w;
|
||||
}
|
||||
|
||||
GtkWidget *linphone_gtk_create_widget(const char *filename, const char *widget_name){
|
||||
char path[2048];
|
||||
GtkWidget *w;
|
||||
GtkBuilder* builder = gtk_builder_new ();
|
||||
GError *error=NULL;
|
||||
gchar *object_ids[2];
|
||||
object_ids[0]=g_strdup(widget_name);
|
||||
object_ids[1]=NULL;
|
||||
|
||||
if (get_ui_file(filename,path,sizeof(path))==-1) return NULL;
|
||||
if (!gtk_builder_add_objects_from_file(builder,path,object_ids,&error)){
|
||||
g_error("Couldn't load %s from builder file %s: %s", widget_name,path,error->message);
|
||||
g_error_free (error);
|
||||
g_free(object_ids[0]);
|
||||
return NULL;
|
||||
}
|
||||
g_free(object_ids[0]);
|
||||
w=GTK_WIDGET(gtk_builder_get_object (builder,widget_name));
|
||||
if (w==NULL){
|
||||
g_error("Could not retrieve '%s' window from xml file",widget_name);
|
||||
return NULL;
|
||||
}
|
||||
g_object_set_data(G_OBJECT(w),"builder",builder);
|
||||
gtk_builder_connect_signals(builder,w);
|
||||
return w;
|
||||
}
|
||||
|
||||
GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name){
|
||||
GObject *w=gtk_builder_get_object(the_ui,name);
|
||||
GtkBuilder *builder=(GtkBuilder*)g_object_get_data(G_OBJECT(window),"builder");
|
||||
GObject *w;
|
||||
if (builder==NULL){
|
||||
g_error("Fail to retrieve builder from window !");
|
||||
return NULL;
|
||||
}
|
||||
w=gtk_builder_get_object(builder,name);
|
||||
if (w==NULL){
|
||||
g_error("No widget named %s found in xml interface.",name);
|
||||
}
|
||||
|
|
@ -549,37 +614,75 @@ static void completion_add_text(GtkEntry *entry, const char *text){
|
|||
save_uri_history();
|
||||
}
|
||||
|
||||
void linphone_gtk_call_terminated(const char *error){
|
||||
void linphone_gtk_call_terminated(LinphoneCall *call, const char *error){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *icw;
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),FALSE);
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"start_call"),TRUE);
|
||||
linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(mw,"main_mute")),FALSE);
|
||||
if (linphone_gtk_use_in_call_view())
|
||||
linphone_gtk_in_call_view_terminate(error);
|
||||
|
||||
if (linphone_gtk_use_in_call_view() && call)
|
||||
linphone_gtk_in_call_view_terminate(call,error);
|
||||
update_video_title();
|
||||
icw=GTK_WIDGET(g_object_get_data(G_OBJECT(mw),"incoming_call"));
|
||||
if (icw!=NULL){
|
||||
g_object_set_data(G_OBJECT(mw),"incoming_call",NULL);
|
||||
gtk_widget_destroy(icw);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean in_call_timer(){
|
||||
if (linphone_core_in_call(linphone_gtk_get_core())){
|
||||
linphone_gtk_in_call_view_update_duration(
|
||||
linphone_core_get_current_call_duration(linphone_gtk_get_core()));
|
||||
LinphoneCall *call=linphone_core_get_current_call(linphone_gtk_get_core());
|
||||
if (call){
|
||||
linphone_gtk_in_call_view_update_duration(call);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void linphone_gtk_call_started(GtkWidget *mw){
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"start_call"),FALSE);
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),TRUE);
|
||||
static bool_t all_calls_paused(const MSList *calls){
|
||||
for(;calls!=NULL;calls=calls->next){
|
||||
LinphoneCall *call=(LinphoneCall*)calls->data;
|
||||
LinphoneCallState cs=linphone_call_get_state(call);
|
||||
if (cs!=LinphoneCallPaused && cs!=LinphoneCallIncomingReceived)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void linphone_gtk_update_call_buttons(LinphoneCall *call){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
const MSList *calls=linphone_core_get_calls(lc);
|
||||
GtkWidget *button;
|
||||
bool_t start_active=TRUE;
|
||||
bool_t stop_active=FALSE;
|
||||
bool_t add_call=FALSE;
|
||||
|
||||
if (calls==NULL){
|
||||
start_active=TRUE;
|
||||
stop_active=FALSE;
|
||||
}else if (linphone_core_get_current_call(lc)!=NULL){
|
||||
start_active=FALSE;
|
||||
stop_active=TRUE;
|
||||
}else if (all_calls_paused(calls)){
|
||||
start_active=TRUE;
|
||||
stop_active=TRUE;
|
||||
add_call=TRUE;
|
||||
}else if (call!=NULL){
|
||||
if (linphone_call_get_state(call)==LinphoneCallIncomingReceived){
|
||||
start_active=TRUE;
|
||||
stop_active=TRUE;
|
||||
}
|
||||
}
|
||||
button=linphone_gtk_get_widget(mw,"start_call");
|
||||
gtk_widget_set_sensitive(button,start_active);
|
||||
gtk_widget_set_visible(button,!add_call);
|
||||
|
||||
button=linphone_gtk_get_widget(mw,"add_call");
|
||||
gtk_widget_set_sensitive(button,start_active);
|
||||
gtk_widget_set_visible(button,add_call);
|
||||
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),stop_active);
|
||||
if (linphone_core_get_calls(lc)==NULL){
|
||||
linphone_gtk_enable_mute_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"main_mute")),
|
||||
FALSE);
|
||||
}
|
||||
update_video_title();
|
||||
if (linphone_gtk_use_in_call_view())
|
||||
g_timeout_add(250,(GSourceFunc)in_call_timer,NULL);
|
||||
}
|
||||
|
||||
static gboolean linphone_gtk_start_call_do(GtkWidget *uri_bar){
|
||||
|
|
@ -587,50 +690,37 @@ static gboolean linphone_gtk_start_call_do(GtkWidget *uri_bar){
|
|||
if (linphone_core_invite(linphone_gtk_get_core(),entered)!=NULL) {
|
||||
completion_add_text(GTK_ENTRY(uri_bar),entered);
|
||||
}else{
|
||||
linphone_gtk_call_terminated(NULL);
|
||||
linphone_gtk_call_terminated(NULL,NULL);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void _linphone_gtk_accept_call(){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *icw=GTK_WIDGET(g_object_get_data(G_OBJECT(mw),"incoming_call"));
|
||||
if (icw!=NULL){
|
||||
g_object_set_data(G_OBJECT(mw),"incoming_call",NULL);
|
||||
gtk_widget_destroy(icw);
|
||||
static gboolean linphone_gtk_auto_answer(LinphoneCall *call){
|
||||
if (linphone_call_get_state(call)==LinphoneCallIncomingReceived){
|
||||
linphone_core_accept_call (linphone_gtk_get_core(),call);
|
||||
linphone_call_unref(call);
|
||||
}
|
||||
|
||||
linphone_core_accept_call(lc,NULL);
|
||||
linphone_gtk_call_started(linphone_gtk_get_main_window());
|
||||
if (linphone_gtk_use_in_call_view()){
|
||||
linphone_gtk_in_call_view_set_in_call();
|
||||
linphone_gtk_show_in_call_view();
|
||||
}
|
||||
linphone_gtk_enable_mute_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"main_mute"))
|
||||
,TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
void linphone_gtk_start_call(GtkWidget *w){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
if (linphone_core_inc_invite_pending(lc)){
|
||||
/*accept the call*/
|
||||
_linphone_gtk_accept_call();
|
||||
}else if (linphone_core_in_call(lc)) {
|
||||
/*already in call */
|
||||
LinphoneCall *call;
|
||||
/*change into in-call mode, then do the work later as it might block a bit */
|
||||
GtkWidget *mw=gtk_widget_get_toplevel(w);
|
||||
GtkWidget *uri_bar=linphone_gtk_get_widget(mw,"uribar");
|
||||
|
||||
call=linphone_gtk_get_currently_displayed_call ();
|
||||
if (call!=NULL && linphone_call_get_state(call)==LinphoneCallIncomingReceived){
|
||||
linphone_core_accept_call(lc,call);
|
||||
}else{
|
||||
/*change into in-call mode, then do the work later as it might block a bit */
|
||||
GtkWidget *mw=gtk_widget_get_toplevel(w);
|
||||
GtkWidget *uri_bar=linphone_gtk_get_widget(mw,"uribar");
|
||||
const char *entered=gtk_entry_get_text(GTK_ENTRY(uri_bar));
|
||||
linphone_gtk_call_started(mw);
|
||||
if (linphone_gtk_use_in_call_view()){
|
||||
linphone_gtk_in_call_view_set_calling(entered);
|
||||
linphone_gtk_show_in_call_view();
|
||||
}
|
||||
/*immediately disable the button and delay a bit the execution the linphone_core_invite()
|
||||
so that we don't freeze the button. linphone_core_invite() might block for some hundreds of milliseconds*/
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"start_call"),FALSE);
|
||||
g_timeout_add(100,(GSourceFunc)linphone_gtk_start_call_do,uri_bar);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void linphone_gtk_uri_bar_activate(GtkWidget *w){
|
||||
|
|
@ -639,23 +729,23 @@ void linphone_gtk_uri_bar_activate(GtkWidget *w){
|
|||
|
||||
|
||||
void linphone_gtk_terminate_call(GtkWidget *button){
|
||||
const MSList *elem=linphone_core_get_calls(linphone_gtk_get_core());
|
||||
if (elem==NULL) return;
|
||||
linphone_core_terminate_call(linphone_gtk_get_core(),(LinphoneCall*)elem->data);
|
||||
LinphoneCall *call=linphone_gtk_get_currently_displayed_call ();
|
||||
if (call)
|
||||
linphone_core_terminate_call(linphone_gtk_get_core(),call);
|
||||
}
|
||||
|
||||
void linphone_gtk_decline_call(GtkWidget *button){
|
||||
linphone_core_terminate_call(linphone_gtk_get_core(),NULL);
|
||||
gtk_widget_destroy(gtk_widget_get_toplevel(button));
|
||||
void linphone_gtk_decline_clicked(GtkWidget *button){
|
||||
LinphoneCall *call=linphone_gtk_get_currently_displayed_call ();
|
||||
if (call)
|
||||
linphone_core_terminate_call(linphone_gtk_get_core(),call);
|
||||
}
|
||||
|
||||
void linphone_gtk_accept_call(GtkWidget *button){
|
||||
_linphone_gtk_accept_call();
|
||||
}
|
||||
|
||||
static gboolean linphone_gtk_auto_answer(GtkWidget *incall_window){
|
||||
linphone_gtk_accept_call(linphone_gtk_get_widget(incall_window,"accept_call"));
|
||||
return FALSE;
|
||||
void linphone_gtk_answer_clicked(GtkWidget *button){
|
||||
LinphoneCall *call=linphone_gtk_get_currently_displayed_call ();
|
||||
if (call){
|
||||
linphone_core_pause_all_calls(linphone_gtk_get_core());
|
||||
linphone_core_accept_call(linphone_gtk_get_core(),call);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_set_audio_video(){
|
||||
|
|
@ -702,33 +792,6 @@ static void linphone_gtk_show(LinphoneCore *lc){
|
|||
linphone_gtk_show_main_window();
|
||||
}
|
||||
|
||||
static void linphone_gtk_inv_recv(LinphoneCore *lc, LinphoneCall *call){
|
||||
GtkWidget *w=linphone_gtk_create_window("incoming_call");
|
||||
GtkWidget *label;
|
||||
gchar *msg;
|
||||
char *from=linphone_call_get_remote_address_as_string(call);
|
||||
|
||||
if (auto_answer){
|
||||
g_timeout_add(2000,(GSourceFunc)linphone_gtk_auto_answer,w);
|
||||
}
|
||||
|
||||
gtk_window_set_transient_for(GTK_WINDOW(w),GTK_WINDOW(linphone_gtk_get_main_window()));
|
||||
gtk_window_set_position(GTK_WINDOW(w),GTK_WIN_POS_CENTER_ON_PARENT);
|
||||
|
||||
label=linphone_gtk_get_widget(w,"message");
|
||||
msg=g_strdup_printf(_("Incoming call from %s"),from);
|
||||
gtk_label_set_text(GTK_LABEL(label),msg);
|
||||
gtk_window_set_title(GTK_WINDOW(w),msg);
|
||||
gtk_widget_show(w);
|
||||
gtk_window_present(GTK_WINDOW(w));
|
||||
/*gtk_window_set_urgency_hint(GTK_WINDOW(w),TRUE);*/
|
||||
g_free(msg);
|
||||
g_object_set_data(G_OBJECT(linphone_gtk_get_main_window()),"incoming_call",w);
|
||||
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"uribar")),
|
||||
from);
|
||||
ms_free(from);
|
||||
}
|
||||
|
||||
static void linphone_gtk_notify_recv(LinphoneCore *lc, LinphoneFriend * fid){
|
||||
linphone_gtk_show_friends();
|
||||
}
|
||||
|
|
@ -871,25 +934,41 @@ static void linphone_gtk_call_log_updated(LinphoneCore *lc, LinphoneCallLog *cl)
|
|||
|
||||
static void linphone_gtk_call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cs, const char *msg){
|
||||
switch(cs){
|
||||
case LinphoneCallConnected:
|
||||
if (linphone_gtk_use_in_call_view())
|
||||
linphone_gtk_in_call_view_set_in_call();
|
||||
case LinphoneCallOutgoingInit:
|
||||
linphone_gtk_create_in_call_view (call);
|
||||
break;
|
||||
case LinphoneCallOutgoingProgress:
|
||||
linphone_gtk_in_call_view_set_calling (call);
|
||||
break;
|
||||
case LinphoneCallStreamsRunning:
|
||||
linphone_gtk_in_call_view_set_in_call(call);
|
||||
linphone_gtk_enable_mute_button(
|
||||
GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"main_mute")),
|
||||
TRUE);
|
||||
g_timeout_add(250,(GSourceFunc)in_call_timer,NULL);
|
||||
break;
|
||||
case LinphoneCallError:
|
||||
linphone_gtk_call_terminated(msg);
|
||||
linphone_gtk_in_call_view_terminate (call,msg);
|
||||
break;
|
||||
case LinphoneCallEnd:
|
||||
linphone_gtk_call_terminated(NULL);
|
||||
linphone_gtk_in_call_view_terminate(call,NULL);
|
||||
break;
|
||||
case LinphoneCallIncomingReceived:
|
||||
linphone_gtk_inv_recv (lc,call);
|
||||
linphone_gtk_create_in_call_view (call);
|
||||
linphone_gtk_in_call_view_set_incoming(call,!all_calls_paused (linphone_core_get_calls(lc)));
|
||||
if (auto_answer) {
|
||||
linphone_call_ref(call);
|
||||
g_timeout_add(2000,(GSourceFunc)linphone_gtk_auto_answer ,call);
|
||||
}
|
||||
break;
|
||||
case LinphoneCallPaused:
|
||||
case LinphoneCallPausedByRemote:
|
||||
linphone_gtk_in_call_view_set_paused(call);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
linphone_gtk_update_call_buttons (call);
|
||||
}
|
||||
|
||||
static void icon_popup_menu(GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data){
|
||||
|
|
@ -1043,6 +1122,7 @@ static void linphone_gtk_configure_main_window(){
|
|||
static const char *title;
|
||||
static const char *home;
|
||||
static const char *start_call_icon;
|
||||
static const char *add_call_icon;
|
||||
static const char *stop_call_icon;
|
||||
static const char *search_icon;
|
||||
static gboolean update_check_menu;
|
||||
|
|
@ -1052,6 +1132,7 @@ static void linphone_gtk_configure_main_window(){
|
|||
title=linphone_gtk_get_ui_config("title","Linphone");
|
||||
home=linphone_gtk_get_ui_config("home","http://www.linphone.org");
|
||||
start_call_icon=linphone_gtk_get_ui_config("start_call_icon","startcall-green.png");
|
||||
add_call_icon=linphone_gtk_get_ui_config("add_call_icon","addcall-green.png");
|
||||
stop_call_icon=linphone_gtk_get_ui_config("stop_call_icon","stopcall-red.png");
|
||||
search_icon=linphone_gtk_get_ui_config("directory_search_icon",NULL);
|
||||
update_check_menu=linphone_gtk_get_ui_config_int("update_check_menu",0);
|
||||
|
|
@ -1066,18 +1147,22 @@ static void linphone_gtk_configure_main_window(){
|
|||
#endif
|
||||
}
|
||||
if (start_call_icon){
|
||||
GdkPixbuf *pbuf=create_pixbuf(start_call_icon);
|
||||
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"start_call_icon")),pbuf);
|
||||
if (buttons_have_borders)
|
||||
gtk_button_set_relief(GTK_BUTTON(linphone_gtk_get_widget(w,"start_call")),GTK_RELIEF_NORMAL);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
gtk_button_set_image(GTK_BUTTON(linphone_gtk_get_widget(w,"start_call")),
|
||||
create_pixmap (start_call_icon));
|
||||
if (!buttons_have_borders)
|
||||
gtk_button_set_relief(GTK_BUTTON(linphone_gtk_get_widget(w,"start_call")),GTK_RELIEF_NONE);
|
||||
}
|
||||
if (add_call_icon){
|
||||
gtk_button_set_image(GTK_BUTTON(linphone_gtk_get_widget(w,"add_call")),
|
||||
create_pixmap (add_call_icon));
|
||||
if (!buttons_have_borders)
|
||||
gtk_button_set_relief(GTK_BUTTON(linphone_gtk_get_widget(w,"add_call")),GTK_RELIEF_NONE);
|
||||
}
|
||||
if (stop_call_icon){
|
||||
GdkPixbuf *pbuf=create_pixbuf(stop_call_icon);
|
||||
gtk_image_set_from_pixbuf(GTK_IMAGE(linphone_gtk_get_widget(w,"terminate_call_icon")),pbuf);
|
||||
if (buttons_have_borders)
|
||||
gtk_button_set_relief(GTK_BUTTON(linphone_gtk_get_widget(w,"terminate_call")),GTK_RELIEF_NORMAL);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
gtk_button_set_image(GTK_BUTTON(linphone_gtk_get_widget(w,"terminate_call")),
|
||||
create_pixmap (stop_call_icon));
|
||||
if (!buttons_have_borders)
|
||||
gtk_button_set_relief(GTK_BUTTON(linphone_gtk_get_widget(w,"terminate_call")),GTK_RELIEF_NONE);
|
||||
}
|
||||
if (search_icon){
|
||||
GdkPixbuf *pbuf=create_pixbuf(search_icon);
|
||||
|
|
@ -1104,10 +1189,10 @@ static void linphone_gtk_configure_main_window(){
|
|||
g_object_unref(G_OBJECT(pbuf));
|
||||
}
|
||||
}
|
||||
if (!linphone_gtk_can_manage_accounts())
|
||||
gtk_widget_hide(linphone_gtk_get_widget(w,"run_assistant"));
|
||||
if (linphone_gtk_can_manage_accounts())
|
||||
gtk_widget_show(linphone_gtk_get_widget(w,"assistant_item"));
|
||||
if (update_check_menu){
|
||||
gtk_widget_show(linphone_gtk_get_widget(w,"versioncheck"));
|
||||
gtk_widget_show(linphone_gtk_get_widget(w,"versioncheck_item"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1123,6 +1208,17 @@ void linphone_gtk_manage_login(void){
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void linphone_gtk_close(GtkWidget *mw){
|
||||
/*shutdown calls if any*/
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
if (linphone_core_in_call(lc)){
|
||||
linphone_core_terminate_all_calls(lc);
|
||||
}
|
||||
linphone_core_enable_video_preview(lc,FALSE);
|
||||
gtk_widget_hide(mw);
|
||||
}
|
||||
|
||||
static void linphone_gtk_init_main_window(){
|
||||
GtkWidget *main_window;
|
||||
|
||||
|
|
@ -1144,23 +1240,12 @@ static void linphone_gtk_init_main_window(){
|
|||
if (!linphone_gtk_use_in_call_view()) {
|
||||
gtk_widget_show(linphone_gtk_get_widget(main_window, "main_mute"));
|
||||
}
|
||||
if (linphone_core_in_call(linphone_gtk_get_core())) linphone_gtk_call_started(
|
||||
linphone_gtk_get_main_window());/*hide the call button, show terminate button*/
|
||||
linphone_gtk_update_call_buttons (NULL);
|
||||
/*prevent the main window from being destroyed by a user click on WM controls, instead we hide it*/
|
||||
g_signal_connect (G_OBJECT (main_window), "delete-event",
|
||||
G_CALLBACK (linphone_gtk_close), main_window);
|
||||
}
|
||||
|
||||
void linphone_gtk_close(){
|
||||
/* couldn't find a way to prevent closing to destroy the main window*/
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
the_ui=NULL;
|
||||
the_ui=linphone_gtk_create_window("main");
|
||||
linphone_gtk_init_main_window();
|
||||
/*shutdown call if any*/
|
||||
if (linphone_core_in_call(lc)){
|
||||
linphone_core_terminate_call(lc,NULL);
|
||||
linphone_gtk_call_terminated(NULL);
|
||||
}
|
||||
linphone_core_enable_video_preview(lc,FALSE);
|
||||
}
|
||||
|
||||
void linphone_gtk_log_handler(OrtpLogLevel lev, const char *fmt, va_list args){
|
||||
if (verbose){
|
||||
|
|
@ -1280,6 +1365,7 @@ int main(int argc, char *argv[]){
|
|||
}
|
||||
|
||||
settings=gtk_settings_get_default();
|
||||
g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));
|
||||
g_object_set(settings, "gtk-menu-images", TRUE, NULL);
|
||||
g_object_set(settings, "gtk-button-images", TRUE, NULL);
|
||||
#ifdef WIN32
|
||||
|
|
@ -1304,9 +1390,7 @@ int main(int argc, char *argv[]){
|
|||
add_pixmap_directory(PACKAGE_DATA_DIR "/pixmaps/linphone");
|
||||
|
||||
|
||||
g_set_application_name("Linphone");
|
||||
pbuf=create_pixbuf(linphone_gtk_get_ui_config("icon",LINPHONE_ICON));
|
||||
if (pbuf!=NULL) gtk_window_set_default_icon(pbuf);
|
||||
|
||||
|
||||
the_ui=linphone_gtk_create_window("main");
|
||||
|
||||
|
|
@ -1314,6 +1398,11 @@ int main(int argc, char *argv[]){
|
|||
linphone_core_enable_logs_with_cb(linphone_gtk_log_handler);
|
||||
|
||||
linphone_gtk_init_liblinphone(config_file, factory_config_file);
|
||||
|
||||
g_set_application_name(linphone_gtk_get_ui_config("title","Linphone"));
|
||||
pbuf=create_pixbuf(linphone_gtk_get_ui_config("icon",LINPHONE_ICON));
|
||||
if (pbuf!=NULL) gtk_window_set_default_icon(pbuf);
|
||||
|
||||
/* do not lower timeouts under 30 ms because it exhibits a bug on gtk+/win32, with cpu running 20% all the time...*/
|
||||
gtk_timeout_add(30,(GtkFunction)linphone_gtk_iterate,(gpointer)linphone_gtk_get_core());
|
||||
gtk_timeout_add(30,(GtkFunction)linphone_gtk_check_logs,(gpointer)NULL);
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,13 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<?xml version="1.0"?>
|
||||
<!--Generated with glade3 3.4.5 on Sun Mar 29 21:17:24 2009 -->
|
||||
<glade-interface>
|
||||
<widget class="GtkAssistant" id="p2pwizard">
|
||||
<interface>
|
||||
<object class="GtkAssistant" id="p2pwizard">
|
||||
<property name="title" translatable="yes">Creating a FONICS account</property>
|
||||
<signal name="apply" handler="linphone_gtk_fonis_wizard_apply"/>
|
||||
<signal name="prepare" handler="linphone_gtk_fonis_wizard_prepare"/>
|
||||
<signal handler="linphone_gtk_fonis_wizard_apply" name="apply"/>
|
||||
<signal handler="linphone_gtk_fonis_wizard_prepare" name="prepare"/>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Welcome !
|
||||
This wizard will help you to setup a SIP account.
|
||||
|
|
@ -16,119 +15,115 @@ This wizard will help you to setup a SIP account.
|
|||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="selectable">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">GTK_ASSISTANT_PAGE_INTRO</property>
|
||||
<property name="title">Introduction</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label2">
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Please choose a username:</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame1">
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox2">
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="username">
|
||||
<object class="GtkEntry" id="username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button1">
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="linphone_gtk_fonis_wizard_check_username_clicked"/>
|
||||
<signal handler="linphone_gtk_fonis_wizard_check_username_clicked" name="clicked"/>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2">
|
||||
<object class="GtkHBox" id="hbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1">
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-apply</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label5">
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Check availability</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="check_result">
|
||||
<object class="GtkLabel" id="check_result">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label4">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="title">Create your account !</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label3">
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Done ! Your account is now created and ready to use.</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">GTK_ASSISTANT_PAGE_CONFIRM</property>
|
||||
<property name="title">Finished !</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
</object>
|
||||
</interface>
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 2.16 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkDialog" id="password">
|
||||
<object class="GtkDialog" id="password">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Linphone - Authentication required</property>
|
||||
|
|
@ -12,68 +12,68 @@
|
|||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox9">
|
||||
<object class="GtkVBox" id="dialog-vbox9">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox12">
|
||||
<object class="GtkVBox" id="vbox12">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="message">
|
||||
<object class="GtkLabel" id="message">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Please enter the domain password</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="wrap">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkTable" id="table1">
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="userid_label">
|
||||
<object class="GtkLabel" id="userid_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">UserID</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="userid_entry">
|
||||
<object class="GtkEntry" id="userid_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Password:</property>
|
||||
<property name="justify">right</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="password_entry">
|
||||
<object class="GtkEntry" id="password_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<signal name="activate" handler="linphone_gtk_password_ok"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_password_ok" name="activate"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
|
|
@ -81,31 +81,31 @@
|
|||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area8">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area8">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button8">
|
||||
<object class="GtkButton" id="button8">
|
||||
<property name="label" translatable="yes">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_password_ok"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_password_ok" name="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
|
|
@ -113,29 +113,29 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button9">
|
||||
<object class="GtkButton" id="button9">
|
||||
<property name="label" translatable="yes">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_password_cancel"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_password_cancel" name="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -813,11 +813,13 @@ void linphone_gtk_show_parameters(void){
|
|||
linphone_gtk_show_sip_accounts(pb);
|
||||
/* CODECS CONFIG */
|
||||
linphone_gtk_init_codec_list(GTK_TREE_VIEW(codec_list));
|
||||
linphone_gtk_draw_codec_list(GTK_TREE_VIEW(codec_list),0);
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(linphone_gtk_get_widget(pb,"codec_view")),0);
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"download_bw")),
|
||||
linphone_core_get_download_bandwidth(lc));
|
||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(linphone_gtk_get_widget(pb,"upload_bw")),
|
||||
linphone_core_get_upload_bandwidth(lc));
|
||||
|
||||
|
||||
/* UI CONFIG */
|
||||
linphone_gtk_fill_langs(pb);
|
||||
|
|
@ -1,8 +1,16 @@
|
|||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<interface>
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100000</property>
|
||||
<property name="lower">0</property>
|
||||
<property name="page_increment">10</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_size">10</property>
|
||||
<property name="value">3600</property>
|
||||
</object>
|
||||
<!-- interface-requires gtk+ 2.6 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkDialog" id="sip_account">
|
||||
<object class="GtkDialog" id="sip_account">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Linphone - Configure a SIP account</property>
|
||||
|
|
@ -11,74 +19,74 @@
|
|||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox2">
|
||||
<object class="GtkVBox" id="dialog-vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame15">
|
||||
<object class="GtkFrame" id="frame15">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment15">
|
||||
<object class="GtkAlignment" id="alignment15">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox11">
|
||||
<object class="GtkVBox" id="vbox11">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="table6">
|
||||
<object class="GtkTable" id="table6">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="n_rows">4</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label38">
|
||||
<object class="GtkLabel" id="label38">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Your SIP identity:</property>
|
||||
<property name="justify">right</property>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="identity">
|
||||
<object class="GtkEntry" id="identity">
|
||||
<property name="width_request">275</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Looks like sip:<username>@<domain></property>
|
||||
<property name="tooltip-text" translatable="yes">Looks like sip:<username>@<domain></property>
|
||||
<property name="text" translatable="yes">sip:</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label39">
|
||||
<object class="GtkLabel" id="label39">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">SIP Proxy address:</property>
|
||||
<property name="justify">right</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="proxy">
|
||||
<object class="GtkEntry" id="proxy">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip" translatable="yes">Looks like sip:<proxy hostname></property>
|
||||
<property name="tooltip-text" translatable="yes">Looks like sip:<proxy hostname></property>
|
||||
<property name="text" translatable="yes">sip:</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
|
|
@ -87,23 +95,23 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label40">
|
||||
<object class="GtkLabel" id="label40">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Route (optional):</property>
|
||||
<property name="justify">right</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="route">
|
||||
<object class="GtkEntry" id="route">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
|
|
@ -112,24 +120,24 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label41">
|
||||
<object class="GtkLabel" id="label41">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Registration duration (sec):</property>
|
||||
<property name="justify">right</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkSpinButton" id="regperiod">
|
||||
<object class="GtkSpinButton" id="regperiod">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="adjustment">3600 0 100000 1 10 10</property>
|
||||
</widget>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
|
|
@ -137,73 +145,70 @@
|
|||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="register">
|
||||
<object class="GtkCheckButton" id="register">
|
||||
<property name="label" translatable="yes">Register at startup</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="publish">
|
||||
<object class="GtkCheckButton" id="publish">
|
||||
<property name="label" translatable="yes">Publish presence information</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label42">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label42">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Configure a SIP account</property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area2">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area2">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button6">
|
||||
<object class="GtkButton" id="button6">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_proxy_ok"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_proxy_ok" name="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
|
|
@ -211,29 +216,29 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="button7">
|
||||
<object class="GtkButton" id="button7">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_proxy_cancel"/>
|
||||
</widget>
|
||||
<signal handler="linphone_gtk_proxy_cancel" name="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
</object>
|
||||
</interface>
|
||||
|
Before Width: | Height: | Size: 764 B After Width: | Height: | Size: 764 B |
|
|
@ -177,7 +177,7 @@ const gchar *linphone_gtk_get_ui_config(const char *key, const char *def){
|
|||
LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
|
||||
return lp_config_get_string(cfg,"GtkUi",key,def);
|
||||
}else{
|
||||
ms_warning ("Cannot read config, no core created yet.");
|
||||
g_error ("Cannot read config, no core created yet.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
|
||||
<?xml version="1.0"?>
|
||||
<!--Generated with glade3 3.4.5 on Sun Mar 29 15:33:09 2009 -->
|
||||
<glade-interface>
|
||||
<widget class="GtkWindow" id="waiting">
|
||||
<interface>
|
||||
<object class="GtkWindow" id="waiting">
|
||||
<property name="title" translatable="yes">Linphone</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="modal">True</property>
|
||||
|
|
@ -10,52 +9,49 @@
|
|||
<property name="icon">linphone2.png</property>
|
||||
<property name="deletable">False</property>
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame1">
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1">
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-dialog-info</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkProgressBar" id="progressbar">
|
||||
<object class="GtkProgressBar" id="progressbar">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Please wait</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="type">label_item</property>
|
||||
</packing>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -240,5 +240,9 @@ public interface LinphoneCore {
|
|||
public boolean isEchoCancellationEnabled();
|
||||
|
||||
public void setSignalingTransport(Transport aTransport);
|
||||
|
||||
public void enableSpeaker(boolean value);
|
||||
|
||||
public boolean isSpeakerEnabled();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit ea7ca97aaaa6f191dfec112f137fb048a4ef2139
|
||||
Subproject commit 46b69fe88700905a362eeb0a57e8218585b76565
|
||||
2
oRTP
2
oRTP
|
|
@ -1 +1 @@
|
|||
Subproject commit 534074027a2163694ce6f8a520f0d6f6ac82b15d
|
||||
Subproject commit 6bc540160a8729f63f6074b958161bc696e78f93
|
||||
BIN
pixmaps/addcall-green.png
Normal file
BIN
pixmaps/addcall-green.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
|
|
@ -1,29 +1,29 @@
|
|||
# List of source files containing translatable strings.
|
||||
gtk-glade/calllogs.c
|
||||
gtk-glade/logging.c
|
||||
gtk-glade/support.c
|
||||
gtk-glade/chat.c
|
||||
gtk-glade/main.c
|
||||
gtk-glade/friendlist.c
|
||||
gtk-glade/propertybox.c
|
||||
gtk-glade/update.c
|
||||
gtk-glade/buddylookup.c
|
||||
gtk-glade/setupwizard.c
|
||||
gtk-glade/incall_view.c
|
||||
gtk-glade/loginframe.c
|
||||
gtk-glade/main.glade
|
||||
gtk-glade/about.glade
|
||||
gtk-glade/contact.glade
|
||||
gtk-glade/log.glade
|
||||
gtk-glade/password.glade
|
||||
gtk-glade/call_logs.glade
|
||||
gtk-glade/main.glade
|
||||
gtk-glade/sip_account.glade
|
||||
gtk-glade/chatroom.glade
|
||||
gtk-glade/incoming_call.glade
|
||||
gtk-glade/parameters.glade
|
||||
gtk-glade/buddylookup.glade
|
||||
gtk-glade/waiting.glade
|
||||
gtk/calllogs.c
|
||||
gtk/logging.c
|
||||
gtk/support.c
|
||||
gtk/chat.c
|
||||
gtk/main.c
|
||||
gtk/friendlist.c
|
||||
gtk/propertybox.c
|
||||
gtk/update.c
|
||||
gtk/buddylookup.c
|
||||
gtk/setupwizard.c
|
||||
gtk/incall_view.c
|
||||
gtk/loginframe.c
|
||||
gtk/main.ui
|
||||
gtk/about.ui
|
||||
gtk/contact.ui
|
||||
gtk/log.ui
|
||||
gtk/password.ui
|
||||
gtk/call_logs.ui
|
||||
gtk/main.ui
|
||||
gtk/sip_account.ui
|
||||
gtk/chatroom.ui
|
||||
gtk/incoming_call.ui
|
||||
gtk/parameters.ui
|
||||
gtk/buddylookup.ui
|
||||
gtk/waiting.ui
|
||||
coreapi/linphonecore.c
|
||||
coreapi/misc.c
|
||||
coreapi/presence.c
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue