summaryrefslogtreecommitdiff
path: root/src/flpsed.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-01-20 17:44:30 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-01-20 17:44:30 +0100
commite441405925865fe4d789040925aea20000d36f21 (patch)
tree204c8877b7d2c995f430fc0dd9694d5d6a3a3ed7 /src/flpsed.cxx
parent87270613d16f082361537fbc1a80131a646756cf (diff)
add support for -z (zoom) option
Diffstat (limited to 'src/flpsed.cxx')
-rw-r--r--src/flpsed.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/flpsed.cxx b/src/flpsed.cxx
index f7014e8..b9f879f 100644
--- a/src/flpsed.cxx
+++ b/src/flpsed.cxx
@@ -356,11 +356,12 @@ Fl_Menu_Item size_menu[] = {
void usage() {
fprintf(stderr,
- "usage: flpsed [-hbd] [-t <tag>=<value>] [<infile>] [<outfile>]\n"
+ "usage: flpsed [-hbdz] [-t <tag>=<value>] [<infile>] [<outfile>]\n"
" -h print this message\n"
" -b batch mode (no gui)\n"
" -d dump tags and values from a document\n"
" to stdout (this implies -b)\n"
+ " -z <zoom> set the zoom percentage (e.g. 200)\n"
" -t <tag>=<value> set text to <value> where tag is <tag>\n"
" <infile> optional input file; in batch mode if no\n"
" input file is given, input is read from stdin\n"
@@ -384,9 +385,10 @@ int main(int argc, char** argv) {
struct {char *tag; char *value;} tv[TV_LEN];
int tv_idx = 0, my_argc;
FILE *in_fp = NULL, *out_fp = NULL;
+ int zoom_val = 0;
err = 0;
- while ((c = getopt(argc, argv, "hdbt:g:d:f:i:s:")) != -1) {
+ while ((c = getopt(argc, argv, "hdbt:z:g:d:f:i:s:")) != -1) {
switch (c) {
case 'h':
usage();
@@ -418,6 +420,9 @@ int main(int argc, char** argv) {
}
free(tmp);
break;
+ case 'z':
+ zoom_val = atoi(optarg);
+ break;
default:
i = optind -1;
n = Fl::arg(argc, argv, i);
@@ -524,6 +529,7 @@ int main(int argc, char** argv) {
psed_p = new PSEditor(0, 0, 700, 900);
psed_p->property_changed_callback(property_changed_cb);
scroll->end();
+
fl_open_display();
Fl::add_handler(xev_handler);
@@ -533,7 +539,12 @@ int main(int argc, char** argv) {
win->end();
win->callback((Fl_Callback *)quit_cb);
win->show(1, argv);
-
+
+
+ if (zoom_val) {
+ psed_p->zoom(zoom_val);
+ }
+
if (in_fp) {
sleep(1); // this seems to be necessary on fast systems to make the
// GHOSTVIEW property available to ghostsscript.