~inkscape.dev/inkscape/eraser_improvements

« back to all changes in this revision

Viewing changes to src/inkview.cpp

  • Committer: jabiertxof
  • Date: 2016-03-01 01:42:13 UTC
  • mfrom: (14648.1.28 inkscape)
  • Revision ID: info@marker.es-20160301014213-ewfxjn3ohelo104c
update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
# include "config.h"
31
31
#endif
32
32
 
33
 
#ifdef HAVE_GETOPT_H
34
 
#include <getopt.h>
35
 
#endif
36
 
 
37
33
#include <cstring>
38
34
#include <sys/stat.h>
39
35
#include <locale.h>
106
102
int sp_main_gui (int, char const**) { return 0; }
107
103
int sp_main_console (int, char const**) { return 0; }
108
104
 
109
 
static int
110
 
sp_svgview_main_delete (GtkWidget */*widget*/, GdkEvent */*event*/, struct SPSlideShow */*ss*/)
 
105
static int sp_svgview_main_delete (GtkWidget */*widget*/,
 
106
                                   GdkEvent */*event*/,
 
107
                                   struct SPSlideShow */*ss*/)
111
108
{
112
109
    gtk_main_quit ();
113
110
    return FALSE;
114
111
}
115
112
 
116
 
static int
117
 
sp_svgview_main_key_press (GtkWidget */*widget*/, GdkEventKey *event, struct SPSlideShow *ss)
 
113
static int sp_svgview_main_key_press (GtkWidget */*widget*/, 
 
114
                                      GdkEventKey *event,
 
115
                                      struct SPSlideShow *ss)
118
116
{
119
117
    switch (event->keyval) {
120
 
    case GDK_KEY_Up:
121
 
    case GDK_KEY_Home:
122
 
        sp_svgview_goto_first(ss);
123
 
        break;
124
 
    case GDK_KEY_Down:
125
 
    case GDK_KEY_End:
126
 
        sp_svgview_goto_last(ss);
127
 
        break;
128
 
    case GDK_KEY_F11:
129
 
        if (ss->fullscreen) {
130
 
            gtk_window_unfullscreen (GTK_WINDOW(ss->window));
131
 
            ss->fullscreen = false;
132
 
        } else {
133
 
            gtk_window_fullscreen (GTK_WINDOW(ss->window));
134
 
            ss->fullscreen = true;
135
 
        }
136
 
        break;
137
 
    case GDK_KEY_Return:
138
 
        sp_svgview_control_show (ss);
139
 
        break;
140
 
    case GDK_KEY_KP_Page_Down:
141
 
    case GDK_KEY_Page_Down:
142
 
    case GDK_KEY_Right:
143
 
    case GDK_KEY_space:
144
 
        sp_svgview_show_next (ss);
145
 
        break;
146
 
    case GDK_KEY_KP_Page_Up:
147
 
    case GDK_KEY_Page_Up:
148
 
    case GDK_KEY_Left:
149
 
    case GDK_KEY_BackSpace:
150
 
        sp_svgview_show_prev (ss);
151
 
        break;
152
 
    case GDK_KEY_Escape:
153
 
    case GDK_KEY_q:
154
 
    case GDK_KEY_Q:
155
 
        gtk_main_quit();
156
 
        break;
157
 
    default:
158
 
        break;
 
118
        case GDK_KEY_Up:
 
119
        case GDK_KEY_Home:
 
120
            sp_svgview_goto_first(ss);
 
121
            break;
 
122
        case GDK_KEY_Down:
 
123
        case GDK_KEY_End:
 
124
            sp_svgview_goto_last(ss);
 
125
            break;
 
126
        case GDK_KEY_F11:
 
127
            if (ss->fullscreen) {
 
128
                gtk_window_unfullscreen (GTK_WINDOW(ss->window));
 
129
                ss->fullscreen = false;
 
130
            } else {
 
131
                gtk_window_fullscreen (GTK_WINDOW(ss->window));
 
132
                ss->fullscreen = true;
 
133
            }
 
134
            break;
 
135
        case GDK_KEY_Return:
 
136
            sp_svgview_control_show (ss);
 
137
        break;
 
138
        case GDK_KEY_KP_Page_Down:
 
139
        case GDK_KEY_Page_Down:
 
140
        case GDK_KEY_Right:
 
141
        case GDK_KEY_space:
 
142
            sp_svgview_show_next (ss);
 
143
        break;
 
144
        case GDK_KEY_KP_Page_Up:
 
145
        case GDK_KEY_Page_Up:
 
146
        case GDK_KEY_Left:
 
147
        case GDK_KEY_BackSpace:
 
148
            sp_svgview_show_prev (ss);
 
149
            break;
 
150
        case GDK_KEY_Escape:
 
151
        case GDK_KEY_q:
 
152
        case GDK_KEY_Q:
 
153
            gtk_main_quit();
 
154
            break;
 
155
        default:
 
156
            break;
159
157
    }
160
158
    gtk_window_set_title(GTK_WINDOW(ss->window), ss->doc->getName());
161
159
    return TRUE;
162
160
}
163
161
 
