/* GIMP - The GNU Image Manipulation Program
 * Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

/* NOTE: This file is auto-generated by pdbgen.pl. */

#include "config.h"

#include "stamp-pdbgen.h"

#include <gegl.h>

#include <gdk-pixbuf/gdk-pixbuf.h>

#include "libgimpbase/gimpbase.h"

#include "pdb-types.h"

#include "core/gimpparamspecs.h"

#include "gimppdb.h"
#include "gimpprocedure.h"
#include "internal-procs.h"


static GimpValueArray *
plug_in_web_browser_invoker (GimpProcedure         *procedure,
                             Gimp                  *gimp,
                             GimpContext           *context,
                             GimpProgress          *progress,
                             const GimpValueArray  *args,
                             GError               **error)
{
  gboolean success = TRUE;
  const gchar *url;

  url = g_value_get_string (gimp_value_array_index (args, 0));

  if (success)
    {
      success = g_app_info_launch_default_for_uri (url, NULL, error);
    }

  return gimp_procedure_get_return_values (procedure, success,
                                           error ? *error : NULL);
}

static GimpValueArray *
gimp_online_main_web_site_invoker (GimpProcedure         *procedure,
                                   Gimp                  *gimp,
                                   GimpContext           *context,
                                   GimpProgress          *progress,
                                   const GimpValueArray  *args,
                                   GError               **error)
{
  gboolean success = TRUE;
  if (success)
    {
      success = g_app_info_launch_default_for_uri ("https://www.gimp.org/", NULL, error);
    }
  return gimp_procedure_get_return_values (procedure, success,
                                           error ? *error : NULL);
}

static GimpValueArray *
gimp_online_docs_web_site_invoker (GimpProcedure         *procedure,
                                   Gimp                  *gimp,
                                   GimpContext           *context,
                                   GimpProgress          *progress,
                                   const GimpValueArray  *args,
                                   GError               **error)
{
  gboolean success = TRUE;
  if (success)
    {
      success = g_app_info_launch_default_for_uri ("https://docs.gimp.org/", NULL, error);
    }
  return gimp_procedure_get_return_values (procedure, success,
                                           error ? *error : NULL);
}

static GimpValueArray *
gimp_online_bugs_features_invoker (GimpProcedure         *procedure,
                                   Gimp                  *gimp,
                                   GimpContext           *context,
                                   GimpProgress          *progress,
                                   const GimpValueArray  *args,
                                   GError               **error)
{
  gboolean success = TRUE;
  if (success)
    {
      success = g_app_info_launch_default_for_uri ("https://gitlab.gnome.org/GNOME/gimp/issues", NULL, error);
    }
  return gimp_procedure_get_return_values (procedure, success,
                                           error ? *error : NULL);
}

static GimpValueArray *
gimp_online_developer_web_site_invoker (GimpProcedure         *procedure,
                                        Gimp                  *gimp,
                                        GimpContext           *context,
                                        GimpProgress          *progress,
                                        const GimpValueArray  *args,
                                        GError               **error)
{
  gboolean success = TRUE;
  if (success)
    {
      success = g_app_info_launch_default_for_uri ("https://developer.gimp.org/", NULL, error);
    }
  return gimp_procedure_get_return_values (procedure, success,
                                           error ? *error : NULL);
}

static GimpValueArray *
gimp_online_roadmap_invoker (GimpProcedure         *procedure,
                             Gimp                  *gimp,
                             GimpContext           *context,
                             GimpProgress          *progress,
                             const GimpValueArray  *args,
                             GError               **error)
{
  gboolean success = TRUE;
  if (success)
    {
      success = g_app_info_launch_default_for_uri ("https://developer.gimp.org/core/roadmap/", NULL, error);
    }
  return gimp_procedure_get_return_values (procedure, success,
                                           error ? *error : NULL);
}

