~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to libgimpbase/gimpprotocol.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * Boston, MA 02111-1307, USA.
18
18
 */
19
19
 
20
 
#include <stdio.h>
 
20
#include "config.h"
21
21
 
22
22
#include <glib-object.h>
23
23
 
28
28
#include "gimpwire.h"
29
29
 
30
30
 
31
 
static void _gp_quit_read                (GIOChannel   *channel,
32
 
                                          WireMessage  *msg,
33
 
                                          gpointer      user_data);
34
 
static void _gp_quit_write               (GIOChannel   *channel,
35
 
                                          WireMessage  *msg,
36
 
                                          gpointer      user_data);
37
 
static void _gp_quit_destroy             (WireMessage  *msg);
38
 
 
39
 
static void _gp_config_read              (GIOChannel   *channel,
40
 
                                          WireMessage  *msg,
41
 
                                          gpointer      user_data);
42
 
static void _gp_config_write             (GIOChannel   *channel,
43
 
                                          WireMessage  *msg,
44
 
                                          gpointer      user_data);
45
 
static void _gp_config_destroy           (WireMessage  *msg);
46
 
 
47
 
static void _gp_tile_req_read            (GIOChannel   *channel,
48
 
                                          WireMessage  *msg,
49
 
                                          gpointer      user_data);
50
 
static void _gp_tile_req_write           (GIOChannel   *channel,
51
 
                                          WireMessage  *msg,
52
 
                                          gpointer      user_data);
53
 
static void _gp_tile_req_destroy         (WireMessage  *msg);
54
 
 
55
 
static void _gp_tile_ack_read            (GIOChannel   *channel,
56
 
                                          WireMessage  *msg,
57
 
                                          gpointer      user_data);
58
 
static void _gp_tile_ack_write           (GIOChannel   *channel,
59
 
                                          WireMessage  *msg,
60
 
                                          gpointer      user_data);
61
 
static void _gp_tile_ack_destroy         (WireMessage  *msg);
62
 
 
63
 
static void _gp_tile_data_read           (GIOChannel   *channel,
64
 
                                          WireMessage  *msg,
65
 
                                          gpointer      user_data);
66
 
static void _gp_tile_data_write          (GIOChannel   *channel,
67
 
                                          WireMessage  *msg,
68
 
                                          gpointer      user_data);
69
 
static void _gp_tile_data_destroy        (WireMessage  *msg);
70
 
 
71
 
static void _gp_proc_run_read            (GIOChannel   *channel,
72
 
                                          WireMessage  *msg,
73
 
                                          gpointer      user_data);
74
 
static void _gp_proc_run_write           (GIOChannel   *channel,
75
 
                                          WireMessage  *msg,
76
 
                                          gpointer      user_data);
77
 
static void _gp_proc_run_destroy         (WireMessage  *msg);
78
 
 
79
 
static void _gp_proc_return_read         (GIOChannel   *channel,
80
 
                                          WireMessage  *msg,
81
 
                                          gpointer      user_data);
82
 
static void _gp_proc_return_write        (GIOChannel   *channel,
83
 
                                          WireMessage  *msg,
84
 
                                          gpointer      user_data);
85
 
static void _gp_proc_return_destroy      (WireMessage  *msg);
86
 
 
87
 
static void _gp_temp_proc_run_read       (GIOChannel   *channel,
88
 
                                          WireMessage  *msg,
89
 
                                          gpointer      user_data);
90
 
static void _gp_temp_proc_run_write      (GIOChannel   *channel,
91
 
                                          WireMessage  *msg,
92
 
                                          gpointer      user_data);
93
 
static void _gp_temp_proc_run_destroy    (WireMessage  *msg);
94
 
 
95
 
static void _gp_temp_proc_return_read    (GIOChannel   *channel,
96
 
                                          WireMessage  *msg,
97
 
                                          gpointer      user_data);
98
 
static void _gp_temp_proc_return_write   (GIOChannel   *channel,
99
 
                                          WireMessage  *msg,
100
 
                                          gpointer      user_data);
101
 
static void _gp_temp_proc_return_destroy (WireMessage  *msg);
102
 
 
103
 
static void _gp_proc_install_read        (GIOChannel   *channel,
104
 
                                          WireMessage  *msg,
105
 
                                          gpointer      user_data);
106
 
static void _gp_proc_install_write       (GIOChannel   *channel,
107
 
                                          WireMessage  *msg,
108
 
                                          gpointer      user_data);
109
 
static void _gp_proc_install_destroy     (WireMessage  *msg);
110
 
 
111
 
static void _gp_proc_uninstall_read      (GIOChannel   *channel,
112
 
                                          WireMessage  *msg,
113
 
                                          gpointer      user_data);
114
 
static void _gp_proc_uninstall_write     (GIOChannel   *channel,
115
 
                                          WireMessage  *msg,
116
 
                                          gpointer      user_data);
117
 
static void _gp_proc_uninstall_destroy   (WireMessage  *msg);
118
 
 
119
 
static void _gp_extension_ack_read       (GIOChannel   *channel,
120
 
                                          WireMessage  *msg,
121
 
                                          gpointer      user_data);
122
 
static void _gp_extension_ack_write      (GIOChannel   *channel,
123
 
                                          WireMessage  *msg,
124
 
                                          gpointer      user_data);
125
 
static void _gp_extension_ack_destroy    (WireMessage  *msg);
126
 
 
127
 
static void _gp_params_read              (GIOChannel   *channel,
128
 
                                          GPParam     **params,
129
 
                                          guint        *nparams,
130
 
                                          gpointer      user_data);
131
 
static void _gp_params_write             (GIOChannel   *channel,
132
 
                                          GPParam      *params,
133
 
                                          gint          nparams,
134
 
                                          gpointer      user_data);
135
 
 
136
 
/* used by gimp.c:gimp_destroy_params() */
137
 
void        _gp_params_destroy           (GPParam      *params,
138
 
                                          gint          nparams);
139
 
 
140
 
static void _gp_has_init_read            (GIOChannel   *channel,
141
 
                                          WireMessage  *msg,
142
 
                                          gpointer      user_data);
143
 
static void _gp_has_init_write           (GIOChannel   *channel,
144
 
                                          WireMessage  *msg,
145
 
                                          gpointer      user_data);
146
 
static void _gp_has_init_destroy         (WireMessage  *msg);
 
31
static void _gp_quit_read                (GIOChannel       *channel,
 
32
                                          GimpWireMessage  *msg,
 
33
                                          gpointer          user_data);
 
34
static void _gp_quit_write               (GIOChannel       *channel,
 
35
                                          GimpWireMessage  *msg,
 
36
                                          gpointer          user_data);
 
37
static void _gp_quit_destroy             (GimpWireMessage  *msg);
 
38
 
 
39
static void _gp_config_read              (GIOChannel       *channel,
 
40
                                          GimpWireMessage  *msg,
 
41
                                          gpointer          user_data);
 
42
static void _gp_config_write             (GIOChannel       *channel,
 
43
                                          GimpWireMessage  *msg,
 
44
                                          gpointer          user_data);
 
45
static void _gp_config_destroy           (GimpWireMessage  *msg);
 
46
 
 
47
static void _gp_tile_req_read            (GIOChannel       *channel,
 
48
                                          GimpWireMessage  *msg,
 
49
                                          gpointer          user_data);
 
50
static void _gp_tile_req_write           (GIOChannel       *channel,
 
51
                                          GimpWireMessage  *msg,
 
52
                                          gpointer          user_data);
 
53
static void _gp_tile_req_destroy         (GimpWireMessage  *msg);
 
54
 
 
55
static void _gp_tile_ack_read            (GIOChannel       *channel,
 
56
                                          GimpWireMessage  *msg,
 
57
                                          gpointer          user_data);
 
58
static void _gp_tile_ack_write           (GIOChannel       *channel,
 
59
                                          GimpWireMessage  *msg,
 
60
                                          gpointer          user_data);
 
61
static void _gp_tile_ack_destroy         (GimpWireMessage  *msg);
 
62
 
 
63
static void _gp_tile_data_read           (GIOChannel       *channel,
 
64
                                          GimpWireMessage  *msg,
 
65
                                          gpointer          user_data);
 
66
static void _gp_tile_data_write          (GIOChannel       *channel,
 
67
                                          GimpWireMessage  *msg,
 
68
                                          gpointer          user_data);
 
69
static void _gp_tile_data_destroy        (GimpWireMessage  *msg);
 
70
 
 
71
static void _gp_proc_run_read            (GIOChannel       *channel,
 
72
                                          GimpWireMessage  *msg,
 
73
                                          gpointer          user_data);
 
74
static void _gp_proc_run_write           (GIOChannel       *channel,
 
75
                                          GimpWireMessage  *msg,
 
76
                                          gpointer          user_data);
 
77
static void _gp_proc_run_destroy         (GimpWireMessage  *msg);
 
78
 
 
79
static void _gp_proc_return_read         (GIOChannel       *channel,
 
80
                                          GimpWireMessage  *msg,
 
81
                                          gpointer          user_data);
 
82
static void _gp_proc_return_write        (GIOChannel       *channel,
 
83
                                          GimpWireMessage  *msg,
 
84
                                          gpointer          user_data);
 
85
static void _gp_proc_return_destroy      (GimpWireMessage  *msg);
 
86
 
 
87
static void _gp_temp_proc_run_read       (GIOChannel       *channel,
 
88
                                          GimpWireMessage  *msg,
 
89
                                          gpointer          user_data);
 
90
static void _gp_temp_proc_run_write      (GIOChannel       *channel,
 
91
                                          GimpWireMessage  *msg,
 
92
                                          gpointer          user_data);
 
93
static void _gp_temp_proc_run_destroy    (GimpWireMessage  *msg);
 
94
 
 
95
static void _gp_temp_proc_return_read    (GIOChannel       *channel,
 
96
                                          GimpWireMessage  *msg,
 
97
                                          gpointer          user_data);
 
98
static void _gp_temp_proc_return_write   (GIOChannel       *channel,
 
99
                                          GimpWireMessage  *msg,
 
100
                                          gpointer          user_data);
 
101
static void _gp_temp_proc_return_destroy (GimpWireMessage  *msg);
 
102
 
 
103
static void _gp_proc_install_read        (GIOChannel       *channel,
 
104
                                          GimpWireMessage  *msg,
 
105
                                          gpointer          user_data);
 
106
static void _gp_proc_install_write       (GIOChannel       *channel,
 
107
                                          GimpWireMessage  *msg,
 
108
                                          gpointer          user_data);
 
109
static void _gp_proc_install_destroy     (GimpWireMessage  *msg);
 
110
 
 
111
static void _gp_proc_uninstall_read      (GIOChannel       *channel,
 
112
                                          GimpWireMessage  *msg,
 
113
                                          gpointer          user_data);
 
114
static void _gp_proc_uninstall_write     (GIOChannel       *channel,
 
115
                                          GimpWireMessage  *msg,
 
116
                                          gpointer          user_data);
 
117
static void _gp_proc_uninstall_destroy   (GimpWireMessage  *msg);
 
118
 
 
119
static void _gp_extension_ack_read       (GIOChannel       *channel,
 
120
                                          GimpWireMessage  *msg,
 
121
                                          gpointer          user_data);
 
122
static void _gp_extension_ack_write      (GIOChannel       *channel,
 
123
                                          GimpWireMessage  *msg,
 
124
                                          gpointer          user_data);
 
125
static void _gp_extension_ack_destroy    (GimpWireMessage  *msg);
 
126
 
 
127
static void _gp_params_read              (GIOChannel       *channel,
 
128
                                          GPParam         **params,
 
129
                                          guint            *nparams,
 
130
                                          gpointer          user_data);
 
131
static void _gp_params_write             (GIOChannel       *channel,
 
132
                                          GPParam          *params,
 
133
                                          gint              nparams,
 
134
                                          gpointer          user_data);
 
135
 
 
136
static void _gp_has_init_read            (GIOChannel       *channel,
 
137
                                          GimpWireMessage  *msg,
 
138
                                          gpointer          user_data);
 
139
static void _gp_has_init_write           (GIOChannel       *channel,
 
140
                                          GimpWireMessage  *msg,
 
141
                                          gpointer          user_data);
 
142
static void _gp_has_init_destroy         (GimpWireMessage  *msg);
147
143
 
148
144
 
149
145
 
150
146
void
151
147
gp_init (void)
152
148
{
153
 
  wire_register (GP_QUIT,
154
 
                 _gp_quit_read,
155
 
                 _gp_quit_write,
156
 
                 _gp_quit_destroy);
157
 
  wire_register (GP_CONFIG,
158
 
                 _gp_config_read,
159
 
                 _gp_config_write,
160
 
                 _gp_config_destroy);
161
 
  wire_register (GP_TILE_REQ,
162
 
                 _gp_tile_req_read,
163
 
                 _gp_tile_req_write,
164
 
                 _gp_tile_req_destroy);
165
 
  wire_register (GP_TILE_ACK,
166
 
                 _gp_tile_ack_read,
167
 
                 _gp_tile_ack_write,
168
 
                 _gp_tile_ack_destroy);
169
 
  wire_register (GP_TILE_DATA,
170
 
                 _gp_tile_data_read,
171
 
                 _gp_tile_data_write,
172
 
                 _gp_tile_data_destroy);
173
 
  wire_register (GP_PROC_RUN,
174
 
                 _gp_proc_run_read,
175
 
                 _gp_proc_run_write,
176
 
                 _gp_proc_run_destroy);
177
 
  wire_register (GP_PROC_RETURN,
178
 
                 _gp_proc_return_read,
179
 
                 _gp_proc_return_write,
180
 
                 _gp_proc_return_destroy);
181
 
  wire_register (GP_TEMP_PROC_RUN,
182
 
                 _gp_temp_proc_run_read,
183
 
                 _gp_temp_proc_run_write,
184
 
                 _gp_temp_proc_run_destroy);
185
 
  wire_register (GP_TEMP_PROC_RETURN,
186
 
                 _gp_temp_proc_return_read,
187
 
                 _gp_temp_proc_return_write,
188
 
                 _gp_temp_proc_return_destroy);
189
 
  wire_register (GP_PROC_INSTALL,
190
 
                 _gp_proc_install_read,
191
 
                 _gp_proc_install_write,
192
 
                 _gp_proc_install_destroy);
193
 
  wire_register (GP_PROC_UNINSTALL,
194
 
                 _gp_proc_uninstall_read,
195
 
                 _gp_proc_uninstall_write,
196
 
                 _gp_proc_uninstall_destroy);
197
 
  wire_register (GP_EXTENSION_ACK,
198
 
                 _gp_extension_ack_read,
199
 
                 _gp_extension_ack_write,
200
 
                 _gp_extension_ack_destroy);
201
 
  wire_register (GP_HAS_INIT,
202
 
                 _gp_has_init_read,
203
 
                 _gp_has_init_write,
204
 
                 _gp_has_init_destroy);
 
149
  gimp_wire_register (GP_QUIT,
 
150
                      _gp_quit_read,
 
151
                      _gp_quit_write,
 
152
                      _gp_quit_destroy);
 
153
  gimp_wire_register (GP_CONFIG,
 
154
                      _gp_config_read,
 
155
                      _gp_config_write,
 
156
                      _gp_config_destroy);
 
157
  gimp_wire_register (GP_TILE_REQ,
 
158
                      _gp_tile_req_read,
 
159
                      _gp_tile_req_write,
 
160
                      _gp_tile_req_destroy);
 
161
  gimp_wire_register (GP_TILE_ACK,
 
162
                      _gp_tile_ack_read,
 
163
                      _gp_tile_ack_write,
 
164
                      _gp_tile_ack_destroy);
 
165
  gimp_wire_register (GP_TILE_DATA,
 
166
                      _gp_tile_data_read,
 
167
                      _gp_tile_data_write,
 
168
                      _gp_tile_data_destroy);
 
169
  gimp_wire_register (GP_PROC_RUN,
 
170
                      _gp_proc_run_read,
 
171
                      _gp_proc_run_write,
 
172
                      _gp_proc_run_destroy);
 
173
  gimp_wire_register (GP_PROC_RETURN,
 
174
                      _gp_proc_return_read,
 
175
                      _gp_proc_return_write,
 
176
                      _gp_proc_return_destroy);
 
177
  gimp_wire_register (GP_TEMP_PROC_RUN,
 
178
                      _gp_temp_proc_run_read,
 
179
                      _gp_temp_proc_run_write,
 
180
                      _gp_temp_proc_run_destroy);
 
181
  gimp_wire_register (GP_TEMP_PROC_RETURN,
 
182
                      _gp_temp_proc_return_read,
 
183
                      _gp_temp_proc_return_write,
 
184
                      _gp_temp_proc_return_destroy);
 
185
  gimp_wire_register (GP_PROC_INSTALL,
 
186
                      _gp_proc_install_read,
 
187
                      _gp_proc_install_write,
 
188
                      _gp_proc_install_destroy);
 
189
  gimp_wire_register (GP_PROC_UNINSTALL,
 
190
                      _gp_proc_uninstall_read,
 
191
                      _gp_proc_uninstall_write,
 
192
                      _gp_proc_uninstall_destroy);
 
193
  gimp_wire_register (GP_EXTENSION_ACK,
 
194
                      _gp_extension_ack_read,
 
195
                      _gp_extension_ack_write,
 
196
                      _gp_extension_ack_destroy);
 
197
  gimp_wire_register (GP_HAS_INIT,
 
198
                      _gp_has_init_read,
 
199
                      _gp_has_init_write,
 
200
                      _gp_has_init_destroy);
205
201
}
206
202
 
207
203
gboolean
208
204
gp_quit_write (GIOChannel *channel,
209
205
               gpointer    user_data)
210
206
{
211
 
  WireMessage msg;
 
207
  GimpWireMessage msg;
212
208
 
213
209
  msg.type = GP_QUIT;
214
210
  msg.data = NULL;
215
211
 
216
 
  if (! wire_write_msg (channel, &msg, user_data))
217
 
    return FALSE;
218
 
  if (! wire_flush (channel, user_data))
219
 
    return FALSE;
 
212
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
213
    return FALSE;
 
214
 
 
215
  if (! gimp_wire_flush (channel, user_data))
 
216
    return FALSE;
 
217
 
220
218
  return TRUE;
221
219
}
222
220
 
223
221
gboolean
224
222
gp_config_write (GIOChannel *channel,
225
 
                 GPConfig   *config,
 
223
                 GPConfig   *config,
226
224
                 gpointer    user_data)
227
225
{
228
 
  WireMessage msg;
 
226
  GimpWireMessage msg;
229
227
 
230
228
  msg.type = GP_CONFIG;
231
229
  msg.data = config;
232
230
 
233
 
  if (! wire_write_msg (channel, &msg, user_data))
234
 
    return FALSE;
235
 
  if (! wire_flush (channel, user_data))
236
 
    return FALSE;
 
231
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
232
    return FALSE;
 
233
 
 
234
  if (! gimp_wire_flush (channel, user_data))
 
235
    return FALSE;
 
236
 
237
237
  return TRUE;
238
238
}
239
239
 
240
240
gboolean
241
241
gp_tile_req_write (GIOChannel *channel,
242
 
                   GPTileReq  *tile_req,
 
242
                   GPTileReq  *tile_req,
243
243
                   gpointer    user_data)
244
244
{
245
 
  WireMessage msg;
 
245
  GimpWireMessage msg;
246
246
 
247
247
  msg.type = GP_TILE_REQ;
248
248
  msg.data = tile_req;
249
249
 
250
 
  if (! wire_write_msg (channel, &msg, user_data))
251
 
    return FALSE;
252
 
  if (! wire_flush (channel, user_data))
253
 
    return FALSE;
 
250
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
251
    return FALSE;
 
252
 
 
253
  if (! gimp_wire_flush (channel, user_data))
 
254
    return FALSE;
 
255
 
254
256
  return TRUE;
255
257
}
256
258
 
258
260
gp_tile_ack_write (GIOChannel *channel,
259
261
                   gpointer    user_data)
260
262
{
261
 
  WireMessage msg;
 
263
  GimpWireMessage msg;
262
264
 
263
265
  msg.type = GP_TILE_ACK;
264
266
  msg.data = NULL;
265
267
 
266
 
  if (! wire_write_msg (channel, &msg, user_data))
267
 
    return FALSE;
268
 
  if (! wire_flush (channel, user_data))
269
 
    return FALSE;
 
268
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
269
    return FALSE;
 
270
 
 
271
  if (! gimp_wire_flush (channel, user_data))
 
272
    return FALSE;
 
273
 
270
274
  return TRUE;
271
275
}
272
276
 
273
277
gboolean
274
278
gp_tile_data_write (GIOChannel *channel,
275
 
                    GPTileData *tile_data,
 
279
                    GPTileData *tile_data,
276
280
                    gpointer    user_data)
277
281
{
278
 
  WireMessage msg;
 
282
  GimpWireMessage msg;
279
283
 
280
284
  msg.type = GP_TILE_DATA;
281
285
  msg.data = tile_data;
282
286
 
283
 
  if (! wire_write_msg (channel, &msg, user_data))
284
 
    return FALSE;
285
 
  if (! wire_flush (channel, user_data))
286
 
    return FALSE;
 
287
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
288
    return FALSE;
 
289
 
 
290
  if (! gimp_wire_flush (channel, user_data))
 
291
    return FALSE;
 
292
 
287
293
  return TRUE;
288
294
}
289
295
 
290
296
gboolean
291
297
gp_proc_run_write (GIOChannel *channel,
292
 
                   GPProcRun  *proc_run,
 
298
                   GPProcRun  *proc_run,
293
299
                   gpointer    user_data)
294
300
{
295
 
  WireMessage msg;
 
301
  GimpWireMessage msg;
296
302
 
297
303
  msg.type = GP_PROC_RUN;
298
304
  msg.data = proc_run;
299
305
 
300
 
  if (! wire_write_msg (channel, &msg, user_data))
301
 
    return FALSE;
302
 
  if (! wire_flush (channel, user_data))
303
 
    return FALSE;
 
306
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
307
    return FALSE;
 
308
 
 
309
  if (! gimp_wire_flush (channel, user_data))
 
310
    return FALSE;
 
311
 
304
312
  return TRUE;
305
313
}
306
314
 
307
315
gboolean
308
316
gp_proc_return_write (GIOChannel   *channel,
309
 
                      GPProcReturn *proc_return,
 
317
                      GPProcReturn *proc_return,
310
318
                      gpointer      user_data)
311
319
{
312
 
  WireMessage msg;
 
320
  GimpWireMessage msg;
313
321
 
314
322
  msg.type = GP_PROC_RETURN;
315
323
  msg.data = proc_return;
316
324
 
317
 
  if (! wire_write_msg (channel, &msg, user_data))
318
 
    return FALSE;
319
 
  if (! wire_flush (channel, user_data))
320
 
    return FALSE;
 
325
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
326
    return FALSE;
 
327
 
 
328
  if (! gimp_wire_flush (channel, user_data))
 
329
    return FALSE;
 
330
 
321
331
  return TRUE;
322
332
}
323
333
 
324
334
gboolean
325
335
gp_temp_proc_run_write (GIOChannel *channel,
326
 
                        GPProcRun  *proc_run,
 
336
                        GPProcRun  *proc_run,
327
337
                        gpointer    user_data)
328
338
{
329
 
  WireMessage msg;
 
339
  GimpWireMessage msg;
330
340
 
331
341
  msg.type = GP_TEMP_PROC_RUN;
332
342
  msg.data = proc_run;
333
343
 
334
 
  if (! wire_write_msg (channel, &msg, user_data))
335
 
    return FALSE;
336
 
  if (! wire_flush (channel, user_data))
337
 
    return FALSE;
 
344
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
345
    return FALSE;
 
346
 
 
347
  if (! gimp_wire_flush (channel, user_data))
 
348
    return FALSE;
 
349
 
338
350
  return TRUE;
339
351
}
340
352
 
341
353
gboolean
342
354
gp_temp_proc_return_write (GIOChannel   *channel,
343
 
                           GPProcReturn *proc_return,
 
355
                           GPProcReturn *proc_return,
344
356
                           gpointer      user_data)
345
357
{
346
 
  WireMessage msg;
 
358
  GimpWireMessage msg;
347
359
 
348
360
  msg.type = GP_TEMP_PROC_RETURN;
349
361
  msg.data = proc_return;
350
362
 
351
 
  if (! wire_write_msg (channel, &msg, user_data))
352
 
    return FALSE;
353
 
  if (! wire_flush (channel, user_data))
354
 
    return FALSE;
 
363
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
364
    return FALSE;
 
365
 
 
366
  if (! gimp_wire_flush (channel, user_data))
 
367
    return FALSE;
 
368
 
355
369
  return TRUE;
356
370
}
357
371
 
358
372
gboolean
359
373
gp_proc_install_write (GIOChannel    *channel,
360
 
                       GPProcInstall *proc_install,
 
374
                       GPProcInstall *proc_install,
361
375
                       gpointer       user_data)
362
376
{
363
 
  WireMessage msg;
 
377
  GimpWireMessage msg;
364
378
 
365
379
  msg.type = GP_PROC_INSTALL;
366
380
  msg.data = proc_install;
367
381
 
368
 
  if (! wire_write_msg (channel, &msg, user_data))
369
 
    return FALSE;
370
 
  if (! wire_flush (channel, user_data))
371
 
    return FALSE;
 
382
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
383
    return FALSE;
 
384
 
 
385
  if (! gimp_wire_flush (channel, user_data))
 
386
    return FALSE;
 
387
 
372
388
  return TRUE;
373
389
}
374
390
 
375
391
gboolean
376
392
gp_proc_uninstall_write (GIOChannel      *channel,
377
 
                         GPProcUninstall *proc_uninstall,
 
393
                         GPProcUninstall *proc_uninstall,
378
394
                         gpointer         user_data)
379
395
{
380
 
  WireMessage msg;
 
396
  GimpWireMessage msg;
381
397
 
382
398
  msg.type = GP_PROC_UNINSTALL;
383
399
  msg.data = proc_uninstall;
384
400
 
385
 
  if (! wire_write_msg (channel, &msg, user_data))
386
 
    return FALSE;
387
 
  if (! wire_flush (channel, user_data))
388
 
    return FALSE;
 
401
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
402
    return FALSE;
 
403
 
 
404
  if (! gimp_wire_flush (channel, user_data))
 
405
    return FALSE;
 
406
 
389
407
  return TRUE;
390
408
}
391
409
 
393
411
gp_extension_ack_write (GIOChannel *channel,
394
412
                        gpointer    user_data)
395
413
{
396
 
  WireMessage msg;
 
414
  GimpWireMessage msg;
397
415
 
398
416
  msg.type = GP_EXTENSION_ACK;
399
417
  msg.data = NULL;
400
418
 
401
 
  if (! wire_write_msg (channel, &msg, user_data))
402
 
    return FALSE;
403
 
  if (! wire_flush (channel, user_data))
404
 
    return FALSE;
 
419
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
420
    return FALSE;
 
421
 
 
422
  if (! gimp_wire_flush (channel, user_data))
 
423
    return FALSE;
 
424
 
405
425
  return TRUE;
406
426
}
407
427
 
409
429
gp_has_init_write (GIOChannel *channel,
410
430
                   gpointer    user_data)
411
431
{
412
 
  WireMessage msg;
 
432
  GimpWireMessage msg;
413
433
 
414
434
  msg.type = GP_HAS_INIT;
415
435
  msg.data = NULL;
416
436
 
417
 
  if (! wire_write_msg (channel, &msg, user_data))
418
 
    return FALSE;
419
 
  if (! wire_flush (channel, user_data))
420
 
    return FALSE;
 
437
  if (! gimp_wire_write_msg (channel, &msg, user_data))
 
438
    return FALSE;
 
439
 
 
440
  if (! gimp_wire_flush (channel, user_data))
 
441
    return FALSE;
 
442
 
421
443
  return TRUE;
422
444
}
423
445
 
424
446
/*  quit  */
425
447
 
426
448
static void
427
 
_gp_quit_read (GIOChannel  *channel,
428
 
               WireMessage *msg,
429
 
               gpointer     user_data)
430
 
{
431
 
}
432
 
 
433
 
static void
434
 
_gp_quit_write (GIOChannel  *channel,
435
 
                WireMessage *msg,
436
 
                gpointer     user_data)
437
 
{
438
 
}
439
 
 
440
 
static void
441
 
_gp_quit_destroy (WireMessage *msg)
 
449
_gp_quit_read (GIOChannel      *channel,
 
450
               GimpWireMessage *msg,
 
451
               gpointer         user_data)
 
452
{
 
453
}
 
454
 
 
455
static void
 
456
_gp_quit_write (GIOChannel      *channel,
 
457
                GimpWireMessage *msg,
 
458
                gpointer         user_data)
 
459
{
 
460
}
 
461
 
 
462
static void
 
463
_gp_quit_destroy (GimpWireMessage *msg)
442
464
{
443
465
}
444
466
 
445
467
/*  config  */
446
468
 
447
469
static void
448
 
_gp_config_read (GIOChannel  *channel,
449
 
                 WireMessage *msg,
450
 
                 gpointer     user_data)
 
470
_gp_config_read (GIOChannel      *channel,
 
471
                 GimpWireMessage *msg,
 
472
                 gpointer         user_data)
451
473
{
452
 
  GPConfig *config;
453
 
 
454
 
  config = g_new0 (GPConfig, 1);
455
 
 
456
 
  if (! wire_read_int32 (channel,
457
 
                         &config->version, 1, user_data))
458
 
    goto cleanup;
459
 
  if (! wire_read_int32 (channel,
460
 
                         &config->tile_width, 1, user_data))
461
 
    goto cleanup;
462
 
  if (! wire_read_int32 (channel,
463
 
                         &config->tile_height, 1, user_data))
464
 
    goto cleanup;
465
 
  if (! wire_read_int32 (channel,
466
 
                         (guint32 *) &config->shm_ID, 1, user_data))
467
 
    goto cleanup;
468
 
  if (! wire_read_int8 (channel,
469
 
                        (guint8 *) &config->check_size, 1, user_data))
470
 
    goto cleanup;
471
 
  if (! wire_read_int8 (channel,
472
 
                        (guint8 *) &config->check_type, 1, user_data))
473
 
    goto cleanup;
474
 
  if (! wire_read_int8 (channel,
475
 
                        (guint8 *) &config->show_help_button, 1, user_data))
476
 
    goto cleanup;
477
 
  if (! wire_read_int8 (channel,
478
 
                        (guint8 *) &config->gimp_reserved_4, 1, user_data))
479
 
    goto cleanup;
480
 
  if (! wire_read_int8 (channel,
481
 
                        (guint8 *) &config->gimp_reserved_5, 1, user_data))
482
 
    goto cleanup;
483
 
  if (! wire_read_int8 (channel,
484
 
                        (guint8 *) &config->gimp_reserved_6, 1, user_data))
485
 
    goto cleanup;
486
 
  if (! wire_read_int8 (channel,
487
 
                        (guint8 *) &config->gimp_reserved_7, 1, user_data))
488
 
    goto cleanup;
489
 
  if (! wire_read_int8 (channel,
490
 
                        (guint8 *) &config->gimp_reserved_8, 1, user_data))
491
 
    goto cleanup;
492
 
  if (! wire_read_int8 (channel,
493
 
                        (guint8 *) &config->install_cmap, 1, user_data))
494
 
    goto cleanup;
495
 
  if (! wire_read_int8 (channel,
496
 
                        (guint8 *) &config->show_tool_tips, 1, user_data))
497
 
    goto cleanup;
498
 
  if (! wire_read_int32 (channel,
499
 
                         (guint32 *) &config->min_colors, 1, user_data))
500
 
    goto cleanup;
501
 
  if (! wire_read_int32 (channel,
502
 
                         (guint32 *) &config->gdisp_ID, 1, user_data))
503
 
    goto cleanup;
504
 
 
505
 
  if (! wire_read_string (channel,
506
 
                          &config->app_name, 1, user_data))
507
 
    goto cleanup;
508
 
  if (! wire_read_string (channel,
509
 
                          &config->wm_class, 1, user_data))
510
 
    goto cleanup;
511
 
  if (! wire_read_string (channel,
512
 
                          &config->display_name, 1, user_data))
513
 
    goto cleanup;
514
 
  if (! wire_read_int32 (channel,
515
 
                         (guint32 *) &config->monitor_number, 1, user_data))
 
474
  GPConfig *config = g_new0 (GPConfig, 1);
 
475
 
 
476
  if (! _gimp_wire_read_int32 (channel,
 
477
                               &config->version, 1, user_data))
 
478
    goto cleanup;
 
479
  if (! _gimp_wire_read_int32 (channel,
 
480
                               &config->tile_width, 1, user_data))
 
481
    goto cleanup;
 
482
  if (! _gimp_wire_read_int32 (channel,
 
483
                               &config->tile_height, 1, user_data))
 
484
    goto cleanup;
 
485
  if (! _gimp_wire_read_int32 (channel,
 
486
                               (guint32 *) &config->shm_ID, 1, user_data))
 
487
    goto cleanup;
 
488
  if (! _gimp_wire_read_int8 (channel,
 
489
                              (guint8 *) &config->check_size, 1, user_data))
 
490
    goto cleanup;
 
491
  if (! _gimp_wire_read_int8 (channel,
 
492
                              (guint8 *) &config->check_type, 1, user_data))
 
493
    goto cleanup;
 
494
  if (! _gimp_wire_read_int8 (channel,
 
495
                              (guint8 *) &config->show_help_button, 1,
 
496
                              user_data))
 
497
    goto cleanup;
 
498
  if (! _gimp_wire_read_int8 (channel,
 
499
                              (guint8 *) &config->use_cpu_accel, 1,
 
500
                              user_data))
 
501
    goto cleanup;
 
502
  if (! _gimp_wire_read_int8 (channel,
 
503
                              (guint8 *) &config->gimp_reserved_5, 1,
 
504
                              user_data))
 
505
    goto cleanup;
 
506
  if (! _gimp_wire_read_int8 (channel,
 
507
                              (guint8 *) &config->gimp_reserved_6, 1,
 
508
                              user_data))
 
509
    goto cleanup;
 
510
  if (! _gimp_wire_read_int8 (channel,
 
511
                              (guint8 *) &config->gimp_reserved_7, 1,
 
512
                              user_data))
 
513
    goto cleanup;
 
514
  if (! _gimp_wire_read_int8 (channel,
 
515
                              (guint8 *) &config->gimp_reserved_8, 1,
 
516
                              user_data))
 
517
    goto cleanup;
 
518
  if (! _gimp_wire_read_int8 (channel,
 
519
                              (guint8 *) &config->install_cmap, 1, user_data))
 
520
    goto cleanup;
 
521
  if (! _gimp_wire_read_int8 (channel,
 
522
                              (guint8 *) &config->show_tooltips, 1, user_data))
 
523
    goto cleanup;
 
524
  if (! _gimp_wire_read_int32 (channel,
 
525
                               (guint32 *) &config->min_colors, 1, user_data))
 
526
    goto cleanup;
 
527
  if (! _gimp_wire_read_int32 (channel,
 
528
                               (guint32 *) &config->gdisp_ID, 1, user_data))
 
529
    goto cleanup;
 
530
 
 
531
  if (! _gimp_wire_read_string (channel,
 
532
                                &config->app_name, 1, user_data))
 
533
    goto cleanup;
 
534
  if (! _gimp_wire_read_string (channel,
 
535
                                &config->wm_class, 1, user_data))
 
536
    goto cleanup;
 
537
  if (! _gimp_wire_read_string (channel,
 
538
                                &config->display_name, 1, user_data))
 
539
    goto cleanup;
 
540
  if (! _gimp_wire_read_int32 (channel,
 
541
                               (guint32 *) &config->monitor_number, 1,
 
542
                               user_data))
516
543
    goto cleanup;
517
544
 
518
545
  msg->data = config;
526
553
}
527
554
 
528
555
static void
529
 
_gp_config_write (GIOChannel  *channel,
530
 
                  WireMessage *msg,
531
 
                  gpointer     user_data)
 
556
_gp_config_write (GIOChannel      *channel,
 
557
                  GimpWireMessage *msg,
 
558
                  gpointer         user_data)
532
559
{
533
 
  GPConfig *config;
 
560
  GPConfig *config = msg->data;
534
561
 
535
 
  config = msg->data;
536
 
  if (! wire_write_int32 (channel, &config->version, 1, user_data))
537
 
    return;
538
 
  if (! wire_write_int32 (channel, &config->tile_width, 1, user_data))
539
 
    return;
540
 
  if (! wire_write_int32 (channel, &config->tile_height, 1, user_data))
541
 
    return;
542
 
  if (! wire_write_int32 (channel, (guint32*) &config->shm_ID, 1, user_data))
543
 
    return;
544
 
  if (! wire_write_int8 (channel, (guint8*) &config->check_size, 1, user_data))
545
 
    return;
546
 
  if (! wire_write_int8 (channel, (guint8*) &config->check_type, 1, user_data))
547
 
    return;
548
 
  if (! wire_write_int8 (channel, (guint8*) &config->show_help_button, 1, user_data))
549
 
    return;
550
 
  if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_4, 1, user_data))
551
 
    return;
552
 
  if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_5, 1, user_data))
553
 
    return;
554
 
  if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_6, 1, user_data))
555
 
    return;
556
 
  if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_7, 1, user_data))
557
 
    return;
558
 
  if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_8, 1, user_data))
559
 
    return;
560
 
  if (! wire_write_int8 (channel, (guint8*) &config->install_cmap, 1, user_data))
561
 
    return;
562
 
  if (! wire_write_int8 (channel, (guint8*) &config->show_tool_tips, 1, user_data))
563
 
    return;
564
 
  if (! wire_write_int32 (channel, (guint32*) &config->min_colors, 1, user_data))
565
 
    return;
566
 
  if (! wire_write_int32 (channel, (guint32*) &config->gdisp_ID, 1, user_data))
567
 
    return;
568
 
  if (! wire_write_string (channel, &config->app_name, 1, user_data))
569
 
    return;
570
 
  if (! wire_write_string (channel, &config->wm_class, 1, user_data))
571
 
    return;
572
 
  if (! wire_write_string (channel, &config->display_name, 1, user_data))
573
 
    return;
574
 
  if (! wire_write_int32 (channel, (guint32*) &config->monitor_number, 1, user_data))
 
562
  if (! _gimp_wire_write_int32 (channel,
 
563
                                &config->version, 1, user_data))
 
564
    return;
 
565
  if (! _gimp_wire_write_int32 (channel,
 
566
                                &config->tile_width, 1, user_data))
 
567
    return;
 
568
  if (! _gimp_wire_write_int32 (channel,
 
569
                                &config->tile_height, 1, user_data))
 
570
    return;
 
571
  if (! _gimp_wire_write_int32 (channel,
 
572
                                (const guint32 *) &config->shm_ID, 1,
 
573
                                user_data))
 
574
    return;
 
575
  if (! _gimp_wire_write_int8 (channel,
 
576
                               (const guint8 *) &config->check_size, 1,
 
577
                               user_data))
 
578
    return;
 
579
  if (! _gimp_wire_write_int8 (channel,
 
580
                               (const guint8 *) &config->check_type, 1,
 
581
                               user_data))
 
582
    return;
 
583
  if (! _gimp_wire_write_int8 (channel,
 
584
                               (const guint8 *) &config->show_help_button, 1,
 
585
                               user_data))
 
586
    return;
 
587
  if (! _gimp_wire_write_int8 (channel,
 
588
                               (const guint8 *) &config->use_cpu_accel, 1,
 
589
                               user_data))
 
590
    return;
 
591
  if (! _gimp_wire_write_int8 (channel,
 
592
                               (const guint8 *) &config->gimp_reserved_5, 1,
 
593
                               user_data))
 
594
    return;
 
595
  if (! _gimp_wire_write_int8 (channel,
 
596
                               (const guint8 *) &config->gimp_reserved_6, 1,
 
597
                               user_data))
 
598
    return;
 
599
  if (! _gimp_wire_write_int8 (channel,
 
600
                               (const guint8 *) &config->gimp_reserved_7, 1,
 
601
                               user_data))
 
602
    return;
 
603
  if (! _gimp_wire_write_int8 (channel,
 
604
                               (const guint8 *) &config->gimp_reserved_8, 1,
 
605
                               user_data))
 
606
    return;
 
607
  if (! _gimp_wire_write_int8 (channel,
 
608
                               (const guint8 *) &config->install_cmap, 1,
 
609
                               user_data))
 
610
    return;
 
611
  if (! _gimp_wire_write_int8 (channel,
 
612
                               (const guint8 *) &config->show_tooltips, 1,
 
613
                               user_data))
 
614
    return;
 
615
  if (! _gimp_wire_write_int32 (channel,
 
616
                                (const guint32 *) &config->min_colors, 1,
 
617
                                user_data))
 
618
    return;
 
619
  if (! _gimp_wire_write_int32 (channel,
 
620
                                (const guint32 *) &config->gdisp_ID, 1,
 
621
                                user_data))
 
622
    return;
 
623
  if (! _gimp_wire_write_string (channel,
 
624
                                 &config->app_name, 1, user_data))
 
625
    return;
 
626
  if (! _gimp_wire_write_string (channel,
 
627
                                 &config->wm_class, 1, user_data))
 
628
    return;
 
629
  if (! _gimp_wire_write_string (channel,
 
630
                                 &config->display_name, 1, user_data))
 
631
    return;
 
632
  if (! _gimp_wire_write_int32 (channel,
 
633
                                (const guint32 *) &config->monitor_number, 1,
 
634
                                user_data))
575
635
    return;
576
636
}
577
637
 
578
638
static void
579
 
_gp_config_destroy (WireMessage *msg)
 