164
 
int
165
 
main (int argc, const char **argv)
 
162
int main (int argc, const char **argv)
166
163
{
167
164
    if (argc == 1) {
168
 
        usage();
 
165
        usage();
169
166
    }
170
167
 
171
168
    // Prevents errors like "Unable to wrap GdkPixbuf..." (in nr-filter-image.cpp for example)
175
172
 
176
173
    struct SPSlideShow ss;
177
174
 
178
 
    int option,
179
 
        num_parsed_options = 0;
 
175
    int num_parsed_options = 0;
180
176
 
181
177
    // the list of arguments is in the net line
182
 
    while ((option = getopt(argc, (char* const* )argv, "t:")) != -1)
183
 
    {
184
 
        switch(option) {
185
 
            case 't': // for timer
186
 
                // fprintf(stderr, "set timer arg %s\n", optarg );
187
 
                ss.timer = atoi(optarg);
188
 
                num_parsed_options += 2; // 2 because of flag + option
 
178
    for (int i = 1; i < argc; i++) {
 
179
        if ((argv[i][0] == '-')) {
 
180
            if (!strcmp(argv[i], "--")) {
189
181
                break;
190
 
            case '?':
191
 
            default:
192
 
                usage();
 
182
            }
 
183
            else if ((!strcmp(argv[i], "-t"))) {
 
184
                if (i + 1 >= argc) {
 
185
                    usage();
 
186
                }
 
187
                ss.timer = atoi(argv[i+1]);
 
188
                num_parsed_options = i+1;
 
189
                i++;
 
190
            }
 
191
            else {
 
192
                usage();
 
193
            }
193
194
        }
194
195
    }
195
196
 
232
233
    // starting at where the commandline options stopped parsing because
233
234
    // we want all the files to be in the list
234
235
    for (i = num_parsed_options + 1 ; i < argc; i++) {
235
 
        struct stat st;
236
 
        if (stat (argv[i], &st)
237
 
              || !S_ISREG (st.st_mode)
238
 
              || (st.st_size < 64)) {
239
 
                fprintf(stderr, "could not open file %s\n", argv[i]);
240
 
        } else {
241
 
 
242
 
#ifdef WITH_INKJAR
243
 
            if (is_jar(argv[i])) {
244
 
                Inkjar::JarFileReader jar_file_reader(argv[i]);
245
 
                for (;;) {
246
 
                    GByteArray *gba = jar_file_reader.get_next_file();
247
 
                    if (gba == NULL) {
248
 
                        char *c_ptr;
249
 
                        gchar *last_filename = jar_file_reader.get_last_filename();
250
 
                        if (last_filename == NULL)
251
 
                            break;
252
 
                        if ((c_ptr = std::strrchr(last_filename, '/')) != NULL) {
253
 
                            if (*(++c_ptr) == '\0') {
254
 
                                g_free(last_filename);
255
 
                                continue;
256
 
                            }
257
 
                        }
258
 
                    } else if (gba->len > 0) {
259
 
                        //::write(1, gba->data, gba->len);
260
 
                        /* Append to list */
261
 
                        if (ss.length >= ss.size) {
262
 
                            /* Expand */
263
 
                            ss.size <<= 1;
264
 
                            ss.slides = g_renew (char *, ss.slides, ss.size);
265
 
                        }
266
 
 
267
 
                        ss.doc = SPDocument::createNewDocFromMem ((const gchar *)gba->data,
268
 
                                                           gba->len,
269
 
                                                           TRUE);
270
 
                        gchar *last_filename = jar_file_reader.get_last_filename();
271
 
                        if (ss.doc) {
272
 
                            ss.slides[ss.length++] = strdup (last_filename);
273
 
                            (ss.doc)->setUri (last_filename);
274
 
                        }
275
 
                        g_byte_array_free(gba, TRUE);
276
 
                        g_free(last_filename);
277
 
                    } else
278
 
                        break;
279
 
                }
280
 
            } else {
281
 
#endif /* WITH_INKJAR */
282
 
                /* Append to list */
283
 
                if (ss.length >= ss.size) {
284
 
                    /* Expand */
285
 
                    ss.size <<= 1;
286
 
                    ss.slides = g_renew (char *, ss.slides, ss.size);
287
 
 
288
 
                }
289
 
 
290
 
                ss.slides[ss.length++] = strdup (argv[i]);
291
 
 
 
236
        struct stat st;
 
237
        if (stat (argv[i], &st)
 
238
              || !S_ISREG (st.st_mode)
 
239
              || (st.st_size < 64)) {
 
240
            fprintf(stderr, "could not open file %s\n", argv[i]);
 
241
        } else {
 
242
 
 
243
    #ifdef WITH_INKJAR
 
244
            if (is_jar(argv[i])) {
 
245
                Inkjar::JarFileReader jar_file_reader(argv[i]);
 
246
                for (;;) {
 
247
                    GByteArray *gba = jar_file_reader.get_next_file();
 
248
                    if (gba == NULL) {
 
249
                        char *c_ptr;
 
250
                        gchar *last_filename = jar_file_reader.get_last_filename();
 
251
                        if (last_filename == NULL)
 
252
                            break;
 
253
                        if ((c_ptr = std::strrchr(last_filename, '/')) != NULL) {
 
254
                            if (*(++c_ptr) == '\0') {
 
255
                                g_free(last_filename);
 
256
                                continue;
 
257
                            }
 
258
                        }
 
259
                    } else if (gba->len > 0) {
 
260
                        //::write(1, gba->data, gba->len);
 
261
                        /* Append to list */
 
262
                        if (ss.length >= ss.size) {
 
263
                            /* Expand */
 
264
                            ss.size <<= 1;
 
265
                            ss.slides = g_renew (char *, ss.slides, ss.size);
 
266
                        }
 
267
 
 
268
                        ss.doc = SPDocument::createNewDocFromMem ((const gchar *)gba->data,
 
269
                                           gba->len,
 
270
                                           TRUE);
 
271
                        gchar *last_filename = jar_file_reader.get_last_filename();
 
272
                        if (ss.doc) {
 
273
                            ss.slides[ss.length++] = strdup (last_filename);
 
274
                            (ss.doc)->setUri (last_filename);
 
275
                        }
 
276
                        g_byte_array_free(gba, TRUE);
 
277
                        g_free(last_filename);
 
278
                    } else {
 
279
                        break;
 
280
                    }
 
281
                }
 
282
            } else {
 
283
    #endif /* WITH_INKJAR */
 
284
            /* Append to list */
 
285
            if (ss.length >= ss.size) {
 
286
                /* Expand */
 
287
                ss.size <<= 1;
 
288
                ss.slides = g_renew (char *, ss.slides, ss.size);
 
289
            }
 
290
 
 
291
            ss.slides[ss.length++] = strdup (argv[i]);
 
292
 
 
293
            if (!ss.doc) {
 
294
                ss.doc = SPDocument::createNewDoc (ss.slides[ss.current], TRUE, false);
292
295
                if (!ss.doc) {
293
 
                    ss.doc = SPDocument::createNewDoc (ss.slides[ss.current], TRUE, false);
294
 
                    if (!ss.doc)
295
 
                        ++ss.current;
296
 
                }
297
 
#ifdef WITH_INKJAR
298
 
            }
299
 
#endif
300
 
        }
 
296
                    ++ss.current;
 
297
                }
 
298
            }
 
299
    #ifdef WITH_INKJAR
 
300
            }
 
301
    #endif
 
302
        }
301
303
    }
302
304
 
303
 
    if(!ss.doc)
 
305
    if(!ss.doc) {
304
306
       return 1; /* none of the slides loadable */
305
 
 
 
307
    }
 
308
    
306
309
    w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
307
310
    gtk_window_set_title( GTK_WINDOW(w), ss.doc->getName() );
308
311
    gtk_window_set_default_size (GTK_WINDOW (w),
309
 
                                 MIN ((int)(ss.doc)->getWidth().value("px"), (int)gdk_screen_width() - 64),
310
 
                                 MIN ((int)(ss.doc)->getHeight().value("px"), (int)gdk_screen_height() - 64));
 
312
                MIN ((int)(ss.doc)->getWidth().value("px"), (int)gdk_screen_width() - 64),
 
313
                MIN ((int)(ss.doc)->getHeight().value("px"), (int)gdk_screen_height() - 64));
311
314
    ss.window = w;
312
315
 
313
316
    g_signal_connect (G_OBJECT (w), "delete_event", (GCallback) sp_svgview_main_delete, &ss);
327
330
    return 0;
328
331
}
329
332
 
330
 
static int
331
 
sp_svgview_ctrlwin_delete (GtkWidget */*widget*/, GdkEvent */*event*/, void */*data*/)
 
333
static int sp_svgview_ctrlwin_delete (GtkWidget */*widget*/,
 
334
                                      GdkEvent */*event*/,
 
335
                                      void */*data*/)
332
336
{
333
337
    ctrlwin = NULL;
334
338
    return FALSE;
337
341
static GtkWidget* sp_svgview_control_show(struct SPSlideShow *ss)
338
342
{
339
343
    if (!ctrlwin) {
340
 
        ctrlwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 
344
        ctrlwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
341
345
        gtk_window_set_resizable(GTK_WINDOW(ctrlwin), FALSE);
342
346
        gtk_window_set_transient_for(GTK_WINDOW(ctrlwin), GTK_WINDOW(ss->window));
343
347
        g_signal_connect(G_OBJECT (ctrlwin), "key_press_event", (GCallback) sp_svgview_main_key_press, ss);
344
348
        g_signal_connect(G_OBJECT (ctrlwin), "delete_event", (GCallback) sp_svgview_ctrlwin_delete, NULL);
345
349
 
346
350
#if GTK_CHECK_VERSION(3,0,0)
347
 
        GtkWidget *t = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
 
351
        GtkWidget *t = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
348
352
#else
349
 
        GtkWidget *t = gtk_hbutton_box_new();
 
353
        GtkWidget *t = gtk_hbutton_box_new();
350
354
#endif
351
355
 
352
 
        gtk_container_add(GTK_CONTAINER(ctrlwin), t);
 
356
        gtk_container_add(GTK_CONTAINER(ctrlwin), t);
353
357
 
354
358
#if GTK_CHECK_VERSION(3,10,0)
355
359
        GtkWidget *b = gtk_button_new_from_icon_name(INKSCAPE_ICON("go-first"), GTK_ICON_SIZE_BUTTON);
356
360
#else
357
 
        GtkWidget *b   = gtk_button_new();
 
361
        GtkWidget *b   = gtk_button_new();
358
362
        GtkWidget *img = gtk_image_new_from_icon_name(INKSCAPE_ICON("go-first"), GTK_ICON_SIZE_BUTTON);
359
363
        gtk_button_set_image(GTK_BUTTON(b), img);
360
364
#endif
361
 
        gtk_container_add(GTK_CONTAINER(t), b);
 
365
        gtk_container_add(GTK_CONTAINER(t), b);
362
366
 
363
 
        g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_goto_first_cb, ss);
 
367
        g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_goto_first_cb, ss);
364
368
#if GTK_CHECK_VERSION(3,10,0)
365
369
        b = gtk_button_new_from_icon_name(INKSCAPE_ICON("go-previous"), GTK_ICON_SIZE_BUTTON);
366
370
#else
367
 
        b   = gtk_button_new();
 
371
        b = gtk_button_new();
368
372
        img = gtk_image_new_from_icon_name(INKSCAPE_ICON("go-previous"), GTK_ICON_SIZE_BUTTON);
369
373
        gtk_button_set_image(GTK_BUTTON(b), img);
370
374
#endif
371
 
        gtk_container_add(GTK_CONTAINER(t), b);
 
375
        gtk_container_add(GTK_CONTAINER(t), b);
372
376
 
373
 
        g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_prev_cb, ss);
 
