VDBTerminalView.st
author Jan Vrany <jan.vrany@labware.com>
Tue, 26 Jul 2022 15:01:33 +0100
changeset 265 f2470f0dd9cd
parent 264 23960fcb9dac
permissions -rw-r--r--
Do not show address for (pseudo) instructions with no code While such instructions do not appear in GDB-produced disassembly, they may appear in some manually-generated instruction lists. One example of such (pseudo) instruction is label.

"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2020 LabWare
Copyright (C) 2022 LabWare

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"
"{ Package: 'jv:vdb' }"

"{ NameSpace: Smalltalk }"

VT100TerminalView subclass:#VDBTerminalView
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'VDB-UI-Console-Unix'
!

!VDBTerminalView class methodsFor:'documentation'!

copyright
"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany
Copyright (C) 2020 LabWare
Copyright (C) 2022 LabWare

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"
! !

!VDBTerminalView methodsFor:'initialization & release'!

closeStreams
    "Do nothing here, streams should be closed by an application,
     not the view!!"

    "Created: / 12-06-2019 / 12:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

initializeKeyboardMap
    | terminalMap |

    "/ This is a little trick. We want shortcuts for next, step, over to
    "/ work when debugger console is in focus, so we need a keyboard map
    "/ which has all those shortcuts defined and the rest behaves like in
    "/ standard terminal.
    "/ 
    "/ To do so, we use "dynamic parent" of an empty keyboard map which
    "/ is constructed such that it is application's map with standard terminal
    "/ map a parent.
    super initializeKeyboardMap.
    terminalMap := keyboardMap.
    keyboardMap := KeyboardMap new.
    keyboardMap parent: [ self topView keyboardMap copy parent: terminalMap; yourself ].

    "Created: / 23-06-2020 / 13:49:53 / Jan Vrany <jan.vrany@labware.com>"
! !

!VDBTerminalView methodsFor:'scrolling-basic'!

scrollTo:anOrigin redraw:doRedraw
    super scrollTo:anOrigin redraw:doRedraw.

    "/ Following is a nasty workaround to avoid 'cheese'
    "/ in terminal - when scrolling, sometimes top few pixels
    "/ are 'cropped'. Dunno why...
    doRedraw ifTrue:[ self invalidate ].

    "Created: / 03-01-2022 / 21:49:07 / Jan Vrany <jan.vrany@labware.com>"
    "Modified: / 04-01-2022 / 10:15:39 / Jan Vrany <jan.vrany@labware.com>"
! !

!VDBTerminalView class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !