From 017ef7df7629a55c082139f7fdd5eceb02384d52 Mon Sep 17 00:00:00 2001 From: Scott Fritzinger Date: Mon, 19 Jun 2000 17:32:53 +0000 Subject: [PATCH] finished renaming include files git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@557 67ed7778-7388-44ab-90cf-0a291f65f57c --- frontends/command-line/gphoto2 | 120 --------------------------- include/gphoto2-core.h | 145 +++++++++++++++++++++++++++++++++ include/gphoto2-datatypes.h | 119 +++++++++++++++++++++++++++ include/gphoto2-interface.h | 24 ++++++ include/gphoto2-library.h | 25 ++++++ 5 files changed, 313 insertions(+), 120 deletions(-) delete mode 100755 frontends/command-line/gphoto2 create mode 100644 include/gphoto2-core.h create mode 100644 include/gphoto2-datatypes.h create mode 100644 include/gphoto2-interface.h create mode 100644 include/gphoto2-library.h diff --git a/frontends/command-line/gphoto2 b/frontends/command-line/gphoto2 deleted file mode 100755 index 7167f9366..000000000 --- a/frontends/command-line/gphoto2 +++ /dev/null @@ -1,120 +0,0 @@ -#! /bin/sh - -# gphoto2 - temporary wrapper script for .libs/gphoto2 -# Generated by ltmain.sh - GNU libtool 1.3.3 (1.385.2.181 1999/07/02 15:49:11) -# -# The gphoto2 program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi - -relink_command="gcc -g -O2 -I../../include -o \$progdir/\$file main.o interface.o ../../libgphoto2/.libs/libgphoto2.so -ldl ../libgphoto2_util/.libs/libgphoto2_util.so -ldl -ldl -Wl,--rpath -Wl,/home/scottf/gphoto2/libgphoto2/.libs -Wl,--rpath -Wl,/home/scottf/gphoto2/frontends/libgphoto2_util/.libs -Wl,--rpath -Wl,/opt/gphoto2/lib" - -# This environment variable determines our operation mode. -if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variable: - link_against_libtool_libs=' ../../libgphoto2/libgphoto2.la ../libgphoto2_util/libgphoto2_util.la' -else - # When we are sourced in execute mode, $file and $echo are already set. - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - echo="echo" - file="$0" - # Make sure echo works. - if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : - else - # Restart under the correct shell, and then maybe $echo will work. - exec /bin/sh "$0" --no-reexec ${1+"$@"} - fi - fi - - # Find the directory that this script lives in. - thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "x$thisdir" = "x$file" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=`ls -ld "$file" | sed -n 's/.*-> //p'` - while test -n "$file"; do - destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - - # If there was a directory component, then change thisdir. - if test "x$destdir" != "x$file"; then - case "$destdir" in - [\/]* | [A-Za-z]:[\/]*) thisdir="$destdir" ;; - *) thisdir="$thisdir/$destdir" ;; - esac - fi - - file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - file=`ls -ld "$thisdir/$file" | sed -n 's/.*-> //p'` - done - - # Try to get the absolute directory name. - absdir=`cd "$thisdir" && pwd` - test -n "$absdir" && thisdir="$absdir" - - program=lt-'gphoto2' - progdir="$thisdir/.libs" - - if test ! -f "$progdir/$program" || \ - { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | sed 1q`; \ - test "X$file" != "X$progdir/$program"; }; then - - file="$$-$program" - - if test ! -d "$progdir"; then - mkdir "$progdir" - else - rm -f "$progdir/$file" - fi - - # relink executable if necessary - if test -n "$relink_command"; then - if (cd "$thisdir" && eval $relink_command); then : - else - rm -f "$progdir/$file" - exit 1 - fi - fi - - mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null || - { rm -f "$progdir/$program"; - mv -f "$progdir/$file" "$progdir/$program"; } - rm -f "$progdir/$file" - fi - - if test -f "$progdir/$program"; then - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - # Run the actual program with our arguments. - - # Export the path to the program. - PATH="$progdir:$PATH" - export PATH - - exec $program ${1+"$@"} - - $echo "$0: cannot exec $program ${1+"$@"}" - exit 1 - fi - else - # The program doesn't exist. - $echo "$0: error: $progdir/$program does not exist" 1>&2 - $echo "This script is just a wrapper for $program." 1>&2 - echo "See the libtool documentation for more information." 1>&2 - exit 1 - fi -fi diff --git a/include/gphoto2-core.h b/include/gphoto2-core.h new file mode 100644 index 000000000..2bcd5b647 --- /dev/null +++ b/include/gphoto2-core.h @@ -0,0 +1,145 @@ +/* Header file for gPhoto 0.5-Dev + + Author: Scott Fritzinger + + This library is covered by the LGPL. +*/ + + +/* Save/retrieve library or front-end configuration data. */ + int gp_get_setting (char *key, char *value); + int gp_set_setting (char *key, char *value); + + +/* Functions for the front-ends + ---------------------------------------------------------------- */ + +/* Initialize/Quit the gPhoto library */ + int gp_init(); + int gp_exit(); + +/* Camera port operations */ + int gp_port_set (CameraPortSettings settings); + +/* Camera operations */ + /* Retrieve number of cameras */ + int gp_camera_count (); + + /* Retrieve camera name */ + int gp_camera_name (int camera_number, char *camera_name); + + /* Set the current camera library */ + int gp_camera_set (int camera_number); + + /* Retrieve the camera abilities */ + int gp_camera_abilities (CameraAbilities *abilities); + + /* Init/Exit, Open or close a camera */ + int gp_camera_init (CameraInit *init); + int gp_camera_exit (); + + int gp_camera_open (); + int gp_camera_close (); + +/* Folder operations */ + /* Retrieve the number of folders on the camera */ + int gp_folder_count (); + + /* Retrieve the name of a particular folder */ + int gp_folder_name (int folder_number, char *folder_name); + + /* Set the current folder */ + int gp_folder_set (int folder_number); + +/* File operations */ + /* Retrieve the number of files in the current folder */ + int gp_file_count (); + + /* Download a file or a preview from the camera from the current folder*/ + int gp_file_get (int file_number, CameraFile *file); + int gp_file_get_preview (int file_number, CameraFile *preview); + + /* Delete a file from the current folder */ + int gp_file_delete (int file_number); + + /* ---- These next 2 are just utilities ---- */ + + /* Allocates a new CameraFile */ + CameraFile* gp_file_new (); + + /* Saves image to "filename" (full path and filename) */ + int gp_file_save_to_disk (CameraFile *file, char *filename); + + /* Frees a CameraFile's components */ + int gp_file_clean (CameraFile *file); + + /* Frees a CameraFile from memory */ + int gp_file_free (CameraFile *file); + +/* Camera configuration operations */ + /* Retrieve and set configuration options for the camera */ + int gp_config_get (char *config_dialog_filename); + + /* The config dialog will be stored in a plainttext file. The filename is + returned to the gphoto-core, which will pass it to the front-end. + The format is still under discussion. XML leads the way though intpotential + formats. we need a draft though. + + Something like (note: my XML is awful, so no standards here) : + + + + + + - or - + + + + + + + + */ + + /* Send "key=value" pairs to the library, delimited by '\n' */ + int gp_config_set (char *config_settings); + +/* Miscellaneous functions */ + /* Captures the current view. Basically, it takes a picture */ + int gp_capture (int type); + + /* Retrieves camera status (number of pictures, charge, etc...) */ + int gp_summary (char *summary); + + /* Retrieves usage of the camera library (config settings, problems, etc) */ + int gp_manual (char *manual); + + /* Retrieves information about the camera library (author, version, etc) */ + int gp_about (char *about); + + +/* Utility functions for libraries + ---------------------------------------------------------------- */ +/* Displays the current status on an operation in the camera */ + int gp_update_status (char *status); + +/* Displays a percentage done in the current operation */ + int gp_update_progress (float percentage); + +/* Displays a message (error, very important info) */ + int gp_message (char *message); + +/* Displays a configuration */ + int gp_confirm (char *message); diff --git a/include/gphoto2-datatypes.h b/include/gphoto2-datatypes.h new file mode 100644 index 000000000..7a9a9ba60 --- /dev/null +++ b/include/gphoto2-datatypes.h @@ -0,0 +1,119 @@ +/* Header file for gPhoto 0.5-Dev + + Author: Scott Fritzinger + + This library is covered by the LGPL. +*/ + +/* Data Structures + ---------------------------------------------------------------- */ + +/* Return Values */ +#define GP_OK 0 +#define GP_ERROR -1 +#define GP_ERROR_CRITICAL -2 + +/* File Types */ +typedef enum { + GP_FILE_UNKNOWN, + GP_FILE_JPEG, + GP_FILE_TIFF, + GP_FILE_FLASHPIX, + GP_FILE_PPM, + GP_FILE_WAV, + GP_FILE_MPEG, + GP_FILE_QUICKTIME +} CameraFileType; + +/* Physical Connection Types */ +typedef enum { + GP_PORT_DIRECTORY, + GP_PORT_SERIAL, + GP_PORT_USB, + GP_PORT_PARALLEL, + GP_PORT_IRDA +} CameraConnectType; + +typedef struct { + CameraConnectType type; + /* What kind of connection is it? */ + + char serial_port[128]; + /* path to serial port device */ + + int serial_baud; + /* Baud rate for serial port camera */ + + int usb_node; + /* dummy for now. need way to specify which USB device */ + + char directory_path[128]; + /* path for directory lib to index */ +} CameraPortSettings; + +typedef struct { + char *model[128]; + + /* can the library support the following: */ + int serial : 1; + int usb : 1; + int parallel : 1; + int ieee1394 : 1; + + int serial_baud[64]; + /* if serial==1, baud rates that this camera */ + /* supports. terminate list with a zero */ + + int cancel : 1; + /* Camera operation can be cancelled in progress */ + + int capture : 1; + /* Camera can do a capture (take picture) */ + + int config : 1; + /* Camera can be configures remotely */ + + int delete_file : 1; + /* Camera can delete files */ + + int file_preview : 1; + /* Camera can get file previews (thumbnails) */ + + int lock : 1; + /* Camera can lock (protect) pictures */ + + int reset : 1; + /* Camera can be reset during transfer */ + + int sleep : 1; + /* Camera can be turned off (sleep) */ +} CameraAbilities; + + + +typedef struct { + char model[128]; /* Name of the camera */ + + CameraPortSettings port_settings; /* Port settings */ +} CameraInit; + +typedef struct { + CameraFileType type; + /* Type of file (GP_FILE_JPEG, GP_FILE_TIFF, ..) */ + + char* name; + /* Suggested name for the file */ + + long int size; + /* Size of the image data*/ + + char* data; + /* Image data */ + +} CameraFile; + +typedef struct { + char *name; + char *value; +} CameraConfig; + diff --git a/include/gphoto2-interface.h b/include/gphoto2-interface.h new file mode 100644 index 000000000..0b4dd270a --- /dev/null +++ b/include/gphoto2-interface.h @@ -0,0 +1,24 @@ +/* Header file for gPhoto 0.5-Dev + + Author: Scott Fritzinger + + This library is covered by the LGPL. +*/ + + +/* Functions provided by the front-end interface + ---------------------------------------------------------------- */ + +/* Displays the current status on an operation in the camera */ + int interface_update_status (char *status); + +/* Displays a percentage done in the current operation */ + int interface_update_progress (float percentage); + +/* Displays a message (error, very important info) */ + int interface_message (char *message); + +/* Displays a configuration */ + int interface_confirm (char *message); + + diff --git a/include/gphoto2-library.h b/include/gphoto2-library.h new file mode 100644 index 000000000..d358c3b82 --- /dev/null +++ b/include/gphoto2-library.h @@ -0,0 +1,25 @@ +int camera_abilities (CameraAbilities *abilities); + +int camera_init (CameraInit *init); +int camera_exit (); + +int camera_open (); +int camera_close (); + +int camera_folder_count (); +int camera_folder_name(int folder_number, char *folder_name); +int camera_folder_set(int folder_number); + +int camera_file_count (); +int camera_file_get (int file_number, CameraFile *file); +int camera_file_get_preview (int file_number, CameraFile *preview); +int camera_file_delete (int file_number); + +int camera_file_lock (int file_number); +int camera_file_unlock (int file_number); + +int camera_config_set (CameraConfig *conf); +int camera_capture (int type); +int camera_summary (char *summary); +int camera_manual (char *manual); +int camera_about (char *about);