gimp/libgimp/gimpprotocol.c

1196 lines
31 KiB
C
Raw Normal View History

1998-01-25 18:26:47 +08:00
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* This library is free software; you can redistribute it and/or
1999-11-18 05:13:50 +08:00
* modify it under the terms of the GNU Lesser General Public
1998-01-25 18:26:47 +08:00
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
1999-11-18 05:13:50 +08:00
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
1998-01-25 18:26:47 +08:00
*/
1997-11-25 06:05:25 +08:00
#include "gimpenums.h"
#include "gimpprotocol.h"
#include "gimpwire.h"
Modified Files: ChangeLog app/Makefile.am app/channel.c app/channel.h Modified Files: ChangeLog app/Makefile.am app/channel.c app/channel.h app/channel_cmds.c app/channel_cmds.h app/drawable_cmds.c app/gimage_cmds.c app/gimpdrawable.c app/gimpdrawable.h app/gimpdrawableP.h app/gimpimage.c app/gimpimage.h app/gimpimageP.h app/internal_procs.c app/layer.c app/layer.h app/layer_cmds.c app/layer_cmds.h app/parasite_cmds.c app/perspective_tool.c app/plug_in.c app/procedural_db.c app/rotate_tool.c app/scale_tool.c app/shear_tool.c app/transform_core.c app/transform_core.h docs/parasites.txt libgimp/Makefile.am libgimp/gimp.c libgimp/gimp.h libgimp/gimpdrawable.c libgimp/gimpimage.c libgimp/gimpprotocol.c libgimp/gimpprotocol.h plug-ins/gif/gif.c plug-ins/script-fu/script-fu.c plug-ins/tiff/tiff.c Added Files: libgimp/gimpmatrix.c libgimp/gimpmatrix.h libgimp/parasite.c libgimp/parasite.h libgimp/parasiteF.h libgimp/parasiteP.h Removed Files: app/parasite.c app/parasite.h app/parasiteF.h app/parasiteP.h libgimp/gimpparasite.c libgimp/gimpparasite.h Tue Oct 13 19:24:03 1998 Jay Cox (jaycox@earthlink.net) * app/parasite.c * app/parasite.h * app/parasiteF.h * app/parasiteP.h : use a single name field instead of seperate creator/type fields. moved to libgimp/parasite* * libgimp/Makefile.am * libgimp/gimp.c * libgimp/gimp.h * libgimp/gimpdrawable.c * libgimp/gimpimage.c * libgimp/gimpprotocol.c * libgimp/gimpprotocol.h * app/Makefile.am * app/channel.c * app/channel.h * app/channel_cmds.c * app/channel_cmds.h * app/drawable_cmds.c * app/gimage_cmds.c * app/gimpdrawable.c * app/gimpdrawable.h * app/gimpdrawableP.h * app/gimpimage.c * app/gimpimage.h * app/gimpimageP.h * app/internal_procs.c * app/layer.c * app/layer.h * app/layer_cmds.c * app/layer_cmds.h * app/parasite_cmds.c * app/plug_in.c * app/procedural_db.c: Add tattoos to layers and drawables. Use new style parasites. * libgimp/gimpmatrix.c * libgimp/gimpmatrix.h: new files for matrix math. * app/perspective_tool.c * app/rotate_tool.c * app/scale_tool.c * app/shear_tool.c * app/transform_core.c * app/transform_core.h: use GimpMatrix instead of the old matrix code from transform_core. * ligimp/gimpparasite*: removed. now useing the same source for plug-ins and the core. * plug-ins/script-fu/script-fu.c * plug-ins/tiff/tiff.c * plug-ins/gif/gif.c: updated to use new style parasites.
1998-10-14 10:54:02 +08:00
#include "parasite.h"
#include "parasiteP.h"
#include <stdio.h>
1997-11-25 06:05:25 +08:00
1999-03-07 20:56:03 +08:00
static void _gp_quit_read (GIOChannel *channel, WireMessage *msg);
static void _gp_quit_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_quit_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_config_read (GIOChannel *channel, WireMessage *msg);
static void _gp_config_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_config_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_tile_req_read (GIOChannel *channel, WireMessage *msg);
static void _gp_tile_req_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_tile_req_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_tile_ack_read (GIOChannel *channel, WireMessage *msg);
static void _gp_tile_ack_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_tile_ack_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_tile_data_read (GIOChannel *channel, WireMessage *msg);
static void _gp_tile_data_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_tile_data_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_proc_run_read (GIOChannel *channel, WireMessage *msg);
static void _gp_proc_run_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_proc_run_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_proc_return_read (GIOChannel *channel, WireMessage *msg);
static void _gp_proc_return_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_proc_return_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_temp_proc_run_read (GIOChannel *channel, WireMessage *msg);
static void _gp_temp_proc_run_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_temp_proc_run_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_temp_proc_return_read (GIOChannel *channel, WireMessage *msg);
static void _gp_temp_proc_return_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_temp_proc_return_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_proc_install_read (GIOChannel *channel, WireMessage *msg);
static void _gp_proc_install_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_proc_install_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_proc_uninstall_read (GIOChannel *channel, WireMessage *msg);
static void _gp_proc_uninstall_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_proc_uninstall_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_extension_ack_read (GIOChannel *channel, WireMessage *msg);
static void _gp_extension_ack_write (GIOChannel *channel, WireMessage *msg);
1997-11-25 06:05:25 +08:00
static void _gp_extension_ack_destroy (WireMessage *msg);
1999-03-07 20:56:03 +08:00
static void _gp_request_wakeups_read (GIOChannel *channel, WireMessage *msg);
static void _gp_request_wakeups_write (GIOChannel *channel, WireMessage *msg);
static void _gp_request_wakeups_destroy (WireMessage *msg);
static void _gp_params_read (GIOChannel *channel, GPParam **params, guint *nparams);
static void _gp_params_write (GIOChannel *channel, GPParam *params, int nparams);
1997-11-25 06:05:25 +08:00
void _gp_params_destroy (GPParam *params, int nparams);
void
gp_init ()
{
wire_register (GP_QUIT,
_gp_quit_read,
_gp_quit_write,
_gp_quit_destroy);
wire_register (GP_CONFIG,
_gp_config_read,
_gp_config_write,
_gp_config_destroy);
wire_register (GP_TILE_REQ,
_gp_tile_req_read,
_gp_tile_req_write,
_gp_tile_req_destroy);
wire_register (GP_TILE_ACK,
_gp_tile_ack_read,
_gp_tile_ack_write,
_gp_tile_ack_destroy);
wire_register (GP_TILE_DATA,
_gp_tile_data_read,
_gp_tile_data_write,
_gp_tile_data_destroy);
wire_register (GP_PROC_RUN,
_gp_proc_run_read,
_gp_proc_run_write,
_gp_proc_run_destroy);
wire_register (GP_PROC_RETURN,
_gp_proc_return_read,
_gp_proc_return_write,
_gp_proc_return_destroy);
wire_register (GP_TEMP_PROC_RUN,
_gp_temp_proc_run_read,
_gp_temp_proc_run_write,
_gp_temp_proc_run_destroy);
wire_register (GP_TEMP_PROC_RETURN,
_gp_temp_proc_return_read,
_gp_temp_proc_return_write,
_gp_temp_proc_return_destroy);
wire_register (GP_PROC_INSTALL,
_gp_proc_install_read,
_gp_proc_install_write,
_gp_proc_install_destroy);
wire_register (GP_PROC_UNINSTALL,
_gp_proc_uninstall_read,
_gp_proc_uninstall_write,
_gp_proc_uninstall_destroy);
wire_register (GP_EXTENSION_ACK,
_gp_extension_ack_read,
_gp_extension_ack_write,
_gp_extension_ack_destroy);
1999-03-07 20:56:03 +08:00
wire_register (GP_REQUEST_WAKEUPS,
_gp_request_wakeups_read,
_gp_request_wakeups_write,
_gp_request_wakeups_destroy);
1997-11-25 06:05:25 +08:00
}
int
1999-03-07 20:56:03 +08:00
gp_quit_write (GIOChannel *channel)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_QUIT;
msg.data = NULL;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_config_write (GIOChannel *channel,
GPConfig *config)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_CONFIG;
msg.data = config;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_tile_req_write (GIOChannel *channel,
GPTileReq *tile_req)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_TILE_REQ;
msg.data = tile_req;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_tile_ack_write (GIOChannel *channel)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_TILE_ACK;
msg.data = NULL;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_tile_data_write (GIOChannel *channel,
1997-11-25 06:05:25 +08:00
GPTileData *tile_data)
{
WireMessage msg;
msg.type = GP_TILE_DATA;
msg.data = tile_data;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_proc_run_write (GIOChannel *channel,
GPProcRun *proc_run)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_PROC_RUN;
msg.data = proc_run;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_proc_return_write (GIOChannel *channel,
1997-11-25 06:05:25 +08:00
GPProcReturn *proc_return)
{
WireMessage msg;
msg.type = GP_PROC_RETURN;
msg.data = proc_return;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_temp_proc_run_write (GIOChannel *channel,
GPProcRun *proc_run)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_TEMP_PROC_RUN;
msg.data = proc_run;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_temp_proc_return_write (GIOChannel *channel,
1997-11-25 06:05:25 +08:00
GPProcReturn *proc_return)
{
WireMessage msg;
msg.type = GP_TEMP_PROC_RETURN;
msg.data = proc_return;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_proc_install_write (GIOChannel *channel,
1997-11-25 06:05:25 +08:00
GPProcInstall *proc_install)
{
WireMessage msg;
msg.type = GP_PROC_INSTALL;
msg.data = proc_install;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_proc_uninstall_write (GIOChannel *channel,
1997-11-25 06:05:25 +08:00
GPProcUninstall *proc_uninstall)
{
WireMessage msg;
msg.type = GP_PROC_UNINSTALL;
msg.data = proc_uninstall;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
int
1999-03-07 20:56:03 +08:00
gp_extension_ack_write (GIOChannel *channel)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_EXTENSION_ACK;
msg.data = NULL;
1999-03-07 20:56:03 +08:00
if (!wire_write_msg (channel, &msg))
1997-11-25 06:05:25 +08:00
return FALSE;
1999-03-07 20:56:03 +08:00
if (!wire_flush (channel))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
1999-03-07 20:56:03 +08:00
int
gp_request_wakeups_write (GIOChannel *channel)
{
WireMessage msg;
msg.type = GP_REQUEST_WAKEUPS;
msg.data = NULL;
if (!wire_write_msg (channel, &msg))
return FALSE;
if (!wire_flush (channel))
return FALSE;
return TRUE;
}
1997-11-25 06:05:25 +08:00
static void
1999-03-07 20:56:03 +08:00
_gp_quit_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
}
static void
1999-03-07 20:56:03 +08:00
_gp_quit_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_quit_destroy (WireMessage *msg)
{
}
static void
1999-03-07 20:56:03 +08:00
_gp_config_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPConfig *config;
config = g_new (GPConfig, 1);
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &config->version, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &config->tile_width, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &config->tile_height, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &config->shm_ID, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_double (channel, &config->gamma, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int8 (channel, (guint8*) &config->install_cmap, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int8 (channel, (guint8*) config->color_cube, 3))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &config->gdisp_ID, 1))
return;
1997-11-25 06:05:25 +08:00
msg->data = config;
}
static void
1999-03-07 20:56:03 +08:00
_gp_config_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPConfig *config;
config = msg->data;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &config->version, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &config->tile_width, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &config->tile_height, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &config->shm_ID, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_double (channel, &config->gamma, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int8 (channel, (guint8*) &config->install_cmap, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int8 (channel, (guint8*) config->color_cube, 3))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &config->gdisp_ID, 1))
return;
1997-11-25 06:05:25 +08:00
}
static void
_gp_config_destroy (WireMessage *msg)
{
g_free (msg->data);
}
static void
1999-03-07 20:56:03 +08:00
_gp_tile_req_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPTileReq *tile_req;
tile_req = g_new (GPTileReq, 1);
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &tile_req->drawable_ID, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &tile_req->tile_num, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &tile_req->shadow, 1))
1997-11-25 06:05:25 +08:00
return;
msg->data = tile_req;
}
static void
1999-03-07 20:56:03 +08:00
_gp_tile_req_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPTileReq *tile_req;
tile_req = msg->data;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &tile_req->drawable_ID, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &tile_req->tile_num, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &tile_req->shadow, 1))
1997-11-25 06:05:25 +08:00
return;
}
static void
_gp_tile_req_destroy (WireMessage *msg)
{
g_free (msg->data);
}
static void
1999-03-07 20:56:03 +08:00
_gp_tile_ack_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
}
static void
1999-03-07 20:56:03 +08:00
_gp_tile_ack_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_tile_ack_destroy (WireMessage *msg)
{
}
static void
1999-03-07 20:56:03 +08:00
_gp_tile_data_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPTileData *tile_data;
guint length;
tile_data = g_new (GPTileData, 1);
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &tile_data->drawable_ID, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &tile_data->tile_num, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &tile_data->shadow, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &tile_data->bpp, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &tile_data->width, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &tile_data->height, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &tile_data->use_shm, 1))
1997-11-25 06:05:25 +08:00
return;
tile_data->data = NULL;
if (!tile_data->use_shm)
{
length = tile_data->width * tile_data->height * tile_data->bpp;
tile_data->data = g_new (guchar, length);
1999-03-07 20:56:03 +08:00
if (!wire_read_int8 (channel, (guint8*) tile_data->data, length))
1997-11-25 06:05:25 +08:00
return;
}
msg->data = tile_data;
}
static void
1999-03-07 20:56:03 +08:00
_gp_tile_data_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPTileData *tile_data;
guint length;
tile_data = msg->data;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &tile_data->drawable_ID, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &tile_data->tile_num, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &tile_data->shadow, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &tile_data->bpp, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &tile_data->width, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &tile_data->height, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &tile_data->use_shm, 1))
1997-11-25 06:05:25 +08:00
return;
if (!tile_data->use_shm)
{
length = tile_data->width * tile_data->height * tile_data->bpp;
1999-03-07 20:56:03 +08:00
if (!wire_write_int8 (channel, (guint8*) tile_data->data, length))
1997-11-25 06:05:25 +08:00
return;
}
}
static void
_gp_tile_data_destroy (WireMessage *msg)
{
GPTileData *tile_data;
tile_data = msg->data;
if (tile_data->data)
g_free (tile_data->data);
g_free (tile_data);
}
static void
1999-03-07 20:56:03 +08:00
_gp_proc_run_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcRun *proc_run;
proc_run = g_new (GPProcRun, 1);
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_run->name, 1))
{
g_free (proc_run);
return;
}
1999-03-07 20:56:03 +08:00
_gp_params_read (channel, &proc_run->params, (guint*) &proc_run->nparams);
1997-11-25 06:05:25 +08:00
msg->data = proc_run;
}
static void
1999-03-07 20:56:03 +08:00
_gp_proc_run_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcRun *proc_run;
proc_run = msg->data;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_run->name, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
_gp_params_write (channel, proc_run->params, proc_run->nparams);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_run_destroy (WireMessage *msg)
{
GPProcRun *proc_run;
proc_run = msg->data;
_gp_params_destroy (proc_run->params, proc_run->nparams);
g_free (proc_run->name);
1997-11-25 06:05:25 +08:00
g_free (proc_run);
}
static void
1999-03-07 20:56:03 +08:00
_gp_proc_return_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcReturn *proc_return;
proc_return = g_new (GPProcReturn, 1);
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_return->name, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
_gp_params_read (channel, &proc_return->params, (guint*) &proc_return->nparams);
1997-11-25 06:05:25 +08:00
msg->data = proc_return;
}
static void
1999-03-07 20:56:03 +08:00
_gp_proc_return_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcReturn *proc_return;
proc_return = msg->data;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_return->name, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
_gp_params_write (channel, proc_return->params, proc_return->nparams);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_return_destroy (WireMessage *msg)
{
GPProcReturn *proc_return;
proc_return = msg->data;
_gp_params_destroy (proc_return->params, proc_return->nparams);
g_free (proc_return);
}
static void
1999-03-07 20:56:03 +08:00
_gp_temp_proc_run_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
1999-03-07 20:56:03 +08:00
_gp_proc_run_read (channel, msg);
1997-11-25 06:05:25 +08:00
}
static void
1999-03-07 20:56:03 +08:00
_gp_temp_proc_run_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
1999-03-07 20:56:03 +08:00
_gp_proc_run_write (channel, msg);
1997-11-25 06:05:25 +08:00
}
static void
_gp_temp_proc_run_destroy (WireMessage *msg)
{
_gp_proc_run_destroy (msg);
}
static void
1999-03-07 20:56:03 +08:00
_gp_temp_proc_return_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
1999-03-07 20:56:03 +08:00
_gp_proc_return_read (channel, msg);
1997-11-25 06:05:25 +08:00
}
static void
1999-03-07 20:56:03 +08:00
_gp_temp_proc_return_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
1999-03-07 20:56:03 +08:00
_gp_proc_return_write (channel, msg);
1997-11-25 06:05:25 +08:00
}
static void
_gp_temp_proc_return_destroy (WireMessage *msg)
{
_gp_proc_return_destroy (msg);
}
static void
1999-03-07 20:56:03 +08:00
_gp_proc_install_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcInstall *proc_install;
int i;
proc_install = g_new (GPProcInstall, 1);
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->name, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->blurb, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->help, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->author, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->copyright, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->date, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->menu_path, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->image_types, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &proc_install->type, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &proc_install->nparams, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &proc_install->nreturn_vals, 1))
1997-11-25 06:05:25 +08:00
return;
proc_install->params = g_new (GPParamDef, proc_install->nparams);
proc_install->return_vals = g_new (GPParamDef, proc_install->nreturn_vals);
for (i = 0; i < proc_install->nparams; i++)
{
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &proc_install->params[i].type, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->params[i].name, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->params[i].description, 1))
1997-11-25 06:05:25 +08:00
return;
}
for (i = 0; i < proc_install->nreturn_vals; i++)
{
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &proc_install->return_vals[i].type, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->return_vals[i].name, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_install->return_vals[i].description, 1))
1997-11-25 06:05:25 +08:00
return;
}
msg->data = proc_install;
}
static void
1999-03-07 20:56:03 +08:00
_gp_proc_install_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcInstall *proc_install;
int i;
proc_install = msg->data;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->name, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->blurb, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->help, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->author, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->copyright, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->date, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->menu_path, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->image_types, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &proc_install->type, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &proc_install->nparams, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &proc_install->nreturn_vals, 1))
1997-11-25 06:05:25 +08:00
return;
for (i = 0; i < proc_install->nparams; i++)
{
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &proc_install->params[i].type, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->params[i].name, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->params[i].description, 1))
1997-11-25 06:05:25 +08:00
return;
}
for (i = 0; i < proc_install->nreturn_vals; i++)
{
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &proc_install->return_vals[i].type, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->return_vals[i].name, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_install->return_vals[i].description, 1))
1997-11-25 06:05:25 +08:00
return;
}
}
static void
_gp_proc_install_destroy (WireMessage *msg)
{
GPProcInstall *proc_install;
int i;
proc_install = msg->data;
g_free (proc_install->name);
g_free (proc_install->blurb);
g_free (proc_install->help);
g_free (proc_install->author);
g_free (proc_install->copyright);
g_free (proc_install->date);
g_free (proc_install->menu_path);
g_free (proc_install->image_types);
for (i = 0; i < proc_install->nparams; i++)
{
g_free (proc_install->params[i].name);
g_free (proc_install->params[i].description);
}
for (i = 0; i < proc_install->nreturn_vals; i++)
{
g_free (proc_install->return_vals[i].name);
g_free (proc_install->return_vals[i].description);
}
g_free (proc_install->params);
g_free (proc_install->return_vals);
1997-11-25 06:05:25 +08:00
g_free (proc_install);
}
static void
1999-03-07 20:56:03 +08:00
_gp_proc_uninstall_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcUninstall *proc_uninstall;
proc_uninstall = g_new (GPProcUninstall, 1);
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &proc_uninstall->name, 1))
1997-11-25 06:05:25 +08:00
return;
msg->data = proc_uninstall;
}
static void
1999-03-07 20:56:03 +08:00
_gp_proc_uninstall_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcUninstall *proc_uninstall;
proc_uninstall = msg->data;
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &proc_uninstall->name, 1))
1997-11-25 06:05:25 +08:00
return;
}
static void
_gp_proc_uninstall_destroy (WireMessage *msg)
{
GPProcUninstall *proc_uninstall;
proc_uninstall = msg->data;
g_free (proc_uninstall->name);
g_free (proc_uninstall);
}
static void
1999-03-07 20:56:03 +08:00
_gp_params_read (GIOChannel *channel, GPParam **params, guint *nparams)
1997-11-25 06:05:25 +08:00
{
int i;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) nparams, 1))
1997-11-25 06:05:25 +08:00
return;
if (*nparams == 0)
{
*params = NULL;
return;
}
*params = g_new (GPParam, *nparams);
for (i = 0; i < *nparams; i++)
{
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].type, 1))
1997-11-25 06:05:25 +08:00
return;
switch ((*params)[i].type)
{
case PARAM_INT32:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_int32, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_INT16:
1999-03-07 20:56:03 +08:00
if (!wire_read_int16 (channel, (guint16*) &(*params)[i].data.d_int16, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_INT8:
1999-03-07 20:56:03 +08:00
if (!wire_read_int8 (channel, (guint8*) &(*params)[i].data.d_int8, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_FLOAT:
1999-03-07 20:56:03 +08:00
if (!wire_read_double (channel, &(*params)[i].data.d_float, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_STRING:
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &(*params)[i].data.d_string, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_INT32ARRAY:
(*params)[i].data.d_int32array = g_new (gint32, (*params)[i-1].data.d_int32);
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) (*params)[i].data.d_int32array,
1997-11-25 06:05:25 +08:00
(*params)[i-1].data.d_int32))
return;
break;
case PARAM_INT16ARRAY:
(*params)[i].data.d_int16array = g_new (gint16, (*params)[i-1].data.d_int32);
1999-03-07 20:56:03 +08:00
if (!wire_read_int16 (channel, (guint16*) (*params)[i].data.d_int16array,
1997-11-25 06:05:25 +08:00
(*params)[i-1].data.d_int32))
return;
break;
case PARAM_INT8ARRAY:
(*params)[i].data.d_int8array = g_new (gint8, (*params)[i-1].data.d_int32);
1999-03-07 20:56:03 +08:00
if (!wire_read_int8 (channel, (guint8*) (*params)[i].data.d_int8array,
1997-11-25 06:05:25 +08:00
(*params)[i-1].data.d_int32))
return;
break;
case PARAM_FLOATARRAY:
(*params)[i].data.d_floatarray = g_new (gdouble, (*params)[i-1].data.d_int32);
1999-03-07 20:56:03 +08:00
if (!wire_read_double (channel, (*params)[i].data.d_floatarray,
1997-11-25 06:05:25 +08:00
(*params)[i-1].data.d_int32))
return;
break;
case PARAM_STRINGARRAY:
(*params)[i].data.d_stringarray = g_new (gchar*, (*params)[i-1].data.d_int32);
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, (*params)[i].data.d_stringarray,
1997-11-25 06:05:25 +08:00
(*params)[i-1].data.d_int32))
return;
break;
case PARAM_COLOR:
1999-03-07 20:56:03 +08:00
if (!wire_read_int8 (channel, (guint8*) &(*params)[i].data.d_color.red, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int8 (channel, (guint8*) &(*params)[i].data.d_color.green, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int8 (channel, (guint8*) &(*params)[i].data.d_color.blue, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_REGION:
break;
case PARAM_DISPLAY:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_display, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_IMAGE:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_image, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_LAYER:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_layer, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_CHANNEL:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_channel, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_DRAWABLE:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_drawable, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_SELECTION:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_selection, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_BOUNDARY:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_boundary, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_PATH:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_path, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_PARASITE:
{
1999-03-07 20:56:03 +08:00
if (!wire_read_string (channel, &(*params)[i].data.d_parasite.name, 1))
return;
if ((*params)[i].data.d_parasite.name == NULL)
{ /* we have a null parasite */
(*params)[i].data.d_parasite.data = NULL;
break;
}
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &((*params)[i].data.d_parasite.flags), 1))
return;
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, &((*params)[i].data.d_parasite.size), 1))
return;
if ((*params)[i].data.d_parasite.size > 0)
{
(*params)[i].data.d_parasite.data = g_malloc((*params)[i].data.d_parasite.size);
1999-03-07 20:56:03 +08:00
if (!wire_read_int8 (channel, (*params)[i].data.d_parasite.data,
(*params)[i].data.d_parasite.size))
{
g_free((*params)[i].data.d_parasite.data);
(*params)[i].data.d_parasite.data = NULL;
return;
}
}
else
(*params)[i].data.d_parasite.data = NULL;
} break;
1997-11-25 06:05:25 +08:00
case PARAM_STATUS:
1999-03-07 20:56:03 +08:00
if (!wire_read_int32 (channel, (guint32*) &(*params)[i].data.d_status, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_END:
break;
}
}
}
static void
1999-03-07 20:56:03 +08:00
_gp_params_write (GIOChannel *channel, GPParam *params, int nparams)
1997-11-25 06:05:25 +08:00
{
int i;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &nparams, 1))
1997-11-25 06:05:25 +08:00
return;
for (i = 0; i < nparams; i++)
{
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].type, 1))
1997-11-25 06:05:25 +08:00
return;
switch (params[i].type)
{
case PARAM_INT32:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_int32, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_INT16:
1999-03-07 20:56:03 +08:00
if (!wire_write_int16 (channel, (guint16*) &params[i].data.d_int16, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_INT8:
1999-03-07 20:56:03 +08:00
if (!wire_write_int8 (channel, (guint8*) &params[i].data.d_int8, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_FLOAT:
1999-03-07 20:56:03 +08:00
if (!wire_write_double (channel, &params[i].data.d_float, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_STRING:
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &params[i].data.d_string, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_INT32ARRAY:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) params[i].data.d_int32array,
1997-11-25 06:05:25 +08:00
params[i-1].data.d_int32))
return;
break;
case PARAM_INT16ARRAY:
1999-03-07 20:56:03 +08:00
if (!wire_write_int16 (channel, (guint16*) params[i].data.d_int16array,
1997-11-25 06:05:25 +08:00
params[i-1].data.d_int32))
return;
break;
case PARAM_INT8ARRAY:
1999-03-07 20:56:03 +08:00
if (!wire_write_int8 (channel, (guint8*) params[i].data.d_int8array,
1997-11-25 06:05:25 +08:00
params[i-1].data.d_int32))
return;
break;
case PARAM_FLOATARRAY:
1999-03-07 20:56:03 +08:00
if (!wire_write_double (channel, params[i].data.d_floatarray,
1997-11-25 06:05:25 +08:00
params[i-1].data.d_int32))
return;
break;
case PARAM_STRINGARRAY:
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, params[i].data.d_stringarray,
1997-11-25 06:05:25 +08:00
params[i-1].data.d_int32))
return;
break;
case PARAM_COLOR:
1999-03-07 20:56:03 +08:00
if (!wire_write_int8 (channel, (guint8*) &params[i].data.d_color.red, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int8 (channel, (guint8*) &params[i].data.d_color.green, 1))
1997-11-25 06:05:25 +08:00
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int8 (channel, (guint8*) &params[i].data.d_color.blue, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_REGION:
break;
case PARAM_DISPLAY:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_display, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_IMAGE:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_image, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_LAYER:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_layer, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_CHANNEL:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_channel, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_DRAWABLE:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_drawable, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_SELECTION:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_selection, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_BOUNDARY:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_boundary, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_PATH:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_path, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_PARASITE:
{
Modified Files: ChangeLog app/Makefile.am app/channel.c app/channel.h Modified Files: ChangeLog app/Makefile.am app/channel.c app/channel.h app/channel_cmds.c app/channel_cmds.h app/drawable_cmds.c app/gimage_cmds.c app/gimpdrawable.c app/gimpdrawable.h app/gimpdrawableP.h app/gimpimage.c app/gimpimage.h app/gimpimageP.h app/internal_procs.c app/layer.c app/layer.h app/layer_cmds.c app/layer_cmds.h app/parasite_cmds.c app/perspective_tool.c app/plug_in.c app/procedural_db.c app/rotate_tool.c app/scale_tool.c app/shear_tool.c app/transform_core.c app/transform_core.h docs/parasites.txt libgimp/Makefile.am libgimp/gimp.c libgimp/gimp.h libgimp/gimpdrawable.c libgimp/gimpimage.c libgimp/gimpprotocol.c libgimp/gimpprotocol.h plug-ins/gif/gif.c plug-ins/script-fu/script-fu.c plug-ins/tiff/tiff.c Added Files: libgimp/gimpmatrix.c libgimp/gimpmatrix.h libgimp/parasite.c libgimp/parasite.h libgimp/parasiteF.h libgimp/parasiteP.h Removed Files: app/parasite.c app/parasite.h app/parasiteF.h app/parasiteP.h libgimp/gimpparasite.c libgimp/gimpparasite.h Tue Oct 13 19:24:03 1998 Jay Cox (jaycox@earthlink.net) * app/parasite.c * app/parasite.h * app/parasiteF.h * app/parasiteP.h : use a single name field instead of seperate creator/type fields. moved to libgimp/parasite* * libgimp/Makefile.am * libgimp/gimp.c * libgimp/gimp.h * libgimp/gimpdrawable.c * libgimp/gimpimage.c * libgimp/gimpprotocol.c * libgimp/gimpprotocol.h * app/Makefile.am * app/channel.c * app/channel.h * app/channel_cmds.c * app/channel_cmds.h * app/drawable_cmds.c * app/gimage_cmds.c * app/gimpdrawable.c * app/gimpdrawable.h * app/gimpdrawableP.h * app/gimpimage.c * app/gimpimage.h * app/gimpimageP.h * app/internal_procs.c * app/layer.c * app/layer.h * app/layer_cmds.c * app/layer_cmds.h * app/parasite_cmds.c * app/plug_in.c * app/procedural_db.c: Add tattoos to layers and drawables. Use new style parasites. * libgimp/gimpmatrix.c * libgimp/gimpmatrix.h: new files for matrix math. * app/perspective_tool.c * app/rotate_tool.c * app/scale_tool.c * app/shear_tool.c * app/transform_core.c * app/transform_core.h: use GimpMatrix instead of the old matrix code from transform_core. * ligimp/gimpparasite*: removed. now useing the same source for plug-ins and the core. * plug-ins/script-fu/script-fu.c * plug-ins/tiff/tiff.c * plug-ins/gif/gif.c: updated to use new style parasites.
1998-10-14 10:54:02 +08:00
Parasite *p = (Parasite *)&params[i].data.d_parasite;
if (p->name == NULL)
{ /* write a null string to signifly a null parasite */
1999-03-07 20:56:03 +08:00
wire_write_string (channel, &p->name, 1);
break;
}
1999-03-07 20:56:03 +08:00
if (!wire_write_string (channel, &p->name, 1))
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &p->flags, 1))
return;
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, &p->size, 1))
return;
if (p->size > 0)
{
1999-03-07 20:56:03 +08:00
if (!wire_write_int8 (channel, p->data, p->size))
return;
}
} break;
1997-11-25 06:05:25 +08:00
case PARAM_STATUS:
1999-03-07 20:56:03 +08:00
if (!wire_write_int32 (channel, (guint32*) &params[i].data.d_status, 1))
1997-11-25 06:05:25 +08:00
return;
break;
case PARAM_END:
break;
}
}
}
static void
1999-03-07 20:56:03 +08:00
_gp_extension_ack_read (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
}
static void
1999-03-07 20:56:03 +08:00
_gp_extension_ack_write (GIOChannel *channel, WireMessage *msg)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_extension_ack_destroy (WireMessage *msg)
{
}
1999-03-07 20:56:03 +08:00
static void
_gp_request_wakeups_read (GIOChannel *channel, WireMessage *msg)
{
}
static void
_gp_request_wakeups_write (GIOChannel *channel, WireMessage *msg)
{
}
static void
_gp_request_wakeups_destroy (WireMessage *msg)
{
}
1997-11-25 06:05:25 +08:00
void
_gp_params_destroy (GPParam *params, int nparams)
{
int count;
int i, j;
for (i = 0; i < nparams; i++)
{
switch (params[i].type)
{
case PARAM_INT32:
case PARAM_INT16:
case PARAM_INT8:
case PARAM_FLOAT:
case PARAM_COLOR:
case PARAM_REGION:
case PARAM_DISPLAY:
case PARAM_IMAGE:
case PARAM_LAYER:
case PARAM_CHANNEL:
case PARAM_DRAWABLE:
case PARAM_SELECTION:
case PARAM_BOUNDARY:
case PARAM_PATH:
case PARAM_STATUS:
break;
case PARAM_STRING:
g_free (params[i].data.d_string);
break;
case PARAM_INT32ARRAY:
g_free (params[i].data.d_int32array);
break;
case PARAM_INT16ARRAY:
g_free (params[i].data.d_int16array);
break;
case PARAM_INT8ARRAY:
g_free (params[i].data.d_int8array);
break;
case PARAM_FLOATARRAY:
g_free (params[i].data.d_floatarray);
break;
case PARAM_STRINGARRAY:
if ((i > 0) && (params[i-1].type == PARAM_INT32))
{
count = params[i-1].data.d_int32;
for (j = 0; j < count; j++)
g_free (params[i].data.d_stringarray[j]);
g_free (params[i].data.d_stringarray);
}
break;
case PARAM_PARASITE:
if (params[i].data.d_parasite.name)
g_free(params[i].data.d_parasite.name);
if (params[i].data.d_parasite.data)
g_free(params[i].data.d_parasite.data);
break;
1997-11-25 06:05:25 +08:00
case PARAM_END:
break;
}
}
g_free (params);
}