home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / libgimp / gimpwire.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-06  |  3.8 KB  |  114 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. #ifndef __GIMP_WIRE_H__
  21. #define __GIMP_WIRE_H__
  22.  
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif /* __cplusplus */
  26.  
  27. /* For information look into the C source or the html documentation */
  28.  
  29.  
  30. typedef struct _WireMessage  WireMessage;
  31.  
  32. typedef void     (* WireReadFunc)    (GIOChannel  *channel,
  33.                       WireMessage *msg);
  34. typedef void     (* WireWriteFunc)   (GIOChannel  *channel,
  35.                       WireMessage *msg);
  36. typedef void     (* WireDestroyFunc) (WireMessage *msg);
  37. typedef gboolean (* WireIOFunc)      (GIOChannel  *channel,
  38.                       guint8      *buf,
  39.                       gulong       count);
  40. typedef gboolean (* WireFlushFunc)   (GIOChannel  *channel);
  41.  
  42.  
  43. struct _WireMessage
  44. {
  45.   guint32  type;
  46.   gpointer data;
  47. };
  48.  
  49.  
  50. void      wire_register     (guint32          type,
  51.                  WireReadFunc     read_func,
  52.                  WireWriteFunc    write_func,
  53.                  WireDestroyFunc  destroy_func);
  54.  
  55. void      wire_set_reader   (WireIOFunc       read_func);
  56. void      wire_set_writer   (WireIOFunc       write_func);
  57. void      wire_set_flusher  (WireFlushFunc    flush_func);
  58.  
  59. gboolean  wire_read         (GIOChannel         *channel,
  60.                  guint8          *buf,
  61.                  gulong           count);
  62. gboolean  wire_write        (GIOChannel      *channel,
  63.                  guint8          *buf,
  64.                  gulong           count);
  65. gboolean  wire_flush        (GIOChannel         *channel);
  66.  
  67. gboolean  wire_error        (void);
  68. void      wire_clear_error  (void);
  69.  
  70. gboolean  wire_read_msg     (GIOChannel         *channel,
  71.                  WireMessage     *msg);
  72. gboolean  wire_write_msg    (GIOChannel         *channel,
  73.                  WireMessage     *msg);
  74.  
  75. void      wire_destroy      (WireMessage     *msg);
  76.  
  77. gboolean  wire_read_int32   (GIOChannel      *channel,
  78.                  guint32         *data,
  79.                  gint             count);
  80. gboolean  wire_read_int16   (GIOChannel         *channel,
  81.                  guint16         *data,
  82.                  gint             count);
  83. gboolean  wire_read_int8    (GIOChannel      *channel,
  84.                  guint8          *data,
  85.                  gint             count);
  86. gboolean  wire_read_double  (GIOChannel      *channel,
  87.                  gdouble         *data,
  88.                  gint             count);
  89. gboolean  wire_read_string  (GIOChannel      *channel,
  90.                  gchar          **data,
  91.                  gint             count);
  92. gboolean  wire_write_int32  (GIOChannel      *channel,
  93.                  guint32         *data,
  94.                  gint             count);
  95. gboolean  wire_write_int16  (GIOChannel      *channel,
  96.                  guint16         *data,
  97.                  gint             count);
  98. gboolean  wire_write_int8   (GIOChannel      *channel,
  99.                  guint8          *data,
  100.                  gint             count);
  101. gboolean  wire_write_double (GIOChannel      *channel,
  102.                  gdouble         *data,
  103.                  gint             count);
  104. gboolean  wire_write_string (GIOChannel      *channel,
  105.                  gchar          **data,
  106.                  gint             count);
  107.  
  108.  
  109. #ifdef __cplusplus
  110. }
  111. #endif /* __cplusplus */
  112.  
  113. #endif /* __GIMP_WIRE_H__ */
  114.