00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __GPHOTO2_CONTEXT_H__
00022 #define __GPHOTO2_CONTEXT_H__
00023
00024 #include <stdarg.h>
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030 typedef struct _GPContext GPContext;
00031
00032 GPContext *gp_context_new (void);
00033
00034 void gp_context_ref (GPContext *context);
00035 void gp_context_unref (GPContext *context);
00036
00037 enum _GPContextFeedback {
00038 GP_CONTEXT_FEEDBACK_OK,
00039 GP_CONTEXT_FEEDBACK_CANCEL
00040 };
00041 typedef enum _GPContextFeedback GPContextFeedback;
00042
00043
00044 typedef void (* GPContextIdleFunc) (GPContext *context, void *data);
00045 typedef void (* GPContextErrorFunc) (GPContext *context, const char *format,
00046 va_list args, void *data)
00047 #if (__GNUC__ >= 3)
00048 __attribute__((__format__(printf,2,0)))
00049 #endif
00050 ;
00051 typedef void (* GPContextStatusFunc) (GPContext *context, const char *format,
00052 va_list args, void *data)
00053 #if (__GNUC__ >= 3)
00054 __attribute__((__format__(printf,2,0)))
00055 #endif
00056 ;
00057 typedef void (* GPContextMessageFunc) (GPContext *context, const char *format,
00058 va_list args, void *data)
00059 #if (__GNUC__ >= 3)
00060 __attribute__((__format__(printf,2,0)))
00061 #endif
00062 ;
00063 typedef GPContextFeedback (* GPContextQuestionFunc) (GPContext *context,
00064 const char *format,
00065 va_list args, void *data)
00066 #if (__GNUC__ >= 3)
00067 __attribute__((__format__(printf,2,0)))
00068 #endif
00069 ;
00070 typedef GPContextFeedback (* GPContextCancelFunc) (GPContext *context,
00071 void *data);
00072 typedef unsigned int (* GPContextProgressStartFunc) (GPContext *context,
00073 float target,
00074 const char *format,
00075 va_list args, void *data)
00076 #if (__GNUC__ >= 3)
00077 __attribute__((__format__(printf,3,0)))
00078 #endif
00079 ;
00080 typedef void (* GPContextProgressUpdateFunc) (GPContext *context,
00081 unsigned int id,
00082 float current,
00083 void *data);
00084 typedef void (* GPContextProgressStopFunc) (GPContext *context,
00085 unsigned int id,
00086 void *data);
00087
00088
00089 void gp_context_set_idle_func (GPContext *context,
00090 GPContextIdleFunc func, void *data);
00091 void gp_context_set_progress_funcs (GPContext *context,
00092 GPContextProgressStartFunc start_func,
00093 GPContextProgressUpdateFunc update_func,
00094 GPContextProgressStopFunc stop_func,
00095 void *data);
00096 void gp_context_set_error_func (GPContext *context,
00097 GPContextErrorFunc func, void *data);
00098 void gp_context_set_status_func (GPContext *context,
00099 GPContextStatusFunc func, void *data);
00100 void gp_context_set_question_func (GPContext *context,
00101 GPContextQuestionFunc func, void *data);
00102 void gp_context_set_cancel_func (GPContext *context,
00103 GPContextCancelFunc func, void *data);
00104 void gp_context_set_message_func (GPContext *context,
00105 GPContextMessageFunc func, void *data);
00106
00107
00108 void gp_context_idle (GPContext *context);
00109 void gp_context_error (GPContext *context, const char *format, ...)
00110 #ifdef __GNUC__
00111 __attribute__((__format__(printf,2,3)))
00112 #endif
00113 ;
00114 void gp_context_status (GPContext *context, const char *format, ...)
00115 #ifdef __GNUC__
00116 __attribute__((__format__(printf,2,3)))
00117 #endif
00118 ;
00119 void gp_context_message (GPContext *context, const char *format, ...)
00120 #ifdef __GNUC__
00121 __attribute__((__format__(printf,2,3)))
00122 #endif
00123 ;
00124 GPContextFeedback gp_context_question (GPContext *context, const char *format,
00125 ...)
00126 #ifdef __GNUC__
00127 __attribute__((__format__(printf,2,3)))
00128 #endif
00129 ;
00130 GPContextFeedback gp_context_cancel (GPContext *context);
00131 unsigned int gp_context_progress_start (GPContext *context, float target,
00132 const char *format, ...)
00133 #ifdef __GNUC__
00134 __attribute__((__format__(printf,3,4)))
00135 #endif
00136 ;
00137 void gp_context_progress_update (GPContext *context, unsigned int id,
00138 float current);
00139 void gp_context_progress_stop (GPContext *context, unsigned int id);
00140
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144
00145 #endif