drop the restriction that plug-ins registered in <Image> must have

2005-09-26  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-in-params.c (plug_in_proc_args_check): drop the
	restriction that plug-ins registered in <Image> must have
	RUN-MODE, IMAGE, DRAWABLE parameters because everything but
	RUN-MODE is actually treated as optional be the rest of the code.

	* plug-ins/script-fu/scripts/paste-as-brush.scm
	* plug-ins/script-fu/scripts/paste-as-pattern.scm: removed IMAGE
	and DRAWABLE parameters.

	* plug-ins/common/screenshot.c
	* plug-ins/twain/twain.c
	* plug-ins/winsnap/winsnap.c: register menu entries in
	<Image>/File/Acquire
This commit is contained in:
Michael Natterer 2005-09-26 00:25:49 +00:00 committed by Michael Natterer
parent 2e42c8ea83
commit 0c2d06f738
7 changed files with 30 additions and 21 deletions

View File

@ -1,3 +1,19 @@
2005-09-26 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-params.c (plug_in_proc_args_check): drop the
restriction that plug-ins registered in <Image> must have
RUN-MODE, IMAGE, DRAWABLE parameters because everything but
RUN-MODE is actually treated as optional be the rest of the code.
* plug-ins/script-fu/scripts/paste-as-brush.scm
* plug-ins/script-fu/scripts/paste-as-pattern.scm: removed IMAGE
and DRAWABLE parameters.
* plug-ins/common/screenshot.c
* plug-ins/twain/twain.c
* plug-ins/winsnap/winsnap.c: register menu entries in
<Image>/File/Acquire
2005-09-26 Sven Neumann <sven@gimp.org> 2005-09-26 Sven Neumann <sven@gimp.org>
* plug-ins/common/gqbist.c: minor dialog tweak. * plug-ins/common/gqbist.c: minor dialog tweak.

View File

