Ticket #45309: main.c

File main.c, 1.8 KB (added by dtakahashi@…, 10 years ago)

modified main.c of the gimp-2.8.14

Line 
1/* GIMP - The GNU Image Manipulation Program
2 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include <stdio.h>
19#include <stdlib.h>
20
21#include <glib-object.h>
22
23#include <gio/gio.h>
24#include <gegl.h>
25
26int
27main (int    argc,
28      char **argv)
29{
30  GOptionContext *context;
31  GError         *error1 = NULL;
32  GError         *error2 = NULL;
33  GDBusConnection *connection;
34
35printf("%s: %d\n", __FILE__, __LINE__);
36  g_thread_init (NULL);
37
38printf("%s: %d\n", __FILE__, __LINE__);
39  context = g_option_context_new ("[FILE|URI...]");
40
41printf("%s: %d\n", __FILE__, __LINE__);
42  g_type_init ();
43
44printf("%s: %d\n", __FILE__, __LINE__);
45  g_option_context_add_group (context, gegl_get_option_group ());
46
47printf("%s: %d\n", __FILE__, __LINE__);
48  g_option_context_parse_strv (context, &argv, &error1);
49
50  if (error1) printf("%s: %d: %s\n", __FILE__, __LINE__, error1->message);
51
52printf("%s: %d\n", __FILE__, __LINE__);
53  connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error2);
54printf("%s: %d: connection = %d\n", __FILE__, __LINE__, connection != 0);
55
56  if (error2) printf("%s: %d: %s\n", __FILE__, __LINE__, error2->message);
57
58printf("%s: %d\n", __FILE__, __LINE__);
59  g_option_context_free (context);
60
61  return EXIT_SUCCESS;
62}