File: SCREENWindowScreenNumber.c

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (55 lines) | stat: -rw-r--r-- 1,788 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
	Psychtoolbox3/Source/Common/SCREENWindowScreenNumber	
  
	AUTHORS:

		Allen.Ingling@nyu.edu		awi 
  
	PLATFORMS:	

		This file should build on any platform. 

	HISTORY:
		1/24/03  awi		Created. 
 
	DESCRIPTION:
  
		For onscreen window: Return the number of the screen on which it lies. 
		For offscreen window: Return the number of the ancestral screen.  If none, return -1.    
  
	TO DO:
	
		When we re-write to represent the pixel format with a single constant instead of structure change the test for matching 
		pixel depth to a test for equivalent color resolution.  Note that the pixel format need not be the same, only 
		the same resolution, for example, kPsych_R8_G8_B8_A8 is compatible with kPsych_A8_R8_G8_B8 but not kPsych_R10_G10_B10_A2.
  
*/
    

#include "Screen.h"

// If you change useString then also change the corresponding synopsis string in ScreenSynopsis.c
static char useString[] = "screenNumber=Screen('WindowScreenNumber', windowPtr);";
//                                                                   1											
static char synopsisString[] = 
	"Get screenNumber, the number of the screen on which the window appears.  If the window is an offscreen window then this value is -1. ";
	
static char seeAlsoString[] = "";
	 
PsychError SCREENWindowScreenNumber(void) 
{
    PsychWindowRecordType	*windowRecord;
    
    //all sub functions should have these two lines
    PsychPushHelp(useString, synopsisString, seeAlsoString);
    if(PsychIsGiveHelp()){PsychGiveHelp();return(PsychError_none);};

    PsychErrorExit(PsychCapNumOutputArgs(2));
    PsychErrorExit(PsychCapNumInputArgs(2));
    PsychAllocInWindowRecordArg(1, TRUE, &windowRecord);
    PsychCopyOutDoubleArg(1, FALSE, windowRecord->screenNumber);
    
    return(PsychError_none);	
}