-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcallback.h
44 lines (38 loc) · 944 Bytes
/
callback.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef _CALLBACK_H_
#define _CALLBACK_H_
#if 0
struct callback_table_t;
typedef struct callback_table_t callback_table_t;
#endif
typedef enum {
PDF_CALLBACK_WARNING = 0,
PDF_CALLBACK_ERROR,
PDF_CALLBACK_FINISH,
PDF_CALLBACK_PROGRESS,
PDF_CALLBACK_PHASE
#if 0
,PDF_CALLBACK_INVALID
#endif
} callback_type_t;
typedef enum {
LOOKUP_ERROR_SUCCESS = 0,
LOOKUP_ERROR_FAIL
} lookup_error_t;
typedef struct {
PyObject *warning_cb;
PyObject *error_cb;
PyObject *finish_cb;
PyObject *progress_cb;
PyObject *phase_cb;
} convertor_callbacks_t;
#ifdef __cplusplus
extern "C" {
#endif
lookup_error_t add_callback(callback_type_t cb_type, wkhtmltopdf_converter *conv, PyObject *callback);
PyObject *get_callback(callback_type_t cb_type, wkhtmltopdf_converter *conv);
void del_callback(callback_type_t cb_type, wkhtmltopdf_converter *conv);
void clean_all(wkhtmltopdf_converter *conv);
#ifdef __cplusplus
}
#endif
#endif /* _CALLBACK_H_ */