VDBAbstractConsoleApplication.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 21 Jun 2019 22:54:50 +0100
changeset 175 a304c250e889
parent 143 df7f89efd39d
child 241 9996050286c5
permissions -rw-r--r--
UI: add "Scratch Pad" tool which can be used by user to keep notes during debug session, to edit (configuration) files and so on.

"
jv:vdb - Visual / VM Debugger
Copyright (C) 2015-now Jan Vrany

This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'

You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
"
"{ Package: 'jv:vdb' }"

"{ NameSpace: Smalltalk }"

VDBAbstractApplication subclass:#VDBAbstractConsoleApplication
	instanceVariableNames:'consoleView'
	classVariableNames:''
	poolDictionaries:''
	category:'VDB-UI-Abstract'
!

!VDBAbstractConsoleApplication class methodsFor:'documentation'!

copyright
"
jv:vdb - Visual / VM Debugger
Copyright (C) 2015-now Jan Vrany

This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'

You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
"
! !

!VDBAbstractConsoleApplication class methodsFor:'interface specs'!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:VDBAbstractConsoleApplication andSelector:#windowSpec
     VDBAbstractConsoleApplication new openInterface:#windowSpec
     VDBAbstractConsoleApplication open
    "

    <resource: #canvas>

    ^ 
    #(FullSpec
       name: windowSpec
       window: 
      (WindowSpec
         label: 'Console'
         name: 'Console'
         min: (Point 10 10)
         bounds: (Rectangle 0 0 782 332)
       )
       component: 
      (SpecCollection
         collection: (
          (ArbitraryComponentSpec
             name: 'Console'
             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
             hasHorizontalScrollBar: true
             hasVerticalScrollBar: true
             miniScrollerHorizontal: true
             autoHideScrollBars: false
             hasBorder: false
             component: consoleView
           )
          )
        
       )
     )
! !

!VDBAbstractConsoleApplication class methodsFor:'plugIn spec'!

aspectSelectors
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this. If it is corrupted,
     the UIPainter may not be able to read the specification."

    "Return a description of exported aspects;
     these can be connected to aspects of an embedding application
     (if this app is embedded in a subCanvas)."

    ^ #(
        #debuggerHolder
      ).

! !

!VDBAbstractConsoleApplication class methodsFor:'queries'!

isAbstract
    "Return if this class is an abstract class.
     True is returned here for myself only; false for subclasses.
     Abstract subclasses must redefine this again."

    ^ self == VDBAbstractConsoleApplication.
! !

!VDBAbstractConsoleApplication methodsFor:'aspects'!

consoleView
    consoleView isNil ifTrue:[ 
        consoleView := self consoleViewClass new.
        self initializeConsoleView: consoleView.
    ].
    ^ consoleView.

    "Created: / 21-01-2019 / 14:09:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

consoleViewClass
    ^ self subclassResponsibility

    "Created: / 21-01-2019 / 14:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBAbstractConsoleApplication methodsFor:'initialization & release'!

initializeConsoleView: aTerminalView
     aTerminalView font: self textFont;
                cursorType: #block;  
                foregroundColor: Color white
                backgroundColor: Color black;
                cursorForegroundColor: Color white
                      backgroundColor: Color white.        
     self initializeConsoleView: aTerminalView forDebugger: debugger.

    "Created: / 21-01-2019 / 14:11:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 21-01-2019 / 15:31:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

initializeConsoleView: aTerminalView forDebugger: aGDBDebugger
    "/ Nothing to do by default

    "Created: / 21-01-2019 / 15:30:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 25-01-2019 / 12:05:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

subscribe   
    "Register for debugger events. To be overrided by subclasses"

    super subscribe.
    consoleView notNil ifTrue:[
        self initializeConsoleView: consoleView forDebugger: debugger
    ].

    "Created: / 10-06-2014 / 21:02:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 21-01-2019 / 15:31:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

unsubscribe
    "Unsubscribe myself fo debugger events"

    super unsubscribe.
    consoleView notNil ifTrue:[ 
        self initializeConsoleView: consoleView forDebugger: nil 
    ].

    "Created: / 09-06-2014 / 10:09:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 21-01-2019 / 15:32:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBAbstractConsoleApplication class methodsFor:'documentation'!

version_HG

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