gimpprotocol.h 6.33 KB
Newer Older
1
/* LIBGIMP - The GIMP Library
2
 * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
Manish Singh's avatar
Manish Singh committed
3
 *
4
 * This library is free software: you can redistribute it and/or
Marc Lehmann's avatar
Marc Lehmann committed
5
 * modify it under the terms of the GNU Lesser General Public
Manish Singh's avatar
Manish Singh committed
6
 * License as published by the Free Software Foundation; either
7
 * version 3 of the License, or (at your option) any later version.
8 9 10 11
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
Manish Singh's avatar
Manish Singh committed
13
 *
Marc Lehmann's avatar
Marc Lehmann committed
14
 * You should have received a copy of the GNU Lesser General Public
15 16
 * License along with this library.  If not, see
 * <http://www.gnu.org/licenses/>.
17
 */
18

Elliot Lee's avatar
Elliot Lee committed
19 20 21
#ifndef __GIMP_PROTOCOL_H__
#define __GIMP_PROTOCOL_H__

22
G_BEGIN_DECLS
23 24 25

/* For information look into the C source or the html documentation */

Elliot Lee's avatar
Elliot Lee committed
26 27 28

/* Increment every time the protocol changes
 */
29
#define GIMP_PROTOCOL_VERSION  0x0015
Elliot Lee's avatar
Elliot Lee committed
30 31


Michael Natterer's avatar
Michael Natterer committed
32 33
enum
{
Elliot Lee's avatar
Elliot Lee committed
34 35 36 37 38 39 40 41 42 43 44
  GP_QUIT,
  GP_CONFIG,
  GP_TILE_REQ,
  GP_TILE_ACK,
  GP_TILE_DATA,
  GP_PROC_RUN,
  GP_PROC_RETURN,
  GP_TEMP_PROC_RUN,
  GP_TEMP_PROC_RETURN,
  GP_PROC_INSTALL,
  GP_PROC_UNINSTALL,
45 46
  GP_EXTENSION_ACK,
  GP_HAS_INIT
Elliot Lee's avatar
Elliot Lee committed
47 48 49
};


Michael Natterer's avatar
Michael Natterer committed
50 51 52 53 54 55 56 57 58 59
typedef struct _GPConfig        GPConfig;
typedef struct _GPTileReq       GPTileReq;
typedef struct _GPTileAck       GPTileAck;
typedef struct _GPTileData      GPTileData;
typedef struct _GPParam         GPParam;
typedef struct _GPParamDef      GPParamDef;
typedef struct _GPProcRun       GPProcRun;
typedef struct _GPProcReturn    GPProcReturn;
typedef struct _GPProcInstall   GPProcInstall;
typedef struct _GPProcUninstall GPProcUninstall;
Elliot Lee's avatar
Elliot Lee committed
60 61 62 63


struct _GPConfig
{
64 65 66 67
  guint32  version;
  guint32  tile_width;
  guint32  tile_height;
  gint32   shm_ID;
68 69
  gint8    check_size;
  gint8    check_type;
70
  gint8    show_help_button;
71
  gint8    use_cpu_accel;
72
  gint8    use_opencl;
73 74 75
  gint8    gimp_reserved_6;
  gint8    gimp_reserved_7;
  gint8    gimp_reserved_8;
76
  gint8    install_cmap;
77
  gint8    show_tooltips;
78 79
  gint32   min_colors;
  gint32   gdisp_ID;
80
  gchar   *app_name;
81 82 83
  gchar   *wm_class;
  gchar   *display_name;
  gint32   monitor_number;
84
  guint32  timestamp;
Elliot Lee's avatar
Elliot Lee committed
85 86 87 88
};

struct _GPTileReq
{
89 90 91
  gint32   drawable_ID;
  guint32  tile_num;
  guint32  shadow;
Elliot Lee's avatar
Elliot Lee committed
92 93 94 95
};

struct _GPTileData
{
Michael Natterer's avatar
Michael Natterer committed
96 97 98 99 100 101 102 103
  gint32   drawable_ID;
  guint32  tile_num;
  guint32  shadow;
  guint32  bpp;
  guint32  width;
  guint32  height;
  guint32  use_shm;
  guchar  *data;
Elliot Lee's avatar
Elliot Lee committed
104 105 106 107 108 109
};

struct _GPParam
{
  guint32 type;

Michael Natterer's avatar
Michael Natterer committed
110 111
  union
  {
112 113 114 115 116 117 118 119 120 121
    gint32        d_int32;
    gint16        d_int16;
    guint8        d_int8;
    gdouble       d_float;
    gchar        *d_string;
    gint32       *d_int32array;
    gint16       *d_int16array;
    guint8       *d_int8array;
    gdouble      *d_floatarray;
    gchar       **d_stringarray;
122
    GimpRGB      *d_colorarray;
123
    GimpRGB       d_color;
Michael Natterer's avatar
Michael Natterer committed
124 125
    struct
    {
Elliot Lee's avatar
Elliot Lee committed
126 127 128 129
      gint32 x;
      gint32 y;
      gint32 width;
      gint32 height;
130
    } d_region; /* deprecated */
131 132
    gint32        d_display;
    gint32        d_image;
133
    gint32        d_item;
134 135 136 137 138 139 140 141 142
    gint32        d_layer;
    gint32        d_channel;
    gint32        d_drawable;
    gint32        d_selection;
    gint32        d_boundary;
    gint32        d_path; /* deprecated */
    gint32        d_vectors;
    gint32        d_status;
    GimpParasite  d_parasite;
Elliot Lee's avatar
Elliot Lee committed
143 144 145 146 147
  } data;
};

