Commit 774caf0e authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/plug-in/Makefile.am new files. Started to split plug-in.c into smaller

2001-12-19  Sven Neumann  <sven@gimp.org>

	* app/plug-in/Makefile.am
	* app/plug-in-proc/plug-in-proc.[ch]: new files. Started to split
	plug-in.c into smaller pieces.

	* app/plug-in/plug-in-types.h: namespacified GimpRunModeType enum and
	renamed it to GimpRunMode.

	* app/plug-in/plug-in.[ch]
	* app/gimphelp.c
	* app/file/file-open.[ch]
	* app/file/file-save.[ch]
	* app/file/file-utils.c
	* app/gui/file-commands.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/paths-dialog.c
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/fileops.pdb: changed accordingly.

	* app/pdb/fileops_cmds.c
	* libgimp/gimpenums.h
	* plug-ins/script-fu/script-fu-constants.c
	* libgimp/gimpfileops_pdb.[ch]
	* tools/pdbgen/enums.pl: regenerated.

	* libgimp/Makefile.am
	* libgimp/gimpcompat.h: added gimpcompat.h mostly as a place to
	document plug-in API changes.

	* plug-ins/*: changed all occurences of GimpRunModeType to GimpRunMode.
parent 89844be4
2001-12-19 Sven Neumann <sven@gimp.org>
* app/plug-in/Makefile.am
* app/plug-in-proc/plug-in-proc.[ch]: new files. Started to split
plug-in.c into smaller pieces.
* app/plug-in/plug-in-types.h: namespacified GimpRunModeType enum and
renamed it to GimpRunMode.
* app/plug-in/plug-in.[ch]
* app/gimphelp.c
* app/file/file-open.[ch]
* app/file/file-save.[ch]
* app/file/file-utils.c
* app/gui/file-commands.c
* app/gui/file-open-dialog.c
* app/gui/file-save-dialog.c
* app/gui/paths-dialog.c
* app/xcf/xcf.c
* tools/pdbgen/pdb/fileops.pdb: changed accordingly.
* app/pdb/fileops_cmds.c
* libgimp/gimpenums.h
* plug-ins/script-fu/script-fu-constants.c
* libgimp/gimpfileops_pdb.[ch]
* tools/pdbgen/enums.pl: regenerated.
* libgimp/Makefile.am
* libgimp/gimpcompat.h: added gimpcompat.h mostly as a place to
document plug-in API changes.
* plug-ins/*: changed all occurences of GimpRunModeType to GimpRunMode.
2001-12-18 Sven Neumann <sven@gimp.org>
* docs/gimptool-1.3.1.in
......
......@@ -133,10 +133,10 @@ gimp_1_3_LDADD = @STRIP_BEGIN@ \
tools/libapptools.a \
display/libappdisplay.a \
widgets/libappwidgets.a \
plug-in/libappplug-in.a \
core/libappcore.a \
xcf/libappxcf.a \
file/libappfile.a \
plug-in/libappplug-in.a \
pdb/libapppdb.a \
config/libappconfig.a \
paint-funcs/libapppaint-funcs.a \
......
......@@ -174,7 +174,7 @@ file_save_cmd_callback (GtkWidget *widget,
filename,
basename,
NULL,
RUN_WITH_LAST_VALS,
GIMP_RUN_WITH_LAST_VALS,
TRUE);
g_free (basename);
......@@ -313,7 +313,7 @@ file_revert_confirm_callback (GtkWidget *widget,
filename,
_("Revert"),
NULL,
RUN_INTERACTIVE,
GIMP_RUN_INTERACTIVE,
&status);
if (new_gimage != NULL)
......
......@@ -107,6 +107,7 @@
#include "gui/pattern-select.h"
#include "plug-in.h"
#include "plug-in-proc.h"
#include "app_procs.h"
#include "gimpprogress.h"
......@@ -1374,7 +1375,8 @@ plug_in_repeat (gboolean with_interface)
args[i].arg_type = last_plug_in->args[i].arg_type;
/* initialize the first three plug-in arguments */
args[0].value.pdb_int = (with_interface ? RUN_INTERACTIVE : RUN_WITH_LAST_VALS);
args[0].value.pdb_int = (with_interface ?
GIMP_RUN_INTERACTIVE : GIMP_RUN_WITH_LAST_VALS);
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
......@@ -2777,7 +2779,7 @@ plug_in_callback (GtkWidget *widget,
{
case GIMP_EXTENSION:
/* initialize the first argument */
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
argc = 1;
break;
......@@ -2787,7 +2789,7 @@ plug_in_callback (GtkWidget *widget,
gdisp_ID = gdisplay->ID;
/* initialize the first 3 plug-in arguments */
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
argc = 3;
......@@ -2801,7 +2803,7 @@ plug_in_callback (GtkWidget *widget,
break;
case GIMP_TEMPORARY:
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
argc = 1;
if (proc_rec->num_args >= 3 &&
proc_rec->args[1].arg_type == GIMP_PDB_IMAGE &&
......
......@@ -48,7 +48,8 @@
#include "core/gimpdocuments.h"
#include "core/gimpimage.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-types.h"
#include "plug-in/plug-in-proc.h"
#include "file/file-open.h"
#include "file/file-utils.h"
......@@ -629,7 +630,7 @@ file_open_genbutton_callback (GtkWidget *widget,
list->data,
NULL,
NULL,
RUN_NONINTERACTIVE,
GIMP_RUN_NONINTERACTIVE,
&dummy);
if (gimage_to_be_thumbed)
......
......@@ -341,7 +341,7 @@ file_save_ok_callback (GtkWidget *widget,
args = g_new (Argument, 3);
args[0].arg_type = GIMP_PDB_INT32;
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].arg_type = GIMP_PDB_IMAGE;
args[1].value.pdb_int = gimp_image_get_ID (the_gimage);
args[2].arg_type = GIMP_PDB_DRAWABLE;
......@@ -388,7 +388,7 @@ file_save_ok_callback (GtkWidget *widget,
filename,
raw_filename,
save_file_proc,
RUN_INTERACTIVE,
GIMP_RUN_INTERACTIVE,
set_filename);
if (status != GIMP_PDB_SUCCESS &&
......@@ -453,7 +453,7 @@ file_overwrite_callback (GtkWidget *widget,
overwrite_data->full_filename,
overwrite_data->raw_filename,
save_file_proc,
RUN_INTERACTIVE,
GIMP_RUN_INTERACTIVE,
set_filename);
if (status != GIMP_PDB_SUCCESS &&
......
......@@ -44,6 +44,7 @@
#include "pdb/procedural_db.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-proc.h"
#include "file-open.h"
#include "file-utils.h"
......@@ -61,7 +62,7 @@ file_open_image (Gimp *gimp,
const gchar *raw_filename,
const gchar *open_mode,
PlugInProcDef *file_proc,
RunModeType run_mode,
GimpRunMode run_mode,
GimpPDBStatusType *status)
{
ProcRecord *proc;
......@@ -82,7 +83,7 @@ file_open_image (Gimp *gimp,
if (! file_proc)
{
/* no errors when making thumbnails */
if (run_mode == RUN_INTERACTIVE)
if (run_mode == GIMP_RUN_INTERACTIVE)
g_message (_("%s failed.\n"
"%s: Unknown file type."),
open_mode, filename);
......@@ -96,7 +97,7 @@ file_open_image (Gimp *gimp,
if (! (statbuf.st_mode & S_IFREG))
{
/* no errors when making thumbnails */
if (run_mode == RUN_INTERACTIVE)
if (run_mode == GIMP_RUN_INTERACTIVE)
g_message (_("%s failed.\n"
"%s is not a regular file."),
open_mode, filename);
......@@ -107,7 +108,7 @@ file_open_image (Gimp *gimp,
if (access (filename, R_OK) != 0)
{
/* no errors when making thumbnails */
if (run_mode == RUN_INTERACTIVE)
if (run_mode == GIMP_RUN_INTERACTIVE)
g_message (_("%s failed.\n"
"%s: %s."),
open_mode, filename, g_strerror (errno));
......@@ -116,7 +117,7 @@ file_open_image (Gimp *gimp,
}
}
proc = &file_proc->db_info;
proc = plug_in_proc_def_get_proc (file_proc);
args = g_new0 (Argument, proc->num_args);
......@@ -169,7 +170,7 @@ file_open_with_proc_and_display (Gimp *gimp,
raw_filename,
_("Open"),
file_proc,
RUN_INTERACTIVE,
GIMP_RUN_INTERACTIVE,
&status)) != NULL)
{
/* enable & clear all undo steps */
......
......@@ -25,7 +25,7 @@ GimpImage * file_open_image (Gimp *gimp,
const gchar *raw_filename,
const gchar *open_mode,
PlugInProcDef *file_proc,
RunModeType run_mode,
GimpRunMode run_mode,
GimpPDBStatusType *status);
GimpPDBStatusType file_open_with_display (Gimp *gimp,
......
......@@ -46,6 +46,7 @@
#include "pdb/procedural_db.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-proc.h"
#include "file-save.h"
#include "file-utils.h"
......@@ -62,7 +63,7 @@ file_save (GimpImage *gimage,
const gchar *filename,
const gchar *raw_filename,
PlugInProcDef *file_proc,
RunModeType run_mode,
GimpRunMode run_mode,
gboolean set_filename)
{
ProcRecord *proc;
......@@ -127,7 +128,7 @@ file_save (GimpImage *gimage,
/* ref the image, so it can't get deleted during save */
g_object_ref (G_OBJECT (gimage));
proc = &file_proc->db_info;
proc = plug_in_proc_def_get_proc (file_proc);
args = g_new0 (Argument, proc->num_args);
......
......@@ -24,7 +24,7 @@ GimpPDBStatusType file_save (GimpImage *gimage,
const gchar *filename,
const gchar *raw_filename,
PlugInProcDef *file_proc,
RunModeType run_mode,
GimpRunMode run_mode,
gboolean set_filename);
......
......@@ -53,6 +53,7 @@
#include "pdb/procedural_db.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-proc.h"
#include "file-utils.h"
......
......@@ -210,7 +210,7 @@ gimp_help_internal (const gchar *help_path,
args = g_new (Argument, 4);
args[0].arg_type = GIMP_PDB_INT32;
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].arg_type = GIMP_PDB_STRING;
args[1].value.pdb_pointer = (gpointer) help_path;
args[2].arg_type = GIMP_PDB_STRING;
......@@ -282,7 +282,7 @@ gimp_help_netscape (const gchar *help_path,
procedural_db_run_proc (the_gimp,
"extension_web_browser",
&nreturn_vals,
GIMP_PDB_INT32, RUN_NONINTERACTIVE,
GIMP_PDB_INT32, GIMP_RUN_NONINTERACTIVE,
GIMP_PDB_STRING, url,
GIMP_PDB_INT32, FALSE,
GIMP_PDB_END);
......
......@@ -174,7 +174,7 @@ file_save_cmd_callback (GtkWidget *widget,
filename,
basename,
NULL,
RUN_WITH_LAST_VALS,
GIMP_RUN_WITH_LAST_VALS,
TRUE);
g_free (basename);
......@@ -313,7 +313,7 @@ file_revert_confirm_callback (GtkWidget *widget,
filename,
_("Revert"),
NULL,
RUN_INTERACTIVE,
GIMP_RUN_INTERACTIVE,
&status);
if (new_gimage != NULL)
......
......@@ -48,7 +48,8 @@
#include "core/gimpdocuments.h"
#include "core/gimpimage.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-types.h"
#include "plug-in/plug-in-proc.h"
#include "file/file-open.h"
#include "file/file-utils.h"
......@@ -629,7 +630,7 @@ file_open_genbutton_callback (GtkWidget *widget,
list->data,
NULL,
NULL,
RUN_NONINTERACTIVE,
GIMP_RUN_NONINTERACTIVE,
&dummy);
if (gimage_to_be_thumbed)
......
......@@ -341,7 +341,7 @@ file_save_ok_callback (GtkWidget *widget,
args = g_new (Argument, 3);
args[0].arg_type = GIMP_PDB_INT32;
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].arg_type = GIMP_PDB_IMAGE;
args[1].value.pdb_int = gimp_image_get_ID (the_gimage);
args[2].arg_type = GIMP_PDB_DRAWABLE;
......@@ -388,7 +388,7 @@ file_save_ok_callback (GtkWidget *widget,
filename,
raw_filename,
save_file_proc,
RUN_INTERACTIVE,
GIMP_RUN_INTERACTIVE,
set_filename);
if (status != GIMP_PDB_SUCCESS &&
......@@ -453,7 +453,7 @@ file_overwrite_callback (GtkWidget *widget,
overwrite_data->full_filename,
overwrite_data->raw_filename,
save_file_proc,
RUN_INTERACTIVE,
GIMP_RUN_INTERACTIVE,
set_filename);
if (status != GIMP_PDB_SUCCESS &&
......
......@@ -1317,7 +1317,7 @@ paths_dialog_advanced_to_path_callback (GtkWidget *widget,
args = g_new (Argument, 3);
args[0].arg_type = GIMP_PDB_INT32;
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].arg_type = GIMP_PDB_IMAGE;
args[1].value.pdb_int = (gint32) gimp_image_get_ID (gimage);
args[2].arg_type = GIMP_PDB_DRAWABLE;
......@@ -1353,7 +1353,7 @@ paths_dialog_sel_to_path_callback (GtkWidget *widget,
args = g_new (Argument, 3);
args[0].arg_type = GIMP_PDB_INT32;
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].arg_type = GIMP_PDB_IMAGE;
args[1].value.pdb_int = (gint32) gimp_image_get_ID (gimage);
args[2].arg_type = GIMP_PDB_DRAWABLE;
......
......@@ -107,6 +107,7 @@
#include "gui/pattern-select.h"
#include "plug-in.h"
#include "plug-in-proc.h"
#include "app_procs.h"
#include "gimpprogress.h"
......@@ -1374,7 +1375,8 @@ plug_in_repeat (gboolean with_interface)
args[i].arg_type = last_plug_in->args[i].arg_type;
/* initialize the first three plug-in arguments */
args[0].value.pdb_int = (with_interface ? RUN_INTERACTIVE : RUN_WITH_LAST_VALS);
args[0].value.pdb_int = (with_interface ?
GIMP_RUN_INTERACTIVE : GIMP_RUN_WITH_LAST_VALS);
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
......@@ -2777,7 +2779,7 @@ plug_in_callback (GtkWidget *widget,
{
case GIMP_EXTENSION:
/* initialize the first argument */
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
argc = 1;
break;
......@@ -2787,7 +2789,7 @@ plug_in_callback (GtkWidget *widget,
gdisp_ID = gdisplay->ID;
/* initialize the first 3 plug-in arguments */
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
argc = 3;
......@@ -2801,7 +2803,7 @@ plug_in_callback (GtkWidget *widget,
break;
case GIMP_TEMPORARY:
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
argc = 1;
if (proc_rec->num_args >= 3 &&
proc_rec->args[1].arg_type == GIMP_PDB_IMAGE &&
......
......@@ -107,6 +107,7 @@
#include "gui/pattern-select.h"
#include "plug-in.h"
#include "plug-in-proc.h"
#include "app_procs.h"
#include "gimpprogress.h"
......@@ -1374,7 +1375,8 @@ plug_in_repeat (gboolean with_interface)
args[i].arg_type = last_plug_in->args[i].arg_type;
/* initialize the first three plug-in arguments */
args[0].value.pdb_int = (with_interface ? RUN_INTERACTIVE : RUN_WITH_LAST_VALS);
args[0].value.pdb_int = (with_interface ?
GIMP_RUN_INTERACTIVE : GIMP_RUN_WITH_LAST_VALS);
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
......@@ -2777,7 +2779,7 @@ plug_in_callback (GtkWidget *widget,
{
case GIMP_EXTENSION:
/* initialize the first argument */
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
argc = 1;
break;
......@@ -2787,7 +2789,7 @@ plug_in_callback (GtkWidget *widget,
gdisp_ID = gdisplay->ID;
/* initialize the first 3 plug-in arguments */
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
argc = 3;
......@@ -2801,7 +2803,7 @@ plug_in_callback (GtkWidget *widget,
break;
case GIMP_TEMPORARY:
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
argc = 1;
if (proc_rec->num_args >= 3 &&
proc_rec->args[1].arg_type == GIMP_PDB_IMAGE &&
......
......@@ -107,6 +107,7 @@
#include "gui/pattern-select.h"
#include "plug-in.h"
#include "plug-in-proc.h"
#include "app_procs.h"
#include "gimpprogress.h"
......@@ -1374,7 +1375,8 @@ plug_in_repeat (gboolean with_interface)
args[i].arg_type = last_plug_in->args[i].arg_type;
/* initialize the first three plug-in arguments */
args[0].value.pdb_int = (with_interface ? RUN_INTERACTIVE : RUN_WITH_LAST_VALS);
args[0].value.pdb_int = (with_interface ?
GIMP_RUN_INTERACTIVE : GIMP_RUN_WITH_LAST_VALS);
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
......@@ -2777,7 +2779,7 @@ plug_in_callback (GtkWidget *widget,
{
case GIMP_EXTENSION:
/* initialize the first argument */
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
argc = 1;
break;
......@@ -2787,7 +2789,7 @@ plug_in_callback (GtkWidget *widget,
gdisp_ID = gdisplay->ID;
/* initialize the first 3 plug-in arguments */
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
args[1].value.pdb_int = gimp_image_get_ID (gdisplay->gimage);
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
argc = 3;
......@@ -2801,7 +2803,7 @@ plug_in_callback (GtkWidget *widget,
break;
case GIMP_TEMPORARY:
args[0].value.pdb_int = RUN_INTERACTIVE;
args[0].value.pdb_int = GIMP_RUN_INTERACTIVE;
argc = 1;
if (proc_rec->num_args >= 3 &&
proc_rec->args[1].arg_type == GIMP_PDB_IMAGE &&
......
......@@ -81,7 +81,7 @@ file_load_invoker (Gimp *gimp,
if (! file_proc)
return procedural_db_return_args (&file_load_proc, FALSE);
proc = &file_proc->db_info;
proc = plug_in_proc_def_get_proc (file_proc);
return procedural_db_execute (gimp, proc->name, args);
}
......@@ -91,7 +91,7 @@ static ProcArg file_load_inargs[] =
{
GIMP_PDB_INT32,
"run_mode",
"The run mode: RUN_INTERACTIVE (0) or RUN_NONINTERACTIVE (1)"
"The run mode: GIMP_RUN_INTERACTIVE (0) or GIMP_RUN_NONINTERACTIVE (1)"
},
{
GIMP_PDB_STRING,
......@@ -145,7 +145,7 @@ file_save_invoker (Gimp *gimp,
if (! file_proc)
return procedural_db_return_args (&file_save_proc, FALSE);
proc = &file_proc->db_info;
proc = plug_in_proc_def_get_proc (file_proc);
new_args = g_new (Argument, proc->num_args);
memset (new_args, 0, sizeof (Argument) * proc->num_args);
......@@ -169,7 +169,7 @@ static ProcArg file_save_inargs[] =
{
GIMP_PDB_INT32,
"run_mode",
"The run mode: RUN_INTERACTIVE (0) or RUN_NONINTERACTIVE (1)"
"The run mode: GIMP_RUN_INTERACTIVE (0) or GIMP_RUN_NONINTERACTIVE (1)"
},
{
GIMP_PDB_IMAGE,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment