From: <mar...@us...> - 2009-12-13 13:04:20
|
Revision: 12556 http://gphoto.svn.sourceforge.net/gphoto/?rev=12556&view=rev Author: marcusmeissner Date: 2009-12-13 13:04:12 +0000 (Sun, 13 Dec 2009) Log Message: ----------- added gp_widget_set_readonly / get_readonly Modified Paths: -------------- trunk/libgphoto2/gphoto2/gphoto2-widget.h trunk/libgphoto2/libgphoto2/gphoto2-widget.c trunk/libgphoto2/libgphoto2/libgphoto2.sym Modified: trunk/libgphoto2/gphoto2/gphoto2-widget.h =================================================================== --- trunk/libgphoto2/gphoto2/gphoto2-widget.h 2009-12-12 21:59:05 UTC (rev 12555) +++ trunk/libgphoto2/gphoto2/gphoto2-widget.h 2009-12-13 13:04:12 UTC (rev 12556) @@ -123,6 +123,9 @@ int gp_widget_changed (CameraWidget *widget); int gp_widget_set_changed (CameraWidget *widget, int changed); +int gp_widget_set_readonly (CameraWidget *widget, int readonly); +int gp_widget_get_readonly (CameraWidget *widget, int *readonly); + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: trunk/libgphoto2/libgphoto2/gphoto2-widget.c =================================================================== --- trunk/libgphoto2/libgphoto2/gphoto2-widget.c 2009-12-12 21:59:05 UTC (rev 12555) +++ trunk/libgphoto2/libgphoto2/gphoto2-widget.c 2009-12-13 13:04:12 UTC (rev 12556) @@ -66,6 +66,9 @@ /* Widget was changed */ int changed; + /* Widget is read only */ + int readonly; + /* Reference count */ int ref_count; @@ -110,6 +113,7 @@ (*widget)->ref_count = 1; (*widget)->choice_count = 0; (*widget)->choice = NULL; + (*widget)->readonly = 0; (*widget)->id = i++; /* Clear all children pointers */ @@ -143,7 +147,7 @@ for (x = 0; x < widget->choice_count; x++) free (widget->choice[x]); free (widget->choice); - + if (widget->value_string) free (widget->value_string); free (widget); @@ -296,6 +300,44 @@ } /** + * \brief Tells that the widget is readonly + * + * @param widget a #CameraWidget + * @param changed a boolean whether we are readonly or not + * @return a gphoto2 error code + * + * Sets the readonly of the CameraWidget depending on + * the changed parameter. + * + * Only useful when called from the camera driver. + **/ +int +gp_widget_set_readonly (CameraWidget *widget, int readonly) +{ + CHECK_NULL (widget); + + widget->readonly = readonly; + return (GP_OK); +} + +/** + * \brief Retrieves the readonly state of the #CameraWidget + * + * @param widget a #CameraWidget + * @param readonly + * @return a gphoto2 error code. + * + **/ +int +gp_widget_get_readonly (CameraWidget *widget, int *readonly) +{ + CHECK_NULL (widget && readonly); + + *readonly = widget->readonly; + return (GP_OK); +} + +/** * \brief Retrieves the type of the #CameraWidget * * @param widget a #CameraWidget Modified: trunk/libgphoto2/libgphoto2/libgphoto2.sym =================================================================== --- trunk/libgphoto2/libgphoto2/libgphoto2.sym 2009-12-12 21:59:05 UTC (rev 12555) +++ trunk/libgphoto2/libgphoto2/libgphoto2.sym 2009-12-13 13:04:12 UTC (rev 12556) @@ -155,6 +155,7 @@ gp_widget_get_name gp_widget_get_parent gp_widget_get_range +gp_widget_get_readonly gp_widget_get_root gp_widget_get_type gp_widget_get_value @@ -165,6 +166,7 @@ gp_widget_set_info gp_widget_set_name gp_widget_set_range +gp_widget_set_readonly gp_widget_set_value gp_widget_unref gpi_exif_get_thumbnail_and_size This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |