
#ifndef __DEFS_H__
#define __DEFS_H__

#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

//#include <glibconfig.h>

#ifdef G_OS_WIN32
#  include <glib/gwin32.h>
#endif

#if HAVE_PATHS_H
#  include <paths.h>
#endif

#if HAVE_SYS_PARAM_H
#  include <sys/param.h>
#endif
G_BEGIN_DECLS

#define COMMON_RC		"arabexrc"
#define COMMAND_HISTORY		"command_history"
#if defined(G_OS_WIN32) || defined(__APPLE__)
#  define RC_DIR		".arabtex-0.0.1a"
#else
#  define RC_DIR		".arabtex-0.0.1a"
#endif
#define MAX_HISTORY_SIZE		16
//#define VERSION		        "0.0.1a"
/*  autre version ...............*/
#define GUITEX_NAME	   "arabTeX"
#define GUITEX_VERS	   "0.0.1a"
#define VERSION	        GUITEX_NAME " - Version " GUITEX_VERS
#define RED                      "'\e[0;31m'"
/**---------------------------------------  MATH  LaTeX -------------------------------------------------------**/
/**............................... LaTeX CMD...................................*/
#define FILE_TO_COMPILE         "assistant.tex"
#define DVI_VIEW      		    "assistant.dvi"
#define PS_VIEW      		    "assistant.ps"
#define PDF_VIEW      		    "assistant.pdf"
#define PNG_VIEW                "assistant1.png"
/*//..................................... BEGIN WINDOWZ......................
#define MPOST_CMD	            "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/mpost --interaction nonstopmode %s"
#define LATEX_CMD               "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/latex.exe  -synctex=1 -interaction=nonstopmode "
//#define LATEX_CMD             "latex -interaction=nonstopmode test.tex|bibtex test.aux|latex -interaction=nonstopmode test.tex ; xdvi test.dvi"
#define XELATEX_CMD             "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/xelatex.exe  assistant.tex  " //\"LATEX\"
#define DVI2PS_CMD	            "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/dvips -Pdownload35    -o assistant.ps  assistant.dvi "
//#define DVI2PS_CMD	        "dvips -o assistant.ps assistant.dvi
#define PS2PDF_CMD	            "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/ps2pdf assistant.ps "
#define DVI2PDF_CMD	            "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/dvipdfm assistant.dvi"
//#define DVI2PDF_CMD	            "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/dvipdfmx -D assistant assistant.dvi"
#define DVI2PNG_CMD	            "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/dvipng  -T tight -D 120  "
#define PDF_LATEX_CMD	        "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/pdflatex -synctex=1 -interaction=nonstopmode "
//............................... VIEW CMD...................................
#define DVI_VIEW_CMD	        "C:/Users/selimb/Desktop/TeX/myMiKTEX/miktex/bin/yap.exe "
#define PS_VIEW_CMD	            "C:/Users/selimb/Desktop/TeX/gs9.10/bin/gswin32c.exe"
#define GHOST_CMD	            "C:/Users/selimb/Desktop/TeX/Ghostgum/gsview/gsview32.exe"
//#define PS_VIEW_CMD	        "gv %s ghostscript  %s"
#define PDF_VIEW_CMD	        "C:/Program Files/Nitro/Reader 3/NitroPDFReader.exe "
#define PNG_VIEW_CMD	        "sh -x $(which xdg-open)  "
//#define CUSTOM_CMD        	"mkdir  settings" //guiTeX/guiTeX.log   guiTeX/custom.log   guiTeX/meRead.txt   //"`tempfile 2>/dev/null` || tempfile=$HOME/.config/guiTeX/custom.log$$"
#define CUSTOM_CMD       	   "mkdir  settings && touch settings/custom.log"  //"`tempfile 2>/dev/null` || tempfile=$HOME/.config/guiTeX/custom.log$$"
#define CUSTOM2_CMD            "DEL  $TMP"
//#define CHMOD_CMD              "chmod 0744  ./settings"
#define CLEAN_CMD       	   "DEL  "  //   "DEL  %s"
#define COPY	               "meRead.txt     settings/meRead.txt"
#define COPY_CMD	           "COPY  "
#define CHMOD_CMD              "chmod 0744  ./settings"
#define DEFAULT_BROWSER_CMD	   "C:/Users/selimb/Desktop/FOX/firefox.exe   "
#define LAUNCH_CMD         	   "C:/Users/selimb/Desktop/FOX/firefox.exe   "

*///.....................................END   WINDOWZ......................
//..................................... BEGIN NUX......................


