gint
main (gint   argc,
      gchar *argv[])
{
  g_autoptr(GOptionContext) context = NULL;
  g_autoptr(GError) error = NULL;
  g_autoptr(GFile) project_file = NULL;
  const gchar *project_path = ".";

  ide_set_program_name ("gnome-builder");
  g_set_prgname ("ide-list-devices");

  ide_log_init (TRUE, NULL);

  gtk_init (&argc, &argv);

  context = g_option_context_new (_("- List devices found on the system."));

  if (!g_option_context_parse (context, &argc, &argv, &error))
    {
      g_printerr ("%s\n", error->message);
      return EXIT_FAILURE;
    }

  gMainLoop = g_main_loop_new (NULL, FALSE);

  if (argc > 1)
    project_path = argv [1];
  project_file = g_file_new_for_path (project_path);

  gb_plugins_init ();

  ide_context_new_async (project_file, NULL, context_cb, NULL);

  g_main_loop_run (gMainLoop);
  g_clear_pointer (&gMainLoop, g_main_loop_unref);

  return gExitCode;
}
示例#2
0
int
main (int   argc,
      char *argv[])
{
    IdeApplication *app;
    int ret;

    ide_log_init (TRUE, NULL);

    g_message ("Initializing with Gtk+ version %d.%d.%d.",
               gtk_get_major_version (),
               gtk_get_minor_version (),
               gtk_get_micro_version ());

    app = ide_application_new ();
    ret = g_application_run (G_APPLICATION (app), argc, argv);
    g_clear_object (&app);

    ide_log_shutdown ();

    return ret;
}
示例#3
0
int
main (int   argc,
      char *argv[])
{
  GApplication *app;
  int ret;

  setlocale (LC_ALL, "");

  bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
  textdomain (GETTEXT_PACKAGE);

  g_set_prgname (PACKAGE_TARNAME);
  g_set_application_name (_("Builder"));

  ide_set_program_name ("gnome-builder");

  ide_log_init (TRUE, NULL);

  g_message ("Initializing with Gtk+ version %d.%d.%d.",
             gtk_get_major_version (),
             gtk_get_minor_version (),
             gtk_get_micro_version ());

  g_resources_register (gb_icons_get_resource ());

  app = g_object_new (GB_TYPE_APPLICATION,
                      "application-id", "org.gnome.Builder",
                      "flags", G_APPLICATION_HANDLES_OPEN,
                      NULL);
  ret = g_application_run (app, argc, argv);
  g_clear_object (&app);

  ide_log_shutdown ();

  return ret;
}
示例#4
0
int
main (int    argc,
      gchar *argv[])
{
  static const GOptionEntry entries[] = {
    { "verbose", 'v', G_OPTION_FLAG_NO_ARG|G_OPTION_FLAG_IN_MAIN,
      G_OPTION_ARG_CALLBACK, verbose_cb },
    { NULL }
  };
  IdeProjectMiner *miner;
  GOptionContext *context;
  GMainLoop *main_loop;
  GError *error = NULL;

  ide_log_init (TRUE, NULL);

  context = g_option_context_new (_("- discover projects"));
  g_option_context_add_main_entries (context, entries, NULL);

  if (!g_option_context_parse (context, &argc, &argv, &error))
    {
      g_printerr ("%s\n", error->message);
      return EXIT_FAILURE;
    }

  miner = g_object_new (IDE_TYPE_AUTOTOOLS_PROJECT_MINER,
                        "root-directory", NULL,
                        NULL);
  g_signal_connect (miner, "discovered", G_CALLBACK (discovered_cb), NULL);
  main_loop = g_main_loop_new (NULL, FALSE);
  ide_project_miner_mine_async (miner, NULL, mine_cb, main_loop);
  g_main_loop_run (main_loop);
  g_main_loop_unref (main_loop);

  ide_log_shutdown ();

  return 0;
}