struct _GPParamDef
{
Michael Natterer's avatar
Michael Natterer committed
148 149 150
  guint32  type;
  gchar   *name;
  gchar   *description;
Elliot Lee's avatar
Elliot Lee committed
151 152 153 154
};

struct _GPProcRun
{
Michael Natterer's avatar
Michael Natterer committed
155 156
  gchar   *name;
  guint32  nparams;
Elliot Lee's avatar
Elliot Lee committed
157 158 159 160 161
  GPParam *params;
};

struct _GPProcReturn
{
Michael Natterer's avatar
Michael Natterer committed
162 163
  gchar   *name;
  guint32  nparams;
Elliot Lee's avatar
Elliot Lee committed
164 165 166 167 168
  GPParam *params;
};

struct _GPProcInstall
{
Michael Natterer's avatar
Michael Natterer committed
169 170 171 172 173 174 175 176 177 178 179
  gchar      *name;
  gchar      *blurb;
  gchar      *help;
  gchar      *author;
  gchar      *copyright;
  gchar      *date;
  gchar      *menu_path;
  gchar      *image_types;
  guint32     type;
  guint32     nparams;
  guint32     nreturn_vals;
Elliot Lee's avatar
Elliot Lee committed
180 181 182 183 184 185
  GPParamDef *params;
  GPParamDef *return_vals;
};

struct _GPProcUninstall
{
Michael Natterer's avatar
Michael Natterer committed
186
  gchar *name;
Elliot Lee's avatar
Elliot Lee committed
187 188 189
};


Michael Natterer's avatar
Michael Natterer committed
190 191
void      gp_init                   (void);

192 193
gboolean  gp_quit_write             (GIOChannel      *channel,
                                     gpointer         user_data);
Michael Natterer's avatar
Michael Natterer committed
194
gboolean  gp_config_write           (GIOChannel      *channel,
Sven Neumann's avatar
Sven Neumann committed
195
                                     GPConfig        *config,
196
                                     gpointer         user_data);
Michael Natterer's avatar
Michael Natterer committed
197
gboolean  gp_tile_req_write         (GIOChannel      *channel,
Sven Neumann's avatar
Sven Neumann committed
198
                                     GPTileReq       *tile_req,
199 200 201
                                     gpointer         user_data);
gboolean  gp_tile_ack_write         (GIOChannel      *channel,
                                     gpointer         user_data);
Michael Natterer's avatar
Michael Natterer committed
202
gboolean  gp_tile_data_write        (GIOChannel      *channel,
Sven Neumann's avatar
Sven Neumann committed
203
                                     GPTileData      *tile_data,
204
                                     gpointer         user_data);
Michael Natterer's avatar
Michael Natterer committed
205
gboolean  gp_proc_run_write         (GIOChannel      *channel,
Sven Neumann's avatar
Sven Neumann committed
206
                                     GPProcRun       *proc_run,
207
                                     gpointer         user_data);
Michael Natterer's avatar
Michael Natterer committed
208
gboolean  gp_proc_return_write      (GIOChannel      *channel,
Sven Neumann's avatar
Sven Neumann committed
209
                                     GPProcReturn    *proc_return,
210
                                     gpointer         user_data);
Michael Natterer's avatar
Michael Natterer committed
211
gboolean  gp_temp_proc_run_write    (GIOChannel      *channel,
Sven Neumann's avatar
Sven Neumann committed
212
                                     GPProcRun       *proc_run,
213
                                     gpointer         user_data);
Michael Natterer's avatar
Michael Natterer committed
214
gboolean  gp_temp_proc_return_write (GIOChannel      *channel,
Sven Neumann's avatar
Sven Neumann committed
215
                                     GPProcReturn    *proc_return,
216
                                     gpointer         user_data);
Michael Natterer's avatar
Michael Natterer committed
217
gboolean  gp_proc_install_write     (GIOChannel      *channel,
Sven Neumann's avatar
Sven Neumann committed
218
                                     GPProcInstall   *proc_install,
219
                                     gpointer         user_data);
Michael Natterer's avatar
Michael Natterer committed
220
gboolean  gp_proc_uninstall_write   (GIOChannel      *channel,
Sven Neumann's avatar
Sven Neumann committed
221
                                     GPProcUninstall *proc_uninstall,
222 223 224 225 226
                                     gpointer         user_data);
gboolean  gp_extension_ack_write    (GIOChannel      *channel,
                                     gpointer         user_data);
gboolean  gp_has_init_write         (GIOChannel      *channel,
                                     gpointer         user_data);
Elliot Lee's avatar
Elliot Lee committed
227

228 229 230
void      gp_params_destroy         (GPParam         *params,
                                     gint             nparams);

Elliot Lee's avatar
Elliot Lee committed
231

232
G_END_DECLS
233

Elliot Lee's avatar
Elliot Lee committed
234
#endif /* __GIMP_PROTOCOL_H__ */