/*****************************************************************************/ /* commons.h : Variables et fonctions communes * commons.h : Commons variables and commons functions * * * ToutDoux : Chtit gestionnaire de projet - A littl' project manage * Copyright (c) 2000-2001 Philippe Roy * Auteur - Author : Philippe Roy <ph_roy@toutdoux.org> * * * Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier * sous les termes de la licence publique générale GNU telle qu'elle est publiée par * la Free Software Foundation ; soit la version 2 de la licence, ou * (comme vous voulez) toute version ultérieure. * * Ce programme est distribué dans l'espoir qu'il sera utile, * mais SANS AUCUNE GARANTIE ; même sans la garantie de * COMMERCIALITÉ ou d'ADÉQUATION A UN BUT PARTICULIER. Voir la * licence publique générale GNU pour plus de détails. * * Vous devriez avoir reçu une copie de la licence publique générale GNU * avec ce programme ; si ce n'est pas le cas, écrivez à la Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * * 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. */ /*****************************************************************************/ #ifdef HAVE_CONFIG_H # include <config.h> #endif /*****************************************************************************/ /*** Macros */ /*****************************************************************************/ #define XmlDoc xmlDocPtr #define XmlNs xmlNsPtr #define XmlNode xmlNodePtr #define XmlChar xmlChar /*****************************************************************************/ /*** Configuration du tirer-lâcher - Drag'n'drop configuration */ /*****************************************************************************/ static GtkTargetEntry TD_DRAG_TYPES [] = { { "plain/text", 0, 0 }, }; static GtkTargetEntry TD_DROP_TYPES [] = { { "plain/text", 0, 0 }, }; static gint TD_N_DRAG_TYPES = sizeof (TD_DRAG_TYPES) / sizeof (TD_DRAG_TYPES [0]); static gint TD_N_DROP_TYPES = sizeof (TD_DROP_TYPES) / sizeof (TD_DROP_TYPES [0]); /*****************************************************************************/ /*** Variables globales - Globals variables */ /*****************************************************************************/ /*** Application */ gchar *TD_PACKAGE_TMP_DIR; gchar *TD_PACKAGE_VAR_DIR; GtkObject *APP; GtkObject *CUSTOM_CURRENT; gchar *CUSTOM_FILE_CURRENT; void *PLUGINS_CORE[50]; void *PLUGINS_DATA[50]; void *PLUGINS_CORE_BOOKMARKS; void *PLUGINS_CORE_DATABASE; /*** Temporisation - Temporization */ int FLAG_DRAG_AUTOEXPAND_ID; int FLAG_DRAG_AUTOEXPAND_TIME; int FLAG_DRAG_ROW_OLD; int FLAG_DRAG_AUTOEXPAND_ROW; int DRAG_ROW; int FLAG_ENTRY_CHANGED_ID; int FLAG_ENTRY_CHANGED_TIME; GtkWidget *FLAG_ENTRY_CHANGED_WIDGET_OLD; GtkObject *FLAG_ENTRY_CHANGED_MOD_OLD; /*** Node courante de la base de données - Current node of database */ int CURRENT_ID; int CURRENT_ID_PARENT; GList *CURRENT_ROW; GList *CURRENT_FIELD; /*** Drapeux internes - Internal flag */ gboolean FLAG_ANTI_AUTOEXPAND; gboolean FLAG_NO_REFRESH_NODE; gboolean FLAG_NO_REFRESH_PALLETTE_MESSAGE; /*** Messages de démarage - Starting message */ GList *START_MSG; /*** Widget */ GtkWidget *WINDOW_FILE_SELECTION; GtkWidget *WINDOW_DATE_SELECTION; /*****************************************************************************/ /*** Initialisation */ /*****************************************************************************/ void td_init (void); /*****************************************************************************/ /*** Ok */ /*****************************************************************************/ void td_set_ok (GtkWidget *widget, gboolean *dialog_result); /*****************************************************************************/ /*** Fonctions - Functions */ /*****************************************************************************/ gint td_func_comp (gconstpointer a, gconstpointer b); /*****************************************************************************/ /*** Message */ /*****************************************************************************/ void td_message_create_window (gchar *message); int td_question_create_window (gchar *question, gchar *title); gchar *td_fileselector_create_window (gchar *title, gchar *file, gchar *extension, gboolean show); /*****************************************************************************/ /*** Extension */ /*****************************************************************************/ gboolean td_system (gchar *command); gboolean td_shell (gchar *command); gpointer *td_dlsym (void *module, gchar *dir, gchar *file, gchar *symbol); GList *td_dataplugins_filelist (void); GtkObject *td_dataplugins_list (void); /*****************************************************************************/ /*** Fichier - File */ /*****************************************************************************/ gboolean td_file_exist (gchar *file); /*****************************************************************************/ /*** Date */ /*****************************************************************************/ GDate *td_date_current (void); GDate *td_date_parse (gchar *date, gchar *format); gchar *td_date_print (GDate *date, gchar *format); gchar *td_date_month_name (int month, gboolean abbrev); gchar *td_date_month (int month, int year, gchar *format); gchar *td_date_week (int week, int year, gchar *format); gchar *td_date_day_name (GDate *date, gboolean abbrev); gchar *td_date_day (int day, int month, int year, gchar *format); int td_date_period_day (GDate *lower, GDate *upper); GDate *td_date_add_days (GDate *date, int days); GDate *td_date_add_months (GDate *date, int months); GDate *td_date_add_years (GDate *date, int years); /*****************************************************************************/ /*** Flottant - Float */ /*****************************************************************************/ int td_float_round (float number);