Term.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: Term.h /main/1 1996/04/21 19:15:14 drk $ */
  24. /*
  25. * (c) Copyright 1993, 1994 Hewlett-Packard Company
  26. * (c) Copyright 1993, 1994 International Business Machines Corp.
  27. * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  28. * (c) Copyright 1993, 1994 Novell, Inc.
  29. */
  30. #ifndef _Dt_TermPrim_h
  31. #define _Dt_TermPrim_h
  32. #include <sys/wait.h>
  33. #include <Xm/Xm.h>
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /*
  38. * Constants
  39. */
  40. /* Resources */
  41. #ifndef DtNbackgroundIsSelect
  42. #define DtNbackgroundIsSelect "backgroundIsSelect"
  43. #endif
  44. #ifndef DtNblinkRate
  45. #define DtNblinkRate "blinkRate"
  46. #endif
  47. #ifndef DtNcharCursorStyle
  48. #define DtNcharCursorStyle "charCursorStyle"
  49. #endif
  50. #ifndef DtNconsoleMode
  51. #define DtNconsoleMode "consoleMode"
  52. #endif
  53. #ifndef DtNcsWidth
  54. #define DtNcsWidth "csWidth"
  55. #endif
  56. #ifndef DtNemulationId
  57. #define DtNemulationId "emulationId"
  58. #endif
  59. #ifndef DtNinputVerifyCallback
  60. #define DtNinputVerifyCallback "inputVerifyCallback"
  61. #endif
  62. #ifndef DtNjumpScroll
  63. #define DtNjumpScroll "jumpScroll"
  64. #endif
  65. #ifndef DtNkshMode
  66. #define DtNkshMode "kshMode"
  67. #endif
  68. #ifndef DtNlogFile
  69. #define DtNlogFile "logFile"
  70. #endif
  71. #ifndef DtNlogInhibit
  72. #define DtNlogInhibit "logInhibit"
  73. #endif
  74. #ifndef DtNlogging
  75. #define DtNlogging "logging"
  76. #endif
  77. #ifndef DtNloginShell
  78. #define DtNloginShell "loginShell"
  79. #endif
  80. #ifndef DtNmapOnOutput
  81. #define DtNmapOnOutput "mapOnOutput"
  82. #endif
  83. #ifndef DtNmapOnOutputDelay
  84. #define DtNmapOnOutputDelay "mapOnOutputDelay"
  85. #endif
  86. #ifndef DtNmarginBell
  87. #define DtNmarginBell "marginBell"
  88. #endif
  89. #ifndef DtNnMarginBell
  90. #define DtNnMarginBell "nMarginBell"
  91. #endif
  92. #ifndef DtNoutputLogCallback
  93. #define DtNoutputLogCallback "outputLogCallback"
  94. #endif
  95. #ifndef DtNpointerBlank
  96. #define DtNpointerBlank "pointerBlank"
  97. #endif
  98. #ifndef DtNpointerBlankDelay
  99. #define DtNpointerBlankDelay "pointerBlankDelay"
  100. #endif
  101. #ifndef DtNpointerColor
  102. #define DtNpointerColor "pointerColor"
  103. #endif
  104. #ifndef DtNpointerColorBackground
  105. #define DtNpointerColorBackground "pointerColorBackground"
  106. #endif
  107. #ifndef DtNpointerShape
  108. #define DtNpointerShape "pointerShape"
  109. #endif
  110. #ifndef DtNreverseVideo
  111. #define DtNreverseVideo "reverseVideo"
  112. #endif
  113. #ifndef DtNsaveLines
  114. #define DtNsaveLines "saveLines"
  115. #endif
  116. #ifndef DtNsizeList
  117. #define DtNsizeList "sizeList"
  118. #endif
  119. #ifndef DtNstatusChangeCallback
  120. #define DtNstatusChangeCallback "statusChangeCallback"
  121. #endif
  122. #ifndef DtNstickyNextCursor
  123. #define DtNstickyNextCursor "stickyNextCursor"
  124. #endif
  125. #ifndef DtNstickyPrevCursor
  126. #define DtNstickyPrevCursor "stickyPrevCursor"
  127. #endif
  128. #ifndef DtNsubprocessLoginShell
  129. #define DtNsubprocessLoginShell "subprocessLoginShell"
  130. #endif
  131. #ifndef DtNsubprocessPid
  132. #define DtNsubprocessPid "subprocessPid"
  133. #endif
  134. #ifndef DtNsubprocessExec
  135. #define DtNsubprocessExec "subprocessExec"
  136. #endif
  137. #ifndef DtNsubprocessTerminationCatch
  138. #define DtNsubprocessTerminationCatch "subprocessTerminationCatch"
  139. #endif
  140. #ifndef DtNsubprocessCmd
  141. #define DtNsubprocessCmd "subprocessCmd"
  142. #endif
  143. #ifndef DtNsubprocessArgv
  144. #define DtNsubprocessArgv "subprocessArgv"
  145. #endif
  146. #ifndef DtNsubprocessTerminationCallback
  147. #define DtNsubprocessTerminationCallback "subprocessTerminationCallback"
  148. #endif
  149. #ifndef DtNtermEmulationMode
  150. #define DtNtermEmulationMode "termEmulationMode"
  151. #endif
  152. #ifndef DtNtermDevice
  153. #define DtNtermDevice "termDevice"
  154. #endif
  155. #ifndef DtNtermDeviceAllocate
  156. #define DtNtermDeviceAllocate "termDeviceAllocate"
  157. #endif
  158. #ifndef DtNtermId
  159. #define DtNtermId "termId"
  160. #endif
  161. #ifndef DtNtermName
  162. #define DtNtermName "termName"
  163. #endif
  164. #ifndef DtNtermSlaveName
  165. #define DtNtermSlaveName "termSlaveName"
  166. #endif
  167. #ifndef DtNttyModes
  168. #define DtNttyModes "ttyModes"
  169. #endif
  170. #ifndef DtNuseFontSets
  171. #define DtNuseFontSets "useFontSets"
  172. #endif
  173. #ifndef DtNuseLineDraw
  174. #define DtNuseLineDraw "useLineDraw"
  175. #endif
  176. #ifndef DtNuserFont
  177. #define DtNuserFont "userFont"
  178. #endif
  179. #ifndef DtNuserBoldFont
  180. #define DtNuserBoldFont "userBoldFont"
  181. #endif
  182. #ifndef DtNvisualBell
  183. #define DtNvisualBell "visualBell"
  184. #endif
  185. #ifndef DtNallowSendEvents
  186. #define DtNallowSendEvents "allowSendEvents"
  187. #endif
  188. #ifndef DtNbaseHeight
  189. #define DtNbaseHeight XmNbaseHeight
  190. #endif
  191. #ifndef DtNbaseWidth
  192. #define DtNbaseWidth XmNbaseWidth
  193. #endif
  194. #ifndef DtNcolumns
  195. #define DtNcolumns XmNcolumns
  196. #endif
  197. #ifndef DtNheightInc
  198. #define DtNheightInc XmNheightInc
  199. #endif
  200. #ifndef DtNmarginHeight
  201. #define DtNmarginHeight XmNmarginHeight
  202. #endif
  203. #ifndef DtNmarginWidth
  204. #define DtNmarginWidth XmNmarginWidth
  205. #endif
  206. #ifndef DtNrows
  207. #define DtNrows XmNrows
  208. #endif
  209. #ifndef DtNshadowType
  210. #define DtNshadowType XmNshadowType
  211. #endif
  212. #ifndef DtNverticalScrollBar
  213. #define DtNverticalScrollBar XmNverticalScrollBar
  214. #endif
  215. #ifndef DtNwidthInc
  216. #define DtNwidthInc XmNwidthInc
  217. #endif
  218. #ifndef DtCBackground
  219. #define DtCBackground XmCBackground
  220. #endif
  221. #ifndef DtCBackgroundIsSelect
  222. #define DtCBackgroundIsSelect "BackgroundIsSelect"
  223. #endif
  224. #ifndef DtCBlinkRate
  225. #define DtCBlinkRate "BlinkRate"
  226. #endif
  227. #ifndef DtCCallback
  228. #define DtCCallback XmCCallback
  229. #endif
  230. #ifndef DtCCursor
  231. #define DtCCursor XmCCursor
  232. #endif
  233. #ifndef DtCConsoleMode
  234. #define DtCConsoleMode "ConsoleMode"
  235. #endif
  236. #ifndef DtCCsWidth
  237. #define DtCCsWidth "CsWidth"
  238. #endif
  239. #ifndef DtCCharCursorStyle
  240. #define DtCCharCursorStyle "CharCursorStyle"
  241. #endif
  242. #ifndef DtCEmulationId
  243. #define DtCEmulationId "EmulationId"
  244. #endif
  245. #ifndef DtCForeground
  246. #define DtCForeground XmCForeground
  247. #endif
  248. #ifndef DtCJumpScroll
  249. #define DtCJumpScroll "JumpScroll"
  250. #endif
  251. #ifndef DtCKshMode
  252. #define DtCKshMode "KshMode"
  253. #endif
  254. #ifndef DtCLogFile
  255. #define DtCLogFile "LogFile"
  256. #endif
  257. #ifndef DtCLogInhibit
  258. #define DtCLogInhibit "LogInhibit"
  259. #endif
  260. #ifndef DtCLogging
  261. #define DtCLogging "Logging"
  262. #endif
  263. #ifndef DtCLoginShell
  264. #define DtCLoginShell "LoginShell"
  265. #endif
  266. #ifndef DtCMapOnOutput
  267. #define DtCMapOnOutput "MapOnOutput"
  268. #endif
  269. #ifndef DtCMapOnOutputDelay
  270. #define DtCMapOnOutputDelay "MapOnOutputDelay"
  271. #endif
  272. #ifndef DtCMarginBell
  273. #define DtCMarginBell "MarginBell"
  274. #endif
  275. #ifndef DtCNMarginBell
  276. #define DtCNMarginBell "NMarginBell"
  277. #endif
  278. #ifndef DtCPointerBlank
  279. #define DtCPointerBlank "PointerBlank"
  280. #endif
  281. #ifndef DtCPointerBlankDelay
  282. #define DtCPointerBlankDelay "PointerBlankDelay"
  283. #endif
  284. #ifndef DtCPointerColor
  285. #define DtCPointerColor "PointerColor"
  286. #endif
  287. #ifndef DtCPointerColorBackground
  288. #define DtCPointerColorBackground "PointerColorBackground"
  289. #endif
  290. #ifndef DtCPointerShape
  291. #define DtCPointerShape "PointerShape"
  292. #endif
  293. #ifndef DtCReverseVideo
  294. #define DtCReverseVideo "ReverseVideo"
  295. #endif
  296. #ifndef DtCSaveLines
  297. #define DtCSaveLines "SaveLines"
  298. #endif
  299. #ifndef DtCSizeList
  300. #define DtCSizeList "SizeList"
  301. #endif
  302. #ifndef DtCStickyCursor
  303. #define DtCStickyCursor "StickyCursor"
  304. #endif
  305. #ifndef DtCSubprocessLoginShell
  306. #define DtCSubprocessLoginShell "SubprocessLoginShell"
  307. #endif
  308. #ifndef DtCSubprocessPid
  309. #define DtCSubprocessPid "SubprocessPid"
  310. #endif
  311. #ifndef DtCSubprocessExec
  312. #define DtCSubprocessExec "SubprocessExec"
  313. #endif
  314. #ifndef DtCSubprocessTerminationCatch
  315. #define DtCSubprocessTerminationCatch "SubprocessTerminationCatch"
  316. #endif
  317. #ifndef DtCSubprocessCmd
  318. #define DtCSubprocessCmd "SubprocessCmd"
  319. #endif
  320. #ifndef DtCSubprocessArgv
  321. #define DtCSubprocessArgv "SubprocessArgv"
  322. #endif
  323. #ifndef DtCTermEmulationMode
  324. #define DtCTermEmulationMode "TermEmulationMode"
  325. #endif
  326. #ifndef DtCTermDevice
  327. #define DtCTermDevice "TermDevice"
  328. #endif
  329. #ifndef DtCTermDeviceAllocate
  330. #define DtCTermDeviceAllocate "TermDeviceAllocate"
  331. #endif
  332. #ifndef DtCTermId
  333. #define DtCTermId "TermId"
  334. #endif
  335. #ifndef DtCTermName
  336. #define DtCTermName "TermName"
  337. #endif
  338. #ifndef DtCTermSlaveName
  339. #define DtCTermSlaveName "TermSlaveName"
  340. #endif
  341. #ifndef DtCTtyModes
  342. #define DtCTtyModes "TtyModes"
  343. #endif
  344. #ifndef DtCUseFontSets
  345. #define DtCUseFontSets "UseFontSets"
  346. #endif
  347. #ifndef DtCUseLineDraw
  348. #define DtCUseLineDraw "UseLineDraw"
  349. #endif
  350. #ifndef DtCUserFont
  351. #define DtCUserFont "UserFont"
  352. #endif
  353. #ifndef DtCUserBoldFont
  354. #define DtCUserBoldFont "UserBoldFont"
  355. #endif
  356. #ifndef DtCVisualBell
  357. #define DtCVisualBell "VisualBell"
  358. #endif
  359. #ifndef DtCAllowSendEvents
  360. #define DtCAllowSendEvents "AllowSendEvents"
  361. #endif
  362. #ifndef DtCBaseHeight
  363. #define DtCBaseHeight XmCBaseHeight
  364. #endif
  365. #ifndef DtCBaseWidth
  366. #define DtCBaseWidth XmCBaseWidth
  367. #endif
  368. #ifndef DtCColumns
  369. #define DtCColumns XmCColumns
  370. #endif
  371. #ifndef DtCHeightInc
  372. #define DtCHeightInc XmCHeightInc
  373. #endif
  374. #ifndef DtCMarginHeight
  375. #define DtCMarginHeight XmCMarginHeight
  376. #endif
  377. #ifndef DtCMarginWidth
  378. #define DtCMarginWidth XmCMarginWidth
  379. #endif
  380. #ifndef DtCRows
  381. #define DtCRows XmCRows
  382. #endif
  383. #ifndef DtCShadowType
  384. #define DtCShadowType XmCShadowType
  385. #endif
  386. #ifndef DtCVerticalScrollBar
  387. #define DtCVerticalScrollBar XmCVerticalScrollBar
  388. #endif
  389. #ifndef DtCWidthInc
  390. #define DtCWidthInc XmCWidthInc
  391. #endif
  392. /* Representation types */
  393. #define DtRDtTermCharCursorStyle "DtTermCharCursorStyle"
  394. #define DtRDtTermEmulationMode "DtTermEmulationMode"
  395. #define DtRDtTermTerminalSize "DtTermTerminalSize"
  396. #define DtRDtTermTerminalSizeList "DtTermTerminalSizeList"
  397. /* DtNshadowType values */
  398. #ifndef DtSHADOW_IN
  399. #define DtSHADOW_IN XmSHADOW_IN
  400. #endif
  401. #ifndef DtSHADOW_OUT
  402. #define DtSHADOW_OUT XmSHADOW_OUT
  403. #endif
  404. #ifndef DtSHADOW_ETCHED_IN
  405. #define DtSHADOW_ETCHED_IN XmSHADOW_ETCHED_IN
  406. #endif
  407. #ifndef DtSHADOW_ETCHED_OUT
  408. #define DtSHADOW_ETCHED_OUT XmSHADOW_ETCHED_OUT
  409. #endif
  410. #define DtTERM_CHAR_CURSOR_BOX 0
  411. #define DtTERM_CHAR_CURSOR_BAR 1
  412. #define DtTERM_CHAR_CURSOR_INVISIBLE 2
  413. #define DtTermEMULATIONHP 0
  414. #define DtTermEMULATIONANSI 1
  415. /* Callback reasons */
  416. #define DtCR_TERM_SUBPROCESS_TERMINATION 1
  417. #define DtCR_TERM_STATUS_CHANGE 2
  418. #define DtCR_TERM_INPUT_VERIFY 7
  419. #define DtCR_TERM_OUTPUT_LOG 8
  420. /*
  421. * Types
  422. */
  423. /* insert char mode */
  424. typedef enum {
  425. DtTERM_INSERT_CHAR_OFF = 0,
  426. DtTERM_INSERT_CHAR_ON,
  427. DtTERM_INSERT_CHAR_ON_WRAP
  428. } DtTermInsertCharMode;
  429. typedef struct {
  430. int reason;
  431. XEvent *event;
  432. int cursorX;
  433. int cursorY;
  434. Boolean capsLock;
  435. Boolean stop;
  436. DtTermInsertCharMode insertCharMode;
  437. Boolean locked;
  438. } DtTermStatusChangeCallbackStruct;
  439. typedef struct {
  440. int reason;
  441. XEvent *event;
  442. pid_t pid;
  443. int status;
  444. } DtTermSubprocessTerminationCallbackStruct;
  445. typedef struct {
  446. int reason;
  447. XEvent *event;
  448. Boolean doit;
  449. unsigned char *text;
  450. int length;
  451. } DtTermInputVerifyCallbackStruct;
  452. typedef struct {
  453. int reason;
  454. XEvent *event;
  455. unsigned char *text;
  456. int length;
  457. } DtTermOutputLogCallbackStruct;
  458. typedef struct _DtTermTerminalSize {
  459. short rows;
  460. short columns;
  461. } DtTermTerminalSize;
  462. typedef struct _DtTermTerminalSizeList {
  463. int numSizes;
  464. DtTermTerminalSize *sizes;
  465. } DtTermTerminalSizeList;
  466. /* Widget class and instance */
  467. typedef struct _DtTermPrimitiveClassRec *DtTermPrimitiveWidgetClass;
  468. typedef struct _DtTermPrimitiveRec *DtTermPrimitiveWidget;
  469. /*
  470. * Data
  471. */
  472. /* Widget class record */
  473. externalref WidgetClass dtTermPrimitiveWidgetClass;
  474. /*
  475. * Functions
  476. */
  477. extern Widget DtCreateTermPrimitive(
  478. Widget parent,
  479. char *name,
  480. ArgList arglist,
  481. Cardinal argcount);
  482. extern void DtTermInitialize(void);
  483. extern void DtTermDisplaySend(
  484. Widget widget,
  485. unsigned char *buffer,
  486. int length);
  487. extern void DtTermSubprocSend(
  488. Widget widget,
  489. unsigned char *buffer,
  490. int length);
  491. extern void DtTermSubprocReap(
  492. pid_t pid,
  493. int *stat_loc);
  494. #ifdef __cplusplus
  495. }
  496. #endif
  497. #endif /* _Dt_TermPrim_h */
  498. #ifndef _Dt_Term_h
  499. #define _Dt_Term_h
  500. #include <Dt/TermPrim.h>
  501. #ifdef __cplusplus
  502. extern "C" {
  503. #endif
  504. /*
  505. * Constants
  506. */
  507. /* Resources */
  508. #ifndef DtNfunctionKeyExecuteProc
  509. #define DtNfunctionKeyExecuteProc "functionKeyExecuteProc"
  510. #endif
  511. #ifndef DtNfunctionKeyUpdateProc
  512. #define DtNfunctionKeyUpdateProc "functionKeyUpdateProc"
  513. #endif
  514. #ifndef DtNautoWrap
  515. #define DtNautoWrap "autoWrap"
  516. #endif
  517. #ifndef DtNreverseWrap
  518. #define DtNreverseWrap "reverseWrap"
  519. #endif
  520. #ifndef DtNsunFunctionKeys
  521. #define DtNsunFunctionKeys "sunFunctionKeys"
  522. #endif
  523. #ifndef DtNc132
  524. #define DtNc132 "c132"
  525. #endif
  526. #ifndef DtNappCursorDefault
  527. #define DtNappCursorDefault "appCursorDefault"
  528. #endif
  529. #ifndef DtNappKeypadDefault
  530. #define DtNappKeypadDefault "appKeypadDefault"
  531. #endif
  532. #ifndef DtCFunctionKeyExecuteProc
  533. #define DtCFunctionKeyExecuteProc "FunctionKeyExecuteProc"
  534. #endif
  535. #ifndef DtCFunctionKeyUpdateProc
  536. #define DtCFunctionKeyUpdateProc "FunctionKeyUpdateProc"
  537. #endif
  538. #ifndef DtCFunctionKeyLast
  539. #define DtCFunctionKeyLast "FunctionKeyLast"
  540. #endif
  541. #ifndef DtCAutoWrap
  542. #define DtCAutoWrap "AutoWrap"
  543. #endif
  544. #ifndef DtCReverseWrap
  545. #define DtCReverseWrap "ReverseWrap"
  546. #endif
  547. #ifndef DtCSunFunctionKeys
  548. #define DtCSunFunctionKeys "SunFunctionKeys"
  549. #endif
  550. #ifndef DtCC132
  551. #define DtCC132 "C132"
  552. #endif
  553. #ifndef DtCAppCursorDefault
  554. #define DtCAppCursorDefault "AppCursorDefault"
  555. #endif
  556. #ifndef DtCAppKeypadDefault
  557. #define DtCAppKeypadDefault "AppKeypadDefault"
  558. #endif
  559. /*
  560. * Types
  561. */
  562. /* Widget class and instance */
  563. typedef struct _DtTermClassRec *DtTermWidgetClass;
  564. typedef struct _DtTermRec *DtTermWidget;
  565. /*
  566. * Data
  567. */
  568. /* Widget class record */
  569. externalref WidgetClass dtTermWidgetClass;
  570. /*
  571. * Functions
  572. */
  573. extern Widget DtCreateTerm(
  574. Widget parent,
  575. char *name,
  576. ArgList arglist,
  577. Cardinal argcount);
  578. #ifdef __cplusplus
  579. }
  580. #endif
  581. #endif /* _Dt_Term_h */