gphoto2-context.h

Go to the documentation of this file.
00001 
00025 #ifndef __GPHOTO2_CONTEXT_H__
00026 #define __GPHOTO2_CONTEXT_H__
00027 
00028 #include <stdarg.h>
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif /* __cplusplus */
00033 
00041 typedef struct _GPContext GPContext;
00042 
00043 GPContext *gp_context_new (void);
00044 
00045 void gp_context_ref   (GPContext *context);
00046 void gp_context_unref (GPContext *context);
00047 
00055 typedef enum _GPContextFeedback {
00056         GP_CONTEXT_FEEDBACK_OK,         
00057         GP_CONTEXT_FEEDBACK_CANCEL      
00058 } GPContextFeedback;
00059 
00060 /* Functions */
00061 typedef void (* GPContextIdleFunc)     (GPContext *context, void *data);
00062 typedef void (* GPContextErrorFunc)    (GPContext *context, const char *format,
00063                                         va_list args, void *data)
00064 #if (__GNUC__ >= 3)
00065         __attribute__((__format__(printf,2,0)))
00066 #endif
00067 ;
00068 typedef void (* GPContextStatusFunc)   (GPContext *context, const char *format,
00069                                         va_list args, void *data)
00070 #if (__GNUC__ >= 3)
00071         __attribute__((__format__(printf,2,0)))
00072 #endif
00073 ;
00074 typedef void (* GPContextMessageFunc)  (GPContext *context, const char *format,
00075                                         va_list args, void *data)
00076 #if (__GNUC__ >= 3)
00077         __attribute__((__format__(printf,2,0)))
00078 #endif
00079 ;
00080 typedef GPContextFeedback (* GPContextQuestionFunc) (GPContext *context,
00081                                                      const char *format,
00082                                                      va_list args, void *data)
00083 #if (__GNUC__ >= 3)
00084         __attribute__((__format__(printf,2,0)))
00085 #endif
00086 ;
00087 typedef GPContextFeedback (* GPContextCancelFunc)   (GPContext *context,
00088                                                      void *data);
00089 typedef unsigned int (* GPContextProgressStartFunc)  (GPContext *context,
00090                                                       float target,
00091                                                       const char *format,
00092                                                       va_list args, void *data)
00093 #if (__GNUC__ >= 3)
00094         __attribute__((__format__(printf,3,0)))
00095 #endif
00096 ;
00097 typedef void         (* GPContextProgressUpdateFunc) (GPContext *context,
00098                                                       unsigned int id,
00099                                                       float current,
00100                                                       void *data);
00101 typedef void         (* GPContextProgressStopFunc)   (GPContext *context,
00102                                                       unsigned int id,
00103                                                       void *data);
00104 
00105 /* Setting those functions (frontends) */
00106 void gp_context_set_idle_func      (GPContext *context,
00107                                     GPContextIdleFunc func,     void *data);
00108 void gp_context_set_progress_funcs (GPContext *context,
00109                                     GPContextProgressStartFunc  start_func,
00110                                     GPContextProgressUpdateFunc update_func,
00111                                     GPContextProgressStopFunc   stop_func,
00112                                     void *data);
00113 void gp_context_set_error_func     (GPContext *context,
00114                                     GPContextErrorFunc func,    void *data);
00115 void gp_context_set_status_func    (GPContext *context,
00116                                     GPContextStatusFunc func,   void *data);
00117 void gp_context_set_question_func  (GPContext *context,
00118                                     GPContextQuestionFunc func, void *data);
00119 void gp_context_set_cancel_func    (GPContext *context,
00120                                     GPContextCancelFunc func,   void *data);
00121 void gp_context_set_message_func   (GPContext *context,
00122                                     GPContextMessageFunc func,  void *data);
00123 
00124 /* Calling those functions (backends) */
00125 void gp_context_idle     (GPContext *context);
00126 void gp_context_error    (GPContext *context, const char *format, ...)
00127 #ifdef __GNUC__
00128         __attribute__((__format__(printf,2,3)))
00129 #endif
00130 ;
00131 void gp_context_status   (GPContext *context, const char *format, ...)
00132 #ifdef __GNUC__
00133         __attribute__((__format__(printf,2,3)))
00134 #endif
00135 ;
00136 void gp_context_message  (GPContext *context, const char *format, ...)
00137 #ifdef __GNUC__
00138         __attribute__((__format__(printf,2,3)))
00139 #endif
00140 ;
00141 GPContextFeedback gp_context_question (GPContext *context, const char *format,
00142                                        ...)
00143 #ifdef __GNUC__
00144         __attribute__((__format__(printf,2,3)))
00145 #endif
00146 ;
00147 GPContextFeedback gp_context_cancel   (GPContext *context);
00148 unsigned int gp_context_progress_start  (GPContext *context, float target,
00149                                          const char *format, ...)
00150 #ifdef __GNUC__
00151         __attribute__((__format__(printf,3,4)))
00152 #endif
00153 ;
00154 void         gp_context_progress_update (GPContext *context, unsigned int id,
00155                                          float current);
00156 void         gp_context_progress_stop   (GPContext *context, unsigned int id);
00157 
00158 #ifdef __cplusplus
00159 }
00160 #endif /* __cplusplus */
00161 
00162 #endif /* __GPHOTO2_CONTEXT_H__ */

Generated on Sun Jul 22 19:29:31 2007 for libgphoto2 photo camera library (libgphoto2) by  doxygen 1.5.0