extern "C" for c++
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@1508 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -87,8 +87,6 @@ int camera_init (Camera *camera) {
|
||||
camera->functions->file_get = camera_file_get;
|
||||
camera->functions->config_get = camera_config_get;
|
||||
camera->functions->config_set = camera_config_set;
|
||||
camera->functions->file_put = camera_file_put;
|
||||
camera->functions->file_delete = camera_file_delete;
|
||||
camera->functions->config = camera_config;
|
||||
camera->functions->summary = camera_summary;
|
||||
camera->functions->manual = camera_manual;
|
||||
@@ -269,17 +267,8 @@ int camera_config_set (Camera *camera, CameraWidget *window) {
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
int camera_file_put (Camera *camera, CameraFile *file, char *folder) {
|
||||
|
||||
return (GP_ERROR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
|
||||
int camera_file_delete (Camera *camera, char *folder, char *filename) {
|
||||
|
||||
return (GP_ERROR_NOT_SUPPORTED);
|
||||
}
|
||||
|
||||
/* DEPRECATED */
|
||||
/* This function is deprecated! Do not implement!*/
|
||||
int camera_config (Camera *camera) {
|
||||
CameraWidget *window;
|
||||
|
||||
@@ -294,50 +283,7 @@ int camera_config (Camera *camera) {
|
||||
camera_config_set (camera, window);
|
||||
|
||||
return (GP_OK);
|
||||
#if 0
|
||||
/* Example. shows when debugging is on */
|
||||
//FIXME: Syntax of gp_widget_value_get/set has changed!
|
||||
|
||||
/* Create a new section for "Quality" */
|
||||
section = gp_widget_new(GP_WIDGET_SECTION, "Quality");
|
||||
gp_widget_append(window, section);
|
||||
|
||||
/* Add the Resolution setting radio buttons */
|
||||
t = gp_widget_new(GP_WIDGET_RADIO, "Resolution");
|
||||
gp_widget_append(section, t);
|
||||
gp_widget_choice_add(t, "Normal");
|
||||
gp_widget_choice_add(t, "High");
|
||||
gp_widget_choice_add(t, "Best");
|
||||
gp_widget_value_set(t, "High");
|
||||
|
||||
t = gp_widget_new(GP_WIDGET_TEXT, "Camera Name");
|
||||
gp_widget_append(section, t);
|
||||
gp_widget_value_set(t, "hey there!");
|
||||
|
||||
t = gp_widget_new(GP_WIDGET_RANGE, "LCD Brightness");
|
||||
gp_widget_append(section, t);
|
||||
gp_widget_range_set(t, 1.0, 7.0, 1.0);
|
||||
gp_widget_value_set(t, "4.0");
|
||||
|
||||
/* Create a new section for "Flash/Lens" and append to window */
|
||||
section = gp_widget_new(GP_WIDGET_SECTION, "Flash/Lens");
|
||||
gp_widget_append(window, section);
|
||||
|
||||
t = gp_widget_new(GP_WIDGET_MENU, "Flash Setting");
|
||||
gp_widget_append(section, t);
|
||||
gp_widget_choice_add(t, "Auto");
|
||||
gp_widget_choice_add(t, "Red-eye");
|
||||
gp_widget_choice_add(t, "Force");
|
||||
gp_widget_choice_add(t, "None");
|
||||
gp_widget_value_set(t, "Red-eye");
|
||||
|
||||
t = gp_widget_new(GP_WIDGET_RADIO, "Lens Mode");
|
||||
gp_widget_append(section, t);
|
||||
gp_widget_choice_add(t, "Normal");
|
||||
gp_widget_choice_add(t, "Macro");
|
||||
gp_widget_value_set(t, "Macro");
|
||||
#endif
|
||||
}
|
||||
} /* END DEPRECATED */
|
||||
|
||||
int camera_summary (Camera *camera, CameraText *summary) {
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
*/
|
||||
|
||||
#ifndef GPHOTO2_H
|
||||
#define GPHOTO2_H
|
||||
#define GPHOTO2_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef OS2
|
||||
#include <gphotoos2.h>
|
||||
@@ -30,4 +34,8 @@
|
||||
#include <gphoto2-settings.h>
|
||||
#include <gphoto2-widget.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -72,6 +72,8 @@ int gp_camera_new (Camera **camera, int camera_number)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (camera == NULL) return (GP_ERROR_BAD_PARAMETERS);
|
||||
|
||||
if (camera_number >= glob_abilities_list->count) {
|
||||
gp_debug_printf(GP_DEBUG_LOW, "core", "camera_number too big");
|
||||
return (GP_ERROR_MODEL_NOT_FOUND);
|
||||
@@ -91,6 +93,8 @@ int gp_camera_new (Camera **camera, int camera_number)
|
||||
(*camera)->frontend_data = NULL;
|
||||
(*camera)->session = glob_session_camera++;
|
||||
(*camera)->ref_count = 1;
|
||||
if (!(*camera)->port || !(*camera)->abilities || !(*camera)->functions)
|
||||
return (GP_ERROR_NO_MEMORY);
|
||||
|
||||
/* Initialize function pointers to NULL.*/
|
||||
(*camera)->functions->id = NULL;
|
||||
|
||||
Reference in New Issue
Block a user