Remove deprecated GTK user interface code.
|
|
@ -46,7 +46,6 @@ option(ENABLE_DAEMON "Enable the linphone daemon interface." YES)
|
|||
option(ENABLE_DATE "Use build date in internal version number." NO)
|
||||
option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO)
|
||||
option(ENABLE_DOC "Enable documentation generation with Doxygen." YES)
|
||||
option(ENABLE_GTK_UI "Turn on or off compilation of gtk interface." NO)
|
||||
option(ENABLE_JAVADOC "Add a target to generate documentation for Java API" NO)
|
||||
option(ENABLE_LDAP "Enable LDAP support." NO)
|
||||
option(ENABLE_NLS "Build with internationalisation support" YES)
|
||||
|
|
@ -160,25 +159,6 @@ if(ENABLE_NOTIFY)
|
|||
set(ENABLE_NOTIFY OFF CACHE BOOL "Enable libnotify support." FORCE)
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_GTK_UI)
|
||||
if(WIN32)
|
||||
set(GTK2_ADDITIONAL_SUFFIXES "../lib/glib-2.0/include" "../lib/gtk-2.0/include")
|
||||
endif()
|
||||
find_package(GTK2 2.18 REQUIRED gtk)
|
||||
if(ENABLE_ASSISTANT AND GTK2_VERSION VERSION_LESS 2.22)
|
||||
message(WARNING "You need at least GTK 2.22 to enable the assistant")
|
||||
set(ENABLE_ASSISTANT OFF CACHE BOOL "Turn on assistant compiling." FORCE)
|
||||
endif()
|
||||
if(APPLE)
|
||||
find_package(GtkMacIntegration)
|
||||
if(GTKMACINTEGRATION_FOUND)
|
||||
set(HAVE_GTK_OSX 1)
|
||||
add_definitions("${GTKMACINTEGRATION_CPPFLAGS}")
|
||||
else()
|
||||
message(WARNING "gtk-mac-integration not found. Please install gtk-osx-application package.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_ASSISTANT)
|
||||
set(BUILD_WIZARD 1)
|
||||
endif()
|
||||
|
|
@ -368,11 +348,6 @@ endif()
|
|||
if(ENABLE_DAEMON)
|
||||
add_subdirectory(daemon)
|
||||
endif()
|
||||
if(ENABLE_GTK_UI)
|
||||
add_subdirectory(gtk)
|
||||
add_subdirectory(pixmaps)
|
||||
add_subdirectory(po)
|
||||
endif()
|
||||
if(ENABLE_TOOLS)
|
||||
add_subdirectory(tools)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
############################################################################
|
||||
# FindGtkMacIntegration.txt
|
||||
# Copyright (C) 2015 Belledonne Communications, Grenoble France
|
||||
#
|
||||
############################################################################
|
||||
#
|
||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
############################################################################
|
||||
#
|
||||
# - Find the libgtkmacintegration include file and library
|
||||
#
|
||||
# GTKMACINTEGRATION_FOUND - system has libgtkmacintegration
|
||||
# GTKMACINTEGRATION_INCLUDE_DIRS - the libgtkmacintegration include directory
|
||||
# GTKMACINTEGRATION_LIBRARIES - The libraries needed to use libgtkmacintegration
|
||||
# GTKMACINTEGRATION_CPPFLAGS - The cflags needed to use libgtkmacintegration
|
||||
|
||||
set(_GTKMACINTEGRATION_ROOT_PATHS
|
||||
${CMAKE_INSTALL_PREFIX}
|
||||
)
|
||||
|
||||
find_path(GTKMACINTEGRATION_INCLUDE_DIRS
|
||||
NAMES gtkosxapplication.h
|
||||
HINTS _GTKMACINTEGRATION_ROOT_PATHS
|
||||
PATH_SUFFIXES include/gtkmacintegration-gtk2 include/gtkmacintegration
|
||||
)
|
||||
|
||||
find_library(GTKMACINTEGRATION_LIBRARIES
|
||||
NAMES gtkmacintegration-gtk2 gtkmacintegration
|
||||
HINTS ${_GTKMACINTEGRATION_ROOT_PATHS}
|
||||
PATH_SUFFIXES bin lib
|
||||
)
|
||||
|
||||
set(GTKMACINTEGRATION_CPPFLAGS "-DMAC_INTEGRATION")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GTKMACINTEGRATION
|
||||
DEFAULT_MSG
|
||||
GTKMACINTEGRATION_INCLUDE_DIRS GTKMACINTEGRATION_LIBRARIES GTKMACINTEGRATION_CPPFLAGS
|
||||
)
|
||||
|
||||
mark_as_advanced(GTKMACINTEGRATION_INCLUDE_DIRS GTKMACINTEGRATION_LIBRARIES GTKMACINTEGRATION_CPPFLAGS)
|
||||
5
gtk/.gitignore
vendored
|
|
@ -1,5 +0,0 @@
|
|||
linphone
|
||||
.libs
|
||||
.deps
|
||||
linphone.res
|
||||
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
############################################################################
|
||||
# CMakeLists.txt
|
||||
# Copyright (C) 2014 Belledonne Communications, Grenoble France
|
||||
#
|
||||
############################################################################
|
||||
#
|
||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
set(UI_FILES
|
||||
about.ui
|
||||
audio_assistant.ui
|
||||
buddylookup.ui
|
||||
callee_frame.ui
|
||||
call_logs.ui
|
||||
call_statistics.ui
|
||||
chatroom_frame.ui
|
||||
conf_frame.ui
|
||||
config-uri.ui
|
||||
contact.ui
|
||||
dscp_settings.ui
|
||||
in_call_frame.ui
|
||||
keypad.ui
|
||||
ldap.ui
|
||||
login_frame.ui
|
||||
log.ui
|
||||
main.ui
|
||||
parameters.ui
|
||||
password.ui
|
||||
provisioning-fetch.ui
|
||||
setup_wizard.ui
|
||||
sip_account.ui
|
||||
tunnel_config.ui
|
||||
waiting.ui
|
||||
)
|
||||
|
||||
set(PIXMAPS stock_people.png)
|
||||
set(LICENSE ../COPYING)
|
||||
|
||||
set(SOURCE_FILES
|
||||
audio_assistant.c
|
||||
buddylookup.c
|
||||
calllogs.c
|
||||
chat.c
|
||||
conference.c
|
||||
config-fetching.c
|
||||
friendlist.c
|
||||
incall_view.c
|
||||
logging.c
|
||||
loginframe.c
|
||||
main.c
|
||||
propertybox.c
|
||||
singleinstance.c
|
||||
status_icon.c
|
||||
status_notifier.c
|
||||
support.c
|
||||
update.c
|
||||
utils.c
|
||||
videowindow.c
|
||||
)
|
||||
|
||||
if(ENABLE_ASSISTANT)
|
||||
list(APPEND SOURCE_FILES setupwizard.c)
|
||||
endif()
|
||||
if(WIN32)
|
||||
list(APPEND SOURCE_FILES linphone.rc)
|
||||
endif()
|
||||
|
||||
set(OBJC_FILES)
|
||||
if (APPLE)
|
||||
list(APPEND OBJC_FILES mac.m)
|
||||
endif()
|
||||
|
||||
bc_apply_compile_flags(OBJC_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
|
||||
bc_apply_compile_flags(SOURCE_FILES STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
|
||||
|
||||
if(WIN32)
|
||||
add_executable(linphone-gtk WIN32 ${SOURCE_FILES})
|
||||
else()
|
||||
add_executable(linphone-gtk ${SOURCE_FILES} ${OBJC_FILES})
|
||||
endif()
|
||||
set_target_properties(linphone-gtk PROPERTIES OUTPUT_NAME linphone LINKER_LANGUAGE CXX)
|
||||
target_include_directories(linphone-gtk PUBLIC ${GTK2_INCLUDE_DIRS} ${INTL_INCLUDE_DIRS})
|
||||
target_link_libraries(linphone-gtk ${LINPHONE_LIBS_FOR_TOOLS} ${GTK2_LIBRARIES} ${BCTOOLBOX_CORE_LIBRARIES} ${ORTP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES})
|
||||
set_target_properties(linphone-gtk PROPERTIES LINK_FLAGS "${LINPHONE_LDFLAGS}")
|
||||
if(INTL_FOUND)
|
||||
target_link_libraries(linphone-gtk ${INTL_LIBRARIES})
|
||||
endif()
|
||||
if(WIN32)
|
||||
target_link_libraries(linphone-gtk Wininet)
|
||||
endif()
|
||||
if(ENABLE_NOTIFY)
|
||||
target_include_directories(linphone-gtk PUBLIC ${NOTIFY_INCLUDE_DIRS})
|
||||
target_link_libraries(linphone-gtk ${NOTIFY_LIBRARIES})
|
||||
endif()
|
||||
if(HAVE_LIBUDEV_H)
|
||||
target_link_libraries(linphone-gtk udev)
|
||||
endif()
|
||||
if(GTKMACINTEGRATION_FOUND)
|
||||
target_include_directories(linphone-gtk PUBLIC ${GTKMACINTEGRATION_INCLUDE_DIRS})
|
||||
target_link_libraries(linphone-gtk ${GTKMACINTEGRATION_LIBRARIES})
|
||||
endif()
|
||||
if(APPLE)
|
||||
target_link_libraries(linphone-gtk "-framework Cocoa")
|
||||
endif()
|
||||
|
||||
set_target_properties(linphone-gtk PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
|
||||
|
||||
install(TARGETS linphone-gtk
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
install(FILES ${UI_FILES} ${PIXMAPS} ${LICENSE}
|
||||
DESTINATION ${PACKAGE_DATA_DIR}/linphone
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
118
gtk/Makefile.am
|
|
@ -1,118 +0,0 @@
|
|||
UI_FILES= about.ui \
|
||||
main.ui \
|
||||
password.ui \
|
||||
contact.ui \
|
||||
parameters.ui \
|
||||
sip_account.ui \
|
||||
call_logs.ui \
|
||||
keypad.ui \
|
||||
log.ui \
|
||||
buddylookup.ui \
|
||||
tunnel_config.ui \
|
||||
waiting.ui \
|
||||
dscp_settings.ui \
|
||||
call_statistics.ui \
|
||||
ldap.ui \
|
||||
config-uri.ui \
|
||||
provisioning-fetch.ui \
|
||||
audio_assistant.ui \
|
||||
chatroom_frame.ui \
|
||||
in_call_frame.ui \
|
||||
conf_frame.ui \
|
||||
callee_frame.ui \
|
||||
login_frame.ui \
|
||||
setup_wizard.ui
|
||||
|
||||
PIXMAPS= \
|
||||
stock_people.png
|
||||
|
||||
LINPHONE_ICO_RC_FILE=linphone.rc
|
||||
LINPHONE_ICO_FILE=linphone.ico
|
||||
|
||||
EXTRA_DIST= \
|
||||
linphone.iss \
|
||||
$(LINPHONE_ICO_RC_FILE) \
|
||||
$(LINPHONE_ICO_FILE)
|
||||
gtkrc \
|
||||
gtkrc.mac
|
||||
|
||||
if BUILD_GTK_UI
|
||||
|
||||
BUILT_SOURCES=version_date.h
|
||||
|
||||
bin_PROGRAMS=linphone
|
||||
|
||||
linphone_SOURCES= \
|
||||
main.c \
|
||||
propertybox.c \
|
||||
friendlist.c \
|
||||
support.c \
|
||||
chat.c \
|
||||
calllogs.c \
|
||||
logging.c \
|
||||
update.c \
|
||||
buddylookup.c \
|
||||
utils.c \
|
||||
incall_view.c \
|
||||
loginframe.c \
|
||||
singleinstance.c \
|
||||
conference.c \
|
||||
config-fetching.c \
|
||||
audio_assistant.c \
|
||||
videowindow.c \
|
||||
status_icon.c status_icon.h \
|
||||
linphone.h regex.h
|
||||
|
||||
if BUILD_WIZARD
|
||||
linphone_SOURCES+= \
|
||||
setupwizard.c setupwizard.h
|
||||
endif
|
||||
|
||||
if BUILD_STATUS_NOTIFIER
|
||||
linphone_SOURCES+= \
|
||||
status_notifier.c \
|
||||
status_notifier.h
|
||||
endif
|
||||
|
||||
|
||||
linphone_LDADD= $(top_builddir)/coreapi/liblinphone.la \
|
||||
$(LIBGTK_LIBS) $(NOTIFY1_LIBS) $(NOTIFY4_LIBS) $(LIBGTKMAC_LIBS) $(INTLLIBS) $(SQLITE3_LIBS) $(BELLESIP_LIBS) $(BCTOOLBOX_LIBS)
|
||||
|
||||
|
||||
if BUILD_WIN32
|
||||
|
||||
linphone.res: $(LINPHONE_ICO_RC_FILE) $(LINPHONE_ICO_FILE)
|
||||
$(WINDRES) $(srcdir)/$(LINPHONE_ICO_RC_FILE) -O coff -o linphone.res
|
||||
|
||||
linphone_LDADD+=linphone.res -lwininet
|
||||
linphone_LDFLAGS=-Wl,--export-all-symbols -mwindows
|
||||
else
|
||||
linphone_LDFLAGS=-export-dynamic
|
||||
endif
|
||||
|
||||
uidir=$(datadir)/linphone
|
||||
dist_ui_DATA=$(UI_FILES) $(PIXMAPS) $(top_srcdir)/COPYING
|
||||
|
||||
if BUILD_MACOS
|
||||
linphone_SOURCES+=mac.m
|
||||
linphone_LDFLAGS+=-framework Cocoa
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
AM_CPPFLAGS= -I$(top_srcdir)/include/ -I$(top_builddir)/coreapi/ -I$(top_srcdir)/coreapi/ \
|
||||
$(MEDIASTREAMER_CFLAGS) \
|
||||
$(ORTP_CFLAGS) $(BELLESIP_CFLAGS) \
|
||||
$(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) $(LIBGTK_CFLAGS) $(LIBGTKMAC_CFLAGS) $(IPV6_CFLAGS) \
|
||||
$(TUNNEL_CFLAGS) \
|
||||
$(SQLITE3_CFLAGS) \
|
||||
$(BCTOOLBOX_CFLAGS)
|
||||
|
||||
version_date.h: $(top_srcdir)/configure.ac
|
||||
echo "#define LINPHONE_VERSION_DATE \"$(VERSION)-`date +%y%m%d`\"" > $@
|
||||
|
||||
newdate:
|
||||
rm -f version_date.h
|
||||
|
||||
CLEANFILES=version_date.h linphone.res
|
||||
|
||||
61
gtk/about.ui
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 2.12 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<object class="GtkAboutDialog" id="about">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">About Linphone</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<property name="program_name">Linphone</property>
|
||||
<property name="version">undef</property>
|
||||
<property name="copyright" translatable="yes">(C) Belledonne Communications, 2010
|
||||
</property>
|
||||
<property name="comments" translatable="yes">An internet video phone using the standard SIP (rfc3261) protocol.</property>
|
||||
<property name="website">http://www.linphone.org</property>
|
||||
<property name="license">GPL</property>
|
||||
<property name="authors">Simon Morlat</property>
|
||||
<property name="documenters"></property>
|
||||
<property name="translator_credits" translatable="yes">fr: Simon Morlat
|
||||
en: Simon Morlat and Delphine Perreau
|
||||
it: Alberto Zanoni <alberto.zanoni@-NO-SPAM-PLEASE!-tiscalinet.it>
|
||||
de: Jean-Jacques Sarton <jj.sarton@-NO-SPAM-PLEASE-t-online.de>
|
||||
sv: Daniel Nylander <po@danielnylander.se>
|
||||
es: Jesus Benitez <gnelson at inMail dot sk>
|
||||
ja: YAMAGUCHI YOSHIYA <yushiya@anet.ne.jp>
|
||||
pt_BR: Rafael Caesar Lenzi <rc_lenzi@yahoo.com.br>
|
||||
pl: Robert Nasiadek <darkone@darkone.pl>
|
||||
cs: Petr Pisar <petr.pisar@atlas.cz>
|
||||
hu: anonymous
|
||||
he: Eli Zaretskii <eliz@gnu.org>
|
||||
</property>
|
||||
<property name="artists">Icons by kerosine.fr</property>
|
||||
<signal name="response" handler="linphone_gtk_about_response"/>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox8">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area7">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,551 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <glib/gstdio.h>
|
||||
|
||||
#include "linphone.h"
|
||||
#include "linphone/core_utils.h"
|
||||
#include "mediastreamer2/mediastream.h"
|
||||
#include "mediastreamer2/msvolume.h"
|
||||
|
||||
static GtkWidget *audio_assistant=NULL;
|
||||
static void prepare(GtkAssistant *w);
|
||||
|
||||
GtkWidget *get_widget_from_assistant(const char *name){
|
||||
return (GtkWidget *)g_object_get_data(G_OBJECT(audio_assistant),name);
|
||||
}
|
||||
|
||||
static void set_widget_to_assistant(const char *name,GtkWidget *w){
|
||||
g_object_set_data(G_OBJECT(audio_assistant),name,w);
|
||||
}
|
||||
|
||||
static void update_record_button(gboolean is_visible){
|
||||
GtkWidget *rec_button = get_widget_from_assistant("rec_button");
|
||||
gtk_widget_set_sensitive(rec_button,is_visible);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void activate_record_button(gboolean is_active){
|
||||
GtkWidget *rec_button = get_widget_from_assistant("rec_button");
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rec_button),is_active);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void update_play_button(gboolean is_visible){
|
||||
GtkWidget *play_button = get_widget_from_assistant("play_button");
|
||||
gtk_widget_set_sensitive(play_button,is_visible);
|
||||
}
|
||||
|
||||
static void activate_play_button(gboolean is_active){
|
||||
GtkWidget *play_button = get_widget_from_assistant("play_button");
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(play_button),is_active);
|
||||
}
|
||||
|
||||
static gboolean deactivate_play_button(void){
|
||||
activate_play_button(FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gchar *get_record_file(void){
|
||||
char filename[256]={0};
|
||||
char date[64]={0};
|
||||
time_t curtime=time(NULL);
|
||||
struct tm loctime;
|
||||
|
||||
#ifdef _WIN32
|
||||
loctime=*localtime(&curtime);
|
||||
#else
|
||||
localtime_r(&curtime,&loctime);
|
||||
#endif
|
||||
snprintf(date,sizeof(date)-1,"%i%02i%02i-%02i%02i%2i",loctime.tm_year+1900,loctime.tm_mon+1,loctime.tm_mday, loctime.tm_hour, loctime.tm_min, loctime.tm_sec);
|
||||
|
||||
snprintf(filename,sizeof(filename)-1,"record-%s.wav",date);
|
||||
return g_build_path(G_DIR_SEPARATOR_S,g_get_tmp_dir(),filename,NULL);;
|
||||
}
|
||||
|
||||
static float audio_stream_get_record_volume(AudioStream *st){
|
||||
if (st && st->volsend){
|
||||
float vol=0;
|
||||
ms_filter_call_method(st->volsend,MS_VOLUME_GET,&vol);
|
||||
return vol;
|
||||
}
|
||||
return LINPHONE_VOLUME_DB_LOWEST;
|
||||
}
|
||||
|
||||
static float audio_stream_get_max_volume(AudioStream *st){
|
||||
if (st && st->volsend){
|
||||
float vol=0;
|
||||
ms_filter_call_method(st->volsend,MS_VOLUME_GET_MAX,&vol);
|
||||
return vol;
|
||||
}
|
||||
return LINPHONE_VOLUME_DB_LOWEST;
|
||||
}
|
||||
|
||||
static gboolean update_audio_label(volume_ctx_t *ctx){
|
||||
float volume_db=ctx->get_volume(ctx->data);
|
||||
gchar *result;
|
||||
if (volume_db < -20) result = _("No voice detected");
|
||||
else if (volume_db <= -10) result = _("Too low");
|
||||
else if (volume_db < -6) result = _("Good");
|
||||
else result = _("Too loud");
|
||||
g_message("volume_max_db=%f, text=%s",volume_db,result);
|
||||
gtk_label_set_text(GTK_LABEL(ctx->widget),result);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void on_audio_label_destroy(guint task_id){
|
||||
g_source_remove(task_id);
|
||||
}
|
||||
|
||||
void linphone_gtk_init_audio_label(GtkWidget *w, get_volume_t get_volume, void *data){
|
||||
guint task_id=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"task_id_t"));
|
||||
if (task_id==0){
|
||||
volume_ctx_t *ctx=g_new(volume_ctx_t,1);
|
||||
ctx->widget=w;
|
||||
ctx->get_volume=get_volume;
|
||||
ctx->data=data;
|
||||
ctx->last_value=0;
|
||||
g_object_set_data_full(G_OBJECT(w),"ctx_t",ctx,g_free);
|
||||
task_id=g_timeout_add(200,(GSourceFunc)update_audio_label,ctx);
|
||||
g_object_set_data_full(G_OBJECT(w),"task_id_t",GINT_TO_POINTER(task_id),(GDestroyNotify)on_audio_label_destroy);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_uninit_audio_label(GtkWidget *w){
|
||||
guint task_id=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"task_id_t"));
|
||||
if (task_id!=0){
|
||||
g_object_set_data(G_OBJECT(w),"ctx_t",NULL);
|
||||
g_object_set_data(G_OBJECT(w),"task_id_t",NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void playback_device_changed(GtkWidget *w){
|
||||
gchar *sel=gtk_combo_box_get_active_text(GTK_COMBO_BOX(w));
|
||||
linphone_core_set_playback_device(linphone_gtk_get_core(),sel);
|
||||
g_free(sel);
|
||||
}
|
||||
|
||||
static void capture_device_changed(GtkWidget *capture_device){
|
||||
gchar *sel;
|
||||
GtkWidget *mic_audiolevel;
|
||||
GtkWidget *label_audiolevel;
|
||||
GtkWidget *assistant=gtk_widget_get_toplevel(capture_device);
|
||||
AudioStream *audio_stream;
|
||||
|
||||
mic_audiolevel = get_widget_from_assistant("mic_audiolevel");
|
||||
label_audiolevel = get_widget_from_assistant("label_audiolevel");
|
||||
audio_stream = (AudioStream *) g_object_get_data(G_OBJECT(assistant),"stream");
|
||||
sel = gtk_combo_box_get_active_text(GTK_COMBO_BOX(capture_device));
|
||||
linphone_core_set_capture_device(linphone_gtk_get_core(),sel);
|
||||
linphone_gtk_uninit_audio_meter(mic_audiolevel);
|
||||
linphone_gtk_uninit_audio_label(label_audiolevel);
|
||||
audio_stream_stop(audio_stream);
|
||||
g_free(sel);
|
||||
/*now restart the audio stream*/
|
||||
prepare(GTK_ASSISTANT(assistant));
|
||||
}
|
||||
|
||||
static void dialog_click(GtkWidget *dialog, guint response_id, GtkWidget *page){
|
||||
switch(response_id){
|
||||
case GTK_RESPONSE_YES:
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(audio_assistant),page,TRUE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
|
||||
static void calibration_finished(LinphoneCore *lc, LinphoneEcCalibratorStatus status, int delay, void *data){
|
||||
GtkWidget * dialog;
|
||||
GtkWidget *speaker_page;
|
||||
ms_message("echo calibration finished %s.",status==LinphoneEcCalibratorDone ? "successfully" : "with faillure");
|
||||
if (status==LinphoneEcCalibratorDone) ms_message("Measured delay is %i",delay);
|
||||
|
||||
speaker_page = get_widget_from_assistant("speaker_page");
|
||||
|
||||
dialog = gtk_message_dialog_new (
|
||||
GTK_WINDOW(audio_assistant),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_YES_NO,
|
||||
"%s",_("Did you hear three beeps ?"));
|
||||
|
||||
g_signal_connect(G_OBJECT (dialog), "response",
|
||||
G_CALLBACK (dialog_click),speaker_page);
|
||||
gtk_widget_show(dialog);
|
||||
}
|
||||
|
||||
void linphone_gtk_start_sound(GtkWidget *w){
|
||||
LinphoneCore *lc = linphone_gtk_get_core();
|
||||
linphone_core_start_echo_calibration(lc,calibration_finished,NULL,NULL,NULL);
|
||||
}
|
||||
|
||||
static gboolean linphone_gtk_stop_record(gpointer data){
|
||||
AudioStream *stream = (AudioStream *)g_object_get_data(G_OBJECT(audio_assistant),"record_stream");
|
||||
if(stream != NULL){
|
||||
audio_stream_stop(stream);
|
||||
g_object_set_data(G_OBJECT(audio_assistant),"record_stream",NULL);
|
||||
}
|
||||
update_record_button(FALSE);
|
||||
update_play_button(TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
void linphone_gtk_start_record_sound(GtkWidget *w, gpointer data){
|
||||
LinphoneCore *lc = linphone_gtk_get_core();
|
||||
MSFactory *factory = linphone_core_get_ms_factory(lc);
|
||||
AudioStream *stream = NULL;
|
||||
MSSndCardManager *manager = ms_factory_get_snd_card_manager(factory);
|
||||
gboolean active=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
|
||||
gint timeout_id;
|
||||
|
||||
if(active){
|
||||
gchar *path = get_record_file();
|
||||
stream=audio_stream_new(factory, 8888, 8889, FALSE);
|
||||
if(stream != NULL){
|
||||
audio_stream_start_full(stream,&av_profile,"127.0.0.1",8888,"127.0.0.1",8889,0,0,NULL,
|
||||
path,NULL,ms_snd_card_manager_get_card(manager,linphone_core_get_capture_device(lc)),FALSE);
|
||||
g_object_set_data(G_OBJECT(audio_assistant),"record_stream",stream);
|
||||
}
|
||||
timeout_id = gtk_timeout_add(6000,(GtkFunction)linphone_gtk_stop_record,NULL);
|
||||
g_object_set_data(G_OBJECT(audio_assistant),"timeout_id",GINT_TO_POINTER(timeout_id));
|
||||
g_object_set_data(G_OBJECT(audio_assistant),"path",path);
|
||||
} else {
|
||||
stream = (AudioStream *)g_object_get_data(G_OBJECT(audio_assistant),"record_stream");
|
||||
timeout_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(audio_assistant),"timeout_id"));
|
||||
gtk_timeout_remove(timeout_id);
|
||||
if(stream != NULL){
|
||||
audio_stream_stop(stream);
|
||||
g_object_set_data(G_OBJECT(audio_assistant),"record_stream",NULL);
|
||||
}
|
||||
update_record_button(FALSE);
|
||||
update_play_button(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static void endoffile_cb(void *ud, MSFilter *f, unsigned int ev,void * arg){
|
||||
switch (ev) {
|
||||
case MS_PLAYER_EOF: {
|
||||
ms_message("EndOfFile received");
|
||||
/*workaround for a mediastreamer2 bug. Don't deactivate the play button, because it will stop the graph from the end of file callback,
|
||||
* which is sometimes crashing. On master branch it is fixed in mediastreamer2, the workaround is only valid in 3.8.x branch*/
|
||||
g_timeout_add(0, (GSourceFunc)deactivate_play_button, NULL);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_start_play_record_sound(GtkWidget *w,gpointer data){
|
||||
LinphoneCore *lc = linphone_gtk_get_core();
|
||||
MSFactory *factory = linphone_core_get_ms_factory(lc);
|
||||
gboolean active=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
|
||||
AudioStream *stream = NULL;
|
||||
MSSndCardManager *manager = ms_factory_get_snd_card_manager(factory);
|
||||
|
||||
if(active){
|
||||
gchar *path = g_object_get_data(G_OBJECT(audio_assistant),"path");
|
||||
stream=audio_stream_new(factory, 8888, 8889, FALSE);
|
||||
if(path != NULL){
|
||||
audio_stream_start_full(stream,&av_profile,"127.0.0.1",8888,"127.0.0.1",8889,0,0,path,
|
||||
NULL,ms_snd_card_manager_get_card(manager,linphone_core_get_playback_device(lc)),NULL,FALSE);
|
||||
ms_filter_add_notify_callback(stream->soundread,endoffile_cb,stream,FALSE);
|
||||
g_object_set_data(G_OBJECT(audio_assistant),"play_stream",stream);
|
||||
}
|
||||
} else {
|
||||
stream = (AudioStream *)g_object_get_data(G_OBJECT(audio_assistant),"play_stream");
|
||||
if(stream != NULL){
|
||||
audio_stream_stop(stream);
|
||||
g_object_set_data(G_OBJECT(audio_assistant),"play_stream",NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void display_popup(GtkMessageType type,const gchar *message){
|
||||
GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(audio_assistant),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
type,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"%s",
|
||||
(const gchar*)message);
|
||||
/* Destroy the dialog when the user responds to it (e.g. clicks a button) */
|
||||
g_signal_connect_swapped (G_OBJECT (dialog), "response",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
G_OBJECT (dialog));
|
||||
gtk_widget_show(dialog);
|
||||
}
|
||||
|
||||
static void open_mixer(void){
|
||||
GError *error = NULL;
|
||||
|
||||
#ifdef _WIN32
|
||||
if(!g_spawn_command_line_async("control mmsys.cpl",&error)){
|
||||
display_popup(GTK_MESSAGE_WARNING,_("Sound preferences not found "));
|
||||
g_error_free(error);
|
||||
}
|
||||
#elif __APPLE__
|
||||
if(!g_spawn_command_line_async("open /System/Library/PreferencePanes/Sound.prefPane",&error)){
|
||||
display_popup(GTK_MESSAGE_WARNING,_("Sound preferences not found "));
|
||||
g_error_free(error);
|
||||
}
|
||||
#else
|
||||
if(!g_spawn_command_line_async("gnome-volume-control",&error)){
|
||||
if(!g_spawn_command_line_async("gnome-control-center sound",&error)){
|
||||
if(!g_spawn_command_line_async("kmix",&error)){
|
||||
if(!g_spawn_command_line_async("mate-volume-control",&error)){
|
||||
if(!g_spawn_command_line_async("xterm alsamixer",&error)){
|
||||
display_popup(GTK_MESSAGE_WARNING,_("Cannot launch system sound control "));
|
||||
g_error_free(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static GtkWidget *create_intro(void){
|
||||
GtkWidget *vbox=gtk_vbox_new(FALSE,2);
|
||||
GtkWidget *label=gtk_label_new(_("Welcome!\nThis assistant will help you to configure audio settings for Linphone"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 2);
|
||||
gtk_widget_show_all(vbox);
|
||||
return vbox;
|
||||
}
|
||||
|
||||
static GtkWidget *create_mic_page(void){
|
||||
GtkWidget *vbox=gtk_table_new(3,2,FALSE);
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
const char **sound_devices;
|
||||
GtkWidget *labelMicChoice=gtk_label_new(_("Capture device"));
|
||||
GtkWidget *labelMicLevel=gtk_label_new(_("Recorded volume"));
|
||||
GtkWidget *mic_audiolevel=gtk_progress_bar_new();
|
||||
GtkWidget *capture_device=gtk_combo_box_new();
|
||||
GtkWidget *box = gtk_vbox_new(FALSE,0);
|
||||
GtkWidget *label_audiolevel=gtk_label_new(_("No voice"));
|
||||
GtkWidget *mixer_button=gtk_button_new_with_label(_("System sound preferences"));
|
||||
GtkWidget *image;
|
||||
|
||||
image=gtk_image_new_from_stock(GTK_STOCK_PREFERENCES,GTK_ICON_SIZE_MENU);
|
||||
gtk_button_set_image(GTK_BUTTON(mixer_button),image);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(box),mic_audiolevel,TRUE,TRUE,1);
|
||||
gtk_box_pack_start(GTK_BOX(box),label_audiolevel,FALSE,FALSE,1);
|
||||
|
||||
gtk_table_attach_defaults(GTK_TABLE(vbox), labelMicChoice, 0, 1, 0, 1);
|
||||
gtk_table_attach_defaults(GTK_TABLE(vbox), capture_device, 1, 2, 0, 1);
|
||||
gtk_table_attach_defaults(GTK_TABLE(vbox), labelMicLevel, 0, 1, 1, 2);
|
||||
gtk_table_attach_defaults(GTK_TABLE(vbox), box, 1, 2, 1, 2);
|
||||
gtk_table_attach(GTK_TABLE(vbox), mixer_button, 0, 2, 2, 3, GTK_SHRINK, GTK_SHRINK, 0,0);
|
||||
|
||||
gtk_table_set_row_spacings(GTK_TABLE(vbox),10);
|
||||
|
||||
set_widget_to_assistant("mic_audiolevel",mic_audiolevel);
|
||||
set_widget_to_assistant("label_audiolevel",label_audiolevel);
|
||||
|
||||
sound_devices=linphone_core_get_sound_devices(lc);
|
||||
linphone_gtk_fill_combo_box(capture_device, sound_devices,
|
||||
linphone_core_get_capture_device(lc), CAP_CAPTURE);
|
||||
gtk_widget_show_all(vbox);
|
||||
|
||||
g_signal_connect(G_OBJECT(capture_device),"changed",(GCallback)capture_device_changed,capture_device);
|
||||
g_signal_connect(G_OBJECT(mixer_button),"clicked",(GCallback)open_mixer,vbox);
|
||||
|
||||
return vbox;
|
||||
}
|
||||
|
||||
static GtkWidget *create_speaker_page(void){
|
||||
GtkWidget *vbox=gtk_table_new(3,2,FALSE);
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
|
||||
GtkWidget *labelSpeakerChoice=gtk_label_new(_("Playback device"));
|
||||
GtkWidget *labelSpeakerLevel=gtk_label_new(_("Play three beeps"));
|
||||
GtkWidget *spk_button=gtk_button_new_from_stock(GTK_STOCK_MEDIA_PLAY);
|
||||
GtkWidget *playback_device=gtk_combo_box_new();
|
||||
GtkWidget *mixer_button=gtk_button_new_with_label(_("System sound preferences"));
|
||||
GtkWidget *image;
|
||||
const char **sound_devices;
|
||||
|
||||
image=gtk_image_new_from_stock(GTK_STOCK_PREFERENCES,GTK_ICON_SIZE_MENU);
|
||||
gtk_button_set_image(GTK_BUTTON(mixer_button),image);
|
||||
|
||||
gtk_table_attach_defaults(GTK_TABLE(vbox), labelSpeakerChoice, 0, 1, 0, 1);
|
||||
gtk_table_attach(GTK_TABLE(vbox), playback_device, 1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0,0);
|
||||
gtk_table_attach_defaults(GTK_TABLE(vbox), labelSpeakerLevel, 0, 1, 1, 2);
|
||||
gtk_table_attach(GTK_TABLE(vbox), spk_button, 1, 2, 1, 2, GTK_SHRINK, GTK_SHRINK, 0,0);
|
||||
gtk_table_attach(GTK_TABLE(vbox), mixer_button, 0, 2, 2, 3, GTK_SHRINK, GTK_SHRINK, 0,0);
|
||||
|
||||
gtk_table_set_row_spacings(GTK_TABLE(vbox),10);
|
||||
|
||||
sound_devices=linphone_core_get_sound_devices(lc);
|
||||
linphone_gtk_fill_combo_box(playback_device, sound_devices,
|
||||
linphone_core_get_playback_device(lc),CAP_PLAYBACK);
|
||||
gtk_widget_show_all(vbox);
|
||||
|
||||
set_widget_to_assistant("speaker_page",vbox);
|
||||
g_signal_connect(G_OBJECT(playback_device),"changed",(GCallback)playback_device_changed,playback_device);
|
||||
g_signal_connect(G_OBJECT(spk_button),"clicked",(GCallback)linphone_gtk_start_sound,vbox);
|
||||
g_signal_connect(G_OBJECT(mixer_button),"clicked",(GCallback)open_mixer,vbox);
|
||||
|
||||
return vbox;
|
||||
}
|
||||
|
||||
static GtkWidget *create_play_record_page(void){
|
||||
GtkWidget *vbox=gtk_table_new(2,2,FALSE);
|
||||
GtkWidget *labelRecord=gtk_label_new(_("Press the record button and say some words"));
|
||||
GtkWidget *labelPlay=gtk_label_new(_("Listen to your record voice"));
|
||||
GtkWidget *rec_button=gtk_toggle_button_new_with_label(_("Record"));
|
||||
GtkWidget *play_button=gtk_toggle_button_new_with_label(_("Play"));
|
||||
GtkWidget *image;
|
||||
|
||||
image=gtk_image_new_from_stock(GTK_STOCK_MEDIA_RECORD,GTK_ICON_SIZE_MENU);
|
||||
gtk_button_set_image(GTK_BUTTON(rec_button),image);
|
||||
|
||||
image=gtk_image_new_from_stock(GTK_STOCK_MEDIA_PLAY,GTK_ICON_SIZE_MENU);
|
||||
gtk_button_set_image(GTK_BUTTON(play_button),image);
|
||||
gtk_widget_set_sensitive(play_button,FALSE);
|
||||
|
||||
gtk_table_attach_defaults(GTK_TABLE(vbox), labelRecord, 0, 1, 0, 1);
|
||||
gtk_table_attach(GTK_TABLE(vbox), rec_button, 1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0,0);
|
||||
gtk_table_attach_defaults(GTK_TABLE(vbox), labelPlay, 0, 1, 1, 2);
|
||||
gtk_table_attach(GTK_TABLE(vbox), play_button, 1, 2, 1, 2, GTK_SHRINK, GTK_SHRINK, 0,0);
|
||||
|
||||
gtk_widget_show_all(vbox);
|
||||
|
||||
set_widget_to_assistant("rec_button",rec_button);
|
||||
set_widget_to_assistant("play_button",play_button);
|
||||
g_signal_connect(G_OBJECT(rec_button),"toggled",(GCallback)linphone_gtk_start_record_sound,vbox);
|
||||
g_signal_connect(G_OBJECT(play_button),"toggled",(GCallback)linphone_gtk_start_play_record_sound,vbox);
|
||||
|
||||
return vbox;
|
||||
}
|
||||
|
||||
static GtkWidget *create_end_page(void){
|
||||
GtkWidget *vbox=gtk_vbox_new(FALSE,2);
|
||||
GtkWidget *label=gtk_label_new(_("Let's start Linphone now"));
|
||||
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 2);
|
||||
gtk_widget_show_all(vbox);
|
||||
return vbox;
|
||||
}
|
||||
|
||||
static void prepare(GtkAssistant *w){
|
||||
AudioStream *audio_stream = NULL;
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
MSFactory *factory = linphone_core_get_ms_factory(lc);
|
||||
int page = gtk_assistant_get_current_page(w);
|
||||
GtkWidget *mic_audiolevel = get_widget_from_assistant("mic_audiolevel");
|
||||
GtkWidget *label_audiolevel = get_widget_from_assistant("label_audiolevel");
|
||||
|
||||
//Speaker page
|
||||
if(page == 1){
|
||||
MSSndCardManager *manager = ms_factory_get_snd_card_manager(factory);
|
||||
audio_stream = audio_stream_start_with_sndcards(factory, &av_profile,9898,"127.0.0.1",19898,0,0,ms_snd_card_manager_get_card(manager,linphone_core_get_playback_device(lc)),ms_snd_card_manager_get_card(manager,linphone_core_get_capture_device(lc)),FALSE);
|
||||
if (mic_audiolevel != NULL && audio_stream != NULL){
|
||||
g_object_set_data(G_OBJECT(audio_assistant),"stream",audio_stream);
|
||||
linphone_gtk_init_audio_meter(mic_audiolevel,(get_volume_t)audio_stream_get_record_volume,audio_stream);
|
||||
linphone_gtk_init_audio_label(label_audiolevel,(get_volume_t)audio_stream_get_max_volume,audio_stream);
|
||||
}
|
||||
} else if(page == 2 || page == 0){
|
||||
if(mic_audiolevel != NULL && label_audiolevel != NULL){
|
||||
audio_stream = (AudioStream *)g_object_get_data(G_OBJECT(audio_assistant),"stream");
|
||||
if(audio_stream != NULL){
|
||||
linphone_gtk_uninit_audio_meter(mic_audiolevel);
|
||||
linphone_gtk_uninit_audio_label(label_audiolevel);
|
||||
audio_stream_stop(audio_stream);
|
||||
g_object_set_data(G_OBJECT(audio_assistant),"stream",NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_close_audio_assistant(GtkWidget *w){
|
||||
gchar *path;
|
||||
AudioStream *stream;
|
||||
|
||||
path = g_object_get_data(G_OBJECT(audio_assistant),"path");
|
||||
if(path != NULL){
|
||||
g_unlink(path);
|
||||
}
|
||||
stream = (AudioStream *)g_object_get_data(G_OBJECT(audio_assistant), "stream");
|
||||
if(stream) {
|
||||
audio_stream_stop(stream);
|
||||
}
|
||||
gtk_widget_destroy(w);
|
||||
if(linphone_gtk_get_audio_assistant_option()){
|
||||
gtk_main_quit();
|
||||
}
|
||||
audio_assistant = NULL;
|
||||
}
|
||||
|
||||
void linphone_gtk_audio_assistant_apply(GtkWidget *w){
|
||||
linphone_gtk_close_audio_assistant(w);
|
||||
}
|
||||
|
||||
void linphone_gtk_show_audio_assistant(void){
|
||||
GtkWidget *w;
|
||||
GtkWidget *welcome;
|
||||
GtkWidget *mic_page;
|
||||
GtkWidget *speaker_page;
|
||||
GtkWidget *play_record_page;
|
||||
GtkWidget *end_page;
|
||||
if(audio_assistant!=NULL)
|
||||
return;
|
||||
w=audio_assistant=linphone_gtk_create_window("audio_assistant", linphone_gtk_get_main_window());
|
||||
|
||||
gtk_window_set_resizable (GTK_WINDOW(w), FALSE);
|
||||
gtk_window_set_title(GTK_WINDOW(w),_("Audio Assistant"));
|
||||
|
||||
welcome=create_intro();
|
||||
mic_page=create_mic_page();
|
||||
speaker_page=create_speaker_page();
|
||||
play_record_page=create_play_record_page();
|
||||
end_page=create_end_page();
|
||||
|
||||
gtk_assistant_append_page(GTK_ASSISTANT(w),welcome);
|
||||
gtk_assistant_set_page_type(GTK_ASSISTANT(w),welcome,GTK_ASSISTANT_PAGE_INTRO);
|
||||
gtk_assistant_set_page_title(GTK_ASSISTANT(w),welcome,_("Audio assistant"));
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(w),welcome,TRUE);
|
||||
|
||||
gtk_assistant_append_page(GTK_ASSISTANT(w),mic_page);
|
||||
gtk_assistant_set_page_type(GTK_ASSISTANT(w),mic_page,GTK_ASSISTANT_PAGE_CONTENT);
|
||||
gtk_assistant_set_page_title(GTK_ASSISTANT(w),mic_page,_("Mic Gain calibration"));
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(w),mic_page,TRUE);
|
||||
|
||||
gtk_assistant_append_page(GTK_ASSISTANT(w),speaker_page);
|
||||
gtk_assistant_set_page_type(GTK_ASSISTANT(w),speaker_page,GTK_ASSISTANT_PAGE_CONTENT);
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(w),speaker_page,FALSE);
|
||||
gtk_assistant_set_page_title(GTK_ASSISTANT(w),speaker_page,_("Speaker volume calibration"));
|
||||
|
||||
gtk_assistant_append_page(GTK_ASSISTANT(w),play_record_page);
|
||||
gtk_assistant_set_page_type(GTK_ASSISTANT(w),play_record_page,GTK_ASSISTANT_PAGE_CONTENT);
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(w),play_record_page,TRUE);
|
||||
gtk_assistant_set_page_title(GTK_ASSISTANT(w),play_record_page,_("Record and Play"));
|
||||
|
||||
gtk_assistant_append_page(GTK_ASSISTANT(w),end_page);
|
||||
gtk_assistant_set_page_type(GTK_ASSISTANT(w),end_page,GTK_ASSISTANT_PAGE_SUMMARY);
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(w),end_page,TRUE);
|
||||
gtk_assistant_set_page_title(GTK_ASSISTANT(w),end_page,_("Terminating"));
|
||||
|
||||
g_signal_connect(G_OBJECT(w),"close",(GCallback)linphone_gtk_close_audio_assistant,w);
|
||||
g_signal_connect(G_OBJECT(w),"cancel",(GCallback)linphone_gtk_close_audio_assistant,w);
|
||||
g_signal_connect(G_OBJECT(w),"prepare",(GCallback)prepare,NULL);
|
||||
|
||||
gtk_widget_show(w);
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.16"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkAssistant" id="audio_assistant">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">12</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,305 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
#include "linphone/sipsetup.h"
|
||||
|
||||
static void linphone_gtk_display_lookup_results(GtkWidget *w, const bctbx_list_t *results);
|
||||
|
||||
enum {
|
||||
LOOKUP_RESULT_NAME,
|
||||
LOOKUP_RESULT_SIP_URI,
|
||||
LOOKUP_RESULT_ADDRESS,
|
||||
LOOKUP_RESULT_ICON,
|
||||
LOOKUP_RESULT_NCOL
|
||||
};
|
||||
|
||||
void linphone_gtk_buddy_lookup_window_destroyed(GtkWidget *w){
|
||||
guint tid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"typing_timeout"));
|
||||
if (tid!=0){
|
||||
g_source_remove(tid);
|
||||
}
|
||||
tid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"buddylookup_processing"));
|
||||
if (tid!=0){
|
||||
g_source_remove(tid);
|
||||
}
|
||||
}
|
||||
|
||||
static void enable_add_buddy_button(GtkWidget *w){
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(w,"add_buddy"),TRUE);
|
||||
}
|
||||
|
||||
static void disable_add_buddy_button(GtkWidget *w){
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(w,"add_buddy"),FALSE);
|
||||
}
|
||||
|
||||
static void buddy_selection_changed(GtkWidget *w){
|
||||
GtkWidget *results=linphone_gtk_get_widget(w,"search_results");
|
||||
GtkTreeSelection *select;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model;
|
||||
enable_add_buddy_button(w);
|
||||
|
||||
select = gtk_tree_view_get_selection(GTK_TREE_VIEW(results));
|
||||
if (gtk_tree_selection_get_selected (select, &model, &iter))
|
||||
{
|
||||
GtkTreePath *path=gtk_tree_model_get_path(model,&iter);
|
||||
gtk_tree_view_collapse_all(GTK_TREE_VIEW(results));
|
||||
gtk_tree_view_expand_row(GTK_TREE_VIEW(results),path,FALSE);
|
||||
gtk_tree_path_free(path);
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget * linphone_gtk_show_buddy_lookup_window(SipSetupContext *ctx){
|
||||
GtkTreeStore *store;
|
||||
GtkCellRenderer *renderer,*pbuf_renderer;
|
||||
GtkTreeViewColumn *column;
|
||||
GtkTreeSelection *select;
|
||||
GtkWidget *w=linphone_gtk_create_window("buddylookup", NULL);
|
||||
GtkWidget *results=linphone_gtk_get_widget(w,"search_results");
|
||||
GtkProgressBar *pb=GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar"));
|
||||
|
||||
store = gtk_tree_store_new(LOOKUP_RESULT_NCOL, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF);
|
||||
|
||||
/*gtk_tree_view_set_hover_expand(GTK_TREE_VIEW(results),TRUE);*/
|
||||
gtk_tree_view_set_model(GTK_TREE_VIEW(results),GTK_TREE_MODEL(store));
|
||||
g_object_unref(G_OBJECT(store));
|
||||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
column = gtk_tree_view_column_new_with_attributes (_("Firstname, Lastname"),
|
||||
renderer,
|
||||
"markup", LOOKUP_RESULT_NAME,
|
||||
NULL);
|
||||
g_object_set (G_OBJECT(column), "resizable", TRUE, NULL);
|
||||
|
||||
|
||||
pbuf_renderer=gtk_cell_renderer_pixbuf_new();
|
||||
g_object_set(G_OBJECT(renderer),"is-expander",TRUE,NULL);
|
||||
gtk_tree_view_column_pack_start(column,pbuf_renderer,FALSE);
|
||||
gtk_tree_view_column_add_attribute (column,pbuf_renderer,
|
||||
"pixbuf",
|
||||
LOOKUP_RESULT_ICON);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (results), column);
|
||||
|
||||
/*
|
||||
column = gtk_tree_view_column_new_with_attributes (_("SIP address"),
|
||||
renderer,
|
||||
"text", LOOKUP_RESULT_SIP_URI,
|
||||
NULL);
|
||||
g_object_set (G_OBJECT(column), "resizable", TRUE, NULL);
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (results), column);
|
||||
*/
|
||||
|
||||
select = gtk_tree_view_get_selection (GTK_TREE_VIEW (results));
|
||||
gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
|
||||
g_signal_connect_swapped(G_OBJECT(select),"changed",(GCallback)buddy_selection_changed,w);
|
||||
/*
|
||||
#if GTK_CHECK_VERSION(2,12,0)
|
||||
gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(results),LOOKUP_RESULT_ADDRESS);
|
||||
#endif
|
||||
*/
|
||||
g_object_set_data(G_OBJECT(w),"SipSetupContext",ctx);
|
||||
g_object_weak_ref(G_OBJECT(w),(GWeakNotify)linphone_gtk_buddy_lookup_window_destroyed,w);
|
||||
//g_signal_connect_swapped(G_OBJECT(w),"destroy",(GCallback)linphone_gtk_buddy_lookup_window_destroyed,w);
|
||||
gtk_progress_bar_set_fraction(pb,0);
|
||||
gtk_progress_bar_set_text(pb,NULL);
|
||||
gtk_dialog_add_button(GTK_DIALOG(w),GTK_STOCK_CLOSE,GTK_RESPONSE_CLOSE);
|
||||
g_object_set_data(G_OBJECT(w),"last_state",GINT_TO_POINTER(-1));
|
||||
|
||||
gtk_widget_show(w);
|
||||
return w;
|
||||
}
|
||||
|
||||
|
||||
void linphone_gtk_buddy_lookup_set_keyword(GtkWidget *w, const char *kw){
|
||||
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(w,"keyword")),kw);
|
||||
}
|
||||
|
||||
static gboolean linphone_gtk_process_buddy_lookup(GtkWidget *w){
|
||||
BuddyLookupStatus bls;
|
||||
SipSetupContext *ctx;
|
||||
int last_state;
|
||||
gchar *tmp;
|
||||
bctbx_list_t *results=NULL;
|
||||
GtkProgressBar *pb=GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar"));
|
||||
BuddyLookupRequest *req=(BuddyLookupRequest*)g_object_get_data(G_OBJECT(w),"buddylookup_request");
|
||||
|
||||
ctx=(SipSetupContext*)g_object_get_data(G_OBJECT(w),"SipSetupContext");
|
||||
last_state=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"last_state"));
|
||||
|
||||
if (req==NULL) {
|
||||
g_object_set_data(G_OBJECT(w),"buddylookup_processing",GINT_TO_POINTER(0));
|
||||
return FALSE;
|
||||
}
|
||||
bls=req->status;
|
||||
if (last_state==(int)bls) return TRUE;
|
||||
|
||||
switch(bls){
|
||||
case BuddyLookupNone:
|
||||
gtk_progress_bar_set_fraction(pb,0);
|
||||
gtk_progress_bar_set_text(pb,NULL);
|
||||
break;
|
||||
case BuddyLookupFailure:
|
||||
gtk_progress_bar_set_fraction(pb,0);
|
||||
gtk_progress_bar_set_text(pb,_("Error communicating with server."));
|
||||
break;
|
||||
case BuddyLookupConnecting:
|
||||
gtk_progress_bar_set_fraction(pb,0.2);
|
||||
gtk_progress_bar_set_text(pb,_("Connecting..."));
|
||||
break;
|
||||
case BuddyLookupConnected:
|
||||
gtk_progress_bar_set_fraction(pb,0.4);
|
||||
gtk_progress_bar_set_text(pb,_("Connected"));
|
||||
break;
|
||||
case BuddyLookupReceivingResponse:
|
||||
gtk_progress_bar_set_fraction(pb,0.8);
|
||||
gtk_progress_bar_set_text(pb,_("Receiving data..."));
|
||||
break;
|
||||
case BuddyLookupDone:
|
||||
results=req->results;
|
||||
linphone_gtk_display_lookup_results(
|
||||
linphone_gtk_get_widget(w,"search_results"),
|
||||
results);
|
||||
gtk_progress_bar_set_fraction(pb,1);
|
||||
tmp=g_strdup_printf(ngettext("Found %u contact", "Found %u contacts",
|
||||
(unsigned int)bctbx_list_size(results)), (unsigned int)bctbx_list_size(results));
|
||||
gtk_progress_bar_set_text(pb,tmp);
|
||||
g_free(tmp);
|
||||
sip_setup_context_buddy_lookup_free(ctx,req);
|
||||
g_object_set_data(G_OBJECT(w),"buddylookup_request",NULL);
|
||||
break;
|
||||
}
|
||||
g_object_set_data(G_OBJECT(w),"last_state",GINT_TO_POINTER(bls));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean keyword_typing_finished(GtkWidget *w){
|
||||
guint tid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"typing_timeout"));
|
||||
const char *keyword;
|
||||
SipSetupContext *ctx;
|
||||
if (tid!=0){
|
||||
g_source_remove(tid);
|
||||
}
|
||||
keyword=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(w,"keyword")));
|
||||
if (strlen(keyword)>=1){
|
||||
BuddyLookupRequest *req;
|
||||
guint tid2;
|
||||
ctx=(SipSetupContext*)g_object_get_data(G_OBJECT(w),"SipSetupContext");
|
||||
req=(BuddyLookupRequest*)g_object_get_data(G_OBJECT(w),"buddylookup_request");
|
||||
if (req!=NULL){
|
||||
sip_setup_context_buddy_lookup_free(ctx,req);
|
||||
}
|
||||
req=sip_setup_context_create_buddy_lookup_request(ctx);
|
||||
buddy_lookup_request_set_key(req,keyword);
|
||||
sip_setup_context_buddy_lookup_submit(ctx,req);
|
||||
g_object_set_data(G_OBJECT(w),"buddylookup_request",req);
|
||||
if (g_object_get_data(G_OBJECT(w),"buddylookup_processing")==NULL){
|
||||
tid2=g_timeout_add(20,(GSourceFunc)linphone_gtk_process_buddy_lookup,w);
|
||||
g_object_set_data(G_OBJECT(w),"buddylookup_processing",GINT_TO_POINTER(tid2));
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void linphone_gtk_keyword_changed(GtkEditable *e){
|
||||
GtkWidget *w=gtk_widget_get_toplevel(GTK_WIDGET(e));
|
||||
guint tid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"typing_timeout"));
|
||||
if (tid!=0){
|
||||
g_source_remove(tid);
|
||||
}
|
||||
tid=g_timeout_add(2000,(GSourceFunc)keyword_typing_finished,w);
|
||||
g_object_set_data(G_OBJECT(w),"typing_timeout",GINT_TO_POINTER(tid));
|
||||
}
|
||||
|
||||
static void linphone_gtk_display_lookup_results(GtkWidget *w, const bctbx_list_t *results){
|
||||
GtkTreeStore *store;
|
||||
GtkTreeIter iter;
|
||||
gchar *tmp;
|
||||
const bctbx_list_t *elem;
|
||||
store=GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(w)));
|
||||
gtk_tree_store_clear(store);
|
||||
disable_add_buddy_button(gtk_widget_get_toplevel(w));
|
||||
for(elem=results;elem!=NULL;elem=elem->next){
|
||||
BuddyInfo *bi=(BuddyInfo*)elem->data;
|
||||
GdkPixbuf *pbuf;
|
||||
GtkTreeIter depth1;
|
||||
gtk_tree_store_append(store,&iter,NULL);
|
||||
tmp=g_strdup_printf("%s, %s (%s)",bi->firstname,bi->lastname,bi->displayname);
|
||||
gtk_tree_store_set(store,&iter,LOOKUP_RESULT_NAME, tmp,-1);
|
||||
g_free(tmp);
|
||||
gtk_tree_store_set(store,&iter,LOOKUP_RESULT_SIP_URI, bi->sip_uri,-1);
|
||||
tmp=g_strdup_printf("%s, %s %s\n%s",bi->address.street, bi->address.zip, bi->address.town, bi->address.country);
|
||||
gtk_tree_store_set(store,&iter,LOOKUP_RESULT_ADDRESS, tmp,-1);
|
||||
g_free(tmp);
|
||||
if (bi->image_data!=NULL){
|
||||
pbuf=_gdk_pixbuf_new_from_memory_at_scale(bi->image_data,bi->image_length,-1,40,TRUE);
|
||||
if (pbuf) {
|
||||
gtk_tree_store_set(store,&iter,LOOKUP_RESULT_ICON,pbuf,-1);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}
|
||||
}
|
||||
gtk_tree_store_append(store,&depth1,&iter);
|
||||
tmp=g_strdup_printf("<big>%s, %s (%s)</big>\n<i>%s</i>, <b>%s</b> %s\n%s\n%s",
|
||||
bi->firstname,bi->lastname,bi->displayname,bi->address.street,
|
||||
bi->address.zip, bi->address.town, bi->address.country,bi->sip_uri);
|
||||
gtk_tree_store_set(store,&depth1,LOOKUP_RESULT_NAME,tmp,-1);
|
||||
g_free(tmp);
|
||||
if (bi->image_data!=NULL){
|
||||
pbuf=_gdk_pixbuf_new_from_memory_at_scale(bi->image_data,bi->image_length,-1,-1,TRUE);
|
||||
if (pbuf) {
|
||||
gtk_tree_store_set(store,&depth1,LOOKUP_RESULT_ICON,pbuf,-1);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_add_buddy_from_database(GtkWidget *button){
|
||||
GtkWidget *w=gtk_widget_get_toplevel(button);
|
||||
GtkTreeSelection *select;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model;
|
||||
select = gtk_tree_view_get_selection(GTK_TREE_VIEW(linphone_gtk_get_widget(w,"search_results")));
|
||||
if (gtk_tree_selection_get_selected (select, &model, &iter))
|
||||
{
|
||||
char *uri;
|
||||
char *name;
|
||||
char *addr;
|
||||
LinphoneFriend *lf;
|
||||
LinphoneCore *lc = linphone_gtk_get_core();
|
||||
int presence=linphone_gtk_get_ui_config_int("use_subscribe_notify",1);
|
||||
gtk_tree_model_get (model, &iter,LOOKUP_RESULT_SIP_URI , &uri,LOOKUP_RESULT_NAME, &name, -1);
|
||||
addr=g_strdup_printf("%s <%s>",name,uri);
|
||||
|
||||
lf=linphone_core_create_friend_with_address(lc, addr);
|
||||
linphone_friend_set_inc_subscribe_policy(lf,presence ? LinphoneSPAccept : LinphoneSPDeny);
|
||||
linphone_friend_send_subscribe(lf,presence);
|
||||
linphone_core_add_friend(lc, lf);
|
||||
linphone_gtk_show_friends();
|
||||
g_free(addr);
|
||||
g_free(uri);
|
||||
g_free(name);
|
||||
}
|
||||
}
|
||||
|
||||
/*called when double clicking on a contact */
|
||||
void linphone_gtk_buddy_lookup_contact_activated(GtkWidget *treeview){
|
||||
linphone_gtk_add_buddy_from_database(treeview);
|
||||
gtk_widget_destroy(gtk_widget_get_toplevel(treeview));
|
||||
}
|
||||
|
|
@ -1,159 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 2.16 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<object class="GtkDialog" id="buddylookup">
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Search contacts in directory</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<signal handler="gtk_widget_destroy" name="response"/>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="keyword">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_focus">True</property>
|
||||
<signal handler="linphone_gtk_keyword_changed" name="changed"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">automatic</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">etched-in</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="search_results">
|
||||
<property name="width_request">512</property>
|
||||
<property name="height_request">140</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<signal handler="linphone_gtk_buddy_lookup_contact_activated" name="row_activated"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="progressbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="activity_mode">True</property>
|
||||
<property name="show_text">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHButtonBox" id="hbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="add_buddy">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal handler="linphone_gtk_add_buddy_from_database" name="clicked"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-add</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Add to my list</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Search somebody</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
119
gtk/call_logs.ui
|
|
@ -1,119 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.16"/>
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<object class="GtkDialog" id="call_logs">
|
||||
<property name="width_request">500</property>
|
||||
<property name="height_request">370</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Call history</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="call_logs_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label" translatable="yes">Clear all</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="image">image1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="call_back_button">
|
||||
<property name="label" translatable="yes">Call back</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="call_logs_close">
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="logs_view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<signal name="button-press-event" handler="linphone_gtk_call_log_button_pressed" swapped="no"/>
|
||||
<signal name="row-activated" handler="linphone_gtk_history_row_activated" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="2">button1</action-widget>
|
||||
<action-widget response="1">call_back_button</action-widget>
|
||||
<action-widget response="0">call_logs_close</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
<object class="GtkListStore" id="call_logs_store">
|
||||
<columns>
|
||||
<!-- column-name icon -->
|
||||
<column type="gchar"/>
|
||||
<!-- column-name sipaddress -->
|
||||
<column type="gchar"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-clear</property>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,293 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.16"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkDialog" id="call_statistics">
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Call statistics</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="response" handler="linphone_gtk_call_statistics_closed"/>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">10</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="audio_codec_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Audio codec</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="video_codec_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Video codec</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Audio IP bandwidth usage</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="audio_codec">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="video_codec">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="audio_bandwidth_usage">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Audio Media connectivity</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="x_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="audio_media_connectivity">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Video IP bandwidth usage</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="video_bandwidth_usage">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Video Media connectivity</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="video_media_connectivity">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Round trip time</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">7</property>
|
||||
<property name="bottom_attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="round_trip_time">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">7</property>
|
||||
<property name="bottom_attach">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="video_size_recv_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Video resolution received</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">8</property>
|
||||
<property name="bottom_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="video_size_recv">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">8</property>
|
||||
<property name="bottom_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="video_size_sent_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Video resolution sent</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">9</property>
|
||||
<property name="bottom_attach">10</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="video_size_sent">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">9</property>
|
||||
<property name="bottom_attach">10</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rtp_profile_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">RTP profile</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="rtp_profile">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="call_statistics_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Call statistics and information</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="0">button1</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.24"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkFrame" id="callee_frame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment_conf">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="conf_alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="conf_hbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="conf_hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="conference_control">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="callee_name_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Callee name</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">right</property>
|
||||
<property name="ellipsize">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="sound_indicator">
|
||||
<property name="width_request">90</property>
|
||||
<property name="height_request">30</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
424
gtk/calllogs.c
|
|
@ -1,424 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
#include <bctoolbox/vfs.h>
|
||||
|
||||
#define CONFIG_FILE ".linphone-call-history.db"
|
||||
|
||||
char *linphone_gtk_call_logs_storage_get_db_file(const char *filename){
|
||||
const int path_max=1024;
|
||||
char *db_file=NULL;
|
||||
|
||||
db_file=(char *)g_malloc(path_max*sizeof(char));
|
||||
if (filename==NULL) filename=CONFIG_FILE;
|
||||
/*try accessing a local file first if exists*/
|
||||
if (bctbx_file_exist(CONFIG_FILE)==0){
|
||||
snprintf(db_file,path_max,"%s",filename);
|
||||
}else{
|
||||
#ifdef _WIN32
|
||||
const char *appdata=getenv("APPDATA");
|
||||
if (appdata){
|
||||
snprintf(db_file,path_max,"%s\\%s",appdata,LINPHONE_CONFIG_DIR);
|
||||
CreateDirectory(db_file,NULL);
|
||||
snprintf(db_file,path_max,"%s\\%s\\%s",appdata,LINPHONE_CONFIG_DIR,filename);
|
||||
}
|
||||
#else
|
||||
const char *home=getenv("HOME");
|
||||
if (home==NULL) home=".";
|
||||
snprintf(db_file,path_max,"%s/%s",home,filename);
|
||||
#endif
|
||||
}
|
||||
return db_file;
|
||||
}
|
||||
|
||||
static void fill_renderers(GtkTreeView *v){
|
||||
GtkTreeViewColumn *c;
|
||||
GtkCellRenderer *r;
|
||||
|
||||
r=gtk_cell_renderer_pixbuf_new();
|
||||
c=gtk_tree_view_column_new_with_attributes("icon",r,"icon-name",0,NULL);
|
||||
gtk_tree_view_append_column (v,c);
|
||||
|
||||
r=gtk_cell_renderer_text_new ();
|
||||
c=gtk_tree_view_column_new_with_attributes("sipaddress",r,"markup",1,NULL);
|
||||
gtk_tree_view_append_column (v,c);
|
||||
}
|
||||
|
||||
void call_log_selection_changed(GtkTreeView *v){
|
||||
GtkTreeSelection *select;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model=NULL;
|
||||
|
||||
select = gtk_tree_view_get_selection(v);
|
||||
if (select!=NULL){
|
||||
if (gtk_tree_selection_get_selected (select, &model, &iter)){
|
||||
GtkTreePath *path=gtk_tree_model_get_path(model,&iter);
|
||||
gtk_tree_view_collapse_all(v);
|
||||
gtk_tree_view_expand_row(v,path,TRUE);
|
||||
gtk_tree_path_free(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_call_log_chat_selected(GtkWidget *w){
|
||||
GtkTreeSelection *select;
|
||||
GtkTreeIter iter;
|
||||
|
||||
select=gtk_tree_view_get_selection(GTK_TREE_VIEW(w));
|
||||
if (select!=NULL){
|
||||
GtkTreeModel *model=NULL;
|
||||
if (gtk_tree_selection_get_selected (select,&model,&iter)){
|
||||
gpointer pcl;
|
||||
LinphoneAddress *la;
|
||||
LinphoneCallLog *cl;
|
||||
gtk_tree_model_get(model,&iter,2,&pcl,-1);
|
||||
cl = (LinphoneCallLog *)pcl;
|
||||
la = linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_from(cl) : linphone_call_log_get_to(cl);
|
||||
if (la != NULL){
|
||||
linphone_gtk_friend_list_set_chat_conversation(la);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_call_log_add_contact(GtkWidget *w){
|
||||
GtkWidget *main_window = gtk_widget_get_toplevel(w);
|
||||
GtkTreeSelection *select;
|
||||
GtkTreeIter iter;
|
||||
|
||||
select=gtk_tree_view_get_selection(GTK_TREE_VIEW(w));
|
||||
if (select!=NULL){
|
||||
GtkTreeModel *model=NULL;
|
||||
if (gtk_tree_selection_get_selected (select,&model,&iter)){
|
||||
gpointer pcl;
|
||||
LinphoneAddress *la;
|
||||
LinphoneCallLog *cl;
|
||||
LinphoneFriend *lf;
|
||||
gtk_tree_model_get(model,&iter,2,&pcl,-1);
|
||||
cl = (LinphoneCallLog *)pcl;
|
||||
la = linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_from(cl) : linphone_call_log_get_to(cl);
|
||||
if (la != NULL){
|
||||
char *uri=linphone_address_as_string(la);
|
||||
lf=linphone_core_create_friend_with_address(linphone_gtk_get_core(), uri);
|
||||
linphone_gtk_show_contact(lf, main_window);
|
||||
ms_free(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool_t put_selection_to_uribar(GtkWidget *treeview){
|
||||
GtkTreeSelection *sel;
|
||||
sel=gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
|
||||
if (sel!=NULL){
|
||||
GtkTreeModel *model=NULL;
|
||||
GtkTreeIter iter;
|
||||
if (gtk_tree_selection_get_selected (sel,&model,&iter)){
|
||||
char *tmp;
|
||||
gpointer pcl;
|
||||
LinphoneAddress *la;
|
||||
LinphoneCallLog *cl;
|
||||
gtk_tree_model_get(model,&iter,2,&pcl,-1);
|
||||
cl = (LinphoneCallLog *)pcl;
|
||||
la = linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_from(cl) : linphone_call_log_get_to(cl);
|
||||
tmp = linphone_address_as_string(la);
|
||||
if(tmp!=NULL)
|
||||
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"uribar")),tmp);
|
||||
ms_free(tmp);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void linphone_gtk_call_selected(GtkTreeView *treeview){
|
||||
put_selection_to_uribar(GTK_WIDGET(treeview));
|
||||
linphone_gtk_start_call(linphone_gtk_get_widget(gtk_widget_get_toplevel(GTK_WIDGET(treeview)),
|
||||
"start_call"));
|
||||
}
|
||||
|
||||
static GtkWidget *linphone_gtk_create_call_log_menu(GtkWidget *call_log){
|
||||
GtkWidget *menu=NULL;
|
||||
GtkWidget *menu_item;
|
||||
gchar *call_label=NULL;
|
||||
gchar *text_label=NULL;
|
||||
gchar *add_contact_label=NULL;
|
||||
gchar *name=NULL;
|
||||
GtkWidget *image;
|
||||
GtkTreeSelection *select;
|
||||
GtkTreeIter iter;
|
||||
|
||||
select=gtk_tree_view_get_selection(GTK_TREE_VIEW(call_log));
|
||||
if (select!=NULL){
|
||||
GtkTreeModel *model=NULL;
|
||||
if (gtk_tree_selection_get_selected (select,&model,&iter)){
|
||||
gpointer pcl;
|
||||
LinphoneAddress *la;
|
||||
LinphoneCallLog *cl;
|
||||
gtk_tree_model_get(model,&iter,2,&pcl,-1);
|
||||
cl = (LinphoneCallLog *)pcl;
|
||||
la = linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_from(cl) : linphone_call_log_get_to(cl);
|
||||
name=linphone_address_as_string(la);
|
||||
call_label=g_strdup_printf(_("Call %s"),name);
|
||||
text_label=g_strdup_printf(_("Send text to %s"),name);
|
||||
if (!linphone_gtk_is_friend(linphone_gtk_get_core(), name)) {
|
||||
add_contact_label=g_strdup_printf(_("Add %s to your contact list"),name);
|
||||
}
|
||||
ms_free(name);
|
||||
menu=gtk_menu_new();
|
||||
}
|
||||
}
|
||||
if (menu && call_label){
|
||||
menu_item=gtk_image_menu_item_new_with_label(call_label);
|
||||
image=gtk_image_new_from_icon_name("linphone-start-call",GTK_ICON_SIZE_MENU);
|
||||
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item),image);
|
||||
gtk_widget_show(image);
|
||||
gtk_widget_show(menu_item);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu),menu_item);
|
||||
g_signal_connect_swapped(G_OBJECT(menu_item),"activate",(GCallback)linphone_gtk_call_selected,call_log);
|
||||
}
|
||||
if (menu && text_label){
|
||||
menu_item=gtk_image_menu_item_new_with_label(text_label);
|
||||
image=gtk_image_new_from_icon_name("linphone-start-chat",GTK_ICON_SIZE_MENU);
|
||||
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item),image);
|
||||
gtk_widget_show(image);
|
||||
gtk_widget_show(menu_item);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu),menu_item);
|
||||
g_signal_connect_swapped(G_OBJECT(menu_item),"activate",(GCallback)linphone_gtk_call_log_chat_selected,call_log);
|
||||
}
|
||||
if (menu && add_contact_label){
|
||||
menu_item=gtk_image_menu_item_new_with_label(add_contact_label);
|
||||
image=gtk_image_new_from_icon_name("linphone-contact-add",GTK_ICON_SIZE_MENU);
|
||||
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item),image);
|
||||
gtk_widget_show(image);
|
||||
gtk_widget_show(menu_item);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu),menu_item);
|
||||
g_signal_connect_swapped(G_OBJECT(menu_item),"activate",(GCallback)linphone_gtk_call_log_add_contact,call_log);
|
||||
}
|
||||
if (menu) {
|
||||
gtk_widget_show(menu);
|
||||
gtk_menu_attach_to_widget(GTK_MENU(menu),call_log, NULL);
|
||||
}
|
||||
|
||||
if (add_contact_label) g_free(add_contact_label);
|
||||
if (call_label) g_free(call_label);
|
||||
if (text_label) g_free(text_label);
|
||||
return menu;
|
||||
}
|
||||
|
||||
gboolean linphone_gtk_call_log_popup_contact(GtkWidget *list, GdkEventButton *event){
|
||||
GtkWidget *m=linphone_gtk_create_call_log_menu(list);
|
||||
if (m) {
|
||||
gtk_menu_popup (GTK_MENU (m), NULL, NULL, NULL, NULL,
|
||||
event ? event->button : 0, event ? event->time : gtk_get_current_event_time());
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean linphone_gtk_call_log_button_pressed(GtkWidget *widget, GdkEventButton *event){
|
||||
if (event->button == 3 && event->type == GDK_BUTTON_PRESS){
|
||||
return linphone_gtk_call_log_popup_contact(widget, event);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void linphone_gtk_call_log_clear_missed_call(void){
|
||||
GtkWidget *mw = linphone_gtk_get_main_window();
|
||||
GtkWidget *label = linphone_gtk_get_widget(mw, "history_tab_label");
|
||||
gtk_label_set_text(GTK_LABEL(label), _("Recent calls"));
|
||||
}
|
||||
|
||||
gboolean linphone_gtk_call_log_reset_missed_call(GtkWidget *w, GdkEvent *event,gpointer user_data){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkNotebook *notebook=GTK_NOTEBOOK(linphone_gtk_get_widget(mw,"viewswitch"));
|
||||
gtk_notebook_set_current_page(notebook,0);
|
||||
linphone_core_reset_missed_calls_count(linphone_gtk_get_core());
|
||||
linphone_gtk_call_log_clear_missed_call();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void linphone_gtk_call_log_display_missed_call(int nb){
|
||||
GtkWidget *mw = linphone_gtk_get_main_window();
|
||||
GtkWidget *label = linphone_gtk_get_widget(mw, "history_tab_label");
|
||||
gchar *buf = g_markup_printf_escaped(_("<b>Recent calls (%i)</b>"), nb);
|
||||
gtk_label_set_markup(GTK_LABEL(label), buf);
|
||||
}
|
||||
|
||||
void linphone_gtk_call_log_update(GtkWidget *w){
|
||||
GtkTreeView *v=GTK_TREE_VIEW(linphone_gtk_get_widget(w,"logs_view"));
|
||||
GtkTreeStore *store;
|
||||
const MSList *logs;
|
||||
GtkTreeSelection *select;
|
||||
GtkWidget *notebook=linphone_gtk_get_widget(w,"viewswitch");
|
||||
gint nb;
|
||||
|
||||
store=(GtkTreeStore*)gtk_tree_view_get_model(v);
|
||||
if (store==NULL){
|
||||
store=gtk_tree_store_new(3,G_TYPE_STRING,G_TYPE_STRING,G_TYPE_POINTER,G_TYPE_STRING);
|
||||
gtk_tree_view_set_model(v,GTK_TREE_MODEL(store));
|
||||
g_object_unref(G_OBJECT(store));
|
||||
fill_renderers(GTK_TREE_VIEW(linphone_gtk_get_widget(w,"logs_view")));
|
||||
select=gtk_tree_view_get_selection(v);
|
||||
gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE);
|
||||
g_signal_connect_swapped(G_OBJECT(select),"changed",(GCallback)call_log_selection_changed,v);
|
||||
g_signal_connect(G_OBJECT(notebook),"focus-tab",(GCallback)linphone_gtk_call_log_reset_missed_call,NULL);
|
||||
g_signal_connect(G_OBJECT(v),"button-press-event",(GCallback)linphone_gtk_call_log_button_pressed,NULL);
|
||||
}
|
||||
nb=linphone_core_get_missed_calls_count(linphone_gtk_get_core());
|
||||
if(nb > 0)
|
||||
linphone_gtk_call_log_display_missed_call(nb);
|
||||
gtk_tree_store_clear (store);
|
||||
|
||||
for (logs=linphone_core_get_call_logs(linphone_gtk_get_core());logs!=NULL;logs=logs->next){
|
||||
LinphoneCallLog *cl=(LinphoneCallLog*)logs->data;
|
||||
GtkTreeIter iter, iter2;
|
||||
LinphoneAddress *la=linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_from(cl) : linphone_call_log_get_to(cl);
|
||||
char *addr= linphone_address_as_string(la);
|
||||
const char *display;
|
||||
gchar *logtxt, *headtxt, *minutes, *seconds;
|
||||
gchar quality[20];
|
||||
const char *status=NULL;
|
||||
gchar *start_date=NULL;
|
||||
LinphoneFriend *lf=NULL;
|
||||
int duration=linphone_call_log_get_duration(cl);
|
||||
time_t start_date_time=linphone_call_log_get_start_date(cl);
|
||||
const gchar *call_status_icon_name;
|
||||
|
||||
#if GLIB_CHECK_VERSION(2,30,0) // The g_date_time_format function exists since 2.26.0 but the '%c' format is only supported since 2.30.0
|
||||
if (start_date_time){
|
||||
GDateTime *dt=g_date_time_new_from_unix_local(start_date_time);
|
||||
start_date=g_date_time_format(dt,"%c");
|
||||
g_date_time_unref(dt);
|
||||
}
|
||||
#else
|
||||
start_date=g_strdup(ctime(&start_date_time));
|
||||
if (start_date[strlen(start_date) - 1] == '\n') {
|
||||
start_date[strlen(start_date) - 1] = '\0';
|
||||
}
|
||||
#endif
|
||||
lf=linphone_core_find_friend(linphone_gtk_get_core(),la);
|
||||
if(lf != NULL){
|
||||
/*update display name from friend*/
|
||||
display = linphone_friend_get_name(lf);
|
||||
if (display != NULL) linphone_address_set_display_name(la, display);
|
||||
} else {
|
||||
display=linphone_address_get_display_name(la);
|
||||
}
|
||||
if (display==NULL){
|
||||
display=linphone_address_get_username (la);
|
||||
if (display==NULL){
|
||||
display=linphone_address_get_domain (la);
|
||||
}
|
||||
}
|
||||
|
||||
if (linphone_call_log_get_quality(cl)!=-1){
|
||||
snprintf(quality,sizeof(quality),"%.1f",linphone_call_log_get_quality(cl));
|
||||
}else snprintf(quality,sizeof(quality)-1,"%s",_("n/a"));
|
||||
switch(linphone_call_log_get_status(cl)){
|
||||
case LinphoneCallAborted:
|
||||
status=_("Aborted");
|
||||
break;
|
||||
case LinphoneCallMissed:
|
||||
status=_("Missed");
|
||||
break;
|
||||
case LinphoneCallDeclined:
|
||||
status=_("Declined");
|
||||
break;
|
||||
case LinphoneCallAnsweredElsewhere:
|
||||
status=_("Answered elsewhere");
|
||||
break;
|
||||
case LinphoneCallDeclinedElsewhere:
|
||||
status=_("Declined elsewhere");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
minutes=g_markup_printf_escaped(
|
||||
ngettext("%i minute", "%i minutes", duration/60),
|
||||
duration/60);
|
||||
seconds=g_markup_printf_escaped(
|
||||
ngettext("%i second", "%i seconds", duration%60),
|
||||
duration%60);
|
||||
if (status==NULL) {
|
||||
headtxt=g_markup_printf_escaped("<big><b>%s</b></big>\t%s",display,start_date ? start_date : "");
|
||||
logtxt=g_markup_printf_escaped(
|
||||
_("<small><i>%s</i>\t"
|
||||
"<i>Quality: %s</i></small>\n%s\t%s\t"),
|
||||
addr, quality, minutes, seconds);
|
||||
} else {
|
||||
headtxt=g_markup_printf_escaped(_("<big><b>%s</b></big>\t%s"),display,start_date ? start_date : "");
|
||||
logtxt=g_markup_printf_escaped(
|
||||
"<small><i>%s</i></small>\t"
|
||||
"\n%s",addr, status);
|
||||
}
|
||||
g_free(minutes);
|
||||
g_free(seconds);
|
||||
if (start_date) g_free(start_date);
|
||||
gtk_tree_store_append (store,&iter,NULL);
|
||||
call_status_icon_name = linphone_call_log_get_dir(cl) == LinphoneCallOutgoing ?
|
||||
"linphone-call-status-outgoing" : "linphone-call-status-incoming";
|
||||
gtk_tree_store_set (store,&iter,
|
||||
0, call_status_icon_name,
|
||||
1, headtxt,2,cl,-1);
|
||||
gtk_tree_store_append (store,&iter2,&iter);
|
||||
gtk_tree_store_set (store,&iter2,1,logtxt,-1);
|
||||
ms_free(addr);
|
||||
g_free(logtxt);
|
||||
g_free(headtxt);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_history_row_activated(GtkWidget *treeview){
|
||||
if (put_selection_to_uribar(treeview)){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
linphone_gtk_start_call(linphone_gtk_get_widget(mw,"start_call"));
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_history_row_selected(GtkWidget *treeview){
|
||||
put_selection_to_uribar(treeview);
|
||||
}
|
||||
|
||||
void linphone_gtk_clear_call_logs(GtkWidget *button){
|
||||
linphone_core_clear_call_logs (linphone_gtk_get_core());
|
||||
linphone_gtk_call_log_clear_missed_call();
|
||||
linphone_gtk_call_log_update(gtk_widget_get_toplevel(button));
|
||||
}
|
||||
|
||||
void linphone_gtk_call_log_callback(GtkWidget *button){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
if (put_selection_to_uribar(linphone_gtk_get_widget(mw,"logs_view")))
|
||||
linphone_gtk_start_call(linphone_gtk_get_widget(mw,"start_call"));
|
||||
}
|
||||
|
||||
void linphone_gtk_call_log_response(GtkWidget *w, guint response_id){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
if (response_id==1){
|
||||
if (put_selection_to_uribar(linphone_gtk_get_widget(w,"logs_view")))
|
||||
linphone_gtk_start_call(linphone_gtk_get_widget(mw,"start_call"));
|
||||
}else if (response_id==2){
|
||||
linphone_core_clear_call_logs (linphone_gtk_get_core());
|
||||
linphone_gtk_call_log_update(w);
|
||||
return;
|
||||
}
|
||||
g_object_set_data(G_OBJECT(mw),"call_logs",NULL);
|
||||
gtk_widget_destroy(w);
|
||||
}
|
||||
683
gtk/chat.c
|
|
@ -1,683 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
#include <bctoolbox/vfs.h>
|
||||
|
||||
#ifdef HAVE_GTK_OSX
|
||||
#include <gtkosxapplication.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(F_OK)
|
||||
#define F_OK 00 /*visual studio does not define F_OK*/
|
||||
#endif
|
||||
|
||||
#define NB_MSG_HIST 250000
|
||||
|
||||
#define CONFIG_FILE ".linphone-history.db"
|
||||
|
||||
#include "regex.h"
|
||||
|
||||
GRegex *uri_regex = NULL;
|
||||
|
||||
static void free_uri_regex(void) {
|
||||
if(uri_regex) g_regex_unref(uri_regex);
|
||||
}
|
||||
|
||||
static const GRegex *get_uri_regex(void) {
|
||||
const gchar *pattern = BC_REGEX_URI;
|
||||
GError *error = NULL;
|
||||
if(uri_regex == NULL) {
|
||||
uri_regex = g_regex_new(pattern, G_REGEX_OPTIMIZE, 0, &error);
|
||||
if(error) {
|
||||
g_warning("Could not parse regex pattern for URIs: %s", error->message);
|
||||
g_error_free(error);
|
||||
uri_regex = NULL;
|
||||
return NULL;
|
||||
}
|
||||
atexit(free_uri_regex);
|
||||
}
|
||||
return uri_regex;
|
||||
}
|
||||
|
||||
char *linphone_gtk_message_storage_get_db_file(const char *filename){
|
||||
const int path_max=1024;
|
||||
char *db_file=NULL;
|
||||
|
||||
db_file=(char *)g_malloc(path_max*sizeof(char));
|
||||
if (filename==NULL) filename=CONFIG_FILE;
|
||||
/*try accessing a local file first if exists*/
|
||||
if (bctbx_file_exist(CONFIG_FILE)==0){
|
||||
snprintf(db_file,path_max,"%s",filename);
|
||||
}else{
|
||||
#ifdef _WIN32
|
||||
const char *appdata=getenv("APPDATA");
|
||||
if (appdata){
|
||||
snprintf(db_file,path_max,"%s\\%s",appdata,LINPHONE_CONFIG_DIR);
|
||||
CreateDirectory(db_file,NULL);
|
||||
snprintf(db_file,path_max,"%s\\%s\\%s",appdata,LINPHONE_CONFIG_DIR,filename);
|
||||
}
|
||||
#else
|
||||
const char *home=getenv("HOME");
|
||||
if (home==NULL) home=".";
|
||||
snprintf(db_file,path_max,"%s/%s",home,filename);
|
||||
#endif
|
||||
}
|
||||
return db_file;
|
||||
}
|
||||
|
||||
void linphone_gtk_mark_chat_read(LinphoneChatRoom *cr) {
|
||||
linphone_chat_room_mark_as_read(cr);
|
||||
#ifdef __APPLE__
|
||||
linphone_gtk_update_badge_count();
|
||||
#endif
|
||||
}
|
||||
|
||||
void linphone_gtk_quit_chatroom(LinphoneChatRoom *cr) {
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window ();
|
||||
GtkWidget *nb=linphone_gtk_get_widget(main_window,"viewswitch");
|
||||
GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list");
|
||||
GtkWidget *w=g_object_get_data(G_OBJECT(friendlist),"chatview");
|
||||
gchar *from;
|
||||
|
||||
g_return_if_fail(w!=NULL);
|
||||
gtk_notebook_remove_page(GTK_NOTEBOOK(nb),gtk_notebook_page_num(GTK_NOTEBOOK(nb),w));
|
||||
linphone_gtk_mark_chat_read(cr);
|
||||
g_object_set_data(G_OBJECT(friendlist),"chatview",NULL);
|
||||
from=g_object_get_data(G_OBJECT(w),"from_message");
|
||||
if (from){
|
||||
g_object_set_data(G_OBJECT(w),"from_message",NULL);
|
||||
g_free(from);
|
||||
}
|
||||
g_object_set_data(G_OBJECT(w),"cr",NULL);
|
||||
linphone_gtk_friend_list_set_active_address(NULL);
|
||||
gtk_widget_destroy(w);
|
||||
}
|
||||
|
||||
const char* get_display_name(const LinphoneAddress *from){
|
||||
const char *display;
|
||||
display=linphone_address_get_display_name(from);
|
||||
if (display==NULL || display[0]=='\0') {
|
||||
display=linphone_address_get_username(from);
|
||||
}
|
||||
return display;
|
||||
}
|
||||
|
||||
GtkWidget *create_tab_chat_header(LinphoneChatRoom *cr, const LinphoneAddress *uri){
|
||||
GtkWidget *tab_header = linphone_gtk_make_tab_header(get_display_name(uri), "linphone-start-chat", TRUE, G_CALLBACK(linphone_gtk_quit_chatroom), cr);
|
||||
gtk_widget_show_all(tab_header);
|
||||
return tab_header;
|
||||
}
|
||||
|
||||
void update_chat_header(GtkNotebook *notebook, GtkWidget *chat_view, LinphoneChatRoom *cr, const LinphoneAddress *uri) {
|
||||
GtkWidget *header = linphone_gtk_make_tab_header(get_display_name(uri), "linphone-start-chat", TRUE, G_CALLBACK(linphone_gtk_quit_chatroom), cr);
|
||||
gtk_widget_show_all(header);
|
||||
gtk_notebook_set_tab_label(notebook, chat_view, header);
|
||||
}
|
||||
|
||||
static gboolean scroll_to_end(GtkTextView *w){
|
||||
GtkTextBuffer *buffer=gtk_text_view_get_buffer(w);
|
||||
GtkTextIter iter;
|
||||
gtk_text_buffer_get_end_iter(buffer,&iter);
|
||||
gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (w), &iter, 0.0, FALSE, 0, 0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void write_body(GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, gboolean is_me, gboolean is_link) {
|
||||
const char *me_tag_name = is_me ? "me" : NULL;
|
||||
const char *link_tag_name = is_link ? "link" : NULL;
|
||||
if(me_tag_name) {
|
||||
gtk_text_buffer_insert_with_tags_by_name(buffer, iter, text, len, "body", me_tag_name, link_tag_name, NULL);
|
||||
} else {
|
||||
gtk_text_buffer_insert_with_tags_by_name(buffer, iter, text, len, "body", link_tag_name, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from,
|
||||
gboolean me,LinphoneChatRoom *cr,LinphoneChatMessage *msg, gboolean hist){
|
||||
GtkTextView *text=GTK_TEXT_VIEW(linphone_gtk_get_widget(w,"textview"));
|
||||
GtkTextBuffer *buffer=gtk_text_view_get_buffer(text);
|
||||
GtkTextIter iter;
|
||||
char *from_str=linphone_address_as_string_uri_only(from);
|
||||
gchar *from_message=(gchar *)g_object_get_data(G_OBJECT(w),"from_message");
|
||||
GHashTable *table=(GHashTable*)g_object_get_data(G_OBJECT(w),"table");
|
||||
const GRegex *uri_regex = get_uri_regex();
|
||||
GMatchInfo *match_info = NULL;
|
||||
const char *message = linphone_chat_message_get_text(msg);
|
||||
const char *external_body_url = linphone_chat_message_get_external_body_url(msg);
|
||||
time_t t;
|
||||
char buf[80];
|
||||
time_t tnow;
|
||||
struct tm *tm;
|
||||
int tnow_day;
|
||||
int tnow_year;
|
||||
int pos = 0, start, end;
|
||||
|
||||
gtk_text_buffer_get_end_iter(buffer, &iter);
|
||||
if (g_strcmp0(from_message,from_str)!=0){
|
||||
gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, get_display_name(from), -1,
|
||||
"from", me ? "me" : NULL, NULL);
|
||||
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter, " : ", -1,
|
||||
"from", me ? "me" : NULL, NULL);
|
||||
gtk_text_buffer_insert(buffer,&iter,"\n",-1);
|
||||
g_free(from_message);
|
||||
g_object_set_data(G_OBJECT(w),"from_message",g_strdup(from_str));
|
||||
}
|
||||
ms_free(from_str);
|
||||
|
||||
if (external_body_url) message = external_body_url;
|
||||
|
||||
// Inserts message body and tags URIs as hypertext links
|
||||
if(message) {
|
||||
g_regex_match(uri_regex, message, 0, &match_info);
|
||||
while(g_match_info_matches(match_info)) {
|
||||
g_match_info_fetch_pos(match_info, 0, &start, &end);
|
||||
if(pos < start) write_body(buffer, &iter, &message[pos], start-pos, me, FALSE);
|
||||
write_body(buffer, &iter, &message[start], end-start, me, TRUE);
|
||||
pos = end;
|
||||
g_match_info_next(match_info, NULL);
|
||||
}
|
||||
if((size_t)pos < strlen(message)) write_body(buffer, &iter, &message[pos], -1, me, FALSE);
|
||||
gtk_text_buffer_insert(buffer,&iter,"\n",-1);
|
||||
g_match_info_free(match_info);
|
||||
}
|
||||
|
||||
g_hash_table_insert(table,GUINT_TO_POINTER(linphone_chat_message_get_storage_id(msg)),GINT_TO_POINTER(gtk_text_iter_get_line(&iter)));
|
||||
switch (linphone_chat_message_get_state (msg)){
|
||||
case LinphoneChatMessageStateInProgress:
|
||||
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,_("Sending..."),-1,"status", me ? "me" : NULL, NULL);
|
||||
break;
|
||||
case LinphoneChatMessageStateDelivered:
|
||||
t=linphone_chat_message_get_time(msg);
|
||||
tnow=time(NULL);
|
||||
tm=localtime(&tnow);
|
||||
tnow_day=tm->tm_yday;
|
||||
tnow_year=tm->tm_year;
|
||||
tm=localtime(&t);
|
||||
if(tnow_day != tm->tm_yday || (tnow_day == tm->tm_yday && tnow_year != tm->tm_year)) {
|
||||
strftime(buf,80,"%a %x, %H:%M",tm);
|
||||
} else {
|
||||
strftime(buf,80,"%H:%M:%S",tm);
|
||||
}
|
||||
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,buf,-1,"status", me ? "me" : NULL, NULL);
|
||||
break;
|
||||
case LinphoneChatMessageStateNotDelivered:
|
||||
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,_("Message not sent"),-1,"status", me ? "me" : NULL, NULL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
gtk_text_buffer_insert(buffer,&iter,"\n",-1);
|
||||
g_idle_add((GSourceFunc)scroll_to_end,text);
|
||||
}
|
||||
|
||||
void update_chat_state_message(LinphoneChatMessageState state,LinphoneChatMessage *msg){
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list");
|
||||
GtkWidget *page=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview");
|
||||
GHashTable *table=(GHashTable*)g_object_get_data(G_OBJECT(page),"table");
|
||||
|
||||
if (page!=NULL) {
|
||||
char buf[80];
|
||||
time_t t;
|
||||
struct tm *tm;
|
||||
GtkTextView *text=GTK_TEXT_VIEW(linphone_gtk_get_widget(page,"textview"));
|
||||
GtkTextBuffer *b=gtk_text_view_get_buffer(text);
|
||||
GtkTextIter iter;
|
||||
GtkTextIter end;
|
||||
GtkTextIter start;
|
||||
gint line;
|
||||
gpointer hash_table_ptr = g_hash_table_lookup(table,GUINT_TO_POINTER(linphone_chat_message_get_storage_id(msg)));
|
||||
if (hash_table_ptr != NULL) {
|
||||
line = GPOINTER_TO_INT(hash_table_ptr);
|
||||
gtk_text_buffer_get_iter_at_line(b,&iter,line);
|
||||
if(gtk_text_iter_get_chars_in_line(&iter) >0) {
|
||||
gtk_text_buffer_get_iter_at_line_offset(b,&start,line,
|
||||
gtk_text_iter_get_chars_in_line(&iter)-1);
|
||||
}else{
|
||||
gtk_text_buffer_get_iter_at_line_offset(b,&start,line,0);
|
||||
}
|
||||
gtk_text_buffer_get_iter_at_line_offset(b,&end,line,0);
|
||||
gtk_text_buffer_delete(b,&start,&end);
|
||||
gtk_text_buffer_get_iter_at_line(b,&iter,line);
|
||||
|
||||
switch (state) {
|
||||
case LinphoneChatMessageStateInProgress:
|
||||
gtk_text_buffer_insert_with_tags_by_name(b,&iter,_("Sending..."),-1,"status", "me", NULL);
|
||||
break;
|
||||
case LinphoneChatMessageStateDelivered:
|
||||
t=time(NULL);
|
||||
tm=localtime(&t);
|
||||
strftime(buf,80,"%H:%M:%S",tm);
|
||||
gtk_text_buffer_insert_with_tags_by_name(b,&iter,(gchar*)buf,-1,"status", "me", NULL);
|
||||
break;
|
||||
case LinphoneChatMessageStateNotDelivered:
|
||||
gtk_text_buffer_insert_with_tags_by_name(b,&iter,_("Message not sent"),-1,"status", "me", NULL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void on_chat_state_changed(LinphoneChatMessage *msg, LinphoneChatMessageState state){
|
||||
update_chat_state_message(state,msg);
|
||||
}
|
||||
|
||||
void linphone_gtk_compose_text(void) {
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list");
|
||||
GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview");
|
||||
LinphoneChatRoom *cr=g_object_get_data(G_OBJECT(w),"cr");
|
||||
if (cr) {
|
||||
linphone_chat_room_compose(cr);
|
||||
linphone_gtk_mark_chat_read(cr);
|
||||
linphone_gtk_friend_list_update_button_display(GTK_TREE_VIEW(friendlist));
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_send_text(void){
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list");
|
||||
GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview");
|
||||
GtkWidget *entry=linphone_gtk_get_widget(w,"text_entry");
|
||||
const gchar *entered;
|
||||
LinphoneChatRoom *cr=g_object_get_data(G_OBJECT(w),"cr");
|
||||
entered=gtk_entry_get_text(GTK_ENTRY(entry));
|
||||
if (strlen(entered)>0) {
|
||||
LinphoneChatMessage *msg;
|
||||
LinphoneChatMessageCbs *cbs;
|
||||
msg=linphone_chat_message_ref(linphone_chat_room_create_message(cr,entered));
|
||||
cbs=linphone_chat_message_get_callbacks(msg);
|
||||
linphone_chat_message_cbs_set_msg_state_changed(cbs,on_chat_state_changed);
|
||||
linphone_chat_room_send_chat_message(cr,msg);
|
||||
linphone_gtk_push_text(w,linphone_chat_message_get_from(msg),
|
||||
TRUE,cr,msg,FALSE);
|
||||
|
||||
// Disconnect and reconnect the "changed" signal to prevent triggering it when clearing the text entry.
|
||||
g_signal_handlers_disconnect_by_func(G_OBJECT(entry),(GCallback)linphone_gtk_compose_text,NULL);
|
||||
gtk_entry_set_text(GTK_ENTRY(entry),"");
|
||||
g_signal_connect_swapped(G_OBJECT(entry),"changed",(GCallback)linphone_gtk_compose_text,NULL);
|
||||
|
||||
linphone_chat_message_unref(msg);
|
||||
}
|
||||
}
|
||||
|
||||
static void linphone_gtk_chat_message_destroy(LinphoneChatMessage *msg){
|
||||
linphone_chat_message_destroy(msg);
|
||||
}
|
||||
|
||||
void linphone_gtk_free_list(bctbx_list_t *messages){
|
||||
bctbx_list_for_each(messages,(void (*)(void*))linphone_gtk_chat_message_destroy);
|
||||
bctbx_list_free(messages);
|
||||
}
|
||||
|
||||
void display_history_message(GtkWidget *chat_view,bctbx_list_t *messages,const LinphoneAddress *with){
|
||||
if (messages != NULL){
|
||||
bctbx_list_t *it;
|
||||
char *from_str;
|
||||
char *with_str;
|
||||
gchar *tmp;
|
||||
for(it=messages;it!=NULL;it=it->next){
|
||||
LinphoneChatMessage *msg=(LinphoneChatMessage *)it->data;
|
||||
from_str=linphone_address_as_string_uri_only(linphone_chat_message_get_from(msg));
|
||||
with_str=linphone_address_as_string_uri_only(with);
|
||||
linphone_gtk_push_text(chat_view,strcmp(from_str,with_str)==0? with :
|
||||
linphone_chat_message_get_from(msg),
|
||||
strcmp(from_str,with_str)==0? FALSE : TRUE,
|
||||
linphone_chat_message_get_chat_room(msg),msg,TRUE);
|
||||
ms_free(from_str);
|
||||
ms_free(with_str);
|
||||
}
|
||||
tmp=g_object_get_data(G_OBJECT(chat_view),"from_message");
|
||||
if (tmp){
|
||||
g_object_set_data(G_OBJECT(chat_view),"from_message",NULL);
|
||||
g_free(tmp);
|
||||
}
|
||||
|
||||
linphone_gtk_free_list(messages);
|
||||
}
|
||||
}
|
||||
|
||||
static void linphone_gtk_chat_add_contact(const LinphoneAddress *addr){
|
||||
LinphoneFriend *lf=NULL;
|
||||
LinphoneCore *lc = linphone_gtk_get_core();
|
||||
gboolean show_presence=FALSE;
|
||||
char *uri=linphone_address_as_string(addr);
|
||||
|
||||
lf=linphone_core_create_friend_with_address(lc, uri);
|
||||
ms_free(uri);
|
||||
|
||||
linphone_friend_set_inc_subscribe_policy(lf,LinphoneSPWait);
|
||||
linphone_friend_send_subscribe(lf,show_presence);
|
||||
|
||||
linphone_friend_set_address(lf,addr);
|
||||
linphone_core_add_friend(lc, lf);
|
||||
linphone_gtk_show_friends();
|
||||
}
|
||||
|
||||
static GdkColor *_linphone_gtk_chatroom_get_link_color(GtkWidget *chatview) {
|
||||
GValue color_value = {0};
|
||||
g_value_init(&color_value, GDK_TYPE_COLOR);
|
||||
gtk_style_get_style_property(
|
||||
gtk_widget_get_style(chatview),
|
||||
G_OBJECT_TYPE(chatview),
|
||||
"link-color", &color_value);
|
||||
|
||||
return (GdkColor *)g_value_get_boxed(&color_value);
|
||||
}
|
||||
|
||||
static gboolean link_event_handler(GtkTextTag *tag, GObject *text_view,GdkEvent *event, GtkTextIter *iter, GtkWidget *chat_view) {
|
||||
if(event->type == GDK_BUTTON_PRESS) {
|
||||
GtkTextIter uri_begin = *iter;
|
||||
GtkTextIter uri_end = *iter;
|
||||
gchar *uri = NULL;
|
||||
LinphoneChatRoom *chat_room = (LinphoneChatRoom *)g_object_get_data(G_OBJECT(chat_view), "cr");
|
||||
GtkWidget *main_window = linphone_gtk_get_main_window();
|
||||
GtkWidget *friendlist = linphone_gtk_get_widget(main_window, "contact_list");
|
||||
|
||||
gtk_text_iter_backward_to_tag_toggle(&uri_begin, tag);
|
||||
gtk_text_iter_forward_to_tag_toggle(&uri_end, tag);
|
||||
uri = gtk_text_iter_get_slice(&uri_begin, &uri_end);
|
||||
if(((GdkEventButton *)event)->button == 1) {
|
||||
linphone_gtk_open_browser(uri);
|
||||
} else if(((GdkEventButton *)event)->button == 3) {
|
||||
GtkMenu *menu = GTK_MENU(g_object_get_data(text_view, "link_ctx_menu"));
|
||||
g_object_set_data_full(G_OBJECT(menu), "uri", g_strdup(uri), g_free);
|
||||
gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 3, gdk_event_get_time(event));
|
||||
}
|
||||
g_free(uri);
|
||||
|
||||
linphone_gtk_mark_chat_read(chat_room);
|
||||
linphone_gtk_friend_list_update_button_display(GTK_TREE_VIEW(friendlist));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void chatroom_enable_hand_cursor(GdkWindow *window, gboolean hand_cursor_enabled) {
|
||||
#if GTK_CHECK_VERSION(2,22,0)
|
||||
GdkCursor *cursor = gdk_window_get_cursor(window);
|
||||
GdkCursor *new_cursor = NULL;
|
||||
if(!hand_cursor_enabled && gdk_cursor_get_cursor_type(cursor) != GDK_XTERM) {
|
||||
new_cursor = gdk_cursor_new(GDK_XTERM);
|
||||
} else if(hand_cursor_enabled && gdk_cursor_get_cursor_type(cursor) != GDK_HAND1) {
|
||||
new_cursor = gdk_cursor_new(GDK_HAND1);
|
||||
}
|
||||
if(new_cursor) {
|
||||
gdk_window_set_cursor(window, new_cursor);
|
||||
gdk_cursor_unref(new_cursor);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static gboolean chatroom_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) {
|
||||
gint wx, wy, bx, by;
|
||||
GtkTextView *chatroom = GTK_TEXT_VIEW(widget);
|
||||
GtkTextBuffer *buffer = gtk_text_view_get_buffer(chatroom);
|
||||
GtkTextTag *link_tag = gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), "link");
|
||||
GdkWindow *window = gtk_text_view_get_window(chatroom, GTK_TEXT_WINDOW_TEXT);
|
||||
GtkTextIter iter;
|
||||
if(event->type == GDK_MOTION_NOTIFY) {
|
||||
GdkEventMotion *motion_ev = (GdkEventMotion *)event;
|
||||
wx = (gint)motion_ev->x;
|
||||
wy = (gint)motion_ev->y;
|
||||
gtk_text_view_window_to_buffer_coords(chatroom, GTK_TEXT_WINDOW_TEXT, wx, wy, &bx, &by);
|
||||
gtk_text_view_get_iter_at_location(chatroom, &iter, bx, by);
|
||||
if(gtk_text_iter_has_tag(&iter, link_tag)) {
|
||||
chatroom_enable_hand_cursor(window, TRUE);
|
||||
} else {
|
||||
chatroom_enable_hand_cursor(window, FALSE);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean copy_uri_into_clipboard_handler(GtkMenuItem *menuitem, gpointer user_data) {
|
||||
GtkWidget *menu = gtk_widget_get_parent(GTK_WIDGET(menuitem));
|
||||
const gchar *uri = (const gchar *)g_object_get_data(G_OBJECT(menu), "uri");
|
||||
GtkClipboard *clipboard = NULL;
|
||||
GdkAtom clipboard_atom = gdk_atom_intern("CLIPBOARD", TRUE);
|
||||
if(clipboard_atom == GDK_NONE) {
|
||||
g_warning("Could not find CLIPBOARD atom");
|
||||
return FALSE;
|
||||
}
|
||||
clipboard = gtk_clipboard_get(clipboard_atom);
|
||||
if(uri) gtk_clipboard_set_text(clipboard, uri, -1);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void refresh_lime_icon(GtkWidget* chat_view, LinphoneChatRoom*cr) {
|
||||
GtkWidget *lime_icon = linphone_gtk_get_widget(chat_view, "lime_icon");
|
||||
if (linphone_chat_room_lime_available(cr)) {
|
||||
gtk_widget_show(lime_icon);
|
||||
} else {
|
||||
gtk_widget_hide(lime_icon);
|
||||
}
|
||||
}
|
||||
|
||||
static gint linphone_gtk_window_focused(GtkWidget* widget, GdkEvent *event, gpointer user_data) {
|
||||
// if we are in a chat, mark it as read
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list");
|
||||
GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview");
|
||||
LinphoneChatRoom *cr=w?g_object_get_data(G_OBJECT(w),"cr"):NULL;
|
||||
if (cr) {
|
||||
linphone_gtk_mark_chat_read(cr);
|
||||
}
|
||||
refresh_lime_icon(w, cr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GtkWidget* linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddress *with){
|
||||
GtkWidget *chat_view=linphone_gtk_create_widget("chatroom_frame");
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
|
||||
GtkWidget *text=linphone_gtk_get_widget(chat_view,"textview");
|
||||
GdkColor color_grey = {0, 32512, 32512, 32512};
|
||||
GdkColor color_light_grey = {0, 56832, 60928, 61952};
|
||||
GdkColor color_black = {0};
|
||||
int idx;
|
||||
GtkWidget *button;
|
||||
GtkWidget *entry = linphone_gtk_get_widget(chat_view,"text_entry");
|
||||
bctbx_list_t *messages;
|
||||
GHashTable *table;
|
||||
GtkTextTag *tmp_tag;
|
||||
GtkWidget *link_ctx_menu = gtk_menu_new();
|
||||
GtkWidget *link_ctx_menu_copy_item = gtk_menu_item_new_with_label(_("Copy"));
|
||||
|
||||
gtk_notebook_append_page(notebook,chat_view,create_tab_chat_header(cr,with));
|
||||
idx = gtk_notebook_page_num(notebook, chat_view);
|
||||
gtk_notebook_set_current_page(notebook, idx);
|
||||
gtk_widget_show(chat_view);
|
||||
table=g_hash_table_new_full(g_direct_hash,g_direct_equal,NULL,NULL);
|
||||
g_object_set_data(G_OBJECT(chat_view),"cr",cr);
|
||||
g_object_set_data(G_OBJECT(chat_view),"from_message",NULL);
|
||||
g_object_set_data_full(G_OBJECT(chat_view),"table",table,(GDestroyNotify)g_hash_table_destroy);
|
||||
|
||||
gtk_text_buffer_create_tag(
|
||||
gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)),
|
||||
"me",
|
||||
"foreground_gdk", &color_black,
|
||||
"paragraph-background-gdk", &color_light_grey,
|
||||
NULL);
|
||||
|
||||
gtk_text_buffer_create_tag(
|
||||
gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)),
|
||||
"from",
|
||||
"weight", PANGO_WEIGHT_BOLD,
|
||||
NULL);
|
||||
|
||||
gtk_text_buffer_create_tag(
|
||||
gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)),
|
||||
"body",
|
||||
"indent", 10,
|
||||
NULL);
|
||||
|
||||
gtk_text_buffer_create_tag(
|
||||
gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)),
|
||||
"status",
|
||||
"size-points", 9.0,
|
||||
"foreground_gdk", &color_grey,
|
||||
"style", PANGO_STYLE_ITALIC,
|
||||
"justification", GTK_JUSTIFY_RIGHT,
|
||||
NULL);
|
||||
|
||||
tmp_tag = gtk_text_buffer_create_tag(
|
||||
gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)),
|
||||
"link",
|
||||
"underline", PANGO_UNDERLINE_SINGLE,
|
||||
"foreground_gdk", _linphone_gtk_chatroom_get_link_color(chat_view),
|
||||
NULL);
|
||||
g_signal_connect(G_OBJECT(tmp_tag), "event", G_CALLBACK(link_event_handler), chat_view);
|
||||
g_signal_connect(G_OBJECT(text), "event", G_CALLBACK(chatroom_event), NULL);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(link_ctx_menu), link_ctx_menu_copy_item);
|
||||
g_signal_connect(G_OBJECT(link_ctx_menu_copy_item), "activate", G_CALLBACK(copy_uri_into_clipboard_handler), NULL);
|
||||
gtk_widget_show_all(link_ctx_menu);
|
||||
g_object_set_data_full(G_OBJECT(text), "link_ctx_menu", link_ctx_menu, g_object_unref);
|
||||
g_object_ref_sink(G_OBJECT(link_ctx_menu));
|
||||
|
||||
messages = linphone_chat_room_get_history(cr,NB_MSG_HIST);
|
||||
display_history_message(chat_view,messages,with);
|
||||
button = linphone_gtk_get_widget(chat_view,"send");
|
||||
g_signal_connect_swapped(G_OBJECT(button),"clicked",(GCallback)linphone_gtk_send_text,NULL);
|
||||
|
||||
g_signal_connect_swapped(G_OBJECT(entry),"activate",(GCallback)linphone_gtk_send_text,NULL);
|
||||
g_signal_connect_swapped(G_OBJECT(entry),"changed",(GCallback)linphone_gtk_compose_text,NULL);
|
||||
g_signal_connect(G_OBJECT(notebook),"switch_page",(GCallback)linphone_gtk_notebook_tab_select,NULL);
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(main_window), "focus-in-event", GTK_SIGNAL_FUNC(linphone_gtk_window_focused), NULL);
|
||||
|
||||
refresh_lime_icon(chat_view, cr);
|
||||
|
||||
return chat_view;
|
||||
}
|
||||
|
||||
LinphoneChatRoom * linphone_gtk_create_chatroom(const LinphoneAddress *with){
|
||||
LinphoneChatRoom *cr=linphone_core_get_chat_room(linphone_gtk_get_core(), with);
|
||||
return cr;
|
||||
}
|
||||
|
||||
void linphone_gtk_load_chatroom(LinphoneChatRoom *cr,const LinphoneAddress *uri,GtkWidget *chat_view){
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window ();
|
||||
GtkWidget *notebook = linphone_gtk_get_widget(main_window, "viewswitch");
|
||||
LinphoneChatRoom *cr2=(LinphoneChatRoom *)g_object_get_data(G_OBJECT(chat_view),"cr");
|
||||
const LinphoneAddress *from=linphone_chat_room_get_peer_address(cr2);
|
||||
char *from_str=linphone_address_as_string_uri_only(from);
|
||||
char *uri_str=linphone_address_as_string(uri);
|
||||
char *uri_only=linphone_address_as_string_uri_only(uri);
|
||||
bctbx_list_t *messages=NULL;
|
||||
|
||||
if(g_strcmp0(from_str,uri_only)!=0){
|
||||
GtkTextView *text_view=GTK_TEXT_VIEW(linphone_gtk_get_widget(chat_view,"textview"));
|
||||
GtkTextIter start;
|
||||
GtkTextIter end;
|
||||
GtkTextBuffer *text_buffer;
|
||||
|
||||
text_buffer=gtk_text_view_get_buffer(text_view);
|
||||
gtk_text_buffer_get_bounds(text_buffer, &start, &end);
|
||||
gtk_text_buffer_delete (text_buffer, &start, &end);
|
||||
update_chat_header(GTK_NOTEBOOK(notebook), chat_view, cr, uri);
|
||||
g_object_set_data(G_OBJECT(chat_view),"cr",cr);
|
||||
g_object_set_data(G_OBJECT(linphone_gtk_get_widget(main_window,"contact_list")),"chatview",(gpointer)chat_view);
|
||||
messages=linphone_chat_room_get_history(cr,NB_MSG_HIST);
|
||||
g_object_set_data(G_OBJECT(chat_view),"from_message",g_strdup(uri_str));
|
||||
display_history_message(chat_view,messages,uri);
|
||||
gtk_text_buffer_get_end_iter(text_buffer,&end);
|
||||
gtk_text_view_scroll_to_iter(text_view,&end,0,FALSE,1.0,0);
|
||||
}
|
||||
refresh_lime_icon(chat_view, cr);
|
||||
|
||||
ms_free(from_str);
|
||||
ms_free(uri_str);
|
||||
ms_free(uri_only);
|
||||
}
|
||||
|
||||
void linphone_gtk_chat_destroyed(GtkWidget *w){
|
||||
/*
|
||||
LinphoneChatRoom *cr=(LinphoneChatRoom*)g_object_get_data(G_OBJECT(w),"cr");
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void linphone_gtk_text_received ( LinphoneCore *lc, LinphoneChatRoom *room,
|
||||
LinphoneChatMessage *msg ) {
|
||||
GtkWidget *main_window=linphone_gtk_get_main_window();
|
||||
GtkWidget *friendlist=linphone_gtk_get_widget ( main_window,"contact_list" );
|
||||
GtkWidget *w;
|
||||
gboolean send=TRUE;
|
||||
/*GtkNotebook *notebook= ( GtkNotebook * ) linphone_gtk_get_widget ( main_window,"viewswitch" );*/
|
||||
const LinphoneAddress *from= linphone_chat_message_get_from ( msg );
|
||||
|
||||
w= ( GtkWidget* ) g_object_get_data ( G_OBJECT ( friendlist ),"chatview" );
|
||||
if ( w!=NULL ) {
|
||||
/* Chat window opened */
|
||||
const LinphoneAddress *from_chatview=linphone_gtk_friend_list_get_active_address();
|
||||
if (linphone_address_weak_equal(from,from_chatview)) {
|
||||
send=TRUE;
|
||||
} else {
|
||||
if ( !linphone_gtk_friend_list_is_contact ( linphone_chat_message_get_from ( msg ) ) ) {
|
||||
linphone_gtk_chat_add_contact ( linphone_chat_message_get_from ( msg ) );
|
||||
}
|
||||
send=FALSE;
|
||||
}
|
||||
} else {
|
||||
/* Chat window closed */
|
||||
#ifdef SQLITE_STORAGE_ENABLED
|
||||
send=FALSE;
|
||||
#else
|
||||
send=TRUE;
|
||||
#endif
|
||||
if ( !linphone_gtk_friend_list_is_contact ( linphone_chat_message_get_from ( msg ) ) ) {
|
||||
linphone_gtk_chat_add_contact ( linphone_chat_message_get_from ( msg ) );
|
||||
}
|
||||
w=linphone_gtk_init_chatroom ( room,linphone_chat_message_get_from ( msg ) );
|
||||
g_object_set_data ( G_OBJECT ( friendlist ),"chatview", ( gpointer ) w );
|
||||
linphone_gtk_friend_list_set_active_address(from);
|
||||
}
|
||||
|
||||
#ifdef HAVE_GTK_OSX
|
||||
/* Notified when a new message is sent */
|
||||
linphone_gtk_status_icon_set_blinking ( TRUE );
|
||||
#else
|
||||
if ( !gtk_window_is_active ( GTK_WINDOW ( main_window ) ) ) {
|
||||
if ( !GPOINTER_TO_INT ( g_object_get_data ( G_OBJECT ( w ),"is_notified" ) ) ) {
|
||||
linphone_gtk_notify ( NULL, msg, NULL );
|
||||
g_object_set_data ( G_OBJECT ( w ),"is_notified",GINT_TO_POINTER ( TRUE ) );
|
||||
} else {
|
||||
g_object_set_data ( G_OBJECT ( w ),"is_notified",GINT_TO_POINTER ( FALSE ) );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if ( send ) {
|
||||
linphone_gtk_push_text ( w,linphone_chat_message_get_from ( msg ),
|
||||
FALSE,room,msg,FALSE );
|
||||
}
|
||||
linphone_core_play_local(lc,linphone_gtk_get_sound_path("incoming_chat.wav"));
|
||||
linphone_gtk_show_friends();
|
||||
|
||||
}
|
||||
|
||||
void linphone_gtk_is_composing_received(LinphoneCore *lc, LinphoneChatRoom *room) {
|
||||
GtkWidget *main_window = linphone_gtk_get_main_window();
|
||||
GtkWidget *friendlist = linphone_gtk_get_widget(main_window, "contact_list");
|
||||
linphone_gtk_friend_list_update_button_display(GTK_TREE_VIEW(friendlist));
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.18"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkFrame" id="chatroom_frame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="border_width">4</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">word-char</property>
|
||||
<property name="cursor_visible">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox10">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="lime_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="pixel_size">16</property>
|
||||
<property name="icon_name">linphone-security-ok</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="text_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="send">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox11">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="send_picture">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">linphone-chat-send</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Send</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">7</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.24"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkFrame" id="conf_frame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="conf_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkHButtonBox" id="button_conf">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="terminate_conf">
|
||||
<property name="label" translatable="yes">End conference</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="conf_record_hbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="conf_record_button">
|
||||
<property name="label" translatable="yes">Record</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_record_call_toggled" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="conf_record_status">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="wrap_mode">char</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
183
gtk/conference.c
|
|
@ -1,183 +0,0 @@
|
|||
/***************************************************************************
|
||||
* gtk/conference.c
|
||||
*
|
||||
* Mon Sep 12, 2011
|
||||
* Copyright 2011 Belledonne Communications
|
||||
* Author: Simon Morlat
|
||||
* Email simon dot morlat at linphone dot 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.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
#define PADDING_PIXELS 4
|
||||
|
||||
/*
|
||||
* conferencee_box = a vbox where participants are added or removed
|
||||
* conf_frame = the conference tab
|
||||
*/
|
||||
|
||||
static GtkWidget *create_conference_label(void){
|
||||
GtkWidget *box=gtk_hbox_new(FALSE,0);
|
||||
gtk_box_pack_start(GTK_BOX(box),gtk_image_new_from_icon_name("linphone-conference-start",GTK_ICON_SIZE_MENU),FALSE,FALSE,0);
|
||||
gtk_box_pack_end(GTK_BOX(box),gtk_label_new(_("Conference")),TRUE,FALSE,0);
|
||||
gtk_widget_show_all(box);
|
||||
return box;
|
||||
}
|
||||
|
||||
static void init_local_participant(GtkWidget *participant){
|
||||
GtkWidget *sound_meter;
|
||||
GtkWidget *button=linphone_gtk_get_widget(participant,"conference_control");
|
||||
gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(participant,"callee_name_label")),_("Me"));
|
||||
sound_meter=linphone_gtk_get_widget(participant,"sound_indicator");
|
||||
linphone_gtk_enable_mute_button(GTK_BUTTON(button),TRUE);
|
||||
g_signal_connect(G_OBJECT(button),"clicked",(GCallback)linphone_gtk_mute_clicked,NULL);
|
||||
gtk_widget_show(button);
|
||||
linphone_gtk_init_audio_meter(sound_meter, (get_volume_t) linphone_core_get_conference_local_input_volume, linphone_gtk_get_core());
|
||||
}
|
||||
|
||||
static GtkWidget *get_conferencee_box(GtkWidget *mw){
|
||||
GtkWidget *box=(GtkWidget*)g_object_get_data(G_OBJECT(mw),"conferencee_box");
|
||||
return box;
|
||||
}
|
||||
|
||||
static GtkWidget *find_conferencee_from_call(LinphoneCall *call){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *conferencee_box=get_conferencee_box(mw);
|
||||
GList *elem;
|
||||
GtkWidget *ret=NULL;
|
||||
|
||||
if (conferencee_box==NULL) return NULL;
|
||||
|
||||
if (call!=NULL){
|
||||
GList *l=gtk_container_get_children(GTK_CONTAINER(conferencee_box));
|
||||
for(elem=l;elem!=NULL;elem=elem->next){
|
||||
GtkWidget *frame=(GtkWidget*)elem->data;
|
||||
if (call==g_object_get_data(G_OBJECT(frame),"call")){
|
||||
ret=frame;
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_list_free(l);
|
||||
}
|
||||
//g_message("find_conferencee_from_call(): found widget %p for call %p",ret,call);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static GtkWidget * create_conference_panel(void){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *conf_frame=linphone_gtk_create_widget("conf_frame");
|
||||
GtkWidget *conf_box=linphone_gtk_get_widget(conf_frame,"conf_box");
|
||||
GtkWidget *button_conf=linphone_gtk_get_widget(conf_frame,"terminate_conf");
|
||||
GtkWidget *image=gtk_image_new_from_icon_name("linphone-stop-call", GTK_ICON_SIZE_BUTTON);
|
||||
GtkWidget *box;
|
||||
GtkWidget *viewswitch=linphone_gtk_get_widget(mw,"viewswitch");
|
||||
GtkWidget *participant;
|
||||
GtkWidget *record = linphone_gtk_get_widget(conf_frame, "conf_record_button");
|
||||
|
||||
gtk_button_set_image(GTK_BUTTON(record), gtk_image_new_from_icon_name("linphone-record", GTK_ICON_SIZE_BUTTON));
|
||||
gtk_button_set_image(GTK_BUTTON(button_conf),image);
|
||||
g_signal_connect_swapped(G_OBJECT(button_conf),"clicked",(GCallback)linphone_gtk_terminate_call,NULL);
|
||||
g_object_set_data(G_OBJECT(mw),"conf_frame",(gpointer)conf_frame);
|
||||
|
||||
box=gtk_vbox_new(FALSE,0);
|
||||
participant=linphone_gtk_create_widget("callee_frame");
|
||||
gtk_widget_show(participant);
|
||||
gtk_box_set_homogeneous(GTK_BOX(box),TRUE);
|
||||
init_local_participant(participant);
|
||||
gtk_box_pack_start(GTK_BOX(box),participant,FALSE,FALSE,PADDING_PIXELS);
|
||||
gtk_widget_show(box);
|
||||
g_object_set_data(G_OBJECT(mw),"conferencee_box",box);
|
||||
gtk_box_pack_start(GTK_BOX(conf_box),box,FALSE,FALSE,PADDING_PIXELS);
|
||||
|
||||
gtk_notebook_append_page(GTK_NOTEBOOK(viewswitch),conf_frame,
|
||||
create_conference_label());
|
||||
return conf_frame;
|
||||
}
|
||||
|
||||
void linphone_gtk_set_in_conference(LinphoneCall *call){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(mw),"conf_frame");
|
||||
GtkWidget *viewswitch=linphone_gtk_get_widget(mw,"viewswitch");
|
||||
GtkWidget *participant;
|
||||
|
||||
if(conf_frame==NULL){
|
||||
conf_frame=create_conference_panel();
|
||||
}
|
||||
participant=find_conferencee_from_call(call);
|
||||
|
||||
if (participant==NULL){
|
||||
/*create and add it */
|
||||
GtkWidget *conferencee_box=get_conferencee_box(mw);
|
||||
GtkWidget *sound_meter;
|
||||
const LinphoneAddress *addr=linphone_call_get_remote_address(call);
|
||||
gchar *markup;
|
||||
|
||||
participant=linphone_gtk_create_widget("callee_frame");
|
||||
gtk_widget_show(participant);
|
||||
if (linphone_address_get_display_name(addr)!=NULL){
|
||||
markup=g_strdup_printf("<b>%s</b>",linphone_address_get_display_name(addr));
|
||||
}else{
|
||||
char *tmp=linphone_address_as_string_uri_only(addr);
|
||||
markup=g_strdup_printf("%s",tmp);
|
||||
ms_free(tmp);
|
||||
}
|
||||
gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(participant,"callee_name_label")),markup);
|
||||
g_free(markup);
|
||||
sound_meter=linphone_gtk_get_widget(participant,"sound_indicator");
|
||||
linphone_gtk_init_audio_meter(sound_meter, (get_volume_t) linphone_call_get_play_volume, call);
|
||||
gtk_box_pack_start(GTK_BOX(conferencee_box),participant,FALSE,FALSE,PADDING_PIXELS);
|
||||
g_object_set_data_full(G_OBJECT(participant),"call",linphone_call_ref(call),(GDestroyNotify)linphone_call_unref);
|
||||
gtk_notebook_set_current_page(GTK_NOTEBOOK(viewswitch),
|
||||
gtk_notebook_page_num(GTK_NOTEBOOK(viewswitch),conf_frame));
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_terminate_conference_participant(LinphoneCall *call){
|
||||
GtkWidget *frame=find_conferencee_from_call(call);
|
||||
if (frame){
|
||||
gtk_widget_set_sensitive(frame,FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_unset_from_conference(LinphoneCall *call){
|
||||
GtkWidget *frame=find_conferencee_from_call(call);
|
||||
|
||||
if (frame){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(mw),"conf_frame");
|
||||
GtkWidget *conferencee_box=g_object_get_data(G_OBJECT(mw),"conferencee_box");
|
||||
GList *children;
|
||||
|
||||
g_message("Removing a participant from conference");
|
||||
gtk_widget_destroy(frame);
|
||||
children=gtk_container_get_children(GTK_CONTAINER(conferencee_box));
|
||||
if (g_list_length(children)==1){ /* only local participant */
|
||||
/*the conference is terminated */
|
||||
g_message("The conference is terminated");
|
||||
g_object_set_data(G_OBJECT(mw),"conferencee_box",NULL);
|
||||
gtk_widget_destroy(conf_frame);
|
||||
g_object_set_data(G_OBJECT(mw),"conf_frame",NULL);
|
||||
}
|
||||
g_list_free(children);
|
||||
}
|
||||
}
|
||||
|
||||
bool_t linphone_gtk_call_is_in_conference_view(LinphoneCall *call) {
|
||||
return (find_conferencee_from_call(call) != NULL);
|
||||
}
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
#include "linphone/lpconfig.h"
|
||||
|
||||
|
||||
void linphone_gtk_set_configuration_uri(void){
|
||||
GtkWidget *w=linphone_gtk_create_window("config-uri", linphone_gtk_get_main_window());
|
||||
GtkWidget *entry=linphone_gtk_get_widget(w,"uri_entry");
|
||||
const char *uri=linphone_core_get_provisioning_uri(linphone_gtk_get_core());
|
||||
if (uri) gtk_entry_set_text(GTK_ENTRY(entry),uri);
|
||||
gtk_widget_show(w);
|
||||
}
|
||||
|
||||
void linphone_gtk_config_uri_changed(GtkWidget *button){
|
||||
GtkWidget *w=gtk_widget_get_toplevel(button);
|
||||
GtkWidget *entry=linphone_gtk_get_widget(w,"uri_entry");
|
||||
const char *uri=gtk_entry_get_text(GTK_ENTRY(entry));
|
||||
|
||||
if (uri && (strlen(uri)==0 || strcmp(uri,"https://")==0)) uri=NULL;
|
||||
|
||||
if(linphone_core_set_provisioning_uri(linphone_gtk_get_core(),uri) == 0) {
|
||||
gtk_widget_destroy(w);
|
||||
if (uri){
|
||||
#ifndef _WIN32
|
||||
linphone_gtk_schedule_restart();
|
||||
gtk_main_quit();
|
||||
#else
|
||||
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(linphone_gtk_get_main_window()),
|
||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
_("Remote provisioning URI successfully set. Please restart Linphone in order to load the new remote settings"));
|
||||
g_signal_connect_swapped(G_OBJECT(dialog), "response", G_CALLBACK(gtk_widget_destroy), dialog);
|
||||
gtk_widget_show(dialog);
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(w),
|
||||
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("Invalid remote provisioning URI"));
|
||||
g_signal_connect_swapped(G_OBJECT(dialog), "response", G_CALLBACK(gtk_widget_destroy), dialog);
|
||||
gtk_widget_show(dialog);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_config_uri_cancel(GtkWidget *button){
|
||||
GtkWidget *w=gtk_widget_get_toplevel(button);
|
||||
gtk_widget_destroy(w);
|
||||
}
|
||||
|
||||
GtkWidget * linphone_gtk_show_config_fetching(void){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
GtkWidget *w=linphone_gtk_create_window("provisioning-fetch", linphone_gtk_get_main_window());
|
||||
g_message("Fetching started");
|
||||
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(w),_("fetching from %s"),linphone_core_get_provisioning_uri(lc));
|
||||
#if GTK_CHECK_VERSION(2,20,0)
|
||||
{
|
||||
GtkWidget *spinner=gtk_spinner_new();
|
||||
gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(w),spinner);
|
||||
}
|
||||
#endif
|
||||
gtk_widget_show(w);
|
||||
return w;
|
||||
}
|
||||
|
||||
void linphone_gtk_close_config_fetching(GtkWidget *w, LinphoneConfiguringState state){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
gtk_widget_destroy(w);
|
||||
g_message("Fetching finished");
|
||||
if (state==LinphoneConfiguringFailed){
|
||||
GtkWidget *msg=gtk_message_dialog_new(NULL,0,GTK_MESSAGE_ERROR,GTK_BUTTONS_CLOSE,_("Downloading of remote configuration from %s failed."),
|
||||
linphone_core_get_provisioning_uri(lc));
|
||||
g_signal_connect(G_OBJECT(msg),"response",(GCallback)gtk_widget_destroy,NULL);
|
||||
gtk_widget_show(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.18"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkDialog" id="config-uri">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Specifying a remote configuration URI</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button2">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_config_uri_cancel" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_config_uri_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">This dialog allows to set an http or https address when configuration is to be fetched at startup.
|
||||
Please enter or modify the configuration URI below. After clicking OK, Linphone will restart automatically in order to fetch and take into account the new configuration. </property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="width_chars">80</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="uri_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="text">https://</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="0">button2</action-widget>
|
||||
<action-widget response="0">button1</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
216
gtk/contact.ui
|
|
@ -1,216 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.16"/>
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<object class="GtkDialog" id="contact">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="cancel_button">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_contact_cancel" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="ok_button">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_contact_ok" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame17">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment17">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox13">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label45">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Name</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label46">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">SIP Address</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="name">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="sip_address">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="show_presence">
|
||||
<property name="label" translatable="yes">Show this contact presence status</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="allow_presence">
|
||||
<property name="label" translatable="yes">Allow this contact to see my presence status</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label47">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes"><b>Contact information</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="0">cancel_button</action-widget>
|
||||
<action-widget response="0">ok_button</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.18"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkDialog" id="dscp_settings">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">DSCP settings</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="response" handler="linphone_gtk_dscp_edit_response" swapped="no"/>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button2">
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="sip_dscp">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="audio_dscp">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="video_dscp">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">SIP</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Audio RTP stream</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Video RTP stream</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Set DSCP values (in hexadecimal)</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">button2</action-widget>
|
||||
<action-widget response="-5">button1</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
22
gtk/fonis.c
|
|
@ -1,22 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
1104
gtk/friendlist.c
|
|
@ -1,4 +0,0 @@
|
|||
#include "share/themes/XLiquid_GTK-1.0.3/gtk-2.0/gtkrc"
|
||||
#include "share/themes/Aero-ion3.1/gtk-2.0/gtkrc"
|
||||
include "share/themes/Outcrop/gtk-2.0/gtkrc"
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
include "../../share/themes/Quartz/gtk-2.0/gtkrc"
|
||||
|
|
@ -1,433 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.24"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkImage" id="zrtp_button_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="pixel_size">16</property>
|
||||
<property name="icon_name">linphone-security-pending</property>
|
||||
</object>
|
||||
<object class="GtkFrame" id="in_call_frame">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="extension_events">cursor</property>
|
||||
<property name="label_xalign">0.5</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<property name="right_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="in_call_uri">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVBox" id="in_call_animation">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="zrtp_box">
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="zrtp_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">zrtp_button_icon</property>
|
||||
<property name="relief">none</property>
|
||||
<signal name="clicked" handler="linphone_gtk_auth_token_verified_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="encryption_status_box">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="encryption_status_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="pixel_size">16</property>
|
||||
<property name="icon_name">linphone-security-ok</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="encryption_status_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label">Encryption status</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="incall_audioview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="incall_mic_vol_control">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkVolumeButton" id="incall_mic_vol_ctrl_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="icons">linphone-micro-enabled</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="mic_audiolevel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">10</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="incall_spk_vol_control">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkVolumeButton" id="incall_spk_vol_ctrl_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Click here to set the speakers volume</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="icons">linphone-speaker-enabled</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="spk_audiolevel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">10</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHButtonBox" id="answer_decline_panel">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">spread</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="accept_call">
|
||||
<property name="label" translatable="yes">Answer</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_answer_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="decline_call">
|
||||
<property name="label" translatable="yes">Decline</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_decline_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="record_hbox">
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="record_button">
|
||||
<property name="label" translatable="yes">Record</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Record this call to an audio file</property>
|
||||
<signal name="toggled" handler="linphone_gtk_record_call_toggled" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="record_status">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="wrap_mode">char</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTable" id="buttons_panel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">3</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="video_button">
|
||||
<property name="label" translatable="yes">Video</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="hold_call">
|
||||
<property name="label" translatable="yes">Pause</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_hold_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="incall_mute">
|
||||
<property name="label" translatable="yes">Mute</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_mute_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="transfer_button">
|
||||
<property name="label" translatable="yes">Transfer</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="terminate_call">
|
||||
<property name="label" translatable="yes">Hang up</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_terminate_call" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="conference_button">
|
||||
<property name="label" translatable="yes">Conference</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="padding">7</property>
|
||||
<property name="position">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkHBox" id="heading_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="in_call_status">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">In call</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="in_call_duration">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Duration</property>
|
||||
<property name="justify">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="quality_indicator">
|
||||
<property name="width_request">90</property>
|
||||
<property name="height_request">10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
|
||||
<property name="tooltip_text" translatable="yes">Call quality rating</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
1027
gtk/incall_view.c
265
gtk/keypad.ui
|
|
@ -1,265 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.16"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkWindow" id="keypad">
|
||||
<property name="can_focus">False</property>
|
||||
<signal name="delete-event" handler="linphone_gtk_keypad_destroyed_handler" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
|
||||
<property name="label_xalign">0.5</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<signal name="key-release-event" handler="linphone_gtk_keypad_key_released" swapped="no"/>
|
||||
<signal name="key-press-event" handler="linphone_gtk_keypad_key_pressed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkAspectFrame" id="aspectframe1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="dtmf_table">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">4</property>
|
||||
<property name="n_rows">4</property>
|
||||
<property name="n_columns">4</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_D">
|
||||
<property name="label">D</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_#">
|
||||
<property name="label">#</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_0">
|
||||
<property name="label">0</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_*">
|
||||
<property name="label">*</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_C">
|
||||
<property name="label">C</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_9">
|
||||
<property name="label">9</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_8">
|
||||
<property name="label">8</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_7">
|
||||
<property name="label">7</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_B">
|
||||
<property name="label">B</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_6">
|
||||
<property name="label">6</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_5">
|
||||
<property name="label">5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_4">
|
||||
<property name="label">4</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_A">
|
||||
<property name="label">A</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_3">
|
||||
<property name="label">3</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_2">
|
||||
<property name="label">2</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="dtmf_1">
|
||||
<property name="label">1</property>
|
||||
<property name="width_request">40</property>
|
||||
<property name="height_request">40</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label_item">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
669
gtk/ldap.ui
|
|
@ -1,669 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.16"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkWindow" id="ldap">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">LDAP Settings</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="ldap_tab">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="ldap_connection_frame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">5</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label41">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xpad">1</property>
|
||||
<property name="label" translatable="yes">Server address:</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label43">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Authentication method:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label44">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Username:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label45">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Password:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="ldap_use_tls">
|
||||
<property name="label" translatable="yes">Use TLS Connection</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Not yet available</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_server">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_password">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="ldap_auth_method">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="model">liststore2</property>
|
||||
<property name="active">0</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="renderer1"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label17">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Connection</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="ldap_sasl_frame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Bind DN</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Authname</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Realm</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_bind_dn">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_sasl_authname">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_sasl_realm">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>SASL</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="ldap_search_frame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">5</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label46">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Base object:</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label47">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Filter (%s for name):</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label48">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Name Attribute:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label49">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">SIP address attribute:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label50">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Attributes to query:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_base_object">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_filter">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_name_attribute">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_sip_attribute">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="ldap_attributes">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label37">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Search</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="ldap_misc_frame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label51">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Timeout for search:</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label52">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Max results:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="ldap_timeout">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">timeout_adjustment</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="ldap_max_results">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="max_length">3</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">result_adjustment</property>
|
||||
<property name="numeric">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="ldap_deref_aliases">
|
||||
<property name="label" translatable="yes">Follow Aliases</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label40">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Miscellaneous</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox20">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="ldap_save">
|
||||
<property name="label">gtk-apply</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_ldap_save" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="ldap_reset">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_ldap_reset" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkListStore" id="liststore2">
|
||||
<columns>
|
||||
<!-- column-name authmethod -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
<data>
|
||||
<row>
|
||||
<col id="0" translatable="yes">ANONYMOUS</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">SIMPLE</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">DIGEST-MD5</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">NTLM</col>
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="result_adjustment">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">100</property>
|
||||
<property name="value">50</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="timeout_adjustment">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">100</property>
|
||||
<property name="value">10</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
</interface>
|
||||
379
gtk/linphone.h
|
|
@ -1,379 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifndef _MSC_VER
|
||||
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
// alloca is already defined by gtk
|
||||
#undef alloca
|
||||
#endif
|
||||
#include "linphone/core.h"
|
||||
|
||||
#include "linphone/ldapprovider.h"
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// prevent libintl.h from re-defining fprintf and vfprintf
|
||||
#ifndef fprintf
|
||||
#define fprintf fprintf
|
||||
#endif
|
||||
#ifndef vfprintf
|
||||
#define vfprintf vfprintf
|
||||
#endif
|
||||
#define _GL_STDIO_H
|
||||
#endif
|
||||
|
||||
# include <libintl.h>
|
||||
# undef _
|
||||
# define _(String) dgettext (GETTEXT_PACKAGE,String)
|
||||
#else
|
||||
# define _(String) (String)
|
||||
# define ngettext(singular,plural,number) ((number>1) ? (plural) : (singular) )
|
||||
#endif // ENABLE_NLS
|
||||
|
||||
#undef N_
|
||||
#define N_(str) (str)
|
||||
|
||||
#ifdef USE_BUILDDATE_VERSION
|
||||
#include "version_date.h"
|
||||
#undef LINPHONE_VERSION
|
||||
#define LINPHONE_VERSION LINPHONE_VERSION_DATE
|
||||
#endif
|
||||
|
||||
#include "setupwizard.h"
|
||||
|
||||
#define LINPHONE_ICON "linphone.png"
|
||||
#define LINPHONE_ICON_NAME "linphone"
|
||||
|
||||
enum {
|
||||
COMPLETION_HISTORY,
|
||||
COMPLETION_LDAP
|
||||
};
|
||||
|
||||
typedef float (*get_volume_t)(void *data);
|
||||
|
||||
typedef struct _volume_ctx{
|
||||
GtkWidget *widget;
|
||||
get_volume_t get_volume;
|
||||
void *data;
|
||||
float last_value;
|
||||
}volume_ctx_t;
|
||||
|
||||
typedef enum {
|
||||
CAP_IGNORE,
|
||||
CAP_PLAYBACK,
|
||||
CAP_CAPTURE
|
||||
}DeviceCap;
|
||||
|
||||
enum {
|
||||
START_LINPHONE,
|
||||
START_AUDIO_ASSISTANT,
|
||||
START_LINPHONE_WITH_CALL
|
||||
};
|
||||
|
||||
GdkPixbuf * create_pixbuf(const gchar *filename);
|
||||
GdkPixbufAnimation *create_pixbuf_animation(const gchar *filename);
|
||||
void add_pixmap_directory(const gchar *directory);
|
||||
GtkWidget*create_pixmap(const gchar *filename);
|
||||
GtkWidget *_gtk_image_new_from_memory_at_scale(const void *data, gint len, gint w, gint h, gboolean preserve_ratio);
|
||||
GdkPixbuf *_gdk_pixbuf_new_from_memory_at_scale(const void *data, gint len, gint w, gint h, gboolean preserve_ratio);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_destroy_window(GtkWidget *window);
|
||||
LINPHONE_PUBLIC GtkWidget *linphone_gtk_create_window(const char *window_name, GtkWidget *parent);
|
||||
LINPHONE_PUBLIC GtkWidget *linphone_gtk_get_widget(GtkWidget *window, const char *name);
|
||||
LINPHONE_PUBLIC GtkWidget *linphone_gtk_create_widget(const char* widget_name);
|
||||
LINPHONE_PUBLIC GtkWidget *linphone_gtk_make_tab_header(const gchar *label, const gchar *icon_name, gboolean show_quit_button, GCallback cb, gpointer user_data);
|
||||
|
||||
char *linphone_gtk_message_storage_get_db_file(const char *filename);
|
||||
char *linphone_gtk_call_logs_storage_get_db_file(const char *filename);
|
||||
char *linphone_gtk_friends_storage_get_db_file(const char* filename);
|
||||
LINPHONE_PUBLIC void linphone_gtk_close_assistant(void);
|
||||
|
||||
LINPHONE_PUBLIC LinphoneCore *linphone_gtk_get_core(void);
|
||||
LINPHONE_PUBLIC GtkWidget *linphone_gtk_get_main_window(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_display_something(GtkMessageType type, const gchar *message);
|
||||
LINPHONE_PUBLIC void linphone_gtk_call_terminated(LinphoneCall *call, const char *error);
|
||||
LINPHONE_PUBLIC void linphone_gtk_set_my_presence(LinphoneOnlineStatus ss);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_parameters(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_fill_soundcards(GtkWidget *pb);
|
||||
LINPHONE_PUBLIC void linphone_gtk_fill_webcams(GtkWidget *pb);
|
||||
LINPHONE_PUBLIC void linphone_gtk_load_identities(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_call_log_update(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_create_log_window(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_log_show(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_main_window(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_log_push(OrtpLogLevel lev, const char *fmt, va_list args);
|
||||
LINPHONE_PUBLIC void linphone_gtk_destroy_log_window(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_refer_received(LinphoneCore *lc, const char *refer_to);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_check_logs(void);
|
||||
LINPHONE_PUBLIC const gchar *linphone_gtk_get_ui_config(const char *key, const char *def);
|
||||
LINPHONE_PUBLIC int linphone_gtk_get_ui_config_int(const char *key, int def);
|
||||
LINPHONE_PUBLIC void linphone_gtk_set_ui_config_int(const char *key, int val);
|
||||
LINPHONE_PUBLIC void linphone_gtk_visibility_set(const char *hiddens, const char *window_name, GtkWidget *w, gboolean show);
|
||||
|
||||
LINPHONE_PUBLIC LinphoneLDAPContactProvider* linphone_gtk_get_ldap(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_set_ldap(LinphoneLDAPContactProvider* ldap);
|
||||
LINPHONE_PUBLIC int linphone_gtk_is_ldap_supported(void);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_open_browser(const char *url);
|
||||
LINPHONE_PUBLIC void linphone_gtk_check_for_new_version(void);
|
||||
LINPHONE_PUBLIC const char *linphone_gtk_get_lang(const char *config_file);
|
||||
LINPHONE_PUBLIC void linphone_gtk_set_lang(const char *code);
|
||||
LINPHONE_PUBLIC SipSetupContext* linphone_gtk_get_default_sip_setup_context(void);
|
||||
LINPHONE_PUBLIC GtkWidget * linphone_gtk_show_buddy_lookup_window(SipSetupContext *ctx);
|
||||
LINPHONE_PUBLIC void linphone_gtk_buddy_lookup_set_keyword(GtkWidget *w, const char *kw);
|
||||
LINPHONE_PUBLIC void * linphone_gtk_wait(LinphoneCore *lc, void *ctx, LinphoneWaitingState ws, const char *purpose, float progress);
|
||||
LINPHONE_PUBLIC void linphone_gtk_terminate_call(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_call_update_tab_header(LinphoneCall *call, gboolean pause);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_directory_search(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_status_icon_set_blinking(gboolean val);
|
||||
LINPHONE_PUBLIC void linphone_gtk_notify(LinphoneCall *call, LinphoneChatMessage *chat_message, const char *msg);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_load_chatroom(LinphoneChatRoom *cr, const LinphoneAddress *uri, GtkWidget *chat_view);
|
||||
LINPHONE_PUBLIC void linphone_gtk_send_text(void);
|
||||
LINPHONE_PUBLIC GtkWidget * linphone_gtk_init_chatroom(LinphoneChatRoom *cr, const LinphoneAddress *with);
|
||||
LINPHONE_PUBLIC LinphoneChatRoom * linphone_gtk_create_chatroom(const LinphoneAddress *with);
|
||||
LINPHONE_PUBLIC void linphone_gtk_text_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC void linphone_gtk_is_composing_received(LinphoneCore *lc, LinphoneChatRoom *room);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_friend_list_update_button_display(GtkTreeView *friendlist);
|
||||
LINPHONE_PUBLIC void linphone_gtk_friend_list_set_chat_conversation(const LinphoneAddress *la);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_friend_list_is_contact(const LinphoneAddress *addr);
|
||||
LINPHONE_PUBLIC void linphone_gtk_friend_list_set_active_address(const LinphoneAddress *addr);
|
||||
LINPHONE_PUBLIC const LinphoneAddress *linphone_gtk_friend_list_get_active_address(void);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_friend_list_enter_event_handler(GtkTreeView *friendlist, GdkEventCrossing *event);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_friend_list_leave_event_handler(GtkTreeView *friendlist, GdkEventCrossing *event);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_friend_list_motion_event_handler(GtkTreeView *friendlist, GdkEventMotion *event);
|
||||
LINPHONE_PUBLIC void linphone_gtk_friend_list_on_name_column_clicked(GtkTreeModel *model);
|
||||
LINPHONE_PUBLIC void linphone_gtk_notebook_tab_select(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer data);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_friends(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_contact(LinphoneFriend *lf, GtkWidget *parent);
|
||||
LINPHONE_PUBLIC void linphone_gtk_buddy_info_updated(LinphoneCore *lc, LinphoneFriend *lf);
|
||||
|
||||
/*functions controlling the different views*/
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_use_in_call_view(void);
|
||||
LINPHONE_PUBLIC LinphoneCall *linphone_gtk_get_currently_displayed_call(gboolean *is_conf);
|
||||
LINPHONE_PUBLIC void linphone_gtk_create_in_call_view(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_view_set_calling(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_view_update_duration(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_view_set_incoming(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_view_set_paused(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_view_set_transfer_status(LinphoneCall *call, LinphoneCallState cstate);
|
||||
LINPHONE_PUBLIC void linphone_gtk_mute_clicked(GtkButton *button);
|
||||
LINPHONE_PUBLIC void transfer_button_clicked(GtkWidget *button, gpointer call_ref);
|
||||
LINPHONE_PUBLIC void linphone_gtk_enable_mute_button(GtkButton *button, gboolean sensitive);
|
||||
LINPHONE_PUBLIC void linphone_gtk_enable_hold_button(LinphoneCall *call, gboolean sensitive, gboolean holdon);
|
||||
LINPHONE_PUBLIC void linphone_gtk_enable_transfer_button(LinphoneCore *lc, gboolean value);
|
||||
LINPHONE_PUBLIC void linphone_gtk_enable_conference_button(LinphoneCore *lc, gboolean value);
|
||||
LINPHONE_PUBLIC void linphone_gtk_set_in_conference(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_unset_from_conference(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC bool_t linphone_gtk_call_is_in_conference_view(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_terminate_conference_participant(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_view_show_encryption(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_view_hide_encryption(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_update_video_button(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_init_audio_meter(GtkWidget *w, get_volume_t get_volume, void *data);
|
||||
LINPHONE_PUBLIC void linphone_gtk_uninit_audio_meter(GtkWidget *w);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg, gboolean disable_auto_login);
|
||||
LINPHONE_PUBLIC void linphone_gtk_exit_login_frame(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_set_ui_config(const char *key, const char *value);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_log_uninit(void);
|
||||
|
||||
LINPHONE_PUBLIC bool_t linphone_gtk_init_instance(const char *app_name, int option, const char *addr_to_call);
|
||||
LINPHONE_PUBLIC void linphone_gtk_uninit_instance(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_monitor_usb(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_unmonitor_usb(void);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_fill_combo_box(GtkWidget *combo, const char **devices, const char *selected, DeviceCap cap);
|
||||
LINPHONE_PUBLIC gchar *linphone_gtk_get_record_path(const LinphoneAddress *address, gboolean is_conference);
|
||||
LINPHONE_PUBLIC gchar *linphone_gtk_get_snapshot_path(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_schedule_restart(void);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_audio_assistant(void);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_get_audio_assistant_option(void);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_set_configuration_uri(void);
|
||||
LINPHONE_PUBLIC GtkWidget * linphone_gtk_show_config_fetching(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_close_config_fetching(GtkWidget *w, LinphoneConfiguringState state);
|
||||
LINPHONE_PUBLIC const char *linphone_gtk_get_sound_path(const char *file);
|
||||
LINPHONE_PUBLIC void linphone_gtk_in_call_show_video(LinphoneCall *call);
|
||||
LINPHONE_PUBLIC char *linphone_gtk_address(const LinphoneAddress *addr);/*return human readable identifier for a LinphoneAddress */
|
||||
LINPHONE_PUBLIC GtkWidget *linphone_gtk_get_camera_preview_window(void);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_login_frame_connect_clicked(GtkWidget *button, GtkWidget *login_frame);
|
||||
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_call_log_reset_missed_call(GtkWidget *w, GdkEvent *event, gpointer user_data);
|
||||
LINPHONE_PUBLIC void linphone_gtk_history_row_activated(GtkWidget *treeview);
|
||||
LINPHONE_PUBLIC void linphone_gtk_history_row_selected(GtkWidget *treeview);
|
||||
LINPHONE_PUBLIC void linphone_gtk_clear_call_logs(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_add_contact(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_contact_clicked(GtkTreeSelection *selection);
|
||||
LINPHONE_PUBLIC void linphone_gtk_add_button_clicked(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_edit_button_clicked(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_remove_button_clicked(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_my_presence_clicked(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_directory_search_button_clicked(GtkWidget *button);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_popup_contact_menu(GtkWidget *list, GdkEventButton *event);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_contact_list_button_pressed(GtkTreeView* firendlist, GdkEventButton* event);
|
||||
LINPHONE_PUBLIC void linphone_gtk_auth_token_verified_clicked(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_hold_clicked(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_record_call_toggled(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_log_hide(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_log_scroll_to_end(GtkToggleButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_log_clear(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_logout_clicked(void);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_about_response(GtkDialog *dialog, gint id);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_about(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_start_call(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_start_chat(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_uri_bar_activate(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_terminate_call(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_decline_clicked(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_answer_clicked(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_enable_video(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_enable_self_view(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_used_identity_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void on_proxy_refresh_button_clicked(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_link_to_website(GtkWidget *item);
|
||||
LINPHONE_PUBLIC void linphone_gtk_options_activate(GtkWidget *item);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_keypad_checked(GtkCheckMenuItem *check_menu_item);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_keypad_destroyed_handler(void);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_keyword_changed(GtkEditable *e);
|
||||
LINPHONE_PUBLIC void linphone_gtk_buddy_lookup_contact_activated(GtkWidget *treeview);
|
||||
LINPHONE_PUBLIC void linphone_gtk_add_buddy_from_database(GtkWidget *button);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_call_log_button_pressed(GtkWidget *widget, GdkEventButton *event);
|
||||
LINPHONE_PUBLIC void linphone_gtk_call_statistics_closed(GtkWidget *call_stats);
|
||||
LINPHONE_PUBLIC void linphone_gtk_config_uri_cancel(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_config_uri_changed(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_contact_cancel(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_contact_ok(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_dscp_edit(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_dscp_edit_response(GtkWidget *dialog, guint response_id);
|
||||
LINPHONE_PUBLIC void linphone_gtk_keypad_key_released(GtkWidget *w, GdkEvent *event, gpointer userdata);
|
||||
LINPHONE_PUBLIC void linphone_gtk_keypad_key_pressed(GtkWidget *w, GdkEvent *event, gpointer userdata);
|
||||
LINPHONE_PUBLIC void linphone_gtk_ldap_save(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_ldap_reset(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_parameters_destroyed(GtkWidget *pb);
|
||||
LINPHONE_PUBLIC void linphone_gtk_mtu_set(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_mtu_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_use_sip_info_dtmf_toggled(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_ipv6_toggled(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_lime_changed(GtkComboBoxText *comboext);
|
||||
LINPHONE_PUBLIC void linphone_gtk_disabled_udp_port_toggle(GtkCheckButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_random_udp_port_toggle(GtkCheckButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_udp_port_value_changed(GtkSpinButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_disabled_tcp_port_toggle(GtkCheckButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_random_tcp_port_toggle(GtkCheckButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_tcp_port_value_changed(GtkSpinButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_min_audio_port_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_max_audio_port_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_fixed_audio_port_toggle(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_min_video_port_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_max_video_port_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_fixed_video_port_toggle(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_set_media_encryption_mandatory(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_edit_tunnel(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_no_firewall_toggled(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_use_nat_address_toggled(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_use_stun_toggled(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_use_ice_toggled(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_use_upnp_toggled(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_nat_address_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_stun_server_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_ring_file_set(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_play_ring_file(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_alsa_special_device_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_capture_device_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_ring_device_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_playback_device_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_echo_cancelation_toggled(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_cam_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_video_size_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_video_renderer_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_video_preset_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_camera_preview_clicked(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_update_my_contact(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_add_proxy(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_sip_accounts(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_edit_proxy(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_remove_proxy(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_clear_passwords(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_audio_codec_up(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_audio_codec_down(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_audio_codec_enable(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_audio_codec_disable(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_video_codec_up(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_video_codec_down(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_video_codec_enable(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_video_codec_disable(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_video_framerate_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_upload_bw_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_download_bw_changed(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_adaptive_rate_control_toggled(GtkToggleButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_lang_changed(GtkComboBox *combo);
|
||||
LINPHONE_PUBLIC void linphone_gtk_ui_level_toggled(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_ldap_config(GtkWidget* button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_parameters_closed(GtkWidget *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_password_ok(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_password_cancel(GtkWidget *w);
|
||||
LINPHONE_PUBLIC void linphone_gtk_proxy_ok(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_proxy_cancel(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_proxy_address_changed(GtkEditable *editable);
|
||||
LINPHONE_PUBLIC void linphone_gtk_proxy_transport_changed(GtkWidget *combo);
|
||||
LINPHONE_PUBLIC void linphone_gtk_tunnel_ok(GtkButton *button);
|
||||
LINPHONE_PUBLIC void linphone_gtk_notebook_current_page_changed(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data);
|
||||
LINPHONE_PUBLIC void linphone_gtk_reload_sound_devices(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_reload_video_devices(void);
|
||||
LINPHONE_PUBLIC bool_t linphone_gtk_is_friend(LinphoneCore *lc, const char *contact);
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_auto_answer_enabled(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_auto_answer_delay_changed(GtkSpinButton *spinbutton, gpointer user_data);
|
||||
LINPHONE_PUBLIC void linphone_gtk_update_status_bar_icons(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_enable_auto_answer(GtkToggleButton *checkbox, gpointer user_data);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_import_contacts(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_export_contacts(void);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_mark_chat_read(LinphoneChatRoom *cr);
|
||||
#ifdef __APPLE__
|
||||
LINPHONE_PUBLIC void linphone_gtk_update_badge_count();
|
||||
#endif
|
||||
|
||||
LINPHONE_PUBLIC gboolean linphone_gtk_on_key_press(GtkWidget *widget, GdkEvent *event, gpointer user_data);
|
||||
BIN
gtk/linphone.ico
|
Before Width: | Height: | Size: 95 KiB |
|
|
@ -1,90 +0,0 @@
|
|||
; Script generated by the Inno Setup Script Wizard.
|
||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||
|
||||
[Setup]
|
||||
AppName=Linphone
|
||||
AppVerName=Linphone version 3.1.2
|
||||
AppPublisher=linphone.org
|
||||
AppPublisherURL=http://www.linphone.org
|
||||
AppSupportURL=http://www.linphone.org
|
||||
AppUpdatesURL=http://www.linphone.org
|
||||
DefaultDirName={pf}\Linphone
|
||||
DefaultGroupName=Linphone
|
||||
LicenseFile=..\COPYING
|
||||
;InfoBeforeFile=..\README
|
||||
OutputBaseFilename=setup
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
|
||||
[Files]
|
||||
Source: "linphone.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\mediastreamer2\build\win32native\mediastream.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\console\linphonec.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\console\linphonecsh.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "*.glade"; DestDir: "{app}/linphone"; Flags: ignoreversion
|
||||
Source: "..\pixmaps\*.png"; DestDir: "{app}/linphone"; Flags: ignoreversion
|
||||
Source: "*.png"; DestDir: "{app}/linphone"; Flags: ignoreversion
|
||||
Source: "..\mediastreamer2\src\nowebcamCIF.jpg"; DestDir: "{app}\images"; Flags: ignoreversion
|
||||
;;internal linphone dlls:
|
||||
Source: "..\..\linphone-deps\bin\osipparser2.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\linphone-deps\bin\osip2.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\linphone-deps\bin\exosip2.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\linphone-deps\bin\libogg.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
;;Source: "..\..\linphone-deps\bin\speex.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\linphone-deps\bin\avcodec.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\linphone-deps\bin\avutil-49.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\linphone-deps\bin\swscale.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
;;Source: "..\..\linphone-deps\bin\libspeex-1.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
;;Source: "..\..\linphone-deps\bin\libspeexdsp-1.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\coreapi\linphone.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\mediastreamer2\build\win32native\mediastreamer2.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\oRTP\build\win32native\ortp.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
;;Sound files:
|
||||
Source: "..\COPYING"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\share\ringback.wav"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\share\rings\orig.wav"; DestDir: "{app}\rings"; Flags: ignoreversion
|
||||
Source: "..\share\rings\bigben.wav"; DestDir: "{app}\rings"; Flags: ignoreversion
|
||||
Source: "..\share\rings\toy.wav"; DestDir: "{app}\rings"; Flags: ignoreversion
|
||||
Source: "..\share\rings\tapping.wav"; DestDir: "{app}\rings"; Flags: ignoreversion
|
||||
Source: "..\share\rings\oldphone.wav"; DestDir: "{app}\rings"; Flags: ignoreversion
|
||||
;;Default my preferred gtk theme on windows:
|
||||
Source: "..\gtk-glade\gtkrc"; DestDir: "{app}"; Flags: ignoreversion
|
||||
;;Locales for linphone:
|
||||
Source: "..\po\fr.gmo"; DestDir: "{app}\share\locale\fr\LC_MESSAGES"; DestName: "linphone.mo"; Flags: ignoreversion
|
||||
Source: "..\po\sv.gmo"; DestDir: "{app}\share\locale\sv\LC_MESSAGES"; DestName: "linphone.mo"; Flags: ignoreversion
|
||||
|
||||
;;GTK stuff:
|
||||
Source: "..\..\gtk+-2.14.7\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\libglade-2.6.3\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\gtk+-2.14.7\etc\gtk-2.0\*"; DestDir: "{app}\etc\gtk-2.0\"; Flags: ignoreversion
|
||||
Source: "..\..\linphone-deps\bin\libxml2.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\iconv-1.9.2.win32\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\gtk+-2.14.7\lib\gtk-2.0\2.10.0\engines\*"; DestDir: "{app}\lib\gtk-2.0\2.10.0\engines"; Flags: ignoreversion
|
||||
Source: "..\..\gtk+-2.14.7\lib\gtk-2.0\2.10.0\loaders\*"; DestDir: "{app}\lib\gtk-2.0\2.10.0\loaders"; Flags: ignoreversion
|
||||
;;Source: "..\..\gtk+-2.14.7\lib\gtk-2.0\2.10.0\immodules\*"; DestDir: "{app}\lib\gtk-2.0\2.10.0\immodules"; Flags: ignoreversion
|
||||
Source: "..\..\gtk+-2.14.7\share\locale\fr\LC_MESSAGES\*"; DestDir: "{app}\share\locale\fr\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "..\..\gtk+-2.14.7\share\locale\sv\LC_MESSAGES\*"; DestDir: "{app}\share\locale\sv\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "..\..\XLiquid_GTK-1.0.3\gtk-2.0\*"; DestDir: "{app}\share\themes\XLiquid_GTK-1.0.3\gtk-2.0"; Flags: ignoreversion
|
||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||
|
||||
;; BuddyLookup plugin
|
||||
Source: "..\coreapi\plugins\buddylookup\libbuddylookup.dll"; DestDir: "{app}\liblinphone\plugins"; Flags: ignoreversion
|
||||
Source: "..\..\libsoup\bin\libsoup-2.4-1.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\..\gnutls-2.6.4\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||
|
||||
;;Directshow capture plugin
|
||||
Source: "..\mediastreamer2\plugins\msdscap\libmsdscap.dll"; DestDir: "{app}\plugins" ; Flags: ignoreversion
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\Linphone"; Filename: "{app}\linphone.exe" ; WorkingDir: "{app}"
|
||||
Name: "{userdesktop}\Linphone"; Filename: "{app}\linphone.exe"; WorkingDir: "{app}" ; Tasks: desktopicon
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\linphone.exe"; Description: "{cm:LaunchProgram,Linphone}"; WorkingDir: "{app}" ; Flags: nowait postinstall skipifsilent
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// This file is automatically generated by wxDev-C++.
|
||||
// All changes to this file will be lost when the project is recompiled.
|
||||
|
||||
A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "linphone.ico"
|
||||
|
||||
113
gtk/log.ui
|
|
@ -1,113 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.16"/>
|
||||
<object class="GtkDialog" id="log">
|
||||
<property name="width_request">540</property>
|
||||
<property name="height_request">290</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Linphone debug window</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">normal</property>
|
||||
<property name="deletable">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="layout_style">spread</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="scroll_to_end">
|
||||
<property name="label" translatable="yes">Scroll to end</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="active">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="linphone_gtk_log_scroll_to_end" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button2">
|
||||
<property name="label">gtk-clear</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_log_clear" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_log_hide" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="window_placement">bottom-left</property>
|
||||
<property name="window_placement_set">True</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">word</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="0">scroll_to_end</action-widget>
|
||||
<action-widget response="0">button2</action-widget>
|
||||
<action-widget response="0">button1</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
373
gtk/logging.c
|
|
@ -1,373 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#define mkdir _mkdir
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4996)
|
||||
#else
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
extern gchar *linphone_logfile;
|
||||
|
||||
static GtkWidget *log_window=NULL;
|
||||
static GStaticMutex log_mutex=G_STATIC_MUTEX_INIT;
|
||||
static GList *log_queue=NULL;
|
||||
static const char *dateformat="%Y%m%d-%H:%M:%S";
|
||||
|
||||
#define LOG_MAX_CHARS 1000000 /*1 mega bytes of traces*/
|
||||
|
||||
typedef struct _LinphoneGtkLog{
|
||||
OrtpLogLevel lev;
|
||||
gchar *msg;
|
||||
}LinphoneGtkLog;
|
||||
|
||||
|
||||
/******
|
||||
* Module to log to a file
|
||||
******/
|
||||
|
||||
/* Marker to insert as a line at the start of every log file */
|
||||
#define LOGFILE_MARKER_START "----<start>----"
|
||||
/* Marker to insert as a line at the end of every log file */
|
||||
#define LOGFILE_MARKER_STOP "----<end>----"
|
||||
/* Number of files to keep in history, log file rotation will be
|
||||
performed. */
|
||||
#define LOGFILE_ROTATION 4
|
||||
/* Pointer to opened log file */
|
||||
static FILE *_logfile = NULL;
|
||||
|
||||
|
||||
/* Called on exit, print out the marker, close the file and avoid to
|
||||
continue logging. */
|
||||
void linphone_gtk_log_uninit(void)
|
||||
{
|
||||
if (_logfile != NULL) {
|
||||
fprintf(_logfile, "%s\n", LOGFILE_MARKER_STOP);
|
||||
fclose(_logfile);
|
||||
_logfile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Called when we start logging, find a good place for the log files,
|
||||
perform rotation, insert the start marker and return the pointer to
|
||||
the file that should be used for logging, or NULL on errors or if
|
||||
disabled. */
|
||||
static FILE *linphone_gtk_log_init(void)
|
||||
{
|
||||
static char _logdir[1024];
|
||||
static char _logfname[1024];
|
||||
static gboolean _log_init = FALSE;
|
||||
const char *dst_fname=NULL;
|
||||
|
||||
if (!_log_init) {
|
||||
if (linphone_gtk_get_core()!=NULL){
|
||||
dst_fname = linphone_gtk_get_ui_config("logfile",NULL);
|
||||
dateformat=linphone_gtk_get_ui_config("logfile_date_format",dateformat);
|
||||
}
|
||||
/* For anything to happen, we need a logfile configuration variable,
|
||||
this is our trigger */
|
||||
if (dst_fname) {
|
||||
/* arrange for _logdir to contain a
|
||||
directory that has been created and _logfname to contain the
|
||||
path to a file to which we will log */
|
||||
#ifdef _WIN32
|
||||
const char *appdata=getenv("LOCALAPPDATA");
|
||||
if (appdata) {
|
||||
snprintf(_logdir, sizeof(_logdir),"%s\\Linphone", appdata);
|
||||
mkdir(_logdir);
|
||||
} else {
|
||||
_logdir[0] = '\0';
|
||||
}
|
||||
#define PATH_SEPARATOR '\\'
|
||||
#else
|
||||
const char *home=getenv("HOME");
|
||||
if (home) {
|
||||
snprintf(_logdir, sizeof(_logdir),"%s/.linphone", home);
|
||||
mkdir(_logdir,S_IRUSR | S_IWUSR | S_IRGRP);
|
||||
} else {
|
||||
_logdir[0] = '\0';
|
||||
}
|
||||
#define PATH_SEPARATOR '/'
|
||||
#endif
|
||||
if (_logdir[0] != '\0') {
|
||||
/* We have a directory, fix the path to the log file in it and
|
||||
open the file so that we will be appending to it. */
|
||||
snprintf(_logfname, sizeof(_logfname), "%s%c%s",_logdir, PATH_SEPARATOR, dst_fname);
|
||||
}
|
||||
}else if (linphone_logfile!=NULL){
|
||||
snprintf(_logfname,sizeof(_logfname),"%s",linphone_logfile);
|
||||
}
|
||||
|
||||
if (_logfname[0]!='\0'){
|
||||
/* If the constant LOGFILE_ROTATION is greater than zero, then
|
||||
we kick away a simple rotation that will ensure that there
|
||||
are never more than LOGFILE_ROTATION+1 old copies of the
|
||||
log file on the disk. The oldest file is always rotated
|
||||
"away" as expected. Rotated files have the same name as
|
||||
the main log file, though with a number 0..LOGFILE_ROTATION
|
||||
at the end, where the greater the number is, the older the
|
||||
file is. */
|
||||
if (ortp_file_exist(_logfname)==0 && LOGFILE_ROTATION > 0) {
|
||||
int i;
|
||||
char old_fname[1024];
|
||||
char new_fname[1024];
|
||||
|
||||
/* Rotate away existing files. We make sure to remove the
|
||||
old files otherwise rename() would not work properly. We
|
||||
have to loop in reverse here. */
|
||||
for (i=LOGFILE_ROTATION-1;i>=0;i--) {
|
||||
snprintf(old_fname, sizeof(old_fname), "%s%c%s.%d",
|
||||
_logdir, PATH_SEPARATOR, dst_fname, i);
|
||||
snprintf(new_fname, sizeof(new_fname), "%s%c%s.%d",
|
||||
_logdir, PATH_SEPARATOR, dst_fname, i+1);
|
||||
if (ortp_file_exist(old_fname)==0) {
|
||||
if (ortp_file_exist(new_fname)==0)
|
||||
unlink(new_fname);
|
||||
rename(old_fname, new_fname);
|
||||
}
|
||||
}
|
||||
/* Move current log file as the first of the rotation. Make
|
||||
sure to remove the old .0 also, since otherwise rename()
|
||||
would not work as expected. */
|
||||
snprintf(new_fname, sizeof(new_fname), "%s%c%s.%d",
|
||||
_logdir, PATH_SEPARATOR, dst_fname, 0);
|
||||
if (ortp_file_exist(new_fname)==0)
|
||||
unlink(new_fname);
|
||||
rename(_logfname, new_fname);
|
||||
}
|
||||
/* Start a new log file and mark that we have now initialised */
|
||||
_logfile = fopen(_logfname, "w");
|
||||
fprintf(_logfile, "%s\n", LOGFILE_MARKER_START);
|
||||
}
|
||||
_log_init = TRUE;
|
||||
}
|
||||
return _logfile;
|
||||
}
|
||||
|
||||
static void linphone_gtk_log_file(OrtpLogLevel lev, const char *msg)
|
||||
{
|
||||
FILE *outlog;
|
||||
|
||||
outlog = linphone_gtk_log_init();
|
||||
if (outlog != NULL) {
|
||||
/* We have an opened file and we have initialised properly, it's
|
||||
time to write all these log messages. We convert the log level
|
||||
from oRTP into something readable and timestamp each log
|
||||
message. The format of the time stamp can be controlled by
|
||||
logfile_date_format in the GtkUi section of the config file,
|
||||
but it defaults to something compact, but yet readable. */
|
||||
const char *lname="undef";
|
||||
|
||||
/* Convert level constant to text */
|
||||
switch(lev){
|
||||
case ORTP_DEBUG:
|
||||
lname="debug ";
|
||||
break;
|
||||
case ORTP_MESSAGE:
|
||||
lname="message";
|
||||
break;
|
||||
case ORTP_WARNING:
|
||||
lname="warning";
|
||||
break;
|
||||
case ORTP_ERROR:
|
||||
lname="error ";
|
||||
break;
|
||||
case ORTP_FATAL:
|
||||
lname="fatal ";
|
||||
break;
|
||||
default:
|
||||
lname="undef ";
|
||||
break;
|
||||
}
|
||||
fprintf(outlog, "[%s] %s\n", lname, msg);
|
||||
fflush(outlog);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_log_hide(void){
|
||||
if (log_window)
|
||||
gtk_widget_hide(log_window);
|
||||
}
|
||||
|
||||
void linphone_gtk_create_log_window(void){
|
||||
GtkTextBuffer *b;
|
||||
log_window=linphone_gtk_create_window("log", NULL);
|
||||
b=gtk_text_view_get_buffer(GTK_TEXT_VIEW(linphone_gtk_get_widget(log_window,"textview")));
|
||||
gtk_text_buffer_create_tag(b,"red","foreground","red",NULL);
|
||||
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 (gtk_widget_hide_on_delete), log_window);
|
||||
}
|
||||
|
||||
void linphone_gtk_destroy_log_window(void){
|
||||
GtkWidget *w=log_window;
|
||||
g_static_mutex_lock(&log_mutex);
|
||||
log_window=NULL;
|
||||
gtk_widget_destroy(w);
|
||||
g_static_mutex_unlock(&log_mutex);
|
||||
}
|
||||
|
||||
void linphone_gtk_log_show(void){
|
||||
gtk_widget_show(log_window);
|
||||
gtk_window_present(GTK_WINDOW(log_window));
|
||||
}
|
||||
|
||||
static void linphone_gtk_display_log(GtkTextView *v, OrtpLogLevel lev, const char *msg){
|
||||
GtkTextIter iter,begin;
|
||||
int off;
|
||||
GtkTextBuffer *b;
|
||||
const char *lname="undef";
|
||||
|
||||
b=gtk_text_view_get_buffer(v);
|
||||
switch(lev){
|
||||
case ORTP_DEBUG:
|
||||
lname="debug";
|
||||
break;
|
||||
case ORTP_MESSAGE:
|
||||
lname="message";
|
||||
break;
|
||||
case ORTP_WARNING:
|
||||
lname="warning";
|
||||
break;
|
||||
case ORTP_ERROR:
|
||||
lname="error";
|
||||
break;
|
||||
case ORTP_FATAL:
|
||||
lname="fatal";
|
||||
break;
|
||||
default:
|
||||
g_error("Bad level !");
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_end_iter(b,&iter);
|
||||
off=gtk_text_iter_get_offset(&iter);
|
||||
gtk_text_buffer_insert(b,&iter,lname,-1);
|
||||
gtk_text_buffer_get_end_iter(b,&iter);
|
||||
gtk_text_buffer_insert(b,&iter,": ",-1);
|
||||
gtk_text_buffer_get_end_iter(b,&iter);
|
||||
gtk_text_buffer_insert(b,&iter,msg,-1);
|
||||
gtk_text_buffer_get_end_iter(b,&iter);
|
||||
gtk_text_buffer_insert(b,&iter,"\n",-1);
|
||||
gtk_text_buffer_get_end_iter(b,&iter);
|
||||
gtk_text_buffer_get_iter_at_offset(b,&begin,off);
|
||||
if (lev==ORTP_ERROR || lev==ORTP_FATAL) gtk_text_buffer_apply_tag_by_name(b,"red",&begin,&iter);
|
||||
else if (lev==ORTP_WARNING) gtk_text_buffer_apply_tag_by_name(b,"orange",&begin,&iter);
|
||||
|
||||
while(gtk_text_buffer_get_char_count(b)>LOG_MAX_CHARS){
|
||||
GtkTextIter iter_line_after;
|
||||
gtk_text_buffer_get_start_iter(b,&iter);
|
||||
iter_line_after=iter;
|
||||
if (gtk_text_iter_forward_line(&iter_line_after)){
|
||||
gtk_text_buffer_delete(b,&iter,&iter_line_after);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void stick_to_end(GtkTextView *v){
|
||||
GtkTextBuffer *b;
|
||||
GtkTextIter iter;
|
||||
b=gtk_text_view_get_buffer(v);
|
||||
gtk_text_buffer_get_end_iter(b,&iter);
|
||||
gtk_text_view_scroll_to_iter(v,&iter,0,FALSE,1.0,0);
|
||||
}
|
||||
|
||||
void linphone_gtk_log_scroll_to_end(GtkToggleButton *button) {
|
||||
if (gtk_toggle_button_get_active(button)){
|
||||
GtkTextView *v=GTK_TEXT_VIEW(linphone_gtk_get_widget(log_window,"textview"));
|
||||
stick_to_end(v);
|
||||
}
|
||||
lp_config_set_int(linphone_core_get_config(linphone_gtk_get_core()), "GtkUi", "logs_scroll_to_end", gtk_toggle_button_get_active(button) ? 1 : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* called from Gtk main loop.
|
||||
**/
|
||||
gboolean linphone_gtk_check_logs(void){
|
||||
GList *elem;
|
||||
GtkTextView *v=NULL;
|
||||
if (log_window) v=GTK_TEXT_VIEW(linphone_gtk_get_widget(log_window,"textview"));
|
||||
g_static_mutex_lock(&log_mutex);
|
||||
for(elem=log_queue;elem!=NULL;elem=elem->next){
|
||||
LinphoneGtkLog *lgl=(LinphoneGtkLog*)elem->data;
|
||||
if (v) linphone_gtk_display_log(v,lgl->lev,lgl->msg);
|
||||
g_free(lgl->msg);
|
||||
g_free(lgl);
|
||||
}
|
||||
if (log_queue) g_list_free(log_queue);
|
||||
log_queue=NULL;
|
||||
g_static_mutex_unlock(&log_mutex);
|
||||
if (v) {
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(log_window,"scroll_to_end")), lp_config_get_int(linphone_core_get_config(linphone_gtk_get_core()), "GtkUi", "logs_scroll_to_end", 0) == 1);
|
||||
linphone_gtk_log_scroll_to_end(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(log_window,"scroll_to_end")));
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Called from any linphone thread.
|
||||
*/
|
||||
void linphone_gtk_log_push(OrtpLogLevel lev, const char *fmt, va_list args){
|
||||
LinphoneGtkLog *lgl=g_new(LinphoneGtkLog,1);
|
||||
gchar *msg=g_strdup_vprintf(fmt,args);
|
||||
gchar *dated_msg;
|
||||
struct timeval tp;
|
||||
struct tm *lt;
|
||||
time_t tt;
|
||||
|
||||
ortp_gettimeofday(&tp, NULL);
|
||||
tt = (time_t)tp.tv_sec;
|
||||
lt = localtime((const time_t*)&tt);
|
||||
dated_msg=g_strdup_printf("%i-%.2i-%.2i %.2i:%.2i:%.2i:%.3i %s",
|
||||
1900 + lt->tm_year, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec, (int)(tp.tv_usec / 1000), msg);
|
||||
g_free(msg);
|
||||
lgl->lev=lev;
|
||||
lgl->msg=dated_msg;
|
||||
linphone_gtk_log_file(lev, dated_msg);
|
||||
g_static_mutex_lock(&log_mutex);
|
||||
log_queue=g_list_append(log_queue,lgl);
|
||||
g_static_mutex_unlock(&log_mutex);
|
||||
}
|
||||
|
||||
void linphone_gtk_log_clear(void){
|
||||
if (log_window){
|
||||
GtkTextIter end,begin;
|
||||
GtkTextView *v;
|
||||
GtkTextBuffer *b;
|
||||
v=GTK_TEXT_VIEW(linphone_gtk_get_widget(log_window,"textview"));
|
||||
b=gtk_text_view_get_buffer(v);
|
||||
gtk_text_buffer_get_start_iter(b,&begin);
|
||||
gtk_text_buffer_get_end_iter(b,&end);
|
||||
gtk_text_buffer_delete(b,&begin,&end);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,250 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.24"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkFrame" id="login_frame">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">etched-out</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="login_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-missing-image</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<property name="right_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">5</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Username</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label10">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Password</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label13">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Internet connection:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="login_username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="login_password">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="login_internet_kind">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="active">0</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="renderer4"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="automatic_login">
|
||||
<property name="label" translatable="yes">Automatically log me in</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="userid">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">UserID</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="login_userid">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="login_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Login information</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">10</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHButtonBox" id="hbuttonbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="login_connect">
|
||||
<property name="label">gtk-connect</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_login_frame_connect_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Welcome!</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkListStore" id="model4">
|
||||
<columns>
|
||||
<!-- column-name gchararray -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
<data>
|
||||
<row>
|
||||
<col id="0" translatable="yes">ADSL</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0" translatable="yes">Fiber Channel</col>
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
</interface>
|
||||
185
gtk/loginframe.c
|
|
@ -1,185 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
void test_button_clicked_cb(GtkWidget *button);
|
||||
void linphone_gtk_exit_login_frame(void);
|
||||
|
||||
|
||||
static void do_login(SipSetupContext *ssctx, const char *identity, const char * passwd, const char *userid){
|
||||
if (sip_setup_context_login_account(ssctx,identity,passwd,userid)==0){
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean do_login_noprompt(LinphoneProxyConfig *cfg){
|
||||
SipSetupContext *ssctx=linphone_proxy_config_get_sip_setup_context(cfg);
|
||||
LinphoneAddress *addr;
|
||||
const char *username;
|
||||
char *tmp;
|
||||
if (ssctx==NULL) return TRUE;/*not ready ?*/
|
||||
username=linphone_gtk_get_ui_config ("login_username",NULL);
|
||||
if (username==NULL) {
|
||||
linphone_gtk_show_login_frame(cfg,TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
addr=linphone_address_clone(linphone_proxy_config_get_identity_address(cfg));
|
||||
linphone_address_set_username(addr,username);
|
||||
tmp=linphone_address_as_string (addr);
|
||||
do_login(ssctx,tmp,NULL,NULL);
|
||||
linphone_address_unref(addr);
|
||||
linphone_gtk_load_identities();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void linphone_gtk_init_login_frame(GtkWidget *login_frame, LinphoneProxyConfig *cfg) {
|
||||
gboolean auto_login=linphone_gtk_get_ui_config_int("automatic_login",0);
|
||||
const char *login_image=linphone_gtk_get_ui_config("login_image","linphone-banner.png");
|
||||
GtkWidget *label=linphone_gtk_get_widget(login_frame,"login_label");
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
gchar *str;
|
||||
LinphoneAddress *from;
|
||||
const LinphoneAuthInfo *ai;
|
||||
const char *passwd=NULL;
|
||||
const char *userid=NULL;
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(login_frame, "automatic_login")),auto_login);
|
||||
|
||||
if (login_image){
|
||||
GdkPixbuf *pbuf=create_pixbuf (login_image);
|
||||
gtk_image_set_from_pixbuf (GTK_IMAGE(linphone_gtk_get_widget(login_frame, "login_image")), pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
}
|
||||
|
||||
if (linphone_gtk_get_ui_config_int("login_needs_userid",FALSE)){
|
||||
gtk_widget_show(linphone_gtk_get_widget(login_frame,"userid"));
|
||||
gtk_widget_show(linphone_gtk_get_widget(login_frame,"login_userid"));
|
||||
}
|
||||
|
||||
str=g_strdup_printf(_("Please enter login information for %s"),linphone_proxy_config_get_domain(cfg));
|
||||
gtk_label_set_text(GTK_LABEL(label),str);
|
||||
g_object_set_data(G_OBJECT(login_frame),"login_proxy_config",cfg);
|
||||
g_free(str);
|
||||
|
||||
from=linphone_address_new(linphone_proxy_config_get_identity(cfg));
|
||||
if (linphone_address_get_username(from)[0]=='?'){
|
||||
const char *username=linphone_gtk_get_ui_config ("login_username",NULL);
|
||||
if (username)
|
||||
linphone_address_set_username(from,username);
|
||||
}
|
||||
|
||||
ai=linphone_core_find_auth_info(lc,linphone_proxy_config_get_domain(cfg),linphone_address_get_username(from),NULL);
|
||||
/*display the last entered username, if not '?????'*/
|
||||
if (linphone_address_get_username(from)[0]!='?')
|
||||
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(login_frame,"login_username")),
|
||||
linphone_address_get_username(from));
|
||||
if (ai) {
|
||||
passwd=linphone_auth_info_get_passwd(ai);
|
||||
userid=linphone_auth_info_get_userid(ai);
|
||||
}
|
||||
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(login_frame,"login_password")),
|
||||
passwd!=NULL ? passwd : "");
|
||||
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(login_frame,"login_userid")),
|
||||
userid ? userid : "");
|
||||
|
||||
linphone_address_unref(from);
|
||||
}
|
||||
|
||||
void linphone_gtk_show_login_frame(LinphoneProxyConfig *cfg, gboolean disable_auto_login){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
gboolean auto_login=linphone_gtk_get_ui_config_int("automatic_login",0);
|
||||
GtkWidget *main_frame = linphone_gtk_get_widget(mw, "main_frame");
|
||||
GtkWidget *main_layout = linphone_gtk_get_widget(mw, "main_layout");
|
||||
GtkWidget *login_frame;
|
||||
|
||||
if (auto_login && !disable_auto_login){
|
||||
g_timeout_add(250,(GSourceFunc)do_login_noprompt,cfg);
|
||||
return;
|
||||
}
|
||||
|
||||
login_frame = linphone_gtk_create_widget("login_frame");
|
||||
linphone_gtk_init_login_frame(login_frame, cfg);
|
||||
g_object_set_data_full(G_OBJECT(mw), "main_frame", g_object_ref(main_frame), g_object_unref);
|
||||
g_object_set_data(G_OBJECT(mw), "login_frame", login_frame);
|
||||
gtk_container_remove(GTK_CONTAINER(main_layout), main_frame);
|
||||
gtk_box_pack_start(GTK_BOX(main_layout), login_frame, TRUE, TRUE, 0);
|
||||
gtk_widget_show(login_frame);
|
||||
|
||||
gtk_widget_hide(linphone_gtk_get_widget(mw,"disconnect_item"));
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"options_menu"),FALSE);
|
||||
}
|
||||
|
||||
void linphone_gtk_exit_login_frame(void){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *main_layout = linphone_gtk_get_widget(mw, "main_layout");
|
||||
GtkWidget *main_frame = GTK_WIDGET(g_object_get_data(G_OBJECT(mw), "main_frame"));
|
||||
GtkWidget *login_frame = GTK_WIDGET(g_object_get_data(G_OBJECT(mw), "login_frame"));
|
||||
|
||||
gtk_container_remove(GTK_CONTAINER(main_layout), login_frame);
|
||||
gtk_box_pack_start(GTK_BOX(main_layout), main_frame, TRUE, TRUE, 0);
|
||||
g_object_set_data(G_OBJECT(mw), "login_frame", NULL);
|
||||
g_object_set_data(G_OBJECT(mw), "main_frame", NULL);
|
||||
|
||||
gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"options_menu"),TRUE);
|
||||
gtk_widget_show(linphone_gtk_get_widget(mw,"disconnect_item"));
|
||||
}
|
||||
|
||||
void linphone_gtk_logout_clicked(void){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
LinphoneProxyConfig *cfg=NULL;
|
||||
cfg = linphone_core_get_default_proxy_config(lc);
|
||||
if (cfg){
|
||||
SipSetupContext *ss=linphone_proxy_config_get_sip_setup_context(cfg);
|
||||
if (ss){
|
||||
sip_setup_context_logout(ss);
|
||||
linphone_gtk_show_login_frame(cfg,TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void linphone_gtk_login_frame_connect_clicked(GtkWidget *button, GtkWidget *login_frame){
|
||||
const char *username;
|
||||
const char *password;
|
||||
const char *userid;
|
||||
char *identity;
|
||||
gboolean autologin;
|
||||
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)g_object_get_data(G_OBJECT(login_frame),"login_proxy_config");
|
||||
LinphoneAddress *from;
|
||||
SipSetupContext *ssctx=linphone_proxy_config_get_sip_setup_context(cfg);
|
||||
|
||||
username=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(login_frame,"login_username")));
|
||||
password=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(login_frame,"login_password")));
|
||||
userid=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(login_frame,"login_userid")));
|
||||
|
||||
if (username==NULL || username[0]=='\0')
|
||||
return;
|
||||
|
||||
autologin=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(login_frame,"automatic_login")));
|
||||
linphone_gtk_set_ui_config_int("automatic_login",autologin);
|
||||
linphone_gtk_set_ui_config("login_username",username);
|
||||
|
||||
from=linphone_address_new(linphone_proxy_config_get_identity(cfg));
|
||||
linphone_address_set_username(from,username);
|
||||
identity=linphone_address_as_string(from);
|
||||
do_login(ssctx,identity,password,userid);
|
||||
/*we need to refresh the identities since the proxy config may have changed.*/
|
||||
linphone_gtk_load_identities();
|
||||
}
|
||||
47
gtk/mac.m
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "linphone.h"
|
||||
|
||||
|
||||
static int unread_messages_count() {
|
||||
LinphoneCore* lc = linphone_gtk_get_core();
|
||||
int count = 0;
|
||||
const MSList *rooms = linphone_core_get_chat_rooms(lc);
|
||||
const MSList *item = rooms;
|
||||
while (item) {
|
||||
LinphoneChatRoom *room = (LinphoneChatRoom *)item->data;
|
||||
if (room) {
|
||||
count += linphone_chat_room_get_unread_messages_count(room);
|
||||
}
|
||||
item = item->next;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void linphone_gtk_update_badge_count() {
|
||||
int count = unread_messages_count();
|
||||
NSString* badgeStr = (count > 0) ? [NSString stringWithFormat:@"%d", count] : @"";
|
||||
[[NSApp dockTile] setBadgeLabel:badgeStr];
|
||||
}
|
||||
|
||||
#endif
|
||||
2383
gtk/main.c
1056
gtk/main.ui
129
gtk/p2pwizard.ui
|
|
@ -1,129 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--Generated with glade3 3.4.5 on Sun Mar 29 21:17:24 2009 -->
|
||||
<interface>
|
||||
<object class="GtkAssistant" id="p2pwizard">
|
||||
<property name="title" translatable="yes">Creating a FONICS account</property>
|
||||
<signal handler="linphone_gtk_fonis_wizard_apply" name="apply"/>
|
||||
<signal handler="linphone_gtk_fonis_wizard_prepare" name="prepare"/>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Welcome!
|
||||
This wizard will help you to setup a SIP account.
|
||||
</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="selectable">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">GTK_ASSISTANT_PAGE_INTRO</property>
|
||||
<property name="title">Introduction</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Please choose a username:</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal handler="linphone_gtk_fonis_wizard_check_username_clicked" name="clicked"/>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox2">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-apply</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Check availability</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="check_result">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="title">Create your account !</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Done ! Your account is now created and ready to use.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">GTK_ASSISTANT_PAGE_CONFIRM</property>
|
||||
<property name="title">Finished !</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
3183
gtk/parameters.ui
139
gtk/password.ui
|
|
@ -1,139 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 2.16 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<object class="GtkDialog" id="password">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Linphone - Authentication required</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox9">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox12">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="message">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Please enter the domain password</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="wrap">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="userid_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">UserID</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="userid_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Password:</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="password_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<signal handler="linphone_gtk_password_ok" name="activate"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area8">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button8">
|
||||
<property name="label" translatable="no">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal handler="linphone_gtk_password_ok" name="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button9">
|
||||
<property name="label" translatable="no">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal handler="linphone_gtk_password_cancel" name="clicked"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
1966
gtk/propertybox.c
|
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.18"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkMessageDialog" id="provisioning-fetch">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Configuring...</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="skip_taskbar_hint">True</property>
|
||||
<property name="text" translatable="yes">Please wait while fetching configuration from server...</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTable" id="spinner_container">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
67
gtk/regex.h
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2015 Belledonne Communications <info@belledonne-communications.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Regex matching with any URI that respects the RFC 3986
|
||||
*/
|
||||
#define BC_REGEX_URI_PCT_ENCODED "(%[[:xdigit:]]{2})"
|
||||
#define BC_REGEX_URI_SUB_DELIMS "[!$&'()*+,;=]"
|
||||
#define BC_REGEX_URI_UNRESERVED "[[:alnum:]\\-._~]"
|
||||
#define BC_REGEX_URI_PCHAR "(" BC_REGEX_URI_UNRESERVED "|" BC_REGEX_URI_PCT_ENCODED "|" BC_REGEX_URI_SUB_DELIMS "|" "[:@]" ")"
|
||||
#define BC_REGEX_URI_SCHEME "(" "[[:alpha:]][[:alnum:]+\\-.]*" ")"
|
||||
#define BC_REGEX_URI_USERINFO "(" "(" BC_REGEX_URI_UNRESERVED "|" BC_REGEX_URI_PCT_ENCODED "|" BC_REGEX_URI_SUB_DELIMS "|" ":" ")*" ")"
|
||||
#define BC_REGEX_URI_HOST "(" "(" BC_REGEX_URI_UNRESERVED "|" BC_REGEX_URI_PCT_ENCODED "|" BC_REGEX_URI_SUB_DELIMS ")*" ")"
|
||||
#define BC_REGEX_URI_PORT "(" "[\\d]*" ")"
|
||||
#define BC_REGEX_URI_AUTHORITY "(" "(" BC_REGEX_URI_USERINFO "@" ")?" BC_REGEX_URI_HOST "(" ":" BC_REGEX_URI_PORT ")?" ")"
|
||||
#define BC_REGEX_URI_SEGMENT "(" BC_REGEX_URI_PCHAR "*" ")"
|
||||
#define BC_REGEX_URI_SEGMENT_NZ "(" BC_REGEX_URI_PCHAR "+" ")"
|
||||
#define BC_REGEX_URI_PATH_ABEMPTY "(" "(" "/" BC_REGEX_URI_SEGMENT ")*" ")"
|
||||
#define BC_REGEX_URI_PATH_ABSOLUTE "(" "/" "(" BC_REGEX_URI_SEGMENT_NZ "(" "/" BC_REGEX_URI_SEGMENT ")*" ")?" ")"
|
||||
#define BC_REGEX_URI_PATH_ROOTLESS "(" BC_REGEX_URI_SEGMENT_NZ "(" "/" BC_REGEX_URI_SEGMENT ")*" ")"
|
||||
#define BC_REGEX_URI_HIER_PART "(" "//" BC_REGEX_URI_AUTHORITY BC_REGEX_URI_PATH_ABEMPTY "|" BC_REGEX_URI_PATH_ABSOLUTE "|" BC_REGEX_URI_PATH_ROOTLESS ")"
|
||||
#define BC_REGEX_URI_QUERY "(" "(" BC_REGEX_URI_PCHAR "|" "[/?]" ")*" ")"
|
||||
#define BC_REGEX_URI_FRAGMENT "(" "(" BC_REGEX_URI_PCHAR "|" "[/?]" ")*" ")"
|
||||
#define BC_REGEX_URI "(" BC_REGEX_URI_SCHEME ":" BC_REGEX_URI_HIER_PART "(" "\\?" BC_REGEX_URI_QUERY ")?" "(" "#" BC_REGEX_URI_FRAGMENT ")?" ")"
|
||||
|
||||
/*
|
||||
* Regex matching with any domain name (RFC 1034)
|
||||
*/
|
||||
#define BC_REGEX_DOMAIN_LDH "[[:alnum:]-]"
|
||||
#define BC_REGEX_DOMAIN_LABEL "(" "[[:alpha:]]" "(" BC_REGEX_DOMAIN_LDH "*" "[[:alnum:]]" ")?" ")"
|
||||
#define BC_REGEX_DOMAIN "(" BC_REGEX_DOMAIN_LABEL "(" "\\." BC_REGEX_DOMAIN_LABEL ")*" ")"
|
||||
|
||||
/*
|
||||
* Regex matching with email addresses (RFC 5322)
|
||||
*/
|
||||
#define BC_REGEX_EMAIL_ATEXT "[[:alnum:]!#$%&'*+\\-/=?\\^_`{}|~]"
|
||||
#define BC_REGEX_EMAIL_DOT_ATOM_TEXT "(" BC_REGEX_EMAIL_ATEXT "+" "(" "." BC_REGEX_EMAIL_ATEXT "+" ")*" ")"
|
||||
#define BC_REGEX_EMAIL_LOCAL_PART BC_REGEX_EMAIL_DOT_ATOM_TEXT
|
||||
#define BC_REGEX_EMAIL_DTEXT_NO_OBS "[!-Z\\^-~]"
|
||||
#define BC_REGEX_EMAIL_DOMAIN "(" BC_REGEX_EMAIL_DOT_ATOM_TEXT "|" "\\[" BC_REGEX_EMAIL_DTEXT_NO_OBS "*" "\\]" ")"
|
||||
#define BC_REGEX_EMAIL_ADDR_SPEC "(" BC_REGEX_EMAIL_LOCAL_PART "@" BC_REGEX_EMAIL_DOMAIN ")"
|
||||
|
||||
/*
|
||||
* Regex matching with email addresses but with more constraints than RFC 5322.
|
||||
* The additionnal constraints are the folowings:
|
||||
* + the domain part is a domain name as describe in RFC 1034
|
||||
* + the domain part must have two label at least
|
||||
* + the last label of the domain part must have two letter (without digit and hyphen) at least.
|
||||
*/
|
||||
#define BC_REGEX_RESTRICTIVE_EMAIL_TLD "(" "[[:alpha:]]" BC_REGEX_DOMAIN_LDH "*" "[[:alnum:]]" ")"
|
||||
#define BC_REGEX_RESTRICTIVE_EMAIL_ADDR "(" BC_REGEX_EMAIL_LOCAL_PART "@" "(" BC_REGEX_DOMAIN_LABEL "\\." ")+" BC_REGEX_RESTRICTIVE_EMAIL_TLD ")"
|
||||
|
|
@ -1,736 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.18"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkAssistant" id="setup_wizard">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">8</property>
|
||||
<property name="title" translatable="yes">SIP account configuration assistant</property>
|
||||
<property name="resizable">False</property>
|
||||
<signal name="close" handler="linphone_gtk_assistant_closed" swapped="no"/>
|
||||
<signal name="cancel" handler="linphone_gtk_assistant_closed" swapped="no"/>
|
||||
<signal name="prepare" handler="linphone_gtk_assistant_prepare" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="page0">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Welcome!
|
||||
This assistant will help you to use a SIP account for your calls.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">intro</property>
|
||||
<property name="title" translatable="yes">Welcome to the account setup assistant</property>
|
||||
<property name="complete">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="page1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="top_padding">20</property>
|
||||
<property name="left_padding">30</property>
|
||||
<property name="right_padding">30</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="p1_vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="radio_create_account">
|
||||
<property name="label" translatable="yes">Create an account on linphone.org</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="radio_setup_lp_account">
|
||||
<property name="label" translatable="yes">I have already a linphone.org account and I just want to use it</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radio_create_account</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="radio_setup_account">
|
||||
<property name="label" translatable="yes">I have already a sip account and I just want to use it</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radio_create_account</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="radio_config_uri">
|
||||
<property name="label" translatable="yes">I want to specify a remote configuration URI</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radio_create_account</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="title" translatable="yes">Account setup assistant</property>
|
||||
<property name="complete">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="page2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0</property>
|
||||
<property name="xscale">0.5</property>
|
||||
<property name="top_padding">30</property>
|
||||
<property name="bottom_padding">10</property>
|
||||
<property name="left_padding">30</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="p2_table">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">6</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="column_spacing">8</property>
|
||||
<property name="row_spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p2_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="ypad">8</property>
|
||||
<property name="label" translatable="yes">Enter your account information</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p2_label_username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Username*</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p2_entry_username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_external_account_configuration_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p2_label_password">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Password*</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p2_entry_password">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_external_account_configuration_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p2_label_domain">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Domain*</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p2_entry_domain">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_external_account_configuration_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p2_label_proxy">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Proxy</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p2_entry_proxy">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_external_account_configuration_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p2_label_error">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<attributes>
|
||||
<attribute name="foreground" value="#ffff00000000"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">confirm</property>
|
||||
<property name="title" translatable="yes">Configure your account (step 1/1)</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="page3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xscale">0.5</property>
|
||||
<property name="top_padding">30</property>
|
||||
<property name="bottom_padding">10</property>
|
||||
<property name="left_padding">30</property>
|
||||
<property name="right_padding">30</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="p3_table">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">8</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="column_spacing">8</property>
|
||||
<property name="row_spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p3_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="ypad">8</property>
|
||||
<property name="label" translatable="yes">Enter your linphone.org username</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p3_label_username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Username:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p3_entry_username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_account_configuration_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p3_label_password">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Password:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p3_entry_password">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">confirm</property>
|
||||
<property name="title" translatable="yes">Enter your sip username (step 1/1)</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="page4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xscale">0.5</property>
|
||||
<property name="top_padding">10</property>
|
||||
<property name="bottom_padding">10</property>
|
||||
<property name="left_padding">30</property>
|
||||
<property name="right_padding">30</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="p4_table">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">8</property>
|
||||
<property name="n_rows">7</property>
|
||||
<property name="n_columns">3</property>
|
||||
<property name="column_spacing">8</property>
|
||||
<property name="row_spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p4_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">(*) Required fields</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="y_padding">8</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p4_label_email">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Email: (*)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p4_entry_email">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_account_creation_email_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="p4_image_email_ok">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-no</property>
|
||||
<property name="icon-size">3</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p4_label_username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Username: (*)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p4_entry_username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_account_creation_username_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="p4_image_username_ok">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-no</property>
|
||||
<property name="icon-size">3</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options"/>
|
||||
<property name="y_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p4_label_password1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Password: (*)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p4_entry_password1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_account_creation_password_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p4_label_password2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Confirm your password: (*)</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="p4_entry_password2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_account_creation_password_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="p4_image_password_ok">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-no</property>
|
||||
<property name="icon-size">3</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="x_options"/>
|
||||
<property name="y_options"/>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="p4_label_error">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<attributes>
|
||||
<attribute name="foreground" value="#ffff00000000"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<!--<child>
|
||||
<object class="GtkCheckButton" id="p4_check_newsletter">
|
||||
<property name="label" translatable="yes">Keep me informed with linphone updates</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
</packing>
|
||||
</child>-->
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">confirm</property>
|
||||
<property name="title" translatable="yes">Enter account information (step 1/2)</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="page5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Your account is being created, please wait.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">progress</property>
|
||||
<property name="title" translatable="yes">Account creation in progress</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="page6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Please validate your account by clicking on the link we just sent you by email.
|
||||
Then come back here and press Next button.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="title" translatable="yes">Validation (step 2/2)</property>
|
||||
<property name="complete">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="page7">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Checking if your account is been validated, please wait.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">progress</property>
|
||||
<property name="title" translatable="yes">Account validation check in progress</property>
|
||||
<property name="complete">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="page8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Error, account not validated, username already used or server unreachable.
|
||||
Please go back and try again.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="title" translatable="yes">Error</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="page9">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Thank you. Your account is now configured and ready for use.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="page_type">summary</property>
|
||||
<property name="title" translatable="yes">Terminating</property>
|
||||
<property name="complete">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,360 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
#include "regex.h"
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
|
||||
static const int PASSWORD_MIN_SIZE = 6;
|
||||
static const int LOGIN_MIN_SIZE = 4;
|
||||
static GtkWidget *the_assistant = NULL;
|
||||
|
||||
|
||||
static LinphoneAccountCreator * linphone_gtk_assistant_get_creator(GtkWidget *w) {
|
||||
return (LinphoneAccountCreator *)g_object_get_data(G_OBJECT(w), "creator");
|
||||
}
|
||||
|
||||
static void linphone_gtk_create_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp) {
|
||||
GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator);
|
||||
if (status == LinphoneAccountCreatorStatusAccountCreated) {
|
||||
// Go to page_6_linphone_account_validation_wait
|
||||
gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), 6);
|
||||
} else { // Error when attempting to create the account
|
||||
// Go to page_8_error
|
||||
gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), 8);
|
||||
}
|
||||
gtk_assistant_commit(GTK_ASSISTANT(assistant));
|
||||
}
|
||||
|
||||
static void create_account(GtkWidget *assistant) {
|
||||
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(assistant);
|
||||
linphone_account_creator_create_account(creator);
|
||||
}
|
||||
|
||||
static void linphone_gtk_test_account_validation_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp) {
|
||||
GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator);
|
||||
if (status == LinphoneAccountCreatorStatusAccountActivated) {
|
||||
// Go to page_9_finish
|
||||
gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), 9);
|
||||
} else {
|
||||
// Go to page_8_error
|
||||
gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), 8);
|
||||
}
|
||||
}
|
||||
|
||||
static void check_account_validation(GtkWidget *assistant) {
|
||||
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(assistant);
|
||||
linphone_account_creator_is_account_activated(creator);
|
||||
}
|
||||
|
||||
void linphone_gtk_assistant_closed(GtkWidget *w) {
|
||||
linphone_gtk_close_assistant();
|
||||
}
|
||||
|
||||
void linphone_gtk_assistant_prepare(GtkWidget *assistant) {
|
||||
int pagenum = gtk_assistant_get_current_page(GTK_ASSISTANT(assistant));
|
||||
|
||||
switch (pagenum) {
|
||||
case 5:
|
||||
create_account(assistant);
|
||||
break;
|
||||
case 7:
|
||||
check_account_validation(assistant);
|
||||
break;
|
||||
case 9:
|
||||
if (linphone_account_creator_configure(linphone_gtk_assistant_get_creator(assistant)) != NULL) {
|
||||
linphone_gtk_load_identities();
|
||||
}
|
||||
gtk_assistant_commit(GTK_ASSISTANT(assistant));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gint destroy_assistant(GtkWidget* w){
|
||||
gtk_widget_destroy(w);
|
||||
the_assistant = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int linphone_gtk_assistant_forward(int curpage, gpointer data) {
|
||||
GtkWidget *w = GTK_WIDGET(data);
|
||||
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(w);
|
||||
|
||||
switch (curpage) {
|
||||
case 0:
|
||||
curpage = 1; // Go to page_1_choice
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
GtkWidget *create_button = linphone_gtk_get_widget(w, "radio_create_account");
|
||||
GtkWidget *setup_linphone_account = linphone_gtk_get_widget(w, "radio_setup_lp_account");
|
||||
GtkWidget *setup_account = linphone_gtk_get_widget(w, "radio_setup_account");
|
||||
GtkWidget *config_uri = linphone_gtk_get_widget(w, "radio_config_uri");
|
||||
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(create_button))) {
|
||||
curpage = 4; // Go to page_4_linphone_account_creation_configuration
|
||||
} else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(setup_linphone_account))) {
|
||||
curpage = 3; // Go to page_3_linphone_account_configuration
|
||||
} else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(setup_account))) {
|
||||
curpage = 2; // Go to page_2_external_account_configuration
|
||||
} else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(config_uri))) {
|
||||
/* Destroy the assistant and popup config-uri dialog */
|
||||
gtk_widget_hide(w);
|
||||
linphone_gtk_set_configuration_uri();
|
||||
curpage = 0;
|
||||
g_idle_add((GSourceFunc)destroy_assistant, w);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
GtkEntry *username_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p2_entry_username"));
|
||||
GtkEntry *domain_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p2_entry_domain"));
|
||||
GtkEntry *proxy_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p2_entry_proxy"));
|
||||
GtkEntry *password_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p2_entry_password"));
|
||||
linphone_account_creator_set_username(creator, gtk_entry_get_text(username_entry));
|
||||
linphone_account_creator_set_domain(creator, gtk_entry_get_text(domain_entry));
|
||||
linphone_account_creator_set_route(creator, gtk_entry_get_text(proxy_entry));
|
||||
linphone_account_creator_set_password(creator, gtk_entry_get_text(password_entry));
|
||||
curpage = 9; // Go to page_9_finish
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
GtkEntry *username_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p3_entry_username"));
|
||||
GtkEntry *password_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p3_entry_password"));
|
||||
linphone_account_creator_set_username(creator, gtk_entry_get_text(username_entry));
|
||||
linphone_account_creator_set_domain(creator, "sip.linphone.org");
|
||||
linphone_account_creator_set_route(creator, "sip.linphone.org");
|
||||
linphone_account_creator_set_password(creator, gtk_entry_get_text(password_entry));
|
||||
curpage = 9; // Go to page_9_finish
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
GtkEntry *password_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p4_entry_password1"));
|
||||
GtkEntry *username_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p4_entry_username"));
|
||||
GtkEntry *email_entry = GTK_ENTRY(linphone_gtk_get_widget(w, "p4_entry_email"));
|
||||
//GtkToggleButton *newsletter = GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(w, "p4_check_newsletter"));
|
||||
linphone_account_creator_set_username(creator, gtk_entry_get_text(username_entry));
|
||||
linphone_account_creator_set_password(creator, gtk_entry_get_text(password_entry));
|
||||
linphone_account_creator_set_email(creator, gtk_entry_get_text(email_entry));
|
||||
//linphone_account_creator_enable_newsletter_subscription(creator, gtk_toggle_button_get_active(newsletter));
|
||||
curpage = 5; // Go to page_5_linphone_account_creation_in_progress
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
curpage = 7; // Go to page_7_linphone_account_validation_check_in_progress
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return curpage;
|
||||
}
|
||||
|
||||
static int external_account_configuration_complete(GtkWidget *page) {
|
||||
GtkWidget *assistant = gtk_widget_get_toplevel(page);
|
||||
GtkEntry* username = GTK_ENTRY(linphone_gtk_get_widget(assistant, "p2_entry_username"));
|
||||
GtkEntry* domain = GTK_ENTRY(linphone_gtk_get_widget(assistant, "p2_entry_domain"));
|
||||
|
||||
if ((gtk_entry_get_text_length(username) > 0)
|
||||
&& (gtk_entry_get_text_length(domain) > 0)
|
||||
&& (g_regex_match_simple("^[a-zA-Z0-9+]+[a-zA-Z0-9.\\+\\-_]{2,}$", gtk_entry_get_text(username), 0, 0))
|
||||
&& (g_regex_match_simple("^(sip:)?([a-zA-Z0-9\\+]+([\\.-][a-zA-Z0-9+]+)*)$", gtk_entry_get_text(domain), 0, 0))) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void linphone_gtk_external_account_configuration_changed(GtkEntry *entry) {
|
||||
GtkWidget *assistant = gtk_widget_get_toplevel(GTK_WIDGET(entry));
|
||||
gint current_page_num = gtk_assistant_get_current_page(GTK_ASSISTANT(assistant));
|
||||
GtkWidget *page = gtk_assistant_get_nth_page(GTK_ASSISTANT(assistant), current_page_num);
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant), page, external_account_configuration_complete(page) > 0);
|
||||
}
|
||||
|
||||
static bool_t check_username_validity(const char *username) {
|
||||
return username && g_regex_match_simple("^[a-zA-Z]+[a-zA-Z0-9.\\-_]{3,}$", username, 0, 0);
|
||||
}
|
||||
|
||||
void linphone_gtk_account_configuration_changed(GtkEntry *entry, GtkAssistant *assistant) {
|
||||
gboolean complete = check_username_validity(gtk_entry_get_text(entry));
|
||||
GtkWidget *page = gtk_assistant_get_nth_page(assistant, gtk_assistant_get_current_page(assistant));
|
||||
gtk_assistant_set_page_complete(assistant, page, complete);
|
||||
}
|
||||
|
||||
static gboolean linphone_account_creation_configuration_correct(GtkWidget *w) {
|
||||
gint is_username_available = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w), "is_username_available"));
|
||||
gint is_email_correct = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w), "is_email_correct"));
|
||||
gint is_password_correct = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w), "is_password_correct"));
|
||||
return (is_username_available && is_email_correct && is_password_correct);
|
||||
}
|
||||
|
||||
static gboolean update_interface_with_username_availability(GtkWidget *page) {
|
||||
GtkWidget *assistant = gtk_widget_get_toplevel(page);
|
||||
GtkImage* isUsernameOk = GTK_IMAGE(linphone_gtk_get_widget(assistant, "p4_image_username_ok"));
|
||||
GtkLabel* usernameError = GTK_LABEL(linphone_gtk_get_widget(assistant, "p4_label_error"));
|
||||
int account_status = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(page), "is_username_used"));
|
||||
|
||||
if (account_status == LinphoneAccountCreatorStatusAccountNotExist) {
|
||||
g_object_set_data(G_OBJECT(page), "is_username_available", GINT_TO_POINTER(1));
|
||||
gtk_image_set_from_stock(isUsernameOk, GTK_STOCK_OK, GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
gtk_label_set_text(usernameError, "");
|
||||
} else if (account_status == LinphoneAccountCreatorStatusAccountExist) {
|
||||
gtk_label_set_text(usernameError, _("Username is already in use!"));
|
||||
g_object_set_data(G_OBJECT(page), "is_username_available", GINT_TO_POINTER(0));
|
||||
gtk_image_set_from_stock(isUsernameOk, GTK_STOCK_NO, GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
} else {
|
||||
gtk_label_set_text(usernameError, _("Failed to check username availability. Please try again later."));
|
||||
g_object_set_data(G_OBJECT(page), "is_username_available", GINT_TO_POINTER(0));
|
||||
gtk_image_set_from_stock(isUsernameOk, GTK_STOCK_NO, GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
}
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant), page, linphone_account_creation_configuration_correct(page) > 0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void linphone_gtk_test_account_existence_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp) {
|
||||
GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator);
|
||||
GtkWidget *page = gtk_assistant_get_nth_page(GTK_ASSISTANT(assistant), gtk_assistant_get_current_page(GTK_ASSISTANT(assistant)));
|
||||
g_object_set_data(G_OBJECT(page), "is_username_used", GINT_TO_POINTER(status));
|
||||
gdk_threads_add_idle((GSourceFunc)update_interface_with_username_availability, page);
|
||||
}
|
||||
|
||||
static gboolean check_username_availability(GtkWidget *assistant) {
|
||||
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(assistant);
|
||||
GtkWidget *page = gtk_assistant_get_nth_page(GTK_ASSISTANT(assistant), gtk_assistant_get_current_page(GTK_ASSISTANT(assistant)));
|
||||
g_object_set_data(G_OBJECT(page), "usernameAvailabilityTimerID", GUINT_TO_POINTER(0));
|
||||
linphone_account_creator_is_account_exist(creator);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void linphone_gtk_account_creation_username_changed(GtkEntry *entry) {
|
||||
GtkWidget *assistant = gtk_widget_get_toplevel(GTK_WIDGET(entry));
|
||||
GtkEntry* username = GTK_ENTRY(linphone_gtk_get_widget(assistant, "p4_entry_username"));
|
||||
GtkImage* isUsernameOk = GTK_IMAGE(linphone_gtk_get_widget(assistant, "p4_image_username_ok"));
|
||||
GtkLabel* usernameError = GTK_LABEL(linphone_gtk_get_widget(assistant, "p4_label_error"));
|
||||
gint current_page_num = gtk_assistant_get_current_page(GTK_ASSISTANT(assistant));
|
||||
GtkWidget *page = gtk_assistant_get_nth_page(GTK_ASSISTANT(assistant), current_page_num);
|
||||
|
||||
LinphoneAccountCreator *creator = linphone_gtk_assistant_get_creator(assistant);
|
||||
linphone_account_creator_set_username(creator, gtk_entry_get_text(username));
|
||||
linphone_account_creator_set_domain(creator, "sip.linphone.org");
|
||||
linphone_account_creator_set_route(creator, "sip.linphone.org");
|
||||
|
||||
if (check_username_validity(gtk_entry_get_text(username))) {
|
||||
guint timerID = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(page), "usernameAvailabilityTimerID"));
|
||||
if (timerID > 0) {
|
||||
g_source_remove(timerID);
|
||||
}
|
||||
timerID = g_timeout_add(500, (GSourceFunc)check_username_availability, assistant);
|
||||
g_object_set_data(G_OBJECT(page), "usernameAvailabilityTimerID", GUINT_TO_POINTER(timerID));
|
||||
} else {
|
||||
if (gtk_entry_get_text_length(username) < LOGIN_MIN_SIZE) {
|
||||
gtk_label_set_text(usernameError, "Username is too short");
|
||||
} else if (!check_username_validity(gtk_entry_get_text(username))) {
|
||||
gtk_label_set_text(usernameError, "Unauthorized username");
|
||||
}
|
||||
g_object_set_data(G_OBJECT(page), "is_username_available", GINT_TO_POINTER(0));
|
||||
gtk_image_set_from_stock(isUsernameOk, GTK_STOCK_NO, GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant), page, linphone_account_creation_configuration_correct(page) > 0);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_account_creation_email_changed(GtkEntry *entry) {
|
||||
GtkWidget *assistant = gtk_widget_get_toplevel(GTK_WIDGET(entry));
|
||||
GtkEntry* email = GTK_ENTRY(linphone_gtk_get_widget(assistant, "p4_entry_email"));
|
||||
GtkImage* isEmailOk = GTK_IMAGE(linphone_gtk_get_widget(assistant, "p4_image_email_ok"));
|
||||
gint current_page_num = gtk_assistant_get_current_page(GTK_ASSISTANT(assistant));
|
||||
GtkWidget *page = gtk_assistant_get_nth_page(GTK_ASSISTANT(assistant), current_page_num);
|
||||
|
||||
if (g_regex_match_simple("^" BC_REGEX_RESTRICTIVE_EMAIL_ADDR "$", gtk_entry_get_text(email), 0, 0)) {
|
||||
g_object_set_data(G_OBJECT(page), "is_email_correct", GINT_TO_POINTER(1));
|
||||
gtk_image_set_from_stock(isEmailOk, GTK_STOCK_OK, GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
} else {
|
||||
g_object_set_data(G_OBJECT(page), "is_email_correct", GINT_TO_POINTER(0));
|
||||
gtk_image_set_from_stock(isEmailOk, GTK_STOCK_NO, GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
}
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant), page, linphone_account_creation_configuration_correct(page) > 0);
|
||||
}
|
||||
|
||||
void linphone_gtk_account_creation_password_changed(GtkEntry *entry) {
|
||||
GtkWidget *assistant = gtk_widget_get_toplevel(GTK_WIDGET(entry));
|
||||
GtkEntry* password = GTK_ENTRY(linphone_gtk_get_widget(assistant, "p4_entry_password1"));
|
||||
GtkEntry* password_confirm = GTK_ENTRY(linphone_gtk_get_widget(assistant, "p4_entry_password2"));
|
||||
GtkImage* isPasswordOk = GTK_IMAGE(linphone_gtk_get_widget(assistant, "p4_image_password_ok"));
|
||||
GtkLabel* passwordError = GTK_LABEL(linphone_gtk_get_widget(assistant, "p4_label_error"));
|
||||
gint current_page_num = gtk_assistant_get_current_page(GTK_ASSISTANT(assistant));
|
||||
GtkWidget *page = gtk_assistant_get_nth_page(GTK_ASSISTANT(assistant), current_page_num);
|
||||
|
||||
if ((gtk_entry_get_text_length(password) >= PASSWORD_MIN_SIZE)
|
||||
&& (g_ascii_strcasecmp(gtk_entry_get_text(password), gtk_entry_get_text(password_confirm)) == 0)) {
|
||||
g_object_set_data(G_OBJECT(page), "is_password_correct", GINT_TO_POINTER(1));
|
||||
gtk_image_set_from_stock(isPasswordOk, GTK_STOCK_OK, GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
gtk_label_set_text(passwordError, "");
|
||||
} else {
|
||||
if (gtk_entry_get_text_length(password) < PASSWORD_MIN_SIZE) {
|
||||
gtk_label_set_text(passwordError, "Password is too short !");
|
||||
} else if (g_ascii_strcasecmp(gtk_entry_get_text(password), gtk_entry_get_text(password_confirm)) != 0) {
|
||||
gtk_label_set_text(passwordError, "Passwords don't match !");
|
||||
}
|
||||
g_object_set_data(G_OBJECT(page), "is_password_correct", GINT_TO_POINTER(0));
|
||||
gtk_image_set_from_stock(isPasswordOk, GTK_STOCK_NO, GTK_ICON_SIZE_LARGE_TOOLBAR);
|
||||
}
|
||||
gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant), page, linphone_account_creation_configuration_correct(page) > 0);
|
||||
}
|
||||
|
||||
static void linphone_gtk_assistant_init(GtkWidget *w) {
|
||||
LinphoneAccountCreator *creator = linphone_account_creator_new(linphone_gtk_get_core(), "https://subscribe.linphone.org:444/wizard.php");
|
||||
LinphoneAccountCreatorCbs *cbs = linphone_account_creator_get_callbacks(creator);
|
||||
linphone_account_creator_set_user_data(creator, w);
|
||||
linphone_account_creator_cbs_set_is_account_exist(cbs, linphone_gtk_test_account_existence_cb);
|
||||
linphone_account_creator_cbs_set_is_account_activated(cbs, linphone_gtk_test_account_validation_cb);
|
||||
linphone_account_creator_cbs_set_create_account(cbs, linphone_gtk_create_account_cb);
|
||||
g_object_set_data(G_OBJECT(w), "creator", creator);
|
||||
|
||||
gtk_assistant_set_forward_page_func(GTK_ASSISTANT(w), linphone_gtk_assistant_forward, w, NULL);
|
||||
}
|
||||
|
||||
void linphone_gtk_show_assistant(void) {
|
||||
if (the_assistant != NULL) return;
|
||||
the_assistant = linphone_gtk_create_window("setup_wizard", linphone_gtk_get_main_window());
|
||||
linphone_gtk_assistant_init(the_assistant);
|
||||
gtk_widget_show(the_assistant);
|
||||
}
|
||||
|
||||
void linphone_gtk_close_assistant(void) {
|
||||
GtkWidget *mw;
|
||||
if (the_assistant == NULL) {
|
||||
return;
|
||||
}
|
||||
gtk_widget_destroy(the_assistant);
|
||||
the_assistant = NULL;
|
||||
|
||||
//reload list of proxy configs because a new one was probably created...
|
||||
mw=linphone_gtk_get_main_window();
|
||||
if (mw) {
|
||||
GtkWidget* pb = (GtkWidget*)g_object_get_data(G_OBJECT(mw),"parameters");
|
||||
if (pb) {
|
||||
linphone_gtk_show_sip_accounts(pb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef SETUP_WIZARD_H
|
||||
#define SETUP_WIZARD_H
|
||||
|
||||
#include "linphone/sipsetup.h"
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_show_assistant(void);
|
||||
LINPHONE_PUBLIC void linphone_gtk_assistant_prepare(GtkWidget *assistant);
|
||||
LINPHONE_PUBLIC void linphone_gtk_assistant_closed(GtkWidget *w);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_gtk_external_account_configuration_changed(GtkEntry* entry);
|
||||
LINPHONE_PUBLIC void linphone_gtk_account_configuration_changed(GtkEntry *entry, GtkAssistant *assistant);
|
||||
LINPHONE_PUBLIC void linphone_gtk_account_creation_username_changed(GtkEntry *entry);
|
||||
LINPHONE_PUBLIC void linphone_gtk_account_creation_password_changed(GtkEntry *entry);
|
||||
LINPHONE_PUBLIC void linphone_gtk_account_creation_email_changed(GtkEntry *entry);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
/*
|
||||
linphone, gtk interface.
|
||||
Copyright (C) 2011 Belledonne Communications SARL
|
||||
Author: 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
static ms_thread_t pipe_thread;
|
||||
static ortp_pipe_t server_pipe=(ortp_pipe_t)-1;
|
||||
static gboolean server_pipe_running=TRUE;
|
||||
static char *pipe_name=NULL;
|
||||
|
||||
gchar *make_name(const char *appname){
|
||||
const char *username=getenv("USER");
|
||||
if (username){
|
||||
return g_strdup_printf("%s-%s",appname,username);
|
||||
}
|
||||
return g_strdup(appname);
|
||||
}
|
||||
|
||||
static gboolean execute_wakeup(char *buf){
|
||||
char uri[255]={0};
|
||||
int option;
|
||||
|
||||
if (strlen(buf)>1) sscanf(buf,"%i%s",&option,uri);
|
||||
else sscanf(buf,"%i",&option);
|
||||
|
||||
switch(option){
|
||||
case START_LINPHONE:
|
||||
linphone_gtk_show_main_window();
|
||||
break;
|
||||
case START_AUDIO_ASSISTANT:
|
||||
linphone_gtk_show_audio_assistant();
|
||||
break;
|
||||
case START_LINPHONE_WITH_CALL:
|
||||
linphone_gtk_refer_received(linphone_gtk_get_core(),uri);
|
||||
break;
|
||||
};
|
||||
|
||||
g_free(buf);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void * server_pipe_thread(void *pointer){
|
||||
ortp_pipe_t child;
|
||||
|
||||
do{
|
||||
child=ortp_server_pipe_accept_client(server_pipe);
|
||||
if (server_pipe_running && child!=(ortp_pipe_t)-1){
|
||||
char buf[256]={0};
|
||||
if (ortp_pipe_read(child,(uint8_t*)buf,sizeof(buf))>0){
|
||||
g_message("Received wakeup command with arg %s",buf);
|
||||
gdk_threads_enter();
|
||||
g_timeout_add(20,(GSourceFunc)execute_wakeup,g_strdup(buf));
|
||||
gdk_threads_leave();
|
||||
}
|
||||
ortp_server_pipe_close_client(child);
|
||||
}
|
||||
}while(server_pipe_running);
|
||||
ortp_server_pipe_close(server_pipe);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void linphone_gtk_init_pipe(const char *name){
|
||||
server_pipe=ortp_server_pipe_create(name);
|
||||
if (server_pipe==(ortp_pipe_t)-1){
|
||||
g_warning("Fail to create server pipe for name %s: %s",name,strerror(errno));
|
||||
return;
|
||||
}
|
||||
server_pipe_running=TRUE;
|
||||
ms_thread_create(&pipe_thread,NULL,server_pipe_thread,NULL);
|
||||
}
|
||||
|
||||
bool_t linphone_gtk_init_instance(const char *app_name, int option, const char *addr_to_call){
|
||||
ortp_pipe_t p;
|
||||
pipe_name=make_name(app_name);
|
||||
p=ortp_client_pipe_connect(pipe_name);
|
||||
if (p!=(ortp_pipe_t)-1){
|
||||
uint8_t buf[256]={0};
|
||||
g_message("There is already a running instance.");
|
||||
if (addr_to_call!=NULL){
|
||||
sprintf((char *)buf,"%i%s",option,addr_to_call);
|
||||
} else {
|
||||
sprintf((char *)buf,"%i",option);
|
||||
}
|
||||
if (ortp_pipe_write(p,buf,sizeof(buf))==-1){
|
||||
g_error("Fail to send wakeup command to running instance: %s",strerror(errno));
|
||||
}else{
|
||||
g_message("Message to running instance sent.");
|
||||
}
|
||||
ortp_client_pipe_close(p);
|
||||
return FALSE;
|
||||
}else{
|
||||
linphone_gtk_init_pipe(pipe_name);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void linphone_gtk_uninit_instance(void){
|
||||
if (server_pipe!=(ortp_pipe_t)-1){
|
||||
ortp_pipe_t client;
|
||||
server_pipe_running=FALSE;
|
||||
/*this is to unblock the accept() of the server pipe*/
|
||||
client=ortp_client_pipe_connect(pipe_name);
|
||||
ortp_pipe_write(client,(uint8_t*)" ",1);
|
||||
ortp_client_pipe_close(client);
|
||||
ms_thread_join(pipe_thread,NULL);
|
||||
server_pipe=(ortp_pipe_t)-1;
|
||||
g_free(pipe_name);
|
||||
pipe_name=NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,395 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 2.6 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="upper">100000</property>
|
||||
<property name="value">3600</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment2">
|
||||
<property name="upper">5</property>
|
||||
<property name="lower">1</property>
|
||||
<property name="value">5</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">1</property>
|
||||
</object>
|
||||
<object class="GtkDialog" id="sip_account">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Linphone - Configure a SIP account</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button6">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_proxy_ok" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button7">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_proxy_cancel" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame15">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment15">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox11">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="n_rows">6</property>
|
||||
<property name="n_columns">2</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label38">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Your SIP identity:</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="identity">
|
||||
<property name="width_request">275</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip_text" translatable="yes">Looks like sip:<username>@<domain></property>
|
||||
<property name="text" translatable="yes">sip:</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label39">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">SIP Proxy address:</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="proxy">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="tooltip_text" translatable="yes">Looks like sip:<proxy hostname></property>
|
||||
<property name="text" translatable="yes">sip:</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<signal name="changed" handler="linphone_gtk_proxy_address_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="route">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label41">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Registration duration (sec):</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="regperiod">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="contactParams">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Contact params (optional):</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="params">
|
||||
<property name="width_request">275</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="invisible_char">•</property>
|
||||
<property name="invisible_char_set">True</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="avpf_rr_interval_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">AVPF regular RTCP interval (sec):</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="avpf_rr_interval">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="bottom_attach">7</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label40">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Route (optional):</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Transport</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="transport">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<signal name="changed" handler="linphone_gtk_proxy_transport_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="register">
|
||||
<property name="label" translatable="yes">Register</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="publish">
|
||||
<property name="label" translatable="yes">Publish presence information</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="avpf">
|
||||
<property name="label" translatable="yes">Enable AVPF</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label42">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Configure a SIP account</property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="0">button6</action-widget>
|
||||
<action-widget response="0">button7</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
@ -1,546 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2015 Belledonne Communications <info@belledonne-communications.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU 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 "status_icon.h"
|
||||
#include "linphone.h"
|
||||
|
||||
#ifdef HAVE_GTK_OSX
|
||||
#include <gtkosxapplication.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32) && !defined(__APPLE__) && GLIB_CHECK_VERSION(2, 26, 0)
|
||||
#define STATUS_NOTIFIER_IS_USABLE 1
|
||||
#endif
|
||||
|
||||
#include "status_notifier.h"
|
||||
#include <mediastreamer2/mscommon.h>
|
||||
|
||||
typedef struct __LinphoneStatusIconDesc _LinphoneStatusIconDesc;
|
||||
|
||||
static LinphoneStatusIcon *_linphone_status_icon_instance = NULL;
|
||||
static const _LinphoneStatusIconDesc *_linphone_status_icon_selected_desc = NULL;
|
||||
static GSList *_linphone_status_icon_impls = NULL;
|
||||
|
||||
|
||||
struct _LinphoneStatusIconParams {
|
||||
char *title;
|
||||
char *desc;
|
||||
GtkWidget *menu;
|
||||
LinphoneStatusIconOnClickCallback on_click_cb;
|
||||
void *user_data;
|
||||
int ref;
|
||||
};
|
||||
|
||||
LinphoneStatusIconParams *linphone_status_icon_params_new(void) {
|
||||
return g_new0(LinphoneStatusIconParams, 1);
|
||||
}
|
||||
|
||||
LinphoneStatusIconParams *linphone_status_icon_params_ref(LinphoneStatusIconParams *obj) {
|
||||
obj->ref++;
|
||||
return obj;
|
||||
}
|
||||
|
||||
void linphone_status_icon_params_unref(LinphoneStatusIconParams *obj) {
|
||||
obj->ref--;
|
||||
if(obj->ref < 0) {
|
||||
if(obj->title) g_free(obj->title);
|
||||
if(obj->menu) g_object_unref(obj->menu);
|
||||
if(obj->desc) g_free(obj->desc);
|
||||
g_free(obj);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_status_icon_params_set_title(LinphoneStatusIconParams *obj, const char *title) {
|
||||
if(obj->title) g_free(obj->title);
|
||||
if(title) obj->title = g_strdup(title);
|
||||
else obj->title = NULL;
|
||||
}
|
||||
|
||||
void linphone_status_icon_params_set_description(LinphoneStatusIconParams *obj, const char *desc) {
|
||||
if(obj->desc) g_free(obj->desc);
|
||||
if(desc) obj->desc = g_strdup(desc);
|
||||
else obj->desc = NULL;
|
||||
}
|
||||
|
||||
void linphone_status_icon_params_set_menu(LinphoneStatusIconParams *obj, GtkWidget *menu) {
|
||||
if(obj->menu) g_object_unref(obj->menu);
|
||||
if(menu) obj->menu = g_object_ref_sink(menu);
|
||||
else obj->menu = NULL;
|
||||
}
|
||||
|
||||
void linphone_status_icon_params_set_on_click_cb(LinphoneStatusIconParams *obj, LinphoneStatusIconOnClickCallback cb, void *user_data) {
|
||||
obj->on_click_cb = cb;
|
||||
obj->user_data = user_data;
|
||||
}
|
||||
|
||||
|
||||
typedef void (*LinphoneStatusIconDescInitFunc)(LinphoneStatusIcon *obj);
|
||||
typedef void (*LinphoneStatusIconDescUninitFunc)(LinphoneStatusIcon *obj);
|
||||
typedef void (*LinphoneStatusIconDescStartFunc)(LinphoneStatusIcon *obj);
|
||||
typedef void (*LinphoneStatusIconDescEnableBlinkingFunc)(LinphoneStatusIcon *obj, gboolean enable);
|
||||
typedef void (*LinphoneStatusIconDescIsSupportedResultCb)(const _LinphoneStatusIconDesc *obj, gboolean result, void *user_data);
|
||||
typedef gboolean (*LinphoneStatusIconDescIsSupportedFunc)(
|
||||
const _LinphoneStatusIconDesc *desc,
|
||||
gboolean *result,
|
||||
LinphoneStatusIconDescIsSupportedResultCb cb,
|
||||
void *user_data
|
||||
);
|
||||
typedef void (*LinphoneStatusIconDescFindResultCb)(const _LinphoneStatusIconDesc *desc, void *user_data);
|
||||
|
||||
struct __LinphoneStatusIconDesc {
|
||||
const char *impl_name;
|
||||
LinphoneStatusIconDescInitFunc init;
|
||||
LinphoneStatusIconDescUninitFunc uninit;
|
||||
LinphoneStatusIconDescStartFunc start;
|
||||
LinphoneStatusIconDescEnableBlinkingFunc enable_blinking;
|
||||
LinphoneStatusIconDescIsSupportedFunc is_supported;
|
||||
};
|
||||
|
||||
static gboolean _linphone_status_icon_desc_is_supported(
|
||||
const _LinphoneStatusIconDesc *desc,
|
||||
gboolean *result,
|
||||
LinphoneStatusIconDescIsSupportedResultCb cb,
|
||||
void *user_data) {
|
||||
|
||||
return desc->is_supported(desc, result, cb, user_data);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GSList *i;
|
||||
LinphoneStatusIconDescFindResultCb cb;
|
||||
void *user_data;
|
||||
} _LinphoneStatusIconDescSearchCtx;
|
||||
|
||||
static void _linphone_status_icon_desc_is_supported_result_cb(
|
||||
const _LinphoneStatusIconDesc *desc,
|
||||
gboolean result,
|
||||
_LinphoneStatusIconDescSearchCtx *ctx) {
|
||||
|
||||
if(!result) {
|
||||
ctx->i = g_slist_next(ctx->i);
|
||||
for(; ctx->i; ctx->i = g_slist_next(ctx->i)) {
|
||||
if(_linphone_status_icon_desc_is_supported(
|
||||
(const _LinphoneStatusIconDesc *)g_slist_nth_data(ctx->i, 0),
|
||||
&result,
|
||||
(LinphoneStatusIconDescIsSupportedResultCb)_linphone_status_icon_desc_is_supported_result_cb,
|
||||
ctx)) {
|
||||
|
||||
if(result) break;
|
||||
} else return;
|
||||
}
|
||||
}
|
||||
|
||||
if(ctx->i) {
|
||||
const _LinphoneStatusIconDesc *desc = (const _LinphoneStatusIconDesc *)g_slist_nth_data(ctx->i, 0);
|
||||
ms_message("StatusIcon: found implementation: %s", desc->impl_name);
|
||||
if(ctx->cb) ctx->cb(desc, ctx->user_data);
|
||||
} else {
|
||||
g_warning("StatusIcon: no implementation found");
|
||||
}
|
||||
|
||||
g_free(ctx);
|
||||
}
|
||||
|
||||
static gboolean _linphone_status_icon_find_first_available_impl(
|
||||
const _LinphoneStatusIconDesc **desc,
|
||||
LinphoneStatusIconDescFindResultCb cb,
|
||||
void *user_data) {
|
||||
|
||||
gboolean result;
|
||||
_LinphoneStatusIconDescSearchCtx *ctx = g_new0(_LinphoneStatusIconDescSearchCtx, 1);
|
||||
ctx->cb = cb;
|
||||
ctx->user_data = user_data;
|
||||
|
||||
ms_message("StatusIcon: looking for implementation...");
|
||||
|
||||
for(ctx->i=_linphone_status_icon_impls; ctx->i; ctx->i = g_slist_next(ctx->i)) {
|
||||
if(_linphone_status_icon_desc_is_supported(
|
||||
(const _LinphoneStatusIconDesc *)g_slist_nth_data(ctx->i, 0),
|
||||
&result,
|
||||
(LinphoneStatusIconDescIsSupportedResultCb)_linphone_status_icon_desc_is_supported_result_cb,
|
||||
ctx)) {
|
||||
|
||||
if(result) {
|
||||
*desc = (const _LinphoneStatusIconDesc *)g_slist_nth_data(ctx->i, 0);
|
||||
ms_message("StatusIcon: found implementation: %s", (*desc)->impl_name);
|
||||
goto sync_return;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
g_warning("StatusIcon: no implementation found");
|
||||
*desc = NULL;
|
||||
|
||||
sync_return:
|
||||
g_free(ctx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
struct _LinphoneStatusIcon {
|
||||
const _LinphoneStatusIconDesc *desc;
|
||||
LinphoneStatusIconParams *params;
|
||||
void *data;
|
||||
};
|
||||
|
||||
static LinphoneStatusIcon *_linphone_status_icon_new(const _LinphoneStatusIconDesc *desc) {
|
||||
LinphoneStatusIcon *si = (LinphoneStatusIcon *)g_new0(LinphoneStatusIcon, 1);
|
||||
si->desc = desc;
|
||||
if(desc->init) desc->init(si);
|
||||
return si;
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_free(LinphoneStatusIcon *obj) {
|
||||
if(obj->desc->uninit) obj->desc->uninit(obj);
|
||||
if(obj->params) linphone_status_icon_params_unref(obj->params);
|
||||
g_free(obj);
|
||||
}
|
||||
|
||||
const char *linphone_status_icon_get_implementation_name(const LinphoneStatusIcon *obj) {
|
||||
return obj->desc->impl_name;
|
||||
}
|
||||
|
||||
void linphone_status_icon_start(LinphoneStatusIcon *obj, LinphoneStatusIconParams *params) {
|
||||
ms_message("StatusIcon: starting status icon");
|
||||
obj->params = linphone_status_icon_params_ref(params);
|
||||
if(obj->desc->start) obj->desc->start(obj);
|
||||
}
|
||||
|
||||
void linphone_status_icon_enable_blinking(LinphoneStatusIcon *obj, gboolean enable) {
|
||||
ms_message("StatusIcon: blinking set to %s", enable ? "TRUE" : "FALSE");
|
||||
if(obj->desc->enable_blinking) obj->desc->enable_blinking(obj, enable);
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_notify_click(LinphoneStatusIcon *obj) {
|
||||
if(obj->params->on_click_cb) {
|
||||
obj->params->on_click_cb(obj, obj->params->user_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _linphone_status_icon_init_cb(const _LinphoneStatusIconDesc *desc, void *user_data) {
|
||||
void **ctx = (void **)user_data;
|
||||
LinphoneStatusIconReadyCb cb = (LinphoneStatusIconReadyCb)ctx[0];
|
||||
_linphone_status_icon_selected_desc = desc;
|
||||
if(cb) cb(ctx[1]);
|
||||
g_free(ctx);
|
||||
}
|
||||
|
||||
#ifdef STATUS_NOTIFIER_IS_USABLE
|
||||
static const _LinphoneStatusIconDesc _linphone_status_icon_impl_status_notifier;
|
||||
#endif
|
||||
#ifdef HAVE_GTK_OSX
|
||||
static const _LinphoneStatusIconDesc _linphone_status_icon_impl_gtkosx_app_desc;
|
||||
#else
|
||||
static const _LinphoneStatusIconDesc _linphone_status_icon_impl_gtk_desc;
|
||||
#endif
|
||||
|
||||
void _linphone_status_icon_create_implementations_list(void) {
|
||||
#ifdef STATUS_NOTIFIER_IS_USABLE
|
||||
_linphone_status_icon_impls = g_slist_append(_linphone_status_icon_impls, (void *)&_linphone_status_icon_impl_status_notifier);
|
||||
#endif
|
||||
#if HAVE_GTK_OSX
|
||||
_linphone_status_icon_impls = g_slist_append(_linphone_status_icon_impls, (void *)&_linphone_status_icon_impl_gtkosx_app_desc);
|
||||
#else
|
||||
_linphone_status_icon_impls = g_slist_append(_linphone_status_icon_impls, (void *)&_linphone_status_icon_impl_gtk_desc);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean linphone_status_icon_init(LinphoneStatusIconReadyCb ready_cb, void *user_data) {
|
||||
const _LinphoneStatusIconDesc *desc;
|
||||
void **ctx;
|
||||
|
||||
ms_message("StatusIcon: Initialising");
|
||||
|
||||
_linphone_status_icon_create_implementations_list();
|
||||
|
||||
ctx = g_new(void *, 2);
|
||||
ctx[0] = ready_cb;
|
||||
ctx[1] = user_data;
|
||||
|
||||
if(_linphone_status_icon_find_first_available_impl(&desc, _linphone_status_icon_init_cb, ctx)) {
|
||||
_linphone_status_icon_selected_desc = desc;
|
||||
g_free(ctx);
|
||||
return 1;
|
||||
} else return 0;
|
||||
}
|
||||
|
||||
void linphone_status_icon_uninit(void) {
|
||||
if(_linphone_status_icon_instance) {
|
||||
_linphone_status_icon_free(_linphone_status_icon_instance);
|
||||
_linphone_status_icon_instance = NULL;
|
||||
}
|
||||
if(_linphone_status_icon_impls) {
|
||||
g_slist_free(_linphone_status_icon_impls);
|
||||
_linphone_status_icon_impls = NULL;
|
||||
}
|
||||
_linphone_status_icon_selected_desc = NULL;
|
||||
}
|
||||
|
||||
LinphoneStatusIcon *linphone_status_icon_get(void) {
|
||||
if(_linphone_status_icon_instance == NULL) {
|
||||
if(_linphone_status_icon_selected_desc)
|
||||
ms_message("StatusIcon: instanciating singleton");
|
||||
_linphone_status_icon_instance = _linphone_status_icon_new(_linphone_status_icon_selected_desc);
|
||||
}
|
||||
return _linphone_status_icon_instance;
|
||||
}
|
||||
|
||||
|
||||
/* GtkStatusIcon implementation */
|
||||
#ifndef HAVE_GTK_OSX
|
||||
static void _linphone_status_icon_impl_gtk_on_click_cb(LinphoneStatusIcon *si) {
|
||||
_linphone_status_icon_notify_click(si);
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impl_gtk_popup_menu(GtkStatusIcon *status_icon, guint button, guint activate_time, LinphoneStatusIcon *si){
|
||||
GtkWidget *menu = si->params->menu;
|
||||
gtk_menu_popup(GTK_MENU(menu),NULL,NULL,gtk_status_icon_position_menu,status_icon,button,activate_time);
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impl_gtk_init(LinphoneStatusIcon *si) {
|
||||
const char *icon_name=linphone_gtk_get_ui_config("icon_name",LINPHONE_ICON_NAME);
|
||||
const char *blinking_icon_name=linphone_gtk_get_ui_config("binking_status_icon_name","linphone-start-call");
|
||||
GtkStatusIcon *icon=gtk_status_icon_new_from_icon_name(icon_name);
|
||||
g_signal_connect_swapped(G_OBJECT(icon),"activate", G_CALLBACK(_linphone_status_icon_impl_gtk_on_click_cb), si);
|
||||
g_signal_connect(G_OBJECT(icon), "popup-menu", G_CALLBACK(_linphone_status_icon_impl_gtk_popup_menu), si);
|
||||
g_object_set_data_full(G_OBJECT(icon), "icon", g_strdup(icon_name), g_free);
|
||||
g_object_set_data_full(G_OBJECT(icon), "call_icon", g_strdup(blinking_icon_name), g_free);
|
||||
si->data = icon;
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impl_gtk_uninit(LinphoneStatusIcon *si) {
|
||||
GtkStatusIcon *icon = GTK_STATUS_ICON(si->data);
|
||||
gtk_status_icon_set_visible(icon, FALSE);
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impl_gtk_start(LinphoneStatusIcon *si) {
|
||||
GtkStatusIcon *icon = GTK_STATUS_ICON(si->data);
|
||||
#if GTK_CHECK_VERSION(2,20,2)
|
||||
char *name = g_strdup_printf("%s - %s", si->params->title, si->params->desc);
|
||||
gtk_status_icon_set_name(icon, name);
|
||||
g_free(name);
|
||||
#endif
|
||||
gtk_status_icon_set_visible(icon,TRUE);
|
||||
}
|
||||
|
||||
static gboolean _linphone_status_icon_impl_gtk_do_icon_blink_cb(GtkStatusIcon *gi){
|
||||
const gchar *call_icon = (const gchar *)g_object_get_data(G_OBJECT(gi),"call_icon");
|
||||
const gchar *normal_icon = (const gchar *)g_object_get_data(G_OBJECT(gi),"icon");
|
||||
const gchar *cur_icon = (const gchar *)gtk_status_icon_get_icon_name(gi);
|
||||
if (cur_icon == call_icon){
|
||||
gtk_status_icon_set_from_icon_name(gi,normal_icon);
|
||||
}else{
|
||||
gtk_status_icon_set_from_icon_name(gi,call_icon);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impl_enable_blinking(LinphoneStatusIcon *si, gboolean val) {
|
||||
GtkStatusIcon *icon = GTK_STATUS_ICON(si->data);
|
||||
guint tout;
|
||||
tout=(unsigned)GPOINTER_TO_INT(g_object_get_data(G_OBJECT(icon),"timeout"));
|
||||
if (val && tout==0){
|
||||
tout=g_timeout_add(500,(GSourceFunc)_linphone_status_icon_impl_gtk_do_icon_blink_cb,icon);
|
||||
g_object_set_data(G_OBJECT(icon),"timeout",GINT_TO_POINTER(tout));
|
||||
}else if (!val && tout!=0){
|
||||
const gchar *normal_icon = (const gchar *)g_object_get_data(G_OBJECT(icon),"icon");
|
||||
g_source_remove(tout);
|
||||
g_object_set_data(G_OBJECT(icon),"timeout",NULL);
|
||||
gtk_status_icon_set_from_icon_name(icon,normal_icon);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean _linphone_status_icon_impl_is_supported(
|
||||
const _LinphoneStatusIconDesc *desc,
|
||||
gboolean *result,
|
||||
LinphoneStatusIconDescIsSupportedResultCb cb,
|
||||
void *user_data) {
|
||||
|
||||
*result = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const _LinphoneStatusIconDesc _linphone_status_icon_impl_gtk_desc = {
|
||||
"gtk_status_icon",
|
||||
_linphone_status_icon_impl_gtk_init,
|
||||
_linphone_status_icon_impl_gtk_uninit,
|
||||
_linphone_status_icon_impl_gtk_start,
|
||||
_linphone_status_icon_impl_enable_blinking,
|
||||
_linphone_status_icon_impl_is_supported
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/* GtkosxApplication implementation */
|
||||
#ifdef HAVE_GTK_OSX
|
||||
static void _linphone_status_icon_impl_gtkosx_app_enable_blinking(LinphoneStatusIcon *si, gboolean val) {
|
||||
GtkosxApplication *theMacApp=gtkosx_application_get();
|
||||
gint *attention_id = (gint *)&si->data;
|
||||
if (val) {
|
||||
*attention_id=gtkosx_application_attention_request(theMacApp, CRITICAL_REQUEST);
|
||||
} else if (*attention_id != 0) {
|
||||
gtkosx_application_cancel_attention_request(theMacApp, *attention_id);
|
||||
*attention_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean _linphone_status_icon_impl_gtkosx_app_is_supported(
|
||||
const _LinphoneStatusIconDesc *desc,
|
||||
gboolean *result,
|
||||
LinphoneStatusIconDescIsSupportedResultCb cb,
|
||||
void *user_data) {
|
||||
|
||||
*result = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const _LinphoneStatusIconDesc _linphone_status_icon_impl_gtkosx_app_desc = {
|
||||
.impl_name = "gtkosx_application",
|
||||
.init = NULL,
|
||||
.uninit = NULL,
|
||||
.start = NULL,
|
||||
.enable_blinking = _linphone_status_icon_impl_gtkosx_app_enable_blinking,
|
||||
.is_supported = _linphone_status_icon_impl_gtkosx_app_is_supported
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/* Implementation based on the StatusNotifier Freedesktop standard */
|
||||
#ifdef STATUS_NOTIFIER_IS_USABLE
|
||||
typedef struct {
|
||||
int x;
|
||||
int y;
|
||||
} _LinphoneStatusIconPosition;
|
||||
|
||||
static void _linphone_status_icon_impl_sn_init(LinphoneStatusIcon *si) {
|
||||
si->data = bc_status_notifier_new();
|
||||
}
|
||||
|
||||
// static void _linphone_status_icon_impl_sn_uninit(LinphoneStatusIcon *si) {
|
||||
// bc_status_notifier_unref((BcStatusNotifier *)si->data);
|
||||
// }
|
||||
|
||||
static void _linphone_status_icon_impl_sn_activated_cb(BcStatusNotifier *sn, int x, int y, void *user_data) {
|
||||
LinphoneStatusIcon *si = (LinphoneStatusIcon *)user_data;
|
||||
_linphone_status_icon_notify_click(si);
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impr_sn_get_position(GtkMenu *menu, int *x, int *y, gboolean *push_in, gpointer data) {
|
||||
_LinphoneStatusIconPosition *pos = (_LinphoneStatusIconPosition *)data;
|
||||
*x = pos->x;
|
||||
*y = pos->y;
|
||||
*push_in = TRUE;
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impl_sn_menu_called_cb(BcStatusNotifier *sn, int x, int y, void *user_data) {
|
||||
LinphoneStatusIcon *si = (LinphoneStatusIcon *)user_data;
|
||||
GtkWidget *menu = si->params->menu;
|
||||
_LinphoneStatusIconPosition pos = {x, y};
|
||||
gtk_menu_popup(
|
||||
GTK_MENU(menu),
|
||||
NULL,
|
||||
NULL,
|
||||
_linphone_status_icon_impr_sn_get_position,
|
||||
&pos,
|
||||
0,
|
||||
gtk_get_current_event_time()
|
||||
);
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impl_sn_start(LinphoneStatusIcon *si) {
|
||||
BcStatusNotifier *sn = (BcStatusNotifier *)si->data;
|
||||
BcStatusNotifierParams *params;
|
||||
BcStatusNotifierToolTip *tooltip = bc_status_notifier_tool_tip_new("linphone", si->params->title, si->params->desc);
|
||||
BcStatusNotifierSignalsVTable vtable = {NULL};
|
||||
|
||||
vtable.activate_called_cb = _linphone_status_icon_impl_sn_activated_cb;
|
||||
vtable.context_menu_called_cb = _linphone_status_icon_impl_sn_menu_called_cb;
|
||||
|
||||
params = bc_status_notifier_params_new();
|
||||
bc_status_notifier_params_set_dbus_prefix(params, "org.kde");
|
||||
bc_status_notifier_params_set_category(params, BcStatusNotifierCategoryCommunications);
|
||||
bc_status_notifier_params_set_id(params, "linphone");
|
||||
bc_status_notifier_params_set_title(params, si->params->title);
|
||||
bc_status_notifier_params_set_icon_name(params, "linphone");
|
||||
bc_status_notifier_params_set_tool_tip(params, tooltip);
|
||||
bc_status_notifier_params_set_vtable(params, &vtable, si);
|
||||
|
||||
bc_status_notifier_start(sn, params, NULL, NULL);
|
||||
|
||||
bc_status_notifier_tool_tip_unref(tooltip);
|
||||
bc_status_notifier_params_unref(params);
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impl_sn_enable_blinking(LinphoneStatusIcon *si, gboolean val) {
|
||||
BcStatusNotifier *sn = (BcStatusNotifier *)si->data;
|
||||
if(val) {
|
||||
bc_status_notifier_update_status(sn, BcStatusNotifierStatusNeedsAttention);
|
||||
} else {
|
||||
bc_status_notifier_update_status(sn, BcStatusNotifierStatusPassive);
|
||||
}
|
||||
}
|
||||
|
||||
static void _linphone_status_icon_impl_is_supported_cb(const char *prefix, gboolean result, void **data) {
|
||||
_LinphoneStatusIconDesc *desc = (_LinphoneStatusIconDesc *)data[0];
|
||||
LinphoneStatusIconDescIsSupportedResultCb cb = (LinphoneStatusIconDescIsSupportedResultCb)data[1];
|
||||
if(cb) cb(desc, result, data[2]);
|
||||
g_free(data);
|
||||
g_free(desc);
|
||||
}
|
||||
|
||||
static gboolean _linphone_status_icon_impl_sn_is_supported(
|
||||
const _LinphoneStatusIconDesc *desc,
|
||||
gboolean *result,
|
||||
LinphoneStatusIconDescIsSupportedResultCb cb,
|
||||
void *user_data) {
|
||||
|
||||
_LinphoneStatusIconDesc *desc2;
|
||||
void **data;
|
||||
const char *desktop = g_getenv("XDG_CURRENT_DESKTOP");
|
||||
|
||||
if(desktop == NULL || g_strcmp0(desktop, "KDE") != 0) {
|
||||
*result = FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
desc2 = g_new(_LinphoneStatusIconDesc, 1);
|
||||
*desc2 = *desc;
|
||||
data = g_new(void *, 3);
|
||||
data[0] = desc2;
|
||||
data[1] = cb;
|
||||
data[2] = user_data;
|
||||
bc_status_notifier_is_supported(
|
||||
"org.kde",
|
||||
(BcStatusNotifierSupportDetectionCb)_linphone_status_icon_impl_is_supported_cb,
|
||||
data
|
||||
);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static const _LinphoneStatusIconDesc _linphone_status_icon_impl_status_notifier = {
|
||||
.impl_name = "status_notifier",
|
||||
.init = _linphone_status_icon_impl_sn_init,
|
||||
.uninit = NULL,
|
||||
.start = _linphone_status_icon_impl_sn_start,
|
||||
.enable_blinking = _linphone_status_icon_impl_sn_enable_blinking,
|
||||
.is_supported = _linphone_status_icon_impl_sn_is_supported
|
||||
};
|
||||
#endif
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2015 Belledonne Communications <info@belledonne-communications.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* LinphoneStatusIcon is an singleton interface which abstracts the
|
||||
* technology used to manage the status icon.
|
||||
*/
|
||||
|
||||
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
#ifndef _MSC_VER
|
||||
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
|
||||
struct _LinphoneStatusIcon;
|
||||
typedef void (*LinphoneStatusIconOnClickCallback)(struct _LinphoneStatusIcon *si, void *user_data);
|
||||
|
||||
|
||||
typedef struct _LinphoneStatusIconParams LinphoneStatusIconParams;
|
||||
|
||||
LinphoneStatusIconParams *linphone_status_icon_params_new(void);
|
||||
LinphoneStatusIconParams *linphone_status_icon_params_ref(LinphoneStatusIconParams *obj);
|
||||
void linphone_status_icon_params_unref(LinphoneStatusIconParams *obj);
|
||||
|
||||
void linphone_status_icon_params_set_title(LinphoneStatusIconParams *obj, const char *title);
|
||||
void linphone_status_icon_params_set_description(LinphoneStatusIconParams *obj, const char *desc);
|
||||
void linphone_status_icon_params_set_menu(LinphoneStatusIconParams *obj, GtkWidget *menu);
|
||||
void linphone_status_icon_params_set_on_click_cb(LinphoneStatusIconParams* obj, LinphoneStatusIconOnClickCallback cb, void *user_data);
|
||||
|
||||
|
||||
typedef void (*LinphoneStatusIconReadyCb)(void *user_data);
|
||||
|
||||
typedef struct _LinphoneStatusIcon LinphoneStatusIcon;
|
||||
|
||||
gboolean linphone_status_icon_init(LinphoneStatusIconReadyCb ready_cb, void* user_data);
|
||||
void linphone_status_icon_uninit(void);
|
||||
LinphoneStatusIcon *linphone_status_icon_get(void);
|
||||
const char *linphone_status_icon_get_implementation_name(const LinphoneStatusIcon *obj);
|
||||
void linphone_status_icon_start(LinphoneStatusIcon *obj, LinphoneStatusIconParams *params);
|
||||
void linphone_status_icon_enable_blinking(LinphoneStatusIcon *obj, gboolean enable);
|
||||
|
|
@ -1,643 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2015 Belledonne Communications <info@belledonne-communications.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU 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 "status_notifier.h"
|
||||
#include <gio/gio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <process.h>
|
||||
#define getpid() _getpid()
|
||||
typedef int lppid_t;
|
||||
#else
|
||||
#include <unistd.h>
|
||||
typedef pid_t lppid_t;
|
||||
#endif
|
||||
|
||||
const gchar *bc_status_notifier_category_to_string(BcStatusNotifierCategory c) {
|
||||
switch(c){
|
||||
case BcStatusNotifierCategoryApplicationStatus:
|
||||
return "ApplicationStatus";
|
||||
case BcStatusNotifierCategoryCommunications:
|
||||
return "Communications";
|
||||
case BcStatusNotifierCategorySystemService:
|
||||
return "SystemServices";
|
||||
case BcStatusNotifierCategoryHardware:
|
||||
return "Hardware";
|
||||
}
|
||||
return "bad category";
|
||||
}
|
||||
|
||||
const gchar *bc_status_notifier_status_to_string(BcStatusNotifierStatus s) {
|
||||
switch(s){
|
||||
case BcStatusNotifierStatusPassive:
|
||||
return "Passive";
|
||||
case BcStatusNotifierStatusActive:
|
||||
return "Active";
|
||||
case BcStatusNotifierStatusNeedsAttention:
|
||||
return "NeedsAttention";
|
||||
}
|
||||
return "badstatus";
|
||||
};
|
||||
|
||||
|
||||
struct _BcStatusNotifierToolTip {
|
||||
char *icon_name;
|
||||
char *title;
|
||||
char *text;
|
||||
int ref;
|
||||
};
|
||||
|
||||
BcStatusNotifierToolTip *bc_status_notifier_tool_tip_new(const char *icon_name, const char *title, const char *text) {
|
||||
BcStatusNotifierToolTip *obj = (BcStatusNotifierToolTip *)g_new0(BcStatusNotifierToolTip, 1);
|
||||
if(icon_name) obj->icon_name = g_strdup(icon_name);
|
||||
if(title) obj->title = g_strdup(title);
|
||||
if(text) obj->text = g_strdup(text);
|
||||
return obj;
|
||||
}
|
||||
|
||||
BcStatusNotifierToolTip *bc_status_notifier_tool_tip_ref(BcStatusNotifierToolTip *obj) {
|
||||
obj->ref++;
|
||||
return obj;
|
||||
}
|
||||
|
||||
void bc_status_notifier_tool_tip_unref(BcStatusNotifierToolTip *obj) {
|
||||
obj->ref--;
|
||||
if(obj->ref < 0) {
|
||||
if(obj->icon_name) g_free(obj->icon_name);
|
||||
if(obj->title) g_free(obj->title);
|
||||
if(obj->text) g_free(obj->text);
|
||||
g_free(obj);
|
||||
}
|
||||
}
|
||||
|
||||
static GVariant *_bc_status_notifier_tool_tip_to_variant(const BcStatusNotifierToolTip *obj) {
|
||||
GVariant *attr[] = {
|
||||
g_variant_new_string(obj->icon_name ? obj->icon_name : ""),
|
||||
g_variant_new_array(G_VARIANT_TYPE_VARIANT, NULL, 0),
|
||||
g_variant_new_string(obj->title ? obj->title : ""),
|
||||
g_variant_new_string(obj->text ? obj->text : ""),
|
||||
};
|
||||
return g_variant_new_tuple(attr, 4);
|
||||
}
|
||||
|
||||
|
||||
static const char *_bc_status_notifier_to_string[] = {
|
||||
"vertical",
|
||||
"horizontal",
|
||||
NULL
|
||||
};
|
||||
|
||||
static BcStatusNotifierOrientation _bc_status_notifier_orientation_from_string(const char *s) {
|
||||
int i;
|
||||
for(i=0; _bc_status_notifier_to_string[i] && g_strcmp0(s, _bc_status_notifier_to_string[i]) == 0; i++);
|
||||
if(_bc_status_notifier_to_string[i]) return i;
|
||||
else return BcStatusNotifierOrientationVertical;
|
||||
}
|
||||
|
||||
|
||||
struct _BcStatusNotifierParams{
|
||||
char *prefix;
|
||||
int item_id;
|
||||
BcStatusNotifierCategory category;
|
||||
char *id;
|
||||
char *title;
|
||||
BcStatusNotifierStatus status;
|
||||
guint32 window_id;
|
||||
char *icon_name;
|
||||
char *overlay_icon_name;
|
||||
char *attention_icon_name;
|
||||
char *attention_movie_name;
|
||||
BcStatusNotifierToolTip *tool_tip;
|
||||
BcStatusNotifierSignalsVTable vtable;
|
||||
void *user_data;
|
||||
int ref;
|
||||
};
|
||||
|
||||
#define DEFAULT_PREFIX "org.freedesktop"
|
||||
|
||||
BcStatusNotifierParams *bc_status_notifier_params_new(void) {
|
||||
BcStatusNotifierParams *obj = (BcStatusNotifierParams *)g_new0(BcStatusNotifierParams, 1);
|
||||
obj->prefix = g_strdup(DEFAULT_PREFIX);
|
||||
return obj;
|
||||
}
|
||||
|
||||
BcStatusNotifierParams *bc_status_notifier_params_ref(BcStatusNotifierParams *obj) {
|
||||
obj->ref++;
|
||||
return obj;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_unref(BcStatusNotifierParams *obj) {
|
||||
obj->ref--;
|
||||
if(obj->ref < 0) {
|
||||
if(obj->prefix) g_free(obj->prefix);
|
||||
if(obj->id) g_free(obj->id);
|
||||
if(obj->title) g_free(obj->title);
|
||||
if(obj->icon_name) g_free(obj->icon_name);
|
||||
if(obj->overlay_icon_name) g_free(obj->overlay_icon_name);
|
||||
if(obj->attention_icon_name) g_free(obj->attention_icon_name);
|
||||
if(obj->attention_movie_name) g_free(obj->attention_movie_name);
|
||||
if(obj->tool_tip) bc_status_notifier_tool_tip_unref(obj->tool_tip);
|
||||
g_free(obj);
|
||||
}
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_dbus_prefix(BcStatusNotifierParams *obj, const char *prefix) {
|
||||
if(obj->prefix) g_free(obj->prefix);
|
||||
if(prefix) obj->prefix = g_strdup(prefix);
|
||||
else obj->prefix = NULL;
|
||||
}
|
||||
|
||||
const char *bc_satus_notifier_params_get_dbus_prefix(const BcStatusNotifierParams *obj) {
|
||||
return obj->prefix;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_item_id(BcStatusNotifierParams *obj, int item_id) {
|
||||
obj->item_id = item_id;
|
||||
}
|
||||
|
||||
int bc_status_notifier_params_get_item_id(const BcStatusNotifierParams *obj) {
|
||||
return obj->item_id;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_category(BcStatusNotifierParams *obj, BcStatusNotifierCategory category) {
|
||||
obj->category = category;
|
||||
}
|
||||
|
||||
BcStatusNotifierCategory bc_status_notifier_params_get_category(const BcStatusNotifierParams *obj) {
|
||||
return obj->category;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_id(BcStatusNotifierParams *obj, const char *id) {
|
||||
if(obj->id) g_free(obj->id);
|
||||
if(id) obj->id = g_strdup(id);
|
||||
else obj->id = NULL;
|
||||
}
|
||||
|
||||
const char *bc_status_notifier_params_get_id(const BcStatusNotifierParams *obj) {
|
||||
return obj->id;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_title(BcStatusNotifierParams *obj, const char *title) {
|
||||
if(obj->title) g_free(obj->title);
|
||||
if(title) obj->title = g_strdup(title);
|
||||
else obj->title = NULL;
|
||||
}
|
||||
|
||||
const char *bc_status_notifier_params_get_title(const BcStatusNotifierParams *obj) {
|
||||
return obj->title;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_status(BcStatusNotifierParams *obj, BcStatusNotifierStatus status) {
|
||||
obj->status = status;
|
||||
}
|
||||
|
||||
BcStatusNotifierStatus bc_status_notifier_params_get_status(const BcStatusNotifierParams *obj) {
|
||||
return obj->status;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_window_id(BcStatusNotifierParams *obj, guint32 window_id) {
|
||||
obj->window_id = window_id;
|
||||
}
|
||||
|
||||
guint32 bc_status_notifier_params_get_window_id(const BcStatusNotifierParams *obj) {
|
||||
return obj->window_id;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_icon_name(BcStatusNotifierParams *obj, const char *name) {
|
||||
if(obj->icon_name) g_free(obj->icon_name);
|
||||
if(name) obj->icon_name = g_strdup(name);
|
||||
else obj->icon_name = NULL;
|
||||
}
|
||||
|
||||
const char *bc_status_notifier_params_get_icon_name(const BcStatusNotifierParams *obj) {
|
||||
return obj->icon_name;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_overlay_icon_name(BcStatusNotifierParams *obj, const char *name) {
|
||||
if(obj->overlay_icon_name) g_free(obj->overlay_icon_name);
|
||||
if(name) obj->overlay_icon_name = g_strdup(name);
|
||||
else obj->overlay_icon_name = NULL;
|
||||
}
|
||||
|
||||
const char *bc_status_notifier_params_get_overlay_icon_name(const BcStatusNotifierParams *obj) {
|
||||
return obj->overlay_icon_name;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_attention_icon_name(BcStatusNotifierParams *obj, const char *name) {
|
||||
if(obj->attention_icon_name) g_free(obj->attention_icon_name);
|
||||
if(name) obj->attention_icon_name = g_strdup(name);
|
||||
else obj->attention_icon_name = NULL;
|
||||
}
|
||||
|
||||
const char *bc_status_notifier_params_get_attention_icon_name(const BcStatusNotifierParams *obj) {
|
||||
return obj->attention_icon_name;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_attention_movie_name(BcStatusNotifierParams *obj, const char *name) {
|
||||
if(obj->attention_movie_name) g_free(obj->attention_movie_name);
|
||||
if(name) obj->attention_movie_name = g_strdup(name);
|
||||
else obj->attention_movie_name = NULL;
|
||||
}
|
||||
|
||||
const char *bc_status_notifier_params_get_attention_movie_name(const BcStatusNotifierParams *obj) {
|
||||
return obj->attention_movie_name;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_tool_tip(BcStatusNotifierParams *obj, BcStatusNotifierToolTip *tool_tip) {
|
||||
if(obj->tool_tip) bc_status_notifier_tool_tip_unref(obj->tool_tip);
|
||||
if(tool_tip) obj->tool_tip = bc_status_notifier_tool_tip_ref(tool_tip);
|
||||
else obj->tool_tip = NULL;
|
||||
}
|
||||
|
||||
const BcStatusNotifierToolTip *bc_status_notifier_params_get_tool_tip(const BcStatusNotifierParams *obj) {
|
||||
return obj->tool_tip;
|
||||
}
|
||||
|
||||
void bc_status_notifier_params_set_vtable(BcStatusNotifierParams *obj, const BcStatusNotifierSignalsVTable *vtable, void *user_data) {
|
||||
obj->vtable = *vtable;
|
||||
obj->user_data = user_data;
|
||||
}
|
||||
|
||||
|
||||
struct _BcStatusNotifier {
|
||||
BcStatusNotifierParams *params;
|
||||
guint bus_owner_id;
|
||||
GDBusConnection *conn;
|
||||
BcStatusNotifierState state;
|
||||
BcStatusNotifierStateVTable vtable;
|
||||
void *user_data;
|
||||
int ref;
|
||||
};
|
||||
|
||||
#define ITEM_NAME "StatusNotifierItem"
|
||||
#define WATCHER_NAME "StatusNotifierWatcher"
|
||||
#define CALL_TIMEOUT 1000
|
||||
|
||||
#define STATUS_NOTIFIER_INTROSPECTION_DATA \
|
||||
"<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\" \
|
||||
\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\"> \
|
||||
<node name=\"/StatusNotifierItem\"> \
|
||||
<interface name=\"org.kde.StatusNotifierItem\"> \
|
||||
<property name=\"Category\" type=\"s\" access=\"read\"/> \
|
||||
<property name=\"Id\" type=\"s\" access=\"read\"/> \
|
||||
<property name=\"Title\" type=\"s\" access=\"read\"/> \
|
||||
<property name=\"Status\" type=\"s\" access=\"read\"/> \
|
||||
<property name=\"WindowId\" type=\"u\" access=\"read\"/> \
|
||||
<property name=\"IconName\" type=\"s\" access=\"read\"/> \
|
||||
<property name=\"IconPixmap\" type=\"a(iiay)\" access=\"read\"/> \
|
||||
<property name=\"OverlayIconName\" type=\"s\" access=\"read\"/> \
|
||||
<property name=\"OverlayIconPixmap\" type=\"a(iiay)\" access=\"read\"/> \
|
||||
<property name=\"AttentionIconName\" type=\"s\" access=\"read\"/> \
|
||||
<property name=\"AttentionIconPixmap\" type=\"a(iiay)\" access=\"read\"/> \
|
||||
<property name=\"AttentionMovieName\" type=\"s\" access=\"read\"/> \
|
||||
<property name=\"ToolTip\" type=\"(sa(iiay)ss)\" access=\"read\"/> \
|
||||
<method name=\"ContextMenu\"> \
|
||||
<arg name=\"x\" type=\"i\" direction=\"in\" /> \
|
||||
<arg name=\"y\" type=\"i\" direction=\"in\" /> \
|
||||
</method> \
|
||||
<method name=\"Activate\"> \
|
||||
<arg name=\"x\" type=\"i\" direction=\"in\" /> \
|
||||
<arg name=\"y\" type=\"i\" direction=\"in\" /> \
|
||||
</method> \
|
||||
<method name=\"SecondaryActivate\"> \
|
||||
<arg name=\"x\" type=\"i\" direction=\"in\" /> \
|
||||
<arg name=\"y\" type=\"i\" direction=\"in\" /> \
|
||||
</method> \
|
||||
<method name=\"Scroll\"> \
|
||||
<arg name=\"delta\" type=\"i\" direction=\"in\" /> \
|
||||
<arg name=\"orientation\" type=\"s\" direction=\"in\" /> \
|
||||
</method> \
|
||||
<signal name=\"NewTitle\" /> \
|
||||
<signal name=\"NewIcon\" /> \
|
||||
<signal name=\"NewAttentionIcon\" /> \
|
||||
<signal name=\"NewOverlayIcon\" /> \
|
||||
<signal name=\"NewToolTip\" /> \
|
||||
<signal name=\"NewStatus\"> \
|
||||
<arg name=\"status\" type=\"s\" /> \
|
||||
</signal> \
|
||||
</interface> \
|
||||
</node>"
|
||||
|
||||
BcStatusNotifier *bc_status_notifier_new(void) {
|
||||
return (BcStatusNotifier *)g_new0(BcStatusNotifier, 1);
|
||||
}
|
||||
|
||||
BcStatusNotifier *bc_status_notifier_ref(BcStatusNotifier *obj) {
|
||||
obj->ref++;
|
||||
return obj;
|
||||
}
|
||||
|
||||
void bc_status_notifier_unref(BcStatusNotifier *obj) {
|
||||
obj->ref--;
|
||||
if(obj->ref < 0) {
|
||||
bc_status_notifier_stop(obj);
|
||||
if(obj->params) bc_status_notifier_params_unref(obj->params);
|
||||
g_free(obj);
|
||||
}
|
||||
}
|
||||
|
||||
static GVariant *_bc_status_notifier_get_property_cb(
|
||||
GDBusConnection *connection,
|
||||
const gchar *sender,
|
||||
const gchar *object_path,
|
||||
const gchar *interface_name,
|
||||
const gchar *property_name,
|
||||
GError **error,
|
||||
BcStatusNotifier *sn) {
|
||||
|
||||
|
||||
GVariant *value = NULL;
|
||||
if(g_strcmp0(property_name, "Category") == 0) {
|
||||
value = g_variant_new_string(bc_status_notifier_category_to_string(sn->params->category));
|
||||
} else if(g_strcmp0(property_name, "Id") == 0) {
|
||||
value = g_variant_new_string(sn->params->id ? sn->params->id : "");
|
||||
} else if(g_strcmp0(property_name, "Title") == 0) {
|
||||
value = g_variant_new_string(sn->params->title ? sn->params->title : "");
|
||||
} else if(g_strcmp0(property_name, "Status") == 0) {
|
||||
value = g_variant_new_string(bc_status_notifier_status_to_string(sn->params->status));
|
||||
} else if(g_strcmp0(property_name, "WindowId") == 0) {
|
||||
value = g_variant_new_uint32(sn->params->window_id);
|
||||
} else if(g_strcmp0(property_name, "IconName") == 0) {
|
||||
value = g_variant_new_string(sn->params->icon_name ? sn->params->icon_name : "");
|
||||
} else if(g_strcmp0(property_name, "IconPixmap") == 0) {
|
||||
value = g_variant_new_array(G_VARIANT_TYPE_VARIANT, NULL, 0);
|
||||
} else if(g_strcmp0(property_name, "OverlayIconName") == 0) {
|
||||
value = g_variant_new_string(sn->params->overlay_icon_name ? sn->params->overlay_icon_name : "");
|
||||
} else if(g_strcmp0(property_name, "OverlayIconPixmap") == 0) {
|
||||
value = g_variant_new_array(G_VARIANT_TYPE_VARIANT, NULL, 0);
|
||||
} else if(g_strcmp0(property_name, "AttentionIconName") == 0) {
|
||||
value = g_variant_new_string(sn->params->attention_icon_name ? sn->params->attention_icon_name : "");
|
||||
} else if(g_strcmp0(property_name, "AttentionIconPixmap") == 0) {
|
||||
value = g_variant_new_array(G_VARIANT_TYPE_VARIANT, NULL, 0);
|
||||
} else if(g_strcmp0(property_name, "AttentionMovieName") == 0) {
|
||||
value = g_variant_new_string(sn->params->attention_movie_name ? sn->params->attention_movie_name : "");
|
||||
} else if(g_strcmp0(property_name, "ToolTip") == 0) {
|
||||
if(sn->params->tool_tip) {
|
||||
value = _bc_status_notifier_tool_tip_to_variant(sn->params->tool_tip);
|
||||
} else {
|
||||
BcStatusNotifierToolTip *tool_tip = bc_status_notifier_tool_tip_new("", "", "");
|
||||
value = _bc_status_notifier_tool_tip_to_variant(tool_tip);
|
||||
bc_status_notifier_tool_tip_unref(tool_tip);
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
static void _bc_status_notifier_method_call_cb(
|
||||
GDBusConnection *connection,
|
||||
const gchar *sender,
|
||||
const gchar *object_path,
|
||||
const gchar *interface_name,
|
||||
const gchar *method_name,
|
||||
GVariant *parameters,
|
||||
GDBusMethodInvocation *invocation,
|
||||
BcStatusNotifier *sn) {
|
||||
|
||||
if(g_strcmp0(method_name, "ContextMenu") == 0) {
|
||||
if(sn->params->vtable.context_menu_called_cb) {
|
||||
int x, y;
|
||||
g_variant_get_child(parameters, 0, "i", &x);
|
||||
g_variant_get_child(parameters, 1, "i", &y);
|
||||
sn->params->vtable.context_menu_called_cb(sn, x, y, sn->params->user_data);
|
||||
}
|
||||
} else if(g_strcmp0(method_name, "Activate") == 0) {
|
||||
if(sn->params->vtable.activate_called_cb) {
|
||||
int x, y;
|
||||
g_variant_get_child(parameters, 0, "i", &x);
|
||||
g_variant_get_child(parameters, 1, "i", &y);
|
||||
sn->params->vtable.activate_called_cb(sn, x, y, sn->params->user_data);
|
||||
}
|
||||
} else if(g_strcmp0(method_name, "SecondaryActivate") == 0) {
|
||||
if(sn->params->vtable.secondary_activate_called_cb) {
|
||||
int x, y;
|
||||
g_variant_get_child(parameters, 0, "i", &x);
|
||||
g_variant_get_child(parameters, 1, "i", &y);
|
||||
sn->params->vtable.secondary_activate_called_cb(sn, x, y, sn->params->user_data);
|
||||
}
|
||||
} else if(g_strcmp0(method_name, "Scroll") == 0) {
|
||||
if(sn->params->vtable.scroll_called_cb) {
|
||||
int delta;
|
||||
BcStatusNotifierOrientation orient;
|
||||
char *orient_str;
|
||||
g_variant_get_child(parameters, 0, "i", &delta);
|
||||
g_variant_get_child(parameters, 1, "&s", &orient_str);
|
||||
orient = _bc_status_notifier_orientation_from_string(orient_str);
|
||||
sn->params->vtable.scroll_called_cb(sn, delta, orient, sn->params->user_data);
|
||||
}
|
||||
}
|
||||
g_dbus_method_invocation_return_value(invocation, NULL);
|
||||
}
|
||||
|
||||
static void _bc_status_notifier_bus_acquired_cb(GDBusConnection *conn, const gchar *name, BcStatusNotifier *sn) {
|
||||
char *interface_name = g_strdup_printf("%s.%s", sn->params->prefix, ITEM_NAME);
|
||||
char *item_path = g_strdup_printf("/%s", ITEM_NAME);
|
||||
GDBusInterfaceVTable vtable;
|
||||
GDBusNodeInfo *node_info = g_dbus_node_info_new_for_xml(STATUS_NOTIFIER_INTROSPECTION_DATA, NULL);
|
||||
GDBusInterfaceInfo *interface = g_dbus_node_info_lookup_interface(
|
||||
node_info,
|
||||
interface_name
|
||||
);
|
||||
|
||||
memset(&vtable, 0, sizeof(vtable));
|
||||
vtable.method_call = (GDBusInterfaceMethodCallFunc)_bc_status_notifier_method_call_cb;
|
||||
vtable.get_property = (GDBusInterfaceGetPropertyFunc)_bc_status_notifier_get_property_cb;
|
||||
g_free(interface_name);
|
||||
|
||||
sn->conn = conn;
|
||||
|
||||
g_dbus_connection_register_object(
|
||||
conn,
|
||||
item_path,
|
||||
interface,
|
||||
&vtable,
|
||||
bc_status_notifier_ref(sn),
|
||||
(GDestroyNotify)bc_status_notifier_unref,
|
||||
NULL
|
||||
);
|
||||
g_free(item_path);
|
||||
|
||||
g_dbus_node_info_unref(node_info);
|
||||
}
|
||||
|
||||
static void _bc_status_notifier_name_acquired_cb(GDBusConnection *conn, const gchar *name, BcStatusNotifier *sn) {
|
||||
GVariant *item_name = g_variant_new_string(name);
|
||||
GVariant *parameters = g_variant_new_tuple(&item_name, 1);
|
||||
char *watcher_bus_name = g_strdup_printf("%s.%s", sn->params->prefix, WATCHER_NAME);
|
||||
char *watcher_interface_name = watcher_bus_name;
|
||||
char *watcher_path = g_strdup_printf("/%s", WATCHER_NAME);
|
||||
|
||||
g_dbus_connection_call(
|
||||
conn,
|
||||
watcher_bus_name,
|
||||
watcher_path,
|
||||
watcher_interface_name,
|
||||
"RegisterStatusNotifierItem",
|
||||
parameters,
|
||||
NULL,
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
CALL_TIMEOUT,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
g_free(watcher_bus_name);
|
||||
g_free(watcher_path);
|
||||
|
||||
sn->state = BcStatusNotifierStateRunning;
|
||||
if(sn->vtable.success) sn->vtable.success(sn, sn->user_data);
|
||||
}
|
||||
|
||||
static void _bc_status_notifier_name_lost(GDBusConnection *conn, const gchar *name, BcStatusNotifier *sn) {
|
||||
if(conn == NULL) {
|
||||
sn->state = BcStatusNotifierStateStopped;
|
||||
if(sn->vtable.fail) sn->vtable.fail(sn, sn->user_data);
|
||||
}
|
||||
}
|
||||
|
||||
void bc_status_notifier_start(BcStatusNotifier* obj, BcStatusNotifierParams* params, const BcStatusNotifierStateVTable *vtable, void *user_data) {
|
||||
if(obj->state == BcStatusNotifierStateStopped) {
|
||||
lppid_t pid = getpid();
|
||||
char *dbus_name = g_strdup_printf("%s.%s-%d-%d", params->prefix, ITEM_NAME, pid, params->item_id);
|
||||
|
||||
if(obj->params) bc_status_notifier_params_unref(obj->params);
|
||||
obj->params = bc_status_notifier_params_ref(params);
|
||||
if(vtable) obj->vtable = *vtable;
|
||||
else {
|
||||
obj->vtable.success = NULL;
|
||||
obj->vtable.fail = NULL;
|
||||
}
|
||||
obj->user_data = user_data;
|
||||
obj->state = BcStatusNotifierStateStarting;
|
||||
obj->bus_owner_id = g_bus_own_name(
|
||||
G_BUS_TYPE_SESSION,
|
||||
dbus_name,
|
||||
G_BUS_NAME_OWNER_FLAGS_NONE,
|
||||
(GBusAcquiredCallback)_bc_status_notifier_bus_acquired_cb,
|
||||
(GBusNameAcquiredCallback)_bc_status_notifier_name_acquired_cb,
|
||||
(GBusNameLostCallback)_bc_status_notifier_name_lost,
|
||||
bc_status_notifier_ref(obj),
|
||||
(GDestroyNotify)bc_status_notifier_unref
|
||||
);
|
||||
g_free(dbus_name);
|
||||
}
|
||||
}
|
||||
|
||||
void bc_status_notifier_stop(BcStatusNotifier *obj) {
|
||||
if(obj->state == BcStatusNotifierStateRunning) {
|
||||
g_bus_unown_name(obj->bus_owner_id);
|
||||
obj->bus_owner_id = 0;
|
||||
obj->conn = NULL;
|
||||
obj->state = BcStatusNotifierStateStopped;
|
||||
}
|
||||
}
|
||||
|
||||
const BcStatusNotifierParams *bc_status_notifier_get_params(const BcStatusNotifier *obj) {
|
||||
return obj->params;
|
||||
}
|
||||
|
||||
static void _bc_status_notifier_emit_signal(const BcStatusNotifier *obj, const char *sig_name, GVariant *parameters) {
|
||||
char *item_interface_name = g_strdup_printf("%s.%s", obj->params->prefix, ITEM_NAME);
|
||||
char *item_path = g_strdup_printf("/%s", ITEM_NAME);
|
||||
g_dbus_connection_emit_signal(
|
||||
obj->conn,
|
||||
NULL,
|
||||
item_path,
|
||||
item_interface_name,
|
||||
sig_name,
|
||||
parameters,
|
||||
NULL
|
||||
);
|
||||
g_free(item_interface_name);
|
||||
g_free(item_path);
|
||||
}
|
||||
|
||||
void bc_status_notifier_update_title(BcStatusNotifier *obj, const char *title) {
|
||||
bc_status_notifier_params_set_title(obj->params, title);
|
||||
_bc_status_notifier_emit_signal(obj, "NewTitle", NULL);
|
||||
}
|
||||
|
||||
void bc_status_notifier_update_icon(BcStatusNotifier *obj, const char *icon_name) {
|
||||
bc_status_notifier_params_set_icon_name(obj->params, icon_name);
|
||||
_bc_status_notifier_emit_signal(obj, "NewIcon", NULL);
|
||||
}
|
||||
|
||||
void bc_status_notifier_update_attention_icon(BcStatusNotifier *obj, const char *icon_name) {
|
||||
bc_status_notifier_params_set_attention_icon_name(obj->params, icon_name);
|
||||
_bc_status_notifier_emit_signal(obj, "NewAttentionIcon", NULL);
|
||||
}
|
||||
|
||||
void bc_status_notifier_update_overlay_icon(BcStatusNotifier *obj, const char *icon_name) {
|
||||
bc_status_notifier_params_set_overlay_icon_name(obj->params, icon_name);
|
||||
_bc_status_notifier_emit_signal(obj, "NewOverlayIcon", NULL);
|
||||
}
|
||||
|
||||
void bc_status_notifier_update_tool_tip(BcStatusNotifier *obj, BcStatusNotifierToolTip *tool_tip) {
|
||||
bc_status_notifier_params_set_tool_tip(obj->params, tool_tip);
|
||||
_bc_status_notifier_emit_signal(obj, "NewToolTip", NULL);
|
||||
}
|
||||
|
||||
void bc_status_notifier_update_status(BcStatusNotifier *obj, BcStatusNotifierStatus status) {
|
||||
GVariant *status_var = g_variant_new_string(bc_status_notifier_status_to_string(status));
|
||||
GVariant *parameter = g_variant_new_tuple(&status_var, 1);
|
||||
bc_status_notifier_params_set_status(obj->params, status);
|
||||
_bc_status_notifier_emit_signal(obj, "NewStatus", parameter);
|
||||
}
|
||||
|
||||
|
||||
typedef struct _BcWatcherDetectionCtx {
|
||||
char *prefix;
|
||||
guint watcher_id;
|
||||
BcStatusNotifierSupportDetectionCb cb;
|
||||
void *user_data;
|
||||
} BcWatcherDetectionCtx;
|
||||
|
||||
static void _bc_watcher_detection_ctx_free(BcWatcherDetectionCtx *obj) {
|
||||
g_free(obj->prefix);
|
||||
g_free(obj);
|
||||
}
|
||||
|
||||
static void _bc_watcher_name_appeared_cb(GDBusConnection *conn, const char *name, const char *name_owner, BcWatcherDetectionCtx *ctx) {
|
||||
g_bus_unwatch_name(ctx->watcher_id);
|
||||
if(ctx->cb) ctx->cb(ctx->prefix, 1, ctx->user_data);
|
||||
}
|
||||
|
||||
static void _bc_watcher_name_vannished_cb(GDBusConnection *conn, const char *name, BcWatcherDetectionCtx *ctx) {
|
||||
g_bus_unwatch_name(ctx->watcher_id);
|
||||
if(ctx->cb) ctx->cb(ctx->prefix, 0, ctx->user_data);
|
||||
}
|
||||
|
||||
void bc_status_notifier_is_supported(const char* prefix, BcStatusNotifierSupportDetectionCb cb, void *user_data) {
|
||||
char *bus_name = g_strdup_printf("%s.%s", prefix, WATCHER_NAME);
|
||||
BcWatcherDetectionCtx *ctx = (BcWatcherDetectionCtx *)g_new0(BcWatcherDetectionCtx, 1);
|
||||
ctx->prefix = g_strdup(prefix);
|
||||
ctx->cb = cb;
|
||||
ctx->user_data = user_data;
|
||||
|
||||
ctx->watcher_id = g_bus_watch_name(
|
||||
G_BUS_TYPE_SESSION,
|
||||
bus_name,
|
||||
G_BUS_NAME_WATCHER_FLAGS_NONE,
|
||||
(GBusNameAppearedCallback)_bc_watcher_name_appeared_cb,
|
||||
(GBusNameVanishedCallback)_bc_watcher_name_vannished_cb,
|
||||
ctx,
|
||||
(GDestroyNotify)_bc_watcher_detection_ctx_free
|
||||
);
|
||||
g_free(bus_name);
|
||||
}
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2015 Belledonne Communications <info@belledonne-communications.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* BcStatusNotifier is an implementation of the StatusNotiferItem standard defined by freedesktop.org.
|
||||
* It is a new way to manage status icons on GNU/Linux systems by using D-Bus. It is implemented by
|
||||
* Unity desktop environmemt and it is the only way to create status icons on KDE 5.
|
||||
* Visit http://freedesktop.org/wiki/Specifications/StatusNotifierItem/ for more information.
|
||||
*/
|
||||
|
||||
#ifndef STATUS_NOTIFIER_H
|
||||
#define STATUS_NOTIFIER_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
struct _BcStatusNotifier;
|
||||
|
||||
|
||||
typedef enum {
|
||||
BcStatusNotifierCategoryApplicationStatus,
|
||||
BcStatusNotifierCategoryCommunications,
|
||||
BcStatusNotifierCategorySystemService,
|
||||
BcStatusNotifierCategoryHardware
|
||||
} BcStatusNotifierCategory;
|
||||
|
||||
const gchar *bc_status_notifier_category_to_string(BcStatusNotifierCategory c);
|
||||
|
||||
|
||||
typedef enum {
|
||||
BcStatusNotifierStatusPassive,
|
||||
BcStatusNotifierStatusActive,
|
||||
BcStatusNotifierStatusNeedsAttention
|
||||
} BcStatusNotifierStatus;
|
||||
|
||||
const gchar *bc_status_notifier_status_to_string(BcStatusNotifierStatus s);
|
||||
|
||||
|
||||
typedef struct _BcStatusNotifierToolTip BcStatusNotifierToolTip;
|
||||
|
||||
BcStatusNotifierToolTip *bc_status_notifier_tool_tip_new(const char *icon_name, const char *title, const char *text);
|
||||
BcStatusNotifierToolTip *bc_status_notifier_tool_tip_ref(BcStatusNotifierToolTip *obj);
|
||||
void bc_status_notifier_tool_tip_unref(BcStatusNotifierToolTip *obj);
|
||||
|
||||
|
||||
typedef enum _BcStatusNotifierOrientation {
|
||||
BcStatusNotifierOrientationVertical,
|
||||
BcStatusNotifierOrientationHorizontal
|
||||
} BcStatusNotifierOrientation;
|
||||
|
||||
|
||||
typedef void (*BcStatusNotifierContextMenuCalledCb)(struct _BcStatusNotifier *sn, int x, int y, void *user_data);
|
||||
typedef void (*BcStatusNotifierActivateCalledCb)(struct _BcStatusNotifier *sn, int x, int y, void *user_data);
|
||||
typedef void (*BcStatusNotifierSecondaryActivateCb)(struct _BcStatusNotifier *sn, int x, int y, void *user_data);
|
||||
typedef void (*BcStatusNotifierScrollCalledCb)(struct _BcStatusNotifier *sn, int delta, BcStatusNotifierOrientation o, void *user_data);
|
||||
|
||||
typedef struct _BcStatusNotifierSignalsVTable {
|
||||
BcStatusNotifierContextMenuCalledCb context_menu_called_cb;
|
||||
BcStatusNotifierActivateCalledCb activate_called_cb;
|
||||
BcStatusNotifierSecondaryActivateCb secondary_activate_called_cb;
|
||||
BcStatusNotifierScrollCalledCb scroll_called_cb;
|
||||
} BcStatusNotifierSignalsVTable;
|
||||
|
||||
|
||||
typedef struct _BcStatusNotifierParams BcStatusNotifierParams;
|
||||
|
||||
BcStatusNotifierParams *bc_status_notifier_params_new(void);
|
||||
BcStatusNotifierParams *bc_status_notifier_params_ref(BcStatusNotifierParams *obj);
|
||||
void bc_status_notifier_params_unref(BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_dbus_prefix(BcStatusNotifierParams *obj, const char *prefix);
|
||||
const char *bc_satus_notifier_params_get_dbus_prefix(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_item_id(BcStatusNotifierParams *obj, int item_id);
|
||||
int bc_status_notifier_params_get_item_id(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_category(BcStatusNotifierParams *obj, BcStatusNotifierCategory category);
|
||||
BcStatusNotifierCategory bc_status_notifier_params_get_category(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_id(BcStatusNotifierParams *obj, const char *id);
|
||||
const char *bc_status_notifier_params_get_id(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_title(BcStatusNotifierParams *obj, const char *title);
|
||||
const char *bc_status_notifier_params_get_title(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_status(BcStatusNotifierParams *obj, BcStatusNotifierStatus status);
|
||||
BcStatusNotifierStatus bc_status_notifier_params_get_status(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_window_id(BcStatusNotifierParams *obj, guint32 window_id);
|
||||
guint32 bc_status_notifier_params_get_window_id(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_icon_name(BcStatusNotifierParams *obj, const char *name);
|
||||
const char *bc_status_notifier_params_get_icon_name(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_overlay_icon_name(BcStatusNotifierParams *obj, const char *name);
|
||||
const char *bc_status_notifier_params_get_overlay_icon_name(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_attention_icon_name(BcStatusNotifierParams *obj, const char *icon_name);
|
||||
const char *bc_status_notifier_params_get_attention_icon_name(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_attention_movie_name(BcStatusNotifierParams *obj, const char *name);
|
||||
const char *bc_status_notifier_params_get_attention_movie_name(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_tool_tip(BcStatusNotifierParams *obj, BcStatusNotifierToolTip *tool_tip);
|
||||
const BcStatusNotifierToolTip *bc_status_notifier_params_get_tool_tip(const BcStatusNotifierParams *obj);
|
||||
|
||||
void bc_status_notifier_params_set_vtable(BcStatusNotifierParams *obj, const BcStatusNotifierSignalsVTable *vtable, void *user_data);
|
||||
|
||||
|
||||
typedef enum _BcStatusNotifierState {
|
||||
BcStatusNotifierStateStopped,
|
||||
BcStatusNotifierStateStarting,
|
||||
BcStatusNotifierStateRunning
|
||||
} BcStatusNotifierState;
|
||||
|
||||
|
||||
typedef void (*BcStatusNotifierStartedCb)(struct _BcStatusNotifier *sn, void *user_data);
|
||||
typedef void (*BcStatusNotifierStartingFailedCb)(struct _BcStatusNotifier *sn, void *user_data);
|
||||
|
||||
typedef struct _BcStatusNotifierStateVTable {
|
||||
BcStatusNotifierStartedCb success;
|
||||
BcStatusNotifierStartingFailedCb fail;
|
||||
} BcStatusNotifierStateVTable;
|
||||
|
||||
|
||||
typedef struct _BcStatusNotifier BcStatusNotifier;
|
||||
|
||||
BcStatusNotifier *bc_status_notifier_new(void);
|
||||
BcStatusNotifier *bc_status_notifier_ref(BcStatusNotifier *obj);
|
||||
void bc_status_notifier_unref(BcStatusNotifier *obj);
|
||||
|
||||
void bc_status_notifier_start(BcStatusNotifier* obj, BcStatusNotifierParams* params, const BcStatusNotifierStateVTable* vtable, void* user_data);
|
||||
void bc_status_notifier_stop(BcStatusNotifier* obj);
|
||||
|
||||
const BcStatusNotifierParams *bc_status_notifier_get_params(const BcStatusNotifier *obj);
|
||||
void bc_status_notifier_update_title(BcStatusNotifier* obj, const char* title);
|
||||
void bc_status_notifier_update_icon(BcStatusNotifier* obj, const char* icon_name);
|
||||
void bc_status_notifier_update_attention_icon(BcStatusNotifier* obj, const char* icon_name);
|
||||
void bc_status_notifier_update_overlay_icon(BcStatusNotifier* obj, const char* icon_name);
|
||||
void bc_status_notifier_update_tool_tip(BcStatusNotifier* obj, BcStatusNotifierToolTip* tool_tip);
|
||||
void bc_status_notifier_update_status(BcStatusNotifier* obj, BcStatusNotifierStatus status);
|
||||
|
||||
|
||||
typedef void (*BcStatusNotifierSupportDetectionCb)(const char *prefix, gboolean is_supported, void *user_data);
|
||||
|
||||
void bc_status_notifier_is_supported(const char* prefix, BcStatusNotifierSupportDetectionCb cb, void *user_data);
|
||||
|
||||
#endif
|
||||
|
Before Width: | Height: | Size: 764 B |
257
gtk/support.c
|
|
@ -1,257 +0,0 @@
|
|||
#include "linphone.h"
|
||||
|
||||
#include "linphone/lpconfig.h"
|
||||
|
||||
static GList *pixmaps_directories = NULL;
|
||||
|
||||
/* Use this function to set the directory containing installed pixmaps. */
|
||||
void
|
||||
add_pixmap_directory (const gchar *directory)
|
||||
{
|
||||
pixmaps_directories = g_list_prepend (pixmaps_directories,
|
||||
g_strdup (directory));
|
||||
}
|
||||
|
||||
/* This is an internally used function to find pixmap files. */
|
||||
static gchar*
|
||||
find_pixmap_file (const gchar *filename)
|
||||
{
|
||||
GList *elem;
|
||||
|
||||
/* We step through each of the pixmaps directory to find it. */
|
||||
elem = pixmaps_directories;
|
||||
while (elem)
|
||||
{
|
||||
gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
|
||||
G_DIR_SEPARATOR_S, filename);
|
||||
if (g_file_test (pathname, G_FILE_TEST_EXISTS))
|
||||
return pathname;
|
||||
g_free (pathname);
|
||||
elem = elem->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* This is an internally used function to create pixmaps. */
|
||||
GtkWidget*
|
||||
create_pixmap (const gchar *filename)
|
||||
{
|
||||
gchar *pathname = NULL;
|
||||
GtkWidget *pixmap;
|
||||
|
||||
if (!filename || !filename[0])
|
||||
return gtk_image_new ();
|
||||
|
||||
pathname = find_pixmap_file (filename);
|
||||
|
||||
if (!pathname)
|
||||
{
|
||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||
return gtk_image_new ();
|
||||
}
|
||||
|
||||
pixmap = gtk_image_new_from_file (pathname);
|
||||
g_free (pathname);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
/* This is an internally used function to create pixmaps. */
|
||||
GdkPixbuf*
|
||||
create_pixbuf (const gchar *filename)
|
||||
{
|
||||
gchar *pathname = NULL;
|
||||
GdkPixbuf *pixbuf;
|
||||
GError *error = NULL;
|
||||
|
||||
if (!filename || !filename[0])
|
||||
return NULL;
|
||||
|
||||
pathname = find_pixmap_file (filename);
|
||||
|
||||
if (!pathname)
|
||||
{
|
||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
|
||||
if (!pixbuf)
|
||||
{
|
||||
fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
|
||||
pathname, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
g_free (pathname);
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
/* This is an internally used function to create animations */
|
||||
GdkPixbufAnimation *
|
||||
create_pixbuf_animation(const gchar *filename)
|
||||
{
|
||||
gchar *pathname = NULL;
|
||||
GdkPixbufAnimation *pixbuf;
|
||||
GError *error = NULL;
|
||||
|
||||
if (!filename || !filename[0])
|
||||
return NULL;
|
||||
|
||||
pathname = find_pixmap_file (filename);
|
||||
|
||||
if (!pathname){
|
||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixbuf = gdk_pixbuf_animation_new_from_file (pathname, &error);
|
||||
if (!pixbuf){
|
||||
fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
|
||||
pathname, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
g_free (pathname);
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* This is used to set ATK action descriptions. */
|
||||
void
|
||||
glade_set_atk_action_description (AtkAction *action,
|
||||
const gchar *action_name,
|
||||
const gchar *description)
|
||||
{
|
||||
gint n_actions, i;
|
||||
|
||||
n_actions = atk_action_get_n_actions (action);
|
||||
for (i = 0; i < n_actions; i++)
|
||||
{
|
||||
if (!strcmp (atk_action_get_name (action, i), action_name))
|
||||
atk_action_set_description (action, i, description);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static char linphone_lang[256]={0};
|
||||
|
||||
/*lang has to be read before the config file is parsed...*/
|
||||
const char *linphone_gtk_get_lang(const char *config_file){
|
||||
FILE *f=fopen(config_file,"r");
|
||||
if (f){
|
||||
char tmp[256];
|
||||
while(fgets(tmp,sizeof(tmp),f)!=NULL){
|
||||
char *p;
|
||||
if ((p=strstr(tmp,"lang="))!=NULL){
|
||||
p+=5;
|
||||
sscanf(p,"%s",linphone_lang);
|
||||
g_message("Found lang %s",linphone_lang);
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
return linphone_lang;
|
||||
}
|
||||
|
||||
void linphone_gtk_set_lang(const char *code){
|
||||
LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
|
||||
const char *curlang=g_getenv("LANGUAGE");
|
||||
if (curlang!=NULL && strncmp(curlang,code,2)==0) {
|
||||
/* do not loose the _territory@encoding part*/
|
||||
return;
|
||||
}
|
||||
lp_config_set_string(cfg,"GtkUi","lang",code);
|
||||
g_setenv("LANGUAGE",code,1);
|
||||
}
|
||||
|
||||
const gchar *linphone_gtk_get_ui_config(const char *key, const char *def){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
if (lc){
|
||||
LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
|
||||
return lp_config_get_string(cfg,"GtkUi",key,def);
|
||||
}else{
|
||||
g_error ("Cannot read config, no core created yet.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int linphone_gtk_get_ui_config_int(const char *key, int def){
|
||||
LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
|
||||
return lp_config_get_int(cfg,"GtkUi",key,def);
|
||||
}
|
||||
|
||||
void linphone_gtk_set_ui_config_int(const char *key , int val){
|
||||
LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
|
||||
lp_config_set_int(cfg,"GtkUi",key,val);
|
||||
}
|
||||
|
||||
void linphone_gtk_set_ui_config(const char *key , const char * val){
|
||||
LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
|
||||
lp_config_set_string(cfg,"GtkUi",key,val);
|
||||
}
|
||||
|
||||
const char *linphone_gtk_get_sound_path(const char *name){
|
||||
static char *ret=NULL;
|
||||
const char *file;
|
||||
const char *sound_dir;
|
||||
LinphoneFactory *factory = linphone_factory_get();
|
||||
|
||||
file=linphone_gtk_get_ui_config(name,NULL);
|
||||
if (file==NULL){
|
||||
char *dirname=g_path_get_dirname(name);
|
||||
if (strcmp(dirname,".")!=0){
|
||||
g_free(dirname);
|
||||
return name;
|
||||
}
|
||||
g_free(dirname);
|
||||
file=name;
|
||||
}
|
||||
if (ret){
|
||||
g_free(ret);
|
||||
ret=NULL;
|
||||
}
|
||||
sound_dir = linphone_factory_get_sound_resources_dir(factory);
|
||||
ret=g_build_filename(sound_dir,name,NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void parse_item(const char *item, const char *window_name, GtkWidget *w, gboolean show){
|
||||
char tmp[64];
|
||||
char *dot;
|
||||
strcpy(tmp,item);
|
||||
dot=strchr(tmp,'.');
|
||||
if (dot){
|
||||
*dot='\0';
|
||||
dot++;
|
||||
if (strcmp(window_name,tmp)==0){
|
||||
GtkWidget *wd=linphone_gtk_get_widget(w,dot);
|
||||
if (wd) {
|
||||
if (!show) gtk_widget_hide(wd);
|
||||
else gtk_widget_show(wd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_gtk_visibility_set(const char *hiddens, const char *window_name, GtkWidget *w, gboolean show){
|
||||
char item[64];
|
||||
const char *i;
|
||||
const char *b;
|
||||
int len;
|
||||
for(b=i=hiddens;*i!='\0';++i){
|
||||
if (*i==' '){
|
||||
len=MIN(i-b,(int)sizeof(item)-1);
|
||||
strncpy(item,b,len);
|
||||
item[len]='\0';
|
||||
b=i+1;
|
||||
parse_item(item,window_name,w,show);
|
||||
}
|
||||
}
|
||||
len=MIN(i-b,(int)sizeof(item)-1);
|
||||
if (len>0){
|
||||
strncpy(item,b,len);
|
||||
item[len]='\0';
|
||||
parse_item(item,window_name,w,show);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,407 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<object class="GtkAdjustment" id="adjustment1">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">65535</property>
|
||||
<property name="value">443</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="adjustment2">
|
||||
<property name="lower">1</property>
|
||||
<property name="upper">65535</property>
|
||||
<property name="value">8080</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkDialog" id="tunnel_config">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Configure VoIP tunnel</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame15">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment15">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox11">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="n_rows">5</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label38">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Host</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="host">
|
||||
<property name="width_request">275</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label39">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes">Port</property>
|
||||
<property name="justify">right</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="port">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="radio_enable">
|
||||
<property name="label" translatable="yes">Enabled</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radio_disable</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="radio_disable">
|
||||
<property name="label" translatable="yes">Disabled</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radio_enable</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRadioButton" id="tunnel_autodetect">
|
||||
<property name="label" translatable="yes">Enable on purpose</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<property name="group">radio_enable</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label42">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="label" translatable="yes"><b>VoIP anti-blocking (tunnel server)</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">4</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Host</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Port</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Username</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Password</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="http_port">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
<property name="adjustment">adjustment2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="http_host">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="username">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="password">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="primary_icon_sensitive">True</property>
|
||||
<property name="secondary_icon_sensitive">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Http proxy (optional)</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkHButtonBox" id="dialog-action_area2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="button6">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_tunnel_ok" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="button7">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="linphone_gtk_proxy_cancel" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="0">button6</action-widget>
|
||||
<action-widget response="0">button7</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
||||
157
gtk/update.c
|
|
@ -1,157 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <wininet.h>
|
||||
|
||||
static int linphone_gtk_create_version(const char *version_url, char *version, size_t size){
|
||||
DWORD dwDownloaded = 0;
|
||||
HINTERNET hSession = NULL, hConnect = NULL;
|
||||
int ret=-1;
|
||||
|
||||
hSession=InternetOpen("Linphone",INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
|
||||
|
||||
if (hSession==NULL) return -1;
|
||||
|
||||
hConnect=InternetOpenUrl(hSession,version_url,NULL,0,0,0);
|
||||
|
||||
if (hConnect==NULL) {
|
||||
InternetCloseHandle(hSession);
|
||||
return -1;
|
||||
}
|
||||
dwDownloaded=0;
|
||||
if (InternetReadFile(hConnect,version,size,&dwDownloaded) && dwDownloaded>0){
|
||||
version[dwDownloaded]='\0';
|
||||
ms_message("Got response: %s", version);
|
||||
/*check this not just html containing 404 not found*/
|
||||
if (strstr(version,"html")==0)
|
||||
ret=0;
|
||||
}
|
||||
|
||||
// Close any open handles.
|
||||
if (hConnect) InternetCloseHandle(hConnect);
|
||||
if (hSession) InternetCloseHandle(hSession);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static int linphone_gtk_create_version(const char *url, char *version, size_t size){
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void new_version_response(GtkWidget *dialog, int response_id, gpointer download_site){
|
||||
if (response_id==GTK_RESPONSE_YES){
|
||||
linphone_gtk_open_browser((const char*)download_site);
|
||||
}
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
|
||||
static gboolean popup_new_version(const char *download_site){
|
||||
GtkWidget *dialog;
|
||||
/* draw a question box. link to dialog_click callback */
|
||||
dialog = gtk_message_dialog_new (
|
||||
GTK_WINDOW(linphone_gtk_get_main_window()),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_YES_NO,
|
||||
_("A more recent version is availalble from %s.\nWould you like to open a browser to download it ?"),
|
||||
download_site);
|
||||
g_signal_connect(G_OBJECT (dialog), "response",
|
||||
G_CALLBACK (new_version_response),
|
||||
(gpointer)download_site);
|
||||
/* actually show the box */
|
||||
gtk_widget_show(dialog);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean popup_version_ok(void){
|
||||
linphone_gtk_display_something(GTK_MESSAGE_INFO,_("You are running the lastest version."));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int copytilldot(char *n, const char *v){
|
||||
int ret=0;
|
||||
while(*v!='\0' && *v!='.' && *v!='-' && *v!='\n' && *v!='\r' && *v!='\t'){
|
||||
*n=*v;
|
||||
ret++;
|
||||
v++;
|
||||
n++;
|
||||
}
|
||||
*n='\0';
|
||||
if (*v!='\0') ret=ret+1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int version_compare(const char *v1, const char *v2){
|
||||
char n1[16];
|
||||
char n2[16];
|
||||
int ret;
|
||||
if (*v1=='\0' && *v2=='\0') return 0;
|
||||
v1+=copytilldot(n1,v1);
|
||||
v2+=copytilldot(n2,v2);
|
||||
ms_message("Comparing %s <> %s",n1,n2);
|
||||
ret=strcmp(n1,n2);
|
||||
if (ret==0) return version_compare(v1,v2);
|
||||
else return ret;
|
||||
}
|
||||
|
||||
static void *check_for_new_version(void *d){
|
||||
const char *version_url=(const char *)d;
|
||||
char version[256];
|
||||
if (linphone_gtk_create_version(version_url,version,sizeof(version))==0){
|
||||
if (version_compare(version,LINPHONE_VERSION)>0){
|
||||
const char *download_site=linphone_gtk_get_ui_config("download_site",NULL);
|
||||
if (download_site) {
|
||||
gdk_threads_enter();
|
||||
g_idle_add((GSourceFunc)popup_new_version,(gpointer)download_site);
|
||||
gdk_threads_leave();
|
||||
}
|
||||
}else{
|
||||
if (linphone_gtk_get_ui_config_int("update_check_menu",0)){
|
||||
gdk_threads_enter();
|
||||
g_idle_add((GSourceFunc)popup_version_ok,NULL);
|
||||
gdk_threads_leave();
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void linphone_gtk_check_for_new_version(void){
|
||||
ortp_thread_t thread;
|
||||
static gboolean done=FALSE;
|
||||
const char *version_url;
|
||||
if (done) return;
|
||||
done=TRUE;
|
||||
version_url=linphone_gtk_get_ui_config("last_version_url",NULL);
|
||||
if (version_url==NULL) return ;
|
||||
ortp_thread_create(&thread,NULL,check_for_new_version,(void*)version_url);
|
||||
}
|
||||
|
||||
/*called when the user clicks on the "Check for updates" menu item */
|
||||
void linphone_gtk_check_for_updates(void){
|
||||
linphone_gtk_check_for_new_version();
|
||||
}
|
||||
178
gtk/utils.c
|
|
@ -1,178 +0,0 @@
|
|||
/*
|
||||
linphone, gtk-glade interface.
|
||||
Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
static void run_gtk(void){
|
||||
while (gtk_events_pending ())
|
||||
gtk_main_iteration ();
|
||||
|
||||
}
|
||||
|
||||
void *linphone_gtk_wait(LinphoneCore *lc, void *ctx, LinphoneWaitingState ws, const char *purpose, float progress){
|
||||
GtkWidget *w;
|
||||
switch(ws){
|
||||
case LinphoneWaitingStart:
|
||||
gdk_threads_enter();
|
||||
w=linphone_gtk_create_window("waiting", NULL);
|
||||
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);
|
||||
if (purpose) {
|
||||
gtk_progress_bar_set_text(
|
||||
GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar")),
|
||||
purpose);
|
||||
}
|
||||
gtk_widget_show(w);
|
||||
/*g_message("Creating waiting window");*/
|
||||
run_gtk();
|
||||
gdk_threads_leave();
|
||||
return w;
|
||||
break;
|
||||
case LinphoneWaitingProgress:
|
||||
w=(GtkWidget*)ctx;
|
||||
gdk_threads_enter();
|
||||
if (progress>=0){
|
||||
gtk_progress_bar_set_fraction(
|
||||
GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar")),
|
||||
progress);
|
||||
|
||||
|
||||
}else {
|
||||
gtk_progress_bar_pulse(
|
||||
GTK_PROGRESS_BAR(linphone_gtk_get_widget(w,"progressbar"))
|
||||
);
|
||||
}
|
||||
/*g_message("Updating progress");*/
|
||||
run_gtk();
|
||||
gdk_threads_leave();
|
||||
g_usleep(50000);
|
||||
return w;
|
||||
break;
|
||||
case LinphoneWaitingFinished:
|
||||
w=(GtkWidget*)ctx;
|
||||
gdk_threads_enter();
|
||||
gtk_widget_destroy(w);
|
||||
run_gtk();
|
||||
gdk_threads_leave();
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GdkPixbuf *_gdk_pixbuf_new_from_memory_at_scale(const void *data, gint len, gint w, gint h, gboolean preserve_ratio){
|
||||
GInputStream *stream=g_memory_input_stream_new_from_data (data,len,NULL);
|
||||
GError *error=NULL;
|
||||
|
||||
GdkPixbuf *pbuf=gdk_pixbuf_new_from_stream_at_scale (stream,w,h,preserve_ratio,NULL,&error);
|
||||
g_input_stream_close(stream,NULL,NULL);
|
||||
g_object_unref(G_OBJECT(stream));
|
||||
if (pbuf==NULL){
|
||||
g_warning("Could not open image from memory");
|
||||
}
|
||||
return pbuf;
|
||||
}
|
||||
|
||||
GtkWidget * _gtk_image_new_from_memory_at_scale(const void *data, gint len, gint w, gint h, gboolean preserve_ratio){
|
||||
GtkWidget *image;
|
||||
GdkPixbuf *pbuf=_gdk_pixbuf_new_from_memory_at_scale(data,len,w,h,preserve_ratio);
|
||||
if (pbuf==NULL) return NULL;
|
||||
image=gtk_image_new_from_pixbuf(pbuf);
|
||||
g_object_unref(G_OBJECT(pbuf));
|
||||
return image;
|
||||
}
|
||||
|
||||
void linphone_gtk_reload_sound_devices(void){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *pb=(GtkWidget*)g_object_get_data(G_OBJECT(mw),"parameters");
|
||||
linphone_core_reload_sound_devices(linphone_gtk_get_core());
|
||||
if (pb) linphone_gtk_fill_soundcards(pb);
|
||||
}
|
||||
|
||||
void linphone_gtk_reload_video_devices(void){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *pb=(GtkWidget*)g_object_get_data(G_OBJECT(mw),"parameters");
|
||||
linphone_core_reload_video_devices(linphone_gtk_get_core());
|
||||
if (pb) linphone_gtk_fill_webcams(pb);
|
||||
}
|
||||
|
||||
bool_t linphone_gtk_is_friend(LinphoneCore *lc, const char *contact) {
|
||||
LinphoneAddress *addr = linphone_core_interpret_url(lc, contact);
|
||||
if (addr) {
|
||||
char *uri = linphone_address_as_string_uri_only(addr);
|
||||
LinphoneFriend *lf = linphone_core_get_friend_by_address(lc, uri);
|
||||
linphone_address_unref(addr);
|
||||
if (uri) ms_free(uri);
|
||||
if (lf) return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBUDEV_H
|
||||
|
||||
static struct udev *udevroot=NULL;
|
||||
static struct udev_monitor *monitor=NULL;
|
||||
static GIOChannel *monitor_channel=NULL;
|
||||
static guint monitor_src_id;
|
||||
|
||||
#include <libudev.h>
|
||||
|
||||
static gboolean on_monitor_data(GIOChannel *chan, GIOCondition cond, void *userdata){
|
||||
struct udev_device *dev=udev_monitor_receive_device(monitor);
|
||||
const char *subsys=udev_device_get_subsystem(dev);
|
||||
const char *type=udev_device_get_action(dev);
|
||||
g_message("USB event arrived for class %s of action type %s",subsys,type);
|
||||
if (strcmp(subsys,"sound")==0) linphone_gtk_reload_sound_devices();
|
||||
if (strcmp(subsys,"video4linux")==0) linphone_gtk_reload_video_devices();
|
||||
udev_device_unref(dev);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void linphone_gtk_monitor_usb(void){
|
||||
int fd;
|
||||
udevroot=udev_new();
|
||||
if (!udevroot) return;
|
||||
monitor=udev_monitor_new_from_netlink(udevroot,"udev");
|
||||
udev_monitor_filter_add_match_subsystem_devtype(monitor,"sound",NULL);
|
||||
udev_monitor_filter_add_match_subsystem_devtype(monitor,"video4linux",NULL);
|
||||
fd=udev_monitor_get_fd(monitor);
|
||||
monitor_channel=g_io_channel_unix_new(fd);
|
||||
monitor_src_id=g_io_add_watch(monitor_channel,G_IO_IN,on_monitor_data,NULL);
|
||||
udev_monitor_enable_receiving(monitor);
|
||||
}
|
||||
|
||||
void linphone_gtk_unmonitor_usb(void){
|
||||
if (monitor) udev_monitor_unref(monitor);
|
||||
if (udevroot) udev_unref(udevroot);
|
||||
if (monitor_channel) {
|
||||
g_source_remove(monitor_src_id);
|
||||
g_io_channel_unref(monitor_channel);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void linphone_gtk_monitor_usb(void){
|
||||
}
|
||||
void linphone_gtk_unmonitor_usb(void){
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -1,394 +0,0 @@
|
|||
/*
|
||||
linphone, gtk interface.
|
||||
Copyright (C) 2014 Belledonne Communications SARL
|
||||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone.h"
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
#include <gdk/gdkx.h>
|
||||
#elif defined(_WIN32)
|
||||
#include <gdk/gdkwin32.h>
|
||||
#elif defined(__APPLE__)
|
||||
extern void *gdk_quartz_window_get_nswindow(GdkWindow *window);
|
||||
extern void *gdk_quartz_window_get_nsview(GdkWindow *window);
|
||||
#endif
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
enum {
|
||||
TARGET_STRING,
|
||||
TARGET_TEXT,
|
||||
TARGET_URILIST
|
||||
};
|
||||
|
||||
static GtkTargetEntry targets[] = {
|
||||
{ "text/uri-list", GTK_TARGET_OTHER_APP, TARGET_URILIST },
|
||||
};
|
||||
|
||||
static void set_video_controls_position(GtkWidget *video_window);
|
||||
|
||||
static void on_end_of_play(LinphonePlayer *player){
|
||||
linphone_player_close(player);
|
||||
}
|
||||
|
||||
static void drag_data_received(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
|
||||
GtkSelectionData *selection_data, guint target_type, guint time, gpointer user_data){
|
||||
int datalen=gtk_selection_data_get_length(selection_data);
|
||||
const void *data=gtk_selection_data_get_data(selection_data);
|
||||
LinphoneCall *call=g_object_get_data(G_OBJECT(widget),"call");
|
||||
|
||||
ms_message("target_type=%i, datalen=%i, data=%p",target_type,datalen,data);
|
||||
if (target_type==TARGET_URILIST && data){
|
||||
LinphonePlayer *player=linphone_call_get_player(call);
|
||||
char *path=ms_strdup(data);
|
||||
while (datalen&&(path[datalen-1]=='\r'||path[datalen-1]=='\n')) {
|
||||
path[datalen-1]='\0';
|
||||
datalen--;
|
||||
}
|
||||
if (player){
|
||||
LinphonePlayerCbs *cbs = linphone_player_get_callbacks(player);
|
||||
linphone_player_cbs_set_eof_reached(cbs, on_end_of_play);
|
||||
const char* filepath = (strstr(path,"file://")==path) ? path+strlen("file://") : path;
|
||||
if (linphone_player_open(player,filepath)==0){
|
||||
|
||||
linphone_player_start(player);
|
||||
}else{
|
||||
GtkWidget *warn=gtk_message_dialog_new(GTK_WINDOW(widget),GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,GTK_BUTTONS_CLOSE,
|
||||
_("Cannot play %s."),filepath);
|
||||
g_signal_connect(warn,"response",(GCallback)gtk_widget_destroy,NULL);
|
||||
gtk_widget_show(warn);
|
||||
}
|
||||
}
|
||||
ms_free(path);
|
||||
}
|
||||
gtk_drag_finish (context, TRUE, FALSE, time);
|
||||
}
|
||||
|
||||
static gboolean drag_drop(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time, gpointer user_data){
|
||||
#if GTK_CHECK_VERSION(2,21,0)
|
||||
GList *l=gdk_drag_context_list_targets(drag_context);
|
||||
GList *elem;
|
||||
|
||||
if (l){
|
||||
ms_message("drag_drop");
|
||||
/* Choose the best target type */
|
||||
for(elem=l;elem!=NULL;elem=g_list_next(elem)){
|
||||
char *name=gdk_atom_name(GDK_POINTER_TO_ATOM(elem->data));
|
||||
ms_message("target: %s",name);
|
||||
g_free(name);
|
||||
}
|
||||
}else{
|
||||
ms_warning("drag_drop no targets");
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void *get_native_handle(GdkWindow *gdkw){
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
return (void *)GDK_WINDOW_XID(gdkw);
|
||||
#elif defined(_WIN32)
|
||||
return (void *)GDK_WINDOW_HWND(gdkw);
|
||||
#elif defined(__APPLE__)
|
||||
return (void *)gdk_quartz_window_get_nsview(gdkw);
|
||||
#endif
|
||||
g_warning("No way to get the native handle from gdk window");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void _resize_video_window(GtkWidget *video_window, MSVideoSize vsize){
|
||||
MSVideoSize cur;
|
||||
gtk_window_get_size(GTK_WINDOW(video_window),&cur.width,&cur.height);
|
||||
if (vsize.width*vsize.height > cur.width*cur.height ||
|
||||
ms_video_size_get_orientation(vsize)!=ms_video_size_get_orientation(cur) ){
|
||||
gtk_window_resize(GTK_WINDOW(video_window),vsize.width,vsize.height);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean resize_video_window(LinphoneCall *call){
|
||||
const LinphoneCallParams *params=linphone_call_get_current_params(call);
|
||||
if (params){
|
||||
MSVideoSize vsize=linphone_call_params_get_received_video_size(params);
|
||||
if (vsize.width>0 && vsize.height>0){
|
||||
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
|
||||
GtkWidget *video_window=(GtkWidget*)g_object_get_data(G_OBJECT(callview),"video_window");
|
||||
if (video_window){
|
||||
_resize_video_window(video_window,vsize);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void on_video_window_destroy(GtkWidget *w, guint timeout){
|
||||
g_source_remove(timeout);
|
||||
linphone_core_set_native_video_window_id(linphone_gtk_get_core(),LINPHONE_VIDEO_DISPLAY_NONE);
|
||||
}
|
||||
|
||||
static void video_window_set_fullscreen(GtkWidget *w, gboolean val){
|
||||
if (val){
|
||||
g_object_set_data(G_OBJECT(w),"fullscreen",GINT_TO_POINTER(1));
|
||||
gtk_window_fullscreen(GTK_WINDOW(w));
|
||||
}else{
|
||||
g_object_set_data(G_OBJECT(w),"fullscreen",GINT_TO_POINTER(0));
|
||||
gtk_window_unfullscreen(GTK_WINDOW(w));
|
||||
}
|
||||
}
|
||||
/*old names in old version of gdk*/
|
||||
#ifndef GDK_KEY_Escape
|
||||
#define GDK_KEY_Escape GDK_Escape
|
||||
#define GDK_KEY_F GDK_F
|
||||
#define GDK_KEY_f GDK_f
|
||||
#endif
|
||||
|
||||
static void on_video_window_key_press(GtkWidget *w, GdkEvent *ev, gpointer up){
|
||||
g_message("Key press event");
|
||||
switch(ev->key.keyval){
|
||||
case GDK_KEY_f:
|
||||
case GDK_KEY_F:
|
||||
video_window_set_fullscreen(w,TRUE);
|
||||
break;
|
||||
case GDK_KEY_Escape:
|
||||
video_window_set_fullscreen(w,FALSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void on_controls_response(GtkWidget *dialog, int response_id, GtkWidget *video_window){
|
||||
|
||||
gtk_widget_destroy(dialog);
|
||||
switch(response_id){
|
||||
case GTK_RESPONSE_YES:
|
||||
video_window_set_fullscreen(video_window,TRUE);
|
||||
break;
|
||||
case GTK_RESPONSE_NO:
|
||||
video_window_set_fullscreen(video_window,FALSE);
|
||||
break;
|
||||
case GTK_RESPONSE_REJECT:
|
||||
{
|
||||
LinphoneCall *call=(LinphoneCall*)g_object_get_data(G_OBJECT(video_window),"call");
|
||||
linphone_call_terminate(call);
|
||||
}
|
||||
break;
|
||||
case GTK_RESPONSE_APPLY:
|
||||
{
|
||||
LinphoneCall *call=(LinphoneCall*)g_object_get_data(G_OBJECT(video_window),"call");
|
||||
char *path = (char *)linphone_gtk_get_snapshot_path();
|
||||
linphone_call_take_video_snapshot(call, path);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static gboolean on_controls_destroy(GtkWidget *w){
|
||||
GtkWidget *video_window=(GtkWidget*)g_object_get_data(G_OBJECT(w),"video_window");
|
||||
gint timeout=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"timeout"));
|
||||
if (timeout!=0){
|
||||
g_source_remove(timeout);
|
||||
g_object_set_data(G_OBJECT(w),"timeout",GINT_TO_POINTER(0));
|
||||
}
|
||||
if (video_window) {
|
||||
g_object_set_data(G_OBJECT(video_window),"controls",NULL);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean _set_video_controls_position(GtkWidget *video_window){
|
||||
GtkWidget *w=(GtkWidget*)g_object_get_data(G_OBJECT(video_window),"controls");
|
||||
if (w){
|
||||
gint vw,vh;
|
||||
gint cw,ch;
|
||||
gint x,y;
|
||||
gtk_window_get_size(GTK_WINDOW(video_window),&vw,&vh);
|
||||
gtk_window_get_position(GTK_WINDOW(video_window),&x,&y);
|
||||
gtk_window_get_size(GTK_WINDOW(w),&cw,&ch);
|
||||
gtk_window_move(GTK_WINDOW(w),x+vw/2 - cw/2, y + vh - ch);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void set_video_controls_position(GtkWidget *video_window){
|
||||
/*do it a first time*/
|
||||
_set_video_controls_position(video_window);
|
||||
/*and schedule to do it a second time in order to workaround a bug in fullscreen mode, where poistion is not taken into account the first time*/
|
||||
g_timeout_add(0,(GSourceFunc)_set_video_controls_position,video_window);
|
||||
}
|
||||
|
||||
static gboolean video_window_moved(GtkWidget *widget, GdkEvent *event, gpointer user_data){
|
||||
/*Workaround to Video window bug on Windows. */
|
||||
/* set_video_controls_position(widget); */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gint do_gtk_widget_destroy(GtkWidget *w){
|
||||
gtk_widget_destroy(w);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void schedule_video_controls_disapearance(GtkWidget *w){
|
||||
gint timeout=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w),"timeout"));
|
||||
if (timeout != 0) g_source_remove(timeout);
|
||||
timeout=g_timeout_add(3000,(GSourceFunc)do_gtk_widget_destroy,w);
|
||||
g_object_set_data(G_OBJECT(w),"timeout",GINT_TO_POINTER(timeout));
|
||||
}
|
||||
|
||||
static GtkWidget *show_video_controls(GtkWidget *video_window){
|
||||
GtkWidget *w;
|
||||
w=(GtkWidget*)g_object_get_data(G_OBJECT(video_window),"controls");
|
||||
if (!w){
|
||||
gboolean isfullscreen=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(video_window),"fullscreen"));
|
||||
const char *stock_button=isfullscreen ? GTK_STOCK_LEAVE_FULLSCREEN : GTK_STOCK_FULLSCREEN;
|
||||
gint response_id=isfullscreen ? GTK_RESPONSE_NO : GTK_RESPONSE_YES ;
|
||||
GtkWidget *image = gtk_image_new_from_icon_name(linphone_gtk_get_ui_config("stop_call_icon_name","linphone-stop-call"), GTK_ICON_SIZE_BUTTON);
|
||||
GtkWidget *button;
|
||||
w=gtk_dialog_new_with_buttons("",GTK_WINDOW(video_window),GTK_DIALOG_DESTROY_WITH_PARENT,stock_button,response_id,NULL);
|
||||
gtk_window_set_opacity(GTK_WINDOW(w),0.5);
|
||||
gtk_window_set_decorated(GTK_WINDOW(w),FALSE);
|
||||
button=gtk_button_new_with_label(_("Hang up"));
|
||||
gtk_button_set_image(GTK_BUTTON(button), image);
|
||||
gtk_widget_show(button);
|
||||
gtk_dialog_add_action_widget(GTK_DIALOG(w),button,GTK_RESPONSE_REJECT);
|
||||
button=gtk_button_new_with_label(_("Take screenshot"));
|
||||
image = gtk_image_new_from_icon_name("linphone-take-screenshot", GTK_ICON_SIZE_BUTTON);
|
||||
gtk_button_set_image(GTK_BUTTON(button), image);
|
||||
gtk_widget_show(button);
|
||||
gtk_dialog_add_action_widget(GTK_DIALOG(w),button,GTK_RESPONSE_APPLY);
|
||||
g_signal_connect(w,"response",(GCallback)on_controls_response,video_window);
|
||||
schedule_video_controls_disapearance(w);
|
||||
g_signal_connect(w,"destroy",(GCallback)on_controls_destroy,NULL);
|
||||
g_object_set_data(G_OBJECT(w),"video_window",video_window);
|
||||
g_object_set_data(G_OBJECT(video_window),"controls",w);
|
||||
set_video_controls_position(video_window);
|
||||
gtk_widget_show(w);
|
||||
}else{
|
||||
schedule_video_controls_disapearance(w);
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
||||
static GtkWidget *create_video_window(LinphoneCall *call){
|
||||
char *remote,*title;
|
||||
GtkWidget *video_window;
|
||||
const LinphoneAddress *addr;
|
||||
guint timeout;
|
||||
MSVideoSize vsize={MS_VIDEO_SIZE_CIF_W,MS_VIDEO_SIZE_CIF_H};
|
||||
GdkColor color;
|
||||
|
||||
addr=linphone_call_get_remote_address(call);
|
||||
remote=linphone_gtk_address(addr);
|
||||
video_window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
/*gtk_window_set_transient_for(GTK_WINDOW(video_window), GTK_WINDOW(linphone_gtk_get_main_window()));*/
|
||||
title=g_strdup_printf("%s - Video call with %s",linphone_gtk_get_ui_config("title","Linphone"),remote);
|
||||
ms_free(remote);
|
||||
gtk_window_set_title(GTK_WINDOW(video_window),title);
|
||||
g_free(title);
|
||||
gtk_window_resize(GTK_WINDOW(video_window),vsize.width,vsize.height);
|
||||
gdk_color_parse("black",&color);
|
||||
gtk_widget_modify_bg(video_window,GTK_STATE_NORMAL,&color);
|
||||
|
||||
gtk_drag_dest_set(video_window, GTK_DEST_DEFAULT_ALL, targets, sizeof(targets)/sizeof(GtkTargetEntry), GDK_ACTION_COPY);
|
||||
gtk_widget_show(video_window);
|
||||
gdk_window_set_events(gtk_widget_get_window(video_window),
|
||||
gdk_window_get_events(gtk_widget_get_window(video_window)) | GDK_POINTER_MOTION_MASK);
|
||||
timeout=g_timeout_add(500,(GSourceFunc)resize_video_window,call);
|
||||
g_signal_connect(video_window,"destroy",(GCallback)on_video_window_destroy,GINT_TO_POINTER(timeout));
|
||||
g_signal_connect(video_window,"key-press-event",(GCallback)on_video_window_key_press,NULL);
|
||||
g_signal_connect_swapped(video_window,"motion-notify-event",(GCallback)show_video_controls,video_window);
|
||||
g_signal_connect(video_window,"configure-event",(GCallback)video_window_moved,NULL);
|
||||
g_signal_connect(video_window, "drag-data-received",(GCallback)drag_data_received, NULL);
|
||||
g_signal_connect(video_window, "drag-drop",(GCallback)drag_drop, NULL);
|
||||
g_object_set_data(G_OBJECT(video_window),"call",call);
|
||||
return video_window;
|
||||
}
|
||||
|
||||
void linphone_gtk_in_call_show_video(LinphoneCall *call){
|
||||
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
|
||||
GtkWidget *video_window=(GtkWidget*)g_object_get_data(G_OBJECT(callview),"video_window");
|
||||
const LinphoneCallParams *params=linphone_call_get_current_params(call);
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
|
||||
if (((bool_t)lp_config_get_int(linphone_core_get_config(lc), "video", "rtp_io", FALSE)) == FALSE) {
|
||||
if (linphone_call_get_state(call)!=LinphoneCallPaused && params && linphone_call_params_video_enabled(params)){
|
||||
if (video_window==NULL){
|
||||
video_window=create_video_window(call);
|
||||
g_object_set_data(G_OBJECT(callview),"video_window",video_window);
|
||||
}
|
||||
linphone_core_set_native_video_window_id(lc,get_native_handle(gtk_widget_get_window(video_window)));
|
||||
gtk_window_present(GTK_WINDOW(video_window));
|
||||
}else{
|
||||
if (video_window){
|
||||
gtk_widget_destroy(video_window);
|
||||
g_object_set_data(G_OBJECT(callview),"video_window",NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void on_video_preview_destroyed(GtkWidget *video_preview, GtkWidget *mw){
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
guint timeout_id=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(video_preview),"timeout-id"));
|
||||
g_object_set_data(G_OBJECT(mw),"video_preview",NULL);
|
||||
linphone_core_enable_video_preview(lc,FALSE);
|
||||
linphone_core_set_native_preview_window_id(lc,(void *)(unsigned long)-1);
|
||||
g_source_remove(timeout_id);
|
||||
}
|
||||
|
||||
GtkWidget *linphone_gtk_get_camera_preview_window(void){
|
||||
return (GtkWidget *)g_object_get_data(G_OBJECT(linphone_gtk_get_main_window()),"video_preview");
|
||||
}
|
||||
|
||||
static gboolean check_preview_size(GtkWidget *video_preview){
|
||||
MSVideoSize vsize=linphone_core_get_current_preview_video_size(linphone_gtk_get_core());
|
||||
if (vsize.width && vsize.height){
|
||||
MSVideoSize cur;
|
||||
gtk_window_get_size(GTK_WINDOW(video_preview),&cur.width,&cur.height);
|
||||
if (cur.width!=vsize.width || cur.height!=vsize.height){
|
||||
gtk_window_resize(GTK_WINDOW(video_preview),vsize.width,vsize.height);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void linphone_gtk_show_camera_preview_clicked(GtkButton *button){
|
||||
GtkWidget *mw=linphone_gtk_get_main_window();
|
||||
GtkWidget *video_preview=(GtkWidget *)g_object_get_data(G_OBJECT(mw),"video_preview");
|
||||
|
||||
if (!video_preview){
|
||||
gchar *title;
|
||||
LinphoneCore *lc=linphone_gtk_get_core();
|
||||
GdkColor color;
|
||||
guint tid;
|
||||
|
||||
video_preview=gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
title=g_strdup_printf("%s - Video preview",linphone_gtk_get_ui_config("title","Linphone"));
|
||||
gtk_window_set_title(GTK_WINDOW(video_preview),title);
|
||||
gdk_color_parse("black",&color);
|
||||
gtk_widget_modify_bg(video_preview,GTK_STATE_NORMAL,&color);
|
||||
g_free(title);
|
||||
g_object_set_data(G_OBJECT(mw),"video_preview",video_preview);
|
||||
g_signal_connect(video_preview,"destroy",(GCallback)on_video_preview_destroyed,mw);
|
||||
gtk_widget_show(video_preview);
|
||||
linphone_core_set_native_preview_window_id(lc,get_native_handle(gtk_widget_get_window(video_preview)));
|
||||
linphone_core_enable_video_preview(lc,TRUE);
|
||||
tid=g_timeout_add(100,(GSourceFunc)check_preview_size,video_preview);
|
||||
g_object_set_data(G_OBJECT(video_preview),"timeout-id",GINT_TO_POINTER(tid));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--Generated with glade3 3.4.5 on Sun Mar 29 15:33:09 2009 -->
|
||||
<interface>
|
||||
<object class="GtkWindow" id="waiting">
|
||||
<property name="title" translatable="yes">Linphone</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
|
||||
<property name="deletable">False</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-dialog-info</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="progressbar">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Please wait</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
2
pixmaps/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
|||
Makefile
|
||||
Makefile.in
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
############################################################################
|
||||
# CMakeLists.txt
|
||||
# Copyright (C) 2014 Belledonne Communications, Grenoble France
|
||||
#
|
||||
############################################################################
|
||||
#
|
||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
set(ICONS_INSTALL_DIR ${PACKAGE_DATA_DIR}/icons/hicolor)
|
||||
|
||||
install(FILES "linphone.icns" "linphone-banner.png"
|
||||
DESTINATION ${PACKAGE_DATA_DIR}/pixmaps/linphone
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
install(FILES
|
||||
svg/linphone-micro-muted.svg
|
||||
svg/linphone-speaker-muted.svg
|
||||
svg/linphone-micro-enabled.svg
|
||||
svg/linphone-speaker-enabled.svg
|
||||
svg/linphone-status-online.svg
|
||||
svg/linphone-status-away.svg
|
||||
svg/linphone-status-donotdisturb.svg
|
||||
svg/linphone-status-offline.svg
|
||||
svg/linphone-call-status-incoming.svg
|
||||
svg/linphone-call-status-missed.svg
|
||||
svg/linphone-call-status-outgoing.svg
|
||||
svg/linphone-chat-new-message-and-writing.svg
|
||||
svg/linphone-chat-new-message.svg
|
||||
svg/linphone-chat-nothing.svg
|
||||
svg/linphone-chat-writing.svg
|
||||
svg/linphone-ok.svg
|
||||
svg/linphone-inprogress.svg
|
||||
svg/linphone-failed.svg
|
||||
svg/linphone-camera-enabled.svg
|
||||
svg/linphone-camera-disabled.svg
|
||||
svg/linphone-security-ok.svg
|
||||
svg/linphone-security-pending.svg
|
||||
svg/linphone-media-play.svg
|
||||
svg/linphone-media-pause.svg
|
||||
svg/linphone-warning.svg
|
||||
DESTINATION ${ICONS_INSTALL_DIR}/scalable/status
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
install(FILES
|
||||
svg/linphone-start-call.svg
|
||||
svg/linphone-add-call.svg
|
||||
svg/linphone-hold-off.svg
|
||||
svg/linphone-hold-on.svg
|
||||
svg/linphone-start-call2.svg
|
||||
svg/linphone-start-chat.svg
|
||||
svg/linphone-history.svg
|
||||
svg/linphone-edit.svg
|
||||
svg/linphone-delete.svg
|
||||
svg/linphone-contact-add.svg
|
||||
svg/linphone-conference-start.svg
|
||||
svg/linphone-call-transfer.svg
|
||||
svg/linphone-record.svg
|
||||
svg/linphone-chat-send.svg
|
||||
DESTINATION ${ICONS_INSTALL_DIR}/scalable/actions
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
install(FILES
|
||||
linphone-micro-muted.png
|
||||
linphone-speaker-muted.png
|
||||
linphone-micro-enabled.png
|
||||
linphone-speaker-enabled.png
|
||||
linphone-status-online.png
|
||||
linphone-status-away.png
|
||||
linphone-status-donotdisturb.png
|
||||
linphone-status-offline.png
|
||||
linphone-chat-nothing.png
|
||||
linphone-chat-new-message.png
|
||||
linphone-chat-writing.png
|
||||
linphone-chat-new-message-and-writing.png
|
||||
linphone-call-status-incoming.png
|
||||
linphone-call-status-outgoing.png
|
||||
linphone-call-status-missed.png
|
||||
linphone-ok.png
|
||||
linphone-inprogress.png
|
||||
linphone-failed.png
|
||||
linphone-camera-enabled.png
|
||||
linphone-camera-disabled.png
|
||||
linphone-security-ok.png
|
||||
linphone-security-pending.png
|
||||
linphone-media-play.png
|
||||
linphone-media-pause.png
|
||||
linphone-warning.png
|
||||
DESTINATION ${ICONS_INSTALL_DIR}/48x48/status
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
install(FILES
|
||||
linphone-start-call2.png
|
||||
linphone-add-call.png
|
||||
linphone-start-call.png
|
||||
linphone-start-chat.png
|
||||
linphone-stop-call.png
|
||||
linphone-hold-on.png
|
||||
linphone-hold-off.png
|
||||
linphone-history.png
|
||||
linphone-edit.png
|
||||
linphone-delete.png
|
||||
linphone-contact-add.png
|
||||
linphone-conference-start.png
|
||||
linphone-call-transfer.png
|
||||
linphone-record.png
|
||||
linphone-chat-send.png
|
||||
linphone-take-screenshot.png
|
||||
DESTINATION ${ICONS_INSTALL_DIR}/48x48/actions
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
install(FILES linphone.png
|
||||
DESTINATION ${ICONS_INSTALL_DIR}/48x48/apps
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
install(FILES index.theme
|
||||
DESTINATION ${ICONS_INSTALL_DIR}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
pixmapdir=$(datadir)/pixmaps/linphone
|
||||
dist_pixmap_DATA= \
|
||||
linphone-banner.png \
|
||||
linphone.icns
|
||||
|
||||
iconsdir=$(datadir)/icons/hicolor
|
||||
if BUILD_WIN32
|
||||
dist_icons_DATA=index.theme
|
||||
endif
|
||||
|
||||
appiconsdir=$(iconsdir)/48x48/apps
|
||||
dist_appicons_DATA= linphone.png
|
||||
|
||||
status48iconsdir=$(iconsdir)/48x48/status
|
||||
dist_status48icons_DATA= \
|
||||
linphone-micro-muted.png \
|
||||
linphone-speaker-muted.png \
|
||||
linphone-micro-enabled.png \
|
||||
linphone-speaker-enabled.png \
|
||||
linphone-status-online.png \
|
||||
linphone-status-away.png \
|
||||
linphone-status-donotdisturb.png \
|
||||
linphone-status-offline.png \
|
||||
linphone-chat-nothing.png \
|
||||
linphone-chat-new-message.png \
|
||||
linphone-chat-writing.png \
|
||||
linphone-chat-new-message-and-writing.png \
|
||||
linphone-call-status-incoming.png \
|
||||
linphone-call-status-outgoing.png \
|
||||
linphone-call-status-missed.png \
|
||||
linphone-ok.png \
|
||||
linphone-inprogress.png \
|
||||
linphone-failed.png \
|
||||
linphone-camera-enabled.png \
|
||||
linphone-camera-disabled.png \
|
||||
linphone-security-ok.png \
|
||||
linphone-security-pending.png \
|
||||
linphone-media-play.png \
|
||||
linphone-media-pause.png \
|
||||
linphone-warning.png \
|
||||
linphone-take-screenshot.png
|
||||
|
||||
statussvgiconsdir=$(iconsdir)/scalable/status
|
||||
dist_statussvgicons_DATA= \
|
||||
svg/linphone-micro-muted.svg \
|
||||
svg/linphone-speaker-muted.svg \
|
||||
svg/linphone-micro-enabled.svg \
|
||||
svg/linphone-speaker-enabled.svg \
|
||||
svg/linphone-status-online.svg \
|
||||
svg/linphone-status-away.svg \
|
||||
svg/linphone-status-donotdisturb.svg \
|
||||
svg/linphone-status-offline.svg \
|
||||
svg/linphone-call-status-incoming.svg \
|
||||
svg/linphone-call-status-missed.svg \
|
||||
svg/linphone-call-status-outgoing.svg \
|
||||
svg/linphone-chat-new-message-and-writing.svg \
|
||||
svg/linphone-chat-new-message.svg \
|
||||
svg/linphone-chat-nothing.svg \
|
||||
svg/linphone-chat-writing.svg \
|
||||
svg/linphone-ok.svg \
|
||||
svg/linphone-inprogress.svg \
|
||||
svg/linphone-failed.svg \
|
||||
svg/linphone-camera-enabled.svg \
|
||||
svg/linphone-camera-disabled.svg \
|
||||
svg/linphone-security-ok.svg \
|
||||
svg/linphone-security-pending.svg \
|
||||
svg/linphone-media-play.svg \
|
||||
svg/linphone-media-pause.svg \
|
||||
svg/linphone-warning.svg
|
||||
|
||||
actions48iconsdir=$(iconsdir)/48x48/actions
|
||||
dist_actions48icons_DATA= \
|
||||
linphone-start-call2.png \
|
||||
linphone-add-call.png \
|
||||
linphone-start-call.png \
|
||||
linphone-start-chat.png \
|
||||
linphone-stop-call.png \
|
||||
linphone-hold-on.png \
|
||||
linphone-hold-off.png \
|
||||
linphone-history.png \
|
||||
linphone-edit.png \
|
||||
linphone-delete.png \
|
||||
linphone-contact-add.png \
|
||||
linphone-conference-start.png \
|
||||
linphone-call-transfer.png \
|
||||
linphone-record.png \
|
||||
linphone-chat-send.png
|
||||
|
||||
actionssvgiconsdir=$(iconsdir)/scalable/actions
|
||||
dist_actionssvgicons_DATA= \
|
||||
svg/linphone-start-call.svg \
|
||||
svg/linphone-add-call.svg \
|
||||
svg/linphone-hold-off.svg \
|
||||
svg/linphone-hold-on.svg \
|
||||
svg/linphone-start-call2.svg \
|
||||
svg/linphone-start-chat.svg \
|
||||
svg/linphone-history.svg \
|
||||
svg/linphone-edit.svg \
|
||||
svg/linphone-delete.svg \
|
||||
svg/linphone-contact-add.svg \
|
||||
svg/linphone-conference-start.svg \
|
||||
svg/linphone-call-transfer.svg \
|
||||
svg/linphone-record.svg \
|
||||
svg/linphone-chat-send.svg
|
||||
1836
pixmaps/index.theme
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 871 B |
|
Before Width: | Height: | Size: 2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 338 B |
|
Before Width: | Height: | Size: 364 B |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 694 B |
|
Before Width: | Height: | Size: 707 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |