annotate main.c @ 9:7e1cf00de1df

completely refactored makefile; removed interface.h
author meillo@marmaro.de
date Thu, 20 Mar 2008 20:01:38 +0100
parents 61e5a1727231
children 5e282003f0c1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
1 #include <gtk/gtk.h>
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
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
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
4 #include "support.h"
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
5
2
e359bea4c8ac added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents: 1
diff changeset
6
1
80535e4deaa4 nicer code formating
meillo@marmaro.de
parents: 0
diff changeset
7 int main (int argc, char *argv[]) {
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
8
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
9 /* 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
10
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 /* 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
12 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
13 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
14 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
15 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
16 } 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
17 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
18 }
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 } else {
5
61e5a1727231 added image widget, that displays the image
meillo@marmaro.de
parents: 4
diff changeset
20 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
21 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
22 }
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
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
26 gtk_set_locale ();
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
27 gtk_init (&argc, &argv);
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
28
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
29 add_pixmap_directory ("/usr/share/pixmaps");
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
30
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
31 cropper_window = create_cropper_window ();
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
32 gtk_widget_show (cropper_window);
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
33
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
34 gtk_main ();
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
35 return 0;
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
36 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
37