#define MPOST_CMD	            "mpost --interaction nonstopmode "
#define LATEX_CMD               "latex -synctex=1 -interaction=nonstopmode   "
#define SELIM_CMD               "latex -synctex=1 -interaction=nonstopmode   "
//#define LATEX_CMD             "latex -interaction=nonstopmode test.tex|bibtex test.aux|latex -interaction=nonstopmode test.tex ; xdvi test.dvi"

#define XELATEX_CMD             "xelatex -synctex=1 -interaction=nonstopmode %s  " //\"LATEX\"
#define DVI2PS_CMD	            "dvips -o assistant.ps  assistant.dvi "
//#define DVI2PS_CMD	        "dvips -Pdownload35    -o assistant.ps  assistant.dvi "
//#define DVI2PS_CMD	        "dvips -Ppdf -t   a4  assistant.dvi"
//#define DVI2PS_CMD	        "dvips -o assistant.ps assistant.dvi "
#define PS2PDF_CMD	            "ps2pdf assistant.ps "
#define DVI2PDF_CMD	            "dvipdfm assistant.dvi"
//#define DVI2PDF_CMD	        "dvipdfmx -D assistant assistant.dvi"
#define DVI2PNG_CMD	            "dvipng  -T tight -D 120  "
//#define PDF_LATEX_CMD	        "pdflatex -synctex=1 -interaction=nonstopmode "
#define PDF_LATEX_CMD	        "pdflatex   -shell-escape -src  -synctex=1 -interaction=nonstopmode "
//............................... VIEW CMD...................................
#define DVI_VIEW_CMD	        "sh -x $(which xdg-open)  "
#define PS_VIEW_CMD	            "sh -x $(which xdg-open)  "
//#define PS_VIEW_CMD	        "gv %s ghostscript  %s"
#define PDF_VIEW_CMD	        "sh -x $(which xdg-open)  "
#define PNG_VIEW_CMD	        "sh -x $(which xdg-open)  "

//....................................
#define CUSTOM_CMD       	    "mkdir -p settings && touch settings/custom.log"  //"`tempfile 2>/dev/null` || tempfile=$HOME/.config/guiTeX/custom.log$$"
#define CUSTOM2_CMD             "rm -fr  $TMP"
#define CHMOD_CMD               "chmod 0744  ./settings"
//#define CLEAN_CMD             system("rm -rf %s ")
#define CLEAN_CMD               "rm -rf  "              //"rm -rf   %s"                  // "DEL  %s
#define COPY	                "meRead.txt     settings/meRead.txt"
#define COPY_CMD	            "cp  "


// #define LAUNCH_CMD      	    "xdg-open  '%s'"
//#define DEFAULT_BROWSER_CMD	"xdg-open  '%s'"
//#define DEFAULT_BROWSER_CMD	"exo-open --launch WebBrowser
#ifdef __APPLE__
#  define DEFAULT_BROWSER_CMD	"open '%s'"
#else
#  define DEFAULT_BROWSER_CMD	"sh -x $(which xdg-open)  '%s'"
#endif

#define LAUNCH_CMD         	    "exo-open --launch WebBrowser     "
#define HTML_CMD       	        "htlatex  %s"  //"/usr/bin/htlatex"

/*..................................... END  NUX......................*/
/**---------------------------------------  END MATH LaTeX ---------------------------------------**/

/*...........................  CUSTOM DEFS voir configure.c    ................................................*/
/*    char *home  = getenv("HOME");
    char *lang  = getenv("LANG");
    char *shell = getenv("SHELL");
*/

 /* docs.dir_name = g_strdup (g_get_home_dir ());*/
/*  docs.dir_name = g_strdup (g_get_current_dir ());*/

#define LOG		             "assistant.log"
//#define LOG2_CMD       	 "`touch settings/.guiTeX.log`"  //mkdir -p $HOME/.config/guiTeX &&  <----- debut de main.c
//#define LOG3_CMD       	 "TMP=`mktemp settings/.guiTeX.log.XXXXXXX` || exit 1;"
#define LOG2		         "settings/guiTeX.log"
#define CUSTOM	              "settings/custom.log"
/*
#define CUSTOM_CMD       	"mkdir -p \"homedir\"/.config/guiTeX && touch \"homedir\"/.config/guiTeX/custom.log"
#define CUSTOM	                "\"homedir\"/guiTeX/.config/custom.log"
*/
//#define CUSTOM_DEL_CMD        "rm -rf /home/selimb/.config/guiTeX/.custom.log" ......... remplace par CLEAN_CMD
//#define CUSTOM_CMD           	"mkdir  settings" //guiTeX/guiTeX.log   guiTeX/custom.log   guiTeX/meRead.txt   //"`tempfile 2>/dev/null` || tempfile=$HOME/.config/guiTeX/custom.log$$"

/*.................................... FIN CUSTOM DEFS .......................................*/
#define CLEAN                "*.log  *.aux  *.out  *.dvi    assistant.png   *.toc  *.err   *.fls  *.fdb*  *synctex.gz  *.fdb_latexmk  *.blg   *.bbl  *.lg *.odt  *.css  *.idv   *.4tc    *.4ct  *.tmp  *.xref"
#define CLEAN2               "settings"
#define SHOW_LOG3_CMD        "while read line; do echo -e $line ; done < assistant.log "
/**--------------------------------------- ALL ---------------------------------------**/
#define CAT_CMD                 "cat `\"(gtk_entry_get_text(GTK_ENTRY (entry1)))\" `> " CUSTOM
//#define ENTRY1_CMD	        gtk_entry_get_text(entry1) ................failed
#define ENTRY1_CMD	            "echo  ` \"(gtk_entry_get_text(GTK_ENTRY (entry1)))\" `  > " CUSTOM
/*"%d.pdf"
* fopen (docs.actif->chemin, "w");
* fprintf (fichier, "%s", locale);*/

/* g_strdup_printf ("%s.pdf *", g_path_get_basename (docs.actif->chemin))*/

#define LAUNCH      		"s.bouras.free.fr/guiTeX"
#define FORUM      	        "s.bouras.free.fr/forum/"
#define HOMEPAGE_URI		"s.bouras.free.fr/guiTeX/"

#define DIRNAME                	"."
#define HTML		        g_strdup_printf ("%s ", g_path_get_basename (docs.actif->chemin))
#define DEFAULT_FILE            "assistant.tex"
#define FILEBRIEF		 g_strdup_printf ("%s ", g_path_get_basename (docs.actif->chemin))

//#define THUNAR     		"."   // <-----  inutile voir "#define THUNAR_CMD"   ligne 150.1" ici "defs.h"
/*#define TERMINAL      	"$HOME/my_radios"      */
//#define TERMINAL      	g_strdup_printf ("%s ", g_path_get_basename (docs.actif->chemin))
//#define TERMINAL              "echo -n  `cat    assistant.log` "

/**-------------------------------------END   ALL ---------------------------------------**/
/* g_strdup_printf ("%s ", g_path_get_basename (docs.actif->chemin))*/
/*#ifdef G_OS_WIN32
#  define REMOTE_CMD_PORT	50215
#endif */
/*------------------------------------ *_CMD ------------------*/
#define THUNAR_CMD	            "sh -x $(which xdg-open)  '.'"
//#define TERMINAL_CMD	        "./textviewer.sh  'assistant.log' "   /*<---------------   super !! */
#define TERMINAL_CMD	        "exo-open --launch TerminalEmulator  ./textviewer.sh  'assistant.log'"
//#define TERMINAL_CMD	        "sh -x $(which xdg-open)  ./textviewer.sh   assistant.log "
//#define TERMINAL_CMD	        "exo-open --launch TerminalEmulator "
/*#define TERMINAL_CMD	        "/home/xfce/com radio"*/

#define DIRNAME_CMD             "pwd . %s" /*	"dirname stdio.h  %s  " */
#define DIRNAME2_CMD            "echo  `pwd %s`  > selim"
#define DIR2                    "selim"
/*#define FILEBRIEF_CMD       	"file --brief %s  -> file.log"*/
#define FILEBRIEF_CMD       	"file --brief %s"
/*#define FILEBRIEF_CMD       	"echo \"`./textviewer.sh %s`\" > file.log" */


/*-----------------------------  END   *_CMD ------------------*/

#define BUFFSIZE		8192
#define PREFSBUFSIZE		1024
#define DEFAULT_MESSAGE_FONT	"Monospace 10"



#define MAX_ENTRY_LENGTH		8191

 G_END_DECLS

#endif /* __DEFS_H__ */