377
        g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_prev_cb, ss);
374
378
#if GTK_CHECK_VERSION(3,10,0)
375
379
        b = gtk_button_new_from_icon_name(INKSCAPE_ICON("go-next"), GTK_ICON_SIZE_BUTTON);
376
380
#else
377
 
        b   = gtk_button_new();
 
381
        b = gtk_button_new();
378
382
        img = gtk_image_new_from_icon_name(INKSCAPE_ICON("go-next"), GTK_ICON_SIZE_BUTTON);
379
383
        gtk_button_set_image(GTK_BUTTON(b), img);
380
384
#endif
381
 
        gtk_container_add(GTK_CONTAINER(t), b);
 
385
        gtk_container_add(GTK_CONTAINER(t), b);
382
386
 
383
 
        g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_next_cb, ss);
 
387
        g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_next_cb, ss);
384
388
#if GTK_CHECK_VERSION(3,10,0)
385
389
        b = gtk_button_new_from_icon_name(INKSCAPE_ICON("go-last"), GTK_ICON_SIZE_BUTTON);
386
390
#else
387
 
        b   = gtk_button_new();
 
391
        b = gtk_button_new();
388
392
        img = gtk_image_new_from_icon_name(INKSCAPE_ICON("go-last"), GTK_ICON_SIZE_BUTTON);
