| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
#ifndef GUTENPRINTUI_H |
| 28 |
#define GUTENPRINTUI_H |
| 29 |
|
| 30 |
#ifdef __cplusplus |
| 31 |
extern "C" { |
| 32 |
#endif |
| 33 |
|
| 34 |
|
| 35 |
#ifdef __GNUC__ |
| 36 |
#ifndef inline |
| 37 |
#define inline __inline__ |
| 38 |
#endif |
| 39 |
#endif |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
#pragma GCC diagnostic push |
| 44 |
#pragma GCC diagnostic ignored "-Wstrict-prototypes" |
| 45 |
#pragma GCC diagnostic ignored "-Wredundant-decls" |
| 46 |
#pragma GCC diagnostic ignored "-Wunused-function" |
| 47 |
#pragma GCC diagnostic ignored "-Wcast-qual" |
| 48 |
#pragma GCC diagnostic ignored "-Wpedantic" |
| 49 |
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
| 50 |
#include <gtk/gtk.h> |
| 51 |
#pragma GCC diagnostic pop |
| 52 |
|
| 53 |
#include <gutenprint/gutenprint.h> |
| 54 |
|
| 55 |
#include <gutenprintui2/curve.h> |
| 56 |
#include <gutenprintui2/gammacurve.h> |
| 57 |
#include <gutenprintui2/typebuiltins.h> |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
typedef enum |
| 64 |
{ |
| 65 |
ORIENT_AUTO = -1, |
| 66 |
ORIENT_PORTRAIT = 0, |
| 67 |
ORIENT_LANDSCAPE = 1, |
| 68 |
ORIENT_UPSIDEDOWN = 2, |
| 69 |
ORIENT_SEASCAPE = 3 |
| 70 |
} orient_t; |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
typedef enum |
| 77 |
{ |
| 78 |
COMMAND_TYPE_DEFAULT, |
| 79 |
COMMAND_TYPE_CUSTOM, |
| 80 |
COMMAND_TYPE_FILE |
| 81 |
} command_t; |
| 82 |
|
| 83 |
typedef struct |
| 84 |
{ |
| 85 |
char *name; |
| 86 |
command_t command_type; |
| 87 |
char *queue_name; |
| 88 |
char *extra_printer_options; |
| 89 |
char *custom_command; |
| 90 |
char *current_standard_command; |
| 91 |
char *output_filename; |
| 92 |
float scaling; |
| 93 |
orient_t orientation; |
| 94 |
int unit; |
| 95 |
int auto_size_roll_feed_paper; |
| 96 |
int invalid_mask; |
| 97 |
stp_vars_t *v; |
| 98 |
} stpui_plist_t; |
| 99 |
|
| 100 |
typedef struct stpui_image |
| 101 |
{ |
| 102 |
stp_image_t im; |
| 103 |
void (*transpose)(struct stpui_image *image); |
| 104 |
void (*hflip)(struct stpui_image *image); |
| 105 |
void (*vflip)(struct stpui_image *image); |
| 106 |
void (*rotate_ccw)(struct stpui_image *image); |
| 107 |
void (*rotate_cw)(struct stpui_image *image); |
| 108 |
void (*rotate_180)(struct stpui_image *image); |
| 109 |
void (*crop)(struct stpui_image *image, int left, int top, |
| 110 |
int right, int bottom); |
| 111 |
} stpui_image_t; |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
extern void stpui_plist_set_name(stpui_plist_t *p, const char *val); |
| 117 |
extern void stpui_plist_set_name_n(stpui_plist_t *p, const char *val, int n); |
| 118 |
extern const char *stpui_plist_get_name(const stpui_plist_t *p); |
| 119 |
|
| 120 |
extern void stpui_plist_set_queue_name(stpui_plist_t *p, const char *val); |
| 121 |
extern void stpui_plist_set_queue_name_n(stpui_plist_t *p, const char *val, int n); |
| 122 |
extern const char *stpui_plist_get_queue_name(const stpui_plist_t *p); |
| 123 |
|
| 124 |
extern void stpui_plist_set_output_filename(stpui_plist_t *p, const char *val); |
| 125 |
extern void stpui_plist_set_output_filename_n(stpui_plist_t *p, const char *val, int n); |
| 126 |
extern const char *stpui_plist_get_output_filename(const stpui_plist_t *p); |
| 127 |
|
| 128 |
extern void stpui_plist_set_extra_printer_options(stpui_plist_t *p, const char *val); |
| 129 |
extern void stpui_plist_set_extra_printer_options_n(stpui_plist_t *p, const char *val, int n); |
| 130 |
extern const char *stpui_plist_get_extra_printer_options(const stpui_plist_t *p); |
| 131 |
|
| 132 |
extern void stpui_plist_set_custom_command(stpui_plist_t *p, const char *val); |
| 133 |
extern void stpui_plist_set_custom_command_n(stpui_plist_t *p, const char *val, int n); |
| 134 |
extern const char *stpui_plist_get_custom_command(const stpui_plist_t *p); |
| 135 |
|
| 136 |
extern void stpui_plist_set_copy_count(stpui_plist_t *p, gint count); |
| 137 |
extern int stpui_plist_get_copy_count(const stpui_plist_t *p); |
| 138 |
|
| 139 |
extern void stpui_plist_set_current_standard_command(stpui_plist_t *p, const char *val); |
| 140 |
extern void stpui_plist_set_current_standard_command_n(stpui_plist_t *p, const char *val, int n); |
| 141 |
extern const char *stpui_plist_get_current_standard_command(const stpui_plist_t *p); |
| 142 |
|
| 143 |
extern void stpui_plist_set_command_type(stpui_plist_t *p, command_t val); |
| 144 |
extern command_t stpui_plist_get_command_type(const stpui_plist_t *p); |
| 145 |
|
| 146 |
extern void stpui_set_global_parameter(const char *param, const char *value); |
| 147 |
extern const char *stpui_get_global_parameter(const char *param); |
| 148 |
|
| 149 |
extern void stpui_plist_copy(stpui_plist_t *vd, const stpui_plist_t *vs); |
| 150 |
extern int stpui_plist_add(const stpui_plist_t *key, int add_only); |
| 151 |
extern void stpui_printer_initialize(stpui_plist_t *printer); |
| 152 |
extern const stpui_plist_t *stpui_get_current_printer(void); |
| 153 |
|
| 154 |
extern char *stpui_build_standard_print_command(const stpui_plist_t *plist, |
| 155 |
const stp_printer_t *printer); |
| 156 |
|
| 157 |
extern void stpui_set_printrc_file(const char *name); |
| 158 |
extern const char * stpui_get_printrc_file(void); |
| 159 |
extern void stpui_printrc_load (void); |
| 160 |
extern void stpui_get_system_printers (void); |
| 161 |
extern void stpui_printrc_save (void); |
| 162 |
extern void stpui_set_image_filename(const char *); |
| 163 |
extern const char *stpui_get_image_filename(void); |
| 164 |
extern void stpui_set_errfunc(stp_outfunc_t wfunc); |
| 165 |
extern stp_outfunc_t stpui_get_errfunc(void); |
| 166 |
extern void stpui_set_errdata(void *errdata); |
| 167 |
extern void *stpui_get_errdata(void); |
| 168 |
|
| 169 |
extern gint stpui_do_print_dialog (void); |
| 170 |
|
| 171 |
extern gint stpui_compute_orientation(void); |
| 172 |
extern void stpui_set_image_dimensions(gint width, gint height); |
| 173 |
extern void stpui_set_image_resolution(gdouble xres, gdouble yres); |
| 174 |
extern void stpui_set_image_type(const char *image_type); |
| 175 |
extern void stpui_set_image_raw_channels(gint channels); |
| 176 |
extern void stpui_set_image_channel_depth(gint bit_depth); |
| 177 |
|
| 178 |
typedef guchar *(*get_thumbnail_func_t)(void *data, gint *width, gint *height, |
| 179 |
gint *bpp, gint page); |
| 180 |
extern void stpui_set_thumbnail_func(get_thumbnail_func_t); |
| 181 |
extern get_thumbnail_func_t stpui_get_thumbnail_func(void); |
| 182 |
extern void stpui_set_thumbnail_data(void *); |
| 183 |
extern void *stpui_get_thumbnail_data(void); |
| 184 |
|
| 185 |
extern int stpui_print(const stpui_plist_t *printer, stpui_image_t *im); |
| 186 |
|
| 187 |
|
| 188 |
#ifdef __cplusplus |
| 189 |
} |
| 190 |
#endif |
| 191 |
|
| 192 |
#endif |