Mercurial > geeqie
comparison src/main.c @ 3:c0e337a01cb7
0.8.0
author | gqview |
---|---|
date | Thu, 13 Apr 2000 12:55:19 +0000 |
parents | b3e0e515fabf |
children | d907d608745f |
comparison
equal
deleted
inserted
replaced
2:0591360d4e38 | 3:c0e337a01cb7 |
---|---|
1 /* | 1 /* |
2 * GQview image viewer | 2 * GQview image viewer |
3 * (C)1999 John Ellis | 3 * (C)2000 John Ellis |
4 * | 4 * |
5 * Author: John Ellis | 5 * Author: John Ellis |
6 * | 6 * |
7 */ | 7 */ |
8 | 8 |
256 return stop_signal; | 256 return stop_signal; |
257 } | 257 } |
258 | 258 |
259 /* | 259 /* |
260 *----------------------------------------------------------------------------- | 260 *----------------------------------------------------------------------------- |
261 * command line parser (private) | 261 * command line parser (private) hehe, who needs popt anyway? |
262 *----------------------------------------------------------------------------- | 262 *----------------------------------------------------------------------------- |
263 */ | 263 */ |
264 | |
265 static gint startup_full_screen = FALSE; | |
266 static gint startup_in_slideshow = FALSE; | |
264 | 267 |
265 static void parse_command_line(int argc, char *argv[], gchar **path, gchar **file) | 268 static void parse_command_line(int argc, char *argv[], gchar **path, gchar **file) |
266 { | 269 { |
267 if (argc > 1) | 270 if (argc > 1) |
268 { | 271 { |
292 { | 295 { |
293 g_free(*path); | 296 g_free(*path); |
294 *path = remove_level_from_path(cmd_all); | 297 *path = remove_level_from_path(cmd_all); |
295 *file = g_strdup(cmd_all); | 298 *file = g_strdup(cmd_all); |
296 } | 299 } |
297 else if (strcmp(cmd_line, "-debug") == 0) | 300 else if (strcmp(cmd_line, "--debug") == 0) |
298 { | 301 { |
299 debug = TRUE; | 302 debug = TRUE; |
300 printf("debugging output enabled\n"); | 303 printf("debugging output enabled\n"); |
301 } | 304 } |
302 else if (strcmp(cmd_line, "+t") == 0 || | 305 else if (strcmp(cmd_line, "+t") == 0 || |
303 strcmp(cmd_line, "+tools") == 0) | 306 strcmp(cmd_line, "--with-tools") == 0) |
304 { | 307 { |
305 tools_float = FALSE; | 308 tools_float = FALSE; |
306 tools_hidden = FALSE; | 309 tools_hidden = FALSE; |
307 } | 310 } |
308 else if (strcmp(cmd_line, "-t") == 0 || | 311 else if (strcmp(cmd_line, "-t") == 0 || |
309 strcmp(cmd_line, "-tools") == 0) | 312 strcmp(cmd_line, "--without-tools") == 0) |
310 { | 313 { |
311 tools_hidden = TRUE; | 314 tools_hidden = TRUE; |
312 } | 315 } |
313 else if (strcmp(cmd_line, "-help") == 0) | 316 else if (strcmp(cmd_line, "-f") == 0 || |
317 strcmp(cmd_line, "--fullscreen") == 0) | |
318 { | |
319 startup_full_screen = TRUE; | |
320 } | |
321 else if (strcmp(cmd_line, "-s") == 0 || | |
322 strcmp(cmd_line, "--slideshow") == 0) | |
323 { | |
324 startup_in_slideshow = TRUE; | |
325 } | |
326 else if (strcmp(cmd_line, "-h") == 0 || | |
327 strcmp(cmd_line, "--help") == 0) | |
314 { | 328 { |
315 printf("GQview version %s\n", VERSION); | 329 printf("GQview version %s\n", VERSION); |
316 printf(_("Usage: gqview [options] [path]\n\n")); | 330 printf(_("Usage: gqview [options] [path]\n\n")); |
317 printf(_("valid options are:\n")); | 331 printf(_("valid options are:\n")); |
318 printf(_(" +t, +tools force show of tools\n")); | 332 printf(_(" +t, --with-tools force show of tools\n")); |
319 printf(_(" -t, -tools force hide of tools\n")); | 333 printf(_(" -t, --without-tools force hide of tools\n")); |
320 printf(_(" -debug turn on debug output\n")); | 334 printf(_(" -f, --fullscreen start in full screen mode\n")); |
321 printf(_(" -help this message\n\n")); | 335 printf(_(" -s, --slideshow start in slideshow mode\n")); |
336 printf(_(" --debug turn on debug output\n")); | |
337 printf(_(" -h, --help show this message\n\n")); | |
322 exit (0); | 338 exit (0); |
323 } | 339 } |
324 else | 340 else |
325 { | 341 { |
326 printf(_("invalid or ignored: %s\nUse -help for options\n"), cmd_line); | 342 printf(_("invalid or ignored: %s\nUse -help for options\n"), cmd_line); |
427 image_change_to(cmd_file); | 443 image_change_to(cmd_file); |
428 | 444 |
429 g_free(cmd_path); | 445 g_free(cmd_path); |
430 g_free(cmd_file); | 446 g_free(cmd_file); |
431 | 447 |
448 if (startup_full_screen) full_screen_toggle(); | |
449 if (startup_in_slideshow) slideshow_start(); | |
450 | |
432 gtk_main (); | 451 gtk_main (); |
433 return 0; | 452 return 0; |
434 } | 453 } |
435 | 454 |
436 | 455 |