Select Git revision
-
Emmanuel Milou authoredEmmanuel Milou authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
main.c 4.50 KiB
/*
* 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 <actions.h>
#include <calllist.h>
#include <config.h>
#include <dbus.h>
#include <mainwindow.h>
#include <statusicon.h>
#include <gtk/gtk.h>
#include <stdlib.h>
int
main (int argc, char *argv[])
{
gtk_init (&argc, &argv);
g_print("%s\n", PACKAGE_STRING);
g_print("Copyright (c) 2005 2006 2007 2008 Savoir-faire Linux Inc.\n");
g_print("This is free software. You may redistribute copies of it under the terms of\n\
the GNU General Public License Version 3 <http://www.gnu.org/licenses/gpl.html>.\n\
There is NO WARRANTY, to the extent permitted by law.\n\n");
srand ( time(NULL) );
// Internationalization
bindtextdomain( "sflphone" , "/usr/share/locale" );
textdomain( "sflphone" );
if(sflphone_init())
{
#if GTK_CHECK_VERSION(2,10,0)
show_status_icon();
#endif
create_main_window ();
#if GTK_CHECK_VERSION(2,10,0)
if( dbus_is_start_hidden() )
{
gtk_widget_hide(GTK_WIDGET( get_main_window() ));
set_minimized( TRUE );
}
#endif
/* start the main loop */
gtk_main ();
}
return 0;
}
/** @mainpage SFLphone GTK+ Client Documentation
* SFLphone GTK+ Client was started as a debuging tool for the new dbus API but
* ended being a full featured client.
* @section intro_sec Architecture
* SFLphone respects the MVC principle. Since the internal workings and the UI
* are too different programs, dbus is used to exchange data between them. Dbus
* is thereby inforcing MVC by only allowing access to high level functions and data.
*
* Therefore, when a button is clicked, a direct dbus API call should happen
* (defined in dbus.h). The UI should only be updated when signals are received
* from dbus. The call back to those signals are defined in dbus.c, but they call
* functions in actions.h. This makes things cleaner as one signal could have many
* actions.
*
* Accounts are stored in form of a account_t in an account list with access functions
* defined in accountlist.h.
*
* Calls are stored in form of a call_t in a call list with access functions defined
* in calllist.h.
*
*/
// This doc is for generated files that get overridden by tools.
/** @file marshaller.h
* @brief This file contains marshallers functions for dbus signals.
* This file is generated by glib-genmarshall.
* Every dbus signal has to have a marshaller. To generate a new marshaller function,
* add its signature to the marshaller.list. Then run :
* <pre>glib-genmarshal --body --g-fatal-warnings marshaller.list > marshaller.c
* glib-genmarshal --header --g-fatal-warnings marshaller.list > marshaller.h</pre>
* to get the generated marshallers.
* Just before connecting to the dbus signal, register the marshaller with:
* dbus_g_object_register_marshaller().
*/
/** @file callmanager-glue.h, configurationmanager-glue.h, contactmanager-glue.h
* @brief CallManager, ConfigurationManager and ContactManager dbus APIs.
* These files are generated by dbus-binding-tool using the server's files named *-introspec.xml:
* <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/callmanager-introspec.xml" > callmanager-glue.h</pre>
* <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/configurationmanager-introspec.xml" > configurationmanager-glue.h</pre>
* <pre>dbus-binding-tool --mode=glib-client "../../src/dbus/contactmanager-introspec.xml" > contactmanager-glue.h</pre>
* These files dbus call wrapper functions to simplify access to dbus API.
*/