1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
/* cbmplugs -- Plugins to enable handling of Commodore 64 images in The GIMP
*
* Copyright © 2002-2007 David Weinehall <tao@acc.umu.se>
*
* These plugins are based off of work
*
* Copyright © 1999 Maurits Rijk <lpeek.mrijk@consunet.nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <libgimp/gimp.h>
#include "cbmplugs.h"
_runheader
{
static GimpParam values[2];
GimpRunMode run_mode;
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
if (nparams < 2)
return;
run_mode = param[0].data.d_int32;
if (strcmp(name, "file_sprite_save") == 0) {
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (!save_image(param[3].data.d_string, param[1].data.d_image,
SPRITE)) {
*nreturn_vals = 1;
values[0].data.d_status = GIMP_PDB_SUCCESS;
}
}
}
static void query(void)
{
static GimpParamDef save_args[] = {
{
GIMP_PDB_INT32,
"run_mode",
"Interactive, non-interactive"
},
{
GIMP_PDB_IMAGE,
"image",
"Input image"
},
{
GIMP_PDB_DRAWABLE,
"drawable",
"Drawable to save"
},
{
GIMP_PDB_STRING,
"filename",
"The name of the file to save the image in"
},
{
GIMP_PDB_STRING,
"raw_filename",
"The name of the file to save the image in"
},
};
static int nsave_args = sizeof (save_args) / sizeof (save_args[0]);
gimp_install_procedure("file_sprite_save",
"saves images as Commodore 64 sprites",
"This plug-in saves images as Commodore 64 sprites.",
"David Weinehall <tao@acc.umu.se>",
"David Weinehall",
"2002",
"<Save>/Sprite",
"INDEXED",
GIMP_PLUGIN,
nsave_args,
0,
save_args,
NULL);
gimp_register_save_handler("file_sprite_save", "spr", "");
}
GimpPlugInInfo PLUG_IN_INFO = {
NULL, /* init_proc */
NULL, /* quit_proc */
query, /* query_proc */
run, /* run_proc */
};
MAIN();
|