639
_gp_config_destroy (GimpWireMessage *msg)
580
640
{
581
 
  GPConfig *config;
582
 
 
583
 
  config = msg->data;
 
641
  GPConfig *config = msg->data;
584
642
 
585
643
  g_free (config->app_name);
586
644
  g_free (config->wm_class);
591
649
/*  tile_req  */
592
650
 
593
651
static void
594
 
_gp_tile_req_read (GIOChannel  *channel,
595
 
                   WireMessage *msg,
596
 
                   gpointer     user_data)
 
652
_gp_tile_req_read (GIOChannel      *channel,
 
653
                   GimpWireMessage *msg,
 
654
                   gpointer         user_data)
597
655
{
598
 
  GPTileReq *tile_req;
599
 
 
600
 
  tile_req = g_new0 (GPTileReq, 1);
601
 
 
602
 
  if (! wire_read_int32 (channel, (guint32*) &tile_req->drawable_ID, 1,
603
 
                         user_data))
604
 
    goto cleanup;
605
 
  if (! wire_read_int32 (channel, &tile_req->tile_num, 1, user_data))
606
 
    goto cleanup;
607
 
  if (! wire_read_int32 (channel, &tile_req->shadow, 1, user_data))
 
656
  GPTileReq *tile_req = g_new0 (GPTileReq, 1);
 
657
 
 
658
  if (! _gimp_wire_read_int32 (channel,
 
659
                               (guint32 *) &tile_req->drawable_ID, 1,
 
660
                               user_data))
 
661
    goto cleanup;
 
662
  if (! _gimp_wire_read_int32 (channel,
 
663
                               &tile_req->tile_num, 1, user_data))
 
664
    goto cleanup;
 
665
  if (! _gimp_wire_read_int32 (channel,
 
666
                               &tile_req->shadow, 1, user_data))
608
667
    goto cleanup;
609
668
 
610
669
  msg->data = tile_req;
615
674
}
616
675
 
617
676
static void
618
 
_gp_tile_req_write (GIOChannel  *channel,
619
 
                    WireMessage *msg,
620
 
                    gpointer     user_data)
 
677
_gp_tile_req_write (GIOChannel      *channel,
 
678
                    GimpWireMessage *msg,
 
679
                    gpointer         user_data)
621
680
{
622
 
  GPTileReq *tile_req;
 
681
  GPTileReq *tile_req = msg->data;
623
682
 
624
 
  tile_req = msg->data;
625
 
  if (! wire_write_int32 (channel, (guint32*) &tile_req->drawable_ID, 1,
626
 
                          user_data))
627
 
    return;
628
 
  if (! wire_write_int32 (channel, &tile_req->tile_num, 1, user_data))
629
 
    return;
630
 
  if (! wire_write_int32 (channel, &tile_req->shadow, 1, user_data))
 
683
  if (! _gimp_wire_write_int32 (channel,
 
684
                                (const guint32 *) &tile_req->drawable_ID, 1,
 
685
                                user_data))
 
686
    return;
 
687
  if (! _gimp_wire_write_int32 (channel,
 
688
                                &tile_req->tile_num, 1, user_data))
 
689
    return;
 
690
  if (! _gimp_wire_write_int32 (channel,
 
691
                                &tile_req->shadow, 1, user_data))
631
692
    return;
632
693
}
633
694
 
634
695
static void
635
 
_gp_tile_req_destroy (WireMessage *msg)
 
696
_gp_tile_req_destroy (GimpWireMessage *msg)
636
697
{
637
698
  g_free (msg->data);
638
699
}
640
701
/*  tile_ack  */
641
702
 
642
703
static void
643
 
_gp_tile_ack_read (GIOChannel  *channel,
644
 
                   WireMessage *msg,
645
 
                   gpointer     user_data)
646
 
{
647
 
}
648
 
 
649
 
static void
650
 
_gp_tile_ack_write (GIOChannel  *channel,
651
 
                    WireMessage *msg,
652
 
                    gpointer     user_data)
653
 
{
654
 
}
655
 
 
656
 
static void
657
 
_gp_tile_ack_destroy (WireMessage *msg)
 
704
_gp_tile_ack_read (GIOChannel      *channel,
 
705
                   GimpWireMessage *msg,
 
706
                   gpointer         user_data)
 
707
{
 
708
}
 
709
 
 
710
static void
 
711
_gp_tile_ack_write (GIOChannel      *channel,
 
712
                    GimpWireMessage *msg,
 
713
                    gpointer         user_data)
 
714
{
 
715
}
 
716
 
 
717
static void
 
718
_gp_tile_ack_destroy (GimpWireMessage *msg)
658
719
{
659
720
}
660
721
 
661
722
/*  tile_data  */
662
723
 
663
724
static void
664
 
_gp_tile_data_read (GIOChannel  *channel,
665
 
                    WireMessage *msg,
666
 
                    gpointer     user_data)
 
725
_gp_tile_data_read (GIOChannel      *channel,
 
726
                    GimpWireMessage *msg,
 
727
                    gpointer         user_data)
667
728
{
668
 
  GPTileData *tile_data;
669
 
  guint length;
670
 
 
671
 
  tile_data = g_new0 (GPTileData, 1);
672
 
 
673
 
  if (! wire_read_int32 (channel, (guint32*) &tile_data->drawable_ID, 1,
674
 
                         user_data))
675
 
    goto cleanup;
676
 
  if (! wire_read_int32 (channel, &tile_data->tile_num, 1, user_data))
677
 
    goto cleanup;
678
 
  if (! wire_read_int32 (channel, &tile_data->shadow, 1, user_data))
679
 
    goto cleanup;
680
 
  if (! wire_read_int32 (channel, &tile_data->bpp, 1, user_data))
681
 
    goto cleanup;
682
 
  if (! wire_read_int32 (channel, &tile_data->width, 1, user_data))
683
 
    goto cleanup;
684
 
  if (! wire_read_int32 (channel, &tile_data->height, 1, user_data))
685
 
    goto cleanup;
686
 
  if (! wire_read_int32 (channel, &tile_data->use_shm, 1, user_data))
 
729
  GPTileData *tile_data = g_new0 (GPTileData, 1);
 
730
 
 
731
  if (! _gimp_wire_read_int32 (channel,
 
732
                               (guint32 *) &tile_data->drawable_ID, 1,
 
733
                               user_data))
 
734
    goto cleanup;
 
735
  if (! _gimp_wire_read_int32 (channel,
 
736
                               &tile_data->tile_num, 1, user_data))
 
737
    goto cleanup;
 
738
  if (! _gimp_wire_read_int32 (channel,
 
739
                               &tile_data->shadow, 1, user_data))
 
740
    goto cleanup;
 
741
  if (! _gimp_wire_read_int32 (channel,
 
742
                               &tile_data->bpp, 1, user_data))
 
743
    goto cleanup;
 
744
  if (! _gimp_wire_read_int32 (channel,
 
745
                               &tile_data->width, 1, user_data))
 
746
    goto cleanup;
 
747
  if (! _gimp_wire_read_int32 (channel,
 
748
                               &tile_data->height, 1, user_data))
 
749
    goto cleanup;
 
750
  if (! _gimp_wire_read_int32 (channel,
 
751
                               &tile_data->use_shm, 1, user_data))
687
752
    goto cleanup;
688
753
 
689
754
  if (!tile_data->use_shm)
690
755
    {
691
 
      length = tile_data->width * tile_data->height * tile_data->bpp;
 
756
      guint length = tile_data->width * tile_data->height * tile_data->bpp;
 
757
 
692
758
      tile_data->data = g_new (guchar, length);
693
759
 
694
 
      if (! wire_read_int8 (channel, (guint8*) tile_data->data, length,
695
 
                            user_data))
696
 
        goto cleanup;
 
760
      if (! _gimp_wire_read_int8 (channel,
 
761
                                  (guint8 *) tile_data->data, length,
 
762
                                  user_data))
 
763
        goto cleanup;
697
764
    }
698
765
 
699
766
  msg->data = tile_data;
705
772
}
706
773
 
707
774
static void
708
 
_gp_tile_data_write (GIOChannel  *channel,
709
 
                     WireMessage *msg,
710
 
                     gpointer     user_data)
 
775
_gp_tile_data_write (GIOChannel      *channel,
 
776
                     GimpWireMessage *msg,
 
777
                     gpointer         user_data)
711
778
{
712
 
  GPTileData *tile_data;
713
 
  guint length;
 
779
  GPTileData *tile_data = msg->data;
714
780
 
715
 
  tile_data = msg->data;
716
 
  if (! wire_write_int32 (channel, (guint32*) &tile_data->drawable_ID, 1,
717
 
                          user_data))
718
 
    return;
719
 
  if (! wire_write_int32 (channel, &tile_data->tile_num, 1, user_data))
720
 
    return;
721
 
  if (! wire_write_int32 (channel, &tile_data->shadow, 1, user_data))
722
 
    return;
723
 
  if (! wire_write_int32 (channel, &tile_data->bpp, 1, user_data))
724
 
    return;
725
 
  if (! wire_write_int32 (channel, &tile_data->width, 1, user_data))
726
 
    return;
727
 
  if (! wire_write_int32 (channel, &tile_data->height, 1, user_data))
728
 
    return;
729
 
  if (! wire_write_int32 (channel, &tile_data->use_shm, 1, user_data))
 
781
  if (! _gimp_wire_write_int32 (channel,
 
782
                                (const guint32 *) &tile_data->drawable_ID, 1,
 
783
                                user_data))
 
784
    return;
 
785
  if (! _gimp_wire_write_int32 (channel,
 
786
                                &tile_data->tile_num, 1, user_data))
 
787
    return;
 
788
  if (! _gimp_wire_write_int32 (channel,
 
789
                                &tile_data->shadow, 1, user_data))
 
790
    return;
 
791
  if (! _gimp_wire_write_int32 (channel,
 
792
                                &tile_data->bpp, 1, user_data))
 
793
    return;
 
794
  if (! _gimp_wire_write_int32 (channel,
 
795
                                &tile_data->width, 1, user_data))
 
796
    return;
 
797
  if (! _gimp_wire_write_int32 (channel,
 
798
                                &tile_data->height, 1, user_data))
 
799
    return;
 
800
  if (! _gimp_wire_write_int32 (channel,
 
801
                                &tile_data->use_shm, 1, user_data))
730
802
    return;
731
803
 
732
804
  if (!tile_data->use_shm)
733
805
    {
734
 
      length = tile_data->width * tile_data->height * tile_data->bpp;
735
 
      if (! wire_write_int8 (channel, (guint8*) tile_data->data, length,
736
 
                             user_data))
737
 
        return;
 
806
      guint length = tile_data->width * tile_data->height * tile_data->bpp;
 
807
 
 
808
      if (! _gimp_wire_write_int8 (channel,
 
809
                                   (const guint8 *) tile_data->data, length,
 
810
                                   user_data))
 
811
        return;
738
812
    }
739
813
}
740
814
 
741
815
static void
742
 
_gp_tile_data_destroy (WireMessage *msg)
 
816
_gp_tile_data_destroy (GimpWireMessage *msg)
743
817
{
744
 
  GPTileData *tile_data;
745
 
 
746
 
  tile_data = msg->data;
 
818
  GPTileData *tile_data = msg->data;
747
819
 
748
820
  g_free (tile_data->data);
749
821
  g_free (tile_data);
752
824
/*  proc_run  */
753
825
 
754
826
static void
755
 
_gp_proc_run_read (GIOChannel  *channel,
756
 
                   WireMessage *msg,
757
 
                   gpointer     user_data)
 
827
_gp_proc_run_read (GIOChannel      *channel,
 
828
                   GimpWireMessage *msg,
 
829
                   gpointer         user_data)
758
830
{
759
 
  GPProcRun *proc_run;
760
 
 
761
 
  proc_run = g_new0 (GPProcRun, 1);
762
 
 
763
 
  if (! wire_read_string (channel, &proc_run->name, 1, user_data))
 
831
  GPProcRun *proc_run = g_new0 (GPProcRun, 1);
 
832
 
 
833
  if (! _gimp_wire_read_string (channel, &proc_run->name, 1, user_data))
764
834
    goto cleanup;
765
835
 
766
836
  _gp_params_read (channel,
767
 
                   &proc_run->params, (guint*) &proc_run->nparams,
 
837
                   &proc_run->params, (guint *) &proc_run->nparams,
768
838
                   user_data);
769
839
 
770
840
  msg->data = proc_run;
775
845
}
776
846
 
777
847
static void
778
 
_gp_proc_run_write (GIOChannel  *channel,
779
 
                    WireMessage *msg,
780
 
                    gpointer     user_data)
 
848
_gp_proc_run_write (GIOChannel      *channel,
 
849
                    GimpWireMessage *msg,
 
850
                    gpointer         user_data)
781
851
{
782
 
  GPProcRun *proc_run;
783
 
 
784
 
  proc_run = msg->data;
785
 
 
786
 
  if (! wire_write_string (channel, &proc_run->name, 1, user_data))
 
852
  GPProcRun *proc_run = msg->data;
 
853
 
 
854
  if (! _gimp_wire_write_string (channel, &proc_run->name, 1, user_data))
787
855
    return;
788
856
 
789
857
  _gp_params_write (channel, proc_run->params, proc_run->nparams, user_data);
790
858
}
791
859
 
792
860
static void
793
 
_gp_proc_run_destroy (WireMessage *msg)
 
861
_gp_proc_run_destroy (GimpWireMessage *msg)
794
862
{
795
 
  GPProcRun *proc_run;
 
863
  GPProcRun *proc_run = msg->data;
796
864
 
797
 
  proc_run = msg->data;
798
 
  _gp_params_destroy (proc_run->params, proc_run->nparams);
 
865
  gp_params_destroy (proc_run->params, proc_run->nparams);
799
866
 
800
867
  g_free (proc_run->name);
801
868
  g_free (proc_run);
804
871
/*  proc_return  */
805
872
 
806
873
static void
807
 
_gp_proc_return_read (GIOChannel  *channel,
808
 
                      WireMessage *msg,
809
 
                      gpointer     user_data)
 
874
_gp_proc_return_read (GIOChannel      *channel,
 
875
                      GimpWireMessage *msg,
 
876
                      gpointer         user_data)
810
877
{
811
 
  GPProcReturn *proc_return;
812
 
 
813
 
  proc_return = g_new0 (GPProcReturn, 1);
814
 
 
815
 
  if (! wire_read_string (channel, &proc_return->name, 1, user_data))
 
878
  GPProcReturn *proc_return = g_new0 (GPProcReturn, 1);
 
879
 
 
880
  if (! _gimp_wire_read_string (channel, &proc_return->name, 1, user_data))
816
881
    goto cleanup;
817
882
 
818
883
  _gp_params_read (channel,
819
 
                   &proc_return->params, (guint*) &proc_return->nparams,
 
884
                   &proc_return->params, (guint *) &proc_return->nparams,
820
885
                   user_data);
821
886
 
822
887
  msg->data = proc_return;
827
892
}
828
893
 
829
894
static void
830
 
_gp_proc_return_write (GIOChannel  *channel,
831
 
                       WireMessage *msg,
832
 
                       gpointer     user_data)
 
895
_gp_proc_return_write (GIOChannel      *channel,
 
896
                       GimpWireMessage *msg,
 
897
                       gpointer         user_data)
833
898
{
834
 
  GPProcReturn *proc_return;
835
 
 
836
 
  proc_return = msg->data;
837
 
 
838
 
  if (! wire_write_string (channel, &proc_return->name, 1, user_data))
 
899
  GPProcReturn *proc_return = msg->data;
 
900
 
 
901
  if (! _gimp_wire_write_string (channel, &proc_return->name, 1, user_data))
839
902
    return;
840
903
 
841
 
  _gp_params_write (channel, proc_return->params, proc_return->nparams,
842
 
                    user_data);
 
904
  _gp_params_write (channel,
 
905
                    proc_return->params, proc_return->nparams, user_data);
843
906
}
844
907
 
845
908
static void
846
 
_gp_proc_return_destroy (WireMessage *msg)
 
909
_gp_proc_return_destroy (GimpWireMessage *msg)
847
910
{
848
 
  GPProcReturn *proc_return;
 
911
  GPProcReturn *proc_return = msg->data;
849
912
 
850
 
  proc_return = msg->data;
851
 
  _gp_params_destroy (proc_return->params, proc_return->nparams);
 
913
  gp_params_destroy (proc_return->params, proc_return->nparams);
852
914
 
853
915
  g_free (proc_return->name);
854
916
  g_free (proc_return);
857
919
/*  temp_proc_run  */
858
920
 
859
921
static void
860
 
_gp_temp_proc_run_read (GIOChannel  *channel,
861
 
                        WireMessage *msg,
862
 
                        gpointer     user_data)
 
922
_gp_temp_proc_run_read (GIOChannel      *channel,
 
923
                        GimpWireMessage *msg,
 
924
                        gpointer         user_data)
863
925
{
864
926
  _gp_proc_run_read (channel, msg, user_data);
865
927
}
866
928
 
867
929
static void
868
 
_gp_temp_proc_run_write (GIOChannel  *channel,
869
 
                         WireMessage *msg,
870
 
                         gpointer     user_data)
 
930
_gp_temp_proc_run_write (GIOChannel      *channel,
 
931
                         GimpWireMessage *msg,
 
932
                         gpointer         user_data)
871
933
{
872
934
  _gp_proc_run_write (channel, msg, user_data);
873
935
}
874
936
 
875
937
static void
876
 
_gp_temp_proc_run_destroy (WireMessage *msg)
 
938
_gp_temp_proc_run_destroy (GimpWireMessage *msg)
877
939
{
878
940
  _gp_proc_run_destroy (msg);
879
941
}
881
943
/*  temp_proc_return  */
882
944
 
883
945
static void
884
 
_gp_temp_proc_return_read (GIOChannel  *channel,
885
 
                           WireMessage *msg,
886
 
                           gpointer     user_data)
 
946
_gp_temp_proc_return_read (GIOChannel      *channel,
 
947
                           GimpWireMessage *msg,
 
948
                           gpointer         user_data)
887
949
{
888
950
  _gp_proc_return_read (channel, msg, user_data);
889
951
}
890
952
 
891
953
static void
892
 
_gp_temp_proc_return_write (GIOChannel  *channel,
893
 
                            WireMessage *msg,
894
 
                            gpointer     user_data)
 
954
_gp_temp_proc_return_write (GIOChannel      *channel,
 
955
                            GimpWireMessage *msg,
 
956
                            gpointer         user_data)
895
957
{
896
958
  _gp_proc_return_write (channel, msg, user_data);
897
959
}
898
960
 
899
961
static void
900
 
_gp_temp_proc_return_destroy (WireMessage *msg)
 
962
_gp_temp_proc_return_destroy (GimpWireMessage *msg)
901
963
{
902
964
  _gp_proc_return_destroy (msg);
903
965
}
905
967
/*  proc_install  */
906
968
 
907
969
static void
908
 
_gp_proc_install_read (GIOChannel  *channel,
909
 
                       WireMessage *msg,
910
 
                       gpointer     user_data)
 
970
_gp_proc_install_read (GIOChannel      *channel,
 
971
                       GimpWireMessage *msg,
 
972
                       gpointer         user_data)
911
973
{
912
 
  GPProcInstall *proc_install;
913
 
  gint i;
914
 
 
915
 
  proc_install = g_new0 (GPProcInstall, 1);
916
 
 
917
 
  if (! wire_read_string (channel, &proc_install->name, 1, user_data))
918
 
    goto cleanup;
919
 
  if (! wire_read_string (channel, &proc_install->blurb, 1, user_data))
920
 
    goto cleanup;
921
 
  if (! wire_read_string (channel, &proc_install->help, 1, user_data))
922
 
    goto cleanup;
923
 
  if (! wire_read_string (channel, &proc_install->author, 1, user_data))
924
 
    goto cleanup;
925
 
  if (! wire_read_string (channel, &proc_install->copyright, 1, user_data))
926
 
    goto cleanup;
927
 
  if (! wire_read_string (channel, &proc_install->date, 1, user_data))
928
 
    goto cleanup;
929
 
  if (! wire_read_string (channel, &proc_install->menu_path, 1, user_data))
930
 
    goto cleanup;
931
 
  if (! wire_read_string (channel, &proc_install->image_types, 1, user_data))
932
 
    goto cleanup;
933
 
 
934
 
  if (! wire_read_int32 (channel, &proc_install->type, 1, user_data))
935
 
    goto cleanup;
936
 
  if (! wire_read_int32 (channel, &proc_install->nparams, 1, user_data))
937
 
    goto cleanup;
938
 
  if (! wire_read_int32 (channel, &proc_install->nreturn_vals, 1, user_data))
 
974
  GPProcInstall *proc_install = g_new0 (GPProcInstall, 1);
 
975
  gint           i;
 
976
 
 
977
  if (! _gimp_wire_read_string (channel,
 
978
                                &proc_install->name, 1, user_data))
 
979
    goto cleanup;
 
980
  if (! _gimp_wire_read_string (channel,
 
981
                                &proc_install->blurb, 1, user_data))
 
982
    goto cleanup;
 
983
  if (! _gimp_wire_read_string (channel,
 
984
                                &proc_install->help, 1, user_data))
 
985
    goto cleanup;
 
986
  if (! _gimp_wire_read_string (channel,
 
987
                                &proc_install->author, 1, user_data))
 
988
    goto cleanup;
 
989
  if (! _gimp_wire_read_string (channel,
 
990
                                &proc_install->copyright, 1, user_data))
 
991
    goto cleanup;
 
992
  if (! _gimp_wire_read_string (channel,
 
993
                                &proc_install->date, 1, user_data))
 
994
    goto cleanup;
 
995
  if (! _gimp_wire_read_string (channel,
 
996
                                &proc_install->menu_path, 1, user_data))
 
997
    goto cleanup;
 
998
  if (! _gimp_wire_read_string (channel,
 
999
                                &proc_install->image_types, 1, user_data))
 
1000
    goto cleanup;
 
1001
 
 
1002
  if (! _gimp_wire_read_int32 (channel,
 
1003
                               &proc_install->type, 1, user_data))
 
1004
    goto cleanup;
 
1005
  if (! _gimp_wire_read_int32 (channel,
 
1006
                               &proc_install->nparams, 1, user_data))
 
1007
    goto cleanup;
 
1008
  if (! _gimp_wire_read_int32 (channel,
 
1009
                               &proc_install->nreturn_vals, 1, user_data))
939
1010
    goto cleanup;
940
1011
 
941
1012
  proc_install->params = g_new0 (GPParamDef, proc_install->nparams);
942
1013
 
943
1014
  for (i = 0; i < proc_install->nparams; i++)
944
1015
    {
945
 
      if (! wire_read_int32 (channel,
946
 
                             (guint32*) &proc_install->params[i].type, 1,
947
 
                             user_data))
948
 
        goto cleanup;
949
 
      if (! wire_read_string (channel,
950
 
                              &proc_install->params[i].name, 1,
951
 
                              user_data))
952
 
        goto cleanup;
953
 
      if (! wire_read_string (channel,
954
 
                              &proc_install->params[i].description, 1,
955
 
                              user_data))
956
 
        goto cleanup;
 
1016
      if (! _gimp_wire_read_int32 (channel,
 
1017
                                   (guint32 *) &proc_install->params[i].type, 1,
 
1018
                                   user_data))
 
1019
        goto cleanup;
 
1020
      if (! _gimp_wire_read_string (channel,
 
1021
                                    &proc_install->params[i].name, 1,
 
1022
                                    user_data))
 
1023
        goto cleanup;
 
1024
      if (! _gimp_wire_read_string (channel,
 
1025
                                    &proc_install->params[i].description, 1,
 
1026
                                    user_data))
 
1027
        goto cleanup;
957
1028
    }
958
1029
 
959
1030
  proc_install->return_vals = g_new0 (GPParamDef, proc_install->nreturn_vals);
960
1031
 
961
1032
  for (i = 0; i < proc_install->nreturn_vals; i++)
962
1033
    {
963
 
      if (! wire_read_int32 (channel,
964
 
                             (guint32*) &proc_install->return_vals[i].type, 1,
965
 
                             user_data))
966
 
        goto cleanup;
967
 
      if (! wire_read_string (channel,
968
 
                              &proc_install->return_vals[i].name, 1,
969
 
                              user_data))
970
 
        goto cleanup;
971
 
      if (! wire_read_string (channel,
972
 
                              &proc_install->return_vals[i].description, 1,
973
 
                              user_data))
974
 
        goto cleanup;
 
1034
      if (! _gimp_wire_read_int32 (channel,
 
1035
                                   (guint32 *) &proc_install->return_vals[i].type, 1,
 
1036
                                   user_data))
 
1037
        goto cleanup;
 
1038
      if (! _gimp_wire_read_string (channel,
 
1039
                                    &proc_install->return_vals[i].name, 1,
 
1040
                                    user_data))
 
1041
        goto cleanup;
 
1042
      if (! _gimp_wire_read_string (channel,
 
1043
                                    &proc_install->return_vals[i].description, 1,
 
1044
                                    user_data))
 
1045
        goto cleanup;
975
1046
    }
976
1047
 
977
1048
  msg->data = proc_install;
990
1061
  if (proc_install->params)
991
1062
    {
992
1063
      for (i = 0; i < proc_install->nparams; i++)
993
 
        {
994
 
          if (!proc_install->params[i].name)
995
 
            break;
 
1064
        {
 
1065
          if (!proc_install->params[i].name)
 
1066
            break;
996
1067
 
997
 
          g_free (proc_install->params[i].name);
998
 
          g_free (proc_install->params[i].description);
999
 
        }
 
1068
          g_free (proc_install->params[i].name);
 
1069
          g_free (proc_install->params[i].description);
 
1070
        }
1000
1071
 
1001
1072
      g_free (proc_install->params);
1002
1073
    }
1004
1075
  if (proc_install->return_vals)
1005
1076
    {
1006
1077
      for (i = 0; i < proc_install->nreturn_vals; i++)
1007
 
        {
1008
 
          if (!proc_install->return_vals[i].name)
1009
 
            break;
 
1078
        {
 
1079
          if (!proc_install->return_vals[i].name)
 
1080
            break;
1010
1081
 
1011
 
          g_free (proc_install->return_vals[i].name);
1012
 
          g_free (proc_install->return_vals[i].description);
1013
 
        }
 
1082
          g_free (proc_install->return_vals[i].name);
 
1083
          g_free (proc_install->return_vals[i].description);
 
1084
        }
1014
1085
 
1015
1086
      g_free (proc_install->return_vals);
1016
1087
    }
1019
1090
}
1020
1091
 
1021
1092
static void
1022
 
_gp_proc_install_write (GIOChannel  *channel,
1023
 
                        WireMessage *msg,
1024
 
                        gpointer     user_data)
 
1093
_gp_proc_install_write (GIOChannel      *channel,
 
1094
                        GimpWireMessage *msg,
 
1095
                        gpointer         user_data)
1025
1096
{
1026
 
  GPProcInstall *proc_install;
1027
 
  gint i;
1028
 
 
1029
 
  proc_install = msg->data;
1030
 
 
1031
 
  if (! wire_write_string (channel, &proc_install->name, 1, user_data))
1032
 
    return;
1033
 
  if (! wire_write_string (channel, &proc_install->blurb, 1, user_data))
1034
 
    return;
1035
 
  if (! wire_write_string (channel, &proc_install->help, 1, user_data))
1036
 
    return;
1037
 
  if (! wire_write_string (channel, &proc_install->author, 1, user_data))
1038
 
    return;
1039
 
  if (! wire_write_string (channel, &proc_install->copyright, 1, user_data))
1040
 
    return;
1041
 
  if (! wire_write_string (channel, &proc_install->date, 1, user_data))
1042
 
    return;
1043
 
  if (! wire_write_string (channel, &proc_install->menu_path, 1, user_data))
1044
 
    return;
1045
 
  if (! wire_write_string (channel, &proc_install->image_types, 1, user_data))
1046
 
    return;
1047
 
 
1048
 
  if (! wire_write_int32 (channel, &proc_install->type, 1, user_data))
1049
 
    return;
1050
 
  if (! wire_write_int32 (channel, &proc_install->nparams, 1, user_data))
1051
 
    return;
1052
 
  if (! wire_write_int32 (channel, &proc_install->nreturn_vals, 1, user_data))
 
1097
  GPProcInstall *proc_install = msg->data;
 
1098
  gint           i;
 
1099
 
 
1100
  if (! _gimp_wire_write_string (channel,
 
1101
                                 &proc_install->name, 1, user_data))
 
1102
    return;
 
1103
  if (! _gimp_wire_write_string (channel,
 
1104
                                 &proc_install->blurb, 1, user_data))
 
1105
    return;
 
1106
  if (! _gimp_wire_write_string (channel,
 
1107
                                 &proc_install->help, 1, user_data))
 
1108
    return;
 
1109
  if (! _gimp_wire_write_string (channel,
 
1110
                                 &proc_install->author, 1, user_data))
 
1111
    return;
 
1112
  if (! _gimp_wire_write_string (channel,
 
1113
                                 &proc_install->copyright, 1, user_data))
 
1114
    return;
 
1115
  if (! _gimp_wire_write_string (channel,
 
1116
                                 &proc_install->date, 1, user_data))
 
1117
    return;
 
1118
  if (! _gimp_wire_write_string (channel,
 
1119
                                 &proc_install->menu_path, 1, user_data))
 
1120
    return;
 
1121
  if (! _gimp_wire_write_string (channel,
 
1122
                                 &proc_install->image_types, 1, user_data))
 
1123
    return;
 
1124
 
 
1125
  if (! _gimp_wire_write_int32 (channel,
 
1126
                                &proc_install->type, 1, user_data))
 
1127
    return;
 
1128
  if (! _gimp_wire_write_int32 (channel,
 
1129
                                &proc_install->nparams, 1, user_data))
 
1130
    return;
 
1131
  if (! _gimp_wire_write_int32 (channel,
 
1132
                                &proc_install->nreturn_vals, 1, user_data))
1053
1133
    return;
1054
1134
 
1055
1135
  for (i = 0; i < proc_install->nparams; i++)
1056
1136
    {
1057
 
      if (! wire_write_int32 (channel,
1058
 
                              (guint32*) &proc_install->params[i].type, 1,
1059
 
                              user_data))
1060
 
        return;
1061
 
      if (! wire_write_string (channel,
1062
 
                               &proc_install->params[i].name, 1,
1063
 
                               user_data))
1064
 
        return;
1065
 
      if (! wire_write_string (channel,
1066
 
                               &proc_install->params[i].description, 1,
1067
 
                               user_data))
1068
 
        return;
 
1137
      if (! _gimp_wire_write_int32 (channel,
 
1138
                                    (guint32 *) &proc_install->params[i].type, 1,
 
1139
                                    user_data))
 
1140
        return;
 
1141
      if (! _gimp_wire_write_string (channel,
 
1142
                                     &proc_install->params[i].name, 1,
 
1143
                                     user_data))
 
1144
        return;
 
1145
      if (! _gimp_wire_write_string (channel,
 
1146
                                     &proc_install->params[i].description, 1,
 
1147
                                     user_data))
 
1148
        return;
1069
1149
    }
1070
1150
 
1071
1151
  for (i = 0; i < proc_install->nreturn_vals; i++)
1072
1152
    {
1073
 
      if (! wire_write_int32 (channel,
1074
 
                              (guint32*) &proc_install->return_vals[i].type, 1,
1075
 
                              user_data))
1076
 
        return;
1077
 
      if (! wire_write_string (channel,
1078
 
                               &proc_install->return_vals[i].name, 1,
1079
 
                               user_data))
1080
 
        return;
1081
 
      if (! wire_write_string (channel,
1082
 
                               &proc_install->return_vals[i].description, 1,
1083
 
                               user_data))
1084
 
        return;
 
1153
      if (! _gimp_wire_write_int32 (channel,
 
1154
                                    (guint32 *) &proc_install->return_vals[i].type, 1,
 
1155
                                    user_data))
 
1156
        return;
 
1157
      if (! _gimp_wire_write_string (channel,
 
1158
                                     &proc_install->return_vals[i].name, 1,
 
1159
                                     user_data))
 
1160
        return;
 
1161
      if (! _gimp_wire_write_string (channel,
 
1162
                                     &proc_install->return_vals[i].description, 1,
 
1163
                                     user_data))
 
1164
        return;
1085
1165
    }
1086
1166
}
1087
1167
 
1088
1168
static void
1089
 
_gp_proc_install_destroy (WireMessage *msg)
 
1169
_gp_proc_install_destroy (GimpWireMessage *msg)
1090
1170
{
1091
 
  GPProcInstall *proc_install;
1092
 
  gint i;
1093
 
 
1094
 
  proc_install = msg->data;
 
1171
  GPProcInstall *proc_install = msg->data;
 
1172
  gint           i;
1095
1173
 
1096
1174
  g_free (proc_install->name);
1097
1175
  g_free (proc_install->blurb);
1122
1200
/*  proc_uninstall  */
1123
1201
 
1124
1202
static void
1125
 
_gp_proc_uninstall_read (GIOChannel  *channel,
1126
 
                         WireMessage *msg,
1127
 
                         gpointer     user_data)
 
1203
_gp_proc_uninstall_read (GIOChannel      *channel,
 
1204
                         GimpWireMessage *msg,
 
1205
                         gpointer         user_data)
1128
1206
{
1129
 
  GPProcUninstall *proc_uninstall;
1130
 
 
1131
 
  proc_uninstall = g_new0 (GPProcUninstall, 1);
1132
 
 
1133
 
  if (! wire_read_string (channel, &proc_uninstall->name, 1, user_data))
 
1207
  GPProcUninstall *proc_uninstall = g_new0 (GPProcUninstall, 1);
 
1208
 
 
1209
  if (! _gimp_wire_read_string (channel, &proc_uninstall->name, 1, user_data))
1134
1210
    goto cleanup;
1135
1211
 
1136
1212
  msg->data = proc_uninstall;
1141
1217
}
1142
1218
 
1143
1219
static void
1144
 
_gp_proc_uninstall_write (GIOChannel  *channel,
1145
 
                          WireMessage *msg,
1146
 
                          gpointer     user_data)
 
1220
_gp_proc_uninstall_write (GIOChannel      *channel,
 
1221
                          GimpWireMessage *msg,
 
1222
                          gpointer         user_data)
1147
1223
{
1148
 
  GPProcUninstall *proc_uninstall;
1149
 
 
1150
 
  proc_uninstall = msg->data;
1151
 
 
1152
 
  if (! wire_write_string (channel, &proc_uninstall->name, 1, user_data))
 
1224
  GPProcUninstall *proc_uninstall = msg->data;
 
1225
 
 
1226
  if (! _gimp_wire_write_string (channel, &proc_uninstall->name, 1, user_data))
1153
1227
    return;
1154
1228
}
1155
1229
 
1156
1230
static void
1157
 
_gp_proc_uninstall_destroy (WireMessage *msg)
 
1231
_gp_proc_uninstall_destroy (GimpWireMessage *msg)
1158
1232
{
1159
 
  GPProcUninstall *proc_uninstall;
1160
 
 
1161
 
  proc_uninstall = msg->data;
 
1233
  GPProcUninstall *proc_uninstall = msg->data;
1162
1234
 
1163
1235
  g_free (proc_uninstall->name);
1164
1236
  g_free (proc_uninstall);
1167
1239
/*  extension_ack  */
1168
1240
 
1169
1241
static void
1170
 
_gp_extension_ack_read (GIOChannel  *channel,
1171
 
                        WireMessage *msg,
1172
 
                        gpointer     user_data)
1173
 
{
1174
 
}
1175
 
 
1176
 
static void
1177
 
_gp_extension_ack_write (GIOChannel  *channel,
1178
 
                         WireMessage *msg,
1179
 
                         gpointer     user_data)
1180
 
{
1181
 
}
1182
 
 
1183
 
static void
1184
 
_gp_extension_ack_destroy (WireMessage *msg)
 
1242
_gp_extension_ack_read (GIOChannel      *channel,
 
1243
                        GimpWireMessage *msg,
 
1244
                        gpointer         user_data)
 
1245
{
 
1246
}
 
1247
 
 
1248
static void
 
1249
_gp_extension_ack_write (GIOChannel      *channel,
 
1250
                         GimpWireMessage *msg,
 
1251
                         gpointer         user_data)
 
1252
{
 
1253
}
 
1254
 
 
1255
static void
 
1256
_gp_extension_ack_destroy (GimpWireMessage *msg)
1185
1257
{
1186
1258
}
1187
1259
 
1189
1261
 
1190
1262
static void
1191
1263
_gp_params_read (GIOChannel  *channel,
1192
 
                 GPParam    **params,
1193
 
                 guint       *nparams,
 
1264
                 GPParam    **params,
 
1265
                 guint       *nparams,
1194
1266
                 gpointer     user_data)
1195
1267
{
1196
1268
  gint i, j;
1197
1269
 
1198
 
  if (! wire_read_int32 (channel, (guint32*) nparams, 1, user_data))
 
1270
  if (! _gimp_wire_read_int32 (channel, (guint32 *) nparams, 1, user_data))
1199
1271
    return;
1200
1272
 
1201
1273
  if (*nparams == 0)
1208
1280
 
1209
1281
  for (i = 0; i < *nparams; i++)
1210
1282
    {
1211
 
      if (! wire_read_int32 (channel,
1212
 
                             (guint32*) &(*params)[i].type, 1,
1213
 
                             user_data))
1214
 
        goto cleanup;
 
1283
      if (! _gimp_wire_read_int32 (channel,
 
1284
                                   (guint32 *) &(*params)[i].type, 1,
 
1285
                                   user_data))
 
1286
        goto cleanup;
1215
1287
 
1216
1288
      switch ((*params)[i].type)
1217
 
        {
1218
 
        case GIMP_PDB_INT32:
1219
 
          if (! wire_read_int32 (channel,
1220
 
                                 (guint32*) &(*params)[i].data.d_int32, 1,
1221
 
                                 user_data))
1222
 
            goto cleanup;
1223
 
          break;
1224
 
 
1225
 
        case GIMP_PDB_INT16:
1226
 
          if (! wire_read_int16 (channel,
1227
 
                                 (guint16*) &(*params)[i].data.d_int16, 1,
1228
 
                                 user_data))
1229
 
            goto cleanup;
1230
 
          break;
1231
 
 
1232
 
        case GIMP_PDB_INT8:
1233
 
          if (! wire_read_int8 (channel,
1234
 
                                (guint8*) &(*params)[i].data.d_int8, 1,
1235
 
                                user_data))
1236
 
            goto cleanup;
1237
 
          break;
 
1289
        {
 
1290
        case GIMP_PDB_INT32:
 
1291
          if (! _gimp_wire_read_int32 (channel,
 
1292
                                       (guint32 *) &(*params)[i].data.d_int32, 1,
 
1293
                                       user_data))
 
1294
            goto cleanup;
 
1295
          break;
 
1296
 
 
1297
        case GIMP_PDB_INT16:
 
1298
          if (! _gimp_wire_read_int16 (channel,
 
1299
                                       (guint16 *) &(*params)[i].data.d_int16, 1,
 
1300
                                       user_data))
 
1301
            goto cleanup;
 
1302
          break;
 
1303
 
 
1304
        case GIMP_PDB_INT8:
 
1305
          if (! _gimp_wire_read_int8 (channel,
 
1306
                                      &(*params)[i].data.d_int8, 1,
 
1307
                                      user_data))
 
1308
            goto cleanup;
 
1309
          break;
1238
1310
 
1239
1311
        case GIMP_PDB_FLOAT:
1240
 
          if (! wire_read_double (channel,
1241
 
                                  &(*params)[i].data.d_float, 1,
1242
 
                                  user_data))
1243
 
            goto cleanup;
 
1312
          if (! _gimp_wire_read_double (channel,
 
1313
                                        &(*params)[i].data.d_float, 1,
 
1314
                                        user_data))
 
1315
            goto cleanup;
1244
1316
          break;
1245
1317
 
1246
1318
        case GIMP_PDB_STRING:
1247
 
          if (! wire_read_string (channel,
1248
 
                                  &(*params)[i].data.d_string, 1,
1249
 
                                  user_data))
1250
 
            goto cleanup;
 
1319
          if (! _gimp_wire_read_string (channel,
 
1320
                                        &(*params)[i].data.d_string, 1,
 
1321
                                        user_data))
 
1322
            goto cleanup;
1251
1323
          break;
1252
1324
 
1253
1325
        case GIMP_PDB_INT32ARRAY:
1254
 
          (*params)[i-1].data.d_int32 = MAX(0, (*params)[i-1].data.d_int32);
1255
 
          (*params)[i].data.d_int32array =
1256
 
            g_new (gint32, (*params)[i-1].data.d_int32);
1257
 
          if (! wire_read_int32 (channel,
1258
 
                                 (guint32*) (*params)[i].data.d_int32array,
1259
 
                                 (*params)[i-1].data.d_int32,
1260
 
                                 user_data))
1261
 
            {
1262
 
              g_free ((*params)[i].data.d_int32array);
1263
 
              goto cleanup;
1264
 
            }
 
1326
          (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
 
1327
          (*params)[i].data.d_int32array = g_new (gint32,
 
1328
                                                  (*params)[i-1].data.d_int32);
 
1329
 
 
1330
          if (! _gimp_wire_read_int32 (channel,
 
1331
                                       (guint32 *) (*params)[i].data.d_int32array,
 
1332
                                       (*params)[i-1].data.d_int32,
 
1333
                                       user_data))
 
1334
            {
 
1335
              g_free ((*params)[i].data.d_int32array);
 
1336
              goto cleanup;
 
1337
            }
1265
1338
          break;
1266
1339
 
1267
1340
        case GIMP_PDB_INT16ARRAY:
1268
 
          (*params)[i-1].data.d_int32 = MAX(0, (*params)[i-1].data.d_int32);
1269
 
          (*params)[i].data.d_int16array =
1270
 
            g_new (gint16, (*params)[i-1].data.d_int32);
1271
 
          if (! wire_read_int16 (channel,
1272
 
                                 (guint16*) (*params)[i].data.d_int16array,
1273
 
                                 (*params)[i-1].data.d_int32,
1274
 
                                 user_data))
1275
 
            {
1276
 
              g_free ((*params)[i].data.d_int16array);
1277
 
              goto cleanup;
1278
 
            }
 
1341
          (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
 
1342
          (*params)[i].data.d_int16array = g_new (gint16,
 
1343
                                                  (*params)[i-1].data.d_int32);
 
1344
          if (! _gimp_wire_read_int16 (channel,
 
1345
                                       (guint16 *) (*params)[i].data.d_int16array,
 
1346
                                       (*params)[i-1].data.d_int32,
 
1347
                                       user_data))
 
1348
            {
 
1349
              g_free ((*params)[i].data.d_int16array);
 
1350
              goto cleanup;
 
1351
            }
1279
1352
          break;
1280
1353
 
1281
1354
        case GIMP_PDB_INT8ARRAY:
1282
 
          (*params)[i-1].data.d_int32 = MAX(0, (*params)[i-1].data.d_int32);
1283
 
          (*params)[i].data.d_int8array =
1284
 
            g_new (gint8, (*params)[i-1].data.d_int32);
1285
 
          if (! wire_read_int8 (channel,
1286
 
                                (guint8*) (*params)[i].data.d_int8array,
1287
 
                                (*params)[i-1].data.d_int32,
1288
 
                                user_data))
1289
 
            {
1290
 
              g_free ((*params)[i].data.d_int8array);
1291
 
              goto cleanup;
1292
 
            }
 
1355
          (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
 
1356
          (*params)[i].data.d_int8array = g_new (guint8,
 
1357
                                                 (*params)[i-1].data.d_int32);
 
1358
          if (! _gimp_wire_read_int8 (channel,
 
1359
                                      (*params)[i].data.d_int8array,
 
1360
                                      (*params)[i-1].data.d_int32,
 
1361
                                      user_data))
 
1362
            {
 
1363
              g_free ((*params)[i].data.d_int8array);
 
1364
              goto cleanup;
 
1365
            }
1293
1366
          break;
1294
1367
 
1295
1368
        case GIMP_PDB_FLOATARRAY:
1296
 
          (*params)[i-1].data.d_int32 = MAX(0, (*params)[i-1].data.d_int32);
1297
 
          (*params)[i].data.d_floatarray =
1298
 
            g_new (gdouble, (*params)[i-1].data.d_int32);
1299
 
          if (! wire_read_double (channel,
1300
 
                                  (*params)[i].data.d_floatarray,
1301
 
                                  (*params)[i-1].data.d_int32,
1302
 
                                  user_data))
1303
 
            {
1304
 
              g_free ((*params)[i].data.d_floatarray);
1305
 
              goto cleanup;
1306
 
            }
 
1369
          (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
 
1370
          (*params)[i].data.d_floatarray = g_new (gdouble,
 
1371
                                                  (*params)[i-1].data.d_int32);
 
1372
          if (! _gimp_wire_read_double (channel,
 
1373
                                        (*params)[i].data.d_floatarray,
 
1374
                                        (*params)[i-1].data.d_int32,
 
1375
                                        user_data))
 
1376
            {
 
1377
              g_free ((*params)[i].data.d_floatarray);
 
1378
              goto cleanup;
 
1379
            }
1307
1380
          break;
1308
1381
 
1309
1382
        case GIMP_PDB_STRINGARRAY:
1310
 
          (*params)[i-1].data.d_int32 = MAX(0, (*params)[i-1].data.d_int32);
1311
 
          (*params)[i].data.d_stringarray =
1312
 
            g_new0 (gchar*, (*params)[i-1].data.d_int32);
1313
 
          if (! wire_read_string (channel,
1314
 
                                  (*params)[i].data.d_stringarray,
1315
 
                                  (*params)[i-1].data.d_int32,
1316
 
                                  user_data))
1317
 
            {
1318
 
              for (j = 0; j < (*params)[i-1].data.d_int32; j++)
1319
 
                g_free (((*params)[i].data.d_stringarray)[j]);
1320
 
              g_free ((*params)[i].data.d_stringarray);
1321
 
              goto cleanup;
1322
 
            }
 
1383
          (*params)[i-1].data.d_int32 = MAX (0, (*params)[i-1].data.d_int32);
 
1384
          (*params)[i].data.d_stringarray = g_new0 (gchar *,
 
1385
                                                    (*params)[i-1].data.d_int32);
 
1386
          if (! _gimp_wire_read_string (channel,
 
1387
                                        (*params)[i].data.d_stringarray,
 
1388
                                        (*params)[i-1].data.d_int32,
 
1389
                                        user_data))
 
1390
            {
 
1391
              for (j = 0; j < (*params)[i-1].data.d_int32; j++)
 
1392
                g_free (((*params)[i].data.d_stringarray)[j]);
 
1393
              g_free ((*params)[i].data.d_stringarray);
 
1394
              goto cleanup;
 
1395
            }
1323
1396
          break;
1324
1397
 
1325
1398
        case GIMP_PDB_COLOR:
1326
 
          if (! wire_read_double (channel,
1327
 
                                  &(*params)[i].data.d_color.r, 1,
1328
 
                                  user_data))
1329
 
            goto cleanup;
1330
 
          if (! wire_read_double (channel,
1331
 
                                  &(*params)[i].data.d_color.g, 1,
1332
 
                                  user_data))
1333
 
            goto cleanup;
1334
 
          if (! wire_read_double (channel,
1335
 
                                  &(*params)[i].data.d_color.b, 1,
1336
 
                                  user_data))
1337
 
            goto cleanup;
1338
 
          if (! wire_read_double (channel,
1339
 
                                  &(*params)[i].data.d_color.a, 1,
1340
 
                                  user_data))
1341
 
            goto cleanup;
1342
 
          break;
 
1399
          if (! _gimp_wire_read_color (channel,
 
1400
                                       &(*params)[i].data.d_color, 1,
 
1401
                                       user_data))
 
1402
            goto cleanup;
 
1403
          break;
1343
1404
 
1344
1405
        case GIMP_PDB_REGION:
1345
1406
          break;
1346
1407
 
1347
1408
        case GIMP_PDB_DISPLAY:
1348
 
          if (! wire_read_int32 (channel,
1349
 
                                 (guint32*) &(*params)[i].data.d_display, 1,
1350
 
                                 user_data))
1351
 
            goto cleanup;
 
1409
          if (! _gimp_wire_read_int32 (channel,
 
1410
                                       (guint32 *) &(*params)[i].data.d_display, 1,
 
1411
                                       user_data))
 
1412
            goto cleanup;
1352
1413
          break;
1353
1414
 
1354
1415
        case GIMP_PDB_IMAGE:
1355
 
          if (! wire_read_int32 (channel,
1356
 
                                 (guint32*) &(*params)[i].data.d_image, 1,
1357
 
                                 user_data))
1358
 
            goto cleanup;
 
1416
          if (! _gimp_wire_read_int32 (channel,
 
1417
                                       (guint32 *) &(*params)[i].data.d_image, 1,
 
1418
                                       user_data))
 
1419
            goto cleanup;
1359
1420
          break;
1360
1421
 
1361
1422
        case GIMP_PDB_LAYER:
1362
 
          if (! wire_read_int32 (channel,
1363
 
                                 (guint32*) &(*params)[i].data.d_layer, 1,
1364
 
                                 user_data))
1365
 
            goto cleanup;
 
1423
          if (! _gimp_wire_read_int32 (channel,
 
1424
                                       (guint32 *) &(*params)[i].data.d_layer, 1,
 
1425
                                       user_data))
 
1426
            goto cleanup;
1366
1427
          break;
1367
1428
 
1368
1429
        case GIMP_PDB_CHANNEL:
1369
 
          if (! wire_read_int32 (channel,
1370
 
                                 (guint32*) &(*params)[i].data.d_channel, 1,
1371
 
                                 user_data))
1372
 
            goto cleanup;
 
1430
          if (! _gimp_wire_read_int32 (channel,
 
1431
                                       (guint32 *) &(*params)[i].data.d_channel, 1,
 
1432
                                       user_data))
 
1433
            goto cleanup;
1373
1434
          break;
1374
1435
 
1375
1436
        case GIMP_PDB_DRAWABLE:
1376
 
          if (! wire_read_int32 (channel,
1377
 
                                 (guint32*) &(*params)[i].data.d_drawable, 1,
1378
 
                                 user_data))
1379
 
            goto cleanup;
 
1437
          if (! _gimp_wire_read_int32 (channel,
 
1438
                                       (guint32 *) &(*params)[i].data.d_drawable, 1,
 
1439
                                       user_data))
 
1440
            goto cleanup;
1380
1441
          break;
1381
1442
 
1382
1443
        case GIMP_PDB_SELECTION:
1383
 
          if (! wire_read_int32 (channel,
1384
 
                                 (guint32*) &(*params)[i].data.d_selection, 1,
1385
 
                                 user_data))
1386
 
            goto cleanup;
 
1444
          if (! _gimp_wire_read_int32 (channel,
 
1445
                                       (guint32 *) &(*params)[i].data.d_selection, 1,
 
1446
                                       user_data))
 
1447
            goto cleanup;
1387
1448
          break;
1388
1449
 
1389
1450
        case GIMP_PDB_BOUNDARY:
1390
 
          if (! wire_read_int32 (channel,
1391
 
                                 (guint32*) &(*params)[i].data.d_boundary, 1,
1392
 
                                 user_data))
1393
 
            goto cleanup;
 
1451
          if (! _gimp_wire_read_int32 (channel,
 
1452
                                       (guint32 *) &(*params)[i].data.d_boundary, 1,
 
1453
                                       user_data))
 
1454
            goto cleanup;
1394
1455
          break;
1395
1456
 
1396
 
        case GIMP_PDB_PATH:
1397
 
          if (! wire_read_int32 (channel,
1398
 
                                 (guint32*) &(*params)[i].data.d_path, 1,
1399
 
                                 user_data))
1400
 
            goto cleanup;
 
1457
        case GIMP_PDB_VECTORS:
 
1458
          if (! _gimp_wire_read_int32 (channel,
 
1459
                                       (guint32 *) &(*params)[i].data.d_vectors, 1,
 
1460
                                       user_data))
 
1461
            goto cleanup;
1401
1462
          break;
1402
1463
 
1403
1464
        case GIMP_PDB_PARASITE:
1404
 
          if (! wire_read_string (channel,
1405
 
                                  &(*params)[i].data.d_parasite.name, 1,
1406
 
                                  user_data))
1407
 
            goto cleanup;
1408
 
          if ((*params)[i].data.d_parasite.name == NULL)
1409
 
            {
1410
 
              /* we have a null parasite */
1411
 
              (*params)[i].data.d_parasite.data = NULL;
1412
 
              break;
1413
 
            }
1414
 
          if (! wire_read_int32 (channel,
1415
 
                                 &((*params)[i].data.d_parasite.flags), 1,
1416
 
                                 user_data))
1417
 
            goto cleanup;
1418
 
          if (! wire_read_int32 (channel,
1419
 
                                 &((*params)[i].data.d_parasite.size), 1,
1420
 
                                 user_data))
1421
 
            goto cleanup;
1422
 
          if ((*params)[i].data.d_parasite.size > 0)
1423
 
            {
1424
 
              (*params)[i].data.d_parasite.data = g_malloc ((*params)[i].data.d_parasite.size);
1425
 
              if (! wire_read_int8 (channel,
1426
 
                                    (*params)[i].data.d_parasite.data,
1427
 
                                    (*params)[i].data.d_parasite.size,
1428
 
                                    user_data))
1429
 
                {
1430
 
                  g_free ((*params)[i].data.d_parasite.data);
1431
 
                  goto cleanup;
1432
 
                }
1433
 
            }
1434
 
          else
1435
 
            (*params)[i].data.d_parasite.data = NULL;
1436
 
          break;
 
1465
          if (! _gimp_wire_read_string (channel,
 
1466
                                        &(*params)[i].data.d_parasite.name, 1,
 
1467
                                        user_data))
 
1468
            goto cleanup;
 
1469
          if ((*params)[i].data.d_parasite.name == NULL)
 
1470
            {
 
1471
              /* we have a null parasite */
 
1472
              (*params)[i].data.d_parasite.data = NULL;
 
1473
              break;
 
1474
            }
 
1475
          if (! _gimp_wire_read_int32 (channel,
 
1476
                                       &((*params)[i].data.d_parasite.flags), 1,
 
1477
                                       user_data))
 
1478
            goto cleanup;
 
1479
          if (! _gimp_wire_read_int32 (channel,
 
1480
                                       &((*params)[i].data.d_parasite.size), 1,
 
1481
                                       user_data))
 
1482
            goto cleanup;
 
1483
          if ((*params)[i].data.d_parasite.size > 0)
 
1484
            {
 
1485
              (*params)[i].data.d_parasite.data =
 
1486
                g_malloc ((*params)[i].data.d_parasite.size);
 
1487
              if (! _gimp_wire_read_int8 (channel,
 
1488
                                          (*params)[i].data.d_parasite.data,
 
1489
                                          (*params)[i].data.d_parasite.size,
 
1490
                                          user_data))
 
1491
                {
 
1492
                  g_free ((*params)[i].data.d_parasite.data);
 
1493
                  goto cleanup;
 
1494
                }
 
1495
            }
 
1496
          else
 
1497
            (*params)[i].data.d_parasite.data = NULL;
 
1498
          break;
1437
1499
 
1438
1500
        case GIMP_PDB_STATUS:
1439
 
          if (! wire_read_int32 (channel,
1440
 
                                 (guint32*) &(*params)[i].data.d_status, 1,
1441
 
                                 user_data))
1442
 
            goto cleanup;
 
1501
          if (! _gimp_wire_read_int32 (channel,
 
1502
                                       (guint32 *) &(*params)[i].data.d_status, 1,
 
1503
                                       user_data))
 
1504
            goto cleanup;
1443
1505
          break;
1444
1506
 
1445
 
        case GIMP_PDB_END:
1446
 
          break;
1447
 
        }
 
1507
        case GIMP_PDB_END:
 
1508
          break;
 
1509
        }
1448
1510
    }
1449
1511
 
1450
1512
  return;
1457
1519
 
1458
1520
static void
1459
1521
_gp_params_write (GIOChannel *channel,
1460
 
                  GPParam    *params,
1461
 
                  gint        nparams,
 
1522
                  GPParam    *params,
 
1523
                  gint        nparams,
1462
1524
                  gpointer    user_data)
1463
1525
{
1464
1526
  gint i;
1465
1527
 
1466
 
  if (! wire_write_int32 (channel, (guint32*) &nparams, 1, user_data))
 
1528
  if (! _gimp_wire_write_int32 (channel,
 
1529
                                (const guint32 *) &nparams, 1, user_data))
1467
1530
    return;
1468
1531
 
1469
1532
  for (i = 0; i < nparams; i++)
1470
1533
    {
1471
 
      if (! wire_write_int32 (channel,
1472
 
                              (guint32*) &params[i].type, 1,
1473
 
                              user_data))
1474
 
        return;
 
1534
      if (! _gimp_wire_write_int32 (channel,
 
1535
                                    (const guint32 *) &params[i].type, 1,
 
1536
                                    user_data))
 
1537
        return;
1475
1538
 
1476
1539
      switch (params[i].type)
1477
 
        {
1478
 
        case GIMP_PDB_INT32:
1479
 
          if (! wire_write_int32 (channel,
1480
 
                                  (guint32*) &params[i].data.d_int32, 1,
1481
 
                                  user_data))
1482
 
            return;
1483
 
          break;
1484
 
 
1485
 
        case GIMP_PDB_INT16:
1486
 
          if (! wire_write_int16 (channel,
1487
 
                                  (guint16*) &params[i].data.d_int16, 1,
1488
 
                                  user_data))
1489
 
            return;
1490
 
          break;
1491
 
 
1492
 
        case GIMP_PDB_INT8:
1493
 
          if (! wire_write_int8 (channel,
1494
 
                                 (guint8*) &params[i].data.d_int8, 1,
1495
 
                                 user_data))
1496
 
            return;
1497
 
          break;
 
1540
        {
 
1541
        case GIMP_PDB_INT32:
 
1542
          if (! _gimp_wire_write_int32 (channel,
 
1543
                                        (const guint32 *) &params[i].data.d_int32, 1,
 
1544
                                        user_data))
 
1545
            return;
 
1546
          break;
 
1547
 
 
1548
        case GIMP_PDB_INT16:
 
1549
          if (! _gimp_wire_write_int16 (channel,
 
1550
                                        (const guint16 *) &params[i].data.d_int16, 1,
 
1551
                                        user_data))
 
1552
            return;
 
1553
          break;
 
1554
 
 
1555
        case GIMP_PDB_INT8:
 
1556
          if (! _gimp_wire_write_int8 (channel,
 
1557
                                       (const guint8 *) &params[i].data.d_int8, 1,
 
1558
                                       user_data))
 
1559
            return;
 
1560
          break;
1498
1561
 
1499
1562
        case GIMP_PDB_FLOAT:
1500
 
          if (! wire_write_double (channel,
1501
 
                                   &params[i].data.d_float, 1,
1502
 
                                   user_data))
1503
 
            return;
 
1563
          if (! _gimp_wire_write_double (channel,
 
1564
                                         &params[i].data.d_float, 1,
 
1565
                                         user_data))
 
1566
            return;
1504
1567
          break;
1505
1568
 
1506
1569
        case GIMP_PDB_STRING:
1507
 
          if (! wire_write_string (channel,
1508
 
                                   &params[i].data.d_string, 1,
1509
 
                                   user_data))
1510
 
            return;
 
1570
          if (! _gimp_wire_write_string (channel,
 
1571
                                         &params[i].data.d_string, 1,
 
1572
                                         user_data))
 
1573
            return;
1511
1574
          break;
1512
1575
 
1513
1576
        case GIMP_PDB_INT32ARRAY:
1514
 
          if (! wire_write_int32 (channel,
1515
 
                                  (guint32*) params[i].data.d_int32array,
1516
 
                                  params[i-1].data.d_int32,
1517
 
                                  user_data))
1518
 
            return;
 
1577
          if (! _gimp_wire_write_int32 (channel,
 
1578
                                        (const guint32 *) params[i].data.d_int32array,
 
1579
                                        params[i-1].data.d_int32,
 
1580
                                        user_data))
 
1581
            return;
1519
1582
          break;
1520
1583
 
1521
1584
        case GIMP_PDB_INT16ARRAY:
1522
 
          if (! wire_write_int16 (channel,
1523
 
                                  (guint16*) params[i].data.d_int16array,
1524
 
                                  params[i-1].data.d_int32,
1525
 
                                  user_data))
1526
 
            return;
 
1585
          if (! _gimp_wire_write_int16 (channel,
 
1586
                                        (const guint16 *) params[i].data.d_int16array,
 
1587
                                        params[i-1].data.d_int32,
 
1588
                                        user_data))
 
1589
            return;
1527
1590
          break;
1528
1591
 
1529
1592
        case GIMP_PDB_INT8ARRAY:
1530
 
          if (! wire_write_int8 (channel,
1531
 
                                 (guint8*) params[i].data.d_int8array,
1532
 
                                 params[i-1].data.d_int32,
1533
 
                                 user_data))
1534
 
            return;
 
1593
          if (! _gimp_wire_write_int8 (channel,
 
1594
                                       (const guint8 *) params[i].data.d_int8array,
 
1595
                                       params[i-1].data.d_int32,
 
1596
                                       user_data))
 
1597
            return;
1535
1598
          break;
1536
1599
 
1537
1600
        case GIMP_PDB_FLOATARRAY:
1538
 
          if (! wire_write_double (channel,
1539
 
                                   params[i].data.d_floatarray,
1540
 
                                   params[i-1].data.d_int32,
1541
 
                                   user_data))
1542
 
            return;
 
1601
          if (! _gimp_wire_write_double (channel,
 
1602
                                         params[i].data.d_floatarray,
 
1603
                                         params[i-1].data.d_int32,
 
1604
                                         user_data))
 
1605
            return;
1543
1606
          break;
1544
1607
 
1545
1608
        case GIMP_PDB_STRINGARRAY:
1546
 
          if (! wire_write_string (channel,
1547
 
                                   params[i].data.d_stringarray,
1548
 
                                   params[i-1].data.d_int32,
1549
 
                                   user_data))
1550
 
            return;
 
1609
          if (! _gimp_wire_write_string (channel,
 
1610
                                         params[i].data.d_stringarray,
 
1611
                                         params[i-1].data.d_int32,
 
1612
                                         user_data))
 
1613
            return;
1551
1614
          break;
1552
1615
 
1553
1616
        case GIMP_PDB_COLOR:
1554
 
          {
1555
 
            GimpRGB *color = (GimpRGB *) &params[i].data.d_color;
1556
 
            if (! wire_write_double (channel, &color->r, 1, user_data))
1557
 
              return;
1558
 
            if (! wire_write_double (channel, &color->g, 1, user_data))
1559
 
              return;
1560
 
            if (! wire_write_double (channel, &color->b, 1, user_data))
1561
 
              return;
1562
 
            if (! wire_write_double (channel, &color->a, 1, user_data))
1563
 
              return;
1564
 
          }
 
1617
          if (! _gimp_wire_write_color (channel,
 
1618
                                        &params[i].data.d_color, 1, user_data))
 
1619
            return;
1565
1620
          break;
1566
1621
 
1567
1622
        case GIMP_PDB_REGION:
1568
1623
          break;
1569
1624
 
1570
1625
        case GIMP_PDB_DISPLAY:
1571
 
          if (! wire_write_int32 (channel,
1572
 
                                  (guint32*) &params[i].data.d_display, 1,
1573
 
                                  user_data))
1574
 
            return;
 
1626
          if (! _gimp_wire_write_int32 (channel,
 
1627
                                        (const guint32 *) &params[i].data.d_display, 1,
 
1628
                                        user_data))
 
1629
            return;
1575
1630
          break;
1576
1631
 
1577
1632
        case GIMP_PDB_IMAGE:
1578
 
          if (! wire_write_int32 (channel,
1579
 
                                  (guint32*) &params[i].data.d_image, 1,
1580
 
                                  user_data))
1581
 
            return;
 
1633
          if (! _gimp_wire_write_int32 (channel,
 
1634
                                        (const guint32 *) &params[i].data.d_image, 1,
 
1635
                                        user_data))
 
1636
            return;
1582
1637
          break;
1583
1638
 
1584
1639
        case GIMP_PDB_LAYER:
1585
 
          if (! wire_write_int32 (channel,
1586
 
                                  (guint32*) &params[i].data.d_layer, 1,
1587
 
                                  user_data))
1588
 
            return;
 
1640
          if (! _gimp_wire_write_int32 (channel,
 
1641
                                        (const guint32 *) &params[i].data.d_layer, 1,
 
1642
                                        user_data))
 
1643
            return;
1589
1644
          break;
1590
1645
 
1591
1646
        case GIMP_PDB_CHANNEL:
1592
 
          if (! wire_write_int32 (channel,
1593
 
                                  (guint32*) &params[i].data.d_channel, 1,
1594
 
                                  user_data))
1595
 
            return;
 
1647
          if (! _gimp_wire_write_int32 (channel,
 
1648
                                        (const guint32 *) &params[i].data.d_channel, 1,
 
1649
                                        user_data))
 
1650
            return;
1596
1651
          break;
1597
1652
 
1598
1653
        case GIMP_PDB_DRAWABLE:
1599
 
          if (! wire_write_int32 (channel,
1600
 
                                  (guint32*) &params[i].data.d_drawable, 1,
1601
 
                                  user_data))
1602
 
            return;
 
1654
          if (! _gimp_wire_write_int32 (channel,
 
1655
                                        (const guint32 *) &params[i].data.d_drawable, 1,
 
1656
                                        user_data))
 
1657
            return;
1603
1658
          break;
1604
1659
 
1605
1660
        case GIMP_PDB_SELECTION:
1606
 
          if (! wire_write_int32 (channel,
1607
 
                                  (guint32*) &params[i].data.d_selection, 1,
1608
 
                                  user_data))
1609
 
            return;
 
1661
          if (! _gimp_wire_write_int32 (channel,
 
1662
                                        (const guint32 *) &params[i].data.d_selection, 1,
 
1663
                                        user_data))
 
1664
            return;
1610
1665
          break;
1611
1666
 
1612
1667
        case GIMP_PDB_BOUNDARY:
1613
 
          if (! wire_write_int32 (channel,
1614
 
                                  (guint32*) &params[i].data.d_boundary, 1,
1615
 
                                  user_data))
1616
 
            return;
 
1668
          if (! _gimp_wire_write_int32 (channel,
 
1669
                                        (const guint32 *) &params[i].data.d_boundary, 1,
 
1670
                                        user_data))
 
1671
            return;
1617
1672
          break;
1618
1673
 
1619
 
        case GIMP_PDB_PATH:
1620
 
          if (! wire_write_int32 (channel,
1621
 
                                  (guint32*) &params[i].data.d_path, 1,
1622
 
                                  user_data))
1623
 
            return;
 
1674
        case GIMP_PDB_VECTORS:
 
1675
          if (! _gimp_wire_write_int32 (channel,
 
1676
                                        (const guint32 *) &params[i].data.d_vectors, 1,
 
1677
                                        user_data))
 
1678
            return;
1624
1679
          break;
1625
1680
 
1626
1681
        case GIMP_PDB_PARASITE:
1627
 
          {
1628
 
            GimpParasite *p = (GimpParasite *) &params[i].data.d_parasite;
1629
 
            if (p->name == NULL)
1630
 
              {
1631
 
                /* write a null string to signifly a null parasite */
1632
 
                wire_write_string (channel,  &p->name, 1, user_data);
1633
 
                break;
1634
 
              }
1635
 
            if (! wire_write_string (channel, &p->name, 1, user_data))
1636
 
              return;
1637
 
            if (! wire_write_int32 (channel, &p->flags, 1, user_data))
1638
 
              return;
1639
 
            if (! wire_write_int32 (channel, &p->size, 1, user_data))
1640
 
              return;
1641
 
            if (p->size > 0)
1642
 
              {
1643
 
                if (! wire_write_int8 (channel, p->data, p->size, user_data))
1644
 
                  return;
1645
 
              }
1646
 
          }
1647
 
          break;
 
1682
          {
 
1683
            GimpParasite *p = &params[i].data.d_parasite;
 
1684
 
 
1685
            if (p->name == NULL)
 
1686
              {
 
1687
                /* write a null string to signal a null parasite */
 
1688
                _gimp_wire_write_string (channel,  &p->name, 1, user_data);
 
1689
                break;
 
1690
              }
 
1691
 
 
1692
            if (! _gimp_wire_write_string (channel, &p->name, 1, user_data))
 
1693
              return;
 
1694
            if (! _gimp_wire_write_int32 (channel, &p->flags, 1, user_data))
 
1695
              return;
 
1696
            if (! _gimp_wire_write_int32 (channel, &p->size, 1, user_data))
 
1697
              return;
 
1698
            if (p->size > 0)
 
1699
              {
 
1700
                if (! _gimp_wire_write_int8 (channel,
 
1701
                                             p->data, p->size, user_data))
 
1702
                  return;
 
1703
              }
 
1704
          }
 
1705
          break;
1648
1706
 
1649
1707
        case GIMP_PDB_STATUS:
1650
 
          if (! wire_write_int32 (channel,
1651
 
                                  (guint32*) &params[i].data.d_status, 1,
1652
 
                                  user_data))
1653
 
            return;
 
1708
          if (! _gimp_wire_write_int32 (channel,
 
1709
                                        (const guint32 *) &params[i].data.d_status, 1,
 
1710
                                        user_data))
 
1711
            return;
1654
1712
          break;
1655
1713
 
1656
 
        case GIMP_PDB_END:
1657
 
          break;
1658
 
        }
 
1714
        case GIMP_PDB_END:
 
1715
          break;
 
1716
        }
1659
1717
    }
1660
1718
}
1661
1719
 
1662
1720
void
1663
 
_gp_params_destroy (GPParam *params,
1664
 
                    gint     nparams)
 
1721
gp_params_destroy (GPParam *params,
 
1722
                   gint     nparams)
1665
1723
{
1666
 
  gint count;
1667
 
  gint i, j;
 
1724
  gint i;
1668
1725
 
1669
1726
  for (i = 0; i < nparams; i++)
1670
1727
    {
1671
1728
      switch (params[i].type)
1672
 
        {
1673
 
        case GIMP_PDB_INT32:
1674
 
        case GIMP_PDB_INT16:
1675
 
        case GIMP_PDB_INT8:
1676
 
        case GIMP_PDB_FLOAT:
1677
 
        case GIMP_PDB_COLOR:
1678
 
        case GIMP_PDB_REGION:
1679
 
        case GIMP_PDB_DISPLAY:
1680
 
        case GIMP_PDB_IMAGE:
1681
 
        case GIMP_PDB_LAYER:
1682
 
        case GIMP_PDB_CHANNEL:
1683
 
        case GIMP_PDB_DRAWABLE:
1684
 
        case GIMP_PDB_SELECTION:
1685
 
        case GIMP_PDB_BOUNDARY:
1686
 
        case GIMP_PDB_PATH:
1687
 
        case GIMP_PDB_STATUS:
1688
 
          break;
1689
 
 
1690
 
        case GIMP_PDB_STRING:
1691
 
          g_free (params[i].data.d_string);
1692
 
          break;
1693
 
 
1694
 
        case GIMP_PDB_INT32ARRAY:
1695
 
          g_free (params[i].data.d_int32array);
1696
 
          break;
1697
 
 
1698
 
        case GIMP_PDB_INT16ARRAY:
1699
 
          g_free (params[i].data.d_int16array);
1700
 
          break;
1701
 
 
1702
 
        case GIMP_PDB_INT8ARRAY:
1703
 
          g_free (params[i].data.d_int8array);
1704
 
          break;
1705
 
 
1706
 
        case GIMP_PDB_FLOATARRAY:
1707
 
          g_free (params[i].data.d_floatarray);
1708
 
          break;
1709
 
 
1710
 
        case GIMP_PDB_STRINGARRAY:
1711
 
          if ((i > 0) && (params[i-1].type == GIMP_PDB_INT32))
1712
 
            {
1713
 
              count = params[i-1].data.d_int32;
1714
 
              for (j = 0; j < count; j++)
1715
 
                g_free (params[i].data.d_stringarray[j]);
1716
 
              g_free (params[i].data.d_stringarray);
1717
 
            }
1718
 
          break;
1719
 
 
1720
 
        case GIMP_PDB_PARASITE:
1721
 
          if (params[i].data.d_parasite.name)
1722
 
            g_free(params[i].data.d_parasite.name);
1723
 
          if (params[i].data.d_parasite.data)
1724
 
            g_free(params[i].data.d_parasite.data);
1725
 
          break;
1726
 
 
1727
 
        case GIMP_PDB_END:
1728
 
          break;
1729
 
        }
 
1729
        {
 
1730
        case GIMP_PDB_INT32:
 
1731
        case GIMP_PDB_INT16:
 
1732
        case GIMP_PDB_INT8:
 
1733
        case GIMP_PDB_FLOAT:
 
1734
        case GIMP_PDB_COLOR:
 
1735
        case GIMP_PDB_REGION:
 
1736
        case GIMP_PDB_DISPLAY:
 
1737
        case GIMP_PDB_IMAGE:
 
1738
        case GIMP_PDB_LAYER:
 
1739
        case GIMP_PDB_CHANNEL:
 
1740
        case GIMP_PDB_DRAWABLE:
 
1741
        case GIMP_PDB_SELECTION:
 
1742
        case GIMP_PDB_BOUNDARY:
 
1743
        case GIMP_PDB_VECTORS:
 
1744
        case GIMP_PDB_STATUS:
 
1745
          break;
 
1746
 
 
1747
        case GIMP_PDB_STRING:
 
1748
          g_free (params[i].data.d_string);
 
1749
          break;
 
1750
 
 
1751
        case GIMP_PDB_INT32ARRAY:
 
1752
          g_free (params[i].data.d_int32array);
 
1753
          break;
 
1754
 
 
1755
        case GIMP_PDB_INT16ARRAY:
 
1756
          g_free (params[i].data.d_int16array);
 
1757
          break;
 
1758
 
 
1759
        case GIMP_PDB_INT8ARRAY:
 
1760
          g_free (params[i].data.d_int8array);
 
1761
          break;
 
1762
 
 
1763
        case GIMP_PDB_FLOATARRAY:
 
1764
          g_free (params[i].data.d_floatarray);
 
1765
          break;
 
1766
 
 
1767
        case GIMP_PDB_STRINGARRAY:
 
1768
          if ((i > 0) && (params[i-1].type == GIMP_PDB_INT32))
 
1769
            {
 
1770
              gint count = params[i-1].data.d_int32;
 
1771
              gint j;
 
1772
 
 
1773
              for (j = 0; j < count; j++)
 
1774
                g_free (params[i].data.d_stringarray[j]);
 
1775
 
 
1776
              g_free (params[i].data.d_stringarray);
 
1777
            }
 
1778
          break;
 
1779
 
 
1780
        case GIMP_PDB_PARASITE:
 
1781
          if (params[i].data.d_parasite.name)
 
1782
            g_free(params[i].data.d_parasite.name);
 
1783
          if (params[i].data.d_parasite.data)
 
1784
            g_free(params[i].data.d_parasite.data);
 
1785
          break;
 
1786
 
 
1787
        case GIMP_PDB_END:
 
1788
          break;
 
1789
        }
1730
1790
    }
1731
1791
 
1732
1792
  g_free (params);
1735
1795
/* has_init */
1736
1796
 
1737
1797
static void
1738
 
_gp_has_init_read (GIOChannel  *channel,
1739
 
                   WireMessage *msg,
1740
 
                   gpointer     user_data)
1741
 
{
1742
 
}
1743
 
 
1744
 
static void
1745
 
_gp_has_init_write (GIOChannel  *channel,
1746
 
                    WireMessage *msg,
1747
 
                    gpointer     user_data)
1748
 
{
1749
 
}
1750
 
 
1751
 
static void
1752
 
_gp_has_init_destroy (WireMessage *msg)
1753
 
{
1754
 
}
1755
 
 
 
1798
_gp_has_init_read (GIOChannel      *channel,
 
1799
                   GimpWireMessage *msg,
 
1800
                   gpointer         user_data)
 
1801
{
 
1802
}
 
1803
 
 
1804
static void
 
1805
_gp_has_init_write (GIOChannel      *channel,
 
1806
                         GimpWireMessage *msg,
 
1807
                    gpointer         user_data)
 
1808
{
 
1809
}
 
1810
 
 
1811
static void
 
1812
_gp_has_init_destroy (GimpWireMessage *msg)
 
1813
{
 
1814
}