libgphoto2 photo camera library (libgphoto2) API
2.5.10.1
|
#include "config.h"
#include <gphoto2/gphoto2-context.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gphoto2/gphoto2-port-log.h>
Data Structures | |
struct | _GPContext |
Functions | |
GPContext * | gp_context_new (void) |
Creates a new context. More... | |
void | gp_context_ref (GPContext *context) |
void | gp_context_unref (GPContext *context) |
Decrements reference count of a context. More... | |
void | gp_context_idle (GPContext *context) |
Notify frontend of a brief idle time. More... | |
unsigned int | gp_context_progress_start (GPContext *context, float target, const char *format,...) |
Start progress tracking. More... | |
void | gp_context_progress_update (GPContext *context, unsigned int id, float current) |
void | gp_context_progress_stop (GPContext *context, unsigned int id) |
void | gp_context_error (GPContext *context, const char *format,...) |
void | gp_context_status (GPContext *context, const char *format,...) |
void | gp_context_message (GPContext *context, const char *format,...) |
Print a message to the context. More... | |
GPContextFeedback | gp_context_question (GPContext *context, const char *format,...) |
Ask frontend user a question. More... | |
GPContextFeedback | gp_context_cancel (GPContext *context) |
void | gp_context_set_idle_func (GPContext *context, GPContextIdleFunc func, void *data) |
void | gp_context_set_progress_funcs (GPContext *context, GPContextProgressStartFunc start_func, GPContextProgressUpdateFunc update_func, GPContextProgressStopFunc stop_func, void *data) |
void | gp_context_set_error_func (GPContext *context, GPContextErrorFunc func, void *data) |
void | gp_context_set_question_func (GPContext *context, GPContextQuestionFunc func, void *data) |
void | gp_context_set_status_func (GPContext *context, GPContextStatusFunc func, void *data) |
void | gp_context_set_cancel_func (GPContext *context, GPContextCancelFunc func, void *data) |
void | gp_context_set_message_func (GPContext *context, GPContextMessageFunc func, void *data) |
GPContextFeedback gp_context_cancel | ( | GPContext * | context | ) |
gp_context_cancel: : a GPContext
Gives the frontend the possibility to cancel the current operation that is executed in this .
Return value: a GPContextFeedback.
References GP_CONTEXT_FEEDBACK_OK.
void gp_context_idle | ( | GPContext * | context | ) |
Notify frontend of a brief idle time.
Tells the frontend that it can do other processing at this moment, like refresh the UI. Backends should call this function every time when an interruption of the transfer is possible.
context | a GPContext |
void gp_context_message | ( | GPContext * | context, |
const char * | format, | ||
... | |||
) |
Print a message to the context.
This sends a message to the passed context, to be printed by it in some kind of way, but do no other action.
To be used by camera drivers.
context | A GPContext |
format | A sprintf style format string |
... | variable argument list depending on format string |
GPContext* gp_context_new | ( | void | ) |
Creates a new context.
To be used by the frontend.
unsigned int gp_context_progress_start | ( | GPContext * | context, |
float | target, | ||
const char * | format, | ||
... | |||
) |
Start progress tracking.
This function starts up a new progress tracking for a specified context. Several nested progress reports can happen at once, depending on the backend.
context | The context in which to start the progress. |
target | The 100% value. |
format | A sprintf style string to print out, including the following variable arguments. |
References gp_log(), and GP_LOG_ERROR.
GPContextFeedback gp_context_question | ( | GPContext * | context, |
const char * | format, | ||
... | |||
) |
Ask frontend user a question.
Asks the user a question that he must answer either with "Ok" or "Cancel".
To be used by a camera driver. (So far no camera driver is using it, but this might change later.)
context | a GPContext |
format | a sprintf format string |
... | variable arguments for format string |
References GP_CONTEXT_FEEDBACK_OK.
void gp_context_ref | ( | GPContext * | context | ) |
Increments the reference count of the context.
context | The context to bump the reference |
void gp_context_unref | ( | GPContext * | context | ) |
Decrements reference count of a context.
Decrement the reference count of a context and free if it goes to 0.
context | The context to drop the reference count. |