VDBInferiorConsoleApplication.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 22 Sep 2014 22:50:28 +0100
changeset 24 c33a063cb363
parent 6 981a32abdbf6
child 40 d766d4c854a2
permissions -rw-r--r--
Added icons from Eclipse.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'jv:vdb' }"
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
VDBAbstractApplication subclass:#VDBInferiorConsoleApplication
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
	instanceVariableNames:'consoleView'
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
	classVariableNames:''
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	poolDictionaries:''
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	category:'VDB-UI-Console'
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
!
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
5
fac6e83fd5c0 Implemented VDBTabbingContainer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
    10
2
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
!VDBInferiorConsoleApplication class methodsFor:'interface specs'!
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
windowSpec
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
    "This resource specification was automatically generated
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
     by the UIPainter of ST/X."
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
    "Do not manually edit this!! If it is corrupted,
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
     the UIPainter may not be able to read the specification."
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
    "
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
     UIPainter new openOnClass:VDBConsoleApplication andSelector:#windowSpec
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
     VDBConsoleApplication new openInterface:#windowSpec
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
     VDBConsoleApplication open
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
    "
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
    <resource: #canvas>
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
    ^ 
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
    #(FullSpec
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
       name: windowSpec
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
       window: 
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
      (WindowSpec
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
         label: 'Inferior Console'
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
         name: 'Inferior Console'
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
         min: (Point 10 10)
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
         bounds: (Rectangle 0 0 782 332)
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
       )
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
       component: 
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
      (SpecCollection
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
         collection: (
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
          (ArbitraryComponentSpec
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
             name: 'Console'
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
             hasBorder: false
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
             component: consoleView
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
           )
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
          )
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
        
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
       )
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
     )
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
    "Modified: / 09-06-2014 / 09:57:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
! !
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
!VDBInferiorConsoleApplication methodsFor:'aspects'!
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
consoleView
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    consoleView isNil ifTrue:[ 
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
        consoleView :=VT100TerminalView new.
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
        debugger notNil ifTrue:[ 
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
            consoleView inStream: debugger inferiorStdin.
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
            consoleView outStream: debugger inferiorStdout.
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
            consoleView startReaderProcessWhenVisible.
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
        ].
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
    ].
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
    ^ consoleView
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
    "Created: / 06-06-2014 / 21:33:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
    "Modified: / 09-06-2014 / 10:02:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
! !
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
!VDBInferiorConsoleApplication methodsFor:'initialization & release'!
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
6
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    74
subscribe   
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    75
    "Register for debugger events. To be overrided by subclasses"
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    76
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    77
    super subscribe.
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    78
    (debugger notNil and:[consoleView notNil]) ifTrue:[
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    79
        consoleView stopReaderProcess.
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    80
        consoleView inStream: debugger inferiorStdin.
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    81
        consoleView outStream: debugger inferiorStdout.
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    82
        consoleView startReaderProcessWhenVisible.
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    83
    ].
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    84
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    85
    "Created: / 10-06-2014 / 21:02:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    86
!
981a32abdbf6 Fixes for debugger/inferior console.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5
diff changeset
    87
2
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
unsubscribe
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
    "Unsubscribe myself fo debugger events"
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
    super unsubscribe.
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
    consoleView notNil ifTrue:[ 
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
        consoleView stopReaderProcess.
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
        consoleView inStream: nil.
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
        consoleView outStream: nil.
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
    ].
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
    "Created: / 09-06-2014 / 10:09:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
! !
9741a7683808 Added VDBInferiorConsoleApplication to display debugee's input/output.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
5
fac6e83fd5c0 Implemented VDBTabbingContainer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
   101
!VDBInferiorConsoleApplication class methodsFor:'documentation'!
fac6e83fd5c0 Implemented VDBTabbingContainer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
   102
fac6e83fd5c0 Implemented VDBTabbingContainer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
   103
version_HG
fac6e83fd5c0 Implemented VDBTabbingContainer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
   104
fac6e83fd5c0 Implemented VDBTabbingContainer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
   105
    ^ '$Changeset: <not expanded> $'
fac6e83fd5c0 Implemented VDBTabbingContainer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
   106
! !
fac6e83fd5c0 Implemented VDBTabbingContainer.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2
diff changeset
   107