visualtest/include/SDL_visualtest_screenshot.h
changeset 7924 fcb86d323770
child 11382 2c50e79b19e0
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/visualtest/include/SDL_visualtest_screenshot.h	Sun Nov 10 00:32:23 2013 -0500
     1.3 @@ -0,0 +1,50 @@
     1.4 +/* See COPYING.txt for the full license governing this code. */
     1.5 +/**
     1.6 + * \file SDL_visualtest_screenshot.h
     1.7 + *
     1.8 + * Header for the screenshot API.
     1.9 + */
    1.10 +
    1.11 +#include "SDL_visualtest_process.h"
    1.12 +
    1.13 +#ifndef _SDL_visualtest_screenshot_h
    1.14 +#define _SDL_visualtest_screenshot_h
    1.15 +
    1.16 +/* Set up for C function definitions, even when using C++ */
    1.17 +#ifdef __cplusplus
    1.18 +extern "C" {
    1.19 +#endif
    1.20 +
    1.21 +/**
    1.22 + * Takes a screenshot of each window owned by the process \c pinfo and saves 
    1.23 + * it in a file \c prefix-i.png where \c prefix is the full path to the file 
    1.24 + * along with a prefix given to each screenshot.
    1.25 + *
    1.26 + * \return 1 on success, 0 on failure.
    1.27 + */
    1.28 +int SDLVisualTest_ScreenshotProcess(SDL_ProcessInfo* pinfo, char* prefix);
    1.29 +
    1.30 +/**
    1.31 + * Takes a screenshot of the desktop and saves it into the file with path
    1.32 + * \c filename.
    1.33 + *
    1.34 + * \return 1 on success, 0 on failure.
    1.35 + */
    1.36 +int SDLVisualTest_ScreenshotDesktop(char* filename);
    1.37 +
    1.38 +/**
    1.39 + * Compare a screenshot taken previously with SUT arguments \c args that is
    1.40 + * located in \c test_dir with a verification image that is located in 
    1.41 + * \c verify_dir.
    1.42 + *
    1.43 + * \return -1 on failure, 0 if the images were not equal, 1 if the images are equal
    1.44 + *         and 2 if the verification image is not present.
    1.45 + */
    1.46 +int SDLVisualTest_VerifyScreenshots(char* args, char* test_dir, char* verify_dir);
    1.47 +
    1.48 +/* Ends C function definitions when using C++ */
    1.49 +#ifdef __cplusplus
    1.50 +}
    1.51 +#endif
    1.52 +
    1.53 +#endif /* _SDL_visualtest_screenshot_h */
    1.54 \ No newline at end of file