def mouse_doubleclick_image(image_names,
                            search_method=_search_method_default,
                            tolerance=_tolerance_default,
                            timeout=_timeout_default,
                            mouse_button=_mouse_button_default,
                            use_wait=True,
                            use_center=True):
    if _check_display():
        _log_output('Mouse button doubleclick on image: Images=' +
                    image_names + ' search_method=' + search_method +
                    ' tolerance=' + tolerance + ' timeout=' +
                    _timeout_default + ' mouse_button=' + ' use_wait=' +
                    use_wait + ' use_center=' + use_center)

        if use_wait:
            #Loop through all images 'timeout' times, and click on the first match
            loop_check = 0
            while loop_check < timeout:
                for image in image_names:
                    if use_center:
                        image_location = libcvautomation.xte_clickMouseImage_location_center(
                            _get_display(), image, mouse_button, search_method,
                            tolerance)
                    else:
                        image_location = libcvautomation.xte_clickMouseImage_location(
                            _get_display(), image, mouse_button, search_method,
                            tolerance)

                    if image_location != _libcvautomation_error_location:
                        #Make sure to click twice once we've found the image
                        #Technically assumes that the system mouse timeout is less than
                        #the time it takes to do two boolean compares - I think this is pretty safe
                        libcvautomation.xte_clickMouse(_get_display(),
                                                       mouse_button)
                        #We've found our image, break out of the for loop and while loop
                        return True

                loop_check += 1
        else:
            #Just cycle through the images once
            for image in image_names:
                if use_center:
                    image_location = libcvautomation.xte_clickMouseImage_location_center(
                        _get_display(), image, mouse_button, search_method,
                        tolerance)
                else:
                    image_location = libcvautomation.xte_clickMouseImage_location(
                        _get_display(), image, mouse_button, search_method,
                        tolerance)

                if image_location != _libcvautomation_error_location:
                    #We've found our image, break out of the for loop
                    return True
        #No image found
        raise LibcvImageNotFound(image_names)
    else:
        #Display not open
        raise LibcvDisplayNotOpen(_get_name())
def mouse_click_image(image_names,
                      search_method=_search_method_default,
                      tolerance=_tolerance_default,
                      timeout=_timeout_default,
                      mouse_button=_mouse_button_default,
                      use_wait=True):
    if _check_display():
        _log_output('Mouse button click on image: Images=' + image_names +
                    ' search_method=' + search_method + ' tolerance=' +
                    tolerance + ' timeout=' + _timeout_default +
                    ' mouse_button=' + ' use_wait=' + use_wait +
                    ' use_center=' + use_center)

        if use_wait:
            #Loop through all images 'timeout' times, and click on the first match
            loop_check = 0
            while loop_check < timeout:
                for image in image_names:
                    if use_center:
                        image_location = libcvautomation.xte_clickMouseImage_location_center(
                            _get_display(), image, mouse_button, search_method,
                            tolerance)
                    else:
                        image_location = libcvautomation.xte_clickMouseImage_location(
                            _get_display(), image, mouse_button, search_method,
                            tolerance)

                    if image_location != _libcvautomation_error_location:
                        #We've found our image, break out of the for loop and while loop
                        return True

                loop_check += 1
        else:
            #Just cycle through the images once
            for image in image_names:
                if use_center:
                    image_location = libcvautomation.xte_clickMouseImage_location_center(
                        _get_display(), image, mouse_button, search_method,
                        tolerance)
                else:
                    image_location = libcvautomation.xte_clickMouseImage_location(
                        _get_display(), image, mouse_button, search_method,
                        tolerance)

                if image_location != _libcvautomation_error_location:
                    #We've found our image, break out of the for loop
                    return True

        #No image was found
        raise LibcvImageNotFound(image_names)
    else:
        #Display not open
        raise LibcvDisplayNotOpen(_get_name())
def mouse_doubleclick_image( image_names, search_method = _search_method_default,
						tolerance = _tolerance_default, timeout = _timeout_default,
						mouse_button = _mouse_button_default, use_wait = True,
						use_center = True ):
	if _check_display():
		_log_output( 'Mouse button doubleclick on image: Images=' + image_names + 
				' search_method=' + search_method + ' tolerance=' + tolerance +
				' timeout=' + _timeout_default + ' mouse_button=' +
				' use_wait=' + use_wait + ' use_center=' + use_center)

		if use_wait:
			#Loop through all images 'timeout' times, and click on the first match
			loop_check = 0
			while loop_check < timeout:
				for image in image_names:
					if use_center:
						image_location = libcvautomation.xte_clickMouseImage_location_center(_get_display(),
											image, mouse_button, search_method, tolerance )
					else:
						image_location = libcvautomation.xte_clickMouseImage_location(_get_display(),
											image, mouse_button, search_method, tolerance )

					if image_location != _libcvautomation_error_location:
						#Make sure to click twice once we've found the image
						#Technically assumes that the system mouse timeout is less than
						#the time it takes to do two boolean compares - I think this is pretty safe
						libcvautomation.xte_clickMouse(_get_display(), mouse_button )
						#We've found our image, break out of the for loop and while loop
						return True

				loop_check += 1
		else:
			#Just cycle through the images once
			for image in image_names:
				if use_center:
					image_location = libcvautomation.xte_clickMouseImage_location_center(_get_display(),
											image, mouse_button, search_method, tolerance )
				else:
					image_location = libcvautomation.xte_clickMouseImage_location(_get_display(),
											image, mouse_button, search_method, tolerance )

				if image_location != _libcvautomation_error_location:
					#We've found our image, break out of the for loop
					return True
		#No image found
		raise LibcvImageNotFound( image_names )
	else:
		#Display not open
		raise LibcvDisplayNotOpen( _get_name() )
def mouse_click_image( image_names, search_method = _search_method_default,
						tolerance = _tolerance_default, timeout = _timeout_default,
						mouse_button = _mouse_button_default, use_wait = True):
	if _check_display():
		_log_output( 'Mouse button click on image: Images=' + image_names + 
				' search_method=' + search_method + ' tolerance=' + tolerance +
				' timeout=' + _timeout_default + ' mouse_button=' +
				' use_wait=' + use_wait + ' use_center=' + use_center)

		if use_wait:
			#Loop through all images 'timeout' times, and click on the first match
			loop_check = 0
			while loop_check < timeout:
				for image in image_names:
					if use_center:
						image_location = libcvautomation.xte_clickMouseImage_location_center(_get_display(),
											image, mouse_button, search_method, tolerance )
					else:
						image_location = libcvautomation.xte_clickMouseImage_location(_get_display(),
											image, mouse_button, search_method, tolerance )

					if image_location != _libcvautomation_error_location:
						#We've found our image, break out of the for loop and while loop
						return True

				loop_check += 1
		else:
			#Just cycle through the images once
			for image in image_names:
				if use_center:
					image_location = libcvautomation.xte_clickMouseImage_location_center(_get_display(),
											image, mouse_button, search_method, tolerance )
				else:
					image_location = libcvautomation.xte_clickMouseImage_location(_get_display(),
											image, mouse_button, search_method, tolerance )

				if image_location != _libcvautomation_error_location:
					#We've found our image, break out of the for loop
					return True

		#No image was found
		raise LibcvImageNotFound( image_names )
	else:
		#Display not open
		raise LibcvDisplayNotOpen( _get_name() )