#ifndef __TEX_PR_H #define __TEX_PR_H /*------------------------------------------------------------------------- * Copyright (c) 1999-2000 Kenneth W. Sodemann (stufflehead@bigfoot.com) *------------------------------------------------------------------------- * tex_pr * * Synopsis: * Routines to handle creating a tex file from problem reports. * * $Id: tex_pr.h,v 1.5 2002/11/22 20:53:07 stuffle Exp $ * * 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 * Free Software Foundation, Inc. * 59 Temple Place, Suite 330 * Boston, MA 02111-1307 USA * *------------------------------------------------------------------------- */ #include #include #include /*------------------------------------------------------------------------- * Function: create_tex_file * * Synopsis: * Given a list of problem report numbers, create the tex file that * will then be used to generate the full printout. * * Inputs: * conn : The database connection. * list : The list of problem report numbers that are to be typeset * and printed. This function will return NULL if the list * is empty. * msg_win : pointer to widget where messages should go (can be NULL) * * Outputs: * None. * * Return Value: * The full path of the created tex file (without the '.tex' extention) * if success, NULL otherwise. Remember to g_string_free it somewhere * if we return non-NULL. * *------------------------------------------------------------------------- */ GString *create_tex_file (PGconn *conn, GList *list, GtkWidget *msg_win); /*------------------------------------------------------------------------- * Function: tex_to_dvi * * Synopsis: * Process the given TeX file into a DVI file. * * Inputs: * infn : base file name (no .tex extention) * msg_win : text widget for messages (can be NULL) * * Outputs: * None. * * Return Value: * TRUE if successful, FALSE otherwise. * *------------------------------------------------------------------------- */ gboolean tex_to_dvi (const gchar *infn, GtkWidget *msg_win); /*------------------------------------------------------------------------- * Function: dump_tex_log * * Synopsis: * Take the log file created when running TeX on the given TeX file * and display its contents in a text widget. * * Inputs: * infn : base file name * text : target text widget * * Outputs: * None. * * Return Value: * None. * *------------------------------------------------------------------------- */ void dump_tex_log (const gchar *infn, GtkWidget *text); /*------------------------------------------------------------------------- * Function: cleanup_files * * Synopsis: * Clean up the tmp files. * * Inputs: * infn : base file name * * Outputs: * None. * * Return Value: * None. * *------------------------------------------------------------------------- */ void cleanup_files (const gchar *infn); /*------------------------------------------------------------------------- * Function: dvi_to_ps * * Synopsis: * Use dvips to save the dvi file as a ps file. * * Inputs: * infn : full path to the dvi file (no '.dvi' extention). * outfn : full path to the target file. * msg_win : pointer to widget where messages should go (can be NULL) * * Outputs: * None. * * Return Value: * TRUE is successful, FALSE otherwise. * *------------------------------------------------------------------------- */ gboolean dvi_to_ps (const gchar *infn, const gchar *outfn, GtkWidget *msg_win); /*------------------------------------------------------------------------- * Function: dvi_to_printer * * Synopsis: * Use dvips to convert from dvi to ps, and send to the printer. * * Inputs: * infn : full path to the dvi file (no '.dvi' extention). * prn : name of the printer. * msg_win : pointer to widget where messages should go (can be NULL) * * Outputs: * None. * * Return Value: * TRUE is successful, FALSE otherwise. * *------------------------------------------------------------------------- */ gboolean dvi_to_printer (const gchar *infn, const gchar *prn, GtkWidget *msg_win); /*------------------------------------------------------------------------- * Function: * * Synopsis: * * Inputs: * None. * * Outputs: * None. * * Return Value: * None. * *------------------------------------------------------------------------- */ #endif