summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2004-06-28 17:43:16 +0000
committerJohannes Hofmann <johannes.hofmann@gmx.de>2004-06-28 17:43:16 +0000
commit5f969cbc52a0778a3b30394bd77bdeff63159ffd (patch)
tree6dece1afa40342d25c7b9883ab29e8ec4f81b6c4
parent3927a541cbbf8edc69ba28abd318ac76a2d2b42d (diff)
cleanups for Linux
cleanups for Linux
-rw-r--r--Makefile2
-rw-r--r--README2
-rw-r--r--src/GsWidget.cxx8
-rw-r--r--src/PSEditWidget.cxx8
-rw-r--r--src/flpsed.cxx6
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);