app: move app/batch.[ch] to app/core/gimp-batch.[ch]
There is no reason batch processing should be considered "glue code".
This commit is contained in:
@ -47,8 +47,6 @@ libapp_sources = \
|
||||
about.h \
|
||||
app.c \
|
||||
app.h \
|
||||
batch.c \
|
||||
batch.h \
|
||||
errors.c \
|
||||
errors.h \
|
||||
language.c \
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include "gegl/gimp-gegl.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimp-batch.h"
|
||||
#include "core/gimp-user-install.h"
|
||||
|
||||
#include "file/file-open.h"
|
||||
@ -59,7 +60,6 @@
|
||||
#endif
|
||||
|
||||
#include "app.h"
|
||||
#include "batch.h"
|
||||
#include "errors.h"
|
||||
#include "units.h"
|
||||
#include "language.h"
|
||||
@ -301,7 +301,7 @@ app_run (const gchar *full_prog_name,
|
||||
}
|
||||
|
||||
if (run_loop)
|
||||
batch_run (gimp, batch_interpreter, batch_commands);
|
||||
gimp_batch_run (gimp, batch_interpreter, batch_commands);
|
||||
|
||||
if (run_loop)
|
||||
{
|
||||
|
@ -28,6 +28,8 @@ libappcore_a_sources = \
|
||||
core-types.h \
|
||||
gimp.c \
|
||||
gimp.h \
|
||||
gimp-batch.c \
|
||||
gimp-batch.h \
|
||||
gimp-cairo.c \
|
||||
gimp-cairo.h \
|
||||
gimp-contexts.c \
|
||||
|
@ -25,12 +25,11 @@
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
|
||||
#include "core/core-types.h"
|
||||
#include "core-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
|
||||
#include "batch.h"
|
||||
#include "gimp.h"
|
||||
#include "gimp-batch.h"
|
||||
#include "gimpparamspecs.h"
|
||||
|
||||
#include "pdb/gimppdb.h"
|
||||
#include "pdb/gimpprocedure.h"
|
||||
@ -41,19 +40,19 @@
|
||||
#define BATCH_DEFAULT_EVAL_PROC "plug-in-script-fu-eval"
|
||||
|
||||
|
||||
static void batch_exit_after_callback (Gimp *gimp) G_GNUC_NORETURN;
|
||||
static void gimp_batch_exit_after_callback (Gimp *gimp) G_GNUC_NORETURN;
|
||||
|
||||
static void batch_run_cmd (Gimp *gimp,
|
||||
const gchar *proc_name,
|
||||
GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
const gchar *cmd);
|
||||
static void gimp_batch_run_cmd (Gimp *gimp,
|
||||
const gchar *proc_name,
|
||||
GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
const gchar *cmd);
|
||||
|
||||
|
||||
void
|
||||
batch_run (Gimp *gimp,
|
||||
const gchar *batch_interpreter,
|
||||
const gchar **batch_commands)
|
||||
gimp_batch_run (Gimp *gimp,
|
||||
const gchar *batch_interpreter,
|
||||
const gchar **batch_commands)
|
||||
{
|
||||
gulong exit_id;
|
||||
|
||||
@ -61,7 +60,7 @@ batch_run (Gimp *gimp,
|
||||
return;
|
||||
|
||||
exit_id = g_signal_connect_after (gimp, "exit",
|
||||
G_CALLBACK (batch_exit_after_callback),
|
||||
G_CALLBACK (gimp_batch_exit_after_callback),
|
||||
NULL);
|
||||
|
||||
if (! batch_interpreter)
|
||||
@ -88,8 +87,8 @@ batch_run (Gimp *gimp,
|
||||
proc_name);
|
||||
|
||||
if (procedure)
|
||||
batch_run_cmd (gimp, proc_name, procedure,
|
||||
GIMP_RUN_NONINTERACTIVE, NULL);
|
||||
gimp_batch_run_cmd (gimp, proc_name, procedure,
|
||||
GIMP_RUN_NONINTERACTIVE, NULL);
|
||||
else
|
||||
g_message (_("The batch interpreter '%s' is not available. "
|
||||
"Batch mode disabled."), proc_name);
|
||||
@ -104,8 +103,8 @@ batch_run (Gimp *gimp,
|
||||
gint i;
|
||||
|
||||
for (i = 0; batch_commands[i]; i++)
|
||||
batch_run_cmd (gimp, batch_interpreter, eval_proc,
|
||||
GIMP_RUN_NONINTERACTIVE, batch_commands[i]);
|
||||
gimp_batch_run_cmd (gimp, batch_interpreter, eval_proc,
|
||||
GIMP_RUN_NONINTERACTIVE, batch_commands[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -125,7 +124,7 @@ batch_run (Gimp *gimp,
|
||||
* and gimp would hang forever.
|
||||
*/
|
||||
static void
|
||||
batch_exit_after_callback (Gimp *gimp)
|
||||
gimp_batch_exit_after_callback (Gimp *gimp)
|
||||
{
|
||||
if (gimp->be_verbose)
|
||||
g_print ("EXIT: %s\n", G_STRFUNC);
|
||||
@ -136,11 +135,11 @@ batch_exit_after_callback (Gimp *gimp)
|
||||
}
|
||||
|
||||
static void
|
||||
batch_run_cmd (Gimp *gimp,
|
||||
const gchar *proc_name,
|
||||
GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
const gchar *cmd)
|
||||
gimp_batch_run_cmd (Gimp *gimp,
|
||||
const gchar *proc_name,
|
||||
GimpProcedure *procedure,
|
||||
GimpRunMode run_mode,
|
||||
const gchar *cmd)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
@ -15,17 +15,13 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __BATCH_H__
|
||||
#define __BATCH_H__
|
||||
|
||||
#ifndef GIMP_APP_GLUE_COMPILATION
|
||||
#error You must not #include "batch.h" from an app/ subdir
|
||||
#endif
|
||||
#ifndef __GIMP_BATCH_H__
|
||||
#define __GIMP_BATCH_H__
|
||||
|
||||
|
||||
void batch_run (Gimp *gimp,
|
||||
const gchar *batch_interpreter,
|
||||
const gchar **batch_commands);
|
||||
void gimp_batch_run (Gimp *gimp,
|
||||
const gchar *batch_interpreter,
|
||||
const gchar **batch_commands);
|
||||
|
||||
|
||||
#endif /* __BATCH_H__ */
|
||||
#endif /* __GIMP_BATCH_H__ */
|
@ -27,6 +27,7 @@
|
||||
#include "gui-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimp-batch.h"
|
||||
#include "core/gimpcontainer.h"
|
||||
|
||||
#include "file/file-open.h"
|
||||
@ -34,12 +35,6 @@
|
||||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
|
||||
/* Dirty hack since we are not supposed to include batch.h
|
||||
* from an app/ subdir. DBus is a special case. */
|
||||
#define GIMP_APP_GLUE_COMPILATION
|
||||
#include "batch.h"
|
||||
#undef GIMP_APP_GLUE_COMPILATION
|
||||
|
||||
#include "gimpdbusservice.h"
|
||||
|
||||
|
||||
@ -349,8 +344,8 @@ gimp_dbus_service_process_idle (GimpDBusService *service)
|
||||
{
|
||||
const gchar *commands[2] = {data->command, 0};
|
||||
|
||||
batch_run (service->gimp, data->interpreter,
|
||||
commands);
|
||||
gimp_batch_run (service->gimp, data->interpreter,
|
||||
commands);
|
||||
}
|
||||
|
||||
gimp_dbus_service_idle_data_free (data);
|
||||
|
@ -8,7 +8,6 @@ desktop/gimp.desktop.in.in
|
||||
|
||||
app/about.h
|
||||
app/app.c
|
||||
app/batch.c
|
||||
app/language.c
|
||||
app/main.c
|
||||
app/sanity.c
|
||||
@ -95,6 +94,7 @@ app/config/gimprc-deserialize.c
|
||||
|
||||
app/core/core-enums.c
|
||||
app/core/gimp.c
|
||||
app/core/gimp-batch.c
|
||||
app/core/gimp-contexts.c
|
||||
app/core/gimp-edit.c
|
||||
app/core/gimp-gradients.c
|
||||
|
Reference in New Issue
Block a user