28
28
#include "gimpwire.h"
31
static void _gp_quit_read (GIOChannel *channel,
34
static void _gp_quit_write (GIOChannel *channel,
37
static void _gp_quit_destroy (WireMessage *msg);
39
static void _gp_config_read (GIOChannel *channel,
42
static void _gp_config_write (GIOChannel *channel,
45
static void _gp_config_destroy (WireMessage *msg);
47
static void _gp_tile_req_read (GIOChannel *channel,
50
static void _gp_tile_req_write (GIOChannel *channel,
53
static void _gp_tile_req_destroy (WireMessage *msg);
55
static void _gp_tile_ack_read (GIOChannel *channel,
58
static void _gp_tile_ack_write (GIOChannel *channel,
61
static void _gp_tile_ack_destroy (WireMessage *msg);
63
static void _gp_tile_data_read (GIOChannel *channel,
66
static void _gp_tile_data_write (GIOChannel *channel,
69
static void _gp_tile_data_destroy (WireMessage *msg);
71
static void _gp_proc_run_read (GIOChannel *channel,
74
static void _gp_proc_run_write (GIOChannel *channel,
77
static void _gp_proc_run_destroy (WireMessage *msg);
79
static void _gp_proc_return_read (GIOChannel *channel,
82
static void _gp_proc_return_write (GIOChannel *channel,
85
static void _gp_proc_return_destroy (WireMessage *msg);
87
static void _gp_temp_proc_run_read (GIOChannel *channel,
90
static void _gp_temp_proc_run_write (GIOChannel *channel,
93
static void _gp_temp_proc_run_destroy (WireMessage *msg);
95
static void _gp_temp_proc_return_read (GIOChannel *channel,
98
static void _gp_temp_proc_return_write (GIOChannel *channel,
101
static void _gp_temp_proc_return_destroy (WireMessage *msg);
103
static void _gp_proc_install_read (GIOChannel *channel,
106
static void _gp_proc_install_write (GIOChannel *channel,
109
static void _gp_proc_install_destroy (WireMessage *msg);
111
static void _gp_proc_uninstall_read (GIOChannel *channel,
114
static void _gp_proc_uninstall_write (GIOChannel *channel,
117
static void _gp_proc_uninstall_destroy (WireMessage *msg);
119
static void _gp_extension_ack_read (GIOChannel *channel,
122
static void _gp_extension_ack_write (GIOChannel *channel,
125
static void _gp_extension_ack_destroy (WireMessage *msg);
127
static void _gp_params_read (GIOChannel *channel,
131
static void _gp_params_write (GIOChannel *channel,
136
/* used by gimp.c:gimp_destroy_params() */
137
void _gp_params_destroy (GPParam *params,
140
static void _gp_has_init_read (GIOChannel *channel,
143
static void _gp_has_init_write (GIOChannel *channel,
146
static void _gp_has_init_destroy (WireMessage *msg);
31
static void _gp_quit_read (GIOChannel *channel,
34
static void _gp_quit_write (GIOChannel *channel,
37
static void _gp_quit_destroy (GimpWireMessage *msg);
39
static void _gp_config_read (GIOChannel *channel,
42
static void _gp_config_write (GIOChannel *channel,
45
static void _gp_config_destroy (GimpWireMessage *msg);
47
static void _gp_tile_req_read (GIOChannel *channel,
50
static void _gp_tile_req_write (GIOChannel *channel,
53
static void _gp_tile_req_destroy (GimpWireMessage *msg);
55
static void _gp_tile_ack_read (GIOChannel *channel,
58
static void _gp_tile_ack_write (GIOChannel *channel,
61
static void _gp_tile_ack_destroy (GimpWireMessage *msg);
63
static void _gp_tile_data_read (GIOChannel *channel,
66
static void _gp_tile_data_write (GIOChannel *channel,
69
static void _gp_tile_data_destroy (GimpWireMessage *msg);
71
static void _gp_proc_run_read (GIOChannel *channel,
74
static void _gp_proc_run_write (GIOChannel *channel,
77
static void _gp_proc_run_destroy (GimpWireMessage *msg);
79
static void _gp_proc_return_read (GIOChannel *channel,
82
static void _gp_proc_return_write (GIOChannel *channel,
85
static void _gp_proc_return_destroy (GimpWireMessage *msg);
87
static void _gp_temp_proc_run_read (GIOChannel *channel,
90
static void _gp_temp_proc_run_write (GIOChannel *channel,
93
static void _gp_temp_proc_run_destroy (GimpWireMessage *msg);
95
static void _gp_temp_proc_return_read (GIOChannel *channel,
98
static void _gp_temp_proc_return_write (GIOChannel *channel,
101
static void _gp_temp_proc_return_destroy (GimpWireMessage *msg);
103
static void _gp_proc_install_read (GIOChannel *channel,
104
GimpWireMessage *msg,
106
static void _gp_proc_install_write (GIOChannel *channel,
107
GimpWireMessage *msg,
109
static void _gp_proc_install_destroy (GimpWireMessage *msg);
111
static void _gp_proc_uninstall_read (GIOChannel *channel,
112
GimpWireMessage *msg,
114
static void _gp_proc_uninstall_write (GIOChannel *channel,
115
GimpWireMessage *msg,
117
static void _gp_proc_uninstall_destroy (GimpWireMessage *msg);
119
static void _gp_extension_ack_read (GIOChannel *channel,
120
GimpWireMessage *msg,
122
static void _gp_extension_ack_write (GIOChannel *channel,
123
GimpWireMessage *msg,
125
static void _gp_extension_ack_destroy (GimpWireMessage *msg);
127
static void _gp_params_read (GIOChannel *channel,
131
static void _gp_params_write (GIOChannel *channel,
136
static void _gp_has_init_read (GIOChannel *channel,
137
GimpWireMessage *msg,
139
static void _gp_has_init_write (GIOChannel *channel,
140
GimpWireMessage *msg,
142
static void _gp_has_init_destroy (GimpWireMessage *msg);
153
wire_register (GP_QUIT,
157
wire_register (GP_CONFIG,
161
wire_register (GP_TILE_REQ,
164
_gp_tile_req_destroy);
165
wire_register (GP_TILE_ACK,
168
_gp_tile_ack_destroy);
169
wire_register (GP_TILE_DATA,
172
_gp_tile_data_destroy);
173
wire_register (GP_PROC_RUN,
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,
204
_gp_has_init_destroy);
149
gimp_wire_register (GP_QUIT,
153
gimp_wire_register (GP_CONFIG,
157
gimp_wire_register (GP_TILE_REQ,
160
_gp_tile_req_destroy);
161
gimp_wire_register (GP_TILE_ACK,
164
_gp_tile_ack_destroy);
165
gimp_wire_register (GP_TILE_DATA,
168
_gp_tile_data_destroy);
169
gimp_wire_register (GP_PROC_RUN,
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,
200
_gp_has_init_destroy);
208
204
gp_quit_write (GIOChannel *channel,
209
205
gpointer user_data)
213
209
msg.type = GP_QUIT;
216
if (! wire_write_msg (channel, &msg, user_data))
218
if (! wire_flush (channel, user_data))
212
if (! gimp_wire_write_msg (channel, &msg, user_data))
215
if (! gimp_wire_flush (channel, user_data))
224
222
gp_config_write (GIOChannel *channel,
226
224
gpointer user_data)
230
228
msg.type = GP_CONFIG;
231
229
msg.data = config;
233
if (! wire_write_msg (channel, &msg, user_data))
235
if (! wire_flush (channel, user_data))
231
if (! gimp_wire_write_msg (channel, &msg, user_data))
234
if (! gimp_wire_flush (channel, user_data))
241
241
gp_tile_req_write (GIOChannel *channel,
243
243
gpointer user_data)
247
247
msg.type = GP_TILE_REQ;
248
248
msg.data = tile_req;
250
if (! wire_write_msg (channel, &msg, user_data))
252
if (! wire_flush (channel, user_data))
250
if (! gimp_wire_write_msg (channel, &msg, user_data))
253
if (! gimp_wire_flush (channel, user_data))
258
260
gp_tile_ack_write (GIOChannel *channel,
259
261
gpointer user_data)
263
265
msg.type = GP_TILE_ACK;
266
if (! wire_write_msg (channel, &msg, user_data))
268
if (! wire_flush (channel, user_data))
268
if (! gimp_wire_write_msg (channel, &msg, user_data))
271
if (! gimp_wire_flush (channel, user_data))
274
278
gp_tile_data_write (GIOChannel *channel,
275
GPTileData *tile_data,
279
GPTileData *tile_data,
276
280
gpointer user_data)
280
284
msg.type = GP_TILE_DATA;
281
285
msg.data = tile_data;
283
if (! wire_write_msg (channel, &msg, user_data))
285
if (! wire_flush (channel, user_data))
287
if (! gimp_wire_write_msg (channel, &msg, user_data))
290
if (! gimp_wire_flush (channel, user_data))
291
297
gp_proc_run_write (GIOChannel *channel,
293
299
gpointer user_data)
297
303
msg.type = GP_PROC_RUN;
298
304
msg.data = proc_run;
300
if (! wire_write_msg (channel, &msg, user_data))
302
if (! wire_flush (channel, user_data))
306
if (! gimp_wire_write_msg (channel, &msg, user_data))
309
if (! gimp_wire_flush (channel, user_data))
308
316
gp_proc_return_write (GIOChannel *channel,
309
GPProcReturn *proc_return,
317
GPProcReturn *proc_return,
310
318
gpointer user_data)
314
322
msg.type = GP_PROC_RETURN;
315
323
msg.data = proc_return;
317
if (! wire_write_msg (channel, &msg, user_data))
319
if (! wire_flush (channel, user_data))
325
if (! gimp_wire_write_msg (channel, &msg, user_data))
328
if (! gimp_wire_flush (channel, user_data))
325
335
gp_temp_proc_run_write (GIOChannel *channel,
327
337
gpointer user_data)
331
341
msg.type = GP_TEMP_PROC_RUN;
332
342
msg.data = proc_run;
334
if (! wire_write_msg (channel, &msg, user_data))
336
if (! wire_flush (channel, user_data))
344
if (! gimp_wire_write_msg (channel, &msg, user_data))
347
if (! gimp_wire_flush (channel, user_data))
342
354
gp_temp_proc_return_write (GIOChannel *channel,
343
GPProcReturn *proc_return,
355
GPProcReturn *proc_return,
344
356
gpointer user_data)
348
360
msg.type = GP_TEMP_PROC_RETURN;
349
361
msg.data = proc_return;
351
if (! wire_write_msg (channel, &msg, user_data))
353
if (! wire_flush (channel, user_data))
363
if (! gimp_wire_write_msg (channel, &msg, user_data))
366
if (! gimp_wire_flush (channel, user_data))
359
373
gp_proc_install_write (GIOChannel *channel,
360
GPProcInstall *proc_install,
374
GPProcInstall *proc_install,
361
375
gpointer user_data)
365
379
msg.type = GP_PROC_INSTALL;
366
380
msg.data = proc_install;
368
if (! wire_write_msg (channel, &msg, user_data))
370
if (! wire_flush (channel, user_data))
382
if (! gimp_wire_write_msg (channel, &msg, user_data))
385
if (! gimp_wire_flush (channel, user_data))
376
392
gp_proc_uninstall_write (GIOChannel *channel,
377
GPProcUninstall *proc_uninstall,
393
GPProcUninstall *proc_uninstall,
378
394
gpointer user_data)
382
398
msg.type = GP_PROC_UNINSTALL;
383
399
msg.data = proc_uninstall;
385
if (! wire_write_msg (channel, &msg, user_data))
387
if (! wire_flush (channel, user_data))
401
if (! gimp_wire_write_msg (channel, &msg, user_data))
404
if (! gimp_wire_flush (channel, user_data))
409
429
gp_has_init_write (GIOChannel *channel,
410
430
gpointer user_data)
414
434
msg.type = GP_HAS_INIT;
417
if (! wire_write_msg (channel, &msg, user_data))
419
if (! wire_flush (channel, user_data))
437
if (! gimp_wire_write_msg (channel, &msg, user_data))
440
if (! gimp_wire_flush (channel, user_data))
427
_gp_quit_read (GIOChannel *channel,
434
_gp_quit_write (GIOChannel *channel,
441
_gp_quit_destroy (WireMessage *msg)
449
_gp_quit_read (GIOChannel *channel,
450
GimpWireMessage *msg,
456
_gp_quit_write (GIOChannel *channel,
457
GimpWireMessage *msg,
463
_gp_quit_destroy (GimpWireMessage *msg)
448
_gp_config_read (GIOChannel *channel,
470
_gp_config_read (GIOChannel *channel,
471
GimpWireMessage *msg,
454
config = g_new0 (GPConfig, 1);
456
if (! wire_read_int32 (channel,
457
&config->version, 1, user_data))
459
if (! wire_read_int32 (channel,
460
&config->tile_width, 1, user_data))
462
if (! wire_read_int32 (channel,
463
&config->tile_height, 1, user_data))
465
if (! wire_read_int32 (channel,
466
(guint32 *) &config->shm_ID, 1, user_data))
468
if (! wire_read_int8 (channel,
469
(guint8 *) &config->check_size, 1, user_data))
471
if (! wire_read_int8 (channel,
472
(guint8 *) &config->check_type, 1, user_data))
474
if (! wire_read_int8 (channel,
475
(guint8 *) &config->show_help_button, 1, user_data))
477
if (! wire_read_int8 (channel,
478
(guint8 *) &config->gimp_reserved_4, 1, user_data))
480
if (! wire_read_int8 (channel,
481
(guint8 *) &config->gimp_reserved_5, 1, user_data))
483
if (! wire_read_int8 (channel,
484
(guint8 *) &config->gimp_reserved_6, 1, user_data))
486
if (! wire_read_int8 (channel,
487
(guint8 *) &config->gimp_reserved_7, 1, user_data))
489
if (! wire_read_int8 (channel,
490
(guint8 *) &config->gimp_reserved_8, 1, user_data))
492
if (! wire_read_int8 (channel,
493
(guint8 *) &config->install_cmap, 1, user_data))
495
if (! wire_read_int8 (channel,
496
(guint8 *) &config->show_tool_tips, 1, user_data))
498
if (! wire_read_int32 (channel,
499
(guint32 *) &config->min_colors, 1, user_data))
501
if (! wire_read_int32 (channel,
502
(guint32 *) &config->gdisp_ID, 1, user_data))
505
if (! wire_read_string (channel,
506
&config->app_name, 1, user_data))
508
if (! wire_read_string (channel,
509
&config->wm_class, 1, user_data))
511
if (! wire_read_string (channel,
512
&config->display_name, 1, user_data))
514
if (! wire_read_int32 (channel,
515
(guint32 *) &config->monitor_number, 1, user_data))
474
GPConfig *config = g_new0 (GPConfig, 1);
476
if (! _gimp_wire_read_int32 (channel,
477
&config->version, 1, user_data))
479
if (! _gimp_wire_read_int32 (channel,
480
&config->tile_width, 1, user_data))
482
if (! _gimp_wire_read_int32 (channel,
483
&config->tile_height, 1, user_data))
485
if (! _gimp_wire_read_int32 (channel,
486
(guint32 *) &config->shm_ID, 1, user_data))
488
if (! _gimp_wire_read_int8 (channel,
489
(guint8 *) &config->check_size, 1, user_data))
491
if (! _gimp_wire_read_int8 (channel,
492
(guint8 *) &config->check_type, 1, user_data))
494
if (! _gimp_wire_read_int8 (channel,
495
(guint8 *) &config->show_help_button, 1,
498
if (! _gimp_wire_read_int8 (channel,
499
(guint8 *) &config->use_cpu_accel, 1,
502
if (! _gimp_wire_read_int8 (channel,
503
(guint8 *) &config->gimp_reserved_5, 1,
506
if (! _gimp_wire_read_int8 (channel,
507
(guint8 *) &config->gimp_reserved_6, 1,
510
if (! _gimp_wire_read_int8 (channel,
511
(guint8 *) &config->gimp_reserved_7, 1,
514
if (! _gimp_wire_read_int8 (channel,
515
(guint8 *) &config->gimp_reserved_8, 1,
518
if (! _gimp_wire_read_int8 (channel,
519
(guint8 *) &config->install_cmap, 1, user_data))
521
if (! _gimp_wire_read_int8 (channel,
522
(guint8 *) &config->show_tooltips, 1, user_data))
524
if (! _gimp_wire_read_int32 (channel,
525
(guint32 *) &config->min_colors, 1, user_data))
527
if (! _gimp_wire_read_int32 (channel,
528
(guint32 *) &config->gdisp_ID, 1, user_data))
531
if (! _gimp_wire_read_string (channel,
532
&config->app_name, 1, user_data))
534
if (! _gimp_wire_read_string (channel,
535
&config->wm_class, 1, user_data))
537
if (! _gimp_wire_read_string (channel,
538
&config->display_name, 1, user_data))
540
if (! _gimp_wire_read_int32 (channel,
541
(guint32 *) &config->monitor_number, 1,
518
545
msg->data = config;
529
_gp_config_write (GIOChannel *channel,
556
_gp_config_write (GIOChannel *channel,
557
GimpWireMessage *msg,
560
GPConfig *config = msg->data;
536
if (! wire_write_int32 (channel, &config->version, 1, user_data))
538
if (! wire_write_int32 (channel, &config->tile_width, 1, user_data))
540
if (! wire_write_int32 (channel, &config->tile_height, 1, user_data))
542
if (! wire_write_int32 (channel, (guint32*) &config->shm_ID, 1, user_data))
544
if (! wire_write_int8 (channel, (guint8*) &config->check_size, 1, user_data))
546
if (! wire_write_int8 (channel, (guint8*) &config->check_type, 1, user_data))
548
if (! wire_write_int8 (channel, (guint8*) &config->show_help_button, 1, user_data))
550
if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_4, 1, user_data))
552
if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_5, 1, user_data))
554
if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_6, 1, user_data))
556
if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_7, 1, user_data))
558
if (! wire_write_int8 (channel, (guint8*) &config->gimp_reserved_8, 1, user_data))
560
if (! wire_write_int8 (channel, (guint8*) &config->install_cmap, 1, user_data))
562
if (! wire_write_int8 (channel, (guint8*) &config->show_tool_tips, 1, user_data))
564
if (! wire_write_int32 (channel, (guint32*) &config->min_colors, 1, user_data))
566
if (! wire_write_int32 (channel, (guint32*) &config->gdisp_ID, 1, user_data))
568
if (! wire_write_string (channel, &config->app_name, 1, user_data))
570
if (! wire_write_string (channel, &config->wm_class, 1, user_data))
572
if (! wire_write_string (channel, &config->display_name, 1, user_data))
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))
565
if (! _gimp_wire_write_int32 (channel,
566
&config->tile_width, 1, user_data))
568
if (! _gimp_wire_write_int32 (channel,
569
&config->tile_height, 1, user_data))
571
if (! _gimp_wire_write_int32 (channel,
572
(const guint32 *) &config->shm_ID, 1,
575
if (! _gimp_wire_write_int8 (channel,
576
(const guint8 *) &config->check_size, 1,
579
if (! _gimp_wire_write_int8 (channel,
580
(const guint8 *) &config->check_type, 1,
583
if (! _gimp_wire_write_int8 (channel,
584
(const guint8 *) &config->show_help_button, 1,
587
if (! _gimp_wire_write_int8 (channel,
588
(const guint8 *) &config->use_cpu_accel, 1,
591
if (! _gimp_wire_write_int8 (channel,
592
(const guint8 *) &config->gimp_reserved_5, 1,
595
if (! _gimp_wire_write_int8 (channel,
596
(const guint8 *) &config->gimp_reserved_6, 1,
599
if (! _gimp_wire_write_int8 (channel,
600
(const guint8 *) &config->gimp_reserved_7, 1,
603
if (! _gimp_wire_write_int8 (channel,
604
(const guint8 *) &config->gimp_reserved_8, 1,
607
if (! _gimp_wire_write_int8 (channel,
608
(const guint8 *) &config->install_cmap, 1,
611
if (! _gimp_wire_write_int8 (channel,
612
(const guint8 *) &config->show_tooltips, 1,
615
if (! _gimp_wire_write_int32 (channel,
616
(const guint32 *) &config->min_colors, 1,
619
if (! _gimp_wire_write_int32 (channel,
620
(const guint32 *) &config->gdisp_ID, 1,
623
if (! _gimp_wire_write_string (channel,
624
&config->app_name, 1, user_data))
626
if (! _gimp_wire_write_string (channel,
627
&config->wm_class, 1, user_data))
629
if (! _gimp_wire_write_string (channel,
630
&config->display_name, 1, user_data))
632
if (! _gimp_wire_write_int32 (channel,
633
(const guint32 *) &config->monitor_number, 1,
579
_gp_config_destroy (WireMessage *msg)
639
_gp_config_destroy (GimpWireMessage *msg)
641
GPConfig *config = msg->data;
585
643
g_free (config->app_name);
586
644
g_free (config->wm_class);
643
_gp_tile_ack_read (GIOChannel *channel,
650
_gp_tile_ack_write (GIOChannel *channel,
657
_gp_tile_ack_destroy (WireMessage *msg)
704
_gp_tile_ack_read (GIOChannel *channel,
705
GimpWireMessage *msg,
711
_gp_tile_ack_write (GIOChannel *channel,
712
GimpWireMessage *msg,
718
_gp_tile_ack_destroy (GimpWireMessage *msg)
664
_gp_tile_data_read (GIOChannel *channel,
725
_gp_tile_data_read (GIOChannel *channel,
726
GimpWireMessage *msg,
668
GPTileData *tile_data;
671
tile_data = g_new0 (GPTileData, 1);
673
if (! wire_read_int32 (channel, (guint32*) &tile_data->drawable_ID, 1,
676
if (! wire_read_int32 (channel, &tile_data->tile_num, 1, user_data))
678
if (! wire_read_int32 (channel, &tile_data->shadow, 1, user_data))
680
if (! wire_read_int32 (channel, &tile_data->bpp, 1, user_data))
682
if (! wire_read_int32 (channel, &tile_data->width, 1, user_data))
684
if (! wire_read_int32 (channel, &tile_data->height, 1, user_data))
686
if (! wire_read_int32 (channel, &tile_data->use_shm, 1, user_data))
729
GPTileData *tile_data = g_new0 (GPTileData, 1);
731
if (! _gimp_wire_read_int32 (channel,
732
(guint32 *) &tile_data->drawable_ID, 1,
735
if (! _gimp_wire_read_int32 (channel,
736
&tile_data->tile_num, 1, user_data))
738
if (! _gimp_wire_read_int32 (channel,
739
&tile_data->shadow, 1, user_data))
741
if (! _gimp_wire_read_int32 (channel,
742
&tile_data->bpp, 1, user_data))
744
if (! _gimp_wire_read_int32 (channel,
745
&tile_data->width, 1, user_data))
747
if (! _gimp_wire_read_int32 (channel,
748
&tile_data->height, 1, user_data))
750
if (! _gimp_wire_read_int32 (channel,
751
&tile_data->use_shm, 1, user_data))
689
754
if (!tile_data->use_shm)
691
length = tile_data->width * tile_data->height * tile_data->bpp;
756
guint length = tile_data->width * tile_data->height * tile_data->bpp;
692
758
tile_data->data = g_new (guchar, length);
694
if (! wire_read_int8 (channel, (guint8*) tile_data->data, length,
760
if (! _gimp_wire_read_int8 (channel,
761
(guint8 *) tile_data->data, length,
699
766
msg->data = tile_data;
708
_gp_tile_data_write (GIOChannel *channel,
775
_gp_tile_data_write (GIOChannel *channel,
776
GimpWireMessage *msg,
712
GPTileData *tile_data;
779
GPTileData *tile_data = msg->data;
715
tile_data = msg->data;
716
if (! wire_write_int32 (channel, (guint32*) &tile_data->drawable_ID, 1,
719
if (! wire_write_int32 (channel, &tile_data->tile_num, 1, user_data))
721
if (! wire_write_int32 (channel, &tile_data->shadow, 1, user_data))
723
if (! wire_write_int32 (channel, &tile_data->bpp, 1, user_data))
725
if (! wire_write_int32 (channel, &tile_data->width, 1, user_data))
727
if (! wire_write_int32 (channel, &tile_data->height, 1, user_data))
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,
785
if (! _gimp_wire_write_int32 (channel,
786
&tile_data->tile_num, 1, user_data))
788
if (! _gimp_wire_write_int32 (channel,
789
&tile_data->shadow, 1, user_data))
791
if (! _gimp_wire_write_int32 (channel,
792
&tile_data->bpp, 1, user_data))
794
if (! _gimp_wire_write_int32 (channel,
795
&tile_data->width, 1, user_data))
797
if (! _gimp_wire_write_int32 (channel,
798
&tile_data->height, 1, user_data))
800
if (! _gimp_wire_write_int32 (channel,
801
&tile_data->use_shm, 1, user_data))
732
804
if (!tile_data->use_shm)
734
length = tile_data->width * tile_data->height * tile_data->bpp;
735
if (! wire_write_int8 (channel, (guint8*) tile_data->data, length,
806
guint length = tile_data->width * tile_data->height * tile_data->bpp;
808
if (! _gimp_wire_write_int8 (channel,
809
(const guint8 *) tile_data->data, length,
742
_gp_tile_data_destroy (WireMessage *msg)
816
_gp_tile_data_destroy (GimpWireMessage *msg)
744
GPTileData *tile_data;
746
tile_data = msg->data;
818
GPTileData *tile_data = msg->data;
748
820
g_free (tile_data->data);
749
821
g_free (tile_data);
905
967
/* proc_install */
908
_gp_proc_install_read (GIOChannel *channel,
970
_gp_proc_install_read (GIOChannel *channel,
971
GimpWireMessage *msg,
912
GPProcInstall *proc_install;
915
proc_install = g_new0 (GPProcInstall, 1);
917
if (! wire_read_string (channel, &proc_install->name, 1, user_data))
919
if (! wire_read_string (channel, &proc_install->blurb, 1, user_data))
921
if (! wire_read_string (channel, &proc_install->help, 1, user_data))
923
if (! wire_read_string (channel, &proc_install->author, 1, user_data))
925
if (! wire_read_string (channel, &proc_install->copyright, 1, user_data))
927
if (! wire_read_string (channel, &proc_install->date, 1, user_data))
929
if (! wire_read_string (channel, &proc_install->menu_path, 1, user_data))
931
if (! wire_read_string (channel, &proc_install->image_types, 1, user_data))
934
if (! wire_read_int32 (channel, &proc_install->type, 1, user_data))
936
if (! wire_read_int32 (channel, &proc_install->nparams, 1, user_data))
938
if (! wire_read_int32 (channel, &proc_install->nreturn_vals, 1, user_data))
974
GPProcInstall *proc_install = g_new0 (GPProcInstall, 1);
977
if (! _gimp_wire_read_string (channel,
978
&proc_install->name, 1, user_data))
980
if (! _gimp_wire_read_string (channel,
981
&proc_install->blurb, 1, user_data))
983
if (! _gimp_wire_read_string (channel,
984
&proc_install->help, 1, user_data))
986
if (! _gimp_wire_read_string (channel,
987
&proc_install->author, 1, user_data))
989
if (! _gimp_wire_read_string (channel,
990
&proc_install->copyright, 1, user_data))
992
if (! _gimp_wire_read_string (channel,
993
&proc_install->date, 1, user_data))
995
if (! _gimp_wire_read_string (channel,
996
&proc_install->menu_path, 1, user_data))
998
if (! _gimp_wire_read_string (channel,
999
&proc_install->image_types, 1, user_data))
1002
if (! _gimp_wire_read_int32 (channel,
1003
&proc_install->type, 1, user_data))
1005
if (! _gimp_wire_read_int32 (channel,
1006
&proc_install->nparams, 1, user_data))
1008
if (! _gimp_wire_read_int32 (channel,
1009
&proc_install->nreturn_vals, 1, user_data))
941
1012
proc_install->params = g_new0 (GPParamDef, proc_install->nparams);
943
1014
for (i = 0; i < proc_install->nparams; i++)
945
if (! wire_read_int32 (channel,
946
(guint32*) &proc_install->params[i].type, 1,
949
if (! wire_read_string (channel,
950
&proc_install->params[i].name, 1,
953
if (! wire_read_string (channel,
954
&proc_install->params[i].description, 1,
1016
if (! _gimp_wire_read_int32 (channel,
1017
(guint32 *) &proc_install->params[i].type, 1,
1020
if (! _gimp_wire_read_string (channel,
1021
&proc_install->params[i].name, 1,
1024
if (! _gimp_wire_read_string (channel,
1025
&proc_install->params[i].description, 1,
959
1030
proc_install->return_vals = g_new0 (GPParamDef, proc_install->nreturn_vals);
961
1032
for (i = 0; i < proc_install->nreturn_vals; i++)
963
if (! wire_read_int32 (channel,
964
(guint32*) &proc_install->return_vals[i].type, 1,
967
if (! wire_read_string (channel,
968
&proc_install->return_vals[i].name, 1,
971
if (! wire_read_string (channel,
972
&proc_install->return_vals[i].description, 1,
1034
if (! _gimp_wire_read_int32 (channel,
1035
(guint32 *) &proc_install->return_vals[i].type, 1,
1038
if (! _gimp_wire_read_string (channel,
1039
&proc_install->return_vals[i].name, 1,
1042
if (! _gimp_wire_read_string (channel,
1043
&proc_install->return_vals[i].description, 1,
977
1048
msg->data = proc_install;
1022
_gp_proc_install_write (GIOChannel *channel,
1093
_gp_proc_install_write (GIOChannel *channel,
1094
GimpWireMessage *msg,
1026
GPProcInstall *proc_install;
1029
proc_install = msg->data;
1031
if (! wire_write_string (channel, &proc_install->name, 1, user_data))
1033
if (! wire_write_string (channel, &proc_install->blurb, 1, user_data))
1035
if (! wire_write_string (channel, &proc_install->help, 1, user_data))
1037
if (! wire_write_string (channel, &proc_install->author, 1, user_data))
1039
if (! wire_write_string (channel, &proc_install->copyright, 1, user_data))
1041
if (! wire_write_string (channel, &proc_install->date, 1, user_data))
1043
if (! wire_write_string (channel, &proc_install->menu_path, 1, user_data))
1045
if (! wire_write_string (channel, &proc_install->image_types, 1, user_data))
1048
if (! wire_write_int32 (channel, &proc_install->type, 1, user_data))
1050
if (! wire_write_int32 (channel, &proc_install->nparams, 1, user_data))
1052
if (! wire_write_int32 (channel, &proc_install->nreturn_vals, 1, user_data))
1097
GPProcInstall *proc_install = msg->data;
1100
if (! _gimp_wire_write_string (channel,
1101
&proc_install->name, 1, user_data))
1103
if (! _gimp_wire_write_string (channel,
1104
&proc_install->blurb, 1, user_data))
1106
if (! _gimp_wire_write_string (channel,
1107
&proc_install->help, 1, user_data))
1109
if (! _gimp_wire_write_string (channel,
1110
&proc_install->author, 1, user_data))
1112
if (! _gimp_wire_write_string (channel,
1113
&proc_install->copyright, 1, user_data))
1115
if (! _gimp_wire_write_string (channel,
1116
&proc_install->date, 1, user_data))
1118
if (! _gimp_wire_write_string (channel,
1119
&proc_install->menu_path, 1, user_data))
1121
if (! _gimp_wire_write_string (channel,
1122
&proc_install->image_types, 1, user_data))
1125
if (! _gimp_wire_write_int32 (channel,
1126
&proc_install->type, 1, user_data))
1128
if (! _gimp_wire_write_int32 (channel,
1129
&proc_install->nparams, 1, user_data))
1131
if (! _gimp_wire_write_int32 (channel,
1132
&proc_install->nreturn_vals, 1, user_data))
1055
1135
for (i = 0; i < proc_install->nparams; i++)
1057
if (! wire_write_int32 (channel,
1058
(guint32*) &proc_install->params[i].type, 1,
1061
if (! wire_write_string (channel,
1062
&proc_install->params[i].name, 1,
1065
if (! wire_write_string (channel,
1066
&proc_install->params[i].description, 1,
1137
if (! _gimp_wire_write_int32 (channel,
1138
(guint32 *) &proc_install->params[i].type, 1,
1141
if (! _gimp_wire_write_string (channel,
1142
&proc_install->params[i].name, 1,
1145
if (! _gimp_wire_write_string (channel,
1146
&proc_install->params[i].description, 1,
1071
1151
for (i = 0; i < proc_install->nreturn_vals; i++)
1073
if (! wire_write_int32 (channel,
1074
(guint32*) &proc_install->return_vals[i].type, 1,
1077
if (! wire_write_string (channel,
1078
&proc_install->return_vals[i].name, 1,
1081
if (! wire_write_string (channel,
1082
&proc_install->return_vals[i].description, 1,
1153
if (! _gimp_wire_write_int32 (channel,
1154
(guint32 *) &proc_install->return_vals[i].type, 1,
1157
if (! _gimp_wire_write_string (channel,
1158
&proc_install->return_vals[i].name, 1,
1161
if (! _gimp_wire_write_string (channel,
1162
&proc_install->return_vals[i].description, 1,
1089
_gp_proc_install_destroy (WireMessage *msg)
1169
_gp_proc_install_destroy (GimpWireMessage *msg)
1091
GPProcInstall *proc_install;
1094
proc_install = msg->data;
1171
GPProcInstall *proc_install = msg->data;
1096
1174
g_free (proc_install->name);
1097
1175
g_free (proc_install->blurb);
1209
1281
for (i = 0; i < *nparams; i++)
1211
if (! wire_read_int32 (channel,
1212
(guint32*) &(*params)[i].type, 1,
1283
if (! _gimp_wire_read_int32 (channel,
1284
(guint32 *) &(*params)[i].type, 1,
1216
1288
switch ((*params)[i].type)
1218
case GIMP_PDB_INT32:
1219
if (! wire_read_int32 (channel,
1220
(guint32*) &(*params)[i].data.d_int32, 1,
1225
case GIMP_PDB_INT16:
1226
if (! wire_read_int16 (channel,
1227
(guint16*) &(*params)[i].data.d_int16, 1,
1233
if (! wire_read_int8 (channel,
1234
(guint8*) &(*params)[i].data.d_int8, 1,
1290
case GIMP_PDB_INT32:
1291
if (! _gimp_wire_read_int32 (channel,
1292
(guint32 *) &(*params)[i].data.d_int32, 1,
1297
case GIMP_PDB_INT16:
1298
if (! _gimp_wire_read_int16 (channel,
1299
(guint16 *) &(*params)[i].data.d_int16, 1,
1305
if (! _gimp_wire_read_int8 (channel,
1306
&(*params)[i].data.d_int8, 1,
1239
1311
case GIMP_PDB_FLOAT:
1240
if (! wire_read_double (channel,
1241
&(*params)[i].data.d_float, 1,
1312
if (! _gimp_wire_read_double (channel,
1313
&(*params)[i].data.d_float, 1,
1246
1318
case GIMP_PDB_STRING:
1247
if (! wire_read_string (channel,
1248
&(*params)[i].data.d_string, 1,
1319
if (! _gimp_wire_read_string (channel,
1320
&(*params)[i].data.d_string, 1,
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,
1262
g_free ((*params)[i].data.d_int32array);
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);
1330
if (! _gimp_wire_read_int32 (channel,
1331
(guint32 *) (*params)[i].data.d_int32array,
1332
(*params)[i-1].data.d_int32,
1335
g_free ((*params)[i].data.d_int32array);
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,
1276
g_free ((*params)[i].data.d_int16array);
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,
1349
g_free ((*params)[i].data.d_int16array);
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,
1290
g_free ((*params)[i].data.d_int8array);
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,
1363
g_free ((*params)[i].data.d_int8array);
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,
1304
g_free ((*params)[i].data.d_floatarray);
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,
1377
g_free ((*params)[i].data.d_floatarray);
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,
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);
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,
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);
1325
1398
case GIMP_PDB_COLOR:
1326
if (! wire_read_double (channel,
1327
&(*params)[i].data.d_color.r, 1,
1330
if (! wire_read_double (channel,
1331
&(*params)[i].data.d_color.g, 1,
1334
if (! wire_read_double (channel,
1335
&(*params)[i].data.d_color.b, 1,
1338
if (! wire_read_double (channel,
1339
&(*params)[i].data.d_color.a, 1,
1399
if (! _gimp_wire_read_color (channel,
1400
&(*params)[i].data.d_color, 1,
1344
1405
case GIMP_PDB_REGION:
1347
1408
case GIMP_PDB_DISPLAY:
1348
if (! wire_read_int32 (channel,
1349
(guint32*) &(*params)[i].data.d_display, 1,
1409
if (! _gimp_wire_read_int32 (channel,
1410
(guint32 *) &(*params)[i].data.d_display, 1,
1354
1415
case GIMP_PDB_IMAGE:
1355
if (! wire_read_int32 (channel,
1356
(guint32*) &(*params)[i].data.d_image, 1,
1416
if (! _gimp_wire_read_int32 (channel,
1417
(guint32 *) &(*params)[i].data.d_image, 1,
1361
1422
case GIMP_PDB_LAYER:
1362
if (! wire_read_int32 (channel,
1363
(guint32*) &(*params)[i].data.d_layer, 1,
1423
if (! _gimp_wire_read_int32 (channel,
1424
(guint32 *) &(*params)[i].data.d_layer, 1,
1368
1429
case GIMP_PDB_CHANNEL:
1369
if (! wire_read_int32 (channel,
1370
(guint32*) &(*params)[i].data.d_channel, 1,
1430
if (! _gimp_wire_read_int32 (channel,
1431
(guint32 *) &(*params)[i].data.d_channel, 1,
1375
1436
case GIMP_PDB_DRAWABLE:
1376
if (! wire_read_int32 (channel,
1377
(guint32*) &(*params)[i].data.d_drawable, 1,
1437
if (! _gimp_wire_read_int32 (channel,
1438
(guint32 *) &(*params)[i].data.d_drawable, 1,
1382
1443
case GIMP_PDB_SELECTION:
1383
if (! wire_read_int32 (channel,
1384
(guint32*) &(*params)[i].data.d_selection, 1,
1444
if (! _gimp_wire_read_int32 (channel,
1445
(guint32 *) &(*params)[i].data.d_selection, 1,
1389
1450
case GIMP_PDB_BOUNDARY:
1390
if (! wire_read_int32 (channel,
1391
(guint32*) &(*params)[i].data.d_boundary, 1,
1451
if (! _gimp_wire_read_int32 (channel,
1452
(guint32 *) &(*params)[i].data.d_boundary, 1,
1397
if (! wire_read_int32 (channel,
1398
(guint32*) &(*params)[i].data.d_path, 1,
1457
case GIMP_PDB_VECTORS:
1458
if (! _gimp_wire_read_int32 (channel,
1459
(guint32 *) &(*params)[i].data.d_vectors, 1,
1403
1464
case GIMP_PDB_PARASITE:
1404
if (! wire_read_string (channel,
1405
&(*params)[i].data.d_parasite.name, 1,
1408
if ((*params)[i].data.d_parasite.name == NULL)
1410
/* we have a null parasite */
1411
(*params)[i].data.d_parasite.data = NULL;
1414
if (! wire_read_int32 (channel,
1415
&((*params)[i].data.d_parasite.flags), 1,
1418
if (! wire_read_int32 (channel,
1419
&((*params)[i].data.d_parasite.size), 1,
1422
if ((*params)[i].data.d_parasite.size > 0)
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,
1430
g_free ((*params)[i].data.d_parasite.data);
1435
(*params)[i].data.d_parasite.data = NULL;
1465
if (! _gimp_wire_read_string (channel,
1466
&(*params)[i].data.d_parasite.name, 1,
1469
if ((*params)[i].data.d_parasite.name == NULL)
1471
/* we have a null parasite */
1472
(*params)[i].data.d_parasite.data = NULL;
1475
if (! _gimp_wire_read_int32 (channel,
1476
&((*params)[i].data.d_parasite.flags), 1,
1479
if (! _gimp_wire_read_int32 (channel,
1480
&((*params)[i].data.d_parasite.size), 1,
1483
if ((*params)[i].data.d_parasite.size > 0)
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,
1492
g_free ((*params)[i].data.d_parasite.data);
1497
(*params)[i].data.d_parasite.data = NULL;
1438
1500
case GIMP_PDB_STATUS:
1439
if (! wire_read_int32 (channel,
1440
(guint32*) &(*params)[i].data.d_status, 1,
1501
if (! _gimp_wire_read_int32 (channel,
1502
(guint32 *) &(*params)[i].data.d_status, 1,
1459
1521
_gp_params_write (GIOChannel *channel,
1462
1524
gpointer user_data)
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))
1469
1532
for (i = 0; i < nparams; i++)
1471
if (! wire_write_int32 (channel,
1472
(guint32*) ¶ms[i].type, 1,
1534
if (! _gimp_wire_write_int32 (channel,
1535
(const guint32 *) ¶ms[i].type, 1,
1476
1539
switch (params[i].type)
1478
case GIMP_PDB_INT32:
1479
if (! wire_write_int32 (channel,
1480
(guint32*) ¶ms[i].data.d_int32, 1,
1485
case GIMP_PDB_INT16:
1486
if (! wire_write_int16 (channel,
1487
(guint16*) ¶ms[i].data.d_int16, 1,
1493
if (! wire_write_int8 (channel,
1494
(guint8*) ¶ms[i].data.d_int8, 1,
1541
case GIMP_PDB_INT32:
1542
if (! _gimp_wire_write_int32 (channel,
1543
(const guint32 *) ¶ms[i].data.d_int32, 1,
1548
case GIMP_PDB_INT16:
1549
if (! _gimp_wire_write_int16 (channel,
1550
(const guint16 *) ¶ms[i].data.d_int16, 1,
1556
if (! _gimp_wire_write_int8 (channel,
1557
(const guint8 *) ¶ms[i].data.d_int8, 1,
1499
1562
case GIMP_PDB_FLOAT:
1500
if (! wire_write_double (channel,
1501
¶ms[i].data.d_float, 1,
1563
if (! _gimp_wire_write_double (channel,
1564
¶ms[i].data.d_float, 1,
1506
1569
case GIMP_PDB_STRING:
1507
if (! wire_write_string (channel,
1508
¶ms[i].data.d_string, 1,
1570
if (! _gimp_wire_write_string (channel,
1571
¶ms[i].data.d_string, 1,
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,
1577
if (! _gimp_wire_write_int32 (channel,
1578
(const guint32 *) params[i].data.d_int32array,
1579
params[i-1].data.d_int32,
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,
1585
if (! _gimp_wire_write_int16 (channel,
1586
(const guint16 *) params[i].data.d_int16array,
1587
params[i-1].data.d_int32,
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,
1593
if (! _gimp_wire_write_int8 (channel,
1594
(const guint8 *) params[i].data.d_int8array,
1595
params[i-1].data.d_int32,
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,
1601
if (! _gimp_wire_write_double (channel,
1602
params[i].data.d_floatarray,
1603
params[i-1].data.d_int32,
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,
1609
if (! _gimp_wire_write_string (channel,
1610
params[i].data.d_stringarray,
1611
params[i-1].data.d_int32,
1553
1616
case GIMP_PDB_COLOR:
1555
GimpRGB *color = (GimpRGB *) ¶ms[i].data.d_color;
1556
if (! wire_write_double (channel, &color->r, 1, user_data))
1558
if (! wire_write_double (channel, &color->g, 1, user_data))
1560
if (! wire_write_double (channel, &color->b, 1, user_data))
1562
if (! wire_write_double (channel, &color->a, 1, user_data))
1617
if (! _gimp_wire_write_color (channel,
1618
¶ms[i].data.d_color, 1, user_data))
1567
1622
case GIMP_PDB_REGION:
1570
1625
case GIMP_PDB_DISPLAY:
1571
if (! wire_write_int32 (channel,
1572
(guint32*) ¶ms[i].data.d_display, 1,
1626
if (! _gimp_wire_write_int32 (channel,
1627
(const guint32 *) ¶ms[i].data.d_display, 1,
1577
1632
case GIMP_PDB_IMAGE:
1578
if (! wire_write_int32 (channel,
1579
(guint32*) ¶ms[i].data.d_image, 1,
1633
if (! _gimp_wire_write_int32 (channel,
1634
(const guint32 *) ¶ms[i].data.d_image, 1,
1584
1639
case GIMP_PDB_LAYER:
1585
if (! wire_write_int32 (channel,
1586
(guint32*) ¶ms[i].data.d_layer, 1,
1640
if (! _gimp_wire_write_int32 (channel,
1641
(const guint32 *) ¶ms[i].data.d_layer, 1,
1591
1646
case GIMP_PDB_CHANNEL:
1592
if (! wire_write_int32 (channel,
1593
(guint32*) ¶ms[i].data.d_channel, 1,
1647
if (! _gimp_wire_write_int32 (channel,
1648
(const guint32 *) ¶ms[i].data.d_channel, 1,
1598
1653
case GIMP_PDB_DRAWABLE:
1599
if (! wire_write_int32 (channel,
1600
(guint32*) ¶ms[i].data.d_drawable, 1,
1654
if (! _gimp_wire_write_int32 (channel,
1655
(const guint32 *) ¶ms[i].data.d_drawable, 1,
1605
1660
case GIMP_PDB_SELECTION:
1606
if (! wire_write_int32 (channel,
1607
(guint32*) ¶ms[i].data.d_selection, 1,
1661
if (! _gimp_wire_write_int32 (channel,
1662
(const guint32 *) ¶ms[i].data.d_selection, 1,
1612
1667
case GIMP_PDB_BOUNDARY:
1613
if (! wire_write_int32 (channel,
1614
(guint32*) ¶ms[i].data.d_boundary, 1,
1668
if (! _gimp_wire_write_int32 (channel,
1669
(const guint32 *) ¶ms[i].data.d_boundary, 1,
1620
if (! wire_write_int32 (channel,
1621
(guint32*) ¶ms[i].data.d_path, 1,
1674
case GIMP_PDB_VECTORS:
1675
if (! _gimp_wire_write_int32 (channel,
1676
(const guint32 *) ¶ms[i].data.d_vectors, 1,
1626
1681
case GIMP_PDB_PARASITE:
1628
GimpParasite *p = (GimpParasite *) ¶ms[i].data.d_parasite;
1629
if (p->name == NULL)
1631
/* write a null string to signifly a null parasite */
1632
wire_write_string (channel, &p->name, 1, user_data);
1635
if (! wire_write_string (channel, &p->name, 1, user_data))
1637
if (! wire_write_int32 (channel, &p->flags, 1, user_data))
1639
if (! wire_write_int32 (channel, &p->size, 1, user_data))
1643
if (! wire_write_int8 (channel, p->data, p->size, user_data))
1683
GimpParasite *p = ¶ms[i].data.d_parasite;
1685
if (p->name == NULL)
1687
/* write a null string to signal a null parasite */
1688
_gimp_wire_write_string (channel, &p->name, 1, user_data);
1692
if (! _gimp_wire_write_string (channel, &p->name, 1, user_data))
1694
if (! _gimp_wire_write_int32 (channel, &p->flags, 1, user_data))
1696
if (! _gimp_wire_write_int32 (channel, &p->size, 1, user_data))
1700
if (! _gimp_wire_write_int8 (channel,
1701
p->data, p->size, user_data))
1649
1707
case GIMP_PDB_STATUS:
1650
if (! wire_write_int32 (channel,
1651
(guint32*) ¶ms[i].data.d_status, 1,
1708
if (! _gimp_wire_write_int32 (channel,
1709
(const guint32 *) ¶ms[i].data.d_status, 1,
1663
_gp_params_destroy (GPParam *params,
1721
gp_params_destroy (GPParam *params,
1669
1726
for (i = 0; i < nparams; i++)
1671
1728
switch (params[i].type)
1673
case GIMP_PDB_INT32:
1674
case GIMP_PDB_INT16:
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:
1687
case GIMP_PDB_STATUS:
1690
case GIMP_PDB_STRING:
1691
g_free (params[i].data.d_string);
1694
case GIMP_PDB_INT32ARRAY:
1695
g_free (params[i].data.d_int32array);
1698
case GIMP_PDB_INT16ARRAY:
1699
g_free (params[i].data.d_int16array);
1702
case GIMP_PDB_INT8ARRAY:
1703
g_free (params[i].data.d_int8array);
1706
case GIMP_PDB_FLOATARRAY:
1707
g_free (params[i].data.d_floatarray);
1710
case GIMP_PDB_STRINGARRAY:
1711
if ((i > 0) && (params[i-1].type == GIMP_PDB_INT32))
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);
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);
1730
case GIMP_PDB_INT32:
1731
case GIMP_PDB_INT16:
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:
1747
case GIMP_PDB_STRING:
1748
g_free (params[i].data.d_string);
1751
case GIMP_PDB_INT32ARRAY:
1752
g_free (params[i].data.d_int32array);
1755
case GIMP_PDB_INT16ARRAY:
1756
g_free (params[i].data.d_int16array);
1759
case GIMP_PDB_INT8ARRAY:
1760
g_free (params[i].data.d_int8array);
1763
case GIMP_PDB_FLOATARRAY:
1764
g_free (params[i].data.d_floatarray);
1767
case GIMP_PDB_STRINGARRAY:
1768
if ((i > 0) && (params[i-1].type == GIMP_PDB_INT32))
1770
gint count = params[i-1].data.d_int32;
1773
for (j = 0; j < count; j++)
1774
g_free (params[i].data.d_stringarray[j]);
1776
g_free (params[i].data.d_stringarray);
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);
1732
1792
g_free (params);