1 /** 2 * Copyright (C) 2001-2002 Artifex Software, Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person 5 * obtaining a copy of this software and associated documentation 6 * files (the "Software"), to deal in the Software without 7 * restriction, including without limitation the rights to use, copy, 8 * modify, merge, publish, distribute, sublicense, and/or sell copies 9 * of the Software, and to permit persons to whom the Software is 10 * furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be 13 * included in all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 * SOFTWARE. 23 **/ 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 typedef struct _IjsServerCtx IjsServerCtx; 30 31 typedef struct { 32 int n_chan; /* number of channels */ 33 int bps; /* bits per sample, one of 1, 2, 4, 8, 16 */ 34 char cs[256]; /* color space, as string */ 35 int width; /* in pixels */ 36 int height; 37 double xres; /* in dpi */ 38 double yres; 39 } IjsPageHeader; 40 41 /* callbacks, lots of callbacks */ 42 43 typedef int IjsBeginJobCb (void *begin_cb_data, 44 IjsServerCtx *ctx, 45 IjsJobId job_id); 46 47 typedef int IjsEndJobCb (void *end_cb_data, 48 IjsServerCtx *ctx, 49 IjsJobId job_id); 50 51 typedef int IjsQueryStatusCb (void *status_cb_data, 52 IjsServerCtx *ctx, 53 IjsJobId job_id); 54 55 typedef int IjsListParamsCb (void *list_cb_data, 56 IjsServerCtx *ctx, 57 IjsJobId job_id, 58 char *val_buf, 59 int val_size); 60 61 typedef int IjsEnumParamCb (void *enum_cb_data, 62 IjsServerCtx *ctx, 63 IjsJobId job_id, 64 const char *key, 65 char *val_buf, 66 int val_size); 67 68 typedef int IjsSetParamCb (void *set_cb_data, 69 IjsServerCtx *ctx, 70 IjsJobId job_id, 71 const char *key, 72 const char *value, 73 int value_size); 74 75 typedef int IjsGetParamCb (void *get_cb_data, 76 IjsServerCtx *ctx, 77 IjsJobId job_id, 78 const char *key, 79 char *val_buf, 80 int val_size); 81 82 IjsServerCtx * 83 ijs_server_init (void); 84 85 int 86 ijs_server_install_begin_cb (IjsServerCtx *ctx, 87 IjsBeginJobCb *begin_cb, void *begin_cb_data); 88 89 int 90 ijs_server_install_end_cb (IjsServerCtx *ctx, 91 IjsEndJobCb *end_cb, void *end_cb_data); 92 93 int 94 ijs_server_install_status_cb (IjsServerCtx *ctx, 95 IjsQueryStatusCb *status_cb, 96 void *status_cb_data); 97 98 int 99 ijs_server_install_list_cb (IjsServerCtx *ctx, 100 IjsListParamsCb *list_cb, void *list_cb_data); 101 102 int 103 ijs_server_install_enum_cb (IjsServerCtx *ctx, 104 IjsEnumParamCb *enum_cb, void *enum_cb_data); 105 106 int 107 ijs_server_install_set_cb (IjsServerCtx *ctx, 108 IjsSetParamCb *set_cb, void *set_cb_data); 109 110 int 111 ijs_server_install_get_cb (IjsServerCtx *ctx, 112 IjsGetParamCb *get_cb, void *get_cb_data); 113 114 void 115 ijs_server_done (IjsServerCtx *ctx); 116 117 int 118 ijs_server_iter (IjsServerCtx *ctx); 119 120 int 121 ijs_server_get_page_header (IjsServerCtx *ctx, IjsPageHeader *ph); 122 123 int 124 ijs_server_get_data (IjsServerCtx *ctx, char *buf, int size); 125 126 #ifdef __cplusplus 127 } 128 #endif 129