mirror of https://github.com/GNOME/gimp.git
added utility functions to send GimpRGB values over the wire.
2006-02-23 Sven Neumann <sven@gimp.org> * libgimpbase/gimpwire.[ch]: added utility functions to send GimpRGB values over the wire. * libgimpbase/gimpprotocol.c: use the functions.
This commit is contained in:
parent
b3c3846ef1
commit
3343baa84c
|
@ -1,3 +1,10 @@
|
||||||
|
2006-02-23 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpbase/gimpwire.[ch]: added utility functions to send
|
||||||
|
GimpRGB values over the wire.
|
||||||
|
|
||||||
|
* libgimpbase/gimpprotocol.c: use the functions.
|
||||||
|
|
||||||
2006-02-22 Simon Budig <simon@gimp.org>
|
2006-02-22 Simon Budig <simon@gimp.org>
|
||||||
|
|
||||||
* app/vectors/gimpvectors-import.c: fix the import of svg circles.
|
* app/vectors/gimpvectors-import.c: fix the import of svg circles.
|
||||||
|
|
|
@ -1396,20 +1396,8 @@ _gp_params_read (GIOChannel *channel,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_PDB_COLOR:
|
case GIMP_PDB_COLOR:
|
||||||
if (! _gimp_wire_read_double (channel,
|
if (! _gimp_wire_read_color (channel,
|
||||||
&(*params)[i].data.d_color.r, 1,
|
&(*params)[i].data.d_color, 1,
|
||||||
user_data))
|
|
||||||
goto cleanup;
|
|
||||||
if (! _gimp_wire_read_double (channel,
|
|
||||||
&(*params)[i].data.d_color.g, 1,
|
|
||||||
user_data))
|
|
||||||
goto cleanup;
|
|
||||||
if (! _gimp_wire_read_double (channel,
|
|
||||||
&(*params)[i].data.d_color.b, 1,
|
|
||||||
user_data))
|
|
||||||
goto cleanup;
|
|
||||||
if (! _gimp_wire_read_double (channel,
|
|
||||||
&(*params)[i].data.d_color.a, 1,
|
|
||||||
user_data))
|
user_data))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
break;
|
break;
|
||||||
|
@ -1626,18 +1614,9 @@ _gp_params_write (GIOChannel *channel,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_PDB_COLOR:
|
case GIMP_PDB_COLOR:
|
||||||
{
|
if (! _gimp_wire_write_color (channel,
|
||||||
GimpRGB *color = (GimpRGB *) ¶ms[i].data.d_color;
|
¶ms[i].data.d_color, 1, user_data))
|
||||||
|
|
||||||
if (! _gimp_wire_write_double (channel, &color->r, 1, user_data))
|
|
||||||
return;
|
return;
|
||||||
if (! _gimp_wire_write_double (channel, &color->g, 1, user_data))
|
|
||||||
return;
|
|
||||||
if (! _gimp_wire_write_double (channel, &color->b, 1, user_data))
|
|
||||||
return;
|
|
||||||
if (! _gimp_wire_write_double (channel, &color->a, 1, user_data))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GIMP_PDB_REGION:
|
case GIMP_PDB_REGION:
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
#include <libgimpcolor/gimpcolortypes.h>
|
||||||
|
|
||||||
#include "gimpwire.h"
|
#include "gimpwire.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -428,6 +430,18 @@ _gimp_wire_read_string (GIOChannel *channel,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
_gimp_wire_read_color (GIOChannel *channel,
|
||||||
|
GimpRGB *data,
|
||||||
|
gint count,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (count >= 0, FALSE);
|
||||||
|
|
||||||
|
return _gimp_wire_read_double (channel,
|
||||||
|
(gdouble *) data, 4 * count, user_data);
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_gimp_wire_write_int32 (GIOChannel *channel,
|
_gimp_wire_write_int32 (GIOChannel *channel,
|
||||||
const guint32 *data,
|
const guint32 *data,
|
||||||
|
@ -570,6 +584,18 @@ _gimp_wire_write_string (GIOChannel *channel,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
_gimp_wire_write_color (GIOChannel *channel,
|
||||||
|
const GimpRGB *data,
|
||||||
|
gint count,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (count >= 0, FALSE);
|
||||||
|
|
||||||
|
return _gimp_wire_write_double (channel,
|
||||||
|
(gdouble *) data, 4 * count, user_data);
|
||||||
|
}
|
||||||
|
|
||||||
static guint
|
static guint
|
||||||
gimp_wire_hash (const guint32 *key)
|
gimp_wire_hash (const guint32 *key)
|
||||||
{
|
{
|
||||||
|
|
|
@ -101,6 +101,10 @@ gboolean _gimp_wire_read_string (GIOChannel *channel,
|
||||||
gchar **data,
|
gchar **data,
|
||||||
gint count,
|
gint count,
|
||||||
gpointer user_data) G_GNUC_INTERNAL;
|
gpointer user_data) G_GNUC_INTERNAL;
|
||||||
|
gboolean _gimp_wire_read_color (GIOChannel *channel,
|
||||||
|
GimpRGB *data,
|
||||||
|
gint count,
|
||||||
|
gpointer user_data) G_GNUC_INTERNAL;
|
||||||
gboolean _gimp_wire_write_int32 (GIOChannel *channel,
|
gboolean _gimp_wire_write_int32 (GIOChannel *channel,
|
||||||
const guint32 *data,
|
const guint32 *data,
|
||||||
gint count,
|
gint count,
|
||||||
|
@ -121,6 +125,10 @@ gboolean _gimp_wire_write_string (GIOChannel *channel,
|
||||||
gchar **data,
|
gchar **data,
|
||||||
gint count,
|
gint count,
|
||||||
gpointer user_data) G_GNUC_INTERNAL;
|
gpointer user_data) G_GNUC_INTERNAL;
|
||||||
|
gboolean _gimp_wire_write_color (GIOChannel *channel,
|
||||||
|
const GimpRGB *data,
|
||||||
|
gint count,
|
||||||
|
gpointer user_data) G_GNUC_INTERNAL;
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
Loading…
Reference in New Issue