@ -514,16 +514,14 @@ plug_in_proc_args_check (const gchar *plug_in_name,
else if (strncmp (menu_path, "<Image>", 7) == 0) else if (strncmp (menu_path, "<Image>", 7) == 0)
{ {
if ((n_args < 3) || if ((n_args < 3) ||
(args[0].arg_type != GIMP_PDB_INT32) || (args[0].arg_type != GIMP_PDB_INT32))
(args[1].arg_type != GIMP_PDB_IMAGE) ||
(args[2].arg_type != GIMP_PDB_DRAWABLE))
{ {
g_set_error (error, 0, 0, g_set_error (error, 0, 0,
"Plug-In \"%s\"\n(%s)\n\n" "Plug-In \"%s\"\n(%s)\n\n"
"attempted to install <Image> procedure \"%s\" " "attempted to install <Image> procedure \"%s\" "
"which does not take the standard <Image> Plug-In " "which does not take the standard <Image> Plug-In "
"args.\n" "args.\n"
"(INT32, IMAGE, DRAWABLE)", "(INT32)",
gimp_filename_to_utf8 (plug_in_name), gimp_filename_to_utf8 (plug_in_name),
gimp_filename_to_utf8 (plug_in_prog), gimp_filename_to_utf8 (plug_in_prog),
procedure_name); procedure_name);

View File

@ -244,7 +244,7 @@ query (void)
args, return_vals); args, return_vals);
gimp_plugin_menu_register (PLUG_IN_PROC, "<Toolbox>/File/Acquire"); gimp_plugin_menu_register (PLUG_IN_PROC, "<Toolbox>/File/Acquire");
/* gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/File/Acquire"); */ gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/File/Acquire");
gimp_plugin_icon_register (PLUG_IN_PROC, gimp_plugin_icon_register (PLUG_IN_PROC,
GIMP_ICON_TYPE_INLINE_PIXBUF, screenshot_icon); GIMP_ICON_TYPE_INLINE_PIXBUF, screenshot_icon);

View File

@ -19,9 +19,7 @@
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(define (script-fu-paste-as-brush image (define (script-fu-paste-as-brush name
drawable
name
filename filename
spacing) spacing)
@ -40,7 +38,7 @@
(set! path (string-append gimp-directory (set! path (string-append gimp-directory
"/brushes/" "/brushes/"
filename filename
(number->string image) (number->string brush-image)
".gbr")) ".gbr"))
(file-gbr-save 1 brush-image brush-draw path "" spacing name) (file-gbr-save 1 brush-image brush-draw path "" spacing name)
@ -56,9 +54,7 @@
"Michael Natterer <mitch@gimp.org>" "Michael Natterer <mitch@gimp.org>"
"Michael Natterer" "Michael Natterer"
"2005-09-25" "2005-09-25"
"*" ""
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-STRING _"Brush name" "My Brush" SF-STRING _"Brush name" "My Brush"
SF-STRING _"File name" "mybrush" SF-STRING _"File name" "mybrush"
SF-ADJUSTMENT _"Spacing" '(25 0 1000 1 1 1 0)) SF-ADJUSTMENT _"Spacing" '(25 0 1000 1 1 1 0))

View File

@ -19,9 +19,7 @@
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(define (script-fu-paste-as-pattern image (define (script-fu-paste-as-pattern name
drawable
name
filename) filename)
(set! pattern-image (car (gimp-edit-paste-as-new))) (set! pattern-image (car (gimp-edit-paste-as-new)))
@ -30,7 +28,7 @@
(set! path (string-append gimp-directory (set! path (string-append gimp-directory
"/patterns/" "/patterns/"
filename filename
(number->string image) (number->string pattern-image)
".pat")) ".pat"))
(file-pat-save 1 pattern-image pattern-draw path "" name) (file-pat-save 1 pattern-image pattern-draw path "" name)
@ -48,10 +46,8 @@
"Michael Natterer" "Michael Natterer"
"2005-09-25" "2005-09-25"
"*" "*"
SF-IMAGE "Image" 0 SF-STRING _"Pattern name" "My Pattern"
SF-DRAWABLE "Drawable" 0 SF-STRING _"File name" "mypattern")
SF-STRING _"Pattern name" "My Pattern"
SF-STRING _"File name" "mypattern")
(script-fu-menu-register "script-fu-paste-as-pattern" (script-fu-menu-register "script-fu-paste-as-pattern"
"<Image>/Edit/Paste as") "<Image>/Edit/Paste as")

View File

@ -319,6 +319,7 @@ query (void)
return_vals); return_vals);
gimp_plugin_menu_register (PLUG_IN_D_NAME, "<Toolbox>/File/Acquire"); gimp_plugin_menu_register (PLUG_IN_D_NAME, "<Toolbox>/File/Acquire");
gimp_plugin_menu_register (PLUG_IN_D_NAME, "<Image>/File/Acquire");
} }
else if (twain_run_mode == RUN_READDUMP) else if (twain_run_mode == RUN_READDUMP)
{ {
@ -338,6 +339,7 @@ query (void)
return_vals); return_vals);
gimp_plugin_menu_register (PLUG_IN_R_NAME, "<Toolbox>/File/Acquire"); gimp_plugin_menu_register (PLUG_IN_R_NAME, "<Toolbox>/File/Acquire");
gimp_plugin_menu_register (PLUG_IN_R_NAME, "<Image>/File/Acquire");
} }
else else
#endif /* _DEBUG */ #endif /* _DEBUG */
@ -358,6 +360,7 @@ query (void)
return_vals); return_vals);
gimp_plugin_menu_register (PLUG_IN_NAME, "<Toolbox>/File/Acquire"); gimp_plugin_menu_register (PLUG_IN_NAME, "<Toolbox>/File/Acquire");
gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/File/Acquire");
} }
} }

View File

@ -1000,7 +1000,7 @@ query(void)
return_vals); return_vals);
gimp_plugin_menu_register (PLUG_IN_NAME, "<Toolbox>/File/Acquire"); gimp_plugin_menu_register (PLUG_IN_NAME, "<Toolbox>/File/Acquire");
/* gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/File/Acquire"); */ gimp_plugin_menu_register (PLUG_IN_NAME, "<Image>/File/Acquire");
} }
/* Return values storage */ /* Return values storage */