libgphoto2 (libgphoto2): libgphoto2/gphoto2-widget.h Source File

Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# gphoto2-widget.h

    00001 /* gphoto2-widget.h
    00002  *
    00003  * Copyright © 2000 Scott Fritzinger
    00004  *
    00005  * This library is free software; you can redistribute it and/or
    00006  * modify it under the terms of the GNU Lesser General Public
    00007  * License as published by the Free Software Foundation; either
    00008  * version 2 of the License, or (at your option) any later version.
    00009  *
    00010  * This library is distributed in the hope that it will be useful,
    00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013  * Lesser General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU Lesser General Public
    00016  * License along with this library; if not, write to the
    00017  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00018  * Boston, MA 02111-1307, USA.
    00019  */
    00020
    00021 #ifndef __GPHOTO2_WIDGET_H__
    00022 #define __GPHOTO2_WIDGET_H__
    00023
    00024 #include <gphoto2-context.h>
    00025
    00026 /* You don't really want to know what's inside, do you? */
    00027 typedef struct _CameraWidget CameraWidget;
    00028
    00029 #include <gphoto2-camera.h>
    00030
    00031 typedef enum {                  /* Value (get/set):     */
    00032         GP_WIDGET_WINDOW,
    00033         GP_WIDGET_SECTION,
    00034         GP_WIDGET_TEXT,         /* char *               */
    00035         GP_WIDGET_RANGE,        /* float                */
    00036         GP_WIDGET_TOGGLE,       /* int                  */
    00037         GP_WIDGET_RADIO,        /* char *               */
    00038         GP_WIDGET_MENU,         /* char *               */
    00039         GP_WIDGET_BUTTON,       /* CameraWidgetCallback */
    00040         GP_WIDGET_DATE          /* int                  */
    00041 } CameraWidgetType;
    00042
    00043 typedef int (* CameraWidgetCallback) (Camera *, CameraWidget *, GPContext *);
    00044
    00045 int     gp_widget_new   (CameraWidgetType type, const char *label,
    00046                          CameraWidget **widget);
    00047 int     gp_widget_free  (CameraWidget *widget);
    00048 int     gp_widget_ref   (CameraWidget *widget);
    00049 int     gp_widget_unref (CameraWidget *widget);
    00050
    00051 int     gp_widget_append        (CameraWidget *widget, CameraWidget *child);
    00052 int     gp_widget_prepend       (CameraWidget *widget, CameraWidget *child);
    00053
    00054 int     gp_widget_count_children     (CameraWidget *widget);
    00055 int     gp_widget_get_child          (CameraWidget *widget, int child_number,
    00056                                       CameraWidget **child);
    00057
    00058 /* Retrieve Widgets */
    00059 int     gp_widget_get_child_by_label (CameraWidget *widget,
    00060                                       const char *label,
    00061                                       CameraWidget **child);
    00062 int     gp_widget_get_child_by_id    (CameraWidget *widget, int id,
    00063                                       CameraWidget **child);
    00064 int     gp_widget_get_child_by_name  (CameraWidget *widget,
    00065                                       const char *name,
    00066                                       CameraWidget **child);
    00067 int     gp_widget_get_root           (CameraWidget *widget,
    00068                                       CameraWidget **root);
    00069 int     gp_widget_get_parent         (CameraWidget *widget,
    00070                                       CameraWidget **parent);
    00071
    00072 int     gp_widget_set_value     (CameraWidget *widget, const void *value);
    00073 int     gp_widget_get_value     (CameraWidget *widget, void *value);
    00074
    00075 int     gp_widget_set_name      (CameraWidget *widget, const char  *name);
    00076 int     gp_widget_get_name      (CameraWidget *widget, const char **name);
    00077
    00078 int     gp_widget_set_info      (CameraWidget *widget, const char  *info);
    00079 int     gp_widget_get_info      (CameraWidget *widget, const char **info);
    00080
    00081 int     gp_widget_get_id        (CameraWidget *widget, int *id);
    00082 int     gp_widget_get_type      (CameraWidget *widget, CameraWidgetType *type);
    00083 int     gp_widget_get_label     (CameraWidget *widget, const char **label);
    00084
    00085 int     gp_widget_set_range     (CameraWidget *range,
    00086                                  float  low, float  high, float  increment);
    00087 int     gp_widget_get_range     (CameraWidget *range,
    00088                                  float *min, float *max, float *increment);
    00089
    00090 int     gp_widget_add_choice     (CameraWidget *widget, const char *choice);
    00091 int     gp_widget_count_choices  (CameraWidget *widget);
    00092 int     gp_widget_get_choice     (CameraWidget *widget, int choice_number,
    00093                                   const char **choice);
    00094
    00095 int     gp_widget_changed        (CameraWidget *widget);
    00096 int     gp_widget_set_changed    (CameraWidget *widget, int changed);
    00097
    00098 #endif /* __GPHOTO2_WIDGET_H__ */