Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-daemon
Commits
c9a5d094
Commit
c9a5d094
authored
Jun 28, 2010
by
Jonas Fonseca
Committed by
Jonas Fonseca
Jul 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
im
Signed-off-by:
Jonas Fonseca
<
jonas.fonseca@savoirfairelinux.com
>
parent
12bc81b9
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
735 additions
and
2 deletions
+735
-2
.gitignore
.gitignore
+1
-0
sflphone-client-gnome/Makefile.am
sflphone-client-gnome/Makefile.am
+1
-1
sflphone-client-gnome/configure.ac
sflphone-client-gnome/configure.ac
+2
-0
sflphone-client-gnome/src/Makefile.am
sflphone-client-gnome/src/Makefile.am
+1
-0
sflphone-client-gnome/src/callable_obj.h
sflphone-client-gnome/src/callable_obj.h
+3
-0
sflphone-client-gnome/src/icons/icon_factory.c
sflphone-client-gnome/src/icons/icon_factory.c
+1
-0
sflphone-client-gnome/src/icons/icon_factory.h
sflphone-client-gnome/src/icons/icon_factory.h
+1
-0
sflphone-client-gnome/src/icons/pixmap_data.h
sflphone-client-gnome/src/icons/pixmap_data.h
+98
-0
sflphone-client-gnome/src/imwindow.c
sflphone-client-gnome/src/imwindow.c
+134
-0
sflphone-client-gnome/src/imwindow.h
sflphone-client-gnome/src/imwindow.h
+59
-0
sflphone-client-gnome/src/sflphone_const.h
sflphone-client-gnome/src/sflphone_const.h
+4
-0
sflphone-client-gnome/src/ui.xml
sflphone-client-gnome/src/ui.xml
+1
-0
sflphone-client-gnome/src/uimanager.c
sflphone-client-gnome/src/uimanager.c
+41
-0
sflphone-client-gnome/src/widget/Makefile.am
sflphone-client-gnome/src/widget/Makefile.am
+2
-1
sflphone-client-gnome/src/widget/imwidget.c
sflphone-client-gnome/src/widget/imwidget.c
+132
-0
sflphone-client-gnome/src/widget/imwidget.h
sflphone-client-gnome/src/widget/imwidget.h
+70
-0
sflphone-client-gnome/src/widget/webwidget.c
sflphone-client-gnome/src/widget/webwidget.c
+87
-0
sflphone-client-gnome/src/widget/webwidget.h
sflphone-client-gnome/src/widget/webwidget.h
+68
-0
sflphone-client-gnome/webkit/Makefile.am
sflphone-client-gnome/webkit/Makefile.am
+8
-0
sflphone-client-gnome/webkit/im/im.css
sflphone-client-gnome/webkit/im/im.css
+6
-0
sflphone-client-gnome/webkit/im/im.html
sflphone-client-gnome/webkit/im/im.html
+11
-0
sflphone-client-gnome/webkit/im/im.js
sflphone-client-gnome/webkit/im/im.js
+4
-0
No files found.
.gitignore
View file @
c9a5d094
...
...
@@ -98,6 +98,7 @@ sflphone-client-gnome/stamp-h1
/sflphone-client-gnome/src/widget/Makefile
/sflphone-client-gnome/doc/Makefile
/sflphone-client-gnome/po/Makefile
/sflphone-client-gnome/webkit/Makefile
# Ignore sflphone-client-gnome stuff
...
...
sflphone-client-gnome/Makefile.am
View file @
c9a5d094
SUBDIRS
=
src pixmaps tests man po doc
SUBDIRS
=
src pixmaps
webkit
tests man po doc
ACLOCAL_AMFLAGS
=
-I
m4
...
...
sflphone-client-gnome/configure.ac
View file @
c9a5d094
...
...
@@ -64,6 +64,7 @@ PKG_CHECK_MODULES(DEPS, \
libnotify >= 0.4 \
gtk+-2.0 >= 2.2 \
glib-2.0 >= 2.2 \
webkit-1.0 \
libebook-1.2 >= 2.22 \
libgnomeui-2.0 \
gnome-doc-utils
...
...
@@ -90,6 +91,7 @@ src/contacts/addressbook/Makefile
src/widget/Makefile
src/icons/Makefile
pixmaps/Makefile
webkit/Makefile
sflphone.desktop
tests/Makefile
man/Makefile
...
...
sflphone-client-gnome/src/Makefile.am
View file @
c9a5d094
...
...
@@ -16,6 +16,7 @@ sflphone_client_gnome_SOURCES = \
uimanager.c
\
sflnotify.c
\
mainwindow.c
\
imwindow.c
\
dialpad.c
\
callable_obj.c
\
conference_obj.c
\
...
...
sflphone-client-gnome/src/callable_obj.h
View file @
c9a5d094
...
...
@@ -149,6 +149,9 @@ typedef struct {
/* The audio codec used for this call, if applicable */
gchar
*
_audio_codec
;
/* Associated IM widget */
GtkWidget
*
_im_widget
;
}
callable_obj_t
;
void
create_new_call
(
callable_type_t
,
call_state_t
,
gchar
*
,
gchar
*
,
gchar
*
,
gchar
*
,
callable_obj_t
**
);
...
...
sflphone-client-gnome/src/icons/icon_factory.c
View file @
c9a5d094
...
...
@@ -67,6 +67,7 @@ void register_sflphone_stock_icons (GtkIconFactory *factory)
add_icon
(
factory
,
GTK_STOCK_TRANSFER
,
gnome_stock_transfer
,
GTK_ICON_SIZE_SMALL_TOOLBAR
);
add_icon
(
factory
,
GTK_STOCK_ONHOLD
,
gnome_stock_onhold
,
GTK_ICON_SIZE_SMALL_TOOLBAR
);
add_icon
(
factory
,
GTK_STOCK_OFFHOLD
,
gnome_stock_offhold
,
GTK_ICON_SIZE_SMALL_TOOLBAR
);
add_icon
(
factory
,
GTK_STOCK_IM
,
gnome_stock_im
,
GTK_ICON_SIZE_SMALL_TOOLBAR
);
add_icon
(
factory
,
GTK_STOCK_CALL_CURRENT
,
gnome_stock_call_current
,
GTK_ICON_SIZE_SMALL_TOOLBAR
);
add_icon
(
factory
,
GTK_STOCK_ADDRESSBOOK
,
gnome_stock_addressbook
,
GTK_ICON_SIZE_SMALL_TOOLBAR
);
add_icon
(
factory
,
GTK_STOCK_CALLS
,
gnome_stock_calls
,
GTK_ICON_SIZE_SMALL_TOOLBAR
);
...
...
sflphone-client-gnome/src/icons/icon_factory.h
View file @
c9a5d094
...
...
@@ -41,6 +41,7 @@ G_BEGIN_DECLS
#define GTK_STOCK_HANGUP "gnome-stock-hangup"
#define GTK_STOCK_ONHOLD "gnome-stock-onhold"
#define GTK_STOCK_OFFHOLD "gnome-stock-offhold"
#define GTK_STOCK_IM "gnome-stock-im"
#define GTK_STOCK_TRANSFER "gnome-stock-transfer"
#define GTK_STOCK_DIAL "gnome-stock-dial"
#define GTK_STOCK_CALL_CURRENT "gnome-stock-call-current"
...
...
sflphone-client-gnome/src/icons/pixmap_data.h
View file @
c9a5d094
...
...
@@ -660,6 +660,104 @@ static const guint8 gnome_stock_offhold[] =
"
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0
lrU
\0
mt
\267\0
lt
\254\0
js<
\0\0\0\0
"
};
/* GdkPixbuf RGBA C-Source image dump */
#ifdef __SUNPRO_C
#pragma align 4 (gnome_stock_im)
#endif
#ifdef __GNUC__
static
const
guint8
gnome_stock_im
[]
__attribute__
((
__aligned__
(
4
)))
=
#else
static
const
guint8
gnome_stock_im
[]
=
#endif
{
""
/* Pixbuf magic (0x47646b50) */
"GdkP"
/* length: header (24) + pixel_data (2304) */
"
\0\0\11\30
"
/* pixdata_type (0x1010002) */
"
\1\1\0\2
"
/* rowstride (96) */
"
\0\0\0
`"
/* width (24) */
"
\0\0\0\30
"
/* height (24) */
"
\0\0\0\30
"
/* pixel_data: */
"
\0\0\0\0\0
ix
\21\0
mss
\0
mr
\210\0
lt@
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"3ff
\5\14
kqV
\14
lr
\250\0
lr}
\0
mv
\34\0\0\0\0\0
ht
\26\0
ls
\343\0
ls
\377\0
ls
\377
"
"
\0
ls
\377\0
ms
\242\0\200\200\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0\0\34
qq
\11\33
mm/
\32
kqX
\33
ms
\205\26
lq
\320\17
ou
\377\22
kp"
"
\377\0
ls
\377\0
ls
\364\0
lq-
\0
ks
\212\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
l"
"s
\377\0
ks
\253\0
ff
\5\0\0\0\0\0\0\0\0\40
`p
\20\34
mm6
\35
nta
\33
ms
\214\34
k"
"p
\235\26
tz
\230\16\202\212\237\5\206\216\324\1\207\217\377\1\205\216\377
"
"
\21
lq
\377\0
ls
\377\0
ls
\377\0
ks
\262\0
lr
\256\0
ls
\377\0
ls
\377\0
ls
\377\0
l"
"s
\377\0
ls
\377\3
lr
\377\11
lr
\300\32
mtn
\34
ns
\222\34
lq
\234\26
y
\200\230\15
"
"
\207\217\240\6\222\233\241\0\233\245\241\0\232\245\241\0\216\226\324
"
"
\4\201\211\377\10
z
\200\377\2\203\213\377\21
lq
\377\0
ls
\377\0
ls
\377\0
l"
"t
\326\0
lsv
\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\22
lq
\377\16
sy
\377
"
"
\11\202\212\341\5\226\241\243\0\236\251\241\0\236\250\241\2\232\245\241
"
"
\6\217\230\241\16\202\212\237\20
qy
\321\21
lq
\377\17
ls
\377\22
kp
\377\2\201
"
"
\211\377\21
kq
\377\0
ls
\377\0
ls
\377\0
ks
\235\0\200\200\6\0
ls
\377\0
ls
\377
"
"
\0
ls
\377\0
ls
\377\0
ls
\377\17
ls
\377\3\210\220\377\1\212\223\377\6\205\215
"
"
\342\16\201\211\240\27
rw
\230\35
ko
\236\33
lt
\206\15
lq
\266\6
ls
\377\1
ls
\377
"
"
\0
ls
\377\21
lq
\377\2\177\207\377\21
kq
\377\0
ls
\377\0
lr
\341\0
ju
\30\0\0\0
"
"
\0\0
pp
\20\0
ms
\312\0
ls
\377\0
ls
\377\0
ls
\377\17
ls
\377\3\207\216\377\22
k"
"p
\377\15
ms
\377\13
mr
\314\26
ot.$mm
\7\0
lr
\223\0
ls
\377\0
ls
\377\0
ls
\377\0
"
"ls
\377\21
lq
\377\2
~
\206\377\21
kq
\377\0
ls
\340\0
lt!
\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0
fw
\17\0
ls
\307\0
ls
\377\0
ls
\377\17
ls
\377\3\205\216\377\22
kp
\377\0
"
"ls
\377\0
ls
\377\0
ls
\266\0
kr
\230\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377
"
"
\21
lq
\377\2
}
\204\377\22
kq
\362\0
pp
\40\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0
fw
\17\0
ks
\305\0
ls
\377\17
ls
\377\3\204\214\377\22
kp
\377\0
ls
\377
"
"
\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\21
l"
"q
\377\2
|
\204\362\32
ko
\247\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0
mm
\16\0
lr
\304\17
ls
\377\3\202\213\377\22
kp
\377\0
ls
\377\0
"
"ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\22
lp
\361
"
"
\3
~
\210\254\34
kp
\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0\0\0
vv
\15\21
ls
\345\3\201\211\377\22
kp
\377\0
ls
\377\0
ls
\377
"
"
\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\332\32
lo
\247\3\177
"
"
\210\241\34
kp
\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0\0\0\0\32
mr
\224\3\201\211\351\22
kp
\377\0
ls
\377\0
ls
\377
"
"
\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
mt
\332\0
hq
\33\34
lo
\234\3
}
\205
"
"
\241\34
kp
\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0\0\33
lq
\220\3\201\211\335\22
kp
\377\0
ls
\377\0
ls
\377\0
ls"
"
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ms
\305\0
f
\200\12\34
lo
\234\3
z
\203
"
"
\241\34
kp
\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0
UU
\3\22
lr
\326\3
}
\205\377\22
kp
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
"
"ls
\377\0
ls
\377\0
ls
\377\4
ls
\377\12
lr
\377\17
mq
\337\34
ko
\245\3
x
\200\241
"
"
\34
kp
\233\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
U"
"U
\3\0
ks
\244\17
lr
\377\3
|
\204\377\22
kp
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls"
"
\377\3
ls
\377\16
lq
\377\17
lr
\377\11
rx
\377\5
sz
\377\7
rx
\351\3
w
\177\245\35
"
"ko
\236\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
UU
\3\0
ls
\246
"
"
\0
ls
\377\17
kr
\377\3
{
\202\377\22
kp
\377\0
ls
\377\0
ls
\377\0
ls
\377\2
ls
\377
"
"
\20
lq
\377\10
rx
\377\0
v}
\377\0
u}
\377\0
t{
\377\0
sz
\377\3
rx
\351\34
jo
\246\0
"
"
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\4\3
ls
\257\10
lr
\377\13
"
"lr
\377\22
kp
\377\3
y
\201\377\22
kp
\377\0
ls
\377\0
ls
\377\0
ls
\324\16
lr
\333
"
"
\10
ry
\377\0
v}
\377\0
t|
\377\0
t{
\377\0
sz
\377\0
ry
\377\6
nv
\377\16
kr
\337\0
"
"fw
\17\0\0\0\0\0\0\0\0\0\0\0\0\22
mm
\16\16
lr
\315\21
lr
\377\13
qx
\377\6
v}"
"
\377\10
u{
\377\2
y
\201\377\22
kp
\377\0
ls
\377\0
ls
\317\0
ht
\26\35
kp
\240\1
u"
"|
\344\0
t{
\377\0
sz
\377\0
ry
\377\0
qx
\377\4
ov
\377\20
kq
\377\3
ls
\377\0
ls
\307
"
"
\0
fw
\17\0\0\0\0\40\200\200\10\22
lr
\331\13
qy
\377\1
}
\204\377\0
|
\204\377
"
"
\0
{
\202\377\0
z
\202\377\1
x
\177\377\22
kp
\377\0
ls
\316\0
ky
\23\0\0\0\0\35
"
"kp
\217\13
sy
\242\1
t|
\343\0
qx
\377\4
pv
\377\13
mt
\377\20
kp
\377\4
kr
\377\0
l"
"s
\377\0
ls
\377\0
ls
\377\0\200\200\6\17
mr
\233\12
ry
\377\0
}
\204\377\0
{
\203
"
"
\377\0
{
\202\377\0
y
\201\377\0
y
\200\377\4
u|
\377\17
lq
\347\0
qq
\22\0\0\0\0
"
"
\0\0\0\0\34
hq
\33\32
lp
\200\34
kp
\235\23
kp
\341\17
lq
\377\11
lr
\377\1
ks
\377
"
"
\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
lt
\213\23
kr
\333\3
y
\201\377\0
{
\202\377
"
"
\0
z
\201\377\0
y
\200\377\0
x
\177\377\3
v|
\377\21
jr
\353\23
mv6
\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\6\0
mr
\260\0
ls
\377\0
ls"
"
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\322\22
lr
\313\10
s{
\377\0
y
\200
"
"
\377\0
x
\200\377\2
v}
\377\11
qw
\377\21
kq
\353\27
koL
\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\200\6\0
ls
\255\0
ls
\377
"
"
\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\377\0
ls
\273\14
jnA
\17
lq
\370\21
kq
\377\20
k"
"r
\377\20
lq
\377\15
kr
\335\24
bo'
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
ff
\5\0
lt
\252\0
ls
\377\0
ls
\377
"
"
\0
ls
\377\0
ls
\374\0
ksE
\0\0\0\0\0
lq-
\2
ms
\242\1
ls
\275\0
lrt
\0
tt
\13\0\0\0
"
"
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
"
"
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0
lrU
\0
mt
\267\0
lt
\254\0
js<
\0\0\0\0
"
};
/* GdkPixbuf RGBA C-Source image dump */
#ifdef __SUNPRO_C
...
...
sflphone-client-gnome/src/imwindow.c
0 → 100644
View file @
c9a5d094
/*
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010 Savoir-Faire Linux Inc.
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
* Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#include <config.h>
#include <gtk/gtk.h>
#include <eel-gconf-extensions.h>
#include <sflphone_const.h>
#include <imwindow.h>
/** Local variables */
GtkWidget
*
im_window
=
NULL
;
GtkWidget
*
im_vbox
=
NULL
;
static
gboolean
window_configure_cb
(
GtkWidget
*
win
,
GdkEventConfigure
*
event
)
{
int
pos_x
,
pos_y
;
eel_gconf_set_integer
(
CONF_IM_WINDOW_WIDTH
,
event
->
width
);
eel_gconf_set_integer
(
CONF_IM_WINDOW_HEIGHT
,
event
->
height
);
gtk_window_get_position
(
GTK_WINDOW
(
im_window_get
()),
&
pos_x
,
&
pos_y
);
eel_gconf_set_integer
(
CONF_IM_WINDOW_POSITION_X
,
pos_x
);
eel_gconf_set_integer
(
CONF_IM_WINDOW_POSITION_Y
,
pos_y
);
return
FALSE
;
}
/**
* Minimize the main window.
*/
static
gboolean
on_delete
(
GtkWidget
*
widget
UNUSED
,
gpointer
data
UNUSED
)
{
gtk_widget_hide
(
GTK_WIDGET
(
im_window_get
()));
return
TRUE
;
}
static
void
im_window_init
()
{
const
char
*
window_title
=
"SFLphone VoIP Client"
;
gchar
*
path
;
GError
*
error
=
NULL
;
gboolean
ret
;
int
width
,
height
,
position_x
,
position_y
;
// Get configuration stored in gconf
width
=
eel_gconf_get_integer
(
CONF_IM_WINDOW_WIDTH
);
if
(
width
<=
0
)
width
=
400
;
height
=
eel_gconf_get_integer
(
CONF_IM_WINDOW_HEIGHT
);
if
(
height
<=
0
)
height
=
500
;
position_x
=
eel_gconf_get_integer
(
CONF_IM_WINDOW_POSITION_X
);
position_y
=
eel_gconf_get_integer
(
CONF_IM_WINDOW_POSITION_Y
);
im_window
=
gtk_window_new
(
GTK_WINDOW_TOPLEVEL
);
gtk_container_set_border_width
(
GTK_CONTAINER
(
im_window
),
0
);
gtk_window_set_title
(
GTK_WINDOW
(
im_window
),
window_title
);
gtk_window_set_default_size
(
GTK_WINDOW
(
im_window
),
width
,
height
);
gtk_window_set_default_icon_from_file
(
LOGO
,
NULL
);
gtk_window_set_position
(
GTK_WINDOW
(
im_window
),
GTK_WIN_POS_MOUSE
);
gtk_widget_set_name
(
im_window
,
"imwindow"
);
g_signal_connect
(
G_OBJECT
(
im_window
),
"delete-event"
,
G_CALLBACK
(
on_delete
),
NULL
);
g_signal_connect_object
(
G_OBJECT
(
im_window
),
"configure-event"
,
G_CALLBACK
(
window_configure_cb
),
NULL
,
0
);
im_vbox
=
gtk_vbox_new
(
FALSE
/*homogeneous*/
,
0
/*spacing*/
);
gtk_container_add
(
GTK_CONTAINER
(
im_window
),
im_vbox
);
/* make sure that everything is visible */
gtk_widget_show_all
(
im_window
);
// Restore position according to the configuration stored in gconf
gtk_window_move
(
GTK_WINDOW
(
im_window
),
position_x
,
position_y
);
}
GtkWidget
*
im_window_get
()
{
if
(
im_window
==
NULL
)
im_window_init
();
return
im_window
;
}
void
im_window_add
(
GtkWidget
*
widget
)
{
if
(
im_window_get
())
{
gtk_box_pack_start
(
GTK_BOX
(
im_vbox
),
widget
,
TRUE
/*expand*/
,
TRUE
/*fill*/
,
0
/*padding*/
);
gtk_widget_show_all
(
im_window
);
}
}
void
im_window_remove
(
GtkWidget
*
widget
)
{
// TODO(jonas) remove widget from the window
}
sflphone-client-gnome/src/imwindow.h
0 → 100644
View file @
c9a5d094
/*
* Copyright (C) 2010 Savoir-Faire Linux Inc.
*
* 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef __IMWINDOW_H__
#define __IMWINDOW_H__
#include <gtk/gtk.h>
#include <gtk/gtk.h>
#define IM_WINDOW_WIDTH 280
#define IM_WINDOW_HEIGHT 320
/** @file imwindow.h
* @brief The IM window of the client.
*/
/**
* Display the IM window
* @return GtkWidget* The IM window
*/
GtkWidget
*
im_window_get
();
/**
* Add IM widget to the IM window
*/
void
im_window_add
(
GtkWidget
*
widget
);
/**
* Remove IM widget from the IM window
*/
void
im_window_remove
(
GtkWidget
*
widget
);
#endif
sflphone-client-gnome/src/sflphone_const.h
View file @
c9a5d094
...
...
@@ -185,6 +185,10 @@ log4c_category_t* log4c_sfl_gtk_category;
#define CONF_MAIN_WINDOW_HEIGHT CONF_PREFIX "/state/window_height"
#define CONF_MAIN_WINDOW_POSITION_X CONF_PREFIX "/state/window_position_x"
#define CONF_MAIN_WINDOW_POSITION_Y CONF_PREFIX "/state/window_position_y"
#define CONF_IM_WINDOW_WIDTH CONF_PREFIX "/state/im_width"
#define CONF_IM_WINDOW_HEIGHT CONF_PREFIX "/state/im_height"
#define CONF_IM_WINDOW_POSITION_X CONF_PREFIX "/state/im_position_x"
#define CONF_IM_WINDOW_POSITION_Y CONF_PREFIX "/state/im_position_y"
/** Show/Hide the dialpad */
#define CONF_SHOW_DIALPAD CONF_PREFIX "/state/dialpad"
#define SHOW_VOLUME_CONTROLS CONF_PREFIX "/state/volume_controls"
...
...
sflphone-client-gnome/src/ui.xml
View file @
c9a5d094
...
...
@@ -7,6 +7,7 @@
<menuitem
action=
"PickUp"
/>
<menuitem
action=
"HangUp"
/>
<menuitem
name=
"OnHoldMenu"
action=
"OnHold"
/>
<menuitem
action=
"InstantMessaging"
/>
<menuitem
action=
"Record"
/>
<separator/>
<menuitem
action=
"AccountAssistant"
/>
...
...
sflphone-client-gnome/src/uimanager.c
View file @
c9a5d094
...
...
@@ -39,6 +39,7 @@
#include <libgnome/gnome-help.h>
#include <uimanager.h>
#include <statusicon.h>
#include <widget/imwidget.h>
static
GtkWidget
*
toolbar
;
static
GtkWidget
*
toolbarWindows
;
...
...
@@ -504,6 +505,26 @@ call_hold(void* foo UNUSED)
}
}
static
void
call_im
(
void
*
foo
UNUSED
)
{
callable_obj_t
*
selectedCall
=
calltab_get_selected_call
(
current_calls
);
static
GtkWidget
*
im
=
NULL
;
if
(
!
im
)
{
im
=
im_widget_new
();
im_window_add
(
im
);
}
else
{
im_widget_add_message
(
im
,
"hello from call_im"
);
}
if
(
selectedCall
)
{
printf
(
"Call IM with call
\n
"
);
selectedCall
->
_im_widget
=
im_widget_new
();
}
}
static
void
conference_hold
(
void
*
foo
UNUSED
)
{
...
...
@@ -839,6 +860,8 @@ static const GtkActionEntry menu_entries[] =
N_
(
"Place the call on hold"
),
G_CALLBACK
(
call_hold
)
},
{
"OffHold"
,
GTK_STOCK_OFFHOLD
,
N_
(
"O_ff hold"
),
"<control>P"
,
N_
(
"Place the call off hold"
),
G_CALLBACK
(
call_hold
)
},
{
"InstantMessaging"
,
GTK_STOCK_IM
,
N_
(
"Send _message"
),
"<control>M"
,
N_
(
"Send message"
),
G_CALLBACK
(
call_im
)
},
{
"AccountAssistant"
,
NULL
,
N_
(
"Configuration _Assistant"
),
NULL
,
N_
(
"Run the configuration assistant"
),
G_CALLBACK
(
call_configuration_assistant
)
},
...
...
@@ -1012,6 +1035,7 @@ show_popup_menu(GtkWidget *my_widget, GdkEventButton *event)
gboolean
pickup
=
FALSE
,
hangup
=
FALSE
,
hold
=
FALSE
,
copy
=
FALSE
,
record
=
FALSE
,
detach
=
FALSE
;
gboolean
accounts
=
FALSE
;
gboolean
im
=
FALSE
;
// conference type boolean
gboolean
hangup_conf
=
FALSE
,
hold_conf
=
FALSE
;
...
...
@@ -1054,6 +1078,7 @@ show_popup_menu(GtkWidget *my_widget, GdkEventButton *event)
hold
=
TRUE
;
record
=
TRUE
;
detach
=
TRUE
;
im
=
TRUE
;
break
;
case
CALL_STATE_BUSY
:
case
CALL_STATE_FAILURE
:
...
...
@@ -1182,6 +1207,22 @@ show_popup_menu(GtkWidget *my_widget, GdkEventButton *event)
gtk_widget_show
(
menu_items
);
}
if
(
im
)
{
menu_items
=
gtk_separator_menu_item_new
();
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
menu
),
menu_items
);
gtk_widget_show
(
menu_items
);
menu_items
=
gtk_image_menu_item_new_with_mnemonic
(
_
(
"Send _message"
));
image
=
gtk_image_new_from_stock
(
GTK_STOCK_IM
,
GTK_ICON_SIZE_MENU
);
gtk_image_menu_item_set_image
(
GTK_IMAGE_MENU_ITEM
(
menu_items
),
image
);
gtk_menu_shell_append
(
GTK_MENU_SHELL
(
menu
),
menu_items
);
g_signal_connect
(
G_OBJECT
(
menu_items
),
"activate"
,
G_CALLBACK
(
call_im
),
NULL
);
gtk_widget_show
(
menu_items
);
}
}
else
{
...
...
sflphone-client-gnome/src/widget/Makefile.am
View file @
c9a5d094
...
...
@@ -4,7 +4,8 @@ noinst_LTLIBRARIES = libwidget.la
libwidget_la_SOURCES
=
\
gtkscrollbook.c
\
minidialog.c
minidialog.c
\
imwidget.c
libwidget_la_LDFLAGS
=
@DEPS_LDFLAGS@
...
...
sflphone-client-gnome/src/widget/imwidget.c
0 → 100644
View file @
c9a5d094
/*
* Copyright (C) 2010 Savoir-Faire Linux Inc.
*
* 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#include "imwidget.h"
#include <JavaScriptCore/JavaScript.h>
#define WEBKIT_DIR "file://" DATA_DIR "/webkit/"
void
im_widget_add_message
(
GtkWidget
*
widget
,
const
gchar
*
message
)
{
IMWidget
*
im
=
IM_WIDGET
(
widget
);
gchar
*
script
=
g_strdup_printf
(
"add_message('%s');"
,
message
);
webkit_web_view_execute_script
(
WEBKIT_WEB_VIEW
(
im
->
web_view
),
script
);
g_free
(
script
);
}
static
gboolean
web_view_nav_requested_cb
(
WebKitWebView
*
web_view
,
WebKitWebFrame
*
frame
,
WebKitNetworkRequest
*
request
,
WebKitWebNavigationAction
*
navigation_action
,
WebKitWebPolicyDecision
*
policy_decision
,
gpointer
user_data
)
{
const
gchar
*
uri
=
webkit_network_request_get_uri
(
request
);
/* Always allow files we are serving ourselves. */
if
(
!
strncmp
(
uri
,
WEBKIT_DIR
,
sizeof
(
WEBKIT_DIR
)
-
1
))
{
webkit_web_policy_decision_use
(
policy_decision
);
}
else
{
printf
(
"FIXME(jonas) open URL in browser: %s
\n
"
,
uri
);
webkit_web_policy_decision_ignore
(
policy_decision
);
}
return
TRUE
;
}
static
void
im_widget_class_init
(
IMWidgetClass
*
klass
)
{
}
static
void
im_widget_init
(
IMWidget
*
im
)
{
im
->
textarea
=
gtk_text_view_new
();
gtk_text_view_set_editable
(
GTK_TEXT_VIEW
(
im
->
textarea
),
TRUE
);
GtkWidget
*
textscrollwin
=
gtk_scrolled_window_new
(
NULL
,
NULL
);
gtk_scrolled_window_set_policy
(
GTK_SCROLLED_WINDOW
(
textscrollwin
),
GTK_POLICY_NEVER
,
GTK_POLICY_AUTOMATIC
);
gtk_container_add
(
GTK_CONTAINER
(
textscrollwin
),
im
->
textarea
);
im
->
web_view
=
webkit_web_view_new
();
GtkWidget
*
webscrollwin
=
gtk_scrolled_window_new
(
NULL
,
NULL
);
gtk_scrolled_window_set_policy
(
GTK_SCROLLED_WINDOW
(
webscrollwin
),
GTK_POLICY_AUTOMATIC
,
GTK_POLICY_AUTOMATIC
);
gtk_container_add
(
GTK_CONTAINER
(
webscrollwin
),
im
->
web_view
);
g_signal_connect
(
im
->
web_view
,
"navigation-policy-decision-requested"
,
G_CALLBACK
(
web_view_nav_requested_cb
),
NULL
);
gtk_box_pack_start
(
GTK_BOX
(
im
),
webscrollwin
,
TRUE
,
TRUE
,
5
);
gtk_box_pack_end
(
GTK_BOX
(
im
),
textscrollwin
,
TRUE
,
TRUE
,
5
);
im
->
web_frame
=
webkit_web_view_get_main_frame
(
WEBKIT_WEB_VIEW
(
im
->
web_view
));
im
->
js_context
=
webkit_web_frame_get_global_context
(
im
->
web_frame
);
im
->
js_global
=
JSContextGetGlobalObject
(
im
->
js_context
);
webkit_web_view_open
(
WEBKIT_WEB_VIEW
(
im
->
web_view
),
"file://"
DATA_DIR
"/webkit/im/im.html"
);
}
GtkWidget
*
im_widget_new
()
{
return
GTK_WIDGET
(
g_object_new
(
IM_WIDGET_TYPE
,
NULL
));
}
GType
im_widget_get_type
(
void
)
{
static
GType
im_widget_type
=
0
;
if
(
!
im_widget_type
)
{
static
const
GTypeInfo
im_widget_info
=
{
sizeof
(
IMWidgetClass
),
NULL
,
/* base_init */
NULL
,
/* base_finalize */
(
GClassInitFunc
)
im_widget_class_init
,