Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_widget_get_child_by_id ( CameraWidget widget,
int  id,
CameraWidget **  child 
)

Retrieves the child with id id of the widget.

Parameters:
widget a CameraWidget
id the id of the child
child 
Returns:
a gphoto2 error code.

Definition at line 568 of file gphoto2-widget.c.

References CHECK_NULL, _CameraWidget::children, _CameraWidget::children_count, GP_ERROR_BAD_PARAMETERS, GP_OK, gp_widget_get_child_by_id(), and _CameraWidget::id.

Referenced by gp_widget_get_child_by_id().

{
      int x;

      CHECK_NULL (widget && child);

      if (widget->id == id) {
            *child = widget;
            return (GP_OK);
      }
      
      for (x = 0; x < widget->children_count; x++) {
            int result;
            CameraWidget *child_rec;
            
            result = gp_widget_get_child_by_id (widget->children[x], id, 
                                        &child_rec);
            if (result == GP_OK) {
                  *child = child_rec;
                  return (GP_OK);
            }
      }

      return (GP_ERROR_BAD_PARAMETERS);
}


Generated by  Doxygen 1.6.0   Back to index