TermPrimP.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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. /*
  24. * $XConsortium: TermPrimP.h /main/1 1996/04/21 19:18:08 drk $";
  25. */
  26. /* *
  27. * (c) Copyright 1993, 1994 Hewlett-Packard Company *
  28. * (c) Copyright 1993, 1994 International Business Machines Corp. *
  29. * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
  30. * (c) Copyright 1993, 1994 Novell, Inc. *
  31. */
  32. #ifndef _Dt_TermPrimP_h
  33. #define _Dt_TermPrimP_h
  34. #include <Xm/LabelP.h>
  35. #include "TermPrim.h"
  36. #include "TermPrimData.h"
  37. /* include the other internal Term include files...
  38. */
  39. #include "TermPrimScroll.h"
  40. #include "TermPrimRender.h"
  41. #include "TermPrimCursor.h"
  42. #include "TermPrimLineFont.h"
  43. #include "TermPrimBuffer.h"
  44. #include "TermPrimSubproc.h"
  45. /*
  46. ** Now we can choose what shell we want
  47. ** NOTE:
  48. ** (is it worth making resources for defaultShell
  49. ** and defaultShellArgv0?) JRM
  50. */
  51. #define DEFAULT_SHELL "/bin/sh"
  52. #define DEFAULT_SHELL_ARGV0 "sh"
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif /* __cplusplus */
  56. /* term class structure... */
  57. typedef int
  58. (*TermInsertProc)
  59. (
  60. Widget w,
  61. unsigned char *buffer,
  62. int length
  63. );
  64. typedef struct _DtTermPrimitiveClassPart
  65. {
  66. StateTable *parser_start_state;
  67. Boolean use_history_buffer;
  68. Boolean allow_scroll_below_buffer;
  69. Boolean wrap_right_after_insert;
  70. BufferCreateProc buffer_create_proc;
  71. BufferFreeProc buffer_free_proc;
  72. TermInsertProc term_insert_proc;
  73. short sizeOfBuffer;
  74. short sizeOfLine;
  75. short sizeOfEnh;
  76. } DtTermPrimitiveClassPart;
  77. /* full class record declaration for Term class... */
  78. typedef struct _DtTermPrimitiveClassRec {
  79. CoreClassPart core_class;
  80. XmPrimitiveClassPart primitive_class;
  81. DtTermPrimitiveClassPart term_primitive_class;
  82. } DtTermPrimitiveClassRec;
  83. externalref DtTermPrimitiveClassRec dtTermPrimitiveClassRec;
  84. /* term instance record... */
  85. typedef struct _DtTermPrimitivePart
  86. {
  87. struct termData *tpd; /* non-widget terminal data */
  88. Widget verticalScrollBar; /* vertical sb to update/track */
  89. short verticalScrollBarValue; /* cached sb value */
  90. short verticalScrollBarMaximum; /* cached sb maximum */
  91. short verticalScrollBarSliderSize; /* cached sb size */
  92. short verticalScrollBarPageIncrement;
  93. /* cached sb page inc */
  94. unsigned char charCursorStyle; /* cursor style: bar or box */
  95. int blinkRate; /* cursor blink rate (0 == no
  96. * blink
  97. */
  98. Boolean consoleMode; /* true == get console output */
  99. Boolean backgroundIsSelect; /* true == background is select
  100. * color
  101. */
  102. Boolean visualBell; /* true == visual bell */
  103. Boolean marginBell; /* true == rt margin waring bell*/
  104. int nMarginBell; /* warning bell distance */
  105. Boolean jumpScroll; /* true == jumpscroll,
  106. * false == line by line scroll
  107. */
  108. Boolean hasFocus; /* true == window has focus
  109. * (and the cursor blinks)
  110. */
  111. char *emulationId; /* $TERMINAL_EMULATOR variable */
  112. char *termId; /* term ID string for esc seq */
  113. char *termName; /* $TERM string */
  114. char *ttyModes; /* ttyModes string */
  115. char *csWidth; /* csWidth string */
  116. unsigned char shadowType; /* shadow type for term window */
  117. XmFontList fontList; /* fontList for base font */
  118. XmFontList boldFontList; /* fontList for bold font */
  119. XFontStruct *font; /* font for base font */
  120. XFontStruct *boldFont; /* font for bold font */
  121. XFontSet fontSet; /* fontSet generated from either
  122. * the fontList or the font above
  123. */
  124. XFontSet boldFontSet; /* fontSet generated from either
  125. * the boldFontList or the boldFont
  126. * above
  127. */
  128. Boolean haveFontSet; /* true == we have a valid fontSet
  129. */
  130. char *saveLines; /* save lines or screens */
  131. short rows; /* rows of displayed term win */
  132. short columns; /* columns of term win & memory */
  133. Dimension marginHeight; /* width of window's margin */
  134. Dimension marginWidth; /* height of window's margin */
  135. int baseWidth; /* base width for size hints */
  136. int baseHeight; /* base height for size hints */
  137. int widthInc; /* width inc for size hints */
  138. int heightInc; /* height inc for size hints */
  139. int ascent; /* ascent for font */
  140. int pty; /* file descriptor of pty */
  141. Boolean ptyAllocate; /* true, allocate a pty */
  142. char *ptySlaveName; /* name of pty slave device */
  143. int subprocessPid; /* process id of child (shell)
  144. * process
  145. */
  146. char *subprocessCWD; /* subprocess working directory */
  147. char *subprocessCmd; /* subprocess cmd to exec */
  148. char **subprocessArgv; /* argv to pass to above cmd */
  149. Boolean subprocessLoginShell; /* if true, prepend argv[0] with
  150. * a '-'
  151. */
  152. Boolean subprocessTerminationCatch; /* if true, catch child exit() */
  153. Boolean subprocessExec; /* if true, exec subprocess */
  154. _termSubprocId subprocessId; /* id of subprocess as returned
  155. * by the subprocess code.
  156. */
  157. XtCallbackList inputVerifyCallback; /* callback invoked when keyboard
  158. * input or selection input is
  159. * received.
  160. */
  161. XtCallbackList outputLogCallback; /* callback invoked when pty output
  162. * is received.
  163. */
  164. XtCallbackList statusChangeCallback;/* callback invoked when there is
  165. * some sort of status change
  166. * (cursor motion, capsLockChange,
  167. * outputStopped, etc). Reason
  168. * indicates which has changed.
  169. */
  170. XtCallbackList subprocessTerminationCallback;
  171. /* callback invoked by subprocess
  172. * termination (exit())
  173. */
  174. Boolean kshMode; /* use meta for escape */
  175. Boolean pointerBlank; /* blank pointer after */
  176. int pointerBlankDelay; /* pointerBlankDelay secs */
  177. Cursor pointerShape; /* pointer pixmap */
  178. Pixel pointerColor; /* pointer color */
  179. Pixel pointerColorBackground; /* pointer background color */
  180. Boolean mapOnOutput; /* map term on pty output after */
  181. int mapOnOutputDelay; /* mapOnOutputDelay secs */
  182. Boolean logging; /* copy tty output to file/pipe */
  183. Boolean log_on; /* is log file (pipe) open? */
  184. char * logFile; /* named logFile (default "logFile"*/
  185. Boolean logInhibit; /* don't allow logging */
  186. Boolean reverseVideo; /* true, reverse video on */
  187. uid_t euid_root; /* suid */
  188. uid_t euid_user; /* user id */
  189. Boolean allowSendEvents; /* allow key, button presses */
  190. Boolean allowOsfKeysyms; /* allow osfKeysyms through */
  191. } DtTermPrimitivePart;
  192. /* full instance record declaration... */
  193. typedef struct _DtTermPrimitiveRec {
  194. CorePart core;
  195. XmPrimitivePart primitive;
  196. DtTermPrimitivePart term;
  197. } DtTermPrimitiveRec;
  198. /* private function declarations... */
  199. /* end private function declarations... */
  200. #ifdef __cplusplus
  201. } /* close scope of 'extern "C"'... */
  202. #endif /* __cplusplus */
  203. /*
  204. ** Some handy macros.
  205. */
  206. #define GetParserContext(w) (((DtTermPrimitiveWidget)w)->term.tpd->context)
  207. #endif /* _Dt_TermPrimP_h */
  208. /* DON'T ADD ANYTHING AFTER THIS #endif... */