* src/lyx_main.C (commandLineHelp): remove -display from command
line help.
+2000-07-09 Kayvan A. Sylvan <kayvan@sylvan.com>
+
+ * lib/Makefile.am: added lib/build-listerrors to DIST tarfile.
+ Also put in Makefile rules for building the ``listerrors''
+ program for parsing errors from literate programs written in LyX.
+
+ * lib/build-listerrors: Added small shell script as part of compile
+ process. This builds a working ``listerrors'' binary if noweb is
+ installed and either 1) the VNC X server is installed on the machine,
+ or 2) the user is compiling from within a GUI. The existence of a GUI
+ is necessary to use the ``lyx --export'' feature for now. This
+ hack can be removed once ``lyx --export'' no longer requires a GUI to
+ function.
+
+2000-07-09 Bernard Michael Hurley <bernardh@westherts.ac.uk>
+
+ * lib/examples/Literate.lyx, src/Literate.[Ch]: Error messages are
+ now passed back correctly from gcc and placed "under" error
+ buttons in a Literate LyX source.
+
2000-07-08 Dekel Tsur <dekel@math.tau.ac.il>
* src/text.C (GetColumnNearX): Better behavior when a RTL
pkgdata_SCRIPTS = configure configure.cmd
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
SUBDIRS = reLyX
+bin_SCRIPTS = listerrors
BIND = bind/*.bind
CLIPART = clipart/*.eps
LYXLIBDIRS = bind clipart doc examples images kbd layouts scripts templates tex
EXTRA_DIST = CREDITS chkconfig.ltx configure.cmd lyxrc.example \
- external_templates $(LYXLIBDIRS)
+ external_templates $(LYXLIBDIRS) build-listerrors
libinstalldirs:
for dir in $(LYXLIBDIRS) ; do \
{ cvs -Q export -r HEAD -d doc lyxdoc || \
echo "WARNING: Unable to get LyX Documentation from CVS!" ; true ; }
+listerrors: examples/Literate.lyx
+ ./build-listerrors
--- /dev/null
+#!/bin/sh
+#
+# Attempt to build listerrors (see examples/Literate.lyx) at build-time
+#
+# Author: Kayvan Sylvan <kayvan@sylvan.com>
+
+fakeprogram()
+{
+ L=listerrors
+ echo "#!/bin/sh" > $L
+ echo 'echo "This is NOT the listerrors program."' >> $L
+ echo 'echo ""' >> $L
+ echo 'echo "Here was the problem when we tried to build listerrors:"' >> $L
+ echo echo "$1" >> $L
+ chmod +x $L
+ exit 0
+}
+
+mywhich()
+{
+ arg=$1
+ for i in `echo $PATH | sed 's/:/ /g'`
+ do
+ if [ -x $i/$arg ]
+ then
+ echo $i/$arg
+ fi
+ done
+}
+
+if [ -r ../src/lyx ]
+then
+ lyx=../src/lyx
+else
+ lyx=`mywhich lyx`
+fi
+
+if [ -z "$lyx" ]
+then
+ echo "You must build lyx first to build listerrors."
+ exit 1
+fi
+
+notangle=`mywhich notangle`
+
+if [ -z "$notangle" ]
+then
+ fakeprogram "The NOWEB notangle was not found."
+fi
+
+vncserver=`mywhich vncserver`
+if [ -z "$vncserver" ]
+then
+ # See if DISPLAY is set
+ #
+ if [ -z "$DISPLAY" ]
+ then
+ fakeprogram "Could not export Literate.nw. Export needs GUI, fix lyx!"
+ else
+ $lyx --export tex examples/Literate.lyx
+ fi
+else
+ # Use the vncserver to make a silent export
+ if [ -r $HOME/.vnc/passwd ]
+ then
+ had_vnc_passwd=1
+ else
+ mkdir $HOME/.vnc > /dev/null 2>&1
+ had_vnc_passwd=0
+ touch $HOME/.vnc/passwd; chmod 700 $HOME/.vnc/passwd
+ fi
+ $vncserver :10 -depth 16
+ DISPLAY=:10
+ export DISPLAY
+ $lyx --export tex examples/Literate.lyx
+ $vncserver -kill :10
+ if [ $had_vnc_passwd -eq 0 ]
+ then
+ rm $HOME/.vnc/passwd
+ fi
+fi
+mv examples/Literate.tex Literate.nw
+$notangle -Rbuild-script Literate.nw | sh
-#This file was created by <wiensk> Tue Feb 23 22:25:52 1999
-#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
-\lyxformat 2.15
+#LyX 1.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 2.16
\textclass literate-article
\language default
\inputencoding default
Edmar Wienskoski Jr.
\newline
edmar-w-jr@technologist.com
+\begin_float footnote
+\layout Standard
+
+Modified by Bernard Michael Hurley bernardh@westherts.ac.uk ---- Don't blame
+ Edmar for any errors that have crept in!
+\end_float
\layout Date
\layout Standard
-\begin_inset LatexCommand \tableofcontents
+\begin_inset LatexCommand \tableofcontents{}
\end_inset
The filter is required to read from standard input, parse for error messages
and copy the error messages to the standard output.
- During the output process, the filter must present the error messages in a
- format that LyX can interpret, currently, the LaTeX error message format.
- Of course, nothing will prevent future LyX releases from being able to read
- other formats as well (like gcc error messages for example).
- This mechanism is necessary to fully explore the literate programming
- tool's capabilities.
+ During the output process, the filter must present the error messages in
+ a format that LyX can interpret, currently, the LaTeX error message format.
+ Of course, nothing will prevent future LyX releases from being able to
+ read other formats as well (like gcc error messages for example).
+ This mechanism is necessary to fully explore the literate programming tool's
+ capabilities.
\layout Section
Algorithm
\newline
{
\newline
-
-\protected_separator
- if (argc == 2) {
+ if (argc == 2) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- switch (argv[1][0]) {
+ switch (argv[1][0]) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- case 'n':
+ case 'n':
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- <<Scan input for noweb error messages>>
+ <<Scan input for noweb error messages>>
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- break;
+ break;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- case 'x':
+ case 'x':
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- <<Scan input for xlc error messages>>
+ <<Scan input for xlc error messages>>
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- break;
+ break;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- case 'a':
+ case 'a':
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-<<AIX system using both noweb and xlc>>
+ <<AIX system using both noweb and xlc>>
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- break;
+ break;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- case 's':
+ case 's':
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- case 'b':
+ case 'b':
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- <<Solaris and Linux systems using both noweb and gcc>>
+ <<Solaris and Linux systems using both noweb and gcc>>
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- break;
+ break;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- case 'g':
+ case 'g':
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- default:
+ default:
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- <<Scan input for gcc error messages>>
+ <<Scan input for gcc error messages>>
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- break;
+ break;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- }
+ }
\newline
-
-\protected_separator
- } else {
+ } else {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- <<Scan input for gcc error messages>>
+ <<Scan input for gcc error messages>>
\newline
-
-\protected_separator
- }
+ }
\newline
}
\newline
<<Global variables>>=
\newline
-char
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- buffer[200][200];
+char buffer[200][200];
\newline
-int
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- last_buf_line;
+int last_buf_line;
\newline
-int
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- last_err_line;
+int last_err_line;
\newline
-int
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- err_line;
+int err_line;
\newline
@
\layout Section
The output format
\layout Standard
-The output format mimics the LaTeX error messages format.
+The output format mimics the TeX error messages format.
This function prints a number of lines residing in the global variable
\family typewriter
\family default
, a program name and line number.
There is no special requirement on the input strings, they can be anything.
+\begin_float footnote
+\layout Standard
+
+This function has been slightly changed from EW's original to make scanning
+ a bit easier with LaTeX::scanLogFile().
+ The test has been added because LyX can crash if empty lines are allowed
+ here --- I can't figure out why! --- BMH
+\end_float
\layout Scrap
<<Function bodies>>=
\newline
{
\newline
-
-\protected_separator
- int
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- i;
+ int i;
\newline
-
-\protected_separator
-
+
\newline
-
-\protected_separator
- fprintf(stdout, "! Build Error: ==> %s ==>
+ fprintf(stdout, "! Build Error: ==> %s ==>
\backslash
n", tool);
\newline
-
-\protected_separator
- for (i=0; i<buf_size; i++)
-\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- fprintf(stdout, "%s", buffer[i]);
-\newline
-
-\protected_separator
- fprintf(stdout, " ...
+ fprintf(stdout, " ...
\backslash
n
\backslash
nl.%d ...
\backslash
-n
-\backslash
n", error_line);
\newline
+
+\newline
+ for (i=0; i<buf_size; i++)
+\newline
+ if (strlen(buffer[i]) != 0)
+\newline
+ fprintf(stdout, "%s", buffer[i]);
+\newline
+
+\newline
+ fprintf(stdout, "
+\backslash
+n");
+\newline
}
\newline
@
\newline
{
\newline
-
-\protected_separator
- last_buf_line = 0;
+ last_buf_line = 0;
\newline
-
-\protected_separator
- while (fgets(buffer[0], 200, stdin)) {
+ while (fgets(buffer[0], 200, stdin)) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (noweb_try(0))
+ if (noweb_try(0))
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- output_error(1, 0, "noweb");
+ output_error(1, 0, "noweb");
\newline
-
-\protected_separator
- }
+ }
\newline
}
\newline
\newline
char *noweb_msgs[] = {
\newline
-
-\protected_separator
- "couldn't open file",
+ "couldn't open file",
\newline
-
-\protected_separator
- "couldn't open temporary file",
+ "couldn't open temporary file",
\newline
-
-\protected_separator
- "error writing temporary file",
+ "error writing temporary file",
\newline
-
-\protected_separator
- "ill-formed option",
+ "ill-formed option",
\newline
-
-\protected_separator
- "unknown option",
+ "unknown option",
\newline
-
-\protected_separator
- "Bad format sequence",
+ "Bad format sequence",
\newline
-
-\protected_separator
- "Can't open output file",
+ "Can't open output file",
\newline
-
-\protected_separator
- "Can't open temporary file",
+ "Can't open temporary file",
\newline
-
-\protected_separator
- "Capacity exceeded:",
+ "Capacity exceeded:",
\newline
-
-\protected_separator
- "Ignoring unknown option -",
+ "Ignoring unknown option -",
\newline
-
-\protected_separator
- "This can't happen:",
+ "This can't happen:",
\newline
-
-\protected_separator
- "non-numeric line number in"
+ "non-numeric line number in"
\newline
};
\newline
\layout Standard
A noweb error message can be any string that contains a matching pair of
- < <
-\protected_separator
-
-\protected_separator
-
-\protected_separator
+ < <\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
> >, or any of the above strings.
\layout Scrap
\newline
{
\newline
-
-\protected_separator
- char
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- *s, *b;
+ char *s, *b;
\newline
-
-\protected_separator
- int
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- i;
+ int i;
\newline
-
-\protected_separator
-
+
\newline
-
-\protected_separator
- b = buffer[buf_line];
+ b = buffer[buf_line];
\newline
-
-\protected_separator
- s = strstr(b, "<<");
+ s = (char *)strstr(b, "<<");
\newline
-
-\protected_separator
- if (s != NULL) {
+ if (s != NULL) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- s = strstr(s+2, ">>");
+ s = (char *)strstr(s+2, ">>");
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (s != NULL)
+ if (s != NULL)
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- return 1;
+ return 1;
\newline
-
-\protected_separator
- } else {
+ } else {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- for (i=0; i<12; i++) {
+ for (i=0; i<12; i++) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- s = strstr (b, noweb_msgs[i]);
+ s = (char *)strstr (b, noweb_msgs[i]);
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (s != NULL)
+ if (s != NULL)
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-break;
+ break;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- }
+ }
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (s != NULL)
+ if (s != NULL)
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- return 1;
+ return 1;
\newline
-
-\protected_separator
- }
+ }
\newline
-
-\protected_separator
- return 0;
+ return 0;
\newline
}
\newline
line at a time.
\layout Scrap
-<<Scan input for xlc error messages>>=
-\protected_separator
-
+<<Scan input for xlc error messages>>=
\newline
{
\newline
-
-\protected_separator
- last_buf_line = 0;
+ last_buf_line = 0;
\newline
-
-\protected_separator
- while (fgets(buffer[last_buf_line], 200, stdin)) {
+ while (fgets(buffer[last_buf_line], 200, stdin)) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (xlc_try(0))
+ if (xlc_try(0))
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- output_error(1, err_line, "xlc");
+ output_error(1, err_line, "xlc");
\newline
-
-\protected_separator
- }
+ }
\newline
}
\newline
\newline
{
\newline
-
-\protected_separator
- char
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- *s, *t;
+ char *s, *t;
\newline
-
-\protected_separator
-
+
\newline
-
-\protected_separator
- t = buffer[buf_line];
+ t = buffer[buf_line];
\newline
-
-\protected_separator
- s = t+1;
+ s = t+1;
\newline
-
-\protected_separator
- while (*s != '"' && *s != ' ' && *s != '
+ while (*s != '"' && *s != ' ' && *s != '
\backslash
0')
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- s++;
+ s++;
\newline
-
-\protected_separator
- if (*t != '"' || *s != '"' || strncmp(s+1, ", line ", 7) != 0)
+ if (*t != '"' || *s != '"' || strncmp(s+1, ", line ", 7) != 0)
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- return 0;
+ return 0;
\newline
-
-\protected_separator
- s += 8;
+ s += 8;
\newline
-
-\protected_separator
- err_line = atoi(s);
+ err_line = atoi(s);
\newline
-
-\protected_separator
- return 1;
+ return 1;
\newline
}
\newline
\newline
{
\newline
-
-\protected_separator
- char
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- *s, *t;
+ char *s, *t;
\newline
-
-\protected_separator
-
+
\newline
-
-\protected_separator
- last_buf_line = 0;
+ last_buf_line = 0;
\newline
-
-\protected_separator
- while (fgets(buffer[last_buf_line], 200, stdin)) {
+ while (fgets(buffer[last_buf_line], 200, stdin)) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- /****** Skip lines until I find an error */
+ /****** Skip lines until I find an error */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- s = strpbrk(buffer[last_buf_line], " :");
+ s = (char *)strpbrk(buffer[last_buf_line], " :");
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (s == NULL || *s == ' ')
+ if (s == NULL || *s == ' ')
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- continue; /* No gcc error found here */
+ continue; /* No gcc error found here */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- do {
+ do {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-<<gcc error message criteria is to find a "...:999:" or a "...: ">>
+ <<gcc error message criteria is to find a "...:999:" or a "...: ">>
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- /****** OK It is an error message, get line number */
+ /****** OK It is an error message, get line number */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- err_line = atoi(s+1);
+ err_line = atoi(s+1);
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (last_err_line == 0 || last_err_line == err_line) {
+ if (last_err_line == 0 || last_err_line == err_line) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-last_err_line = err_line;
+ last_err_line = err_line;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-continue; /* It's either a header or a continuation, don't output yet */
+ continue; /* It's either a header or a continuation, don't output
+ yet */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- }
+ }
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- /****** Completed the scan of one error message, output it to LyX */
+ /****** Completed the scan of one error message, output it to LyX
+ */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- discharge_buffer(1);
+ discharge_buffer(1);
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- break;
+ break;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- } while (fgets(buffer[last_buf_line], 200, stdin));
+ } while (fgets(buffer[last_buf_line], 200, stdin));
\newline
-
-\protected_separator
- }
+ }
\newline
-
-\protected_separator
-
-\protected_separator
-/****** EOF completes the scan of whatever was being scanned */
+ /****** EOF completes the scan of whatever was being scanned */
\newline
-
-\protected_separator
- discharge_buffer(0);
+ discharge_buffer(0);
\newline
}
\newline
\newline
/****** Search first ":" in the error number */
\newline
-s = strpbrk(buffer[last_buf_line], " :");
+s = (char *)strpbrk(buffer[last_buf_line], " :");
\newline
last_buf_line++;
\newline
if (s == NULL || *s == ' ')
\newline
-
-\protected_separator
- <<No gcc error found here, but it might terminate the scanning of a previous
+ <<No gcc error found here, but it might terminate the scanning of a previous
one>>
\newline
/****** Search second ":" in the error number */
\newline
-t = strpbrk(s+1, " :");
+t = (char *)strpbrk(s+1, " :");
\newline
if (t == NULL || *t == ' ')
\newline
-
-\protected_separator
- <<No gcc error found here, but it might terminate the scanning of a previous
+ <<No gcc error found here, but it might terminate the scanning of a previous
one>>
\newline
/****** Verify if is all digits between ":" */
\newline
if (t != s+1+strspn(s+1, "0123456789"))
\newline
-
-\protected_separator
- <<No gcc error found here, but it might terminate the scanning of a previous
+ <<No gcc error found here, but it might terminate the scanning of a previous
one>>
\newline
@
\newline
{
\newline
-
-\protected_separator
-
-\protected_separator
-err_line = 0;
+ err_line = 0;
\newline
-
-\protected_separator
-
-\protected_separator
-discharge_buffer(1);
+ discharge_buffer(1);
\newline
-
-\protected_separator
-
-\protected_separator
-continue;
+ continue;
\newline
}
\newline
\newline
{
\newline
-
-\protected_separator
- if (last_err_line != 0) {
+ if (last_err_line != 0) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (save_last != 0) {
+ clean_gcc_messages();
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- output_error(last_buf_line-1, last_err_line, "gcc");
+ if (save_last != 0) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- strcpy (buffer[0], buffer[last_buf_line-1]);
+ output_error(last_buf_line-1, last_err_line, "gcc");
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- last_err_line = err_line;
+ strcpy (buffer[0], buffer[last_buf_line-1]);
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- last_buf_line = 1;
+ last_err_line = err_line;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- } else {
+ last_buf_line = 1;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- output_error (last_buf_line, last_err_line, "gcc");
+ } else {
\newline
+ ++last_buf_line;
+\newline
+ clean_gcc_messages();
+\newline
+ output_error(last_buf_line-1, last_err_line, "gcc");
+\newline
+ last_err_line = 0;
+\newline
+ last_buf_line = 0;
+\newline
+ }
+\newline
+ }
+\newline
+}
+\newline
+@
+\layout Scrap
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- last_err_line = 0;
+<<Function prototypes>>=
+\newline
+void discharge_buffer (int save_last);
\newline
+@
+\layout Standard
-\protected_separator
+The next function
+\begin_inset Quotes eld
+\end_inset
-\protected_separator
+cleans
+\begin_inset Quotes erd
+\end_inset
-\protected_separator
+ superfluous information from gcc messages, namely the name of the noweb
+ file and the line number of the Error.
+\begin_float footnote
+\layout Standard
-\protected_separator
+More could be done.
+ For instance, some way of distinguishing between gcc Errors and Warnings
+ should be devised.
+\end_float
+\layout Scrap
-\protected_separator
- last_buf_line = 0;
+<<Function bodies>>=
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- }
+void
\newline
-
-\protected_separator
- }
+clean_gcc_messages ()
+\newline
+{
+\newline
+ int index;
+\newline
+ char search [30];
+\newline
+ char *tail, *head;
+\newline
+ int search_len = sprintf(search, ".nw:%d:", last_err_line);
+\newline
+
+\newline
+ for (index = 0; index < last_buf_line-1; index++) {
+\newline
+ tail = (char *)strstr (buffer[index], search);
+\newline
+ if ( tail == NULL) {
+\newline
+ tail = (char *) strstr (buffer[index], ".nw:");
+\newline
+ if (tail) {
+\newline
+ tail += 4;
+\newline
+ }
+\newline
+ } else {
+\newline
+ tail += search_len;
+\newline
+ }
+\newline
+ if (tail != NULL) {
+\newline
+ head = buffer[index];
+\newline
+ while (*(head++) = *(tail++));
+\newline
+ }
+\newline
+ }
\newline
}
\newline
<<Function prototypes>>=
\newline
-void discharge_buffer (int save_last);
+void clean_gcc_messages ();
\newline
@
\layout Standard
\newline
{
\newline
-
-\protected_separator
- last_buf_line = 0;
+ last_buf_line = 0;
\newline
-
-\protected_separator
- while (fgets(buffer[0], 200, stdin)) {
+ while (fgets(buffer[0], 200, stdin)) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (noweb_try(0))
+ if (noweb_try(0))
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- output_error(1, 0, "noweb");
+ output_error(1, 0, "noweb");
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- else if (xlc_try(0))
+ else if (xlc_try(0))
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- output_error(1, err_line, "xlc");
+ output_error(1, err_line, "xlc");
\newline
-
-\protected_separator
- }
+ }
\newline
}
\newline
\layout Standard
To combine the scan of noweb error messages and gcc error messages is simple
- if we realize that it is not possible to find a noweb error message
- in the middle of a gcc error message.
+ if we realize that it is not possible to find a noweb error message in
+ the middle of a gcc error message.
So we just repeat the gcc procedure and test for noweb error messages in
the beginning of the scan:
\layout Scrap
\newline
{
\newline
-
-\protected_separator
- char
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- *s, *t;
+ char *s, *t;
\newline
-
-\protected_separator
-
+
\newline
-
-\protected_separator
- last_buf_line = 0;
+ last_buf_line = 0;
\newline
-
-\protected_separator
- while (fgets(buffer[last_buf_line], 200, stdin)) {
+ while (fgets(buffer[last_buf_line], 200, stdin)) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- /****** Skip lines until I find an error */
+ /****** Skip lines until I find an error */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (last_buf_line == 0 && noweb_try(0)) {
+ if (last_buf_line == 0 && noweb_try(0)) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- output_error(1, 0, "noweb");
+ output_error(1, 0, "noweb");
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- continue;
+ continue;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- }
+ }
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- s = strpbrk(buffer[last_buf_line], " :");
+ s = (char *)strpbrk(buffer[last_buf_line], " :");
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (s == NULL || *s == ' ')
+ if (s == NULL || *s == ' ')
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- continue; /* No gcc error found here */
+ continue; /* No gcc error found here */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- do {
+ do {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-<<gcc error message criteria is to find a "...:999:" or a "...: ">>
+ <<gcc error message criteria is to find a "...:999:" or a "...: ">>
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- /****** OK It is an error, get line number */
+ /****** OK It is an error, get line number */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- err_line = atoi(s+1);
+ err_line = atoi(s+1);
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- if (last_err_line == 0 || last_err_line == err_line) {
+ if (last_err_line == 0 || last_err_line == err_line) {
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-last_err_line = err_line;
+ last_err_line = err_line;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-continue; /* It's either a header or a continuation, don't output yet */
+ continue; /* It's either a header or a continuation, don't output
+ yet */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- }
+ }
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- /****** Completed the scan of one error message, output it to LyX */
+ /****** Completed the scan of one error message, output it to LyX
+ */
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- discharge_buffer(1);
+ discharge_buffer(1);
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- break;
+ break;
\newline
-
-\protected_separator
-
-\protected_separator
-
-\protected_separator
- } while (fgets(buffer[last_buf_line], 200, stdin));
+ } while (fgets(buffer[last_buf_line], 200, stdin));
\newline
-
-\protected_separator
- }
+ }
\newline
-
-\protected_separator
-
-\protected_separator
-/****** EOF completes the scan of whatever was being scanned */
+ /****** EOF completes the scan of whatever was being scanned */
\newline
-
-\protected_separator
- discharge_buffer(0);
+ discharge_buffer(0);
\newline
}
\newline
\newline
#include <stdio.h>
\newline
-#include <strings.h>
-\protected_separator
-
-\protected_separator
-
-\protected_separator
-
+#include <strings.h>
\newline
-
-\protected_separator
-
+
\newline
<<Global variables>>
\newline
\newline
notangle -Rbuild-script $1 | sh
\the_end
-
-
-
-
-
-
text->CursorLeft(this);
update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
new_inset->Edit(this, 0, 0, 0);
+ return true;
}
/* This is also a buffer property (ale) */
string tmp1, tmp2;
int ret1, ret2;
Systemcalls one, two;
+ string logfile = OnlyFilename(ChangeExtension(file, ".log"));
// The class LaTeX does not know the temp path.
bufferlist.updateIncludedTeXfiles(GetCWD());
// Run the literate program to convert \literate_extension file to .tex file
//
tmp1 = literate_cmd + " < " + litfile + " > " + file + " 2> " + litfile + ".out";
- tmp2 = literate_filter + " < " + litfile + ".out" + " > " + litfile + ".log";
+ tmp2 = literate_filter + " < " + litfile + ".out" + " > " + logfile;
ret1 = one.startscript(Systemcalls::System, tmp1);
ret2 = two.startscript(Systemcalls::System, tmp2);
lyxerr.debug() << "LITERATE {" << tmp1 << "} {" << tmp2 << "}" << endl;
- scanres = scanLiterateLogFile();
+
+ scanres = scanLogFile(terr);
if (scanres & Literate::ERRORS) return scanres; // return on literate error
return run(terr, minib);
}
-int Literate::build(TeXErrors & /*terr*/, MiniBuffer * minib)
+int Literate::build(TeXErrors & terr, MiniBuffer * minib)
// We know that this function will only be run if the lyx buffer
// has been changed.
{
string tmp1, tmp2;
int ret1, ret2;
Systemcalls one, two;
+ string logfile = OnlyFilename(ChangeExtension(file, ".log"));
+
// The class LaTeX does not know the temp path.
bufferlist.updateIncludedTeXfiles(GetCWD());
// Run the build program
//
tmp1 = build_cmd + ' ' + litfile + " > " + litfile + ".out 2>&1";
- tmp2 = build_filter + " < " + litfile + ".out" + " > " + litfile + ".log";
+ tmp2 = build_filter + " < " + litfile + ".out" + " > " + logfile;
ret1 = one.startscript(Systemcalls::System, tmp1);
ret2 = two.startscript(Systemcalls::System, tmp2);
- scanres = scanBuildLogFile();
+
+ scanres = scanLogFile(terr);
lyxerr[Debug::LATEX] << "Done." << endl;
return scanres;
}
-
-
-int Literate::scanLiterateLogFile()
-{
- string token;
- int retval = NO_ERRORS;
-
- string tmp = litfile + ".log";
-
- ifstream ifs(tmp.c_str());
- while (getline(ifs, token)) {
- lyxerr[Debug::LATEX] << token << endl;
-
- if (prefixIs(token, "Build Warning:")) {
- // Here shall we handle different
- // types of warnings
- retval |= LATEX_WARNING;
- lyxerr[Debug::LATEX] << "Build Warning." << endl;
- } else if (prefixIs(token, "! Build Error:")) {
- // Here shall we handle different
- // types of errors
- retval |= LATEX_ERROR;
- lyxerr[Debug::LATEX] << "Build Error." << endl;
- // this is not correct yet
- ++num_errors;
- }
- }
- return retval;
-}
-
-
-int Literate::scanBuildLogFile()
-{
- string token;
- int retval = NO_ERRORS;
-
- string tmp = litfile + ".log";
-
- ifstream ifs(tmp.c_str());
- while (getline(ifs, token)) {
- lyxerr[Debug::LATEX] << token << endl;
-
- if (prefixIs(token, "Build Warning:")) {
- // Here shall we handle different
- // types of warnings
- retval |= LATEX_WARNING;
- lyxerr[Debug::LATEX] << "Build Warning." << endl;
- } else if (prefixIs(token, "! Build Error:")) {
- // Here shall we handle different
- // types of errors
- retval |= LATEX_ERROR;
- lyxerr[Debug::LATEX] << "Build Error." << endl;
- // this is not correct yet
- ++num_errors;
- }
- }
- return retval;
-}
/// runs literate and build
int build(TeXErrors &, MiniBuffer *);
private:
- ///
- int scanLiterateLogFile();
-
- ///
- int scanBuildLogFile();
-
///
string litfile;
};
#endif
+
+
#endif
C_RETURNCB(FormTabular, WMHideCB)
-C_GENERICCB(FormTabular, TabularCloseCB)
-C_GENERICCB(FormTabular, TabularInputCB)
+C_GENERICCB(FormTabular, CloseCB)
+C_GENERICCB(FormTabular, InputCB)
+C_GENERICCB(FormTabular, OKCB)
+C_GENERICCB(FormTabular, ApplyCB)
+C_GENERICCB(FormTabular, CancelCB)
FormTabular::FormTabular(LyXView * lv, Dialogs * d)
}
-void FormTabular::TabularCloseCB(FL_OBJECT * ob, long)
+void FormTabular::CloseCB(FL_OBJECT * ob, long)
{
FormTabular * pre = static_cast<FormTabular*>(ob->form->u_vdata);
pre->hide();
}
-void FormTabular::TabularInputCB(FL_OBJECT * ob, long)
+void FormTabular::InputCB(FL_OBJECT * ob, long)
{
FormTabular * pre = static_cast<FormTabular*>(ob->form->u_vdata);
pre->input();
}
-void FormTabular::TabularOKCB(FL_OBJECT * ob, long)
+void FormTabular::OKCB(FL_OBJECT * ob, long)
{
FormTabular * pre = (FormTabular*)ob->form->u_vdata;
pre->apply_create();
}
-void FormTabular::TabularApplyCB(FL_OBJECT * ob, long)
+void FormTabular::ApplyCB(FL_OBJECT * ob, long)
{
FormTabular * pre = (FormTabular*)ob->form->u_vdata;
pre->apply_create();
}
-void FormTabular::TabularCancelCB(FL_OBJECT * ob, long)
+void FormTabular::CancelCB(FL_OBJECT * ob, long)
{
FormTabular * pre = (FormTabular*)ob->form->u_vdata;
pre->hide_create();
}
+
+
/**@name Real per-instance Callback Methods */
//@{
static int WMHideCB(FL_FORM *, void *);
- static void TabularCloseCB(FL_OBJECT *, long);
- static void TabularOKCB(FL_OBJECT *, long);
- static void TabularCancelCB(FL_OBJECT *, long);
- static void TabularApplyCB(FL_OBJECT *, long);
- static void TabularInputCB(FL_OBJECT *, long);
+ static void CloseCB(FL_OBJECT *, long);
+ static void OKCB(FL_OBJECT *, long);
+ static void CancelCB(FL_OBJECT *, long);
+ static void ApplyCB(FL_OBJECT *, long);
+ static void InputCB(FL_OBJECT *, long);
//@}
private:
fl_set_object_resize(obj, FL_RESIZE_ALL);
fdui->button_close = obj = fl_add_button(FL_NORMAL_BUTTON, 395, 300, 100, 30, idex(_("Close|#C")));fl_set_button_shortcut(obj, scex(_("Close|#C")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularCloseCB, 0);
+ fl_set_object_callback(obj, C_FormTabularCloseCB, 0);
fdui->input_tabular_column = obj = fl_add_input(FL_NORMAL_INPUT, 15, 300, 60, 30, _("Column"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fl_set_object_color(obj, FL_COL1, FL_COL1);
fdui->button_append_column = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 40, 120, 30, idex(_("Append Column|#A")));fl_set_button_shortcut(obj, scex(_("Append Column|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->button_delete_column = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 40, 120, 30, idex(_("Delete Column|#O")));fl_set_button_shortcut(obj, scex(_("Delete Column|#O")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->button_append_row = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 70, 120, 30, idex(_("Append Row|#p")));fl_set_button_shortcut(obj, scex(_("Append Row|#p")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->button_delete_row = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 70, 120, 30, idex(_("Delete Row|#w")));fl_set_button_shortcut(obj, scex(_("Delete Row|#w")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->button_set_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 10, 120, 30, idex(_("Set Borders|#S")));fl_set_button_shortcut(obj, scex(_("Set Borders|#S")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->button_unset_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 10, 120, 30, idex(_("Unset Borders|#U")));fl_set_button_shortcut(obj, scex(_("Unset Borders|#U")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_longtable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 280, 30, 90, 25, _("Longtable"));
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_rotate_tabular = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 280, 55, 90, 25, idex(_("Rotate 90°|#9")));fl_set_button_shortcut(obj, scex(_("Rotate 90°|#9")), 1);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
obj = fl_add_text(FL_NORMAL_TEXT, 285, 10, 100, 20, _("Spec. Table"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fdui->radio_border_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 85, 45, 25, 25, idex(_("Top|#t")));fl_set_button_shortcut(obj, scex(_("Top|#t")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_border_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 85, 75, 25, 25, idex(_("Bottom|#b")));fl_set_button_shortcut(obj, scex(_("Bottom|#b")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_border_left = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 65, 60, 25, 25, idex(_("Left|#l")));fl_set_button_shortcut(obj, scex(_("Left|#l")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_border_right = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 105, 60, 25, 25, idex(_("Right|#r")));fl_set_button_shortcut(obj, scex(_("Right|#r")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 200, 20, 130, 105, "");
fl_set_object_color(obj, FL_COL1, FL_COL1);
obj = fl_add_text(FL_NORMAL_TEXT, 205, 10, 115, 20, _("H. Alignment"));
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 30, 110, 25, idex(_("Left|#e")));fl_set_button_shortcut(obj, scex(_("Left|#e")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 55, 115, 25, idex(_("Right|#i")));fl_set_button_shortcut(obj, scex(_("Right|#i")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 205, 80, 115, 25, idex(_("Center|#c")));fl_set_button_shortcut(obj, scex(_("Center|#c")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->input_column_width = obj = fl_add_input(FL_NORMAL_INPUT, 375, 150, 95, 30, _("Width of column:"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 340, 20, 130, 105, "");
fl_set_object_color(obj, FL_COL1, FL_COL1);
fdui->radio_valign_top = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 345, 30, 110, 25, idex(_("Top|#p")));fl_set_button_shortcut(obj, scex(_("Top|#p")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_valign_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 345, 55, 115, 25, idex(_("Center|#n")));fl_set_button_shortcut(obj, scex(_("Center|#n")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_valign_bottom = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 345, 80, 115, 25, idex(_("Bottom|#o")));fl_set_button_shortcut(obj, scex(_("Bottom|#o")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
obj = fl_add_text(FL_NORMAL_TEXT, 345, 10, 115, 20, _("V. Alignment"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->input_special_alignment = obj = fl_add_input(FL_NORMAL_INPUT, 30, 150, 200, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
obj = fl_add_text(FL_NORMAL_TEXT, 25, 130, 170, 20, _("Special Column Alignment"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->radio_multicolumn = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 25, 145, 25, idex(_("Multicolumn|#M")));fl_set_button_shortcut(obj, scex(_("Multicolumn|#M")), 1);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_linebreak_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 50, 145, 25, idex(_("Linebreaks|#N")));fl_set_button_shortcut(obj, scex(_("Linebreaks|#N")), 1);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_rotate_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 75, 145, 25, _("Rotate 90°"));
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 165, 15, 305, 85, "");
fl_set_object_color(obj, FL_COL1, FL_COL1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->input_special_multialign = obj = fl_add_input(FL_NORMAL_INPUT, 175, 30, 280, 30, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
obj = fl_add_text(FL_NORMAL_TEXT, 170, 5, 290, 20, _("Special Multicolumn Alignment"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->input_mcolumn_width = obj = fl_add_input(FL_NORMAL_INPUT, 360, 65, 95, 30, _("Width of multi-column:"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_border_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 75, 135, 25, 25, idex(_("Top|#t")));fl_set_button_shortcut(obj, scex(_("Top|#t")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_border_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 75, 165, 25, 25, idex(_("Bottom|#b")));fl_set_button_shortcut(obj, scex(_("Bottom|#b")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_border_left = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 55, 150, 25, 25, idex(_("Left|#l")));fl_set_button_shortcut(obj, scex(_("Left|#l")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_border_right = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 95, 150, 25, 25, idex(_("Right|#r")));fl_set_button_shortcut(obj, scex(_("Right|#r")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 195, 120, 110, 25, idex(_("Left|#e")));fl_set_button_shortcut(obj, scex(_("Left|#e")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 195, 145, 115, 25, idex(_("Right|#i")));fl_set_button_shortcut(obj, scex(_("Right|#i")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 195, 170, 115, 25, idex(_("Center|#c")));fl_set_button_shortcut(obj, scex(_("Center|#c")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_valign_top = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 340, 120, 110, 25, idex(_("Top|#p")));fl_set_button_shortcut(obj, scex(_("Top|#p")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_valign_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 340, 145, 115, 25, idex(_("Center|#n")));fl_set_button_shortcut(obj, scex(_("Center|#n")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_valign_bottom = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 340, 170, 115, 25, idex(_("Bottom|#o")));fl_set_button_shortcut(obj, scex(_("Bottom|#o")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fl_end_form();
fdui->form_cell_options->fdui = fdui;
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->radio_lt_firsthead = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 30, 90, 25, _("First Head"));
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_lt_head = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 15, 60, 90, 25, _("Head"));
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 130, 20, 100, 75, "");
obj = fl_add_text(FL_NORMAL_TEXT, 135, 10, 85, 20, _("Footer"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->radio_lt_foot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 135, 30, 90, 25, _("Foot"));
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fdui->radio_lt_lastfoot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 135, 60, 90, 25, _("Last Foot"));
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 245, 20, 95, 75, "");
obj = fl_add_text(FL_NORMAL_TEXT, 250, 10, 85, 20, _("Special"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->radio_lt_newpage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 250, 30, 90, 25, _("New Page"));
- fl_set_object_callback(obj, TabularInputCB, 0);
+ fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fl_end_form();
fdui->form_longtable_options->fdui = fdui;
obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 130, "");
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 90, 30, _("OK"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularOKCB, 0);
+ fl_set_object_callback(obj, C_FormTabularOKCB, 0);
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 90, 90, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularApplyCB, 0);
+ fl_set_object_callback(obj, C_FormTabularApplyCB, 0);
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 90, 90, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, TabularCancelCB, 0);
+ fl_set_object_callback(obj, C_FormTabularCancelCB, 0);
fdui->slider_columns = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 50, 220, 30, _("Columns"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_LEFT);
-/** Header file generated with fdesign on Tue Jul 11 16:33:31 2000.**/
+/** Header file generated with fdesign on Wed Jul 12 15:19:16 2000.**/
#ifndef FD_form_tabular_h_
#define FD_form_tabular_h_
/** Callbacks, globals and object handlers **/
-extern "C" void TabularCloseCB(FL_OBJECT *, long);
+extern "C" void C_FormTabularCloseCB(FL_OBJECT *, long);
-extern "C" void TabularInputCB(FL_OBJECT *, long);
+extern "C" void C_FormTabularInputCB(FL_OBJECT *, long);
-extern "C" void TabularInputCB(FL_OBJECT *, long);
+extern "C" void C_FormTabularInputCB(FL_OBJECT *, long);
-extern "C" void TabularInputCB(FL_OBJECT *, long);
+extern "C" void C_FormTabularInputCB(FL_OBJECT *, long);
-extern "C" void TabularInputCB(FL_OBJECT *, long);
+extern "C" void C_FormTabularInputCB(FL_OBJECT *, long);
-extern "C" void TabularOKCB(FL_OBJECT *, long);
-extern "C" void TabularApplyCB(FL_OBJECT *, long);
-extern "C" void TabularCancelCB(FL_OBJECT *, long);
+extern "C" void C_FormTabularOKCB(FL_OBJECT *, long);
+extern "C" void C_FormTabularApplyCB(FL_OBJECT *, long);
+extern "C" void C_FormTabularCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_close
-callback: TabularCloseCB
+callback: C_FormTabularCloseCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_append_column
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_delete_column
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_append_row
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_delete_row
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_set_borders
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_unset_borders
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_longtable
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_rotate_tabular
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_border_top
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_border_bottom
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_border_left
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_border_right
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_left
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_right
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_center
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_column_width
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_valign_top
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_valign_center
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_valign_bottom
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_special_alignment
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_multicolumn
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_linebreak_cell
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_rotate_cell
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_special_multialign
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: input_mcolumn_width
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_border_top
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_border_bottom
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_border_left
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_border_right
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_left
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_right
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_align_center
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_valign_top
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_valign_center
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_valign_bottom
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
=============== FORM ===============
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_lt_firsthead
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_lt_head
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_lt_foot
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_lt_lastfoot
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_lt_newpage
-callback: TabularInputCB
+callback: C_FormTabularInputCB
argument: 0
=============== FORM ===============
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_ok
-callback: TabularOKCB
+callback: C_FormTabularOKCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_apply
-callback: TabularApplyCB
+callback: C_FormTabularApplyCB
argument: 0
--------------------
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_cancel
-callback: TabularCancelCB
+callback: C_FormTabularCancelCB
argument: 0
--------------------
#define cellstart(p) ((p % 2) == 0)
-//#define USE_NEW_LAYOUT 1
+#define USE_NEW_LAYOUT 1
InsetTabular::InsetTabular(Buffer * buf, int rows, int columns)
{