XTermView.st
changeset 13816 732c224bdfb9
parent 13790 743e45769350
child 13907 99bbb7660e97
equal deleted inserted replaced
13815:2b090510c0b7 13816:732c224bdfb9
   101     clientInitiated ifFalse:[^self].
   101     clientInitiated ifFalse:[^self].
   102     
   102     
   103     "But hackish..."
   103     "But hackish..."
   104     app := self application.
   104     app := self application.
   105     app ifNil:[^self].
   105     app ifNil:[^self].
       
   106     (app class == FileApplicationNoteBook::Terminal) ifTrue:[
       
   107         app doClose.
       
   108         ^self.
       
   109     ].
   106     #(removeWorkspace "WorkspaceApplication"
   110     #(removeWorkspace "WorkspaceApplication"
   107       doCloseApplication "FileBrowserNotebook"
       
   108       bufferMenuRemoveCurrentBuffer "NewSystemBrowser"
   111       bufferMenuRemoveCurrentBuffer "NewSystemBrowser"
   109     ) do:[:closeSelector|
   112     ) do:[:closeSelector|
   110         (app topApplication respondsTo: closeSelector) ifTrue:
   113         (app topApplication respondsTo: closeSelector) ifTrue: [
   111             [app topApplication perform: closeSelector]].
   114             app topApplication perform: closeSelector.
       
   115             ^self
       
   116         ]
       
   117     ].
   112 
   118 
   113     "Created: / 06-06-2011 / 10:04:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   119     "Created: / 06-06-2011 / 10:04:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   114 ! !
   120 ! !
   115 
   121 
   116 !XTermView methodsFor:'initialization & release'!
   122 !XTermView methodsFor:'initialization & release'!
   136     wd := Filename defaultDirectory asString
   142     wd := Filename defaultDirectory asString
   137 
   143 
   138     "Created: / 25-11-2010 / 12:34:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   144     "Created: / 25-11-2010 / 12:34:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   139 ! !
   145 ! !
   140 
   146 
       
   147 !XTermView methodsFor:'menu'!
       
   148 
       
   149 doClear
       
   150     "reset the scroll-range etc, clear the text buffer"
       
   151 
       
   152 "/    rangeStartLine := 1.
       
   153 "/    rangeEndLine := numberOfLines.
       
   154 "/
       
   155 "/    self normal.
       
   156 "/    self clear.
       
   157 
       
   158     "Created: / 03-04-2007 / 08:58:59 / cg"
       
   159     "Modified: / 03-04-2012 / 10:34:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   160 !
       
   161 
       
   162 doReset
       
   163     "reset the scroll-range; 
       
   164      may have to reset more in the future (current font-set; color; etc)"
       
   165 
       
   166 "/    rangeStartLine := 1.
       
   167 "/    rangeEndLine := numberOfLines.
       
   168 "/
       
   169 "/    self normal.
       
   170 
       
   171     "Modified: / 03-04-2012 / 10:34:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   172 !
       
   173 
       
   174 doSendInterrupt
       
   175     "send an INT-signal to the shell (UNIX only)"
       
   176     pid notNil ifTrue:[
       
   177         OperatingSystem sendSignal:(OperatingSystem sigINT) to:pid negated.
       
   178     ].
       
   179 
       
   180     "Modified: / 10-06-1998 / 17:49:49 / cg"
       
   181     "Modified: / 03-04-2012 / 10:34:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   182 !
       
   183 
       
   184 doSendKillSignal
       
   185     "send a KILL-signal to the shell (UNIX only)"
       
   186 
       
   187     pid notNil ifTrue:[
       
   188         OperatingSystem sendSignal:(OperatingSystem sigKILL) to:pid negated.
       
   189     ]
       
   190 
       
   191     "Modified: / 03-04-2012 / 10:34:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   192 ! !
       
   193 
   141 !XTermView methodsFor:'mimicry'!
   194 !XTermView methodsFor:'mimicry'!
       
   195 
       
   196 defaultFileNameForFileDialog
       
   197 
       
   198     ^nil
       
   199 
       
   200     "Created: / 03-05-2012 / 12:29:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   201 !
       
   202 
       
   203 lineLimit:aSmallInteger
       
   204 
       
   205     "Nothing"
       
   206 
       
   207     "Created: / 03-04-2012 / 10:42:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   208 !
       
   209 
       
   210 list
       
   211     ^nil
       
   212 
       
   213     "Created: / 17-07-2012 / 21:11:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   214 !
       
   215 
       
   216 modified
       
   217 
       
   218     ^false
       
   219 
       
   220     "Created: / 03-05-2012 / 11:42:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   221 !
       
   222 
       
   223 save
       
   224 
       
   225     Dialog warn: 'Not yet implemented for XTermView'
       
   226 
       
   227     "Created: / 03-04-2012 / 10:43:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   228 !
       
   229 
       
   230 selectionAsString
       
   231 
       
   232     ^ (device getSelectionOwnerOf: #PRIMARY) = drawableId ifTrue:[
       
   233         device getClipboardText:#selection for:drawableId
       
   234     ] ifFalse:[
       
   235         nil
       
   236     ]
       
   237 
       
   238     "Created: / 03-04-2012 / 10:30:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   239 !
       
   240 
       
   241 sendLine:aString
       
   242     self halt:'please define sendLine: here'.
       
   243 
       
   244     "Created: / 03-04-2012 / 10:33:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   245 !
   142 
   246 
   143 shellTerminateAction: aBlock
   247 shellTerminateAction: aBlock
   144 
   248 
   145     "Nothing to do"
   249     "Nothing to do"
   146 
   250 
   165 
   269 
   166     "Created: / 25-11-2010 / 12:25:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   270     "Created: / 25-11-2010 / 12:25:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   167 !
   271 !
   168 
   272 
   169 xtermArgs
   273 xtermArgs
       
   274 
   170     | args |
   275     | args |
   171 
   276 
   172     args := OrderedCollection new.
   277     args := OrderedCollection new.
   173     args
   278     args
   174         add: self xtermExecutable;
   279         add: self xtermExecutable;
   175         add: (XTermType == #rxvt ifTrue:['-embed'] ifFalse:['-into']); add:self drawableId address printString;        
   280         add: (XTermType == #xterm ifTrue:['-into'] ifFalse:['-embed']); add: drawableId address printString;        
   176         add: '-j';
   281         add: '-j';
   177         add: '-font'; add: (device fullFontNameOf: (font fontId));
   282         add: '-font'; add: (device fullFontNameOf: (font fontId));
   178         add: '-fg'; add: 'white'"(self xcolorNameFor: foreground)";
   283         add: '-fg'; add: 'white'"(self xcolorNameFor: foreground)";
   179         add: '-bg'; add: 'black'"(self xcolorNameFor: viewBackground)".
   284         add: '-bg'; add: 'black'"(self xcolorNameFor: viewBackground)".
   180 
   285 
   181     XTermType == #rxvt ifTrue:[
   286     XTermType == #rxvt ifTrue:[
   182     args
   287     args
   183         add: '-tn'; add: 'xterm'
   288         add: '-tn'; add: 'xterm'
   184     ].
   289     ].
   185 
   290 
   186     ^ args asArray
   291     ^args asArray
   187 
   292 
   188     "Modified: / 10-06-2011 / 19:51:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   293     "Modified: / 12-09-2013 / 00:12:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   189 !
   294 !
   190 
   295 
   191 xtermExecutable
   296 xtermExecutable
   192 
   297 
   193     ^ XTermExecutable
   298     ^ XTermExecutable
   246 
   351 
   247 !XTermView methodsFor:'testing'!
   352 !XTermView methodsFor:'testing'!
   248 
   353 
   249 isTextView
   354 isTextView
   250 
   355 
   251     ^false
   356     ^true
   252 
   357 
   253     "Created: / 13-09-2011 / 11:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   358     "Created: / 13-09-2011 / 11:22:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   254 ! !
   359 ! !
   255 
   360 
   256 !XTermView class methodsFor:'documentation'!
   361 !XTermView class methodsFor:'documentation'!
   257 
   362 
   258 version_CVS
   363 version_CVS
   259     ^ '$Header: /cvs/stx/stx/libtool/XTermView.st,v 1.4 2014-02-04 10:06:57 stefan Exp $'
   364     ^ '$Header: /cvs/stx/stx/libtool/XTermView.st,v 1.5 2014-02-05 18:57:03 cg Exp $'
   260 !
   365 !
   261 
   366 
   262 version_SVN
   367 version_SVN
   263     ^ '$Id: XTermView.st,v 1.4 2014-02-04 10:06:57 stefan Exp $'
   368     ^ '$Id: XTermView.st,v 1.5 2014-02-05 18:57:03 cg Exp $'
   264 ! !
   369 ! !
   265 
   370 
   266 
   371 
   267 XTermView initialize!
   372 XTermView initialize!