SR Research Support Site
Macros | Functions | Variables
gdi_expt.h File Reference

Declarations of eyelink_exptkit functions and types. More...

Macros

#define SCREEN_LEFT   dispinfo.left
 
#define SCREEN_TOP   dispinfo.top
 
#define SCREEN_RIGHT   dispinfo.right
 
#define SCREEN_BOTTOM   dispinfo.bottom
 
#define SCRHEIGHT   dispinfo.height
 
#define SCRWIDTH   dispinfo.width
 
#define process_key_messages   gdi_process_key_messages
 
#define bitmap_save_and_backdrop   gdi_bitmap_save_and_backdrop
 
#define bitmap_to_backdrop   gdi_bitmap_to_backdrop
 
#define bitmap_save   gdi_bitmap_save
 
#define CALLTYPE   ELCALLTYPE
 
#define HOOK_ERROR   -1 /* if error occurred */
 
#define HOOK_CONTINUE   0 /* if drawing to continue after return from hook */
 
#define HOOK_NODRAW   1 /* if drawing should not be done after hook */
 
#define CAL_TARG_BEEP   1
 
#define CAL_GOOD_BEEP   0
 
#define CAL_ERR_BEEP   -1
 
#define DC_TARG_BEEP   3
 
#define DC_GOOD_BEEP   2
 
#define DC_ERR_BEEP   -2
 

Functions

void set_calibration_colors (COLORREF fg, COLORREF bg)
 
void set_camera_setup_colors (COLORREF sc, COLORREF pbc, COLORREF tc)
 
void set_target_size (UINT16 diameter, UINT16 holesize)
 
void set_cal_sounds (char *ontarget, char *ongood, char *onbad)
 
void set_dcorr_sounds (char *ontarget, char *ongood, char *onbad)
 
INT16 set_camera_image_position (INT16 left, INT16 top, INT16 right, INT16 bottom)
 
int set_calibration_monitor_index (int monitor_index)
 
void get_display_information (DISPLAYINFO *di)
 
INT16 init_expt_graphics (HWND hwnd, DISPLAYINFO *info)
 
void close_expt_graphics (void)
 
void wait_for_video_refresh (void)
 
UINT16 gdi_process_key_messages (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
void wait_for_drawing (HWND hwnd)
 
int gdi_bitmap_save_and_backdrop (HBITMAP hbm, INT16 xs, INT16 ys, INT16 width, INT16 height, char *fname, char *path, INT16 sv_options, INT16 xd, INT16 yd, UINT16 bx_options)
 
int gdi_bitmap_to_backdrop (HBITMAP hbm, INT16 xs, INT16 ys, INT16 width, INT16 height, INT16 xd, INT16 yd, UINT16 bx_options)
 
int gdi_bitmap_save (HBITMAP hbm, INT16 xs, INT16 ys, INT16 width, INT16 height, char *fname, char *path, INT16 sv_options)
 
INT16 set_setup_cal_display_hook (INT16(*hookfn)(void), INT16 options)
 
INT16 set_clear_cal_display_hook (INT16(*hookfn)(HDC hdc), INT16 options)
 
INT16 CALLTYPE set_erase_cal_target_hook (INT16(*hookfn)(HDC hdc), INT16 options)
 
INT16 CALLTYPE set_draw_cal_target_hook (INT16(*hookfn)(HDC hdc, INT16 *x, INT16 *y), INT16 options)
 
INT16 set_exit_cal_display_hook (INT16(*hookfn)(void), INT16 options)
 
INT16 CALLTYPE set_cal_sound_hook (INT16(*hookfn)(INT16 *error), INT16 options)
 
INT16 set_record_abort_hide_hook (INT16(*hookfn)(void), INT16 options)
 
INT16 set_setup_image_display_hook (INT16(*hookfn)(INT16 width, INT16 height), INT16 options)
 
INT16 set_image_title_hook (INT16(*hookfn)(INT16 threshold, char *cam_name), INT16 options)
 
INT16 set_draw_image_line_hook (INT16(*hookfn)(INT16 width, INT16 line, INT16 totlines, byte *pixels), INT16 options)
 
INT16 set_set_image_palette_hook (INT16(*hookfn)(INT16 ncolors, byte r[], byte g[], byte b[]), INT16 options)
 
INT16 set_exit_image_display_hook (INT16(*hookfn)(void), INT16 options)
 
void initialize_gc_window (int wwidth, int wheight, HBITMAP window_bitmap, HBITMAP background_bitmap, HWND window, RECT display_rect, int is_mask, int deadband)
 
void redraw_gc_window (int x, int y)
 
HDC get_window_dc (void)
 
INT16 release_window_dc (HDC hdc)
 
const char * get_output_folder (void)
 
int set_output_folder (const char *path)
 
int copy_resource_to_output_folder (const char *resource)
 
int open_output_folder (void)
 
int initialize_folder (const char *exe_path, const char *output_folder, int create_output_folder)
 

Variables

DISPLAYINFO dispinfo
 

Detailed Description

Declarations of eyelink_exptkit functions and types.

Copyright (c) 1996-2026, SR Research Ltd., All Rights Reserved

For use by SR Research licencees only. Redistribution and use in source and binary forms, with or without modification, are NOT permitted.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither name of SR Research Ltd nor the name of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This file will also reference the other EyeLink header files.

Function Documentation

int copy_resource_to_output_folder ( const char *  resource)

Convenient function to copy a resource to output folder.

Parameters
resourceName of resource to be copied.
const char* get_output_folder ( void  )
Returns
The path to the output folder. For macos and linux, default output folder is ~/Documents/<exe name>_<date string> For Windows default output folder behaviour is as follows. take the first pass case. ie. if item #1 passes, take it otherwise move on to the next item.
  1. if set_output_folder is called use that path.
  2. Can the current directory writeable. If yes, use the current directory as output_folder. (This will handle the 32bit application case)
  3. Can we write to the PublicDocuments folder? if yes, use the public documents folder
  4. Can we write to the Documents folder? if yes use the documents folder
  5. If we reach here that means we cannot write anywhere. We can attempt the desktop, but I guess, if documents folder is not writeable, then chances are we cannot write anywhere.
int initialize_folder ( const char *  exe_path,
const char *  output_folder,
int  create_output_folder 
)

Initializes the folder util. Optionally creates the output folder.

Returns
Non-zero on success. 0 if failed.
Remarks
See get_output_folder() for more detail about the get_output_folder behaviour.
Parameters
exe_pathThe path to the executable e.g. argv[0] of the main().
output_folderUse this as the default output folder. Use NULL if there is none.
create_output_folderAttempt to create non-existent output folder when this is non-zero.
int open_output_folder ( void  )

Convenient function to show the output folder.

int set_output_folder ( const char *  path)

Allow one to set the output folder. If output folder needs to be created, call this before calling initialize_sdl_util. Otherwise, this only sets teh output folder.

Parameters
pathOutput folder path to use.

Copyright ©2002-2026, SR Research Ltd.