From 5f969cbc52a0778a3b30394bd77bdeff63159ffd Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 28 Jun 2004 17:43:16 +0000 Subject: cleanups for Linux cleanups for Linux --- Makefile | 2 +- README | 2 +- src/GsWidget.cxx | 8 ++++++-- src/PSEditWidget.cxx | 8 ++++---- src/flpsed.cxx | 6 +++--- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 6096af2..8dff5ce 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ OBJECTS=GsWidget.o PSEditWidget.o flpsed.o $(CC) -c $(CFLAGS) $*.cxx flpsed: $(OBJECTS) - $(CC) -g -o flpsed $(OBJECTS) -L/usr/X11R6/lib -lfltk -lm + $(CC) -g -o flpsed $(OBJECTS) -L/usr/X11R6/lib -lfltk -lX11 -lm clean: rm -f flpsed $(OBJECTS) diff --git a/README b/README index 2ab61d6..42c4fc0 100644 --- a/README +++ b/README @@ -14,7 +14,7 @@ Usage: - the frame around the text shows, which text line has the focus. - remove text, by hitting BackSpace. - click on the lower left corner of a text line, to focus it. -- navigate within the document with the Page->next or Page->first menu buttons. +- navigate within the document with the Page->Next or Page->First menu buttons. - save your document and preview it with ghostview or something similar. - if you reopen the document with flpsed, you can edit the added text lines. diff --git a/src/GsWidget.cxx b/src/GsWidget.cxx index c781ea2..ec0a73d 100644 --- a/src/GsWidget.cxx +++ b/src/GsWidget.cxx @@ -1,5 +1,5 @@ // -// "$Id: GsWidget.cxx,v 1.4 2004/06/25 18:14:05 hofmann Exp $" +// "$Id: GsWidget.cxx,v 1.5 2004/06/28 19:43:16 hofmann Exp $" // // GsWidget routines. // @@ -152,7 +152,11 @@ int GsWidget::load(int fd) { argv[5] = "-dNOPLATFONTS"; argv[6] = "-"; argv[7] = NULL; - execvp(argv[0], argv); + execvp(argv[0], argv); + fprintf(stderr, "Could not exec gs (errno %d)\n", errno); + fprintf(stderr, "Please install ghostscript and make sure 'gs' " + "is in the PATH.\n"); + exit(1); } else { gs_pid = pid; page = 0; diff --git a/src/PSEditWidget.cxx b/src/PSEditWidget.cxx index 55373f5..d3c54ad 100644 --- a/src/PSEditWidget.cxx +++ b/src/PSEditWidget.cxx @@ -1,5 +1,5 @@ // -// "$Id: PSEditWidget.cxx,v 1.8 2004/06/25 18:14:05 hofmann Exp $" +// "$Id: PSEditWidget.cxx,v 1.9 2004/06/28 19:43:16 hofmann Exp $" // // PSEditWidget routines. // @@ -204,8 +204,8 @@ int PSEditWidget::load(char *f) { char *s, *e, glyph[1024]; int size, ret; - strncpy(tmpname, "/tmp/PSEditWidgetXXXXXX.ps", 256); - tmp_fd = mkstemps(tmpname, 3); + strncpy(tmpname, "/tmp/PSEditWidgetXXXXXX", 256); + tmp_fd = mkstemp(tmpname); if (tmp_fd < 0) { fprintf(stderr, "Could not create temporary file (errno %d).\n", errno); return 1; @@ -379,7 +379,7 @@ void PSText::draw(int off_x,int off_y) { fl_font(FL_HELVETICA, size); fl_draw(s, x + off_x, y + off_y); if (gsew->cur_text == this) { - fl_draw_box(FL_BORDER_FRAME, x+off_x-1, y+off_y-fl_height()+fl_descent(), fl_width(s)+2, fl_height(), FL_BLACK); + fl_draw_box(FL_BORDER_FRAME, x+off_x-1, y+off_y-fl_height()+fl_descent(), (int) fl_width(s)+2, fl_height(), FL_BLACK); } if (p->next) { p->next->draw(off_x, off_y); diff --git a/src/flpsed.cxx b/src/flpsed.cxx index a045b90..1344bce 100644 --- a/src/flpsed.cxx +++ b/src/flpsed.cxx @@ -1,5 +1,5 @@ // -// "$Id: flpsed.cxx,v 1.9 2004/06/25 18:14:05 hofmann Exp $" +// "$Id: flpsed.cxx,v 1.10 2004/06/28 19:43:16 hofmann Exp $" // // flpsed program. // @@ -170,8 +170,8 @@ void print_cb() { return; } - strncpy(tmpname, "/tmp/PSEditWidgetXXXXXX.ps", 256); - tmp_fd = mkstemps(tmpname, 3); + strncpy(tmpname, "/tmp/PSEditWidgetXXXXXX", 256); + tmp_fd = mkstemp(tmpname); if (tmp_fd >= 0) { close(tmp_fd); -- cgit v1.2.3