2001-05-21 21:58:46 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
|
|
|
* 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
|
2001-05-21 21:58:46 +08:00
|
|
|
* 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
|
1998-01-25 18:26:47 +08:00
|
|
|
* 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
|
1998-04-13 13:44:11 +08:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
2001-05-21 21:58:46 +08:00
|
|
|
*/
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2004-07-29 20:33:15 +08:00
|
|
|
#include <glib-object.h>
|
2000-05-27 09:30:21 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
#include "gimpbasetypes.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2000-05-27 09:30:21 +08:00
|
|
|
#include "gimpparasite.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimpprotocol.h"
|
|
|
|
#include "gimpwire.h"
|
|
|
|
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
static void _gp_quit_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_quit_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_quit_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_config_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_config_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_config_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_tile_req_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_tile_req_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_tile_req_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_tile_ack_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_tile_ack_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_tile_ack_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_tile_data_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_tile_data_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_tile_data_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_proc_run_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_proc_run_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_proc_run_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_proc_return_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_proc_return_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_proc_return_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_temp_proc_run_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_temp_proc_run_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_temp_proc_run_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_temp_proc_return_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_temp_proc_return_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_temp_proc_return_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_proc_install_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_proc_install_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_proc_install_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_proc_uninstall_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_proc_uninstall_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_proc_uninstall_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_extension_ack_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_extension_ack_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_extension_ack_destroy (GimpWireMessage *msg);
|
|
|
|
|
|
|
|
static void _gp_params_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPParam **params,
|
|
|
|
guint *nparams,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_params_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPParam *params,
|
|
|
|
gint nparams,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
static void _gp_has_init_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_has_init_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static void _gp_has_init_destroy (GimpWireMessage *msg);
|
2002-02-12 15:59:16 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
void
|
2000-03-04 08:24:39 +08:00
|
|
|
gp_init (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
gimp_wire_register (GP_QUIT,
|
|
|
|
_gp_quit_read,
|
|
|
|
_gp_quit_write,
|
|
|
|
_gp_quit_destroy);
|
|
|
|
gimp_wire_register (GP_CONFIG,
|
|
|
|
_gp_config_read,
|
|
|
|
_gp_config_write,
|
|
|
|
_gp_config_destroy);
|
|
|
|
gimp_wire_register (GP_TILE_REQ,
|
|
|
|
_gp_tile_req_read,
|
|
|
|
_gp_tile_req_write,
|
|
|
|
_gp_tile_req_destroy);
|
|
|
|
gimp_wire_register (GP_TILE_ACK,
|
|
|
|
_gp_tile_ack_read,
|
|
|
|
_gp_tile_ack_write,
|
|
|
|
_gp_tile_ack_destroy);
|
|
|
|
gimp_wire_register (GP_TILE_DATA,
|
|
|
|
_gp_tile_data_read,
|
|
|
|
_gp_tile_data_write,
|
|
|
|
_gp_tile_data_destroy);
|
|
|
|
gimp_wire_register (GP_PROC_RUN,
|
|
|
|
_gp_proc_run_read,
|
|
|
|
_gp_proc_run_write,
|
|
|
|
_gp_proc_run_destroy);
|
|
|
|
gimp_wire_register (GP_PROC_RETURN,
|
|
|
|
_gp_proc_return_read,
|
|
|
|
_gp_proc_return_write,
|
|
|
|
_gp_proc_return_destroy);
|
|
|
|
gimp_wire_register (GP_TEMP_PROC_RUN,
|
|
|
|
_gp_temp_proc_run_read,
|
|
|
|
_gp_temp_proc_run_write,
|
|
|
|
_gp_temp_proc_run_destroy);
|
|
|
|
gimp_wire_register (GP_TEMP_PROC_RETURN,
|
|
|
|
_gp_temp_proc_return_read,
|
|
|
|
_gp_temp_proc_return_write,
|
|
|
|
_gp_temp_proc_return_destroy);
|
|
|
|
gimp_wire_register (GP_PROC_INSTALL,
|
|
|
|
_gp_proc_install_read,
|
|
|
|
_gp_proc_install_write,
|
|
|
|
_gp_proc_install_destroy);
|
|
|
|
gimp_wire_register (GP_PROC_UNINSTALL,
|
|
|
|
_gp_proc_uninstall_read,
|
|
|
|
_gp_proc_uninstall_write,
|
|
|
|
_gp_proc_uninstall_destroy);
|
|
|
|
gimp_wire_register (GP_EXTENSION_ACK,
|
|
|
|
_gp_extension_ack_read,
|
|
|
|
_gp_extension_ack_write,
|
|
|
|
_gp_extension_ack_destroy);
|
|
|
|
gimp_wire_register (GP_HAS_INIT,
|
|
|
|
_gp_has_init_read,
|
|
|
|
_gp_has_init_write,
|
|
|
|
_gp_has_init_destroy);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
2002-05-17 01:41:38 +08:00
|
|
|
gp_quit_write (GIOChannel *channel,
|
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_QUIT;
|
|
|
|
msg.data = NULL;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
gp_config_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPConfig *config,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_CONFIG;
|
|
|
|
msg.data = config;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
gp_tile_req_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPTileReq *tile_req,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_TILE_REQ;
|
|
|
|
msg.data = tile_req;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
2002-05-17 01:41:38 +08:00
|
|
|
gp_tile_ack_write (GIOChannel *channel,
|
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_TILE_ACK;
|
|
|
|
msg.data = NULL;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
gp_tile_data_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPTileData *tile_data,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_TILE_DATA;
|
|
|
|
msg.data = tile_data;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
gp_proc_run_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPProcRun *proc_run,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_PROC_RUN;
|
|
|
|
msg.data = proc_run;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
gp_proc_return_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPProcReturn *proc_return,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_PROC_RETURN;
|
|
|
|
msg.data = proc_return;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
gp_temp_proc_run_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPProcRun *proc_run,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_TEMP_PROC_RUN;
|
|
|
|
msg.data = proc_run;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
gp_temp_proc_return_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPProcReturn *proc_return,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_TEMP_PROC_RETURN;
|
|
|
|
msg.data = proc_return;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
gp_proc_install_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPProcInstall *proc_install,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_PROC_INSTALL;
|
|
|
|
msg.data = proc_install;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
1999-03-07 20:56:03 +08:00
|
|
|
gp_proc_uninstall_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPProcUninstall *proc_uninstall,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_PROC_UNINSTALL;
|
|
|
|
msg.data = proc_uninstall;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
gboolean
|
2002-05-17 01:41:38 +08:00
|
|
|
gp_extension_ack_write (GIOChannel *channel,
|
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg.type = GP_EXTENSION_ACK;
|
|
|
|
msg.data = NULL;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-02-12 15:59:16 +08:00
|
|
|
gboolean
|
2002-05-17 01:41:38 +08:00
|
|
|
gp_has_init_write (GIOChannel *channel,
|
|
|
|
gpointer user_data)
|
2002-02-12 15:59:16 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
GimpWireMessage msg;
|
2002-02-12 15:59:16 +08:00
|
|
|
|
|
|
|
msg.type = GP_HAS_INIT;
|
|
|
|
msg.data = NULL;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_write_msg (channel, &msg, user_data))
|
2002-02-12 15:59:16 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! gimp_wire_flush (channel, user_data))
|
2002-02-12 15:59:16 +08:00
|
|
|
return FALSE;
|
2005-01-15 19:55:34 +08:00
|
|
|
|
2002-02-12 15:59:16 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* quit */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_quit_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_quit_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_quit_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* config */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_config_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2007-05-22 21:09:56 +08:00
|
|
|
GPConfig *config = g_slice_new0 (GPConfig);
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&config->version, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&config->tile_width, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&config->tile_height, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &config->shm_ID, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) &config->check_size, 1, user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) &config->check_type, 1, user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) &config->show_help_button, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
2006-06-01 23:34:58 +08:00
|
|
|
(guint8 *) &config->use_cpu_accel, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) &config->gimp_reserved_5, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) &config->gimp_reserved_6, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) &config->gimp_reserved_7, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) &config->gimp_reserved_8, 1,
|
|
|
|
user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) &config->install_cmap, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
2006-03-11 00:40:09 +08:00
|
|
|
(guint8 *) &config->show_tooltips, 1, user_data))
|
2000-05-01 02:17:55 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &config->min_colors, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &config->gdisp_ID, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&config->app_name, 1, user_data))
|
2003-11-08 01:29:02 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&config->wm_class, 1, user_data))
|
2003-11-08 01:29:02 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&config->display_name, 1, user_data))
|
2003-11-08 01:29:02 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &config->monitor_number, 1,
|
|
|
|
user_data))
|
2003-11-08 01:29:02 +08:00
|
|
|
goto cleanup;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
msg->data = config;
|
2000-03-04 08:24:39 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
2004-02-17 22:03:07 +08:00
|
|
|
g_free (config->app_name);
|
2003-11-08 01:29:02 +08:00
|
|
|
g_free (config->wm_class);
|
|
|
|
g_free (config->display_name);
|
2007-05-22 21:09:56 +08:00
|
|
|
g_slice_free (GPConfig, config);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_config_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPConfig *config = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&config->version, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&config->tile_width, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&config->tile_height, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) &config->shm_ID, 1,
|
|
|
|
user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) &config->check_size, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) &config->check_type, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) &config->show_help_button, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
2006-06-01 23:34:58 +08:00
|
|
|
(const guint8 *) &config->use_cpu_accel, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) &config->gimp_reserved_5, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) &config->gimp_reserved_6, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) &config->gimp_reserved_7, 1,
|
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) &config->gimp_reserved_8, 1,
|
|
|
|
user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) &config->install_cmap, 1,
|
|
|
|
user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
2006-03-11 00:40:09 +08:00
|
|
|
(const guint8 *) &config->show_tooltips, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
user_data))
|
2000-05-01 02:17:55 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) &config->min_colors, 1,
|
|
|
|
user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) &config->gdisp_ID, 1,
|
|
|
|
user_data))
|
1998-06-14 12:33:27 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&config->app_name, 1, user_data))
|
2003-11-08 01:29:02 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&config->wm_class, 1, user_data))
|
2003-11-08 01:29:02 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&config->display_name, 1, user_data))
|
2003-11-08 01:29:02 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) &config->monitor_number, 1,
|
|
|
|
user_data))
|
2003-11-08 01:29:02 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_config_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPConfig *config = msg->data;
|
2003-11-08 01:29:02 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
if (config)
|
|
|
|
{
|
|
|
|
g_free (config->app_name);
|
|
|
|
g_free (config->wm_class);
|
|
|
|
g_free (config->display_name);
|
|
|
|
g_slice_free (GPConfig, config);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* tile_req */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_tile_req_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2007-05-22 21:09:56 +08:00
|
|
|
GPTileReq *tile_req = g_slice_new0 (GPTileReq);
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &tile_req->drawable_ID, 1,
|
|
|
|
user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&tile_req->tile_num, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&tile_req->shadow, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg->data = tile_req;
|
2000-03-04 08:24:39 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
2007-05-22 21:09:56 +08:00
|
|
|
g_slice_free (GPTileReq, tile_req);
|
2007-12-11 17:40:10 +08:00
|
|
|
msg->data = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_tile_req_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPTileReq *tile_req = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) &tile_req->drawable_ID, 1,
|
|
|
|
user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&tile_req->tile_num, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&tile_req->shadow, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_tile_req_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2007-12-11 17:40:10 +08:00
|
|
|
GPTileReq *tile_req = msg->data;
|
|
|
|
|
|
|
|
if (tile_req)
|
|
|
|
g_slice_free (GPTileReq, msg->data);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* tile_ack */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_tile_ack_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_tile_ack_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_tile_ack_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* tile_data */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_tile_data_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2007-05-22 21:09:56 +08:00
|
|
|
GPTileData *tile_data = g_slice_new0 (GPTileData);
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &tile_data->drawable_ID, 1,
|
|
|
|
user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&tile_data->tile_num, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&tile_data->shadow, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&tile_data->bpp, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&tile_data->width, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&tile_data->height, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&tile_data->use_shm, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!tile_data->use_shm)
|
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
guint length = tile_data->width * tile_data->height * tile_data->bpp;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
tile_data->data = g_new (guchar, length);
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) tile_data->data, length,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
msg->data = tile_data;
|
2000-03-04 08:24:39 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
|
|
|
g_free (tile_data->data);
|
2007-05-22 21:09:56 +08:00
|
|
|
g_slice_free (GPTileData, tile_data);
|
2007-12-11 17:40:10 +08:00
|
|
|
msg->data = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_tile_data_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPTileData *tile_data = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) &tile_data->drawable_ID, 1,
|
|
|
|
user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&tile_data->tile_num, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&tile_data->shadow, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&tile_data->bpp, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&tile_data->width, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&tile_data->height, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&tile_data->use_shm, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (!tile_data->use_shm)
|
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
guint length = tile_data->width * tile_data->height * tile_data->bpp;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) tile_data->data, length,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_tile_data_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPTileData *tile_data = msg->data;
|
2000-03-03 21:37:23 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
if (tile_data)
|
|
|
|
{
|
|
|
|
g_free (tile_data->data);
|
|
|
|
g_slice_free (GPTileData, tile_data);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* proc_run */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_run_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2007-05-22 21:09:56 +08:00
|
|
|
GPProcRun *proc_run = g_slice_new0 (GPProcRun);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel, &proc_run->name, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
|
|
|
|
2002-05-17 01:41:38 +08:00
|
|
|
_gp_params_read (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
&proc_run->params, (guint *) &proc_run->nparams,
|
2002-05-17 01:41:38 +08:00
|
|
|
user_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg->data = proc_run;
|
2000-03-04 08:24:39 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
2007-05-22 21:09:56 +08:00
|
|
|
g_slice_free (GPProcRun, proc_run);
|
2007-12-11 17:40:10 +08:00
|
|
|
msg->data = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_run_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPProcRun *proc_run = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel, &proc_run->name, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2002-05-17 01:41:38 +08:00
|
|
|
_gp_params_write (channel, proc_run->params, proc_run->nparams, user_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_run_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPProcRun *proc_run = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
if (proc_run)
|
|
|
|
{
|
|
|
|
gp_params_destroy (proc_run->params, proc_run->nparams);
|
2000-03-03 21:37:23 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
g_free (proc_run->name);
|
|
|
|
g_slice_free (GPProcRun, proc_run);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* proc_return */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_return_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2007-05-22 21:09:56 +08:00
|
|
|
GPProcReturn *proc_return = g_slice_new0 (GPProcReturn);
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel, &proc_return->name, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
|
|
|
|
2002-05-17 01:41:38 +08:00
|
|
|
_gp_params_read (channel,
|
2005-01-15 19:55:34 +08:00
|
|
|
&proc_return->params, (guint *) &proc_return->nparams,
|
2002-05-17 01:41:38 +08:00
|
|
|
user_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg->data = proc_return;
|
2000-03-04 08:24:39 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
2007-05-22 21:09:56 +08:00
|
|
|
g_slice_free (GPProcReturn, proc_return);
|
2007-12-11 17:40:10 +08:00
|
|
|
msg->data = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_return_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPProcReturn *proc_return = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel, &proc_return->name, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2002-05-17 01:41:38 +08:00
|
|
|
|
2005-01-15 19:55:34 +08:00
|
|
|
_gp_params_write (channel,
|
|
|
|
proc_return->params, proc_return->nparams, user_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_return_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPProcReturn *proc_return = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
if (proc_return)
|
|
|
|
{
|
|
|
|
gp_params_destroy (proc_return->params, proc_return->nparams);
|
2000-03-03 21:37:23 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
g_free (proc_return->name);
|
|
|
|
g_slice_free (GPProcReturn, proc_return);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* temp_proc_run */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_temp_proc_run_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-05-17 01:41:38 +08:00
|
|
|
_gp_proc_run_read (channel, msg, user_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_temp_proc_run_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-05-17 01:41:38 +08:00
|
|
|
_gp_proc_run_write (channel, msg, user_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_temp_proc_run_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
_gp_proc_run_destroy (msg);
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* temp_proc_return */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_temp_proc_return_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-05-17 01:41:38 +08:00
|
|
|
_gp_proc_return_read (channel, msg, user_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_temp_proc_return_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-05-17 01:41:38 +08:00
|
|
|
_gp_proc_return_write (channel, msg, user_data);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_temp_proc_return_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
_gp_proc_return_destroy (msg);
|
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* proc_install */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_install_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2007-05-22 21:09:56 +08:00
|
|
|
GPProcInstall *proc_install = g_slice_new0 (GPProcInstall);
|
2005-01-15 19:55:34 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->name, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->blurb, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->help, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->author, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->copyright, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->date, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->menu_path, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->image_types, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&proc_install->type, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&proc_install->nparams, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&proc_install->nreturn_vals, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
proc_install->params = g_new0 (GPParamDef, proc_install->nparams);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
for (i = 0; i < proc_install->nparams; i++)
|
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &proc_install->params[i].type, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->params[i].name, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->params[i].description, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
proc_install->return_vals = g_new0 (GPParamDef, proc_install->nreturn_vals);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
for (i = 0; i < proc_install->nreturn_vals; i++)
|
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &proc_install->return_vals[i].type, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->return_vals[i].name, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&proc_install->return_vals[i].description, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
msg->data = proc_install;
|
2000-03-04 08:24:39 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
|
|
|
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);
|
|
|
|
|
|
|
|
if (proc_install->params)
|
|
|
|
{
|
|
|
|
for (i = 0; i < proc_install->nparams; i++)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
if (!proc_install->params[i].name)
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
g_free (proc_install->params[i].name);
|
|
|
|
g_free (proc_install->params[i].description);
|
|
|
|
}
|
2000-03-04 08:24:39 +08:00
|
|
|
|
|
|
|
g_free (proc_install->params);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (proc_install->return_vals)
|
|
|
|
{
|
|
|
|
for (i = 0; i < proc_install->nreturn_vals; i++)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
if (!proc_install->return_vals[i].name)
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
g_free (proc_install->return_vals[i].name);
|
|
|
|
g_free (proc_install->return_vals[i].description);
|
|
|
|
}
|
2000-03-04 08:24:39 +08:00
|
|
|
|
|
|
|
g_free (proc_install->return_vals);
|
|
|
|
}
|
|
|
|
|
2007-05-22 21:09:56 +08:00
|
|
|
g_slice_free (GPProcInstall, proc_install);
|
2007-12-11 17:40:10 +08:00
|
|
|
msg->data = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_install_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPProcInstall *proc_install = msg->data;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->name, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->blurb, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->help, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->author, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->copyright, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->date, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->menu_path, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->image_types, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&proc_install->type, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&proc_install->nparams, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
&proc_install->nreturn_vals, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < proc_install->nparams; i++)
|
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) &proc_install->params[i].type, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->params[i].name, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->params[i].description, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < proc_install->nreturn_vals; i++)
|
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) &proc_install->return_vals[i].type, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->return_vals[i].name, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&proc_install->return_vals[i].description, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_install_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPProcInstall *proc_install = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
if (proc_install)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2007-12-11 17:40:10 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
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);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
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);
|
|
|
|
g_slice_free (GPProcInstall, proc_install);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* proc_uninstall */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_uninstall_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2007-05-22 21:09:56 +08:00
|
|
|
GPProcUninstall *proc_uninstall = g_slice_new0 (GPProcUninstall);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_string (channel, &proc_uninstall->name, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
msg->data = proc_uninstall;
|
2000-03-04 08:24:39 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
2007-05-22 21:09:56 +08:00
|
|
|
g_slice_free (GPProcUninstall, proc_uninstall);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_uninstall_write (GIOChannel *channel,
|
|
|
|
GimpWireMessage *msg,
|
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPProcUninstall *proc_uninstall = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_string (channel, &proc_uninstall->name, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_proc_uninstall_destroy (GimpWireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-01-15 19:55:34 +08:00
|
|
|
GPProcUninstall *proc_uninstall = msg->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
if (proc_uninstall)
|
|
|
|
{
|
|
|
|
g_free (proc_uninstall->name);
|
|
|
|
g_slice_free (GPProcUninstall, proc_uninstall);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-03-04 08:24:39 +08:00
|
|
|
/* extension_ack */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_extension_ack_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-03-04 08:24:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_extension_ack_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
2000-03-04 08:24:39 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_extension_ack_destroy (GimpWireMessage *msg)
|
2000-03-04 08:24:39 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/* params */
|
|
|
|
|
|
|
|
static void
|
|
|
|
_gp_params_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPParam **params,
|
|
|
|
guint *nparams,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
2000-03-04 08:24:39 +08:00
|
|
|
{
|
|
|
|
gint i, j;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel, (guint32 *) nparams, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (*nparams == 0)
|
|
|
|
{
|
|
|
|
*params = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-11-08 01:29:02 +08:00
|
|
|
*params = g_new0 (GPParam, *nparams);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
for (i = 0; i < *nparams; i++)
|
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &(*params)[i].type, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
switch ((*params)[i].type)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
case GIMP_PDB_INT32:
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_int32, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
case GIMP_PDB_INT16:
|
|
|
|
if (! _gimp_wire_read_int16 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint16 *) &(*params)[i].data.d_int16, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
case GIMP_PDB_INT8:
|
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
2006-06-26 07:30:15 +08:00
|
|
|
&(*params)[i].data.d_int8, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_FLOAT:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_double (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
&(*params)[i].data.d_float, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_STRING:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
&(*params)[i].data.d_string, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_INT32ARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
(*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
|
|
|
|
(*params)[i].data.d_int32array = g_new (gint32,
|
2005-01-15 19:55:34 +08:00
|
|
|
(*params)[i-1].data.d_int32);
|
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) (*params)[i].data.d_int32array,
|
|
|
|
(*params)[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_int32array);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_INT16ARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
(*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
|
|
|
|
(*params)[i].data.d_int16array = g_new (gint16,
|
2005-01-15 19:55:34 +08:00
|
|
|
(*params)[i-1].data.d_int32);
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int16 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint16 *) (*params)[i].data.d_int16array,
|
|
|
|
(*params)[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_int16array);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_INT8ARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
(*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
|
2006-06-26 07:30:15 +08:00
|
|
|
(*params)[i].data.d_int8array = g_new (guint8,
|
2005-01-15 19:55:34 +08:00
|
|
|
(*params)[i-1].data.d_int32);
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
2006-06-26 07:30:15 +08:00
|
|
|
(*params)[i].data.d_int8array,
|
2005-12-13 22:11:56 +08:00
|
|
|
(*params)[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_int8array);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_FLOATARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
(*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
|
|
|
|
(*params)[i].data.d_floatarray = g_new (gdouble,
|
2005-01-15 19:55:34 +08:00
|
|
|
(*params)[i-1].data.d_int32);
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_double (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(*params)[i].data.d_floatarray,
|
|
|
|
(*params)[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_floatarray);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_STRINGARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
(*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
|
|
|
|
(*params)[i].data.d_stringarray = g_new0 (gchar *,
|
2005-01-15 19:55:34 +08:00
|
|
|
(*params)[i-1].data.d_int32);
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(*params)[i].data.d_stringarray,
|
|
|
|
(*params)[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
for (j = 0; j < (*params)[i-1].data.d_int32; j++)
|
|
|
|
g_free (((*params)[i].data.d_stringarray)[j]);
|
|
|
|
g_free ((*params)[i].data.d_stringarray);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_COLOR:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_color (channel,
|
2006-02-23 21:53:32 +08:00
|
|
|
&(*params)[i].data.d_color, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_REGION:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_DISPLAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_display, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_IMAGE:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_image, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_LAYER:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_layer, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_CHANNEL:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_channel, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_DRAWABLE:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_drawable, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_SELECTION:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_selection, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_BOUNDARY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_boundary, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2005-12-29 09:07:02 +08:00
|
|
|
case GIMP_PDB_VECTORS:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-29 09:07:02 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_vectors, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_PARASITE:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
&(*params)[i].data.d_parasite.name, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
|
|
|
if ((*params)[i].data.d_parasite.name == NULL)
|
|
|
|
{
|
|
|
|
/* we have a null parasite */
|
|
|
|
(*params)[i].data.d_parasite.data = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
&((*params)[i].data.d_parasite.flags), 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
&((*params)[i].data.d_parasite.size), 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
|
|
|
if ((*params)[i].data.d_parasite.size > 0)
|
|
|
|
{
|
|
|
|
(*params)[i].data.d_parasite.data =
|
2005-01-15 19:55:34 +08:00
|
|
|
g_malloc ((*params)[i].data.d_parasite.size);
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(*params)[i].data.d_parasite.data,
|
|
|
|
(*params)[i].data.d_parasite.size,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_parasite.data);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
(*params)[i].data.d_parasite.data = NULL;
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_STATUS:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_status, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
case GIMP_PDB_END:
|
|
|
|
break;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2000-03-04 08:24:39 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
|
|
|
*nparams = 0;
|
|
|
|
g_free (*params);
|
|
|
|
*params = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-03-04 08:24:39 +08:00
|
|
|
_gp_params_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GPParam *params,
|
|
|
|
gint nparams,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-03-04 08:24:39 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) &nparams, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < nparams; i++)
|
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) ¶ms[i].type, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
switch (params[i].type)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
case GIMP_PDB_INT32:
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_int32, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
case GIMP_PDB_INT16:
|
|
|
|
if (! _gimp_wire_write_int16 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint16 *) ¶ms[i].data.d_int16, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
case GIMP_PDB_INT8:
|
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint8 *) ¶ms[i].data.d_int8, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_FLOAT:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_double (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
¶ms[i].data.d_float, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_STRING:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
¶ms[i].data.d_string, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_INT32ARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) params[i].data.d_int32array,
|
|
|
|
params[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_INT16ARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int16 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint16 *) params[i].data.d_int16array,
|
|
|
|
params[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_INT8ARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint8 *) params[i].data.d_int8array,
|
|
|
|
params[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_FLOATARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_double (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
params[i].data.d_floatarray,
|
|
|
|
params[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_STRINGARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
params[i].data.d_stringarray,
|
|
|
|
params[i-1].data.d_int32,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_COLOR:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_color (channel,
|
2006-02-23 21:53:32 +08:00
|
|
|
¶ms[i].data.d_color, 1, user_data))
|
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_REGION:
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_DISPLAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_display, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_IMAGE:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_image, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_LAYER:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_layer, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_CHANNEL:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_channel, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_DRAWABLE:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_drawable, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_SELECTION:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_selection, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_BOUNDARY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_boundary, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2005-12-29 09:07:02 +08:00
|
|
|
case GIMP_PDB_VECTORS:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-29 09:07:02 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_vectors, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_PARASITE:
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
2007-04-12 22:32:44 +08:00
|
|
|
GimpParasite *p = ¶ms[i].data.d_parasite;
|
2006-04-12 18:53:28 +08:00
|
|
|
|
|
|
|
if (p->name == NULL)
|
|
|
|
{
|
|
|
|
/* write a null string to signal a null parasite */
|
|
|
|
_gimp_wire_write_string (channel, &p->name, 1, user_data);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_string (channel, &p->name, 1, user_data))
|
|
|
|
return;
|
|
|
|
if (! _gimp_wire_write_int32 (channel, &p->flags, 1, user_data))
|
|
|
|
return;
|
|
|
|
if (! _gimp_wire_write_int32 (channel, &p->size, 1, user_data))
|
|
|
|
return;
|
|
|
|
if (p->size > 0)
|
|
|
|
{
|
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
p->data, p->size, user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2000-08-03 08:48:55 +08:00
|
|
|
case GIMP_PDB_STATUS:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
2005-12-13 22:11:56 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_status, 1,
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
case GIMP_PDB_END:
|
|
|
|
break;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-12-13 22:11:56 +08:00
|
|
|
gp_params_destroy (GPParam *params,
|
|
|
|
gint nparams)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-14 21:19:18 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
for (i = 0; i < nparams; i++)
|
|
|
|
{
|
|
|
|
switch (params[i].type)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
|
|
|
case GIMP_PDB_INT32:
|
|
|
|
case GIMP_PDB_INT16:
|
|
|
|
case GIMP_PDB_INT8:
|
|
|
|
case GIMP_PDB_FLOAT:
|
|
|
|
case GIMP_PDB_COLOR:
|
|
|
|
case GIMP_PDB_REGION:
|
|
|
|
case GIMP_PDB_DISPLAY:
|
|
|
|
case GIMP_PDB_IMAGE:
|
|
|
|
case GIMP_PDB_LAYER:
|
|
|
|
case GIMP_PDB_CHANNEL:
|
|
|
|
case GIMP_PDB_DRAWABLE:
|
|
|
|
case GIMP_PDB_SELECTION:
|
|
|
|
case GIMP_PDB_BOUNDARY:
|
|
|
|
case GIMP_PDB_VECTORS:
|
|
|
|
case GIMP_PDB_STATUS:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_PDB_STRING:
|
|
|
|
g_free (params[i].data.d_string);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_PDB_INT32ARRAY:
|
|
|
|
g_free (params[i].data.d_int32array);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_PDB_INT16ARRAY:
|
|
|
|
g_free (params[i].data.d_int16array);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_PDB_INT8ARRAY:
|
|
|
|
g_free (params[i].data.d_int8array);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_PDB_FLOATARRAY:
|
|
|
|
g_free (params[i].data.d_floatarray);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_PDB_STRINGARRAY:
|
|
|
|
if ((i > 0) && (params[i-1].type == GIMP_PDB_INT32))
|
|
|
|
{
|
|
|
|
gint count = params[i-1].data.d_int32;
|
2005-12-14 21:19:18 +08:00
|
|
|
gint j;
|
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
for (j = 0; j < count; j++)
|
|
|
|
g_free (params[i].data.d_stringarray[j]);
|
2005-12-14 21:19:18 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
g_free (params[i].data.d_stringarray);
|
|
|
|
}
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
case GIMP_PDB_PARASITE:
|
|
|
|
if (params[i].data.d_parasite.name)
|
2007-09-28 22:20:35 +08:00
|
|
|
g_free (params[i].data.d_parasite.name);
|
2006-04-12 18:53:28 +08:00
|
|
|
if (params[i].data.d_parasite.data)
|
2007-09-28 22:20:35 +08:00
|
|
|
g_free (params[i].data.d_parasite.data);
|
2006-04-12 18:53:28 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2006-04-12 18:53:28 +08:00
|
|
|
case GIMP_PDB_END:
|
|
|
|
break;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2000-03-04 08:24:39 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
g_free (params);
|
|
|
|
}
|
2002-02-12 15:59:16 +08:00
|
|
|
|
|
|
|
/* has_init */
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_has_init_read (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
2002-02-12 15:59:16 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_has_init_write (GIOChannel *channel,
|
2006-04-12 18:53:28 +08:00
|
|
|
GimpWireMessage *msg,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data)
|
2002-02-12 15:59:16 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-13 22:11:56 +08:00
|
|
|
_gp_has_init_destroy (GimpWireMessage *msg)
|
2002-02-12 15:59:16 +08:00
|
|
|
{
|
|
|
|
}
|