Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

343 lines
16 KiB

  1. #define SMAPI_VERSION 0x00010001 // version 1.1
  2. //
  3. // Flags:
  4. //
  5. // 1st WORD
  6. #define FLAG_NOTSPECIAL 0x0000 // Not in special mode now
  7. #define FLAG_RGBPROJ_MODE 0x0010 // in RGB Projector mode now ?
  8. #define FLAG_DUALVIEW_MODE 0x0020 // in DualView mode now ?
  9. #define FLAG_DUALAPP_MODE 0x0040 // in DualApp mode now ?
  10. #define FLAG_STRETCH_MODE 0x0080 // in Stretch mode now ?
  11. #define FLAG_ROTATE_MODE 0x0100 // in Rotate mode now ?
  12. #define FLAG_DDRAW_ON 0x0200 // DirectDraw in effect ?
  13. #define FLAG_WIN98_2NDON 0x0400 // 2nd monitor on under Win98
  14. #define FLAG_WIN98_DRV 0x0800 // driver is Win98 native driver
  15. #define FLAG_VIRTUALREFRESH_MODE 0x1000 // in virtual refresh mode now ?
  16. #define FLAG_IN_DOSFULLSCREEN 0x2000 // in dos full screen mode now ?
  17. #define FLAG_APP_EXCLUSIVE_DISP 0x4000 // some application exclusive display ?
  18. #define FLAG_LYNXDVM 0x8000 // Is LynxDVM
  19. // 2nd WORD
  20. #define FLAG_NT_ROTATE_SUPPORT 0x0001 // Is rotation support in NT ?
  21. #define FLAG_ROTATE_DIRECTION 0x0006 // Rotation direction.
  22. #define FLAG_NEW_ROTATE_SUPPORT 0x0008 // New Rotation (QuickRotate(tm)) Support ?
  23. #define DISP2ND_CRT 0 // 2nd display is CRT
  24. #define DISP2ND_TV 1 // 2nd display is TV
  25. #define TV_NTSC 0 // TV is NTSC
  26. #define TV_PAL 1 // TV is PAL
  27. /*
  28. #define TV_NTSC_640x400 0 // TV is NTSC 640 x 400
  29. #define TV_NTSC_640x480 1 // TV is NTSC 640 x 480
  30. #define TV_PAL_640x480 2 // TV is PAL 640 x 480
  31. #define TV_PAL_800x600 3 // TV is PAL 800 x 600
  32. */
  33. #define LCD_LEFTSIDE 0 // LCD is at left hand side
  34. #define LCD_RIGHTSIDE 1 // LCD is at right hand side
  35. #define DS_LCD 1 // switch to LCD only
  36. #define DS_CRT 2 // switch to CRT only
  37. #define DS_TV 3 // switch to TV only
  38. #define DS_LCDCRT 4 // switch to LCD+CRT
  39. #define DS_LCDTV 5 // switch to LCD+TV
  40. #define DS_LCD_VR 6 // switch to virtual LCD
  41. #define DA_USEHANDLE 0x00000001 // use window handle for dualapp
  42. #define DA_USEPATH 0x00000002 // use application path for dualapp
  43. #define DV_GRAPHICS 0x00000001 // dualview for graphics
  44. #define DV_VIDEO 0x00000002 // dualview for video
  45. #define DV_TWO_VIDEO 0x00000003 // dualview for video -- 1.1 --
  46. #define DV_MINCX 50 // suggestion only!
  47. #define DV_MINCY 50 // suggestion only!
  48. #define MEM_1M 1 // 1M video memory
  49. #define MEM_2M 2 // 2M video memory
  50. #define MEM_4M 3 // 4M video memory
  51. #define MEM_6M 4 // 6M video memory
  52. // for rotation -- new for version 1.1
  53. #define RT_CLOCKWISE 1 // clockwise rotation
  54. #define RT_COUNTERCLOCKWISE 2 // counter clockwise rotation
  55. #define RT_180 3 // rotate 180 degree
  56. //
  57. // Messages:
  58. //
  59. #define SMAPI_INIT 0x00000001 // initiate SMI API DLL
  60. #define SMAPI_EXIT 0x00000002 // cleanup SMI API DLL
  61. #define SMAPI_DISPLAYCHANGE 0x00000003 // notify SMI API DLL that display changed
  62. #define SMAPI_GETCURDS 0x00000004 // set display settings
  63. #define SMAPI_SETCURDS 0x00000005 // save current display settings
  64. #define SMAPI_GET2NDDISP 0x00000006 // get 2nd display
  65. #define SMAPI_SET2NDDISP 0x00000007 // set 2nd display
  66. #define SMAPI_GETTVTYPE 0x00000008 // get TV type
  67. #define SMAPI_SETTVTYPE 0x00000009 // set TV type
  68. #define SMAPI_GETLCDSIDE 0x0000000a // get LCD side
  69. #define SMAPI_SETLCDSIDE 0x0000000b // set LCD side
  70. #define SMAPI_GETDVCRTRES 0x0000000c // get DualView CRT Res -- new for 1.1
  71. #define SMAPI_SETDVCRTRES 0x0000000d // set DualView CRT Res -- new for 1.1
  72. #define SMAPI_DV_SWAP2PANEL 0x0000000e // dv video swap to panel -- new for 1.1
  73. #define TURNOFF_SPECIALMODE 0x0000000f // turn off special mode
  74. #define SMAPI_SUSPENDRESUME 0x00000010 // suspend or resume
  75. #define DUALAPP_INIT 0x00000011
  76. #define DUALAPP_EXECUTE 0x00000012
  77. #define DUALAPP_SWAPAPP 0x00000013
  78. #define DUALAPP_SWAPDISPLAY 0x00000014
  79. #define DUALAPP_EXIT 0x00000015
  80. #define SMAPI_TVON_COVER 0x00000019
  81. #define SMAPI_TVOFF_COVER 0x00000020
  82. #define DUALVIEW_INIT 0x00000021
  83. #define DUALVIEW_CHECKFORMAT 0x00000022
  84. #define DUALVIEW_LOCATEVIDEO 0x00000023
  85. #define DUALVIEW_EXECUTE 0x00000024
  86. #define DUALVIEW_UPDATE 0x00000025
  87. #define DUALVIEW_EXIT 0x00000026
  88. #define DUALVIEW_LOCATE2VIDEO 0x00000027 // -- 1.1 --
  89. #define RGBPROJ_INIT 0x00000031
  90. #define RGBPROJ_EXECUTE 0x00000032
  91. #define RGBPROJ_EXIT 0x00000033
  92. #define STRETCH_INIT 0x00000041
  93. #define STRETCH_EXECUTE 0x00000042
  94. #define STRETCH_EXIT 0x00000043
  95. #define STRETCH_CLEAR 0x00000045
  96. #define ROTATE_INIT 0x00000051 // -- 1.1 --
  97. #define ROTATE_EXECUTE 0x00000052 // -- 1.1 --
  98. #define ROTATE_EXIT 0x00000053 // -- 1.1 --
  99. #define ROTATE_STATUS 0x00000054 // -- 1.1 --
  100. #define ROTATE_STARTUP 0x00000055 // -- 1.1 --
  101. #define ROTATE_NEW 0x00000056
  102. #define VREFRESH_INIT 0x00000061 // -- 1.1 --
  103. #define VREFRESH_EXECUTE 0x00000062 // -- 1.1 --
  104. #define VREFRESH_EXIT 0x00000063 // -- 1.1 --
  105. #define SMAPI_910_RESET 0x00000070
  106. //
  107. // Return Values:
  108. //
  109. #define SMAPI_OK 0x00000000 // API calling is OK
  110. #define SMAPI_ERR_NODRV 0x00000001 // Display driver is not silicon motion's driver
  111. #define SMAPI_ERR_RESET910 0x00000002 // Chip is SM910 for reset
  112. #define SMAPI_ERR_UNKNOWNMSG 0xFFFFFFFF // unknown API message
  113. #define DS_ERR_LCD 0x00000010 // cannot switch to LCD
  114. #define DS_ERR_CRT 0x00000011 // cannot switch to CRT
  115. #define DS_ERR_TV_INSTRETCHMODE 0x00000012 // cannot switch to TV because in stretch mode
  116. #define DS_ERR_TV_VIDEOON 0x00000013 // cannot switch to TV because hw video on
  117. #define DS_ERR_TV_VIRTUALON 0x00000014 // cannot switch to TV because virtual on
  118. #define DS_ERR_TV_NOMEMORY 0x00000015 // cannot switch to TV because virtual on
  119. #define DS_ERR_LCDCRT 0x00000016 // cannot switch to LCD+CRT
  120. #define DS_ERR_LCDTV 0x00000017 // cannot switch to LCD+TV
  121. #define DS_ERR_SETMODE 0x00000018 // unable to set mode
  122. #define DS_ERR_INVALID 0x00000019 // invalid display setting
  123. #define DS_ERR_NOTV 0x00000020 // no TV support
  124. #define DS_ERR_INVALIDDISP 0x00000021 // invalid 2nd display
  125. #define DS_ERR_INVALIDTYPE 0x00000022 // invalid 2nd display type
  126. #define DS_ERR_INVALIDSIDE 0x00000023 // invalid LCD side
  127. #define DS_ERR_NOCRT 0x00000024 // CRT not attached
  128. #define DS_ERR_TV_CLRDEPTH 0x00000025 // cannot turn on TV in 24-bit
  129. #define DS_ERR_2NDMONITORON 0x00000026 // cannot do display switch while 2nd monitor on
  130. #define DS_ERR_LCDTV_RES 0x00000027 // cannot switch to LCD+CRT
  131. #define DS_ERR_TV_NOMS 0x00000028 // no microvision support
  132. #define DS_ERR_ST_712 0x00000029 // video on with stretch on
  133. #define DA_ERR_INSTRETCHMODE 0x00000030 // in stretch mode now
  134. #define DA_ERR_INDUALAPPMODE 0x00000031 // in dualapp mode now
  135. #define DA_ERR_INDUALVIEWMODE 0x00000032 // in dualview mode now
  136. #define DA_ERR_INRGBPROJMODE 0x00000033 // in rgbproj mode now
  137. #define DA_ERR_INVIRTUALSCREEN 0x00000034 // in virtual screen mode now
  138. #define DA_ERR_INVIRTUALREFRESH 0x00000035 // in virtual refresh now
  139. #define DA_ERR_VIDEOON 0x00000036 // there is a hardware video on
  140. #define DA_ERR_RESOLUTION 0x00000037 // screen resolution is not match with panel resolution
  141. #define DA_ERR_CLRDEPTH8 0x00000038 // color depth must be set to 8-bit index mode
  142. #define DA_ERR_CLRDEPTH16 0x00000039 // color depth must be set to 16-bit mode
  143. #define DA_ERR_INVALIDSIZE 0x0000003a // invalid size field
  144. #define DA_ERR_INVALIDFLAG 0x0000003b // invalid flag
  145. #define DA_ERR_NOTINDUALAPP 0x0000003c // not in dualapp mode
  146. #define DA_ERR_NOTWOAPP 0x0000003d // do not have 2 windows
  147. #define DA_ERR_APPNOTEXIST 0x0000003e // window not exist
  148. #define DA_ERR_NOTVSWAP 0x0000003f // cannot swap display when 2nd display is TV
  149. #define DA_ERR_NEED4M 0x00000040 // need 4M of memory to run DualApp
  150. #define DA_ERR_TC_RESTOOBIG 0x00000041 // Dual CRT, resolution too big
  151. #define DA_ERR_INROTATEMODE 0x00000042 // in rotation mode now -- 1.1 --
  152. #define DA_ERR_TWOVIDEO 0x00000043 // not allow 2 hw video -- 1.1 --
  153. #define DA_ERR_VIDEOHIDE 0x00000044 // video is hided -- 1.1 --
  154. #define DA_ERR_ALREADYSET 0x00000045 // already in DualApp Mode
  155. #define DA_ERR_CLRDEPTH 0x00000046 // color depth must be set to 8-bit or 16-bit mode -- 1.1 --
  156. #define DA_ERR_2NDMONITORON 0x00000046 // cannot do dual app while 2nd monitor on
  157. #define DV_ERR_INSTRETCHMODE DA_ERR_INSTRETCHMODE
  158. #define DV_ERR_INDUALAPPMODE DA_ERR_INDUALAPPMODE
  159. #define DV_ERR_INDUALVIEWMODE DA_ERR_INDUALVIEWMODE
  160. #define DV_ERR_INRGBPROJMODE DA_ERR_INRGBPROJMODE
  161. #define DV_ERR_INVIRTUALSCREEN DA_ERR_INVIRTUALSCREEN
  162. #define DV_ERR_INVIRTUALREFRESH DA_ERR_INVIRTUALREFRESH
  163. #define DV_ERR_INROTATEMODE DA_ERR_INROTATEMODE
  164. #define DV_ERR_VIDEOHIDE DA_ERR_VIDEOHIDE
  165. #define DV_ERR_2NDMONITORON DA_ERR_2NDMONITORON
  166. #define DV_ERR_CLRDEPTH16 0x00000050 // color depth must be set to 16-bit mode
  167. #define DV_ERR_TWOHWVIDEO 0x00000051 // there are 2 hw videos
  168. #define DV_ERR_RESOLUTION 0x00000052 // screen resolution is not match with panel resolution
  169. #define DV_ERR_LOCATEVIDEO 0x00000053 // cannot locate video window
  170. #define DV_ERR_INVALIDSIZE 0x00000054 // invalid size field
  171. #define DV_ERR_INVALIDFLAG 0x00000055 // invalid flag
  172. #define DV_ERR_NOTINDUALVIEW 0x00000056 // not in dual view
  173. #define DV_ERR_INVIDEODV 0x00000057 // in video DualView now, cannot do update
  174. #define DV_ERR_INVALIDRECT 0x00000058 // invalid rectangle, cannot do update
  175. #define DV_ERR_TC_RESTOOBIG 0x00000059 // Dual CRT, resolution too big
  176. #define DV_ERR_CLRDEPTH 0x0000005a // color depth must be set to 8-bit or 16-bit mode -- 1.1 --
  177. #define DV_ERR_INVALIDPARAM 0x0000005b // invalid parameter
  178. #define DV_ERR_ALREADYSET 0x0000005c // already in DualView Mode
  179. #define DV_ERR_FORMAT 0x0000005d // there is video on after invoke graphics dv
  180. #define DV_ERR_VIDEOON 0x0000005e // there is video on
  181. #define DV_ERR_SM712 0x0000005f // there is video on
  182. #define RP_ERR_INSTRETCHMODE DA_ERR_INSTRETCHMODE
  183. #define RP_ERR_INDUALAPPMODE DA_ERR_INDUALAPPMODE
  184. #define RP_ERR_INDUALVIEWMODE DA_ERR_INDUALVIEWMODE
  185. #define RP_ERR_INRGBPROJMODE DA_ERR_INRGBPROJMODE
  186. #define RP_ERR_INVIRTUALSCREEN DA_ERR_INVIRTUALSCREEN
  187. #define RP_ERR_INVIRTUALREFRESH DA_ERR_INVIRTUALREFRESH
  188. #define RP_ERR_INROTATEMODE DA_ERR_INROTATEMODE
  189. #define RP_ERR_2NDMONITORON DA_ERR_2NDMONITORON
  190. #define RP_ERR_RESOLUTION 0x00000060 // screen resolution is > 1024 or < 800
  191. #define RP_ERR_MEMORY 0x00000061 // not enough memory
  192. #define RP_ERR_BANDWIDTH 0x00000062 // not enough bandwidth
  193. #define RP_ERR_NOTINRGBPROJ 0x00000063 // not in RGB Projector mode
  194. #define RP_ERR_INVALIDCRTRES 0x00000064 // Invalid RGB projector resolution
  195. #define RP_ERR_ALREADYSET 0x00000065 // already in RGB Projector mode
  196. #define ST_ERR_INSTRETCHMODE DA_ERR_INSTRETCHMODE
  197. #define ST_ERR_INDUALAPPMODE DA_ERR_INDUALAPPMODE
  198. #define ST_ERR_INDUALVIEWMODE DA_ERR_INDUALVIEWMODE
  199. #define ST_ERR_INRGBPROJMODE DA_ERR_INRGBPROJMODE
  200. #define ST_ERR_INVIRTUALSCREEN DA_ERR_INVIRTUALSCREEN
  201. #define ST_ERR_INVIRTUALREFRESH DA_ERR_INVIRTUALREFRESH
  202. #define ST_ERR_INROTATEMODE DA_ERR_INROTATEMODE
  203. #define ST_ERR_2NDMONITORON DA_ERR_2NDMONITORON
  204. #define ST_ERR_VIDEOON 0x00000070 // there is hw video(s)
  205. #define ST_ERR_NOLCD 0x00000071 // LCD is not on
  206. #define ST_ERR_LOWRES 0x00000072 // current resolution is less than 640 x 480
  207. #define ST_ERR_HIGHRES 0x00000073 // current resolution is greater or equal than panel resolution
  208. #define ST_ERR_NOTINSTRETCH 0x00000074 // not in stretch mode
  209. #define ST_ERR_ALREADYSET 0x00000075 // already in stretch Mode
  210. // -- 1.1 -- for rotation mode
  211. #define RT_ERR_INSTRETCHMODE DA_ERR_INSTRETCHMODE
  212. #define RT_ERR_INDUALAPPMODE DA_ERR_INDUALAPPMODE
  213. #define RT_ERR_INDUALVIEWMODE DA_ERR_INDUALVIEWMODE
  214. #define RT_ERR_INRGBPROJMODE DA_ERR_INRGBPROJMODE
  215. #define RT_ERR_INVIRTUALSCREEN DA_ERR_INVIRTUALSCREEN
  216. #define RT_ERR_INVIRTUALREFRESH DA_ERR_INVIRTUALREFRESH
  217. #define RT_ERR_INROTATEMODE DA_ERR_INROTATEMODE
  218. #define RT_ERR_2NDMONITORON DA_ERR_2NDMONITORON
  219. #define RT_ERR_WRONGHW 0x00000080 // error if SM910
  220. #define RT_ERR_CLRDEPTH 0x00000081 // error if in 24-bit color depth
  221. #define RT_ERR_MEMORY 0x00000082 // not enough memory
  222. #define RT_ERR_SETMODE 0x00000083 // set rotate mode failed
  223. #define RT_ERR_DIRECTION 0x00000084 // error in rotate direction
  224. #define RT_ERR_CAPTUREON 0x00000085 // error in rotate direction
  225. #define RT_ERR_VIDEOON 0x00000086 // video on when rotate 180
  226. #define RT_ERR_DDRAWON 0x00000087 // direct draw in effect
  227. #define RT_ERR_ALREADYSET 0x00000088 // already in rotation Mode
  228. // -- 1.1 -- for virtual refresh mode
  229. #define VR_ERR_INSTRETCHMODE DA_ERR_INSTRETCHMODE
  230. #define VR_ERR_INDUALAPPMODE DA_ERR_INDUALAPPMODE
  231. #define VR_ERR_INDUALVIEWMODE DA_ERR_INDUALVIEWMODE
  232. #define VR_ERR_INRGBPROJMODE DA_ERR_INRGBPROJMODE
  233. #define VR_ERR_INVIRTUALSCREEN DA_ERR_INVIRTUALSCREEN
  234. #define VR_ERR_INROTATEMODE DA_ERR_INROTATEMODE
  235. #define VR_ERR_2NDMONITORON DA_ERR_2NDMONITORON
  236. #define VR_ERR_VIDEOON 0x00000090 // there is hw video(s)
  237. #define VR_ERR_NOTLCDONLY 0x00000091 // not LCD only
  238. #define VR_ERR_MEMORY 0x00000092 // not enough memory
  239. #define VR_ERR_NOTINVREFRESH 0x00000093 // not in virtual refresh mode
  240. #define VR_ERR_ALREADYSET 0x00000094 // already in virtual refresh mode
  241. //
  242. // Structures:
  243. //
  244. typedef struct
  245. {
  246. BOOL bWinNT;
  247. BOOL bNoTV;
  248. BOOL bTwoCRT;
  249. BOOL bChronTelTV; // -- ver 1.1 --
  250. int iMem;
  251. int cxPanelRes;
  252. int cyPanelRes;
  253. // DWORD dwWinVer1;
  254. WORD bCH7005TV;
  255. WORD bNewST;
  256. // DWORD dwWinVer2;
  257. WORD bNewTV;
  258. WORD bNoST;
  259. BOOL bNativeDrv; // native windows 98 driver
  260. BOOL bNoRT; // no rotation mode
  261. BOOL bNoDV; // no DualView
  262. BOOL bNoDA; // no DualApp
  263. WORD wChipID; // -- ver 1.1 --
  264. WORD b1024x600Panel; // -- ver 1.1 --
  265. BOOL bXGANoST24;
  266. BOOL wReserved;
  267. } SM_APIINIT;
  268. typedef SM_APIINIT FAR *LPSM_APIINIT;
  269. typedef struct
  270. {
  271. int iSize;
  272. DWORD dwFlag;
  273. HWND hWnd1;
  274. HWND hWnd2;
  275. char szApp1[MAX_PATH];
  276. char szApp2[MAX_PATH];
  277. } SM_DUALAPP;
  278. typedef SM_DUALAPP FAR *LPSM_DUALAPP;
  279. typedef struct
  280. {
  281. int iSize;
  282. DWORD dwFlag;
  283. HWND hWndCaller;
  284. RECT rCapRect;
  285. } SM_DUALVIEW;
  286. typedef SM_DUALVIEW FAR *LPSM_DUALVIEW;
  287. typedef struct
  288. {
  289. int iSize;
  290. DWORD dwFlag;
  291. HWND hWndVW1;
  292. HWND hWndVW2;
  293. } SM_DV2VW;
  294. typedef SM_DV2VW FAR *LPSM_DV2VW;
  295. //
  296. // Function Prototypes:
  297. //
  298. #ifdef __cplusplus
  299. extern "C" {
  300. #endif
  301. DWORD APIENTRY CallSMAPI(DWORD dwMessage, DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);
  302. DWORD APIENTRY dwRotateStatus();
  303. BOOL APIENTRY bNoTVSimul();
  304. BOOL APIENTRY bIsInSpecialMode(WORD wFlag);
  305. int APIENTRY nIsInSpecialMode();
  306. #ifdef __cplusplus
  307. }
  308. #endif