gimp/libgimpbase/gimpprotocol.c

1676 lines
44 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
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
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1998-01-25 18:26:47 +08:00
* Library General Public License for more details.
*
1999-11-18 05:13:50 +08:00
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
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 <stdio.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 <glib.h>
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
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,
WireMessage *msg,
gpointer user_data);
static void _gp_quit_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_quit_destroy (WireMessage *msg);
static void _gp_config_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_config_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_config_destroy (WireMessage *msg);
static void _gp_tile_req_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_tile_req_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_tile_req_destroy (WireMessage *msg);
static void _gp_tile_ack_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_tile_ack_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_tile_ack_destroy (WireMessage *msg);
static void _gp_tile_data_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_tile_data_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_tile_data_destroy (WireMessage *msg);
static void _gp_proc_run_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_proc_run_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_proc_run_destroy (WireMessage *msg);
static void _gp_proc_return_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_proc_return_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_proc_return_destroy (WireMessage *msg);
static void _gp_temp_proc_run_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_temp_proc_run_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_temp_proc_run_destroy (WireMessage *msg);
static void _gp_temp_proc_return_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_temp_proc_return_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_temp_proc_return_destroy (WireMessage *msg);
static void _gp_proc_install_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_proc_install_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_proc_install_destroy (WireMessage *msg);
static void _gp_proc_uninstall_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_proc_uninstall_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_proc_uninstall_destroy (WireMessage *msg);
static void _gp_extension_ack_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_extension_ack_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_extension_ack_destroy (WireMessage *msg);
static void _gp_params_read (GIOChannel *channel,
GPParam **params,
guint *nparams,
gpointer user_data);
static void _gp_params_write (GIOChannel *channel,
GPParam *params,
gint nparams,
gpointer user_data);
/* used by gimp.c:gimp_destroy_params() */
void _gp_params_destroy (GPParam *params,
gint nparams);
static void _gp_has_init_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_has_init_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data);
static void _gp_has_init_destroy (WireMessage *msg);
1997-11-25 06:05:25 +08:00
void
gp_init (void)
1997-11-25 06:05:25 +08:00
{
wire_register (GP_QUIT,
_gp_quit_read,
_gp_quit_write,
_gp_quit_destroy);
wire_register (GP_CONFIG,
_gp_config_read,
_gp_config_write,
_gp_config_destroy);
wire_register (GP_TILE_REQ,
_gp_tile_req_read,
_gp_tile_req_write,
_gp_tile_req_destroy);
wire_register (GP_TILE_ACK,
_gp_tile_ack_read,
_gp_tile_ack_write,
_gp_tile_ack_destroy);
wire_register (GP_TILE_DATA,
_gp_tile_data_read,
_gp_tile_data_write,
_gp_tile_data_destroy);
wire_register (GP_PROC_RUN,
_gp_proc_run_read,
_gp_proc_run_write,
_gp_proc_run_destroy);
wire_register (GP_PROC_RETURN,
_gp_proc_return_read,
_gp_proc_return_write,
_gp_proc_return_destroy);
wire_register (GP_TEMP_PROC_RUN,
_gp_temp_proc_run_read,
_gp_temp_proc_run_write,
_gp_temp_proc_run_destroy);
wire_register (GP_TEMP_PROC_RETURN,
_gp_temp_proc_return_read,
_gp_temp_proc_return_write,
_gp_temp_proc_return_destroy);
wire_register (GP_PROC_INSTALL,
_gp_proc_install_read,
_gp_proc_install_write,
_gp_proc_install_destroy);
wire_register (GP_PROC_UNINSTALL,
_gp_proc_uninstall_read,
_gp_proc_uninstall_write,
_gp_proc_uninstall_destroy);
wire_register (GP_EXTENSION_ACK,
_gp_extension_ack_read,
_gp_extension_ack_write,
_gp_extension_ack_destroy);
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
}
gboolean
gp_quit_write (GIOChannel *channel,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_QUIT;
msg.data = NULL;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
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
{
WireMessage msg;
msg.type = GP_CONFIG;
msg.data = config;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
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
{
WireMessage msg;
msg.type = GP_TILE_REQ;
msg.data = tile_req;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
gboolean
gp_tile_ack_write (GIOChannel *channel,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_TILE_ACK;
msg.data = NULL;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
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
{
WireMessage msg;
msg.type = GP_TILE_DATA;
msg.data = tile_data;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
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
{
WireMessage msg;
msg.type = GP_PROC_RUN;
msg.data = proc_run;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
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
{
WireMessage msg;
msg.type = GP_PROC_RETURN;
msg.data = proc_return;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
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
{
WireMessage msg;
msg.type = GP_TEMP_PROC_RUN;
msg.data = proc_run;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
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
{
WireMessage msg;
msg.type = GP_TEMP_PROC_RETURN;
msg.data = proc_return;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
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
{
WireMessage msg;
msg.type = GP_PROC_INSTALL;
msg.data = proc_install;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
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
{
WireMessage msg;
msg.type = GP_PROC_UNINSTALL;
msg.data = proc_uninstall;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
gboolean
gp_extension_ack_write (GIOChannel *channel,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
WireMessage msg;
msg.type = GP_EXTENSION_ACK;
msg.data = NULL;
if (! wire_write_msg (channel, &msg, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
if (! wire_flush (channel, user_data))
1997-11-25 06:05:25 +08:00
return FALSE;
return TRUE;
}
gboolean
gp_has_init_write (GIOChannel *channel,
gpointer user_data)
{
WireMessage msg;
msg.type = GP_HAS_INIT;
msg.data = NULL;
if (! wire_write_msg (channel, &msg, user_data))
return FALSE;
if (! 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,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_quit_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_quit_destroy (WireMessage *msg)
{
}
/* config */
1997-11-25 06:05:25 +08:00
static void
_gp_config_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPConfig *config;
config = g_new (GPConfig, 1);
if (! wire_read_int32 (channel, &config->version, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, &config->tile_width, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, &config->tile_height, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, (guint32*) &config->shm_ID, 1, user_data))
goto cleanup;
if (! wire_read_double (channel, &config->gamma, 1, user_data))
goto cleanup;
if (! wire_read_int8 (channel, (guint8*) &config->install_cmap, 1, user_data))
goto cleanup;
removed gimp_help_init() and gimp_help_free(). Added _gimp_help_init() 2003-01-07 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimphelpui.[ch]: removed gimp_help_init() and gimp_help_free(). Added _gimp_help_init() instead. * libgimpwidgets/gimpwidgets.def: changed accordingly. * libgimpwidgets/gimpwidgets.c (gimp_widgets_init): call _gimp_help_init() so it doesn't need to be done in all plug-ins manually. * libgimp/gimpcompat.h: added gimp_help_init() and gimp_help_free() here as COMPAT_CRUFT. * app/gui/gui.c * plug-ins/FractalExplorer/Dialogs.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/AlienMap.c * plug-ins/common/AlienMap2.c * plug-ins/common/CML_explorer.c * plug-ins/common/blur.c * plug-ins/common/curve_bend.c * plug-ins/common/gtm.c * plug-ins/common/illusion.c * plug-ins/common/jigsaw.c * plug-ins/common/plasma.c * plug-ins/common/polar.c * plug-ins/common/ps.c * plug-ins/common/randomize.c * plug-ins/common/sinus.c * plug-ins/common/snoise.c * plug-ins/common/sparkle.c * plug-ins/common/uniteditor.c * plug-ins/common/warp.c * plug-ins/common/wind.c * plug-ins/gap/gap_arr_dialog.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gap/gap_navigator_dialog.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/maze/maze_face.c * plug-ins/print/gimp_main_window.c * plug-ins/sel2path/sel2path.c: removed the calls to gimp_help_init() and gimp_help_free(). Fixed bug #81017: * libgimpbase/gimpprotocol.[ch]: added "guint8 show_tool_tips" to the GPConfig message. Increased the protocol version number. * app/plug-in/plug-in.c: pass the value of gui_config->show_tool_tips. * libgimp/gimp.[ch]: added gimp_show_tool_tips() to get the value which was passed in the GPConfig message. * libgimp/gimpui.c (gimp_ui_init): disable the tooltips if show_tool_tips is FALSE. * plug-ins/MapObject/mapobject_main.[ch] * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/jigsaw.c * plug-ins/gap/gap_navigator_dialog.c * plug-ins/gfig/gfig.c: removed all plug-in specific GUI for enabling/disabling tooltips.
2003-01-08 01:00:49 +08:00
if (! wire_read_int8 (channel, (guint8*) &config->show_tool_tips, 1, user_data))
gimprc.in replaced "color-cube" by "min-colors". 2000-04-30 Michael Natterer <mitch@gimp.org> * gimprc.in * app/gimprc.[ch]: replaced "color-cube" by "min-colors". * app/app_procs.c: read unitrc/gimprc before displaying the splash. * app/colormaps.c: set min_colors and install_cmap before initializing GdkRGB. * app/gimprc.[ch] * app/gimpunit.c: don't call the splash's progress_update function. * app/plug_in.c: pass min_colors instead of color_cube to plugins. * app/preferences_dialog.c: widget for min_colors. * libgimp/gimp.[ch]: s/color_cube/min_colors/ but left gimp_color_cube() there for source level compatibility. * libgimp/gimpprotocol.[ch]: changed the GPConfig message accordinly and increased the gimp protocol version number because the change breaks binary compatibility. Also actually pass the use_xshm variable over the wire (was only in the GPConfig struct before). Was it the right thing to do to increase the version number?? * libgimp/gimpui.c (gimp_ui_init): use the same code as the app for initializing GdkRGB. Never explicitly activate Gdk's SHM usage (only switch it off). * app/main.c * libgimp/gimp.c: reverted the handling of all signals except SIGCHLD back to plain old signal() because those signals are fatal anyway and sigaction() as used by gimp_signal_*() made debugging (stacktrace) impossible. * plug-ins/AlienMap/AlienMap.c * plug-ins/AlienMap2/AlienMap2.c * plug-ins/FractalExplorer/Dialogs.c * plug-ins/bmp/bmp.c * plug-ins/borderaverage/borderaverage.c * plug-ins/dbbrowser/dbbrowser.c * plug-ins/faxg3/faxg3.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp.c * plug-ins/fp/fp_gtk.c * plug-ins/gdyntext/Makefile.am * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/helpbrowser/helpbrowser.c * plug-ins/ifscompose/ifscompose.c * plug-ins/imagemap/Makefile.am * plug-ins/imagemap/imap_main.c * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print.c * plug-ins/rcm/rcm_dialog.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/Makefile.am * plug-ins/sel2path/sel2path.c * plug-ins/sgi/sgi.c * plug-ins/sinus/sinus.c * plug-ins/struc/struc.c * plug-ins/webbrowser/webbrowser.c * plug-ins/winsnap/winsnap.c * plug-ins/xjt/xjt.c: use gimp_ui_init(). * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c: only switch Gdk SHM usage off, never on. Don't use gimp_ui_init() here because of libgck.
2000-05-01 02:17:55 +08:00
goto cleanup;
if (! wire_read_int32 (channel, (guint32*) &config->min_colors, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, (guint32*) &config->gdisp_ID, 1, user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
msg->data = config;
return;
cleanup:
g_free (config);
1997-11-25 06:05:25 +08:00
}
static void
_gp_config_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPConfig *config;
config = msg->data;
if (! wire_write_int32 (channel, &config->version, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &config->tile_width, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &config->tile_height, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, (guint32*) &config->shm_ID, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_double (channel, &config->gamma, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int8 (channel, (guint8*) &config->install_cmap, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
removed gimp_help_init() and gimp_help_free(). Added _gimp_help_init() 2003-01-07 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimphelpui.[ch]: removed gimp_help_init() and gimp_help_free(). Added _gimp_help_init() instead. * libgimpwidgets/gimpwidgets.def: changed accordingly. * libgimpwidgets/gimpwidgets.c (gimp_widgets_init): call _gimp_help_init() so it doesn't need to be done in all plug-ins manually. * libgimp/gimpcompat.h: added gimp_help_init() and gimp_help_free() here as COMPAT_CRUFT. * app/gui/gui.c * plug-ins/FractalExplorer/Dialogs.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/AlienMap.c * plug-ins/common/AlienMap2.c * plug-ins/common/CML_explorer.c * plug-ins/common/blur.c * plug-ins/common/curve_bend.c * plug-ins/common/gtm.c * plug-ins/common/illusion.c * plug-ins/common/jigsaw.c * plug-ins/common/plasma.c * plug-ins/common/polar.c * plug-ins/common/ps.c * plug-ins/common/randomize.c * plug-ins/common/sinus.c * plug-ins/common/snoise.c * plug-ins/common/sparkle.c * plug-ins/common/uniteditor.c * plug-ins/common/warp.c * plug-ins/common/wind.c * plug-ins/gap/gap_arr_dialog.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gap/gap_navigator_dialog.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/maze/maze_face.c * plug-ins/print/gimp_main_window.c * plug-ins/sel2path/sel2path.c: removed the calls to gimp_help_init() and gimp_help_free(). Fixed bug #81017: * libgimpbase/gimpprotocol.[ch]: added "guint8 show_tool_tips" to the GPConfig message. Increased the protocol version number. * app/plug-in/plug-in.c: pass the value of gui_config->show_tool_tips. * libgimp/gimp.[ch]: added gimp_show_tool_tips() to get the value which was passed in the GPConfig message. * libgimp/gimpui.c (gimp_ui_init): disable the tooltips if show_tool_tips is FALSE. * plug-ins/MapObject/mapobject_main.[ch] * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/jigsaw.c * plug-ins/gap/gap_navigator_dialog.c * plug-ins/gfig/gfig.c: removed all plug-in specific GUI for enabling/disabling tooltips.
2003-01-08 01:00:49 +08:00
if (! wire_write_int8 (channel, (guint8*) &config->show_tool_tips, 1, user_data))
gimprc.in replaced "color-cube" by "min-colors". 2000-04-30 Michael Natterer <mitch@gimp.org> * gimprc.in * app/gimprc.[ch]: replaced "color-cube" by "min-colors". * app/app_procs.c: read unitrc/gimprc before displaying the splash. * app/colormaps.c: set min_colors and install_cmap before initializing GdkRGB. * app/gimprc.[ch] * app/gimpunit.c: don't call the splash's progress_update function. * app/plug_in.c: pass min_colors instead of color_cube to plugins. * app/preferences_dialog.c: widget for min_colors. * libgimp/gimp.[ch]: s/color_cube/min_colors/ but left gimp_color_cube() there for source level compatibility. * libgimp/gimpprotocol.[ch]: changed the GPConfig message accordinly and increased the gimp protocol version number because the change breaks binary compatibility. Also actually pass the use_xshm variable over the wire (was only in the GPConfig struct before). Was it the right thing to do to increase the version number?? * libgimp/gimpui.c (gimp_ui_init): use the same code as the app for initializing GdkRGB. Never explicitly activate Gdk's SHM usage (only switch it off). * app/main.c * libgimp/gimp.c: reverted the handling of all signals except SIGCHLD back to plain old signal() because those signals are fatal anyway and sigaction() as used by gimp_signal_*() made debugging (stacktrace) impossible. * plug-ins/AlienMap/AlienMap.c * plug-ins/AlienMap2/AlienMap2.c * plug-ins/FractalExplorer/Dialogs.c * plug-ins/bmp/bmp.c * plug-ins/borderaverage/borderaverage.c * plug-ins/dbbrowser/dbbrowser.c * plug-ins/faxg3/faxg3.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp.c * plug-ins/fp/fp_gtk.c * plug-ins/gdyntext/Makefile.am * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/gimpressionist.c * plug-ins/helpbrowser/helpbrowser.c * plug-ins/ifscompose/ifscompose.c * plug-ins/imagemap/Makefile.am * plug-ins/imagemap/imap_main.c * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print.c * plug-ins/rcm/rcm_dialog.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/Makefile.am * plug-ins/sel2path/sel2path.c * plug-ins/sgi/sgi.c * plug-ins/sinus/sinus.c * plug-ins/struc/struc.c * plug-ins/webbrowser/webbrowser.c * plug-ins/winsnap/winsnap.c * plug-ins/xjt/xjt.c: use gimp_ui_init(). * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c: only switch Gdk SHM usage off, never on. Don't use gimp_ui_init() here because of libgck.
2000-05-01 02:17:55 +08:00
return;
if (! wire_write_int32 (channel, (guint32*) &config->min_colors, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, (guint32*) &config->gdisp_ID, 1, user_data))
return;
1997-11-25 06:05:25 +08:00
}
static void
_gp_config_destroy (WireMessage *msg)
{
g_free (msg->data);
}
/* tile_req */
1997-11-25 06:05:25 +08:00
static void
_gp_tile_req_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPTileReq *tile_req;
tile_req = g_new (GPTileReq, 1);
if (! wire_read_int32 (channel, (guint32*) &tile_req->drawable_ID, 1,
user_data))
goto cleanup;
if (! wire_read_int32 (channel, &tile_req->tile_num, 1, user_data))
goto cleanup;
if (! 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_free (tile_req);
1997-11-25 06:05:25 +08:00
}
static void
_gp_tile_req_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPTileReq *tile_req;
tile_req = msg->data;
if (! wire_write_int32 (channel, (guint32*) &tile_req->drawable_ID, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &tile_req->tile_num, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! 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 (WireMessage *msg)
{
g_free (msg->data);
}
/* tile_ack */
1997-11-25 06:05:25 +08:00
static void
_gp_tile_ack_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_tile_ack_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_tile_ack_destroy (WireMessage *msg)
{
}
/* tile_data */
1997-11-25 06:05:25 +08:00
static void
_gp_tile_data_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPTileData *tile_data;
guint length;
tile_data = g_new0 (GPTileData, 1);
if (! wire_read_int32 (channel, (guint32*) &tile_data->drawable_ID, 1,
user_data))
goto cleanup;
if (! wire_read_int32 (channel, &tile_data->tile_num, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, &tile_data->shadow, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, &tile_data->bpp, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, &tile_data->width, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, &tile_data->height, 1, user_data))
goto cleanup;
if (! 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)
{
length = tile_data->width * tile_data->height * tile_data->bpp;
tile_data->data = g_new (guchar, length);
if (! 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_free (tile_data);
1997-11-25 06:05:25 +08:00
}
static void
_gp_tile_data_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPTileData *tile_data;
guint length;
tile_data = msg->data;
if (! wire_write_int32 (channel, (guint32*) &tile_data->drawable_ID, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &tile_data->tile_num, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &tile_data->shadow, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &tile_data->bpp, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &tile_data->width, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &tile_data->height, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! 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)
{
length = tile_data->width * tile_data->height * tile_data->bpp;
if (! wire_write_int8 (channel, (guint8*) tile_data->data, length,
user_data))
1997-11-25 06:05:25 +08:00
return;
}
}
static void
_gp_tile_data_destroy (WireMessage *msg)
{
GPTileData *tile_data;
tile_data = msg->data;
g_free (tile_data->data);
1997-11-25 06:05:25 +08:00
g_free (tile_data);
}
/* proc_run */
1997-11-25 06:05:25 +08:00
static void
_gp_proc_run_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcRun *proc_run;
proc_run = g_new (GPProcRun, 1);
if (! wire_read_string (channel, &proc_run->name, 1, user_data))
goto cleanup;
_gp_params_read (channel,
&proc_run->params, (guint*) &proc_run->nparams,
user_data);
1997-11-25 06:05:25 +08:00
msg->data = proc_run;
return;
cleanup:
g_free (proc_run);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_run_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcRun *proc_run;
proc_run = msg->data;
if (! 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->nparams, user_data);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_run_destroy (WireMessage *msg)
{
GPProcRun *proc_run;
proc_run = msg->data;
_gp_params_destroy (proc_run->params, proc_run->nparams);
g_free (proc_run->name);
1997-11-25 06:05:25 +08:00
g_free (proc_run);
}
/* proc_return */
1997-11-25 06:05:25 +08:00
static void
_gp_proc_return_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcReturn *proc_return;
proc_return = g_new (GPProcReturn, 1);
if (! wire_read_string (channel, &proc_return->name, 1, user_data))
goto cleanup;
_gp_params_read (channel,
&proc_return->params, (guint*) &proc_return->nparams,
user_data);
1997-11-25 06:05:25 +08:00
msg->data = proc_return;
return;
cleanup:
g_free (proc_return);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_return_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcReturn *proc_return;
proc_return = msg->data;
if (! 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->nparams,
user_data);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_return_destroy (WireMessage *msg)
{
GPProcReturn *proc_return;
proc_return = msg->data;
_gp_params_destroy (proc_return->params, proc_return->nparams);
g_free (proc_return->name);
1997-11-25 06:05:25 +08:00
g_free (proc_return);
}
/* temp_proc_run */
1997-11-25 06:05:25 +08:00
static void
_gp_temp_proc_run_read (GIOChannel *channel,
WireMessage *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,
WireMessage *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 (WireMessage *msg)
{
_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,
WireMessage *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,
WireMessage *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 (WireMessage *msg)
{
_gp_proc_return_destroy (msg);
}
/* proc_install */
1997-11-25 06:05:25 +08:00
static void
_gp_proc_install_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcInstall *proc_install;
gint i;
1997-11-25 06:05:25 +08:00
proc_install = g_new0 (GPProcInstall, 1);
1997-11-25 06:05:25 +08:00
if (! wire_read_string (channel, &proc_install->name, 1, user_data))
goto cleanup;
if (! wire_read_string (channel, &proc_install->blurb, 1, user_data))
goto cleanup;
if (! wire_read_string (channel, &proc_install->help, 1, user_data))
goto cleanup;
if (! wire_read_string (channel, &proc_install->author, 1, user_data))
goto cleanup;
if (! wire_read_string (channel, &proc_install->copyright, 1, user_data))
goto cleanup;
if (! wire_read_string (channel, &proc_install->date, 1, user_data))
goto cleanup;
if (! wire_read_string (channel, &proc_install->menu_path, 1, user_data))
goto cleanup;
if (! wire_read_string (channel, &proc_install->image_types, 1, user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
if (! wire_read_int32 (channel, &proc_install->type, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, &proc_install->nparams, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, &proc_install->nreturn_vals, 1, user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
proc_install->params = g_new0 (GPParamDef, proc_install->nparams);
1997-11-25 06:05:25 +08:00
for (i = 0; i < proc_install->nparams; i++)
{
if (! wire_read_int32 (channel,
(guint32*) &proc_install->params[i].type, 1,
user_data))
goto cleanup;
if (! wire_read_string (channel,
&proc_install->params[i].name, 1,
user_data))
goto cleanup;
if (! wire_read_string (channel,
&proc_install->params[i].description, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
}
proc_install->return_vals = g_new0 (GPParamDef, proc_install->nreturn_vals);
1997-11-25 06:05:25 +08:00
for (i = 0; i < proc_install->nreturn_vals; i++)
{
if (! wire_read_int32 (channel,
(guint32*) &proc_install->return_vals[i].type, 1,
user_data))
goto cleanup;
if (! wire_read_string (channel,
&proc_install->return_vals[i].name, 1,
user_data))
goto cleanup;
if (! wire_read_string (channel,
&proc_install->return_vals[i].description, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
}
msg->data = proc_install;
return;
cleanup:
g_free (proc_install->name);
g_free (proc_install->blurb);
g_free (proc_install->help);
g_free (proc_install->author);
g_free (proc_install->copyright);
g_free (proc_install->date);
g_free (proc_install->menu_path);
g_free (proc_install->image_types);
if (proc_install->params)
{
for (i = 0; i < proc_install->nparams; i++)
{
if (!proc_install->params[i].name)
break;
g_free (proc_install->params[i].name);
g_free (proc_install->params[i].description);
}
g_free (proc_install->params);
}
if (proc_install->return_vals)
{
for (i = 0; i < proc_install->nreturn_vals; i++)
{
if (!proc_install->return_vals[i].name)
break;
g_free (proc_install->return_vals[i].name);
g_free (proc_install->return_vals[i].description);
}
g_free (proc_install->return_vals);
}
g_free (proc_install);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_install_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcInstall *proc_install;
gint i;
1997-11-25 06:05:25 +08:00
proc_install = msg->data;
if (! wire_write_string (channel, &proc_install->name, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel, &proc_install->blurb, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel, &proc_install->help, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel, &proc_install->author, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel, &proc_install->copyright, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel, &proc_install->date, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel, &proc_install->menu_path, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel, &proc_install->image_types, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &proc_install->type, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &proc_install->nparams, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_int32 (channel, &proc_install->nreturn_vals, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
for (i = 0; i < proc_install->nparams; i++)
{
if (! wire_write_int32 (channel,
(guint32*) &proc_install->params[i].type, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel,
&proc_install->params[i].name, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel,
&proc_install->params[i].description, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
}
for (i = 0; i < proc_install->nreturn_vals; i++)
{
if (! wire_write_int32 (channel,
(guint32*) &proc_install->return_vals[i].type, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel,
&proc_install->return_vals[i].name, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
if (! wire_write_string (channel,
&proc_install->return_vals[i].description, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
}
}
static void
_gp_proc_install_destroy (WireMessage *msg)
{
GPProcInstall *proc_install;
gint i;
1997-11-25 06:05:25 +08:00
proc_install = msg->data;
g_free (proc_install->name);
g_free (proc_install->blurb);
g_free (proc_install->help);
g_free (proc_install->author);
g_free (proc_install->copyright);
g_free (proc_install->date);
g_free (proc_install->menu_path);
g_free (proc_install->image_types);
for (i = 0; i < proc_install->nparams; i++)
{
g_free (proc_install->params[i].name);
g_free (proc_install->params[i].description);
}
for (i = 0; i < proc_install->nreturn_vals; i++)
{
g_free (proc_install->return_vals[i].name);
g_free (proc_install->return_vals[i].description);
}
g_free (proc_install->params);
g_free (proc_install->return_vals);
1997-11-25 06:05:25 +08:00
g_free (proc_install);
}
/* proc_uninstall */
1997-11-25 06:05:25 +08:00
static void
_gp_proc_uninstall_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcUninstall *proc_uninstall;
proc_uninstall = g_new (GPProcUninstall, 1);
if (! 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_free (proc_uninstall);
1997-11-25 06:05:25 +08:00
}
static void
_gp_proc_uninstall_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
GPProcUninstall *proc_uninstall;
proc_uninstall = msg->data;
if (! 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 (WireMessage *msg)
{
GPProcUninstall *proc_uninstall;
proc_uninstall = msg->data;
g_free (proc_uninstall->name);
g_free (proc_uninstall);
}
/* extension_ack */
1997-11-25 06:05:25 +08:00
static void
_gp_extension_ack_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
}
static void
_gp_extension_ack_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
{
}
static void
_gp_extension_ack_destroy (WireMessage *msg)
{
}
/* params */
static void
_gp_params_read (GIOChannel *channel,
GPParam **params,
guint *nparams,
gpointer user_data)
{
gint i, j;
1997-11-25 06:05:25 +08:00
if (! wire_read_int32 (channel, (guint32*) nparams, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
if (*nparams == 0)
{
*params = NULL;
return;
}
*params = g_new (GPParam, *nparams);
for (i = 0; i < *nparams; i++)
{
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].type, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
switch ((*params)[i].type)
{
case GIMP_PDB_INT32:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_int32, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_INT16:
if (! wire_read_int16 (channel,
(guint16*) &(*params)[i].data.d_int16, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_INT8:
if (! wire_read_int8 (channel,
(guint8*) &(*params)[i].data.d_int8, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_FLOAT:
if (! wire_read_double (channel,
&(*params)[i].data.d_float, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_STRING:
if (! wire_read_string (channel,
&(*params)[i].data.d_string, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_INT32ARRAY:
(*params)[i].data.d_int32array =
g_new (gint32, (*params)[i-1].data.d_int32);
if (! wire_read_int32 (channel,
(guint32*) (*params)[i].data.d_int32array,
(*params)[i-1].data.d_int32,
user_data))
{
g_free ((*params)[i].data.d_int32array);
goto cleanup;
}
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_INT16ARRAY:
(*params)[i].data.d_int16array =
g_new (gint16, (*params)[i-1].data.d_int32);
if (! wire_read_int16 (channel,
(guint16*) (*params)[i].data.d_int16array,
(*params)[i-1].data.d_int32,
user_data))
{
g_free ((*params)[i].data.d_int16array);
goto cleanup;
}
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_INT8ARRAY:
(*params)[i].data.d_int8array =
g_new (gint8, (*params)[i-1].data.d_int32);
if (! wire_read_int8 (channel,
(guint8*) (*params)[i].data.d_int8array,
(*params)[i-1].data.d_int32,
user_data))
{
g_free ((*params)[i].data.d_int8array);
goto cleanup;
}
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_FLOATARRAY:
(*params)[i].data.d_floatarray =
g_new (gdouble, (*params)[i-1].data.d_int32);
if (! wire_read_double (channel,
(*params)[i].data.d_floatarray,
(*params)[i-1].data.d_int32,
user_data))
{
g_free ((*params)[i].data.d_floatarray);
goto cleanup;
}
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_STRINGARRAY:
(*params)[i].data.d_stringarray =
g_new0 (gchar*, (*params)[i-1].data.d_int32);
if (! wire_read_string (channel,
(*params)[i].data.d_stringarray,
(*params)[i-1].data.d_int32,
user_data))
{
for (j = 0; j < (*params)[i-1].data.d_int32; j++)
g_free (((*params)[i].data.d_stringarray)[j]);
g_free ((*params)[i].data.d_stringarray);
goto cleanup;
}
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_COLOR:
if (! wire_read_double (channel,
&(*params)[i].data.d_color.r, 1,
user_data))
goto cleanup;
if (! wire_read_double (channel,
&(*params)[i].data.d_color.g, 1,
user_data))
goto cleanup;
if (! wire_read_double (channel,
&(*params)[i].data.d_color.b, 1,
user_data))
goto cleanup;
if (! wire_read_double (channel,
&(*params)[i].data.d_color.a, 1,
user_data))
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
goto cleanup;
break;
case GIMP_PDB_REGION:
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_DISPLAY:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_display, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_IMAGE:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_image, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_LAYER:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_layer, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_CHANNEL:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_channel, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_DRAWABLE:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_drawable, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_SELECTION:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_selection, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_BOUNDARY:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_boundary, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_PATH:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_path, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_PARASITE:
if (! 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 (! wire_read_int32 (channel,
&((*params)[i].data.d_parasite.flags), 1,
user_data))
goto cleanup;
if (! 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 (! 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 GIMP_PDB_STATUS:
if (! wire_read_int32 (channel,
(guint32*) &(*params)[i].data.d_status, 1,
user_data))
goto cleanup;
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_END:
1997-11-25 06:05:25 +08:00
break;
}
}
return;
cleanup:
*nparams = 0;
g_free (*params);
*params = NULL;
1997-11-25 06:05:25 +08:00
}
static void
_gp_params_write (GIOChannel *channel,
GPParam *params,
gint nparams,
gpointer user_data)
1997-11-25 06:05:25 +08:00
{
gint i;
1997-11-25 06:05:25 +08:00
if (! wire_write_int32 (channel, (guint32*) &nparams, 1, user_data))
1997-11-25 06:05:25 +08:00
return;
for (i = 0; i < nparams; i++)
{
if (! wire_write_int32 (channel,
(guint32*) &params[i].type, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
switch (params[i].type)
{
case GIMP_PDB_INT32:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_int32, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_INT16:
if (! wire_write_int16 (channel,
(guint16*) &params[i].data.d_int16, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_INT8:
if (! wire_write_int8 (channel,
(guint8*) &params[i].data.d_int8, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_FLOAT:
if (! wire_write_double (channel,
&params[i].data.d_float, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_STRING:
if (! wire_write_string (channel,
&params[i].data.d_string, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_INT32ARRAY:
if (! wire_write_int32 (channel,
(guint32*) params[i].data.d_int32array,
params[i-1].data.d_int32,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_INT16ARRAY:
if (! wire_write_int16 (channel,
(guint16*) params[i].data.d_int16array,
params[i-1].data.d_int32,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_INT8ARRAY:
if (! wire_write_int8 (channel,
(guint8*) params[i].data.d_int8array,
params[i-1].data.d_int32,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_FLOATARRAY:
if (! wire_write_double (channel,
params[i].data.d_floatarray,
params[i-1].data.d_int32,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_STRINGARRAY:
if (! wire_write_string (channel,
params[i].data.d_stringarray,
params[i-1].data.d_int32,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_COLOR:
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
{
GimpRGB *color = (GimpRGB *) &params[i].data.d_color;
if (! wire_write_double (channel, &color->r, 1, user_data))
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
return;
if (! wire_write_double (channel, &color->g, 1, user_data))
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
return;
if (! wire_write_double (channel, &color->b, 1, user_data))
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
return;
if (! wire_write_double (channel, &color->a, 1, user_data))
tools/pdbgen/lib.pl tools/pdbgen/pdb.pl tools/pdbgen/pdb/channel.pdb 2001-01-25 Sven Neumann <sven@gimp.org> * tools/pdbgen/lib.pl * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: changed these with the help of Yosh. PDB functions take GimpRGB as color type now. * app/plug_in.c * app/pdb/channel_cmds.c * app/pdb/internal_procs.c * app/pdb/palette_cmds.c * app/pdb/procedural_db.[ch] * app/pdb/tools_cmds.c * libgimp/gimp.[ch] * libgimp/gimpchannel.[ch] * libgimp/gimpchannel_pdb.[ch] * libgimp/gimppalette_pdb.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimptools_pdb.[ch]: incremented Gimp protocol version and changed color type from array of chars to GimpRGB. * libgimp/Makefile.am * libgimp/gimppalette.[ch]: removed these files again * app/libgimp_glue.[ch] * libgimpwidgets/gimpcolorbutton.c * plug-ins/Lighting/lighting_main.c * plug-ins/Lighting/lighting_preview.c * plug-ins/MapObject/mapobject_image.c * plug-ins/MapObject/mapobject_main.c * plug-ins/MapObject/mapobject_preview.c * plug-ins/common/apply_lens.c * plug-ins/common/blinds.c * plug-ins/common/borderaverage.c * plug-ins/common/checkerboard.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/cubism.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/gif.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/mblur.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/png.c * plug-ins/common/polar.c * plug-ins/common/psd.c * plug-ins/common/semiflatten.c * plug-ins/common/sinus.c * plug-ins/common/sparkle.c * plug-ins/common/tiff.c * plug-ins/common/vpropagate.c * plug-ins/common/warp.c * plug-ins/common/whirlpinch.c * plug-ins/gap/gap_filter_iterators.c * plug-ins/gap/gap_mov_dialog.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gfig/gfig.c * plug-ins/gfli/gfli.c * plug-ins/ifscompose/ifscompose.c * plug-ins/maze/handy.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu.c * plug-ins/xjt/xjt.c: changed accordingly. A few plug-ins need to be looked at more closely after this change. I tried to put FIXME comments into those.
2001-01-25 09:20:05 +08:00
return;
}
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_REGION:
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_DISPLAY:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_display, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_IMAGE:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_image, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_LAYER:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_layer, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_CHANNEL:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_channel, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_DRAWABLE:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_drawable, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_SELECTION:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_selection, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_BOUNDARY:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_boundary, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_PATH:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_path, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_PARASITE:
{
GimpParasite *p = (GimpParasite *) &params[i].data.d_parasite;
if (p->name == NULL)
{
/* write a null string to signifly a null parasite */
wire_write_string (channel, &p->name, 1, user_data);
break;
}
if (! wire_write_string (channel, &p->name, 1, user_data))
return;
if (! wire_write_int32 (channel, &p->flags, 1, user_data))
return;
if (! wire_write_int32 (channel, &p->size, 1, user_data))
return;
if (p->size > 0)
{
if (! wire_write_int8 (channel, p->data, p->size, user_data))
return;
}
}
break;
case GIMP_PDB_STATUS:
if (! wire_write_int32 (channel,
(guint32*) &params[i].data.d_status, 1,
user_data))
1997-11-25 06:05:25 +08:00
return;
break;
case GIMP_PDB_END:
1997-11-25 06:05:25 +08:00
break;
}
}
}
void
_gp_params_destroy (GPParam *params,
gint nparams)
1997-11-25 06:05:25 +08:00
{
gint count;
gint i, j;
1997-11-25 06:05:25 +08:00
for (i = 0; i < nparams; i++)
{
switch (params[i].type)
{
case GIMP_PDB_INT32:
case GIMP_PDB_INT16:
case GIMP_PDB_INT8:
case GIMP_PDB_FLOAT:
case GIMP_PDB_COLOR:
case GIMP_PDB_REGION:
case GIMP_PDB_DISPLAY:
case GIMP_PDB_IMAGE:
case GIMP_PDB_LAYER:
case GIMP_PDB_CHANNEL:
case GIMP_PDB_DRAWABLE:
case GIMP_PDB_SELECTION:
case GIMP_PDB_BOUNDARY:
case GIMP_PDB_PATH:
case GIMP_PDB_STATUS:
1997-11-25 06:05:25 +08:00
break;
case GIMP_PDB_STRING:
1997-11-25 06:05:25 +08:00
g_free (params[i].data.d_string);
break;
case GIMP_PDB_INT32ARRAY:
1997-11-25 06:05:25 +08:00
g_free (params[i].data.d_int32array);
break;
case GIMP_PDB_INT16ARRAY:
1997-11-25 06:05:25 +08:00
g_free (params[i].data.d_int16array);
break;
case GIMP_PDB_INT8ARRAY:
1997-11-25 06:05:25 +08:00
g_free (params[i].data.d_int8array);
break;
case GIMP_PDB_FLOATARRAY:
1997-11-25 06:05:25 +08:00
g_free (params[i].data.d_floatarray);
break;
case GIMP_PDB_STRINGARRAY:
if ((i > 0) && (params[i-1].type == GIMP_PDB_INT32))
1997-11-25 06:05:25 +08:00
{
count = params[i-1].data.d_int32;
for (j = 0; j < count; j++)
g_free (params[i].data.d_stringarray[j]);
g_free (params[i].data.d_stringarray);
}
break;
case GIMP_PDB_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 GIMP_PDB_END:
1997-11-25 06:05:25 +08:00
break;
}
}
1997-11-25 06:05:25 +08:00
g_free (params);
}
/* has_init */
static void
_gp_has_init_read (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
{
}
static void
_gp_has_init_write (GIOChannel *channel,
WireMessage *msg,
gpointer user_data)
{
}
static void
_gp_has_init_destroy (WireMessage *msg)
{
}