void
register_plug_in_compat_procs (GimpPDB *pdb)
{
  GimpProcedure *procedure;

  /*
   * gimp-plug-in-web-browser
   */
  procedure = gimp_procedure_new (plug_in_web_browser_invoker, FALSE);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "plug-in-web-browser");
  gimp_procedure_set_static_help (procedure,
                                  "Open a URI",
                                  "Open a URI in the user specified software.\n"
                                  "\n"
                                  "For instance, a HTTP URI should open your default web browser.\n"
                                  "\n"
                                  "This PDB procedure is deprecated without any replacement because you should not need a PDB procedure to open a given URI in your browser.\n"
                                  "Instead use the GLib function `g_app_info_launch_default_for_uri()`, or again the GTK function `gtk_show_uri_on_window()`.\n"
                                  "In Script-Fu, you may use `(gimp-show-uri)`.\n"
                                  "\n"
                                  "Deprecated: There is no replacement for this procedure.",
                                  NULL);
  gimp_procedure_set_static_attribution (procedure,
                                         "Spencer Kimball & Peter Mattis",
                                         "Spencer Kimball & Peter Mattis",
                                         "2003-09-16");
  gimp_procedure_set_deprecated (procedure,
                                 "NONE");
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_string ("url",
                                                       "url",
                                                       "URI to open",
                                                       FALSE, FALSE, FALSE,
                                                       NULL,
                                                       GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-gimp-online-main-web-site
   */
  procedure = gimp_procedure_new (gimp_online_main_web_site_invoker, FALSE);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-online-main-web-site");
  gimp_procedure_set_static_help (procedure,
                                  "Main Web Site",
                                  "Bookmark to the GIMP web site\n"
                                  "\n"
                                  "Deprecated: Use plug_in_web_browser() instead.",
                                  NULL);
  gimp_procedure_set_static_attribution (procedure,
                                         "Spencer Kimball & Peter Mattis",
                                         "Spencer Kimball & Peter Mattis",
                                         "2003");
  gimp_procedure_set_deprecated (procedure,
                                 "plug-in-web-browser");
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("run-mode",
                                                  "run mode",
                                                  "The run mode",
                                                  GIMP_TYPE_RUN_MODE,
                                                  GIMP_RUN_INTERACTIVE,
                                                  GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-gimp-online-docs-web-site
   */
  procedure = gimp_procedure_new (gimp_online_docs_web_site_invoker, FALSE);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-online-docs-web-site");
  gimp_procedure_set_static_help (procedure,
                                  "User Manual Web Site",
                                  "Bookmark to the GIMP Documentation web site\n"
                                  "\n"
                                  "Deprecated: Use plug_in_web_browser() instead.",
                                  NULL);
  gimp_procedure_set_static_attribution (procedure,
                                         "Spencer Kimball & Peter Mattis",
                                         "Spencer Kimball & Peter Mattis",
                                         "2006");
  gimp_procedure_set_deprecated (procedure,
                                 "plug-in-web-browser");
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("run-mode",
                                                  "run mode",
                                                  "The run mode",
                                                  GIMP_TYPE_RUN_MODE,
                                                  GIMP_RUN_INTERACTIVE,
                                                  GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-gimp-online-bugs-features
   */
  procedure = gimp_procedure_new (gimp_online_bugs_features_invoker, FALSE);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-online-bugs-features");
  gimp_procedure_set_static_help (procedure,
                                  "Bug Tracker",
                                  "Bookmark to the bug tracker of GIMP\n"
                                  "\n"
                                  "Deprecated: Use plug_in_web_browser() instead.",
                                  NULL);
  gimp_procedure_set_static_attribution (procedure,
                                         "Spencer Kimball & Peter Mattis",
                                         "Spencer Kimball & Peter Mattis",
                                         "2018");
  gimp_procedure_set_deprecated (procedure,
                                 "plug-in-web-browser");
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("run-mode",
                                                  "run mode",
                                                  "The run mode",
                                                  GIMP_TYPE_RUN_MODE,
                                                  GIMP_RUN_INTERACTIVE,
                                                  GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-gimp-online-developer-web-site
   */
  procedure = gimp_procedure_new (gimp_online_developer_web_site_invoker, FALSE);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-online-developer-web-site");
  gimp_procedure_set_static_help (procedure,
                                  "Bug Tracker",
                                  "Bookmark to the bug tracker of GIMP\n"
                                  "\n"
                                  "Deprecated: Use plug_in_web_browser() instead.",
                                  NULL);
  gimp_procedure_set_static_attribution (procedure,
                                         "Spencer Kimball & Peter Mattis",
                                         "Spencer Kimball & Peter Mattis",
                                         "2003");
  gimp_procedure_set_deprecated (procedure,
                                 "plug-in-web-browser");
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("run-mode",
                                                  "run mode",
                                                  "The run mode",
                                                  GIMP_TYPE_RUN_MODE,
                                                  GIMP_RUN_INTERACTIVE,
                                                  GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-gimp-online-roadmap
   */
  procedure = gimp_procedure_new (gimp_online_roadmap_invoker, FALSE);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-online-roadmap");
  gimp_procedure_set_static_help (procedure,
                                  "Roadmaps",
                                  "Bookmark to the roadmaps of GIMP\n"
                                  "\n"
                                  "Deprecated: Use plug_in_web_browser() instead.",
                                  NULL);
  gimp_procedure_set_static_attribution (procedure,
                                         "Spencer Kimball & Peter Mattis",
                                         "Spencer Kimball & Peter Mattis",
                                         "2018");
  gimp_procedure_set_deprecated (procedure,
                                 "plug-in-web-browser");
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("run-mode",
                                                  "run mode",
                                                  "The run mode",
                                                  GIMP_TYPE_RUN_MODE,
                                                  GIMP_RUN_INTERACTIVE,
                                                  GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);
}
