1
/* The GIMP -- an image manipulation program
1
/* GIMP - The GNU Image Manipulation Program
2
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
4
* This program is free software; you can redistribute it and/or modify
30
28
#include "libgimp/stdplugins-intl.h"
31
#define SAVE_PROC "file-header-save"
32
#define PLUG_IN_BINARY "header"
33
35
/* Declare some local functions.
35
37
static void query (void);
60
static GimpParamDef save_args[] =
62
static const GimpParamDef save_args[] =
62
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
63
{ GIMP_PDB_IMAGE, "image", "Input image" },
64
{ GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" },
65
{ GIMP_PDB_STRING, "filename", "The name of the file to save the image in" },
66
{ GIMP_PDB_STRING, "raw_filename", "The name of the file to save the image in" }
64
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
65
{ GIMP_PDB_IMAGE, "image", "Input image" },
66
{ GIMP_PDB_DRAWABLE, "drawable", "Drawable to save" },
67
{ GIMP_PDB_STRING, "filename", "The name of the file to save the image in" },
68
{ GIMP_PDB_STRING, "raw-filename", "The name of the file to save the image in" }
69
gimp_install_procedure ("file_header_save",
71
gimp_install_procedure (SAVE_PROC,
70
72
"saves files as C unsigned character array",
71
73
"FIXME: write help",
72
74
"Spencer Kimball & Peter Mattis",
78
80
G_N_ELEMENTS (save_args), 0,
81
gimp_register_file_handler_mime ("file_header_save", "text/x-chdr");
82
gimp_register_save_handler ("file_header_save", "h", "");
83
gimp_register_file_handler_mime (SAVE_PROC, "text/x-chdr");
84
gimp_register_save_handler (SAVE_PROC, "h", "");
105
107
values[0].type = GIMP_PDB_STATUS;
106
108
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
108
if (strcmp (name, "file_header_save") == 0)
110
if (strcmp (name, SAVE_PROC) == 0)
110
112
image_ID = param[1].data.d_int32;
111
113
drawable_ID = param[2].data.d_int32;
116
118
case GIMP_RUN_INTERACTIVE:
117
119
case GIMP_RUN_WITH_LAST_VALS:
118
gimp_ui_init ("header", FALSE);
120
gimp_ui_init (PLUG_IN_BINARY, FALSE);
119
121
export = gimp_export_image (&image_ID, &drawable_ID, "Header",
120
122
(GIMP_EXPORT_CAN_HANDLE_RGB |
121
123
GIMP_EXPORT_CAN_HANDLE_INDEXED));