Commit 9bb33db2 authored by Julien Bonjean's avatar Julien Bonjean

First development release

parent 1a11cb27
......@@ -7,6 +7,7 @@
*.Plo
*.loT
*.m4
*.Tpo
Makefile.in
*.spec
/config.*
......@@ -82,6 +83,7 @@ libs/utilspp/functor/Makefile
libs/utilspp/singleton/Makefile
sflphone-gtk/Makefile
sflphone-gtk/src/Makefile
sflphone-gtk/src/contactlist/Makefile
sflphone-gtk/pixmaps/Makefile
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sflphone-gtk</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
</natures>
</projectDescription>
This diff is collapsed.
#Thu Feb 26 16:02:29 EST 2009
eclipse.preferences.version=1
formatter_profile=_SFLPhone
formatter_settings_version=1
#Thu Feb 26 15:43:10 EST 2009
eclipse.preferences.version=1
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
......@@ -42,6 +42,7 @@ AC_SUBST(DEPS_LIBS)
AC_OUTPUT([
Makefile
src/Makefile
src/contactlist/Makefile
pixmaps/Makefile
sflphone.desktop
])
......
bin_PROGRAMS = sflphone-gtk
SUBDIRS=contactlist
# noinst_LTLIBRARIES = libsflphonegtk.la
NOFIFY_LIBS=-lnotify
SEXY_LIBS=-lsexy
......@@ -35,13 +39,16 @@ sflphone_gtk_SOURCES = \
codeclist.c \
timestamp.c \
reqaccount.c
noinst_HEADERS = actions.h dbus.h sflnotify.h mainwindow.h calllist.h dialpad.h audioconf.h codeclist.h assistant.h \
callmanager-glue.h errors.h sflphone_const.h configurationmanager-glue.h instance-glue.h menus.h calltab.h calltree.h configwindow.h \
accountlist.h accountwindow.h marshaller.h sliders.h $(STATUSICON_HEADER) timestamp.h historyfilter.c reqaccount.h
EXTRA_DIST = marshaller.list
sflphone_gtk_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SEXY_LIBS)
sflphone_gtk_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SEXY_LIBS) \
./contactlist/libcontact.la
AM_CPPFLAGS = $(DEPS_CFLAGS) \
-DICONS_DIR=\""$(prefix)/share/sflphone"\" \
......
This diff is collapsed.
/*
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@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.
*/
#include <calllist.h>
#include <calltree.h>
#include <dbus.h>
......@@ -29,7 +29,7 @@
*/
/* GCompareFunc to compare a callID (gchar* and a call_t) */
gint
gint
is_callID_callstruct ( gconstpointer a, gconstpointer b)
{
call_t * c = (call_t*)a;
......@@ -44,7 +44,7 @@ is_callID_callstruct ( gconstpointer a, gconstpointer b)
}
/* GCompareFunc to get current call (gchar* and a call_t) */
gint
gint
get_state_callstruct ( gconstpointer a, gconstpointer b)
{
call_t * c = (call_t*)a;
......@@ -58,30 +58,30 @@ get_state_callstruct ( gconstpointer a, gconstpointer b)
}
}
void
void
call_list_init (calltab_t* tab)
{
tab->callQueue = g_queue_new ();
tab->selectedCall = NULL;
}
void
void
call_list_clean (calltab_t* tab)
{
g_queue_free (tab->callQueue);
}
void
void
call_list_reset (calltab_t* tab)
{
g_queue_free (tab->callQueue);
tab->callQueue = g_queue_new();
}
void
void
call_list_add (calltab_t* tab, call_t * c)
{
if( tab == history )
if( tab == history )
{
// First case: can still add calls to the list
if( call_list_get_size(tab) < dbus_get_max_calls() )
......@@ -92,7 +92,7 @@ call_list_add (calltab_t* tab, call_t * c)
// List full -> Remove the last call from history and preprend the new call to the list
else
{
update_call_tree_remove( history , (call_t*)g_queue_pop_head( tab -> callQueue ) );
update_call_tree_remove( history , (call_t*)g_queue_pop_head( tab -> callQueue ) );
g_queue_push_tail (tab->callQueue, (gpointer *) c);
update_call_tree_add( history , c );
}
......@@ -126,7 +126,7 @@ call_list_remove_from_history( call_t* c )
g_print("Size of history = %i\n" , call_list_get_size( history ));
}
void
void
call_list_remove (calltab_t* tab, const gchar * callID)
{
call_t * c = call_list_get(tab, callID);
......@@ -137,7 +137,7 @@ call_list_remove (calltab_t* tab, const gchar * callID)
}
call_t *
call_t *
call_list_get_by_state (calltab_t* tab, call_state_t state )
{
GList * c = g_queue_find_custom (tab->callQueue, &state, get_state_callstruct);
......@@ -145,11 +145,11 @@ call_list_get_by_state (calltab_t* tab, call_state_t state )
{
return (call_t *)c->data;
}
else
else
{
return NULL;
}
}
guint
......@@ -158,13 +158,13 @@ call_list_get_size (calltab_t* tab)
return g_queue_get_length (tab->callQueue);
}
call_t *
call_t *
call_list_get_nth (calltab_t* tab, guint n )
{
return g_queue_peek_nth (tab->callQueue, n);
}
gchar *
gchar *
call_get_name (const call_t * c)
{
gchar * end = g_strrstr(c->from, "\"");
......@@ -176,7 +176,7 @@ call_get_name (const call_t * c)
}
}
gchar *
gchar *
call_get_number (const call_t * c)
{
gchar * number = g_strrstr(c->from, "<") + 1;
......@@ -192,7 +192,7 @@ call_get_recipient( const call_t * c )
}
call_t *
call_t *
call_list_get (calltab_t* tab, const gchar * callID )
{
GList * c = g_queue_find_custom (tab->callQueue, callID, is_callID_callstruct);
......@@ -200,7 +200,7 @@ call_list_get (calltab_t* tab, const gchar * callID )
{
return (call_t *)c->data;
}
else
else
{
return NULL;
}
......
/*
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@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.
*/
#ifndef __CALLLIST_H__
#define __CALLLIST_H__
......@@ -25,31 +25,31 @@
/** @file calllist.h
* @brief A list to hold calls.
*/
/** @enum call_state_t
/** @enum call_state_t
* This enum have all the states a call can take.
*/
typedef enum
{ /** Invalid state */
CALL_STATE_INVALID = 0,
CALL_STATE_INVALID = 0,
/** Ringing incoming call */
CALL_STATE_INCOMING,
CALL_STATE_INCOMING,
/** Ringing outgoing call */
CALL_STATE_RINGING,
CALL_STATE_RINGING,
/** Call to which the user can speak and hear */
CALL_STATE_CURRENT,
CALL_STATE_CURRENT,
/** Call which numbers are being added by the user */
CALL_STATE_DIALING,
CALL_STATE_DIALING,
/** Call is on hold */
CALL_STATE_HOLD,
CALL_STATE_HOLD,
/** Call has failed */
CALL_STATE_FAILURE,
CALL_STATE_FAILURE,
/** Call is busy */
CALL_STATE_BUSY,
CALL_STATE_BUSY,
/** Call is being transfert. During this state, the user can enter the new number. */
CALL_STATE_TRANSFERT,
/** Call is on hold */
CALL_STATE_RECORD
CALL_STATE_RECORD
} call_state_t;
/**
......@@ -64,16 +64,29 @@ typedef enum
MISSED
} history_state_t;
/**
* @enum call_type
* This enum have all types of call
*/
typedef enum
{
CALL,
HISTORY,
CONTACT
} call_type_t;
/** @struct call_t
* @brief Call information.
* This struct holds information about a call.
* This struct holds information about a call.
*/
typedef struct {
/** Type of call entry */
call_type_t call_type;
/** Unique identifier of the call */
gchar * callID;
/** The account used to place/receive the call */
gchar * accountID;
/** The information about the calling person. See call_get_name() and call_get_number()
/** The information about the calling person. See call_get_name() and call_get_number()
* on how to get the name and number separately. */
gchar * from;
/** The number we are calling. Only used when dialing out */
......@@ -100,6 +113,7 @@ typedef struct {
calltab_t* current_calls;
calltab_t* history;
calltab_t* contacts;
/** This function initialize a call list. */
void call_list_init (calltab_t* tab);
......@@ -111,22 +125,22 @@ void call_list_clean(calltab_t* tab);
void call_list_reset (calltab_t* tab);
/** Get the maximun number of calls in the history calltab */
gdouble call_history_get_max_calls( void );
gdouble call_history_get_max_calls( void );
/** Set the maximun number of calls in the history calltab */
void call_history_set_max_calls( const gdouble number );
void call_history_set_max_calls( const gdouble number );
/** This function append a call to list.
* @param c The call you want to add
/** This function append a call to list.
* @param c The call you want to add
* */
void call_list_add (calltab_t* tab, call_t * c);
/** This function remove a call from list.
/** This function remove a call from list.
* @param callID The callID of the call you want to remove
*/
void call_list_remove (calltab_t* tab, const gchar * callID);
/** Return the first call that corresponds to the state.
/** Return the first call that corresponds to the state.
* This is usefull for unique states as DIALING and CURRENT.
* @param state The state
* @return A call or NULL */
......@@ -151,10 +165,10 @@ call_t * call_list_get (calltab_t* tab, const gchar * callID );
* @return The full name of the caller or an empty string */
gchar * call_get_name ( const call_t * c);
/**
/**
* This function parse the call_t.from field to return the number
* @param c The call
* @return The number of the caller
* @return The number of the caller
*/
gchar * call_get_number (const call_t * c);
......@@ -178,4 +192,4 @@ void call_list_clean_history();
*/
void call_list_remove_from_history( call_t* c);
#endif
#endif
/*
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Antoine Reversat <antoine.reversat@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.
......@@ -27,6 +27,7 @@ calltab_t*
calltab_init()
{
calltab_t* ret;
ret = malloc(sizeof(calltab_t));
ret->store = NULL;
......@@ -37,6 +38,6 @@ calltab_init()
create_call_tree(ret);
call_list_init(ret);
return ret;
}
/*
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Antoine Reversat <antoine.reversat@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.
*/
#ifndef __NOTEBOOK_H__
#define __NOTEBOOK_H__
......
This diff is collapsed.
/*
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@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.
*/
#ifndef __CALLTREE_H__
#define __CALLTREE_H__
......@@ -32,8 +32,14 @@
*/
GtkToolItem * historyButton;
GtkToolItem * contactButton;
GtkWidget * filter_entry;
calltab_t* active_calltree;
void free_call_t (call_t *c);
/**
* Create a new widget calltree
* @return GtkWidget* A new widget
......@@ -54,7 +60,7 @@ void update_call_tree_add (calltab_t* ct, call_t * c);
/*
* Update the call tree if the call state changes
* @param c The call to update
*/
*/
void update_call_tree (calltab_t* ct, call_t * c);
/**
* Remove a call from the call tree
......@@ -62,12 +68,16 @@ void update_call_tree (calltab_t* ct, call_t * c);
*/
void update_call_tree_remove (calltab_t* ct, call_t * c);
void reset_call_tree (calltab_t* tab);
/**
* Build the toolbar
* @return GtkWidget* The toolbar
*/
GtkWidget * create_toolbar();
void switch_tab( void );
void switch_tab( calltab_t* tab );
void refresh_tab( calltab_t* tab );
#endif
#endif
noinst_LTLIBRARIES = libcontact.la
libcontact_la_SOURCES = \
eds.c
libcontact_la_LDFLAGS= -pthread -lebook-1.2 -lgnome-2 -lpopt -ledataserver-1.2 -lxml2 -lgconf-2 -lsoup-2.4 -lbonobo-2 -lbonobo-activation -lORBit-2 -lgthread-2.0 -lrt -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lgio-2.0 -lcairo -lpango-1.0 -lfreetype -lz -lfontconfig -lgmodule-2.0 -lgobject-2.0 -lglib-2.0
libcontact_la_CFLAGS=-DORBIT2=1 -pthread -I/usr/include/evolution-data-server-2.24 -I/usr/include/libbonobo-2.0 -I/usr/include/libgnome-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/libxml2 -I/usr/include/libsoup-2.4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pygtk-2.0
* Adding dependencies for configure
* Define better interface (to easily distinct contacts, history and current calls)
* Make stuff more generic (to be able to add other contact list sources later)
* Rename historyfilter.c ... for something more generic
* Handle gtk_widget_hide et gtk_widget_show more cleanly
\ No newline at end of file
/*
* Copyright (C) 2009 Savoir-Faire Linux inc.
* Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com>
*
* File originally copied from evolution module of deskbar-applet 2.24.1
* Authors :
* Nigel Tao <nigel.tao@myrealbox.com>
* Raphaël Slinckx <raphael@slinckx.net>
* Mikkel Kamstrup Erlandsen <kamstrup@daimi.au.dk>
* Sebastian Pölsterl <marduk@k-d-w.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 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.
*/
#include <glib.h>
#include <glib/gstring.h>
#include <libebook/e-book.h>
#include <pango/pango.h>
#include "eds.h"
static GSList *books = NULL;
static EContactField search_fields[] = { E_CONTACT_FULL_NAME, E_CONTACT_PHONE_BUSINESS, E_CONTACT_NICKNAME, 0 };
static int n_search_fields = G_N_ELEMENTS (search_fields) - 1;
void
free_hit (Hit *h)
{
g_free (h->name);
g_free (h->phone);
g_free (h);
}
/**
* Split a string of tokens separated by whitespace into an array of tokens.
*/
static GArray *
split_query_string (const gchar *str)
{
GArray *parts = g_array_sized_new (FALSE, FALSE, sizeof (char *), 2);
PangoLogAttr *attrs;
guint str_len = strlen (str), word_start = 0, i;
attrs = g_new0 (PangoLogAttr, str_len + 1);
/* TODO: do we need to specify a particular language or is NULL ok? */
pango_get_log_attrs (str, -1, -1, NULL, attrs, str_len + 1);
for (i = 0; i < str_len + 1; i++) {
char *start_word, *end_word, *word;
if (attrs[i].is_word_end) {
start_word = g_utf8_offset_to_pointer (str, word_start);
end_word = g_utf8_offset_to_pointer (str, i);
word = g_strndup (start_word, end_word - start_word);
g_array_append_val (parts, word);
}
if (attrs[i].is_word_start) {
word_start = i;
}
}
g_free (attrs);
return parts;
}
/**
* Create a query which looks for the specified string in a contact's full name, email addresses and
* nick name.
*/
static EBookQuery*
create_query (const char* s)
{
EBookQuery *query;
GArray *parts = split_query_string (s);
EBookQuery ***field_queries;
EBookQuery **q;
guint j;
int i;
q = g_new0 (EBookQuery *, n_search_fields);
field_queries = g_new0 (EBookQuery **, n_search_fields);
for (i = 0; i < n_search_fields; i++) {
field_queries[i] = g_new0 (EBookQuery *, parts->len);
for (j = 0; j < parts->len; j++) {
field_queries[i][j] = e_book_query_field_test (search_fields[i], E_BOOK_QUERY_CONTAINS, g_array_index (parts, gchar *, j));
}
q[i] = e_book_query_and (parts->len, field_queries[i], TRUE);
}
g_array_free (parts, TRUE);
query = e_book_query_or (n_search_fields, q, TRUE);
for (i = 0; i < n_search_fields; i++) {
g_free (field_queries[i]);
}
g_free (field_queries);
g_free (q);
return query;
}
/**
* Initialize address book
*/
void
init (void)
{
GSList *list, *l;
ESourceList *source_list;
source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources");
if (source_list == NULL) {
return;
}
list = e_source_list_peek_groups (source_list);
for (l = list; l != NULL; l = l->next) {
ESourceGroup *group = l->data;
GSList *sources = NULL, *m;
sources = e_source_group_peek_sources (group);
for (m = sources; m != NULL; m = m->next) {
ESource *source = m->data;
EBook *book = e_book_new (source, NULL);
if (book != NULL) {
books = g_slist_prepend (books, book);
e_book_open(book, TRUE, NULL);
}
}
}
g_object_unref (source_list);
}
/**
* Do a synchronized search in EDS address book
*/