diff --git a/Makefile.am b/Makefile.am index 37abf47a9..458ddbe80 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/TODO b/TODO index 3a0199c38..1452a7c00 100644 --- a/TODO +++ b/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. \ No newline at end of file diff --git a/build/android/Android.mk b/build/android/Android.mk index 7432a7722..0997d9639 100755 --- a/build/android/Android.mk +++ b/build/android/Android.mk @@ -37,7 +37,6 @@ LOCAL_SRC_FILES = \ authentication.c \ lpconfig.c \ chat.c \ - general_state.c \ sipsetup.c \ siplogin.c \ address.c \ diff --git a/configure.in b/configure.in index cda24af91..c67f47ec8 100644 --- a/configure.in +++ b/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 diff --git a/console/commands.c b/console/commands.c index 2fd9b5401..816135687 100644 --- a/console/commands.c +++ b/console/commands.c @@ -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 */ } diff --git a/console/linphonec.c b/console/linphonec.c index df86abb8f..75121db61 100644 --- a/console/linphonec.c +++ b/console/linphonec.c @@ -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); diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index aad80a60d..c96207251 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -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); } diff --git a/coreapi/exevents.h b/coreapi/exevents.h deleted file mode 100644 index c7e7baa9b..000000000 --- a/coreapi/exevents.h +++ /dev/null @@ -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 -#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 diff --git a/coreapi/general_state.c b/coreapi/general_state.c deleted file mode 100644 index dc9e3e642..000000000 --- a/coreapi/general_state.c +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** - * - * File: general_state.c - * - * Copyright (C) 2006, 2007 Thomas Reitmayr - * - **************************************************************************** - * - * 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); -} - diff --git a/coreapi/help/Makefile.am b/coreapi/help/Makefile.am index ae5e2ed25..ebe407ff9 100644 --- a/coreapi/help/Makefile.am +++ b/coreapi/help/Makefile.am @@ -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) \ diff --git a/coreapi/help/helloworld.c b/coreapi/help/helloworld.c new file mode 100644 index 000000000..77eda06df --- /dev/null +++ b/coreapi/help/helloworld.c @@ -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 + +#include + +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; +} + diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index b5c3e8e94..00739ae95 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -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){ diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index af13e57a0..89ad4382a 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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. * diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 075fcf2f0..60714aa7c 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -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); diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 67da96a02..c6a7cd6f6 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -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,"", "(J)V"); + + callClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCallImpl")); + callCtrId = env->GetMethodID(callClass,"", "(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); +} + + + + diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index 172255716..ac5ea1d7a 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -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); diff --git a/coreapi/sdphandler.c b/coreapi/sdphandler.c deleted file mode 100644 index bf622a92e..000000000 --- a/coreapi/sdphandler.c +++ /dev/null @@ -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 -#include -#include -#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); -} diff --git a/coreapi/sdphandler.h b/coreapi/sdphandler.h deleted file mode 100644 index b3e811b70..000000000 --- a/coreapi/sdphandler.h +++ /dev/null @@ -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 -#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 diff --git a/gtk-glade/incall_view.c b/gtk-glade/incall_view.c deleted file mode 100644 index 4d60d6309..000000000 --- a/gtk-glade/incall_view.c +++ /dev/null @@ -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 , (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("%s\n%s", - displayname,id); - }else - uri_label=g_markup_printf_escaped("%s\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),_("Calling...")); - 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),_("In call with")); - - 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),_("Call ended.")); - else{ - char *msg=g_markup_printf_escaped("%s",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); -} diff --git a/gtk-glade/.gitignore b/gtk/.gitignore similarity index 100% rename from gtk-glade/.gitignore rename to gtk/.gitignore diff --git a/gtk-glade/Makefile.am b/gtk/Makefile.am similarity index 67% rename from gtk-glade/Makefile.am rename to gtk/Makefile.am index f2086d823..546e9f494 100644 --- a/gtk-glade/Makefile.am +++ b/gtk/Makefile.am @@ -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) diff --git a/gtk-glade/about.glade b/gtk/about.ui similarity index 90% rename from gtk-glade/about.glade rename to gtk/about.ui index e4ee4d2bb..3fc7d3538 100644 --- a/gtk-glade/about.glade +++ b/gtk/about.ui @@ -1,14 +1,13 @@ - + - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 About linphone False center-on-parent - linphone2.png dialog False Linphone @@ -35,7 +34,7 @@ hu: anonymous Icons by kerosine.fr - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical @@ -44,18 +43,18 @@ hu: anonymous - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK end - + False end 0 - + - - + + diff --git a/gtk-glade/buddylookup.c b/gtk/buddylookup.c similarity index 100% rename from gtk-glade/buddylookup.c rename to gtk/buddylookup.c diff --git a/gtk-glade/buddylookup.glade b/gtk/buddylookup.ui similarity index 75% rename from gtk-glade/buddylookup.glade rename to gtk/buddylookup.ui index 2e6eb96bd..34b45edfc 100644 --- a/gtk-glade/buddylookup.glade +++ b/gtk/buddylookup.ui @@ -1,94 +1,94 @@ - + - + 5 Search contacts in directory center-on-parent linphone2.png dialog False - + - + True 2 - + True 5 0 - + True 12 - + True - + True True True - - + + False 0 - + True True automatic automatic etched-in - + 512 140 True True - - + + - + 6 1 - + True True True - + False 2 - + True - + True False True True - + - + True - + True gtk-add - + False False @@ -96,17 +96,17 @@ - + True Add to my list - + 1 - + - + False False @@ -114,34 +114,31 @@ 0 - + False False 3 - + - + - - + + True <b>Search somebody</b> True - - - label_item - + - + 1 - + True end @@ -150,14 +147,14 @@ - + False end 0 - + - - + + diff --git a/gtk-glade/call_logs.glade b/gtk/call_logs.ui similarity index 77% rename from gtk-glade/call_logs.glade rename to gtk/call_logs.ui index d2ac682d3..566f525f2 100644 --- a/gtk-glade/call_logs.glade +++ b/gtk/call_logs.ui @@ -1,8 +1,7 @@ - - + - - + + 500 370 5 @@ -12,55 +11,57 @@ GDK_WINDOW_TYPE_HINT_DIALOG False - + True 2 - + True True GTK_POLICY_NEVER GTK_POLICY_AUTOMATIC - + True True False GTK_WRAP_WORD - + - + 1 - + True GTK_BUTTONBOX_END - + True True True gtk-close True - 0 - + 1 - + False GTK_PACK_END - + - - + + button1 + + + diff --git a/gtk-glade/calllogs.c b/gtk/calllogs.c similarity index 100% rename from gtk-glade/calllogs.c rename to gtk/calllogs.c diff --git a/gtk-glade/chat.c b/gtk/chat.c similarity index 100% rename from gtk-glade/chat.c rename to gtk/chat.c diff --git a/gtk-glade/chatroom.glade b/gtk/chatroom.ui similarity index 68% rename from gtk-glade/chatroom.glade rename to gtk/chatroom.ui index 870ae537e..6322d09cc 100644 --- a/gtk-glade/chatroom.glade +++ b/gtk/chatroom.ui @@ -1,69 +1,67 @@ - - + - - - + + + - + True - + 200 200 True True False GTK_WRAP_WORD - + - + True - + True True True - - + + - + True True True - 0 - + - + True - + True gtk-ok - + - + True Send - + 7 1 - + - + False False 1 - + False False @@ -71,30 +69,29 @@ - + True GTK_BUTTONBOX_END - + True True True gtk-close True - 0 - - + + GTK_PACK_END - + False 2 - + - - + + diff --git a/gtk-glade/contact.glade b/gtk/contact.ui similarity index 84% rename from gtk-glade/contact.glade rename to gtk/contact.ui index d16543b53..516f427cb 100644 --- a/gtk-glade/contact.glade +++ b/gtk/contact.ui @@ -1,8 +1,8 @@ - + - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 center-on-parent @@ -10,46 +10,46 @@ dialog False - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Name - + GTK_FILL - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK SIP Address - + 1 2 @@ -57,11 +57,11 @@ - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 1 2 @@ -69,11 +69,11 @@ - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 1 2 @@ -82,14 +82,14 @@ GTK_FILL - + False 0 - + Show this contact presence status True True @@ -97,13 +97,13 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True True - + 1 - + Allow this contact to see my presence status True True @@ -111,46 +111,43 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True True - + 2 - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Contact information</b> True - - - label_item - + - + 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK end - + gtk-cancel True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + False False @@ -158,29 +155,29 @@ - + gtk-ok True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + False False 1 - + False end 0 - + - - + + diff --git a/gtk-glade/fonis.c b/gtk/fonis.c similarity index 100% rename from gtk-glade/fonis.c rename to gtk/fonis.c diff --git a/gtk-glade/friendlist.c b/gtk/friendlist.c similarity index 100% rename from gtk-glade/friendlist.c rename to gtk/friendlist.c diff --git a/gtk-glade/gtkrc b/gtk/gtkrc similarity index 100% rename from gtk-glade/gtkrc rename to gtk/gtkrc diff --git a/gtk/incall_view.c b/gtk/incall_view.c new file mode 100644 index 000000000..ffa6329d3 --- /dev/null +++ b/gtk/incall_view.c @@ -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 , (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("%s\n%s", + displayname,id); + }else + uri_label=g_markup_printf_escaped("%s\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),_("Calling...")); + 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),_("Incoming call")); + 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),_("In call with")); + + 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),_("Paused call with")); +} + +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),_("Call ended.")); + else{ + char *msg=g_markup_printf_escaped("%s",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); +} diff --git a/gtk-glade/incoming_call.glade b/gtk/incoming_call.ui similarity index 81% rename from gtk-glade/incoming_call.glade rename to gtk/incoming_call.ui index 14c89480a..00a6e0efc 100644 --- a/gtk-glade/incoming_call.glade +++ b/gtk/incoming_call.ui @@ -1,8 +1,8 @@ - + - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 popup @@ -13,84 +13,81 @@ True False - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Incoming call from - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Incoming call True - - - label_item - + - + 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK spread - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-yes - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Accept - + 1 - + - + False False @@ -98,53 +95,53 @@ - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-no - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Decline - + 1 - + - + False False 1 - + False end 0 - + - - + + diff --git a/gtk-glade/linphone.h b/gtk/linphone.h similarity index 86% rename from gtk-glade/linphone.h rename to gtk/linphone.h index 850277155..0b77f6430 100644 --- a/gtk-glade/linphone.h +++ b/gtk/linphone.h @@ -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); diff --git a/gtk-glade/linphone.ico b/gtk/linphone.ico similarity index 100% rename from gtk-glade/linphone.ico rename to gtk/linphone.ico diff --git a/gtk-glade/linphone.iss b/gtk/linphone.iss similarity index 100% rename from gtk-glade/linphone.iss rename to gtk/linphone.iss diff --git a/gtk-glade/linphone.rc b/gtk/linphone.rc similarity index 100% rename from gtk-glade/linphone.rc rename to gtk/linphone.rc diff --git a/gtk-glade/log.glade b/gtk/log.ui similarity index 77% rename from gtk-glade/log.glade rename to gtk/log.ui index fc7206433..4f5603ef1 100644 --- a/gtk-glade/log.glade +++ b/gtk/log.ui @@ -1,24 +1,24 @@ - - + + - + 540 290 5 Linphone debug window center-on-parent - linphone2.png dialog False False - + True + vertical 2 - + True True never @@ -27,48 +27,51 @@ True in - + True True False word - + - + 1 - + True end - - gtk-close + + gtk-close True True True True - + False False 1 - + False end 0 - + - - + + button1 + + + diff --git a/gtk-glade/logging.c b/gtk/logging.c similarity index 98% rename from gtk-glade/logging.c rename to gtk/logging.c index 9bdf1dc0e..4b3af6638 100644 --- a/gtk-glade/logging.c +++ b/gtk/logging.c @@ -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); } diff --git a/gtk-glade/loginframe.c b/gtk/loginframe.c similarity index 100% rename from gtk-glade/loginframe.c rename to gtk/loginframe.c diff --git a/gtk-glade/main.c b/gtk/main.c similarity index 83% rename from gtk-glade/main.c rename to gtk/main.c index ddae9ff90..6ad7c65fe 100644 --- a/gtk-glade/main.c +++ b/gtk/main.c @@ -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); diff --git a/gtk-glade/main.glade b/gtk/main.ui similarity index 68% rename from gtk-glade/main.glade rename to gtk/main.ui index 67701fb23..2f9433a3f 100644 --- a/gtk-glade/main.glade +++ b/gtk/main.ui @@ -1,364 +1,328 @@ - - + + - + + + + + + + + All users + + + Online users + + + + + + + + + + + ADSL + + + Fiber Channel + + + + + + + + + + + Default + + + + + + + + + + + ADSL + + + Fiber Channel + + + + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - linphone2.png - - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK _Linphone True - - + + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - Assistant - True + + _Assistant + True + image3 False - - - - True - gtk-preferences - 1 - - - + - + gtk-preferences True True True - + - - Call history + + _Call history True + True + image2 False - - - True - gtk-justify-fill - 1 - - - + - + gtk-disconnect True True - + - + True - + - + gtk-quit True True True - + - + - + - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _Modes + _Options True - - + + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Audio only True True - video_item - - + + - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Audio & Video + Audio & video True True True audio_only_item - - + + - + True - + - + True Enable self-view True True - + - + - + - - gtk-help + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Aid_e True - True - - + + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - Show debug messages - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - - True - gtk-info - 1 - - - - - - + gtk-about True True True - + - - Homepage + + Show debug window True + image1 + False + + + + + + _Homepage + True + True + image4 False - - - True - gtk-home - 1 - - - + - - Check for updates + + Check _Updates + True + image5 False - - - - True - gtk-info - 1 - - - + + - + - + - + False 0 - + True - + True vertical - + True - + True True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - Start call - none - - - True - - - True - gtk-apply - - - 0 - - - - - Start call - - - 1 - - - - - + False False - 10 0 - + + True + True + Initiate a new call + + + + False + False + 1 + + + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 5 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True True True - Enter username, phone number, or full sip address + Enter username, phone number, or full sip address - + 0 - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK SIP address or phone number: True - - - label_item - + - + - 1 - - - - - True - False - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - Terminate call - none - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-close - - - 0 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Terminate call - - - 1 - - - - - - - False - False - 10 2 - + + + True + True + True + + + + False + False + 3 + + + False 8 @@ -366,104 +330,109 @@ - + True True - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True vertical - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Lookup: - + 12 0 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 4 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK in - + 8 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + model1 0 - All users -Online users - + + + + 0 + + + 4 3 - + False 0 - + True True automatic automatic - + 120 True True @@ -472,23 +441,23 @@ Online users - + - + 1 - + True 0 none - + True - + True True @@ -496,60 +465,57 @@ Online users - + 0 - + True True True none - + True - + True gtk-find - + 0 - + True Search - + 1 - + - + False 1 - + - - + + True <b>Add contacts from directory</b> True - - - label_item - + - + False False @@ -557,44 +523,41 @@ Online users 2 - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Contact list</b> True - - - label_item - + - + 8 0 - + True - + Mute False True True - + False 0 - + False False @@ -602,160 +565,167 @@ Online users - + - + True Internet connection: - + 0 - + True + model2 0 - ADSL -Fiber Channel - + + + + 0 + + + 1 - + False 2 - + 8 0 - + 0 - + True - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + model3 0 - Default - + + + + 0 + + + - + 0 - + True True True - + False 1 - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK My current identity: True - - - label_item - + - + 0 - + False 1 - + - - + + True - + True gtk-missing-image - + 0 - + True Contacts - + 1 - + False - tab - + True vertical - + True 0.5 none - + True 0 0 - + True 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 4 @@ -763,7 +733,7 @@ Fiber Channel 4 True - + D 50 50 @@ -771,7 +741,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 3 4 @@ -782,7 +752,7 @@ Fiber Channel - + # 50 50 @@ -790,7 +760,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 2 3 @@ -801,7 +771,7 @@ Fiber Channel - + 0 50 50 @@ -809,7 +779,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 1 2 @@ -820,7 +790,7 @@ Fiber Channel - + * 50 50 @@ -828,7 +798,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 3 4 @@ -837,7 +807,7 @@ Fiber Channel - + C 50 50 @@ -845,7 +815,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 3 4 @@ -856,7 +826,7 @@ Fiber Channel - + 9 50 50 @@ -864,7 +834,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 2 3 @@ -875,7 +845,7 @@ Fiber Channel - + 8 50 50 @@ -883,7 +853,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 1 2 @@ -894,7 +864,7 @@ Fiber Channel - + 7 50 50 @@ -902,7 +872,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 2 3 @@ -911,7 +881,7 @@ Fiber Channel - + B 50 50 @@ -919,7 +889,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 3 4 @@ -930,7 +900,7 @@ Fiber Channel - + 6 50 50 @@ -938,7 +908,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 2 3 @@ -949,7 +919,7 @@ Fiber Channel - + 5 50 50 @@ -957,7 +927,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 1 2 @@ -968,7 +938,7 @@ Fiber Channel - + 4 50 50 @@ -976,7 +946,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 1 2 @@ -985,7 +955,7 @@ Fiber Channel - + A 50 50 @@ -993,7 +963,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 3 4 @@ -1002,7 +972,7 @@ Fiber Channel - + 3 50 50 @@ -1010,7 +980,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 2 3 @@ -1019,7 +989,7 @@ Fiber Channel - + 2 50 50 @@ -1027,7 +997,7 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 1 2 @@ -1036,7 +1006,7 @@ Fiber Channel - + 1 50 50 @@ -1044,25 +1014,22 @@ Fiber Channel True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + GTK_FILL - + - + - + - + - - label_item - - + 0 @@ -1070,274 +1037,123 @@ Fiber Channel - + 1 - - + + True - + True gtk-missing-image - + 0 - + True Keypad - + 1 - + 1 False - tab - - 0.5 - none - - - True - 12 - 12 - - - True - vertical - - - True - gtk-info - 5 - - - 0 - - - - - True - 0 - - - True - label - center - - - - - True - True - - - label_item - - - - - 1 - - - - - True - 0 - - - True - vertical - - - True - Duration - center - - - 0 - - - - - - - True - Duration: - True - - - label_item - - - - - False - 2 - - - - - True - spread - - - Mute - True - False - True - True - - - - False - False - 0 - - - - - HoldOn - True - False - True - True - - - - False - False - 1 - - - - - False - False - 3 - - - - - - - - - True - In call - True - center - - - label_item - - - - - 2 - + - - - True - Call Details - - - 2 - False - tab - + + - + 1 - + 0 - + 0 - + True 12 - + True vertical - + True 0 - + True 12 12 - + True 4 2 - + True Username - + - + True Password - + 1 2 - + True Internet connection: - + 2 3 - + True True - + 1 2 - + True True False - + 1 2 @@ -1346,13 +1162,18 @@ Fiber Channel - + True + model4 0 - ADSL -Fiber Channel - + + + + 0 + + + 1 2 @@ -1361,13 +1182,13 @@ Fiber Channel - + Automatically log me in True True False True - + 1 2 @@ -1378,85 +1199,270 @@ Fiber Channel - + - + - - + + True Login information True - - - label_item - + - + 0 - + True - + gtk-connect True True True True - + False False 0 - + 1 - + - + - - + + True <b>Welcome !</b> True - - - label_item - + - + 1 - + 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 - + False False 2 - + - - + + + True + gtk-info + + + True + gtk-refresh + + + True + gtk-properties + + + True + gtk-home + + + True + gtk-execute + + + + + 0.5 + none + + + True + 12 + 12 + + + True + vertical + + + True + gtk-info + 5 + + + 0 + + + + + True + 0 + + + True + label + center + + + + + True + True + + + + + 1 + + + + + spread + + + Answer + True + True + True + + + + False + False + 0 + + + + + Decline + True + True + True + + + + False + False + 1 + + + + + 2 + + + + + True + 0 + + + True + vertical + + + True + Duration + center + + + 0 + + + + + + + True + Duration: + True + + + + + False + 3 + + + + + True + spread + + + Mute + True + False + True + True + + + + False + False + 0 + + + + + HoldOn + True + False + True + True + + + + False + False + 1 + + + + + False + False + 4 + + + + + + + + + True + In call + True + center + + + + + + diff --git a/gtk-glade/p2pwizard.glade b/gtk/p2pwizard.ui similarity index 68% rename from gtk-glade/p2pwizard.glade rename to gtk/p2pwizard.ui index 79007a6e9..e8e6703ee 100644 --- a/gtk-glade/p2pwizard.glade +++ b/gtk/p2pwizard.ui @@ -1,13 +1,12 @@ - - + - - + + Creating a FONICS account - - + + - + True 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. GTK_JUSTIFY_CENTER True True - + GTK_ASSISTANT_PAGE_INTRO Introduction - + True - + True Please choose a username: - + - + True 0 - + True 12 - + True - + True - + True True - + - + True True True - 0 - + - + True - + True gtk-apply - + - + True Check availability - + 1 - + - + False 1 - + False - + True - + 1 - + - + - - + + True True - - - label_item - + - + 1 - + Create your account ! - + True Done ! Your account is now created and ready to use. - + GTK_ASSISTANT_PAGE_CONFIRM Finished ! - - + + diff --git a/gtk-glade/parameters.glade b/gtk/parameters.ui similarity index 75% rename from gtk-glade/parameters.glade rename to gtk/parameters.ui index 3f3671330..9d7f79e38 100644 --- a/gtk-glade/parameters.glade +++ b/gtk/parameters.ui @@ -1,144 +1,262 @@ - + + + 3001 + 500 + 10 + 1 + 10 + 500 + + + 65535 + 1 + 10 + 1 + 10 + 1 + + + 65535 + 1 + 10 + 1 + 10 + 1 + + + 65535 + 1 + 10 + 1 + 10 + 1 + + + 100000 + -1 + 10 + 1 + 10 + 0 + + + 100000 + -1 + 10 + 1 + 10 + 0 + + + + + + + + default soundcard + + + + + + + + + + default soundcard + + + + + + + + + + a sound card + + + + + + + + + + default camera + + + + + + + + + + CIF + + + + + + + + + + Audio codecs + + + Video codecs + + + + + + + + + + C + + + - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Settings linphone2.png - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True vertical - + True - + Set Maximum Transmission Unit: True True False True - - + + 0 - + True True - 500 500 3001 1 10 10 - - + adjustment1 + + 1 - + 0 - + Send DTMFs as SIP info True True False True - - + + 1 - + Use IPv6 instead of IPv4 True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + 2 - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Transport</b> True - - - label_item - + - + False 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 3 2 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 1 65535 1 10 10 - - + adjustment2 + + 1 2 @@ -147,13 +265,13 @@ - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 1 65535 1 10 10 - - + adjustment3 + + 1 2 @@ -162,90 +280,87 @@ - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 1 65535 1 10 10 - - + adjustment4 + + 1 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Video RTP/UDP: right - + 2 3 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Audio RTP/UDP: right - + 1 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK SIP (UDP): right - + - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Ports</b> True - - - label_item - + - + False 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True vertical - + Direct connection to the Internet True True False True True - - + + False False @@ -253,11 +368,11 @@ - + True vertical - + Behind NAT / Firewall (specify gateway IP below) True True @@ -265,44 +380,44 @@ True True no_nat - - + + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Public IP address: right - + 0 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - + + 1 - + 1 - + False False @@ -310,11 +425,11 @@ - + True vertical - + Behind NAT / Firewall (use STUN to resolve) True True @@ -322,151 +437,147 @@ True True no_nat - - + + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Stun server: right - + 0 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - + + 1 - + 1 - + False False 2 - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>NAT and Firewall</b> True - - - label_item - + - + False 2 - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-network - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Network settings - + 1 - + False - tab - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 6 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - + + 0 - + gtk-media-play True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + 1 - + 1 2 @@ -476,12 +587,12 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Ring sound: right - + 4 5 @@ -489,11 +600,11 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - + + 1 2 @@ -503,13 +614,18 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - default soundcard - - - + + model1 + + + + 0 + + + 1 2 @@ -519,12 +635,18 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - default soundcard - - + + model2 + + + + 0 + + + 1 2 @@ -534,11 +656,11 @@ - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK ALSA special device (optional): right - + 3 4 @@ -546,12 +668,12 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Capture device: right - + 2 3 @@ -559,12 +681,12 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Ring device: right - + 1 2 @@ -572,25 +694,30 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Playback device: right - + GTK_FILL GTK_FILL - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - a sound card - - - + + model3 + + + + 0 + + + 1 2 @@ -599,14 +726,14 @@ - + Enable echo cancellation True True False True - - + + 1 2 @@ -617,55 +744,58 @@ - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Audio</b> True - - - label_item - + - + 0 - + True 0 - + True 12 - + True 2 2 - + True Video input device: right - + GTK_EXPAND - + True - default camera - - + + model4 + + + + 0 + + + 1 2 @@ -673,22 +803,28 @@ - + True Prefered video resolution: - + 1 2 - + True 0 - CIF - - + + model5 + + + + 0 + + + 1 2 @@ -696,132 +832,125 @@ 2 - + - + - - + + True <b>Video</b> True - - - label_item - + - + False 1 - - - 1 - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-media-play - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Multimedia settings - + 1 - + 1 False - tab - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - This section defines your SIP address when not using a SIP account + This section defines your SIP address when not using a SIP account 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 3 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Your display name (eg: John Doe): - + - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - + + 1 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Your username: - + 1 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Your resulting SIP address: - + 2 3 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - + + 1 2 @@ -830,12 +959,12 @@ - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False - + 1 2 @@ -843,98 +972,95 @@ 3 - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Default identity</b> True - - - label_item - + - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK automatic automatic - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-add - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Add - + 1 - + - + False False @@ -942,39 +1068,39 @@ - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-edit - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Edit - + 1 - + - + False False @@ -982,39 +1108,39 @@ - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-delete - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Remove - + 1 - + - + False False @@ -1022,218 +1148,213 @@ - + True True - + - + True - + True gtk-network - + 0 - + True Register to FONICS virtual network ! - + 1 - + - + False False 3 - + False False 1 - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Proxy accounts</b> True - - - label_item - + - + 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-delete - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Erase all passwords - + 1 - + - + False False 0 - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Privacy</b> True - - - label_item - + - + 2 - - - 2 - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK stock_people.png - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Manage SIP Accounts - + 1 - + 2 False - tab - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - Audio codecs -Video codecs - - + + model6 + + + + 0 + + + False 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -1241,33 +1362,33 @@ Video codecs automatic out - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - + - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + gtk-go-up True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + False False @@ -1275,15 +1396,15 @@ Video codecs - + gtk-go-down True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + False False @@ -1291,39 +1412,39 @@ Video codecs - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-yes - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Enable - + 1 - + - + False False @@ -1331,101 +1452,98 @@ Video codecs - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-no - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Disable - + 1 - + - + False False 3 - + False 1 - + 1 - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Codecs</b> True - - - label_item - + - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 2 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 stands for "unlimited" - 0 -1 100000 1 10 10 - - + 0 stands for "unlimited" + adjustment5 + + 1 2 @@ -1434,243 +1552,232 @@ Video codecs - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 stands for "unlimited" - 0 -1 100000 1 10 10 - - + 0 stands for "unlimited" + adjustment6 + + 1 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Upload speed limit in Kbit/sec: right - + 1 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Download speed limit in Kbit/sec: right - + - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK <b>Bandwidth control</b> True - - - label_item - + - + 1 - - - 3 - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK gtk-execute - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Codecs - + 1 - + 3 False - tab - + True vertical - + True 0 - + True 12 - + True - C - - + + model7 + + + + 0 + + + - + - - + + True <b>Language</b> True - - - label_item - + - + False 0 - + True 0 - + True 12 - + Show advanced settings True True False True - - + + - + - - + + True <b>Level</b> True - - - label_item - + - + False 1 - - - 4 - + - - + + True - + True gtk-properties 3 - + 0 - + True User interface - + 1 - + 4 False - tab - + 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK end - + True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + - + True - + True gtk-apply - + 0 - + True Done - + 1 - + - + False False @@ -1678,13 +1785,13 @@ Video codecs 0 - + 5 1 - + - - + + diff --git a/gtk-glade/password.glade b/gtk/password.ui similarity index 83% rename from gtk-glade/password.glade rename to gtk/password.ui index 6617f4831..59ac15212 100644 --- a/gtk-glade/password.glade +++ b/gtk/password.ui @@ -1,8 +1,8 @@ - + - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 Linphone - Authentication required @@ -12,68 +12,68 @@ dialog False - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Please enter the domain password center True - + 0 - + True 2 2 - + True UserID - + - + True True - + 1 2 - + True Password: right - + 1 2 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK False - - + + 1 2 @@ -81,31 +81,31 @@ 2 - + 1 - + 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK end - + gtk-ok True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + False False @@ -113,29 +113,29 @@ - + gtk-cancel True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + False False 1 - + False end 0 - + - - + + diff --git a/gtk-glade/propertybox.c b/gtk/propertybox.c similarity index 99% rename from gtk-glade/propertybox.c rename to gtk/propertybox.c index be4073fb9..179a134b7 100644 --- a/gtk-glade/propertybox.c +++ b/gtk/propertybox.c @@ -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); diff --git a/gtk-glade/setupwizard.c b/gtk/setupwizard.c similarity index 100% rename from gtk-glade/setupwizard.c rename to gtk/setupwizard.c diff --git a/gtk-glade/sip_account.glade b/gtk/sip_account.ui similarity index 81% rename from gtk-glade/sip_account.glade rename to gtk/sip_account.ui index bb8862619..0c49aafdb 100644 --- a/gtk-glade/sip_account.glade +++ b/gtk/sip_account.ui @@ -1,8 +1,16 @@ - + + + 100000 + 0 + 10 + 1 + 10 + 3600 + - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 Linphone - Configure a SIP account @@ -11,74 +19,74 @@ dialog False - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK vertical - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 4 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Your SIP identity: right - + - + 275 True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Looks like sip:<username>@<domain> + Looks like sip:<username>@<domain> sip: - + 1 2 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK SIP Proxy address: right - + 1 2 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Looks like sip:<proxy hostname> + Looks like sip:<proxy hostname> sip: - + 1 2 @@ -87,23 +95,23 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Route (optional): right - + 2 3 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 1 2 @@ -112,24 +120,24 @@ - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Registration duration (sec): right - + 3 4 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3600 0 100000 1 10 10 - + adjustment1 + 1 2 @@ -137,73 +145,70 @@ 4 - + 0 - + Register at startup True True False True True - + 1 - + Publish presence information True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - + False 2 - + - + - - + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Configure a SIP account True - - - label_item - + - + 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK end - + gtk-ok True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + False False @@ -211,29 +216,29 @@ - + gtk-cancel True True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True - - + + False False 1 - + False end 0 - + - - + + diff --git a/gtk-glade/stock_people.png b/gtk/stock_people.png similarity index 100% rename from gtk-glade/stock_people.png rename to gtk/stock_people.png diff --git a/gtk-glade/support.c b/gtk/support.c similarity index 98% rename from gtk-glade/support.c rename to gtk/support.c index 3e3320c4f..2124d2ee8 100644 --- a/gtk-glade/support.c +++ b/gtk/support.c @@ -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; } } diff --git a/gtk-glade/update.c b/gtk/update.c similarity index 100% rename from gtk-glade/update.c rename to gtk/update.c diff --git a/gtk-glade/utils.c b/gtk/utils.c similarity index 100% rename from gtk-glade/utils.c rename to gtk/utils.c diff --git a/gtk-glade/waiting.glade b/gtk/waiting.ui similarity index 69% rename from gtk-glade/waiting.glade rename to gtk/waiting.ui index 294f44eff..4413dfab0 100644 --- a/gtk-glade/waiting.glade +++ b/gtk/waiting.ui @@ -1,8 +1,7 @@ - - + - - + + Linphone False True @@ -10,52 +9,49 @@ linphone2.png False - + True 0 - + True 12 - + True 5 - + True gtk-dialog-info - + False False - + True - + 5 1 - + - + - - + + True Please wait True GTK_JUSTIFY_CENTER - - - label_item - + - + - - + + diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index f32d5cd55..d6c7799d9 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -240,5 +240,9 @@ public interface LinphoneCore { public boolean isEchoCancellationEnabled(); public void setSignalingTransport(Transport aTransport); + + public void enableSpeaker(boolean value); + + public boolean isSpeakerEnabled(); } diff --git a/mediastreamer2 b/mediastreamer2 index ea7ca97aa..46b69fe88 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit ea7ca97aaaa6f191dfec112f137fb048a4ef2139 +Subproject commit 46b69fe88700905a362eeb0a57e8218585b76565 diff --git a/oRTP b/oRTP index 534074027..6bc540160 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 534074027a2163694ce6f8a520f0d6f6ac82b15d +Subproject commit 6bc540160a8729f63f6074b958161bc696e78f93 diff --git a/pixmaps/addcall-green.png b/pixmaps/addcall-green.png new file mode 100644 index 000000000..3e6ae3b7a Binary files /dev/null and b/pixmaps/addcall-green.png differ diff --git a/po/POTFILES.in b/po/POTFILES.in index 3fcfbdd20..1e699aa8a 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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