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
|
|
|
*
|
2009-01-18 06:28:01 +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
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2001-05-21 21:58:46 +08:00
|
|
|
*
|
|
|
|
* 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
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2001-05-21 21:58:46 +08:00
|
|
|
*/
|
|
|
|
|
2005-12-13 22:11:56 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2023-12-27 00:07:19 +08:00
|
|
|
#include <gegl.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
|
|
|
|
2023-08-03 05:55:33 +08:00
|
|
|
#include "gimpchoice.h"
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
#include "gimpparamspecs.h"
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
guint *n_params,
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
gint n_params,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
static void _gp_params_destroy (GPParam *params,
|
2019-09-09 07:00:54 +08:00
|
|
|
gint n_params);
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
/* public writing API */
|
|
|
|
|
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->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,
|
2019-08-24 04:23:23 +08:00
|
|
|
(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;
|
2023-11-21 04:38:11 +08:00
|
|
|
if (! _gimp_wire_read_gegl_color (channel,
|
|
|
|
&config->check_custom_color1,
|
|
|
|
&config->check_custom_icc1,
|
|
|
|
&config->check_custom_encoding1,
|
|
|
|
1, user_data))
|
2020-05-25 04:26:50 +08:00
|
|
|
goto cleanup;
|
2023-11-21 04:38:11 +08:00
|
|
|
if (! _gimp_wire_read_gegl_color (channel,
|
|
|
|
&config->check_custom_color2,
|
|
|
|
&config->check_custom_icc2,
|
|
|
|
&config->check_custom_encoding2,
|
|
|
|
1, user_data))
|
2020-05-25 04:26:50 +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,
|
2014-02-26 04:19:25 +08:00
|
|
|
(guint8 *) &config->use_opencl, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
goto cleanup;
|
2018-06-18 08:19:41 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
2019-10-10 06:45:41 +08:00
|
|
|
(guint8 *) &config->export_color_profile, 1,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(guint8 *) &config->export_comment, 1,
|
2018-06-18 08:19:41 +08:00
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
2018-01-11 12:14:07 +08:00
|
|
|
(guint8 *) &config->export_exif, 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,
|
2018-01-11 12:14:07 +08:00
|
|
|
(guint8 *) &config->export_xmp, 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,
|
2018-01-11 12:14:07 +08:00
|
|
|
(guint8 *) &config->export_iptc, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
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,
|
2019-10-10 06:45:41 +08:00
|
|
|
(guint32 *) &config->default_display_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;
|
2008-03-28 00:30:29 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&config->timestamp, 1, user_data))
|
|
|
|
goto cleanup;
|
libgimpbase, libgimp, app: pass icon theme dir to plug-ins through config
Pass the current icon theme directory to plug-ins through the
config message, and add a gimp_icon_theme_dir() libgimp function
for retrieving it. Note that we already have a similar
gimp_icon_get_theme_dir() PDB function, which we keep around, since
it can be used to dynamically query for the current icon dir,
unlike the former, and since it returns a dynamically-allocated
string, while the rest of the config-related functions return
statically allocated strings.
Use the new function, instead of gimp_get_icon_theme_dir(), in
gimp_ui_init(). This allows gimp_ui_init() to run without making
any PDB calls. Consequently, this allows us to start plug-ins that
call gimp_ui_init() without entering the main loop in the main app.
We're going to add a plug-in that displays an interactive dialog
while the main app is blocking waiting for an operation to
complete, and we need to be able to start the plug-in without
entering the main loop, to avoid the possibility of arbitrary code
being executed during the wait.
Bump the protocol version.
2018-05-29 23:20:54 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&config->icon_theme_dir, 1, user_data))
|
|
|
|
goto cleanup;
|
2018-11-20 05:13:07 +08:00
|
|
|
if (! _gimp_wire_read_int64 (channel,
|
|
|
|
&config->tile_cache_size, 1, user_data))
|
|
|
|
goto cleanup;
|
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&config->swap_path, 1, user_data))
|
|
|
|
goto cleanup;
|
2019-09-22 22:48:16 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&config->swap_compression, 1, user_data))
|
|
|
|
goto cleanup;
|
2018-11-20 05:13:07 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &config->num_processors, 1,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
2003-11-08 01:29:02 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
msg->data = config;
|
2000-03-04 08:24:39 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
2023-11-21 04:38:11 +08:00
|
|
|
g_bytes_unref (config->check_custom_color1);
|
|
|
|
g_bytes_unref (config->check_custom_icc1);
|
|
|
|
g_free (config->check_custom_encoding1);
|
|
|
|
g_bytes_unref (config->check_custom_color2);
|
|
|
|
g_bytes_unref (config->check_custom_icc2);
|
|
|
|
g_free (config->check_custom_encoding2);
|
|
|
|
|
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);
|
libgimpbase, libgimp, app: pass icon theme dir to plug-ins through config
Pass the current icon theme directory to plug-ins through the
config message, and add a gimp_icon_theme_dir() libgimp function
for retrieving it. Note that we already have a similar
gimp_icon_get_theme_dir() PDB function, which we keep around, since
it can be used to dynamically query for the current icon dir,
unlike the former, and since it returns a dynamically-allocated
string, while the rest of the config-related functions return
statically allocated strings.
Use the new function, instead of gimp_get_icon_theme_dir(), in
gimp_ui_init(). This allows gimp_ui_init() to run without making
any PDB calls. Consequently, this allows us to start plug-ins that
call gimp_ui_init() without entering the main loop in the main app.
We're going to add a plug-in that displays an interactive dialog
while the main app is blocking waiting for an operation to
complete, and we need to be able to start the plug-in without
entering the main loop, to avoid the possibility of arbitrary code
being executed during the wait.
Bump the protocol version.
2018-05-29 23:20:54 +08:00
|
|
|
g_free (config->icon_theme_dir);
|
2018-11-20 05:13:07 +08:00
|
|
|
g_free (config->swap_path);
|
2019-09-22 22:48:16 +08:00
|
|
|
g_free (config->swap_compression);
|
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->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,
|
2019-08-24 04:23:23 +08:00
|
|
|
(const guint32 *) &config->shm_id, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
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;
|
2023-11-21 04:38:11 +08:00
|
|
|
if (! _gimp_wire_write_gegl_color (channel,
|
|
|
|
&config->check_custom_color1,
|
|
|
|
&config->check_custom_icc1,
|
|
|
|
&config->check_custom_encoding1,
|
|
|
|
1, user_data))
|
2020-05-25 04:26:50 +08:00
|
|
|
return;
|
2023-11-21 04:38:11 +08:00
|
|
|
if (! _gimp_wire_write_gegl_color (channel,
|
|
|
|
&config->check_custom_color2,
|
|
|
|
&config->check_custom_icc2,
|
|
|
|
&config->check_custom_encoding2,
|
|
|
|
1, user_data))
|
2020-05-25 04:26:50 +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,
|
2014-02-26 04:19:25 +08:00
|
|
|
(const guint8 *) &config->use_opencl, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
user_data))
|
2004-09-03 20:19:26 +08:00
|
|
|
return;
|
2018-06-18 08:19:41 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
2019-10-10 06:45:41 +08:00
|
|
|
(const guint8 *) &config->export_color_profile, 1,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) &config->export_comment, 1,
|
2018-06-18 08:19:41 +08:00
|
|
|
user_data))
|
|
|
|
return;
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int8 (channel,
|
2018-01-11 12:14:07 +08:00
|
|
|
(const guint8 *) &config->export_exif, 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,
|
2018-01-11 12:14:07 +08:00
|
|
|
(const guint8 *) &config->export_xmp, 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,
|
2018-01-11 12:14:07 +08:00
|
|
|
(const guint8 *) &config->export_iptc, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
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,
|
2019-10-10 06:45:41 +08:00
|
|
|
(const guint32 *) &config->default_display_id, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
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;
|
2008-03-28 00:30:29 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) &config->timestamp, 1,
|
|
|
|
user_data))
|
|
|
|
return;
|
libgimpbase, libgimp, app: pass icon theme dir to plug-ins through config
Pass the current icon theme directory to plug-ins through the
config message, and add a gimp_icon_theme_dir() libgimp function
for retrieving it. Note that we already have a similar
gimp_icon_get_theme_dir() PDB function, which we keep around, since
it can be used to dynamically query for the current icon dir,
unlike the former, and since it returns a dynamically-allocated
string, while the rest of the config-related functions return
statically allocated strings.
Use the new function, instead of gimp_get_icon_theme_dir(), in
gimp_ui_init(). This allows gimp_ui_init() to run without making
any PDB calls. Consequently, this allows us to start plug-ins that
call gimp_ui_init() without entering the main loop in the main app.
We're going to add a plug-in that displays an interactive dialog
while the main app is blocking waiting for an operation to
complete, and we need to be able to start the plug-in without
entering the main loop, to avoid the possibility of arbitrary code
being executed during the wait.
Bump the protocol version.
2018-05-29 23:20:54 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&config->icon_theme_dir, 1, user_data))
|
|
|
|
return;
|
2018-11-20 05:13:07 +08:00
|
|
|
if (! _gimp_wire_write_int64 (channel,
|
|
|
|
&config->tile_cache_size, 1, user_data))
|
|
|
|
return;
|
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&config->swap_path, 1, user_data))
|
|
|
|
return;
|
2019-09-22 22:48:16 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
&config->swap_compression, 1, user_data))
|
|
|
|
return;
|
2018-11-20 05:13:07 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) &config->num_processors, 1,
|
|
|
|
user_data))
|
|
|
|
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)
|
|
|
|
{
|
2023-11-21 04:38:11 +08:00
|
|
|
g_bytes_unref (config->check_custom_color1);
|
|
|
|
g_bytes_unref (config->check_custom_icc1);
|
|
|
|
g_free (config->check_custom_encoding1);
|
|
|
|
g_bytes_unref (config->check_custom_color2);
|
|
|
|
g_bytes_unref (config->check_custom_icc2);
|
|
|
|
g_free (config->check_custom_encoding2);
|
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
g_free (config->app_name);
|
|
|
|
g_free (config->wm_class);
|
|
|
|
g_free (config->display_name);
|
2018-11-20 05:31:04 +08:00
|
|
|
g_free (config->icon_theme_dir);
|
2018-11-20 05:13:07 +08:00
|
|
|
g_free (config->swap_path);
|
2019-09-22 22:48:16 +08:00
|
|
|
g_free (config->swap_compression);
|
2007-12-11 17:40:10 +08:00
|
|
|
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,
|
2019-08-24 04:23:23 +08:00
|
|
|
(guint32 *) &tile_req->drawable_id, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
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,
|
2019-08-24 04:23:23 +08:00
|
|
|
(const guint32 *) &tile_req->drawable_id, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
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,
|
2019-08-24 04:23:23 +08:00
|
|
|
(guint32 *) &tile_data->drawable_id, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
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,
|
2019-08-24 04:23:23 +08:00
|
|
|
(const guint32 *) &tile_data->drawable_id, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
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)
|
|
|
|
{
|
2012-10-23 01:03:00 +08:00
|
|
|
if (tile_data->data)
|
|
|
|
{
|
|
|
|
g_free (tile_data->data);
|
|
|
|
tile_data->data = NULL;
|
|
|
|
}
|
|
|
|
|
2007-12-11 17:40:10 +08:00
|
|
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_run->params, (guint *) &proc_run->n_params,
|
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
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
_gp_params_write (channel, proc_run->params, proc_run->n_params, 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)
|
|
|
|
{
|
2019-09-09 07:00:54 +08:00
|
|
|
_gp_params_destroy (proc_run->params, proc_run->n_params);
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_return->params, (guint *) &proc_return->n_params,
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
proc_return->params, proc_return->n_params, 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)
|
|
|
|
{
|
2019-09-09 07:00:54 +08:00
|
|
|
_gp_params_destroy (proc_return->params, proc_return->n_params);
|
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 */
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
static gboolean
|
|
|
|
_gp_param_def_read (GIOChannel *channel,
|
|
|
|
GPParamDef *param_def,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
¶m_def->param_def_type, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
¶m_def->type_name, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
2019-09-12 03:40:17 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
¶m_def->value_type_name, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
¶m_def->name, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
¶m_def->nick, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
¶m_def->blurb, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
2019-08-19 18:54:52 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
¶m_def->flags, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
switch (param_def->param_def_type)
|
|
|
|
{
|
|
|
|
case GP_PARAM_DEF_TYPE_DEFAULT:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_INT:
|
2019-08-10 22:25:22 +08:00
|
|
|
if (! _gimp_wire_read_int64 (channel,
|
|
|
|
(guint64 *) ¶m_def->meta.m_int.min_val, 1,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
user_data) ||
|
2019-08-10 22:25:22 +08:00
|
|
|
! _gimp_wire_read_int64 (channel,
|
|
|
|
(guint64 *) ¶m_def->meta.m_int.max_val, 1,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
user_data) ||
|
2019-08-10 22:25:22 +08:00
|
|
|
! _gimp_wire_read_int64 (channel,
|
|
|
|
(guint64 *) ¶m_def->meta.m_int.default_val, 1,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
2023-08-03 05:55:33 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_CHOICE:
|
|
|
|
{
|
|
|
|
GimpChoice *choice;
|
|
|
|
guint32 size;
|
|
|
|
gchar *nick;
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_string (channel, &nick, (int) 1, user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
param_def->meta.m_choice.default_val = g_strdup (nick);
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_int32 (channel, &size, 1, user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
choice = gimp_choice_new ();
|
|
|
|
|
|
|
|
for (gint i = 0; i < size; i++)
|
|
|
|
{
|
|
|
|
gchar *label;
|
|
|
|
gchar *help;
|
|
|
|
gint id;
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_string (channel, &nick,
|
|
|
|
(int) 1, user_data) ||
|
|
|
|
! _gimp_wire_read_int32 (channel, (guint32 *) &id,
|
|
|
|
1, user_data) ||
|
|
|
|
! _gimp_wire_read_string (channel, &label,
|
|
|
|
(int) 1, user_data) ||
|
|
|
|
! _gimp_wire_read_string (channel, &help,
|
|
|
|
(int) 1, user_data))
|
|
|
|
{
|
|
|
|
g_object_unref (choice);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_choice_add (choice, nick, id, label, help);
|
|
|
|
}
|
|
|
|
param_def->meta.m_choice.choice = choice;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2019-07-30 21:04:06 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_UNIT:
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_unit.allow_pixels, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_unit.allow_percent, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_unit.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_ENUM:
|
2019-09-12 03:40:17 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
(guint32 *) ¶m_def->meta.m_enum.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_BOOLEAN:
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_boolean.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_FLOAT:
|
|
|
|
if (! _gimp_wire_read_double (channel,
|
|
|
|
¶m_def->meta.m_float.min_val, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_read_double (channel,
|
|
|
|
¶m_def->meta.m_float.max_val, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_read_double (channel,
|
|
|
|
¶m_def->meta.m_float.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_STRING:
|
2019-08-19 18:54:52 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
¶m_def->meta.m_string.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
2024-02-13 23:07:24 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_GEGL_COLOR:
|
|
|
|
{
|
|
|
|
GPParamColor *default_val = NULL;
|
|
|
|
GBytes *pixel_data = NULL;
|
|
|
|
GBytes *icc_data = NULL;
|
|
|
|
gchar *encoding = NULL;
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_gegl_color.has_alpha, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_read_gegl_color (channel, &pixel_data, &icc_data, &encoding,
|
|
|
|
1, user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (pixel_data != NULL)
|
|
|
|
{
|
|
|
|
default_val = g_new0 (GPParamColor, 1);
|
|
|
|
|
|
|
|
default_val->encoding = encoding;
|
|
|
|
default_val->size = g_bytes_get_size (pixel_data);
|
|
|
|
if (default_val->size > 40)
|
|
|
|
{
|
|
|
|
g_free (default_val);
|
|
|
|
g_free (encoding);
|
|
|
|
g_bytes_unref (pixel_data);
|
|
|
|
g_bytes_unref (icc_data);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
memcpy (default_val->data, g_bytes_get_data (pixel_data, NULL),
|
|
|
|
default_val->size);
|
|
|
|
g_bytes_unref (pixel_data);
|
|
|
|
if (icc_data)
|
|
|
|
{
|
|
|
|
gsize profile_size;
|
|
|
|
|
|
|
|
default_val->profile_data = g_bytes_unref_to_data (icc_data,
|
|
|
|
&profile_size);
|
|
|
|
default_val->profile_size = (guint32) profile_size;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
default_val->profile_data = NULL;
|
|
|
|
default_val->profile_size = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
param_def->meta.m_gegl_color.default_val = default_val;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_ID:
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_id.none_ok, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
2019-08-05 20:12:19 +08:00
|
|
|
|
2019-09-05 17:34:54 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_ID_ARRAY:
|
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
¶m_def->meta.m_id_array.type_name, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
2024-05-07 02:38:12 +08:00
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_EXPORT_OPTIONS:
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_export_options.capabilities, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
2024-09-06 19:38:43 +08:00
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_RESOURCE:
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_resource.none_ok, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_resource.default_to_context, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_resource.default_resource_id, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_gp_param_def_destroy (GPParamDef *param_def)
|
|
|
|
{
|
|
|
|
g_free (param_def->type_name);
|
2019-09-12 03:40:17 +08:00
|
|
|
g_free (param_def->value_type_name);
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
g_free (param_def->name);
|
|
|
|
g_free (param_def->nick);
|
|
|
|
g_free (param_def->blurb);
|
|
|
|
|
|
|
|
switch (param_def->param_def_type)
|
|
|
|
{
|
|
|
|
case GP_PARAM_DEF_TYPE_DEFAULT:
|
|
|
|
case GP_PARAM_DEF_TYPE_INT:
|
2019-07-30 21:04:06 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_UNIT:
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_ENUM:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_BOOLEAN:
|
|
|
|
case GP_PARAM_DEF_TYPE_FLOAT:
|
|
|
|
break;
|
|
|
|
|
2023-08-03 05:55:33 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_CHOICE:
|
|
|
|
g_free (param_def->meta.m_choice.default_val);
|
|
|
|
g_object_unref (param_def->meta.m_choice.choice);
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_STRING:
|
|
|
|
g_free (param_def->meta.m_string.default_val);
|
|
|
|
break;
|
|
|
|
|
2024-02-13 23:07:24 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_GEGL_COLOR:
|
|
|
|
if (param_def->meta.m_gegl_color.default_val)
|
|
|
|
{
|
|
|
|
g_free (param_def->meta.m_gegl_color.default_val->encoding);
|
|
|
|
g_free (param_def->meta.m_gegl_color.default_val->profile_data);
|
|
|
|
}
|
|
|
|
g_free (param_def->meta.m_gegl_color.default_val);
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_ID:
|
|
|
|
break;
|
2019-08-05 20:12:19 +08:00
|
|
|
|
2019-09-05 17:34:54 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_ID_ARRAY:
|
|
|
|
g_free (param_def->meta.m_id_array.type_name);
|
|
|
|
break;
|
2024-05-07 02:38:12 +08:00
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_EXPORT_OPTIONS:
|
|
|
|
break;
|
2024-09-06 19:38:43 +08:00
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_RESOURCE:
|
|
|
|
break;
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_install->name, 1, user_data) ||
|
2019-09-09 06:36:24 +08:00
|
|
|
! _gimp_wire_read_int32 (channel,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_install->type, 1, user_data) ||
|
2019-09-09 06:36:24 +08:00
|
|
|
! _gimp_wire_read_int32 (channel,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_install->n_params, 1, user_data) ||
|
2019-09-09 06:36:24 +08:00
|
|
|
! _gimp_wire_read_int32 (channel,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_install->n_return_vals, 1, user_data))
|
2000-03-04 08:24:39 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
proc_install->params = g_new0 (GPParamDef, proc_install->n_params);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < proc_install->n_params; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
if (! _gp_param_def_read (channel,
|
|
|
|
&proc_install->params[i],
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
goto cleanup;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
proc_install->return_vals = g_new0 (GPParamDef, proc_install->n_return_vals);
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < proc_install->n_return_vals; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
if (! _gp_param_def_read (channel,
|
|
|
|
&proc_install->return_vals[i],
|
|
|
|
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);
|
|
|
|
|
|
|
|
if (proc_install->params)
|
|
|
|
{
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < proc_install->n_params; i++)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
if (! proc_install->params[i].name)
|
2006-04-12 18:53:28 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
_gp_param_def_destroy (&proc_install->params[i]);
|
2006-04-12 18:53:28 +08:00
|
|
|
}
|
2000-03-04 08:24:39 +08:00
|
|
|
|
|
|
|
g_free (proc_install->params);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (proc_install->return_vals)
|
|
|
|
{
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < proc_install->n_return_vals; i++)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
if (! proc_install->return_vals[i].name)
|
2006-04-12 18:53:28 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
_gp_param_def_destroy (&proc_install->return_vals[i]);
|
2006-04-12 18:53:28 +08:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
static gboolean
|
|
|
|
_gp_param_def_write (GIOChannel *channel,
|
|
|
|
GPParamDef *param_def,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
¶m_def->param_def_type, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
¶m_def->type_name, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
2019-09-12 03:40:17 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
¶m_def->value_type_name, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
¶m_def->name, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
¶m_def->nick, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
¶m_def->blurb, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
2019-08-19 18:54:52 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
¶m_def->flags, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
switch (param_def->param_def_type)
|
|
|
|
{
|
|
|
|
case GP_PARAM_DEF_TYPE_DEFAULT:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_INT:
|
2019-08-10 22:25:22 +08:00
|
|
|
if (! _gimp_wire_write_int64 (channel,
|
|
|
|
(guint64 *) ¶m_def->meta.m_int.min_val, 1,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
user_data) ||
|
2019-08-10 22:25:22 +08:00
|
|
|
! _gimp_wire_write_int64 (channel,
|
|
|
|
(guint64 *) ¶m_def->meta.m_int.max_val, 1,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
user_data) ||
|
2019-08-10 22:25:22 +08:00
|
|
|
! _gimp_wire_write_int64 (channel,
|
|
|
|
(guint64 *) ¶m_def->meta.m_int.default_val, 1,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
2023-08-03 05:55:33 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_CHOICE:
|
|
|
|
{
|
|
|
|
GList *values;
|
|
|
|
gint size;
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
¶m_def->meta.m_choice.default_val,
|
|
|
|
1, user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
values = gimp_choice_list_nicks (param_def->meta.m_choice.choice);
|
|
|
|
size = g_list_length (values);
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) &size, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
for (GList *iter = values; iter; iter = iter->next)
|
|
|
|
{
|
|
|
|
const gchar *label;
|
|
|
|
const gchar *help;
|
|
|
|
gint id;
|
|
|
|
|
|
|
|
gimp_choice_get_documentation (param_def->meta.m_choice.choice,
|
|
|
|
iter->data, &label, &help);
|
|
|
|
id = gimp_choice_get_id (param_def->meta.m_choice.choice,
|
|
|
|
iter->data);
|
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
(gchar **) &iter->data,
|
|
|
|
1, user_data) ||
|
|
|
|
! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) &id, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_string (channel,
|
|
|
|
(gchar **) &label,
|
|
|
|
1, user_data) ||
|
|
|
|
! _gimp_wire_write_string (channel,
|
|
|
|
(gchar **) &help,
|
|
|
|
1, user_data))
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2019-07-30 21:04:06 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_UNIT:
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_unit.allow_pixels, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_unit.allow_percent, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_unit.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_ENUM:
|
2019-09-12 03:40:17 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
(guint32 *) ¶m_def->meta.m_enum.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_BOOLEAN:
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_boolean.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_FLOAT:
|
|
|
|
if (! _gimp_wire_write_double (channel,
|
|
|
|
¶m_def->meta.m_float.min_val, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_double (channel,
|
|
|
|
¶m_def->meta.m_float.max_val, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_double (channel,
|
|
|
|
¶m_def->meta.m_float.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_STRING:
|
2019-08-19 18:54:52 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
¶m_def->meta.m_string.default_val, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
2024-02-13 23:07:24 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_GEGL_COLOR:
|
|
|
|
{
|
|
|
|
GBytes *pixel_data = NULL;
|
|
|
|
GBytes *icc_data = NULL;
|
|
|
|
gchar *encoding = "";
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_gegl_color.has_alpha, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (param_def->meta.m_gegl_color.default_val)
|
|
|
|
{
|
|
|
|
pixel_data = g_bytes_new_static (param_def->meta.m_gegl_color.default_val->data,
|
|
|
|
param_def->meta.m_gegl_color.default_val->size);
|
|
|
|
icc_data = g_bytes_new_static (param_def->meta.m_gegl_color.default_val->profile_data,
|
|
|
|
param_def->meta.m_gegl_color.default_val->profile_size);
|
|
|
|
encoding = param_def->meta.m_gegl_color.default_val->encoding;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_gegl_color (channel,
|
|
|
|
&pixel_data,
|
|
|
|
&icc_data,
|
|
|
|
&encoding,
|
|
|
|
1, user_data))
|
|
|
|
{
|
|
|
|
g_bytes_unref (pixel_data);
|
|
|
|
g_bytes_unref (icc_data);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_bytes_unref (pixel_data);
|
|
|
|
g_bytes_unref (icc_data);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_ID:
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_id.none_ok, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
2019-08-05 20:12:19 +08:00
|
|
|
|
2019-09-05 17:34:54 +08:00
|
|
|
case GP_PARAM_DEF_TYPE_ID_ARRAY:
|
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
¶m_def->meta.m_id_array.type_name, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
break;
|
2024-05-07 02:38:12 +08:00
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_EXPORT_OPTIONS:
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_export_options.capabilities, 1,
|
|
|
|
user_data))
|
2024-09-06 19:38:43 +08:00
|
|
|
return FALSE;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GP_PARAM_DEF_TYPE_RESOURCE:
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_resource.none_ok, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_resource.default_to_context, 1,
|
|
|
|
user_data))
|
|
|
|
return FALSE;
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32 *) ¶m_def->meta.m_resource.default_resource_id, 1,
|
|
|
|
user_data))
|
2024-05-07 02:38:12 +08:00
|
|
|
return FALSE;
|
|
|
|
break;
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_install->name, 1, user_data) ||
|
2019-09-09 06:36:24 +08:00
|
|
|
! _gimp_wire_write_int32 (channel,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_install->type, 1, user_data) ||
|
2019-09-09 06:36:24 +08:00
|
|
|
! _gimp_wire_write_int32 (channel,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_install->n_params, 1, user_data) ||
|
2019-09-09 06:36:24 +08:00
|
|
|
! _gimp_wire_write_int32 (channel,
|
2019-09-09 07:00:54 +08:00
|
|
|
&proc_install->n_return_vals, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < proc_install->n_params; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
if (! _gp_param_def_write (channel,
|
|
|
|
&proc_install->params[i],
|
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < proc_install->n_return_vals; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
if (! _gp_param_def_write (channel,
|
|
|
|
&proc_install->return_vals[i],
|
|
|
|
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);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < proc_install->n_params; i++)
|
2007-12-11 17:40:10 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
_gp_param_def_destroy (&proc_install->params[i]);
|
2007-12-11 17:40:10 +08:00
|
|
|
}
|
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < proc_install->n_return_vals; i++)
|
2007-12-11 17:40:10 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
_gp_param_def_destroy (&proc_install->return_vals[i]);
|
2007-12-11 17:40:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
guint *n_params,
|
2002-05-17 01:41:38 +08:00
|
|
|
gpointer user_data)
|
2000-03-04 08:24:39 +08:00
|
|
|
{
|
2021-05-25 04:36:31 +08:00
|
|
|
guint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel, (guint32 *) n_params, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
if (*n_params == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
*params = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
*params = g_try_new0 (GPParam, *n_params);
|
2019-08-01 22:48:56 +08:00
|
|
|
|
|
|
|
/* We may read crap on the wire (and as a consequence try to allocate
|
|
|
|
* far too much), which would be a plug-in error.
|
|
|
|
*/
|
|
|
|
if (*params == NULL)
|
|
|
|
{
|
|
|
|
/* Output on stderr but no WARNING/CRITICAL. This is likely a
|
|
|
|
* plug-in bug sending bogus data, not a core bug.
|
|
|
|
*/
|
|
|
|
g_printerr ("%s: failed to allocate %u parameters\n",
|
2019-09-09 07:00:54 +08:00
|
|
|
G_STRFUNC, *n_params);
|
|
|
|
*n_params = 0;
|
2019-08-01 22:48:56 +08:00
|
|
|
return;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < *n_params; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
(guint32 *) &(*params)[i].param_type, 1,
|
2019-09-12 03:40:17 +08:00
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_read_string (channel,
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
&(*params)[i].type_name, 1,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch ((*params)[i].param_type)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_INT:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
(guint32 *) &(*params)[i].data.d_int, 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
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_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
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_STRING:
|
2019-09-12 03:40:17 +08:00
|
|
|
case GP_PARAM_TYPE_FILE:
|
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
|
|
|
|
2023-11-04 04:26:51 +08:00
|
|
|
case GP_PARAM_TYPE_GEGL_COLOR:
|
|
|
|
/* Read the color data. */
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&(*params)[i].data.d_gegl_color.size, 1,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
if ((*params)[i].data.d_gegl_color.size > 40 ||
|
|
|
|
! _gimp_wire_read_int8 (channel,
|
|
|
|
(*params)[i].data.d_gegl_color.data,
|
|
|
|
(*params)[i].data.d_gegl_color.size,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
/* Read encoding. */
|
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&(*params)[i].data.d_gegl_color.encoding, 1,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
/* Read space (profile data). */
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&(*params)[i].data.d_gegl_color.profile_size, 1,
|
|
|
|
user_data))
|
|
|
|
{
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_gegl_color.encoding, g_free);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
(*params)[i].data.d_gegl_color.profile_data = g_new0 (guint8, (*params)[i].data.d_gegl_color.profile_size);
|
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(*params)[i].data.d_gegl_color.profile_data,
|
|
|
|
(*params)[i].data.d_gegl_color.profile_size,
|
|
|
|
user_data))
|
|
|
|
{
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_gegl_color.encoding, g_free);
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_gegl_color.profile_data, g_free);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
2023-12-27 00:07:19 +08:00
|
|
|
case GP_PARAM_TYPE_COLOR_ARRAY:
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&(*params)[i].data.d_color_array.size, 1,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
(*params)[i].data.d_color_array.colors = g_new0 (GPParamColor,
|
|
|
|
(*params)[i].data.d_color_array.size);
|
|
|
|
|
|
|
|
for (gint j = 0; j < (*params)[i].data.d_color_array.size; j++)
|
|
|
|
{
|
|
|
|
/* Read the color data. */
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&(*params)[i].data.d_color_array.colors[j].size, 1,
|
|
|
|
user_data))
|
|
|
|
{
|
2024-02-20 00:49:47 +08:00
|
|
|
for (gint k = 0; k < j; k++)
|
2023-12-27 00:07:19 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].encoding);
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].profile_data);
|
|
|
|
}
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_color_array.colors, g_free);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((*params)[i].data.d_color_array.colors[j].size > 40 ||
|
|
|
|
! _gimp_wire_read_int8 (channel,
|
|
|
|
(*params)[i].data.d_color_array.colors[j].data,
|
|
|
|
(*params)[i].data.d_color_array.colors[j].size,
|
|
|
|
user_data))
|
|
|
|
{
|
2024-02-20 00:49:47 +08:00
|
|
|
for (gint k = 0; k < j; k++)
|
2023-12-27 00:07:19 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].encoding);
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].profile_data);
|
|
|
|
}
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_color_array.colors, g_free);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read encoding. */
|
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&(*params)[i].data.d_color_array.colors[j].encoding, 1,
|
|
|
|
user_data))
|
|
|
|
{
|
2024-02-20 00:49:47 +08:00
|
|
|
for (gint k = 0; k < j; k++)
|
2023-12-27 00:07:19 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].encoding);
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].profile_data);
|
|
|
|
}
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_color_array.colors, g_free);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read space (profile data). */
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&(*params)[i].data.d_color_array.colors[j].profile_size, 1,
|
|
|
|
user_data))
|
|
|
|
{
|
2024-02-20 00:49:47 +08:00
|
|
|
for (gint k = 0; k < j; k++)
|
2023-12-27 00:07:19 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].encoding);
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].profile_data);
|
|
|
|
}
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_color_array.colors[j].encoding, g_free);
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_color_array.colors, g_free);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((*params)[i].data.d_color_array.colors[j].profile_size > 0)
|
|
|
|
{
|
|
|
|
(*params)[i].data.d_color_array.colors[j].profile_data = g_new0 (guint8, (*params)[i].data.d_color_array.colors[j].profile_size);
|
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(*params)[i].data.d_color_array.colors[j].profile_data,
|
|
|
|
(*params)[i].data.d_color_array.colors[j].profile_size,
|
|
|
|
user_data))
|
|
|
|
{
|
2024-02-20 00:49:47 +08:00
|
|
|
for (gint k = 0; k < j; k++)
|
2023-12-27 00:07:19 +08:00
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].encoding);
|
|
|
|
g_free ((*params)[i].data.d_color_array.colors[k].profile_data);
|
|
|
|
}
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_color_array.colors[j].encoding, g_free);
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_color_array.colors[j].profile_data, g_free);
|
|
|
|
g_clear_pointer (&(*params)[i].data.d_color_array.colors, g_free);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_ARRAY:
|
2010-07-09 15:34:44 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
&(*params)[i].data.d_array.size, 1,
|
2010-07-09 15:34:44 +08:00
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
(*params)[i].data.d_array.data = g_new0 (guint8,
|
|
|
|
(*params)[i].data.d_array.size);
|
2000-03-04 08:24:39 +08:00
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
if (! _gimp_wire_read_int8 (channel,
|
|
|
|
(*params)[i].data.d_array.data,
|
|
|
|
(*params)[i].data.d_array.size,
|
|
|
|
user_data))
|
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_array.data);
|
|
|
|
(*params)[i].data.d_array.data = NULL;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2023-05-24 05:37:46 +08:00
|
|
|
case GP_PARAM_TYPE_BYTES:
|
|
|
|
{
|
|
|
|
guint32 data_len;
|
|
|
|
guint8* data;
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_int32 (channel, &data_len, 1, user_data))
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
data = g_new0 (guint8, data_len);
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_int8 (channel, data, data_len, user_data))
|
|
|
|
{
|
|
|
|
g_free (data);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
|
|
|
(*params)[i].data.d_bytes = g_bytes_new_take (data, data_len);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2020-12-24 04:15:43 +08:00
|
|
|
case GP_PARAM_TYPE_STRV:
|
|
|
|
{
|
|
|
|
guint32 size;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2020-12-24 04:15:43 +08:00
|
|
|
if (! _gimp_wire_read_int32 (channel, &size, 1, user_data))
|
|
|
|
goto cleanup;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2020-12-24 04:15:43 +08:00
|
|
|
(*params)[i].data.d_strv = g_new0 (gchar *, size + 1);
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
|
2020-12-24 04:15:43 +08:00
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
(*params)[i].data.d_strv,
|
|
|
|
(int) size,
|
|
|
|
user_data))
|
|
|
|
{
|
|
|
|
g_strfreev ((*params)[i].data.d_strv);
|
|
|
|
(*params)[i].data.d_strv = NULL;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2019-09-05 17:34:54 +08:00
|
|
|
case GP_PARAM_TYPE_ID_ARRAY:
|
|
|
|
if (! _gimp_wire_read_string (channel,
|
|
|
|
&(*params)[i].data.d_id_array.type_name, 1,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
&(*params)[i].data.d_id_array.size, 1,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
|
|
|
|
|
|
|
(*params)[i].data.d_id_array.data = g_new0 (gint32,
|
|
|
|
(*params)[i].data.d_id_array.size);
|
|
|
|
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) (*params)[i].data.d_id_array.data,
|
|
|
|
(*params)[i].data.d_id_array.size,
|
|
|
|
user_data))
|
|
|
|
{
|
|
|
|
g_free ((*params)[i].data.d_id_array.data);
|
|
|
|
(*params)[i].data.d_id_array.data = NULL;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_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;
|
2019-08-05 06:58:44 +08:00
|
|
|
|
2024-05-07 02:38:12 +08:00
|
|
|
case GP_PARAM_TYPE_EXPORT_OPTIONS:
|
|
|
|
if (! _gimp_wire_read_int32 (channel,
|
|
|
|
(guint32 *) &(*params)[i].data.d_export_options.capabilities, 1,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
|
|
|
break;
|
|
|
|
|
2019-08-05 06:58:44 +08:00
|
|
|
case GP_PARAM_TYPE_PARAM_DEF:
|
|
|
|
if (! _gp_param_def_read (channel,
|
|
|
|
&(*params)[i].data.d_param_def,
|
|
|
|
user_data))
|
|
|
|
goto cleanup;
|
|
|
|
break;
|
2006-04-12 18:53:28 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2000-03-04 08:24:39 +08:00
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
cleanup:
|
2019-09-09 07:00:54 +08:00
|
|
|
*n_params = 0;
|
2000-03-04 08:24:39 +08:00
|
|
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
gint n_params,
|
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,
|
2019-09-09 07:00:54 +08:00
|
|
|
(const guint32 *) &n_params, 1, user_data))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < n_params; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-12-13 22:11:56 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
(const guint32 *) ¶ms[i].param_type, 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
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
¶ms[i].type_name, 1,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch (params[i].param_type)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_INT:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_int, 1,
|
2005-12-13 22:11:56 +08:00
|
|
|
user_data))
|
2006-04-12 18:53:28 +08:00
|
|
|
return;
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_FLOAT:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_double (channel,
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
(const gdouble *) ¶ms[i].data.d_float, 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
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_STRING:
|
2019-09-12 03:40:17 +08:00
|
|
|
case GP_PARAM_TYPE_FILE:
|
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
|
|
|
|
2023-11-04 04:26:51 +08:00
|
|
|
case GP_PARAM_TYPE_GEGL_COLOR:
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) ¶ms[i].data.d_gegl_color.size, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) params[i].data.d_gegl_color.data,
|
|
|
|
params[i].data.d_gegl_color.size,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_string (channel,
|
|
|
|
¶ms[i].data.d_gegl_color.encoding, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) ¶ms[i].data.d_gegl_color.profile_size, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) params[i].data.d_gegl_color.profile_data,
|
|
|
|
params[i].data.d_gegl_color.profile_size,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
break;
|
|
|
|
|
2023-12-27 00:07:19 +08:00
|
|
|
case GP_PARAM_TYPE_COLOR_ARRAY:
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) ¶ms[i].data.d_color_array.size, 1,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (gint j = 0; j < params[i].data.d_color_array.size; j++)
|
|
|
|
{
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) ¶ms[i].data.d_color_array.colors[j].size, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) params[i].data.d_color_array.colors[j].data,
|
|
|
|
params[i].data.d_color_array.colors[j].size,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_string (channel,
|
|
|
|
¶ms[i].data.d_color_array.colors[j].encoding, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) ¶ms[i].data.d_color_array.colors[j].profile_size, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) params[i].data.d_color_array.colors[j].profile_data,
|
|
|
|
params[i].data.d_color_array.colors[j].profile_size,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_ARRAY:
|
2006-04-12 18:53:28 +08:00
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
(const guint32 *) ¶ms[i].data.d_array.size, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int8 (channel,
|
|
|
|
(const guint8 *) params[i].data.d_array.data,
|
|
|
|
params[i].data.d_array.size,
|
|
|
|
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
|
|
|
|
2023-05-24 05:37:46 +08:00
|
|
|
case GP_PARAM_TYPE_BYTES:
|
|
|
|
{
|
|
|
|
const guint8 *bytes = NULL;
|
|
|
|
guint32 size = 0;
|
|
|
|
|
|
|
|
if (params[i].data.d_bytes)
|
|
|
|
{
|
2023-05-26 05:47:42 +08:00
|
|
|
bytes = g_bytes_get_data (params[i].data.d_bytes, NULL);
|
|
|
|
size = g_bytes_get_size (params[i].data.d_bytes);
|
2023-05-24 05:37:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_int32 (channel, &size, 1, user_data) ||
|
|
|
|
! _gimp_wire_write_int8 (channel, bytes, size, user_data))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2020-12-24 04:15:43 +08:00
|
|
|
case GP_PARAM_TYPE_STRV:
|
2022-02-11 06:53:10 +08:00
|
|
|
{
|
|
|
|
gint size;
|
|
|
|
|
|
|
|
if (params[i].data.d_strv)
|
|
|
|
size = g_strv_length (params[i].data.d_strv);
|
|
|
|
else
|
|
|
|
size = 0;
|
|
|
|
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(guint32*) &size, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_string (channel,
|
|
|
|
params[i].data.d_strv,
|
|
|
|
size,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2019-09-05 17:34:54 +08:00
|
|
|
case GP_PARAM_TYPE_ID_ARRAY:
|
|
|
|
if (! _gimp_wire_write_string (channel,
|
|
|
|
¶ms[i].data.d_id_array.type_name, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) ¶ms[i].data.d_id_array.size, 1,
|
|
|
|
user_data) ||
|
|
|
|
! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) params[i].data.d_id_array.data,
|
|
|
|
params[i].data.d_id_array.size,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_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;
|
2019-08-05 06:58:44 +08:00
|
|
|
|
2024-05-07 02:38:12 +08:00
|
|
|
case GP_PARAM_TYPE_EXPORT_OPTIONS:
|
|
|
|
if (! _gimp_wire_write_int32 (channel,
|
|
|
|
(const guint32 *) ¶ms[i].data.d_export_options.capabilities, 1,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
break;
|
|
|
|
|
2019-08-05 06:58:44 +08:00
|
|
|
case GP_PARAM_TYPE_PARAM_DEF:
|
|
|
|
if (! _gp_param_def_write (channel,
|
|
|
|
¶ms[i].data.d_param_def,
|
|
|
|
user_data))
|
|
|
|
return;
|
|
|
|
break;
|
2006-04-12 18:53:28 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
static void
|
|
|
|
_gp_params_destroy (GPParam *params,
|
2019-09-09 07:00:54 +08:00
|
|
|
gint n_params)
|
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
|
|
|
|
2019-09-09 07:00:54 +08:00
|
|
|
for (i = 0; i < n_params; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
g_free (params[i].type_name);
|
|
|
|
|
|
|
|
switch (params[i].param_type)
|
2006-04-12 18:53:28 +08:00
|
|
|
{
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_INT:
|
|
|
|
case GP_PARAM_TYPE_FLOAT:
|
2006-04-12 18:53:28 +08:00
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_STRING:
|
2019-09-12 03:40:17 +08:00
|
|
|
case GP_PARAM_TYPE_FILE:
|
2006-04-12 18:53:28 +08:00
|
|
|
g_free (params[i].data.d_string);
|
|
|
|
break;
|
|
|
|
|
2023-11-04 04:26:51 +08:00
|
|
|
case GP_PARAM_TYPE_GEGL_COLOR:
|
|
|
|
g_free (params[i].data.d_gegl_color.encoding);
|
|
|
|
g_free (params[i].data.d_gegl_color.profile_data);
|
|
|
|
break;
|
|
|
|
|
2023-12-27 00:07:19 +08:00
|
|
|
case GP_PARAM_TYPE_COLOR_ARRAY:
|
|
|
|
for (gint j = 0; j < params[i].data.d_color_array.size; j++)
|
|
|
|
{
|
|
|
|
g_free (params[i].data.d_color_array.colors[j].encoding);
|
|
|
|
g_free (params[i].data.d_color_array.colors[j].profile_data);
|
|
|
|
}
|
|
|
|
g_free (params[i].data.d_color_array.colors);
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_ARRAY:
|
|
|
|
g_free (params[i].data.d_array.data);
|
2006-04-12 18:53:28 +08:00
|
|
|
break;
|
|
|
|
|
2023-05-24 05:37:46 +08:00
|
|
|
case GP_PARAM_TYPE_BYTES:
|
|
|
|
g_bytes_unref (params[i].data.d_bytes);
|
|
|
|
break;
|
|
|
|
|
2020-12-24 04:15:43 +08:00
|
|
|
case GP_PARAM_TYPE_STRV:
|
|
|
|
g_strfreev (params[i].data.d_strv);
|
2006-04-12 18:53:28 +08:00
|
|
|
break;
|
2000-03-04 08:24:39 +08:00
|
|
|
|
2019-09-05 17:34:54 +08:00
|
|
|
case GP_PARAM_TYPE_ID_ARRAY:
|
|
|
|
g_free (params[i].data.d_id_array.type_name);
|
|
|
|
g_free (params[i].data.d_id_array.data);
|
|
|
|
break;
|
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
case GP_PARAM_TYPE_PARASITE:
|
2006-04-12 18:53:28 +08:00
|
|
|
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;
|
2019-08-05 06:58:44 +08:00
|
|
|
|
2024-05-07 02:38:12 +08:00
|
|
|
case GP_PARAM_TYPE_EXPORT_OPTIONS:
|
|
|
|
break;
|
|
|
|
|
2019-08-05 06:58:44 +08:00
|
|
|
case GP_PARAM_TYPE_PARAM_DEF:
|
|
|
|
_gp_param_def_destroy (¶ms[i].data.d_param_def);
|
|
|
|
break;
|
2006-04-12 18:53:28 +08:00
|
|
|
}
|
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,
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +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
|
|
|
{
|
|
|
|
}
|