コード例 #1
0
ファイル: print.c プロジェクト: jdburton/gimp-osx
static gchar *
print_temp_proc_install (gint32  image_ID)
{
  static const GimpParamDef args[] =
  {
    { GIMP_PDB_IMAGE, "image", "Image to print" }
  };

  gchar *name = print_temp_proc_name (image_ID);

  gimp_install_temp_proc (name,
                          "DON'T USE THIS ONE",
                          "Temporary procedure to notify the Print plug-in "
                          "about changes to the Page Setup.",
			  "Sven Neumann",
			  "Sven Neumann",
			  "2008",
                          NULL,
                          "",
                          GIMP_TEMPORARY,
                          G_N_ELEMENTS (args), 0, args, NULL,
                          print_temp_proc_run);

  return name;
}
コード例 #2
0
ファイル: help.c プロジェクト: jdburton/gimp-osx
static void
temp_proc_install (void)
{
  static const GimpParamDef args[] =
  {
    { GIMP_PDB_STRING, "procedure",    "The procedure of the browser to use" },
    { GIMP_PDB_STRING, "help-domain",  "Help domain to use" },
    { GIMP_PDB_STRING, "help-locales", "Language to use"    },
    { GIMP_PDB_STRING, "help-id",      "Help ID to open"    }
  };

  gimp_install_temp_proc (GIMP_HELP_TEMP_EXT_PROC,
                          "DON'T USE THIS ONE",
                          "(Temporary procedure)",
			  "Sven Neumann <*****@*****.**>, "
			  "Michael Natterer <*****@*****.**>"
                          "Henrik Brix Andersen <*****@*****.**",
			  "Sven Neumann, Michael Natterer & Henrik Brix Andersen",
			  "1999-2008",
                          NULL,
                          "",
                          GIMP_TEMPORARY,
                          G_N_ELEMENTS (args), 0,
                          args, NULL,
                          temp_proc_run);
}
コード例 #3
0
ファイル: gimpfontselect.c プロジェクト: jiapei100/gimp
const gchar *
gimp_font_select_new (const gchar         *title,
                      const gchar         *font_name,
                      GimpRunFontCallback  callback,
                      gpointer             data)
{
  static const GimpParamDef args[] =
  {
    { GIMP_PDB_STRING, "str",           "String"                     },
    { GIMP_PDB_INT32,  "dialog status", "If the dialog was closing "
                                        "[0 = No, 1 = Yes]"          }
  };

  gchar *font_callback = gimp_procedural_db_temp_name ();

  gimp_install_temp_proc (font_callback,
                          "Temporary font popup callback procedure",
                          "",
                          "",
                          "",
                          "",
                          NULL,
                          "",
                          GIMP_TEMPORARY,
                          G_N_ELEMENTS (args), 0,
                          args, NULL,
                          gimp_temp_font_run);

  if (gimp_fonts_popup (font_callback, title, font_name))
    {
      GimpFontData *font_data;

      gimp_extension_enable (); /* Allow callbacks to be watched */

      /* Now add to hash table so we can find it again */
      if (! gimp_font_select_ht)
        {
          gimp_font_select_ht =
            g_hash_table_new_full (g_str_hash, g_str_equal,
                                   g_free,
                                   (GDestroyNotify) gimp_font_data_free);
        }

      font_data = g_slice_new0 (GimpFontData);

      font_data->font_callback = font_callback;
      font_data->callback      = callback;
      font_data->data          = data;

      g_hash_table_insert (gimp_font_select_ht, font_callback, font_data);

      return font_callback;
    }

  gimp_uninstall_temp_proc (font_callback);
  g_free (font_callback);

  return NULL;
}
コード例 #4
0
ファイル: script-fu.c プロジェクト: jiapei100/gimp
static void
script_fu_extension_init (void)
{
  static const GimpParamDef args[] =
  {
    { GIMP_PDB_INT32, "run-mode", "[Interactive], non-interactive" }
  };

  gimp_plugin_menu_branch_register ("<Image>/Help", N_("_GIMP Online"));
  gimp_plugin_menu_branch_register ("<Image>/Help", N_("_User Manual"));

  gimp_plugin_menu_branch_register ("<Image>/Filters/Languages",
                                    N_("_Script-Fu"));
  gimp_plugin_menu_branch_register ("<Image>/Filters/Languages/Script-Fu",
                                    N_("_Test"));

  gimp_plugin_menu_branch_register ("<Image>/File/Create",
                                    N_("_Buttons"));
  gimp_plugin_menu_branch_register ("<Image>/File/Create",
                                    N_("_Logos"));
  gimp_plugin_menu_branch_register ("<Image>/File/Create",
                                    N_("_Patterns"));

  gimp_plugin_menu_branch_register ("<Image>/File/Create",
                                    N_("_Web Page Themes"));
  gimp_plugin_menu_branch_register ("<Image>/File/Create/Web Page Themes",
                                    N_("_Alien Glow"));
  gimp_plugin_menu_branch_register ("<Image>/File/Create/Web Page Themes",
                                    N_("_Beveled Pattern"));
  gimp_plugin_menu_branch_register ("<Image>/File/Create/Web Page Themes",
                                    N_("_Classic.Gimp.Org"));

  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("Alpha to _Logo"));

  gimp_install_temp_proc ("script-fu-refresh",
                          N_("Re-read all available Script-Fu scripts"),
                          "Re-read all available Script-Fu scripts",
                          "Spencer Kimball & Peter Mattis",
                          "Spencer Kimball & Peter Mattis",
                          "1997",
                          N_("_Refresh Scripts"),
                          NULL,
                          GIMP_TEMPORARY,
                          G_N_ELEMENTS (args), 0,
                          args, NULL,
                          script_fu_refresh_proc);

  gimp_plugin_menu_register ("script-fu-refresh",
                             "<Image>/Filters/Languages/Script-Fu");
}
コード例 #5
0
ファイル: script-fu.c プロジェクト: Minoos/gimp
static void
script_fu_extension_init (void)
{
  static const GimpParamDef args[] =
  {
    { GIMP_PDB_INT32, "run-mode", "[Interactive], non-interactive" }
  };

  gimp_plugin_menu_branch_register ("<Toolbox>/Help", N_("_GIMP Online"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Help", N_("_User Manual"));

  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Languages",
                                    N_("_Script-Fu"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
                                    N_("_Buttons"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
                                    N_("_Logos"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
                                    N_("_Misc"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
                                    N_("_Patterns"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Languages/Script-Fu",
                                    N_("_Test"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
                                    N_("_Utilities"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns",
                                    N_("_Web Page Themes"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Web Page Themes",
                                    N_("_Alien Glow"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Web Page Themes",
                                    N_("_Beveled Pattern"));
  gimp_plugin_menu_branch_register ("<Toolbox>/Xtns/Web Page Themes",
                                    N_("_Classic.Gimp.Org"));

  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("Alpha to _Logo"));
  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("An_imation"));
  gimp_plugin_menu_branch_register ("<Image>/Filters/Animation",
                                    N_("_Animators"));
  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("_Artistic"));
  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("_Blur"));
  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("_Decor"));
  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("_Effects"));
  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("En_hance"));
  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("_Light and Shadow"));
  gimp_plugin_menu_branch_register ("<Image>/Filters/Light and Shadow",
                                    N_("S_hadow"));
  gimp_plugin_menu_branch_register ("<Image>/Filters",
                                    N_("_Render"));
  gimp_plugin_menu_branch_register ("<Image>/Filters/Effects",
                                    N_("_Alchemy"));

  gimp_install_temp_proc ("script-fu-refresh",
                          N_("Re-read all available Script-Fu scripts"),
                          "Re-read all available Script-Fu scripts",
                          "Spencer Kimball & Peter Mattis",
                          "Spencer Kimball & Peter Mattis",
                          "1997",
                          N_("_Refresh Scripts"),
                          NULL,
                          GIMP_TEMPORARY,
                          G_N_ELEMENTS (args), 0,
                          args, NULL,
                          script_fu_refresh_proc);

  gimp_plugin_menu_register ("script-fu-refresh",
                             "<Toolbox>/Xtns/Languages/Script-Fu");
}
コード例 #6
0
/**
 * gimp_progress_install_vtable:
 * @vtable:    a pointer to a @GimpProgressVtable.
 * @user_data: a pointer that is passed as user_data to all vtable functions.
 *
 * Return value: the name of the temporary procedure that's been installed
 *
 * Since: GIMP 2.4
 **/
const gchar *
gimp_progress_install_vtable (const GimpProgressVtable *vtable,
                              gpointer                  user_data)
{
  static const GimpParamDef args[] =
  {
    { GIMP_PDB_INT32,  "command", "" },
    { GIMP_PDB_STRING, "text",    "" },
    { GIMP_PDB_FLOAT,  "value",   "" }
  };

  static const GimpParamDef values[] =
  {
    { GIMP_PDB_FLOAT,  "value",   "" }
  };

  gchar *progress_callback;

  g_return_val_if_fail (vtable != NULL, NULL);
  g_return_val_if_fail (vtable->start != NULL, NULL);
  g_return_val_if_fail (vtable->end != NULL, NULL);
  g_return_val_if_fail (vtable->set_text != NULL, NULL);
  g_return_val_if_fail (vtable->set_value != NULL, NULL);

  progress_callback = gimp_procedural_db_temp_name ();

  gimp_install_temp_proc (progress_callback,
                          "Temporary progress callback procedure",
                          "",
                          "",
                          "",
                          "",
                          NULL,
                          "",
                          GIMP_TEMPORARY,
                          G_N_ELEMENTS (args), G_N_ELEMENTS (values),
                          args, values,
                          gimp_temp_progress_run);

  if (_gimp_progress_install (progress_callback))
    {
      GimpProgressData *progress_data;

      gimp_extension_enable (); /* Allow callbacks to be watched */

      /* Now add to hash table so we can find it again */
      if (! gimp_progress_ht)
        {
          gimp_progress_ht =
            g_hash_table_new_full (g_str_hash, g_str_equal,
                                   g_free,
                                   (GDestroyNotify) gimp_progress_data_free);
        }

      progress_data = g_slice_new0 (GimpProgressData);

      progress_data->progress_callback = progress_callback;
      progress_data->vtable.start      = vtable->start;
      progress_data->vtable.end        = vtable->end;
      progress_data->vtable.set_text   = vtable->set_text;
      progress_data->vtable.set_value  = vtable->set_value;
      progress_data->vtable.pulse      = vtable->pulse;
      progress_data->vtable.get_window = vtable->get_window;
      progress_data->data              = user_data;

      g_hash_table_insert (gimp_progress_ht, progress_callback, progress_data);

      return progress_callback;
    }

  gimp_uninstall_temp_proc (progress_callback);
  g_free (progress_callback);

  return NULL;
}