gimp/libgimpbase/gimpprotocol.c

1940 lines
60 KiB
C
Raw Normal View History

Makefile.am configure.in added new directory libgimpbase/ 2001-05-21 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool-1.4.in: added new directory libgimpbase/ * app/Makefile.am: link against the new lib. * app/appenums.h: removed the PDB enums which are in libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed. * app/apptypes.h: #include "libgimpbase/gimpbasetypes.h" * app/[lots] * app/core/[of] * app/gui/[files] * app/tools/: changed includes and all PDB types. * app/pdb/*: regenerated. * libgimp/Makefile.am: don't build libgimpi.a uglyness any more. * libgimp/gimpenv.[ch] * libgimp/gimplimits.[hh] * libgimp/gimpparasite.[ch] * libgimp/gimpparasiteio.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimpsignal.[ch] * libgimp/gimpunit.h * libgimp/gimputils.[ch] * libgimp/gimpwire.[ch]: removed... * libgimpbase/*: ...and added here as new library. * libgimp/gimp.[ch] * libgimp/gimpdrawable.[ch] * libgimp/gimpenums.h * libgimp/gimpimage.[ch] * libgimp/gimptile.c * libgimp/gimptypes.h * libgimp/gimpunit.c: changed accordingly. Added the gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and gimpimage.[ch]. * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpsizeentry.c * libgimpwidgets/gimpunitmenu.c * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly. * plug-ins/*/Makefile.am * plug-ins/common/mkgen.pl: link against libgimpbase. * tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so the enums are known to pdbgen... * tools/pdbgen/enumcode.pl: ...but don't write them out to libgimp/gimpenums.h * tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c files. Added GIMP_ to the type names ganerated in app/. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 21:58:46 +08:00
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
1998-01-25 18:26:47 +08:00
*
* This library is free software: you can redistribute it and/or
1999-11-18 05:13:50 +08:00
* modify it under the terms of the GNU Lesser General Public
1998-01-25 18:26:47 +08:00
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
Makefile.am configure.in added new directory libgimpbase/ 2001-05-21 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool-1.4.in: added new directory libgimpbase/ * app/Makefile.am: link against the new lib. * app/appenums.h: removed the PDB enums which are in libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed. * app/apptypes.h: #include "libgimpbase/gimpbasetypes.h" * app/[lots] * app/core/[of] * app/gui/[files] * app/tools/: changed includes and all PDB types. * app/pdb/*: regenerated. * libgimp/Makefile.am: don't build libgimpi.a uglyness any more. * libgimp/gimpenv.[ch] * libgimp/gimplimits.[hh] * libgimp/gimpparasite.[ch] * libgimp/gimpparasiteio.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimpsignal.[ch] * libgimp/gimpunit.h * libgimp/gimputils.[ch] * libgimp/gimpwire.[ch]: removed... * libgimpbase/*: ...and added here as new library. * libgimp/gimp.[ch] * libgimp/gimpdrawable.[ch] * libgimp/gimpenums.h * libgimp/gimpimage.[ch] * libgimp/gimptile.c * libgimp/gimptypes.h * libgimp/gimpunit.c: changed accordingly. Added the gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and gimpimage.[ch]. * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpsizeentry.c * libgimpwidgets/gimpunitmenu.c * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly. * plug-ins/*/Makefile.am * plug-ins/common/mkgen.pl: link against libgimpbase. * tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so the enums are known to pdbgen... * tools/pdbgen/enumcode.pl: ...but don't write them out to libgimp/gimpenums.h * tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c files. Added GIMP_ to the type names ganerated in app/. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/unit.pdb: changed includes.
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
* License along with this library. If not, see
* <https://www.gnu.org/licenses/>.
Makefile.am configure.in added new directory libgimpbase/ 2001-05-21 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool-1.4.in: added new directory libgimpbase/ * app/Makefile.am: link against the new lib. * app/appenums.h: removed the PDB enums which are in libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed. * app/apptypes.h: #include "libgimpbase/gimpbasetypes.h" * app/[lots] * app/core/[of] * app/gui/[files] * app/tools/: changed includes and all PDB types. * app/pdb/*: regenerated. * libgimp/Makefile.am: don't build libgimpi.a uglyness any more. * libgimp/gimpenv.[ch] * libgimp/gimplimits.[hh] * libgimp/gimpparasite.[ch] * libgimp/gimpparasiteio.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimpsignal.[ch] * libgimp/gimpunit.h * libgimp/gimputils.[ch] * libgimp/gimpwire.[ch]: removed... * libgimpbase/*: ...and added here as new library. * libgimp/gimp.[ch] * libgimp/gimpdrawable.[ch] * libgimp/gimpenums.h * libgimp/gimpimage.[ch] * libgimp/gimptile.c * libgimp/gimptypes.h * libgimp/gimpunit.c: changed accordingly. Added the gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and gimpimage.[ch]. * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpsizeentry.c * libgimpwidgets/gimpunitmenu.c * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly. * plug-ins/*/Makefile.am * plug-ins/common/mkgen.pl: link against libgimpbase. * tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so the enums are known to pdbgen... * tools/pdbgen/enumcode.pl: ...but don't write them out to libgimp/gimpenums.h * tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c files. Added GIMP_ to the type names ganerated in app/. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 21:58:46 +08:00
*/
#include "config.h"
#include <glib-object.h>
Libgimp cleanup part II (with a little help from Yosh who moved the CVS 2000-05-27 Michael Natterer <mitch@gimp.org> Libgimp cleanup part II (with a little help from Yosh who moved the CVS files). * libgimp/Makefile.am * libgimp/gimpchannel_pdb.c * libgimp/gimpdisplay_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpparasite_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimpunit_pdb.c: new names of all files which contain PDB wrappers. * modules/Makefile.am * libgimp/gimpcolordisplay.h * libgimp/gimpcolorselector.h * modules/gimpmodregister.[ch]: renamed. * libgimp/gimpparasiteF.h * libgimp/gimpparasiteP.h: removed because gimp.h had to include the private header anyway. * app/color_notebook.c * app/color_select.c * app/gdisplay_color.[ch] * app/gdisplay_color_ui.c * app/gimpbrushpipe.c * app/gimpdrawable.[ch] * app/gimpimage.c * app/gimpimage.h * app/gimpparasite.[ch] * app/gimprc.c * app/image_new.c * app/layer.c * app/parasite_cmds.c * app/parasitelist.[ch] * app/plug_in.c * app/procedural_db.c * app/undo.c * app/xcf.c * libgimp/gimp.[ch] * libgimp/gimpcolordisplay.h * libgimp/gimpparasite.[ch] * modules/cdisplay_gamma.c * modules/cdisplay_highcontrast.c * modules/colorsel_gtk.c * modules/colorsel_triangle.c * modules/colorsel_water.c * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/Lighting/lighting_apply.c * plug-ins/Lighting/lighting_shade.c * plug-ins/MapObject/mapobject_image.c * plug-ins/common/gpb.c * plug-ins/common/psp.c * plug-ins/sel2path/sel2path.c * po-libgimp/POTFILES.in * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/parasite.pdb: changed includes accordingly.
2000-05-27 09:30:21 +08:00
Makefile.am configure.in added new directory libgimpbase/ 2001-05-21 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool-1.4.in: added new directory libgimpbase/ * app/Makefile.am: link against the new lib. * app/appenums.h: removed the PDB enums which are in libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed. * app/apptypes.h: #include "libgimpbase/gimpbasetypes.h" * app/[lots] * app/core/[of] * app/gui/[files] * app/tools/: changed includes and all PDB types. * app/pdb/*: regenerated. * libgimp/Makefile.am: don't build libgimpi.a uglyness any more. * libgimp/gimpenv.[ch] * libgimp/gimplimits.[hh] * libgimp/gimpparasite.[ch] * libgimp/gimpparasiteio.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimpsignal.[ch] * libgimp/gimpunit.h * libgimp/gimputils.[ch] * libgimp/gimpwire.[ch]: removed... * libgimpbase/*: ...and added here as new library. * libgimp/gimp.[ch] * libgimp/gimpdrawable.[ch] * libgimp/gimpenums.h * libgimp/gimpimage.[ch] * libgimp/gimptile.c * libgimp/gimptypes.h * libgimp/gimpunit.c: changed accordingly. Added the gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and gimpimage.[ch]. * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpsizeentry.c * libgimpwidgets/gimpunitmenu.c * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly. * plug-ins/*/Makefile.am * plug-ins/common/mkgen.pl: link against libgimpbase. * tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so the enums are known to pdbgen... * tools/pdbgen/enumcode.pl: ...but don't write them out to libgimp/gimpenums.h * tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c files. Added GIMP_ to the type names ganerated in app/. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 21:58:46 +08:00
#include "gimpbasetypes.h"
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 23:22:01 +08:00
#include "gimpparamspecs.h"
Libgimp cleanup part II (with a little help from Yosh who moved the CVS 2000-05-27 Michael Natterer <mitch@gimp.org> Libgimp cleanup part II (with a little help from Yosh who moved the CVS files). * libgimp/Makefile.am * libgimp/gimpchannel_pdb.c * libgimp/gimpdisplay_pdb.c * libgimp/gimpdrawable_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimphelp_pdb.c * libgimp/gimpimage_pdb.c * libgimp/gimplayer_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimpparasite_pdb.c * libgimp/gimpselection_pdb.c * libgimp/gimpunit_pdb.c: new names of all files which contain PDB wrappers. * modules/Makefile.am * libgimp/gimpcolordisplay.h * libgimp/gimpcolorselector.h * modules/gimpmodregister.[ch]: renamed. * libgimp/gimpparasiteF.h * libgimp/gimpparasiteP.h: removed because gimp.h had to include the private header anyway. * app/color_notebook.c * app/color_select.c * app/gdisplay_color.[ch] * app/gdisplay_color_ui.c * app/gimpbrushpipe.c * app/gimpdrawable.[ch] * app/gimpimage.c * app/gimpimage.h * app/gimpparasite.[ch] * app/gimprc.c * app/image_new.c * app/layer.c * app/parasite_cmds.c * app/parasitelist.[ch] * app/plug_in.c * app/procedural_db.c * app/undo.c * app/xcf.c * libgimp/gimp.[ch] * libgimp/gimpcolordisplay.h * libgimp/gimpparasite.[ch] * modules/cdisplay_gamma.c * modules/cdisplay_highcontrast.c * modules/colorsel_gtk.c * modules/colorsel_triangle.c * modules/colorsel_water.c * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/Lighting/lighting_apply.c * plug-ins/Lighting/lighting_shade.c * plug-ins/MapObject/mapobject_image.c * plug-ins/common/gpb.c * plug-ins/common/psp.c * plug-ins/sel2path/sel2path.c * po-libgimp/POTFILES.in * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/parasite.pdb: changed includes accordingly.
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"
static void _gp_quit_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_quit_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_quit_destroy (GimpWireMessage *msg);
static void _gp_config_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_config_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_config_destroy (GimpWireMessage *msg);
static void _gp_tile_req_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_tile_req_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_tile_req_destroy (GimpWireMessage *msg);
static void _gp_tile_ack_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_tile_ack_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_tile_ack_destroy (GimpWireMessage *msg);
static void _gp_tile_data_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_tile_data_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_tile_data_destroy (GimpWireMessage *msg);
static void _gp_proc_run_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_proc_run_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_proc_run_destroy (GimpWireMessage *msg);
static void _gp_proc_return_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_proc_return_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_proc_return_destroy (GimpWireMessage *msg);
static void _gp_temp_proc_run_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_temp_proc_run_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_temp_proc_run_destroy (GimpWireMessage *msg);
static void _gp_temp_proc_return_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_temp_proc_return_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_temp_proc_return_destroy (GimpWireMessage *msg);
static void _gp_proc_install_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_proc_install_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_proc_install_destroy (GimpWireMessage *msg);
static void _gp_proc_uninstall_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_proc_uninstall_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_proc_uninstall_destroy (GimpWireMessage *msg);
static void _gp_extension_ack_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_extension_ack_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_extension_ack_destroy (GimpWireMessage *msg);
static void _gp_params_read (GIOChannel *channel,
GPParam **params,
guint *n_params,
gpointer user_data);
static void _gp_params_write (GIOChannel *channel,
GPParam *params,
gint n_params,
gpointer user_data);
static void _gp_params_destroy (GPParam *params,
gint n_params);
static void _gp_has_init_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_has_init_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data);
static void _gp_has_init_destroy (GimpWireMessage *msg);
1997-11-25 06:05:25 +08:00
void
gp_init (void)
1997-11-25 06:05:25 +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
}
/* public writing API */
gboolean
gp_quit_write (GIOChannel *channel,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_QUIT;
msg.data = NULL;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
1999-03-07 20:56:03 +08:00
gp_config_write (GIOChannel *channel,
GPConfig *config,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_CONFIG;
msg.data = config;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
1999-03-07 20:56:03 +08:00
gp_tile_req_write (GIOChannel *channel,
GPTileReq *tile_req,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_TILE_REQ;
msg.data = tile_req;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
gp_tile_ack_write (GIOChannel *channel,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_TILE_ACK;
msg.data = NULL;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
1999-03-07 20:56:03 +08:00
gp_tile_data_write (GIOChannel *channel,
GPTileData *tile_data,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_TILE_DATA;
msg.data = tile_data;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
1999-03-07 20:56:03 +08:00
gp_proc_run_write (GIOChannel *channel,
GPProcRun *proc_run,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_PROC_RUN;
msg.data = proc_run;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
1999-03-07 20:56:03 +08:00
gp_proc_return_write (GIOChannel *channel,
GPProcReturn *proc_return,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_PROC_RETURN;
msg.data = proc_return;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
1999-03-07 20:56:03 +08:00
gp_temp_proc_run_write (GIOChannel *channel,
GPProcRun *proc_run,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_TEMP_PROC_RUN;
msg.data = proc_run;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
1999-03-07 20:56:03 +08:00
gp_temp_proc_return_write (GIOChannel *channel,
GPProcReturn *proc_return,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_TEMP_PROC_RETURN;
msg.data = proc_return;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
1999-03-07 20:56:03 +08:00
gp_proc_install_write (GIOChannel *channel,
GPProcInstall *proc_install,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_PROC_INSTALL;
msg.data = proc_install;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
1999-03-07 20:56:03 +08:00
gp_proc_uninstall_write (GIOChannel *channel,
GPProcUninstall *proc_uninstall,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_PROC_UNINSTALL;
msg.data = proc_uninstall;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
gp_extension_ack_write (GIOChannel *channel,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GimpWireMessage msg;
1997-11-25 06:05:25 +08:00
msg.type = GP_EXTENSION_ACK;
msg.data = NULL;
if (! gimp_wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! gimp_wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
1997-11-25 06:05:25 +08:00
return TRUE;
}
gboolean
gp_has_init_write (GIOChannel *channel,
gpointer user_data)
{
GimpWireMessage msg;
msg.type = GP_HAS_INIT;
msg.data = NULL;
if (! gimp_wire_write_msg (channel, &msg, user_data))
return FALSE;
if (! gimp_wire_flush (channel, user_data))
return FALSE;
return TRUE;
}
/* quit */
1997-11-25 06:05:25 +08:00
static void
_gp_quit_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_quit_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_quit_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
}
/* config */
1997-11-25 06:05:25 +08:00
static void
_gp_config_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPConfig *config = g_slice_new0 (GPConfig);
if (! _gimp_wire_read_int32 (channel,
&config->tile_width, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&config->tile_height, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &config->shm_id, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->check_size, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->check_type, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->show_help_button, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->use_cpu_accel, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->use_opencl, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->export_color_profile, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->export_comment, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->export_exif, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->export_xmp, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int8 (channel,
(guint8 *) &config->export_iptc, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &config->default_display_id, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_read_string (channel,
&config->app_name, 1, user_data))
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
goto cleanup;
if (! _gimp_wire_read_string (channel,
&config->wm_class, 1, user_data))
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
goto cleanup;
if (! _gimp_wire_read_string (channel,
&config->display_name, 1, user_data))
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &config->monitor_number, 1,
user_data))
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&config->timestamp, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_string (channel,
&config->icon_theme_dir, 1, user_data))
goto cleanup;
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;
if (! _gimp_wire_read_string (channel,
&config->swap_compression, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &config->num_processors, 1,
user_data))
goto cleanup;
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
1997-11-25 06:05:25 +08:00
msg->data = config;
return;
cleanup:
g_free (config->app_name);
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
g_free (config->wm_class);
g_free (config->display_name);
g_free (config->icon_theme_dir);
g_free (config->swap_path);
g_free (config->swap_compression);
g_slice_free (GPConfig, config);
1997-11-25 06:05:25 +08:00
}
static void
_gp_config_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPConfig *config = msg->data;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_write_int32 (channel,
&config->tile_width, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
&config->tile_height, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &config->shm_id, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->check_size, 1,
user_data))
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->check_type, 1,
user_data))
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->show_help_button, 1,
user_data))
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->use_cpu_accel, 1,
user_data))
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->use_opencl, 1,
user_data))
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->export_color_profile, 1,
user_data))
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->export_comment, 1,
user_data))
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->export_exif, 1,
user_data))
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->export_xmp, 1,
user_data))
return;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) &config->export_iptc, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &config->default_display_id, 1,
user_data))
return;
if (! _gimp_wire_write_string (channel,
&config->app_name, 1, user_data))
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
return;
if (! _gimp_wire_write_string (channel,
&config->wm_class, 1, user_data))
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
return;
if (! _gimp_wire_write_string (channel,
&config->display_name, 1, user_data))
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &config->monitor_number, 1,
user_data))
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &config->timestamp, 1,
user_data))
return;
if (! _gimp_wire_write_string (channel,
&config->icon_theme_dir, 1, user_data))
return;
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;
if (! _gimp_wire_write_string (channel,
&config->swap_compression, 1, user_data))
return;
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
_gp_config_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPConfig *config = msg->data;
added "wm_name", "wm_class", "display_name" and "monitor_number" to the 2003-11-07 Michael Natterer <mitch@gimp.org> * libgimpbase/gimpprotocol.[ch]: added "wm_name", "wm_class", "display_name" and "monitor_number" to the GPConfig message. Increased protocol version number. * libgimp/gimp.[ch] (gimp_config): read them from the GPConfig message and remember them. Added public accessors for the new config values. * libgimp/gimpui.c (gimp_ui_init): pass wm_name and wm_class to gtk_init() and export the display/screen to use to the environment. * app/core/gimp.[ch]: added vtable entries to get the values from the GUI. * app/gui/gui-vtable.c: implement the vtable entries. * app/plug-in/plug-in-run.c: fill in the GPConfig values using the new Gimp vtable functions. * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/channels-commands.c * app/gui/color-notebook.c * app/gui/convert-dialog.c * app/gui/file-dialog-utils.[ch] * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gradients-commands.c * app/gui/grid-dialog.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/info-window.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-import-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/splash.c * app/gui/stroke-dialog.c * app/gui/templates-commands.c * app/gui/tips-dialog.c * app/gui/vectors-commands.c * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c * app/widgets/gimpdock.c * app/widgets/gimperrorconsole.c * app/widgets/gimptexteditor.c * app/widgets/gimptoolbox.c * app/widgets/gimpviewabledialog.[ch] * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpunitmenu.c * plug-ins/helpbrowser/dialog.c * plug-ins/ifscompose/ifscompose.c: replaced all calls to gtk_window_set_wmclass() by gtk_window_set_role() and all "const gchar *wmclass_name" parameters by "const gchar *role". Cleaned up the window role strings.
2003-11-08 01:29:02 +08:00
if (config)
{
g_free (config->app_name);
g_free (config->wm_class);
g_free (config->display_name);
g_free (config->icon_theme_dir);
g_free (config->swap_path);
g_free (config->swap_compression);
g_slice_free (GPConfig, config);
}
1997-11-25 06:05:25 +08:00
}
/* tile_req */
1997-11-25 06:05:25 +08:00
static void
_gp_tile_req_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPTileReq *tile_req = g_slice_new0 (GPTileReq);
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &tile_req->drawable_id, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&tile_req->tile_num, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&tile_req->shadow, 1, user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
msg->data = tile_req;
return;
cleanup:
g_slice_free (GPTileReq, tile_req);
msg->data = NULL;
1997-11-25 06:05:25 +08:00
}
static void
_gp_tile_req_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPTileReq *tile_req = msg->data;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &tile_req->drawable_id, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
&tile_req->tile_num, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
&tile_req->shadow, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
}
static void
_gp_tile_req_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPTileReq *tile_req = msg->data;
if (tile_req)
g_slice_free (GPTileReq, msg->data);
1997-11-25 06:05:25 +08:00
}
/* tile_ack */
1997-11-25 06:05:25 +08:00
static void
_gp_tile_ack_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_tile_ack_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_tile_ack_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
}
/* tile_data */
1997-11-25 06:05:25 +08:00
static void
_gp_tile_data_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPTileData *tile_data = g_slice_new0 (GPTileData);
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &tile_data->drawable_id, 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&tile_data->tile_num, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&tile_data->shadow, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&tile_data->bpp, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&tile_data->width, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&tile_data->height, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&tile_data->use_shm, 1, user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
if (!tile_data->use_shm)
{
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);
if (! _gimp_wire_read_int8 (channel,
(guint8 *) tile_data->data, length,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
}
msg->data = tile_data;
return;
cleanup:
g_free (tile_data->data);
g_slice_free (GPTileData, tile_data);
msg->data = NULL;
1997-11-25 06:05:25 +08:00
}
static void
_gp_tile_data_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPTileData *tile_data = msg->data;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &tile_data->drawable_id, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
&tile_data->tile_num, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
&tile_data->shadow, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
&tile_data->bpp, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
&tile_data->width, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! _gimp_wire_write_int32 (channel,
&tile_data->height, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
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)
{
guint length = tile_data->width * tile_data->height * tile_data->bpp;
if (! _gimp_wire_write_int8 (channel,
(const guint8 *) tile_data->data, length,
user_data))
return;
1997-11-25 06:05:25 +08:00
}
}
static void
_gp_tile_data_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPTileData *tile_data = msg->data;
if (tile_data)
{
if (tile_data->data)
{
g_free (tile_data->data);
tile_data->data = NULL;
}
g_slice_free (GPTileData, tile_data);
}
1997-11-25 06:05:25 +08:00
}
/* proc_run */
1997-11-25 06:05:25 +08:00
static void
_gp_proc_run_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcRun *proc_run = g_slice_new0 (GPProcRun);
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_read_string (channel, &proc_run->name, 1, user_data))
goto cleanup;
_gp_params_read (channel,
&proc_run->params, (guint *) &proc_run->n_params,
user_data);
1997-11-25 06:05:25 +08:00
msg->data = proc_run;
return;
cleanup:
g_slice_free (GPProcRun, proc_run);
msg->data = NULL;
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_run_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcRun *proc_run = msg->data;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_write_string (channel, &proc_run->name, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
_gp_params_write (channel, proc_run->params, proc_run->n_params, user_data);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_run_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcRun *proc_run = msg->data;
1997-11-25 06:05:25 +08:00
if (proc_run)
{
_gp_params_destroy (proc_run->params, proc_run->n_params);
g_free (proc_run->name);
g_slice_free (GPProcRun, proc_run);
}
1997-11-25 06:05:25 +08:00
}
/* proc_return */
1997-11-25 06:05:25 +08:00
static void
_gp_proc_return_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcReturn *proc_return = g_slice_new0 (GPProcReturn);
if (! _gimp_wire_read_string (channel, &proc_return->name, 1, user_data))
goto cleanup;
_gp_params_read (channel,
&proc_return->params, (guint *) &proc_return->n_params,
user_data);
1997-11-25 06:05:25 +08:00
msg->data = proc_return;
return;
cleanup:
g_slice_free (GPProcReturn, proc_return);
msg->data = NULL;
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_return_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcReturn *proc_return = msg->data;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_write_string (channel, &proc_return->name, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
_gp_params_write (channel,
proc_return->params, proc_return->n_params, user_data);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_return_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcReturn *proc_return = msg->data;
1997-11-25 06:05:25 +08:00
if (proc_return)
{
_gp_params_destroy (proc_return->params, proc_return->n_params);
g_free (proc_return->name);
g_slice_free (GPProcReturn, proc_return);
}
1997-11-25 06:05:25 +08:00
}
/* temp_proc_run */
1997-11-25 06:05:25 +08:00
static void
_gp_temp_proc_run_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
_gp_proc_run_read (channel, msg, user_data);
1997-11-25 06:05:25 +08:00
}
static void
_gp_temp_proc_run_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
_gp_proc_run_write (channel, msg, user_data);
1997-11-25 06:05:25 +08:00
}
static void
_gp_temp_proc_run_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
_gp_proc_run_destroy (msg);
}
/* temp_proc_return */
1997-11-25 06:05:25 +08:00
static void
_gp_temp_proc_return_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
_gp_proc_return_read (channel, msg, user_data);
1997-11-25 06:05:25 +08:00
}
static void
_gp_temp_proc_return_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
_gp_proc_return_write (channel, msg, user_data);
1997-11-25 06:05:25 +08:00
}
static void
_gp_temp_proc_return_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
_gp_proc_return_destroy (msg);
}
/* 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,
&param_def->param_def_type, 1,
user_data))
return FALSE;
if (! _gimp_wire_read_string (channel,
&param_def->type_name, 1,
user_data))
return FALSE;
if (! _gimp_wire_read_string (channel,
&param_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,
&param_def->name, 1,
user_data))
return FALSE;
if (! _gimp_wire_read_string (channel,
&param_def->nick, 1,
user_data))
return FALSE;
if (! _gimp_wire_read_string (channel,
&param_def->blurb, 1,
user_data))
return FALSE;
if (! _gimp_wire_read_int32 (channel,
&param_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:
if (! _gimp_wire_read_int64 (channel,
(guint64 *) &param_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) ||
! _gimp_wire_read_int64 (channel,
(guint64 *) &param_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) ||
! _gimp_wire_read_int64 (channel,
(guint64 *) &param_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;
case GP_PARAM_DEF_TYPE_UNIT:
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &param_def->meta.m_unit.allow_pixels, 1,
user_data) ||
! _gimp_wire_read_int32 (channel,
(guint32 *) &param_def->meta.m_unit.allow_percent, 1,
user_data) ||
! _gimp_wire_read_int32 (channel,
(guint32 *) &param_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:
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 *) &param_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 *) &param_def->meta.m_boolean.default_val, 1,
user_data))
return FALSE;
break;
case GP_PARAM_DEF_TYPE_FLOAT:
if (! _gimp_wire_read_double (channel,
&param_def->meta.m_float.min_val, 1,
user_data) ||
! _gimp_wire_read_double (channel,
&param_def->meta.m_float.max_val, 1,
user_data) ||
! _gimp_wire_read_double (channel,
&param_def->meta.m_float.default_val, 1,
user_data))
return FALSE;
break;
case GP_PARAM_DEF_TYPE_STRING:
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
&param_def->meta.m_string.default_val, 1,
user_data))
return FALSE;
break;
case GP_PARAM_DEF_TYPE_COLOR:
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &param_def->meta.m_color.has_alpha, 1,
user_data) ||
! _gimp_wire_read_color (channel,
&param_def->meta.m_color.default_val, 1,
user_data))
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 FALSE;
break;
case GP_PARAM_DEF_TYPE_ID:
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &param_def->meta.m_id.none_ok, 1,
user_data))
return FALSE;
break;
case GP_PARAM_DEF_TYPE_ID_ARRAY:
if (! _gimp_wire_read_string (channel,
&param_def->meta.m_id_array.type_name, 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);
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:
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;
case GP_PARAM_DEF_TYPE_STRING:
g_free (param_def->meta.m_string.default_val);
break;
case GP_PARAM_DEF_TYPE_COLOR:
case GP_PARAM_DEF_TYPE_ID:
break;
case GP_PARAM_DEF_TYPE_ID_ARRAY:
g_free (param_def->meta.m_id_array.type_name);
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
_gp_proc_install_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcInstall *proc_install = g_slice_new0 (GPProcInstall);
gint i;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_read_string (channel,
&proc_install->name, 1, user_data) ||
! _gimp_wire_read_int32 (channel,
&proc_install->type, 1, user_data) ||
! _gimp_wire_read_int32 (channel,
&proc_install->n_params, 1, user_data) ||
! _gimp_wire_read_int32 (channel,
&proc_install->n_return_vals, 1, user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
proc_install->params = g_new0 (GPParamDef, proc_install->n_params);
1997-11-25 06:05:25 +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))
goto cleanup;
1997-11-25 06:05:25 +08:00
}
proc_install->return_vals = g_new0 (GPParamDef, proc_install->n_return_vals);
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))
goto cleanup;
1997-11-25 06:05:25 +08:00
}
msg->data = proc_install;
return;
cleanup:
g_free (proc_install->name);
if (proc_install->params)
{
for (i = 0; i < proc_install->n_params; i++)
{
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)
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
_gp_param_def_destroy (&proc_install->params[i]);
}
g_free (proc_install->params);
}
if (proc_install->return_vals)
{
for (i = 0; i < proc_install->n_return_vals; i++)
{
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)
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
_gp_param_def_destroy (&proc_install->return_vals[i]);
}
g_free (proc_install->return_vals);
}
g_slice_free (GPProcInstall, proc_install);
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,
&param_def->param_def_type, 1,
user_data))
return FALSE;
if (! _gimp_wire_write_string (channel,
&param_def->type_name, 1,
user_data))
return FALSE;
if (! _gimp_wire_write_string (channel,
&param_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,
&param_def->name, 1,
user_data))
return FALSE;
if (! _gimp_wire_write_string (channel,
&param_def->nick, 1,
user_data))
return FALSE;
if (! _gimp_wire_write_string (channel,
&param_def->blurb, 1,
user_data))
return FALSE;
if (! _gimp_wire_write_int32 (channel,
&param_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:
if (! _gimp_wire_write_int64 (channel,
(guint64 *) &param_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) ||
! _gimp_wire_write_int64 (channel,
(guint64 *) &param_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) ||
! _gimp_wire_write_int64 (channel,
(guint64 *) &param_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;
case GP_PARAM_DEF_TYPE_UNIT:
if (! _gimp_wire_write_int32 (channel,
(guint32 *) &param_def->meta.m_unit.allow_pixels, 1,
user_data) ||
! _gimp_wire_write_int32 (channel,
(guint32 *) &param_def->meta.m_unit.allow_percent, 1,
user_data) ||
! _gimp_wire_write_int32 (channel,
(guint32 *) &param_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:
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 *) &param_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 *) &param_def->meta.m_boolean.default_val, 1,
user_data))
return FALSE;
break;
case GP_PARAM_DEF_TYPE_FLOAT:
if (! _gimp_wire_write_double (channel,
&param_def->meta.m_float.min_val, 1,
user_data) ||
! _gimp_wire_write_double (channel,
&param_def->meta.m_float.max_val, 1,
user_data) ||
! _gimp_wire_write_double (channel,
&param_def->meta.m_float.default_val, 1,
user_data))
return FALSE;
break;
case GP_PARAM_DEF_TYPE_STRING:
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
&param_def->meta.m_string.default_val, 1,
user_data))
return FALSE;
break;
case GP_PARAM_DEF_TYPE_COLOR:
if (! _gimp_wire_write_int32 (channel,
(guint32 *) &param_def->meta.m_color.has_alpha, 1,
user_data) ||
! _gimp_wire_write_color (channel,
&param_def->meta.m_color.default_val, 1,
user_data))
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 FALSE;
break;
case GP_PARAM_DEF_TYPE_ID:
if (! _gimp_wire_write_int32 (channel,
(guint32 *) &param_def->meta.m_id.none_ok, 1,
user_data))
return FALSE;
break;
case GP_PARAM_DEF_TYPE_ID_ARRAY:
if (! _gimp_wire_write_string (channel,
&param_def->meta.m_id_array.type_name, 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_proc_install_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcInstall *proc_install = msg->data;
gint i;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_write_string (channel,
&proc_install->name, 1, user_data) ||
! _gimp_wire_write_int32 (channel,
&proc_install->type, 1, user_data) ||
! _gimp_wire_write_int32 (channel,
&proc_install->n_params, 1, user_data) ||
! _gimp_wire_write_int32 (channel,
&proc_install->n_return_vals, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
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))
return;
1997-11-25 06:05:25 +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))
return;
1997-11-25 06:05:25 +08:00
}
}
static void
_gp_proc_install_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcInstall *proc_install = msg->data;
1997-11-25 06:05:25 +08:00
if (proc_install)
1997-11-25 06:05:25 +08:00
{
gint i;
1997-11-25 06:05:25 +08:00
g_free (proc_install->name);
1997-11-25 06:05:25 +08:00
for (i = 0; i < proc_install->n_params; i++)
{
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]);
}
for (i = 0; i < proc_install->n_return_vals; i++)
{
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]);
}
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
}
/* proc_uninstall */
1997-11-25 06:05:25 +08:00
static void
_gp_proc_uninstall_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcUninstall *proc_uninstall = g_slice_new0 (GPProcUninstall);
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_read_string (channel, &proc_uninstall->name, 1, user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
msg->data = proc_uninstall;
return;
cleanup:
g_slice_free (GPProcUninstall, proc_uninstall);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_uninstall_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcUninstall *proc_uninstall = msg->data;
1997-11-25 06:05:25 +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
_gp_proc_uninstall_destroy (GimpWireMessage *msg)
1997-11-25 06:05:25 +08:00
{
GPProcUninstall *proc_uninstall = msg->data;
1997-11-25 06:05:25 +08:00
if (proc_uninstall)
{
g_free (proc_uninstall->name);
g_slice_free (GPProcUninstall, proc_uninstall);
}
1997-11-25 06:05:25 +08:00
}
/* extension_ack */
1997-11-25 06:05:25 +08:00
static void
_gp_extension_ack_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_extension_ack_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
{
}
static void
_gp_extension_ack_destroy (GimpWireMessage *msg)
{
}
/* params */
static void
_gp_params_read (GIOChannel *channel,
GPParam **params,
guint *n_params,
gpointer user_data)
{
2021-05-25 04:36:31 +08:00
guint i;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_read_int32 (channel, (guint32 *) n_params, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (*n_params == 0)
1997-11-25 06:05:25 +08:00
{
*params = NULL;
return;
}
*params = g_try_new0 (GPParam, *n_params);
/* 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",
G_STRFUNC, *n_params);
*n_params = 0;
return;
}
1997-11-25 06:05:25 +08:00
for (i = 0; i < *n_params; i++)
1997-11-25 06:05:25 +08:00
{
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &(*params)[i].param_type, 1,
user_data) ||
! _gimp_wire_read_string (channel,
&(*params)[i].type_name, 1,
user_data))
return;
switch ((*params)[i].param_type)
{
case GP_PARAM_TYPE_INT:
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &(*params)[i].data.d_int, 1,
user_data))
goto cleanup;
break;
case GP_PARAM_TYPE_FLOAT:
if (! _gimp_wire_read_double (channel,
&(*params)[i].data.d_float, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GP_PARAM_TYPE_STRING:
case GP_PARAM_TYPE_FILE:
if (! _gimp_wire_read_string (channel,
&(*params)[i].data.d_string, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GP_PARAM_TYPE_COLOR:
if (! _gimp_wire_read_color (channel,
&(*params)[i].data.d_color, 1,
user_data))
goto cleanup;
break;
case GP_PARAM_TYPE_ARRAY:
if (! _gimp_wire_read_int32 (channel,
&(*params)[i].data.d_array.size, 1,
user_data))
goto cleanup;
(*params)[i].data.d_array.data = g_new0 (guint8,
(*params)[i].data.d_array.size);
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;
case GP_PARAM_TYPE_STRING_ARRAY:
if (! _gimp_wire_read_int32 (channel,
&(*params)[i].data.d_string_array.size, 1,
user_data))
goto cleanup;
(*params)[i].data.d_string_array.data = g_new0 (gchar *,
(*params)[i].data.d_array.size);
if (! _gimp_wire_read_string (channel,
(*params)[i].data.d_string_array.data,
(*params)[i].data.d_array.size,
user_data))
2017-06-17 17:38:18 +08:00
{
gint j;
for (j = 0; j < (*params)[i].data.d_array.size; j++)
g_free ((*params)[i].data.d_string_array.data[j]);
g_free ((*params)[i].data.d_string_array.data);
(*params)[i].data.d_string_array.data = NULL;
2017-06-17 17:38:18 +08:00
goto cleanup;
}
1997-11-25 06:05:25 +08:00
break;
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;
case GP_PARAM_TYPE_PARASITE:
if (! _gimp_wire_read_string (channel,
&(*params)[i].data.d_parasite.name, 1,
user_data))
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,
&((*params)[i].data.d_parasite.flags), 1,
user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
&((*params)[i].data.d_parasite.size), 1,
user_data))
goto cleanup;
if ((*params)[i].data.d_parasite.size > 0)
{
(*params)[i].data.d_parasite.data =
g_malloc ((*params)[i].data.d_parasite.size);
if (! _gimp_wire_read_int8 (channel,
(*params)[i].data.d_parasite.data,
(*params)[i].data.d_parasite.size,
user_data))
{
g_free ((*params)[i].data.d_parasite.data);
goto cleanup;
}
}
else
(*params)[i].data.d_parasite.data = NULL;
break;
case GP_PARAM_TYPE_PARAM_DEF:
if (! _gp_param_def_read (channel,
&(*params)[i].data.d_param_def,
user_data))
goto cleanup;
break;
}
1997-11-25 06:05:25 +08:00
}
return;
cleanup:
*n_params = 0;
g_free (*params);
*params = NULL;
1997-11-25 06:05:25 +08:00
}
static void
_gp_params_write (GIOChannel *channel,
GPParam *params,
gint n_params,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
gint i;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &n_params, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
for (i = 0; i < n_params; i++)
1997-11-25 06:05:25 +08:00
{
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &params[i].param_type, 1,
user_data))
return;
1997-11-25 06:05:25 +08:00
if (! _gimp_wire_write_string (channel,
&params[i].type_name, 1,
user_data))
return;
switch (params[i].param_type)
{
case GP_PARAM_TYPE_INT:
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &params[i].data.d_int, 1,
user_data))
return;
break;
case GP_PARAM_TYPE_FLOAT:
if (! _gimp_wire_write_double (channel,
(const gdouble *) &params[i].data.d_float, 1,
user_data))
return;
1997-11-25 06:05:25 +08:00
break;
case GP_PARAM_TYPE_STRING:
case GP_PARAM_TYPE_FILE:
if (! _gimp_wire_write_string (channel,
&params[i].data.d_string, 1,
user_data))
return;
1997-11-25 06:05:25 +08:00
break;
case GP_PARAM_TYPE_COLOR:
if (! _gimp_wire_write_color (channel,
&params[i].data.d_color, 1,
user_data))
return;
1997-11-25 06:05:25 +08:00
break;
case GP_PARAM_TYPE_ARRAY:
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &params[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))
return;
1997-11-25 06:05:25 +08:00
break;
case GP_PARAM_TYPE_STRING_ARRAY:
if (! _gimp_wire_write_int32 (channel,
&params[i].data.d_string_array.size, 1,
user_data) ||
! _gimp_wire_write_string (channel,
params[i].data.d_string_array.data,
params[i].data.d_string_array.size,
user_data))
return;
1997-11-25 06:05:25 +08:00
break;
case GP_PARAM_TYPE_ID_ARRAY:
if (! _gimp_wire_write_string (channel,
&params[i].data.d_id_array.type_name, 1,
user_data) ||
! _gimp_wire_write_int32 (channel,
(const guint32 *) &params[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;
case GP_PARAM_TYPE_PARASITE:
{
GimpParasite *p = &params[i].data.d_parasite;
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,
p->data, p->size, user_data))
return;
}
}
break;
case GP_PARAM_TYPE_PARAM_DEF:
if (! _gp_param_def_write (channel,
&params[i].data.d_param_def,
user_data))
return;
break;
}
1997-11-25 06:05:25 +08:00
}
}
static void
_gp_params_destroy (GPParam *params,
gint n_params)
1997-11-25 06:05:25 +08:00
{
gint i;
1997-11-25 06:05:25 +08:00
for (i = 0; i < n_params; i++)
1997-11-25 06:05:25 +08:00
{
g_free (params[i].type_name);
switch (params[i].param_type)
{
case GP_PARAM_TYPE_INT:
case GP_PARAM_TYPE_FLOAT:
break;
case GP_PARAM_TYPE_STRING:
case GP_PARAM_TYPE_FILE:
g_free (params[i].data.d_string);
break;
case GP_PARAM_TYPE_COLOR:
break;
case GP_PARAM_TYPE_ARRAY:
g_free (params[i].data.d_array.data);
break;
case GP_PARAM_TYPE_STRING_ARRAY:
if (params[i].data.d_string_array.size > 0 &&
params[i].data.d_string_array.data)
{
gint j;
for (j = 0; j < params[i].data.d_string_array.size; j++)
g_free (params[i].data.d_string_array.data[j]);
g_free (params[i].data.d_string_array.data);
}
break;
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;
case GP_PARAM_TYPE_PARASITE:
if (params[i].data.d_parasite.name)
g_free (params[i].data.d_parasite.name);
if (params[i].data.d_parasite.data)
g_free (params[i].data.d_parasite.data);
break;
case GP_PARAM_TYPE_PARAM_DEF:
_gp_param_def_destroy (&params[i].data.d_param_def);
break;
}
1997-11-25 06:05:25 +08:00
}
1997-11-25 06:05:25 +08:00
g_free (params);
}
/* has_init */
static void
_gp_has_init_read (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
{
}
static void
_gp_has_init_write (GIOChannel *channel,
GimpWireMessage *msg,
gpointer user_data)
{
}
static void
_gp_has_init_destroy (GimpWireMessage *msg)
{
}