389
393
        gtk_button_set_image(GTK_BUTTON(b), img);
390
394
#endif
391
 
        gtk_container_add(GTK_CONTAINER(t), b);
392
 
        g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_goto_last_cb, ss);
393
 
        gtk_widget_show_all(ctrlwin);
 
395
        gtk_container_add(GTK_CONTAINER(t), b);
 
396
        g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_goto_last_cb, ss);
 
397
        gtk_widget_show_all(ctrlwin);
394
398
    } else {
395
 
        gtk_window_present(GTK_WINDOW(ctrlwin));
 
399
        gtk_window_present(GTK_WINDOW(ctrlwin));
396
400
    }
397
401
 
398
402
    return NULL;
399
403
}
400
404
 
401
 
static int
402
 
sp_svgview_show_next_cb (GtkWidget */*widget*/, void *data)
 
405
static int sp_svgview_show_next_cb (GtkWidget */*widget*/, void *data)
403
406
{
404
407
    sp_svgview_show_next(static_cast<struct SPSlideShow *>(data));
405
408
    return FALSE;
406
409
}
407
410
 
408
 
static int
409
 
sp_svgview_show_prev_cb (GtkWidget */*widget*/, void *data)
 
411
static int sp_svgview_show_prev_cb (GtkWidget */*widget*/, void *data)
410
412
{
411
413
    sp_svgview_show_prev(static_cast<struct SPSlideShow *>(data));
412
414
    return FALSE;
413
415
}
414
416
 
415
 
static int
416
 
sp_svgview_goto_first_cb (GtkWidget */*widget*/, void *data)
 
417
static int sp_svgview_goto_first_cb (GtkWidget */*widget*/, void *data)
417
418
{
418
419
    sp_svgview_goto_first(static_cast<struct SPSlideShow *>(data));
419
420
    return FALSE;
420
421
}
421
422
 
422
 
static int
423
 
sp_svgview_goto_last_cb (GtkWidget */*widget*/, void *data)
 
423
static int sp_svgview_goto_last_cb (GtkWidget */*widget*/, void *data)
424
424
{
425
425
    sp_svgview_goto_last(static_cast<struct SPSlideShow *>(data));
426
426
    return FALSE;
427
427
}
428
428
 
429
 
static void
430
 
sp_svgview_waiting_cursor(struct SPSlideShow *ss)
 
429
static void sp_svgview_waiting_cursor(struct SPSlideShow *ss)
431
430
{
432
431
    GdkCursor *waiting = gdk_cursor_new(GDK_WATCH);
433
432
    gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(ss->window)), waiting);
445
444
        gdk_cursor_unref(waiting);
446
445
#endif
447
446
    }
448
 
    while(gtk_events_pending())
 
447
    while(gtk_events_pending()) {
449
448
       gtk_main_iteration();
 
449
    }
450
450
}
451
451
 
452
 
static void
453
 
sp_svgview_normal_cursor(struct SPSlideShow *ss)
 
452
static void sp_svgview_normal_cursor(struct SPSlideShow *ss)
454
453
{
455
454
   gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(ss->window)), NULL);
456
455
    if (ctrlwin) {
458
457
    }
459
458
}
460
459
 
461
 
static void
462
 
sp_svgview_set_document(struct SPSlideShow *ss, SPDocument *doc, int current)
 
460
static void sp_svgview_set_document(struct SPSlideShow *ss,
 
461
                                    SPDocument *doc,
 
462
                                    int current)
463
463
{
464
464
    if (doc && doc != ss->doc) {
465
465
        doc->ensureUpToDate();
469
469
    }
470
470
}
471
471
 
472
 
static void
473
 
sp_svgview_show_next (struct SPSlideShow *ss)
 
472
static void sp_svgview_show_next (struct SPSlideShow *ss)
474
473
{
475
474
    sp_svgview_waiting_cursor(ss);
476
475
 
485
484
    sp_svgview_normal_cursor(ss);
486
485
}
487
486
 
488
 
static void
489
 
sp_svgview_show_prev (struct SPSlideShow *ss)
 
487
static void sp_svgview_show_prev (struct SPSlideShow *ss)
490
488
{
491
489
    sp_svgview_waiting_cursor(ss);
492
490
 
501
499
    sp_svgview_normal_cursor(ss);
502
500
}
503
501
 
504
 
static void
505
 
sp_svgview_goto_first (struct SPSlideShow *ss)
 
502
static void sp_svgview_goto_first (struct SPSlideShow *ss)
506
503
{
507
504
    sp_svgview_waiting_cursor(ss);
508
505
 
509
506
    SPDocument *doc = NULL;
510
507
    int current = 0;
511
508
    while ( !doc && (current < ss->length - 1)) {
512
 
        if (current == ss->current)
 
509
        if (current == ss->current) {
513
510
            break;
 
511
        }
514
512
        doc = SPDocument::createNewDoc (ss->slides[current++], TRUE, false);
515
513
    }
516
514
 
519
517
    sp_svgview_normal_cursor(ss);
520
518
}
521
519
 
522
 
static void
523
 
sp_svgview_goto_last (struct SPSlideShow *ss)
 
520
static void sp_svgview_goto_last (struct SPSlideShow *ss)
524
521
{
525
522
    sp_svgview_waiting_cursor(ss);
526
523
 
527
524
    SPDocument *doc = NULL;
528
525
    int current = ss->length - 1;
529
526
    while (!doc && (current >= 0)) {
530
 
        if (current == ss->current)
 
527
        if (current == ss->current) {
531
528
            break;
 
529
        }
532
530
        doc = SPDocument::createNewDoc (ss->slides[current--], TRUE, false);
533
531
    }
534
532
 
538
536
}
539
537
 
540
538
#ifdef WITH_INKJAR
541
 
static bool
542
 
is_jar(char const *filename)
 
539
static bool is_jar(char const *filename)
543
540
{
544
541
    /* fixme: Check MIME type or something.  /usr/share/misc/file/magic suggests that checking for
545
542
       initial string "PK\003\004" in content should suffice. */
556
553
static void usage()
557
554
{
558
555
    fprintf(stderr,
559
 
            "Usage: inkview [OPTIONS...] [FILES ...]\n"
560
 
            "\twhere FILES are SVG (.svg or .svgz)"
 
556
        "Usage: inkview [OPTIONS...] [FILES ...]\n"
 
557
        "\twhere FILES are SVG (.svg or .svgz)"
561
558
#ifdef WITH_INKJAR
562
 
            " or archives of SVGs (.sxw, .jar)"
 
559
        " or archives of SVGs (.sxw, .jar)"
563
560
#endif
564
 
            "\n");
 
561
        "\n");
565
562
    exit(1);
566
563
}
567
564