home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / libgimp / gimpprotocol.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-29  |  5.3 KB  |  218 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_PROTOCOL_H__
  21. #define __GIMP_PROTOCOL_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. /* Increment every time the protocol changes
  31.  */
  32. #define GP_VERSION 0x0004
  33.  
  34.  
  35. enum
  36. {
  37.   GP_QUIT,
  38.   GP_CONFIG,
  39.   GP_TILE_REQ,
  40.   GP_TILE_ACK,
  41.   GP_TILE_DATA,
  42.   GP_PROC_RUN,
  43.   GP_PROC_RETURN,
  44.   GP_TEMP_PROC_RUN,
  45.   GP_TEMP_PROC_RETURN,
  46.   GP_PROC_INSTALL,
  47.   GP_PROC_UNINSTALL,
  48.   GP_EXTENSION_ACK
  49. };
  50.  
  51.  
  52. typedef struct _GPConfig        GPConfig;
  53. typedef struct _GPTileReq       GPTileReq;
  54. typedef struct _GPTileAck       GPTileAck;
  55. typedef struct _GPTileData      GPTileData;
  56. typedef struct _GPParam         GPParam;
  57. typedef struct _GPParamDef      GPParamDef;
  58. typedef struct _GPProcRun       GPProcRun;
  59. typedef struct _GPProcReturn    GPProcReturn;
  60. typedef struct _GPProcInstall   GPProcInstall;
  61. typedef struct _GPProcUninstall GPProcUninstall;
  62.  
  63.  
  64. struct _GPConfig
  65. {
  66.   guint32 version;
  67.   guint32 tile_width;
  68.   guint32 tile_height;
  69.   gint32  shm_ID;
  70.   gdouble gamma;
  71.   gint8   install_cmap;
  72.   gint8   use_xshm;
  73.   gint32  min_colors;
  74.   gint32  gdisp_ID;
  75. };
  76.  
  77. struct _GPTileReq
  78. {
  79.   gint32  drawable_ID;
  80.   guint32 tile_num;
  81.   guint32 shadow;
  82. };
  83.  
  84. struct _GPTileData
  85. {
  86.   gint32   drawable_ID;
  87.   guint32  tile_num;
  88.   guint32  shadow;
  89.   guint32  bpp;
  90.   guint32  width;
  91.   guint32  height;
  92.   guint32  use_shm;
  93.   guchar  *data;
  94. };
  95.  
  96. struct _GPParam
  97. {
  98.   guint32 type;
  99.  
  100.   union
  101.   {
  102.     gint32    d_int32;
  103.     gint16    d_int16;
  104.     gint8     d_int8;
  105.     gdouble   d_float;
  106.     gchar    *d_string;
  107.     gint32   *d_int32array;
  108.     gint16   *d_int16array;
  109.     gint8    *d_int8array;
  110.     gdouble  *d_floatarray;
  111.     gchar   **d_stringarray;
  112.     struct
  113.     {
  114.       guint8 red;
  115.       guint8 green;
  116.       guint8 blue;
  117.     } d_color;
  118.     struct
  119.     {
  120.       gint32 x;
  121.       gint32 y;
  122.       gint32 width;
  123.       gint32 height;
  124.     } d_region;
  125.     gint32 d_display;
  126.     gint32 d_image;
  127.     gint32 d_layer;
  128.     gint32 d_channel;
  129.     gint32 d_drawable;
  130.     gint32 d_selection;
  131.     gint32 d_boundary;
  132.     gint32 d_path;
  133.     struct
  134.     {
  135.       gchar    *name;
  136.       guint32   flags;
  137.       guint32   size;
  138.       gpointer  data;
  139.     } d_parasite;
  140.     gint32 d_status;
  141.   } data;
  142. };
  143.  
  144. struct _GPParamDef
  145. {
  146.   guint32  type;
  147.   gchar   *name;
  148.   gchar   *description;
  149. };
  150.  
  151. struct _GPProcRun
  152. {
  153.   gchar   *name;
  154.   guint32  nparams;
  155.   GPParam *params;
  156. };
  157.  
  158. struct _GPProcReturn
  159. {
  160.   gchar   *name;
  161.   guint32  nparams;
  162.   GPParam *params;
  163. };
  164.  
  165. struct _GPProcInstall
  166. {
  167.   gchar      *name;
  168.   gchar      *blurb;
  169.   gchar      *help;
  170.   gchar      *author;
  171.   gchar      *copyright;
  172.   gchar      *date;
  173.   gchar      *menu_path;
  174.   gchar      *image_types;
  175.   guint32     type;
  176.   guint32     nparams;
  177.   guint32     nreturn_vals;
  178.   GPParamDef *params;
  179.   GPParamDef *return_vals;
  180. };
  181.  
  182. struct _GPProcUninstall
  183. {
  184.   gchar *name;
  185. };
  186.  
  187.  
  188. void      gp_init                   (void);
  189.  
  190. gboolean  gp_quit_write             (GIOChannel      *channel);
  191. gboolean  gp_config_write           (GIOChannel      *channel,
  192.                      GPConfig        *config);
  193. gboolean  gp_tile_req_write         (GIOChannel      *channel,
  194.                      GPTileReq       *tile_req);
  195. gboolean  gp_tile_ack_write         (GIOChannel      *channel);
  196. gboolean  gp_tile_data_write        (GIOChannel      *channel,
  197.                      GPTileData      *tile_data);
  198. gboolean  gp_proc_run_write         (GIOChannel      *channel,
  199.                      GPProcRun       *proc_run);
  200. gboolean  gp_proc_return_write      (GIOChannel      *channel,
  201.                      GPProcReturn    *proc_return);
  202. gboolean  gp_temp_proc_run_write    (GIOChannel      *channel,
  203.                      GPProcRun       *proc_run);
  204. gboolean  gp_temp_proc_return_write (GIOChannel      *channel,
  205.                      GPProcReturn    *proc_return);
  206. gboolean  gp_proc_install_write     (GIOChannel      *channel,
  207.                      GPProcInstall   *proc_install);
  208. gboolean  gp_proc_uninstall_write   (GIOChannel      *channel,
  209.                      GPProcUninstall *proc_uninstall);
  210. gboolean  gp_extension_ack_write    (GIOChannel      *channel);
  211.  
  212.  
  213. #ifdef __cplusplus
  214. }
  215. #endif /* __cplusplus */
  216.  
  217. #endif /* __GIMP_PROTOCOL_H__ */
  218.