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