From: Jürgen Vigna Date: Wed, 12 Jul 2000 13:24:24 +0000 (+0000) Subject: Small fixes notified by Angus and patch from Kayan! X-Git-Tag: 1.6.10~22124 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d02a3f2679f0f2e0c6af50155c3ff710e065a302;p=lyx.git Small fixes notified by Angus and patch from Kayan! git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@878 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index a363c47bd4..c402ed9426 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,26 @@ * src/lyx_main.C (commandLineHelp): remove -display from command line help. +2000-07-09 Kayvan A. Sylvan + + * 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 + + * 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 * src/text.C (GetColumnNearX): Better behavior when a RTL diff --git a/lib/Makefile.am b/lib/Makefile.am index cc794cccb0..4f3dcb820b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -4,6 +4,7 @@ DISTCLEANFILES = *.orig *.rej *~ *.bak core textclass.lst packages.lst \ pkgdata_SCRIPTS = configure configure.cmd MAINTAINERCLEANFILES = $(srcdir)/Makefile.in SUBDIRS = reLyX +bin_SCRIPTS = listerrors BIND = bind/*.bind CLIPART = clipart/*.eps @@ -29,7 +30,7 @@ pkgdata_DATA = lyxrc.example CREDITS chkconfig.ltx lyxrc.defaults \ 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 \ @@ -55,3 +56,5 @@ dist-hook: { cvs -Q export -r HEAD -d doc lyxdoc || \ echo "WARNING: Unable to get LyX Documentation from CVS!" ; true ; } +listerrors: examples/Literate.lyx + ./build-listerrors diff --git a/lib/build-listerrors b/lib/build-listerrors new file mode 100755 index 0000000000..629d031f19 --- /dev/null +++ b/lib/build-listerrors @@ -0,0 +1,83 @@ +#!/bin/sh +# +# Attempt to build listerrors (see examples/Literate.lyx) at build-time +# +# Author: Kayvan Sylvan + +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 diff --git a/lib/examples/Literate.lyx b/lib/examples/Literate.lyx index 47db33766a..647af802ed 100644 --- a/lib/examples/Literate.lyx +++ b/lib/examples/Literate.lyx @@ -1,6 +1,5 @@ -#This file was created by 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 @@ -33,6 +32,12 @@ An example program 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 @@ -43,7 +48,7 @@ today \layout Standard -\begin_inset LatexCommand \tableofcontents +\begin_inset LatexCommand \tableofcontents{} \end_inset @@ -70,12 +75,12 @@ In this document we present a filter that recognizes compilation error messages 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 @@ -89,219 +94,51 @@ main (int argc, char **argv) \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 - <> + <> \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 - <> + <> \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 -<> + <> \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 - <> + <> \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 - <> + <> \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 - <> + <> \newline - -\protected_separator - } + } \newline } \newline @@ -326,43 +163,13 @@ We resort to some global variables to allow access from several different <>= \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 @@ -370,7 +177,7 @@ int 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 @@ -378,6 +185,14 @@ buffer \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 <>= @@ -388,52 +203,36 @@ output_error (int buf_size, int error_line, char *tool) \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 >, or any of the above strings. \layout Scrap @@ -581,161 +331,43 @@ noweb_try (int buf_line) \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 @@ -754,43 +386,19 @@ The xlc compiler always outputs one single line for each error found, thus line at a time. \layout Scrap -<>= -\protected_separator - +<>= \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 @@ -819,65 +427,29 @@ xlc_try (int buf_line) \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 @@ -929,223 +501,53 @@ Every gcc error message contains a string with no space followed by a \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 -<> + <> \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 @@ -1156,35 +558,29 @@ continue; /* It's either a header or a continuation, don't output yet */ \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 - <> \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 - <> \newline /****** Verify if is all digits between ":" */ \newline if (t != s+1+strspn(s+1, "0123456789")) \newline - -\protected_separator - <> \newline @ @@ -1195,23 +591,11 @@ if (t != s+1+strspn(s+1, "0123456789")) \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 @@ -1241,121 +625,114 @@ discharge_buffer (int save_last) \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; +<>= +\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; +<>= \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 @@ -1364,7 +741,7 @@ discharge_buffer (int save_last) <>= \newline -void discharge_buffer (int save_last); +void clean_gcc_messages (); \newline @ \layout Standard @@ -1378,57 +755,19 @@ To combine the scan of noweb error messages and xlc error messages is very \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 @@ -1436,8 +775,8 @@ To combine the scan of noweb error messages and xlc error messages is very \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 @@ -1446,263 +785,61 @@ To combine the scan of noweb error messages and gcc error messages is simple \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 -<> + <> \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 @@ -1716,17 +853,9 @@ Wrapping the code into a file \newline #include \newline -#include -\protected_separator - -\protected_separator - -\protected_separator - +#include \newline - -\protected_separator - + \newline <> \newline @@ -1794,9 +923,3 @@ build-script \newline notangle -Rbuild-script $1 | sh \the_end - - - - - - diff --git a/src/BufferView2.C b/src/BufferView2.C index e305bd0b65..d792cb0ba5 100644 --- a/src/BufferView2.C +++ b/src/BufferView2.C @@ -281,6 +281,7 @@ bool BufferView::open_new_inset(UpdatableInset * new_inset) 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) */ diff --git a/src/Literate.C b/src/Literate.C index 7443d01cfd..134d6d310e 100644 --- a/src/Literate.C +++ b/src/Literate.C @@ -51,6 +51,7 @@ int Literate::weave(TeXErrors & terr, MiniBuffer * minib) 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()); @@ -62,17 +63,18 @@ int Literate::weave(TeXErrors & terr, MiniBuffer * minib) // 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. { @@ -81,6 +83,8 @@ int Literate::build(TeXErrors & /*terr*/, MiniBuffer * minib) 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()); @@ -92,69 +96,12 @@ int Literate::build(TeXErrors & /*terr*/, MiniBuffer * minib) // 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; -} diff --git a/src/Literate.h b/src/Literate.h index 2b65841d4e..9027db10d0 100644 --- a/src/Literate.h +++ b/src/Literate.h @@ -33,12 +33,6 @@ public: /// runs literate and build int build(TeXErrors &, MiniBuffer *); private: - /// - int scanLiterateLogFile(); - - /// - int scanBuildLogFile(); - /// string litfile; @@ -56,3 +50,5 @@ private: }; #endif + + diff --git a/src/frontends/xforms/FormTabular.C b/src/frontends/xforms/FormTabular.C index 272e4ef5e8..29c206df51 100644 --- a/src/frontends/xforms/FormTabular.C +++ b/src/frontends/xforms/FormTabular.C @@ -24,8 +24,11 @@ using SigC::slot; #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) @@ -194,14 +197,14 @@ int FormTabular::WMHideCB(FL_FORM * form, void *) } -void FormTabular::TabularCloseCB(FL_OBJECT * ob, long) +void FormTabular::CloseCB(FL_OBJECT * ob, long) { FormTabular * pre = static_cast(ob->form->u_vdata); pre->hide(); } -void FormTabular::TabularInputCB(FL_OBJECT * ob, long) +void FormTabular::InputCB(FL_OBJECT * ob, long) { FormTabular * pre = static_cast(ob->form->u_vdata); pre->input(); @@ -404,7 +407,7 @@ void FormTabular::apply_create() } -void FormTabular::TabularOKCB(FL_OBJECT * ob, long) +void FormTabular::OKCB(FL_OBJECT * ob, long) { FormTabular * pre = (FormTabular*)ob->form->u_vdata; pre->apply_create(); @@ -412,15 +415,17 @@ void FormTabular::TabularOKCB(FL_OBJECT * ob, long) } -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(); } + + diff --git a/src/frontends/xforms/FormTabular.h b/src/frontends/xforms/FormTabular.h index 63b9e9eb64..e5def09932 100644 --- a/src/frontends/xforms/FormTabular.h +++ b/src/frontends/xforms/FormTabular.h @@ -43,11 +43,11 @@ public: /**@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: diff --git a/src/frontends/xforms/form_tabular.C b/src/frontends/xforms/form_tabular.C index 7d4e7bdb84..0a58769abf 100644 --- a/src/frontends/xforms/form_tabular.C +++ b/src/frontends/xforms/form_tabular.C @@ -21,7 +21,7 @@ FD_form_tabular * FormTabular::build_tabular() 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); @@ -52,26 +52,26 @@ FD_form_tabular_options * FormTabular::build_tabular_options() 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); @@ -102,19 +102,19 @@ FD_form_column_options * FormTabular::build_column_options() 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")); @@ -123,27 +123,27 @@ FD_form_column_options * FormTabular::build_column_options() 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); @@ -153,7 +153,7 @@ FD_form_column_options * FormTabular::build_column_options() 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); @@ -199,58 +199,58 @@ FD_form_cell_options * FormTabular::build_cell_options() 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; @@ -273,25 +273,25 @@ FD_form_longtable_options * FormTabular::build_longtable_options() 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; @@ -310,13 +310,13 @@ FD_form_create_tabular * FormTabular::build_create_tabular() 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); diff --git a/src/frontends/xforms/form_tabular.h b/src/frontends/xforms/form_tabular.h index 2560e8cf71..f25187ab73 100644 --- a/src/frontends/xforms/form_tabular.h +++ b/src/frontends/xforms/form_tabular.h @@ -1,22 +1,22 @@ -/** 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 ****/ diff --git a/src/frontends/xforms/forms/form_tabular.fd b/src/frontends/xforms/forms/form_tabular.fd index 5c419f8fa2..2c8268c1c3 100644 --- a/src/frontends/xforms/forms/form_tabular.fd +++ b/src/frontends/xforms/forms/form_tabular.fd @@ -64,7 +64,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_close -callback: TabularCloseCB +callback: C_FormTabularCloseCB argument: 0 -------------------- @@ -178,7 +178,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_append_column -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -196,7 +196,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_delete_column -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -214,7 +214,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_append_row -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -232,7 +232,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_delete_row -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -250,7 +250,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_set_borders -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -268,7 +268,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_unset_borders -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -286,7 +286,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_longtable -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -304,7 +304,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_rotate_tabular -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -400,7 +400,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_top -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -418,7 +418,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_bottom -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -436,7 +436,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_left -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -454,7 +454,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_right -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -508,7 +508,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_left -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -526,7 +526,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_right -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -544,7 +544,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_center -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -562,7 +562,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_column_width -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -598,7 +598,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_top -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -616,7 +616,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_center -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -634,7 +634,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_bottom -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -688,7 +688,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_special_alignment -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -892,7 +892,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_multicolumn -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -910,7 +910,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_linebreak_cell -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -928,7 +928,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_rotate_cell -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -964,7 +964,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_special_multialign -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1000,7 +1000,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: input_mcolumn_width -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1018,7 +1018,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_top -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1036,7 +1036,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_bottom -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1054,7 +1054,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_left -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1072,7 +1072,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_border_right -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1090,7 +1090,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_left -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1108,7 +1108,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_right -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1126,7 +1126,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_align_center -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1144,7 +1144,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_top -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1162,7 +1162,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_center -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1180,7 +1180,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_valign_bottom -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 =============== FORM =============== @@ -1258,7 +1258,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_firsthead -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1276,7 +1276,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_head -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1330,7 +1330,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_foot -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1348,7 +1348,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_lastfoot -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 -------------------- @@ -1402,7 +1402,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: radio_lt_newpage -callback: TabularInputCB +callback: C_FormTabularInputCB argument: 0 =============== FORM =============== @@ -1444,7 +1444,7 @@ shortcut: ^M resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_ok -callback: TabularOKCB +callback: C_FormTabularOKCB argument: 0 -------------------- @@ -1462,7 +1462,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_apply -callback: TabularApplyCB +callback: C_FormTabularApplyCB argument: 0 -------------------- @@ -1480,7 +1480,7 @@ shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: button_cancel -callback: TabularCancelCB +callback: C_FormTabularCancelCB argument: 0 -------------------- diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index ca8e7a9c36..c957576010 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -47,7 +47,7 @@ using std::endl; #define cellstart(p) ((p % 2) == 0) -//#define USE_NEW_LAYOUT 1 +#define USE_NEW_LAYOUT 1 InsetTabular::InsetTabular(Buffer * buf, int rows, int columns) {