cropper
annotate main.c @ 4:2f11ab3e6047
added option handling; added output for convert; commented all ratio code cause it is not really important now
author | meillo@marmaro.de |
---|---|
date | Fri, 07 Dec 2007 17:40:08 +0100 |
parents | e359bea4c8ac |
children | 61e5a1727231 |
rev | line source |
---|---|
meillo@0 | 1 #include <gtk/gtk.h> |
meillo@0 | 2 |
meillo@2 | 3 #include "main.h" |
meillo@0 | 4 #include "interface.h" |
meillo@0 | 5 #include "support.h" |
meillo@0 | 6 |
meillo@2 | 7 |
meillo@1 | 8 int main (int argc, char *argv[]) { |
meillo@0 | 9 |
meillo@4 | 10 /* printf("argc: %i\nargv[0]: %s\nargv[1]: %s\nargv[2]: %s\n", argc, argv[0], argv[1], argv[2]); */ |
meillo@4 | 11 |
meillo@4 | 12 /* commandline option handling */ |
meillo@4 | 13 if (argc == 2) { |
meillo@4 | 14 if (strcmp(argv[1], "--version") == 0) { |
meillo@4 | 15 g_print("cropper - a crop frontend for convert\nversion 0.1\nhttp://prog.marmaro.de\n"); |
meillo@4 | 16 return(0); |
meillo@4 | 17 } else { |
meillo@4 | 18 image_filename = argv[1]; |
meillo@4 | 19 } |
meillo@4 | 20 } else { |
meillo@4 | 21 g_print("usage: %s <image>\n", argv[0]); |
meillo@4 | 22 return(1); |
meillo@4 | 23 } |
meillo@4 | 24 |
meillo@4 | 25 |
meillo@4 | 26 |
meillo@0 | 27 gtk_set_locale (); |
meillo@0 | 28 gtk_init (&argc, &argv); |
meillo@0 | 29 |
meillo@0 | 30 add_pixmap_directory ("/usr/share/pixmaps"); |
meillo@0 | 31 |
meillo@0 | 32 cropper_window = create_cropper_window (); |
meillo@0 | 33 gtk_widget_show (cropper_window); |
meillo@0 | 34 |
meillo@0 | 35 gtk_main (); |
meillo@0 | 36 return 0; |
meillo@0 | 37 } |
meillo@0 | 38 |