Tools__CodeView2.st
changeset 13813 576b071baeea
parent 13625 33f926cd64ff
child 13936 93271eb5f45b
equal deleted inserted replaced
13812:d797f0c1e183 13813:576b071baeea
    30 SimpleView subclass:#CodeView2
    30 SimpleView subclass:#CodeView2
    31 	instanceVariableNames:'gutterView textView textViewScroller methodHolder languageHolder
    31 	instanceVariableNames:'gutterView textView textViewScroller methodHolder languageHolder
    32 		classHolder browserHolder codeAspect modifiedChannel
    32 		classHolder browserHolder codeAspect modifiedChannel
    33 		showGutterChannel showAcceptCancelBarChannel modeHolder
    33 		showGutterChannel showAcceptCancelBarChannel modeHolder
    34 		serviceManager services servicesFromClient syntaxElements
    34 		serviceManager services servicesFromClient syntaxElements
       
    35 		currentParseNodeHolder currentBlockNodeHolder
    35 		syntaxElementSelection highlightEmphasis diffMode
    36 		syntaxElementSelection highlightEmphasis diffMode
    36 		synchronizedCodeViews'
    37 		synchronizedCodeViews'
    37 	classVariableNames:'TraceSelectors'
    38 	classVariableNames:'TraceSelectors'
    38 	poolDictionaries:''
    39 	poolDictionaries:''
    39 	category:'Interface-CodeView'
    40 	category:'Interface-CodeView'
    40 !
    41 !
    41 
    42 
    42 SimpleView subclass:#GutterView
    43 SimpleView subclass:#GutterView
    43 	instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel
    44 	instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel
    44 		widthAnnotations widthDiffInfo numberOfLines acceptColor
    45 		widthAnnotations widthDiffInfo numberOfLines acceptColor
    45 		cancelColor diffColor menuHolder showLineNumbers'
    46 		cancelColor diffColor menuHolder currentBlockNodeHolder
       
    47 		showLineNumbers'
    46 	classVariableNames:''
    48 	classVariableNames:''
    47 	poolDictionaries:''
    49 	poolDictionaries:''
    48 	privateIn:CodeView2
    50 	privateIn:CodeView2
    49 !
    51 !
    50 
    52 
   220      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp
   222      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp
   221     "
   223     "
   222 
   224 
   223     <resource: #menu>
   225     <resource: #menu>
   224 
   226 
   225     ^ 
   227     ^
   226      #(Menu
   228      #(Menu
   227         (
   229 	(
   228          (MenuItem
   230 	 (MenuItem
   229             label: 'Implementors...'
   231 	    label: 'Implementors...'
   230             itemValue: browseImplementorsOfIt
   232 	    itemValue: browseImplementorsOfIt
   231             translateLabel: true
   233 	    submenuChannel: implementorsMenu
   232             submenuChannel: implementorsMenu
   234 	    shortcutKey: ImplementorsOfIt
   233             shortcutKey: ImplementorsOfIt
   235 	  )
   234           )
   236 	 (MenuItem
   235          (MenuItem
   237 	    label: 'Senders...'
   236             label: 'Senders...'
   238 	    itemValue: browseSendersOfIt
   237             itemValue: browseSendersOfIt
   239 	    submenuChannel: sendersMenu
   238             translateLabel: true
   240 	    shortcutKey: SendersOfIt
   239             submenuChannel: sendersMenu
   241 	  )
   240             shortcutKey: SendersOfIt
   242 	 (MenuItem
   241           )
   243 	    label: 'Refactor'
   242          (MenuItem
   244 	    nameKey: refactor
   243             label: 'Refactor'
   245 	    isVisible: false
   244             nameKey: refactor
   246 	    shortcutKey: Shift
   245             translateLabel: true
   247 	  )
   246             isVisible: false
   248 	 (MenuItem
   247             shortcutKey: Shift
   249 	    label: '-'
   248           )
   250 	  )
   249          (MenuItem
   251 	 (MenuItem
   250             label: '-'
   252 	    label: 'Accept'
   251           )
   253 	    itemValue: accept
   252          (MenuItem
   254 	    shortcutKey: Accept
   253             label: 'Accept'
   255 	  )
   254             itemValue: accept
   256 	 (MenuItem
   255             translateLabel: true
   257 	    label: '-'
   256             shortcutKey: Accept
   258 	  )
   257           )
   259 	 (MenuItem
   258          (MenuItem
   260 	    label: 'Cut'
   259             label: '-'
   261 	    itemValue: cut
   260           )
   262 	    shortcutKey: Cut
   261          (MenuItem
   263 	  )
   262             label: 'Cut'
   264 	 (MenuItem
   263             itemValue: cut
   265 	    label: 'Copy'
   264             translateLabel: true
   266 	    itemValue: copySelection
   265             shortcutKey: Cut
   267 	    shortcutKey: Copy
   266           )
   268 	  )
   267          (MenuItem
   269 	 (MenuItem
   268             label: 'Copy'
   270 	    label: 'Paste'
   269             itemValue: copySelection
   271 	    itemValue: pasteOrReplace
   270             translateLabel: true
   272 	    shortcutKey: Paste
   271             shortcutKey: Copy
   273 	  )
   272           )
   274 	 (MenuItem
   273          (MenuItem
   275 	    label: '-'
   274             label: 'Paste'
   276 	  )
   275             itemValue: pasteOrReplace
   277 	 (MenuItem
   276             translateLabel: true
   278 	    label: 'Undo'
   277             shortcutKey: Paste
   279 	    itemValue: undo
   278           )
   280 	    shortcutKey: Undo
   279          (MenuItem
   281 	  )
   280             label: '-'
   282 	 (MenuItem
   281           )
   283 	    label: 'Redo'
   282          (MenuItem
   284 	    itemValue: redo
   283             label: 'Undo'
   285 	    shortcutKey: Redo
   284             itemValue: undo
   286 	  )
   285             translateLabel: true
   287 	 (MenuItem
   286             shortcutKey: Undo
   288 	    label: '-'
   287           )
   289 	  )
   288          (MenuItem
   290 	 (MenuItem
   289             label: '-'
   291 	    label: 'Do it'
   290           )
   292 	    itemValue: doIt
   291          (MenuItem
   293 	    shortcutKey: DoIt
   292             label: 'Do it'
   294 	  )
   293             itemValue: doIt
   295 	 (MenuItem
   294             translateLabel: true
   296 	    label: 'Print it'
   295             shortcutKey: DoIt
   297 	    itemValue: printIt
   296           )
   298 	    shortcutKey: PrintIt
   297          (MenuItem
   299 	  )
   298             label: 'Print it'
   300 	 (MenuItem
   299             itemValue: printIt
   301 	    label: 'Inspect it'
   300             translateLabel: true
   302 	    itemValue: inspectIt
   301             shortcutKey: PrintIt
   303 	    shortcutKey: InspectIt
   302           )
   304 	  )
   303          (MenuItem
   305 	 (MenuItem
   304             label: 'Inspect it'
   306 	    label: 'Profile it'
   305             itemValue: inspectIt
   307 	    itemValue: profileIt
   306             translateLabel: true
   308 	    shortcutKey: InspectIt
   307             shortcutKey: InspectIt
   309 	  )
   308           )
   310 	 (MenuItem
   309          (MenuItem
   311 	    label: '-'
   310             label: 'Profile it'
   312 	  )
   311             itemValue: profileIt
   313 	 (MenuItem
   312             translateLabel: true
   314 	    label: 'Show Gutter'
   313             shortcutKey: InspectIt
   315 	    nameKey: ShowGutter
   314           )
   316 	    indication: showGutterChannel
   315          (MenuItem
   317 	  )
   316             label: '-'
   318 	 (MenuItem
   317           )
   319 	    label: 'More'
   318          (MenuItem
   320 	    nameKey: More
   319             label: 'Show Gutter'
   321 	  )
   320             nameKey: ShowGutter
   322 	 (MenuItem
   321             translateLabel: true
   323 	    label: 'Services'
   322             indication: showGutterChannel
   324 	    submenuChannel: servicesMenu
   323           )
   325 	  )
   324          (MenuItem
   326 	 (MenuItem
   325             label: 'More'
   327 	    label: 'Debug'
   326             nameKey: More
   328 	    submenuChannel: debugMenu
   327             translateLabel: true
   329 	  )
   328           )
   330 	 )
   329          (MenuItem
   331 	nil
   330             label: 'Services'
   332 	nil
   331             translateLabel: true
       
   332             submenuChannel: servicesMenu
       
   333           )
       
   334          (MenuItem
       
   335             label: 'Debug'
       
   336             translateLabel: true
       
   337             submenuChannel: debugMenu
       
   338           )
       
   339          )
       
   340         nil
       
   341         nil
       
   342       )
   333       )
   343 
       
   344     "Modified: / 08-03-2012 / 12:36:18 / cg"
       
   345 !
   334 !
   346 
   335 
   347 editMenu_stxStyle
   336 editMenu_stxStyle
   348     "This resource specification was automatically generated
   337     "This resource specification was automatically generated
   349      by the MenuEditor of ST/X."
   338      by the MenuEditor of ST/X."
   457       )
   446       )
   458 
   447 
   459     "Modified: / 02-03-2012 / 19:53:19 / cg"
   448     "Modified: / 02-03-2012 / 19:53:19 / cg"
   460 ! !
   449 ! !
   461 
   450 
       
   451 !CodeView2 methodsFor:'* As yet uncategorized *'!
       
   452 
       
   453 defaultFileNameForSave
       
   454     self halt:'please define defaultFileNameForSave here'.
       
   455 
       
   456     "Created: / 11-05-2012 / 15:38:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   457 ! !
       
   458 
   462 !CodeView2 methodsFor:'accessing'!
   459 !CodeView2 methodsFor:'accessing'!
   463 
   460 
   464 acceptAction:aBlock
   461 acceptAction:aBlock
   465 
   462 
   466     textView acceptAction: aBlock
   463     textView acceptAction: aBlock
   499 
   496 
   500     "Modified: / 27-07-2012 / 22:32:19 / cg"
   497     "Modified: / 27-07-2012 / 22:32:19 / cg"
   501     "Modified: / 27-09-2013 / 10:01:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   498     "Modified: / 27-09-2013 / 10:01:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   502 !
   499 !
   503 
   500 
       
   501 compilerClass
       
   502     ^textView compilerClass
       
   503 
       
   504     "Created: / 10-05-2012 / 23:47:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   505 !
       
   506 
       
   507 compilerClass: aClass
       
   508     textView compilerClass: aClass
       
   509 
       
   510     "Created: / 10-05-2012 / 23:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   511 !
       
   512 
   504 contents
   513 contents
   505 
   514 
   506     ^textView contents
   515     ^textView contents
   507 
   516 
   508     "Created: / 14-02-2010 / 22:13:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   517     "Created: / 14-02-2010 / 22:13:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   512 
   521 
   513     textView contents: aStringOrStringCollection.
   522     textView contents: aStringOrStringCollection.
   514     "/self update:#value with: aStringOrStringCollection from: textView model
   523     "/self update:#value with: aStringOrStringCollection from: textView model
   515 
   524 
   516     "Modified: / 19-07-2011 / 13:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   525     "Modified: / 19-07-2011 / 13:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   526 !
       
   527 
       
   528 contents: aStringOrStringCollection clear: clearPrevious
       
   529     "Set the contents. If clearPrevous is true, then
       
   530      previous original text is cleared and set to given one.
       
   531      (so the text is considered not modified)"
       
   532 
       
   533     textView contents: aStringOrStringCollection clear: clearPrevious
       
   534 
       
   535     "Modified: / 19-07-2011 / 13:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   536     "Created: / 17-02-2012 / 00:33:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   537 !
       
   538 
       
   539 currentParseNode
       
   540 
       
   541     ^self currentParseNodeHolder value
       
   542 
       
   543     "Created: / 21-02-2012 / 14:20:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   544 !
       
   545 
       
   546 delegate: anObject
       
   547 
       
   548     super delegate: anObject.
       
   549     self textView delegate: anObject.
       
   550     self gutterView delegate: anObject.
       
   551 
       
   552     "Created: / 11-05-2012 / 10:29:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   517 !
   553 !
   518 
   554 
   519 diffMode
   555 diffMode
   520     ^ diffMode
   556     ^ diffMode
   521 !
   557 !
   577 model: aValueModel
   613 model: aValueModel
   578 
   614 
   579     |oldValue newValue|
   615     |oldValue newValue|
   580 
   616 
   581     textView model notNil ifTrue:[
   617     textView model notNil ifTrue:[
   582         oldValue := textView model value.
   618 	oldValue := textView model value.
   583         textView model removeDependent:self.
   619 	textView model removeDependent:self.
   584     ].
   620     ].
   585     textView model: aValueModel.
   621     textView model: aValueModel.
   586     textView model notNil ifTrue:[
   622     textView model notNil ifTrue:[
   587         textView model addDependent:self.
   623 	textView model addDependent:self.
   588     ].
   624     ].
   589     newValue := textView model value.
   625     newValue := textView model value.
   590     oldValue ~~ newValue ifTrue:[
   626     oldValue ~~ newValue ifTrue:[
   591         self update:#value with:newValue from:textView model.
   627 	self update:#value with:newValue from:textView model.
   592     ].
   628     ].
   593 
   629 
   594     "Modified: / 27-07-2011 / 12:58:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   630     "Modified: / 17-03-2012 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   595 !
   631 !
   596 
   632 
   597 modified
   633 modified
   598     "return true if text was modified"
   634     "return true if text was modified"
   599 
   635 
   656     (synchronizedCodeViews includes: aCodeView) ifTrue:[^self].    
   692     (synchronizedCodeViews includes: aCodeView) ifTrue:[^self].    
   657     synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView.
   693     synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView.
   658 
   694 
   659     "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
   695     "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
   660     "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   696     "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   661 ! !
   697 !
   662 
   698 
   663 !CodeView2 methodsFor:'accessing-code component'!
   699 unsynchronizeWith: aCodeView
       
   700 
       
   701     self assert: aCodeView ~= self.
       
   702     (synchronizedCodeViews includes: aCodeView) ifFalse:[^self].
       
   703     synchronizedCodeViews := synchronizedCodeViews copyWithout: aCodeView.
       
   704 
       
   705     "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
       
   706     "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   707     "Created: / 19-03-2012 / 14:25:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   708 ! !
       
   709 
       
   710 !CodeView2 methodsFor:'accessing - code component'!
   664 
   711 
   665 klass
   712 klass
   666     | v |
   713     | v |
   667 
   714 
   668     (v := self classHolder value) notNil ifTrue:[^v].
   715     (v := self classHolder value) notNil ifTrue:[^v].
   669     (v := self method) notNil ifTrue:[^v mclass].
   716     (v := self method) notNil ifTrue:[^v mclass].
   670 
   717 
   671     ^UndefinedObject
   718     ^nil
   672 
   719 
   673     "Created: / 27-07-2011 / 13:14:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   720     "Created: / 27-07-2011 / 13:14:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   674     "Modified: / 22-07-2013 / 13:34:05 / cg"
   721     "Modified: / 22-07-2013 / 13:34:05 / cg"
   675 !
   722 ! !
       
   723 
       
   724 !CodeView2 methodsFor:'accessing-code component'!
   676 
   725 
   677 klass: aClass
   726 klass: aClass
   678 
   727 
   679     "Created: / 27-07-2011 / 13:13:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   728     "Created: / 27-07-2011 / 13:13:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   680 !
   729 !
   764     ].
   813     ].
   765 
   814 
   766     self changed: #classHolder with: old -> classHolder
   815     self changed: #classHolder with: old -> classHolder
   767 
   816 
   768     "Modified: / 17-06-2011 / 12:56:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   817     "Modified: / 17-06-2011 / 12:56:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   818 !
       
   819 
       
   820 currentBlockNodeHolder
       
   821     "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
       
   822 
       
   823     currentBlockNodeHolder isNil ifTrue:[
       
   824 	currentBlockNodeHolder := ValueHolder new.
       
   825     ].
       
   826     ^ currentBlockNodeHolder
       
   827 !
       
   828 
       
   829 currentBlockNodeHolder:something
       
   830     "set the 'currentBlockNodeHolder' value holder (automatically generated)"
       
   831 
       
   832     currentBlockNodeHolder := something.
       
   833 !
       
   834 
       
   835 currentParseNodeHolder
       
   836     "return/create the 'currentParseNodeHolder' value holder (automatically generated)"
       
   837 
       
   838     currentParseNodeHolder isNil ifTrue:[
       
   839 	currentParseNodeHolder := ValueHolder new.
       
   840     ].
       
   841     ^ currentParseNodeHolder
       
   842 !
       
   843 
       
   844 currentParseNodeHolder:something
       
   845     "set the 'currentParseNodeHolder' value holder (automatically generated)"
       
   846 
       
   847     currentParseNodeHolder := something.
       
   848     gutterView notNil ifTrue:[ gutterView currentBlockNodeHolder: currentBlockNodeHolder ].
       
   849 
       
   850     "Modified: / 16-02-2012 / 23:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   769 !
   851 !
   770 
   852 
   771 languageHolder
   853 languageHolder
   772     languageHolder isNil ifTrue:[
   854     languageHolder isNil ifTrue:[
   773         "/ cg: I dont like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.)
   855         "/ cg: I dont like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.)
   882 
   964 
   883 update:aspect with:param from:sender
   965 update:aspect with:param from:sender
   884 
   966 
   885 
   967 
   886     sender == methodHolder ifTrue:[
   968     sender == methodHolder ifTrue:[
   887         textView editedMethodOrClass: methodHolder value.
   969 	textView editedMethodOrClass: methodHolder value.
   888     ].
   970     ].
   889 
   971 
   890     sender == classHolder ifTrue:[
   972     sender == classHolder ifTrue:[
   891         methodHolder value isNil ifTrue:[
   973 	methodHolder value isNil ifTrue:[
   892             textView editedMethodOrClass: classHolder value.
   974 	    textView editedMethodOrClass: classHolder value.
   893         ].
   975 	].
   894     ].
   976     ].
   895 
   977 
   896     sender == languageHolder ifTrue:[
   978     sender == languageHolder ifTrue:[
   897         textView editedLanguage: languageHolder value.
   979 	textView editedLanguage: languageHolder value.
       
   980     ].
       
   981 
       
   982     sender == modeHolder ifTrue:[
       
   983 	codeAspect := modeHolder value
   898     ].
   984     ].
   899 
   985 
   900     sender == showGutterChannel ifTrue: [
   986     sender == showGutterChannel ifTrue: [
   901         self updateGutterVisibility.
   987 	self updateGutterVisibility.
   902         ^self.
   988 	^self.
   903     ].
   989     ].
   904 
   990 
   905     services do:[:each | 
   991     services do:[:each |
   906         each isEnabled ifTrue:[
   992 	each isEnabled ifTrue:[
   907             each update:aspect with:param from:sender 
   993 	    each update:aspect with:param from:sender
   908         ]
   994 	]
   909     ].
   995     ].
   910 
   996 
   911     super update:aspect with:param from:sender
   997     super update:aspect with:param from:sender
   912 
   998 
   913     "Modified: / 07-07-2011 / 12:07:04 / Jan Vrany <jan.vrant@fit.cvut,cz>"
   999     "Modified: / 07-07-2011 / 12:07:04 / Jan Vrany <jan.vrant@fit.cvut,cz>"
  1114     "/ not exact, but much faster (looks for symbol only, does not parse code for real send)
  1200     "/ not exact, but much faster (looks for symbol only, does not parse code for real send)
  1115     senderBlock := SystemBrowser searchBlockForSymbol:selector.
  1201     senderBlock := SystemBrowser searchBlockForSymbol:selector.
  1116     senderBlock == false ifTrue:[ ^ #() ].
  1202     senderBlock == false ifTrue:[ ^ #() ].
  1117 
  1203 
  1118     ^ SystemBrowser
  1204     ^ SystemBrowser
  1119         allMethodsIn:Smalltalk allClasses
  1205 	allMethodsIn:Smalltalk allClasses
  1120         where:senderBlock.
  1206 	where:senderBlock.
  1121 
  1207 
  1122     "/ exact, but much slower 
  1208     "/ exact, but much slower
  1123     "/ (parses code to see if this is really a send or only a symbol reference)
       
  1124 "/    ^SystemBrowser
  1209 "/    ^SystemBrowser
  1125 "/        findSendersOf: selector
  1210 "/        findSendersOf: selector
  1126 "/        in: Smalltalk allClasses
  1211 "/        in: Smalltalk allClasses
  1127 "/        ignoreCase: false
  1212 "/        ignoreCase: false
  1128 
  1213 
  1149     ^textView hasSelection
  1234     ^textView hasSelection
  1150 
  1235 
  1151     "Created: / 14-02-2010 / 09:53:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1236     "Created: / 14-02-2010 / 09:53:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1152 ! !
  1237 ! !
  1153 
  1238 
       
  1239 !CodeView2 methodsFor:'delegation - events'!
       
  1240 
       
  1241 buttonPress: button x:x y:y in: view
       
  1242     "Delegates events to services. Answers true iff at least
       
  1243      one service handler method returns true. In that case,
       
  1244      the event is is NOT processes by the view."
       
  1245 
       
  1246     ^ services
       
  1247 	contains:[:service |
       
  1248 	    service isEnabled and:[ ((service buttonPress: button x:x y:y in: view) == true) ]
       
  1249 	].
       
  1250 
       
  1251     "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1252     "Modified: / 06-10-2011 / 14:14:00 / cg"
       
  1253     "Modified (format): / 05-03-2012 / 08:56:02 / cg"
       
  1254 !
       
  1255 
       
  1256 scrollTo:origin redraw:doRedraw in: view
       
  1257     view == textView ifTrue: [
       
  1258 	"/my text view scrolled...
       
  1259 	synchronizedCodeViews do:[:codeView|
       
  1260 	    codeView scrollTo:origin redraw:doRedraw in: view.
       
  1261 	]
       
  1262     ] ifFalse: [
       
  1263 	"/other code view scrolls and I'm notified about that
       
  1264 	textView basicScrollTo:origin redraw:doRedraw.
       
  1265     ]
       
  1266 
       
  1267     "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
       
  1268     "Created: / 19-03-2012 / 17:05:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1269 ! !
       
  1270 
  1154 !CodeView2 methodsFor:'delegation-drawing'!
  1271 !CodeView2 methodsFor:'delegation-drawing'!
  1155 
  1272 
  1156 drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg
  1273 drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg
  1157     "See the comment in
  1274     "See the comment in
  1158      CodeViewService>>drawLine:in:atX..."
  1275      CodeViewService>>drawLine:in:atX..."
  1198             service isEnabled and:[ ((service buttonMotion: button x:x y:y in: view) == true) ]
  1315             service isEnabled and:[ ((service buttonMotion: button x:x y:y in: view) == true) ]
  1199         ].
  1316         ].
  1200 
  1317 
  1201     "Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1318     "Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1202     "Modified: / 06-10-2011 / 14:13:57 / cg"
  1319     "Modified: / 06-10-2011 / 14:13:57 / cg"
  1203 !
       
  1204 
       
  1205 buttonPress: button x:x y:y in: view
       
  1206     "Delegates events to services. Answers true iff at least
       
  1207      one service handler method returns true. 
       
  1208      In that case, the event is is NOT processes by the view."
       
  1209 
       
  1210     ^ services 
       
  1211         contains:[:service |
       
  1212             (service isEnabled 
       
  1213             and:[ ((service buttonPress: button x:x y:y in: view) == true) ])
       
  1214         ].
       
  1215 
       
  1216     "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1217     "Modified (comment): / 29-08-2013 / 16:23:08 / cg"
       
  1218 !
  1320 !
  1219 
  1321 
  1220 buttonRelease: button x:x y:y in: view
  1322 buttonRelease: button x:x y:y in: view
  1221     "Delegates events to services. Answers true iff at least
  1323     "Delegates events to services. Answers true iff at least
  1222      one service handler method returns true. In that case,
  1324      one service handler method returns true. In that case,
  1381 !
  1483 !
  1382 
  1484 
  1383 initialize
  1485 initialize
  1384     "Invoked when a new instance is created."
  1486     "Invoked when a new instance is created."
  1385     "Call super initialize"
  1487     "Call super initialize"
  1386     
  1488 
  1387     super initialize.
  1489     super initialize.
  1388      "Now set up some visual properties"
  1490      "Now set up some visual properties"
  1389     self level:-1.
  1491     self level:-1.
  1390      "Now initialize sub-views"
  1492      "Now initialize sub-views"
  1391     showGutterChannel := ValueHolder with: true.
  1493     showGutterChannel := ValueHolder with: true.
  1392     showGutterChannel addDependent: self.     
  1494     showGutterChannel addDependent: self.
  1393     "/ toDo: I don't like two options in the settings;
  1495     "/ toDo: I don't like two options in the settings;
  1394     "/ showAcceptCancelBarChannel := (ValueHolder with: (UserPreferences current showAcceptCancelBarInBrowser)).
  1496     "/ showAcceptCancelBarChannel := (ValueHolder with: (UserPreferences current showAcceptCancelBarInBrowser)).
  1395     showAcceptCancelBarChannel := ValueHolder with: (UserPreferences current codeView2ShowAcceptCancel).
  1497     showAcceptCancelBarChannel := ValueHolder with: (UserPreferences current codeView2ShowAcceptCancel).
  1396 
  1498 
  1397     "/ these views must be created first, as they refer to each other's channels in their
  1499     "/ these views must be created first, as they refer to each other's channels in their
  1401     textView := textViewScroller scrolledView.
  1503     textView := textViewScroller scrolledView.
  1402 
  1504 
  1403     self initializeGutterView.
  1505     self initializeGutterView.
  1404     self initializeTextView.
  1506     self initializeTextView.
  1405     textView setCodeView:self.
  1507     textView setCodeView:self.
  1406     modifiedChannel := ValueHolder with:false.    
  1508     modifiedChannel := ValueHolder with:false.
  1407     diffMode := false.
  1509     diffMode := false.
  1408     synchronizedCodeViews := #().
  1510     synchronizedCodeViews := #().
       
  1511     currentParseNodeHolder := ValueHolder new.
       
  1512     currentBlockNodeHolder := ValueHolder new.
  1409 
  1513 
  1410     servicesFromClient := false.
  1514     servicesFromClient := false.
  1411     services := OrderedCollection new.
  1515     services := OrderedCollection new.
  1412     self initializeServices.
  1516     self initializeServices.
  1413 
  1517 
  1414     "Modified: / 14-12-2009 / 13:59:53 / Jindra <a>"
  1518     "Modified: / 14-12-2009 / 13:59:53 / Jindra <a>"
  1415     "Modified: / 06-04-2010 / 13:56:35 / Jakub <zelenja7@fel.cvut.cz>"
  1519     "Modified: / 06-04-2010 / 13:56:35 / Jakub <zelenja7@fel.cvut.cz>"
  1416     "Modified: / 06-10-2011 / 14:15:48 / cg"
  1520     "Modified: / 06-10-2011 / 14:15:48 / cg"
  1417     "Modified: / 18-10-2011 / 19:17:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1521     "Modified: / 16-02-2012 / 23:05:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1418 !
  1522 !
  1419 
  1523 
  1420 initializeGutterView
  1524 initializeGutterView
  1421 
  1525 
  1422     gutterView setCodeView:self.
  1526     gutterView setCodeView:self.
  1431     | serviceClasses |
  1535     | serviceClasses |
  1432 
  1536 
  1433     "/ only do it, if the services have not yet been defined by the user of this view
  1537     "/ only do it, if the services have not yet been defined by the user of this view
  1434     "/ (FileBrowser does not want Smalltalk-specific services)
  1538     "/ (FileBrowser does not want Smalltalk-specific services)
  1435     servicesFromClient ifFalse:[
  1539     servicesFromClient ifFalse:[
  1436         serviceClasses := self defaultServices sort:[:a :b|name < b name].
  1540 	serviceClasses := self defaultServices sort:[:a :b|a priority = b priority ifTrue:[a name < b name] ifFalse:[a priority > b priority]].
  1437         serviceClasses do:[:cls|
  1541 	serviceClasses do:[:cls|
  1438             self registerService: cls new
  1542 	    self registerService: cls new
  1439         ].
  1543 	].
  1440     ].
  1544     ].
  1441 
  1545 
  1442     "Modified: / 27-07-2011 / 11:37:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1443     "Modified: / 22-07-2013 / 14:02:59 / cg"
  1546     "Modified: / 22-07-2013 / 14:02:59 / cg"
       
  1547     "Modified: / 24-07-2013 / 11:56:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1444 !
  1548 !
  1445 
  1549 
  1446 initializeTextView
  1550 initializeTextView
  1447     "Initialize textView. gutterView has to be already initialized!!"
  1551     "Initialize textView. gutterView has to be already initialized!!"
  1448 
  1552 
  1629     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1733     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1630     "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1734     "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1631     "Modified: / 05-03-2012 / 09:02:43 / cg"
  1735     "Modified: / 05-03-2012 / 09:02:43 / cg"
  1632 !
  1736 !
  1633 
  1737 
  1634 implementorsMenu: implementors selector: selector  
  1738 implementorsMenu: implementors selector: selector
  1635     | menu|
  1739     | menu|
  1636 
  1740 
  1637     menu := Menu new.
  1741     menu := Menu new.
  1638     implementors isEmptyOrNil ifTrue:[
  1742     implementors isEmptyOrNil ifTrue:[
  1639         menu addItem:(MenuItem label:'No implementors found') disable
  1743 	menu addItem:(MenuItem label:'No implementors found') disable
  1640     ] ifFalse:[
  1744     ] ifFalse:[
  1641         menu addItem:(MenuItem 
  1745 	menu addItem:(MenuItem
  1642                     label:(selector "storeString" , (' (all implementors) ') asText allItalic)
  1746 		    label:(selector storeString , (' (all implementors) ') asText allItalic)
  1643                     itemValue:[
  1747 		    itemValue:[
  1644                         self browseMethods:implementors
  1748 			self browseMethods:implementors
  1645                             label:'Implementors of ' , selector "storeString"
  1749 			    label:'Implementors of ' , selector storeString
  1646                     ]).
  1750 		    ]).
  1647 
  1751 
  1648         menu addSeparator.
  1752 	menu addSeparator.
  1649         "/ (implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name])
  1753 	(implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name])
  1650         (implementors asOrderedCollection sort:[:a :b | a selector < b selector])
  1754 	"implementors" do:[:mth |
  1651         "implementors" do:[:mth | 
  1755 	    menu
  1652             menu 
  1756 		addItem:(MenuItem label:(selector storeString
  1653                 addItem:(MenuItem label:(selector "storeString" allBold
  1757 				, (' in ' , mth containingClass nameInBrowser asText allBold))
  1654                                 , (' in ' , mth containingClass name "asText allBold"))
  1758 			itemValue:[ self browseMethod:mth label: 'Implementor of ' , selector storeString  ])
  1655                         value:[ self browseMethod:mth label: 'Implementor of ' , selector "storeString"  ])
  1759 	]
  1656         ]
       
  1657     ].
  1760     ].
  1658     ^ menu
  1761     ^ menu
  1659 
  1762 
  1660     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1763     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1661     "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1764     "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1662     "Modified: / 28-08-2013 / 22:03:06 / cg"
  1765     "Modified: / 07-03-2012 / 12:56:56 / cg"
       
  1766     "Modified: / 14-10-2013 / 10:47:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1663 !
  1767 !
  1664 
  1768 
  1665 sendersMenu
  1769 sendersMenu
  1666 
  1770 
  1667     | selectorAndSelectedText selector selectedText  senders |
  1771     | selectorAndSelectedText selector selectedText  senders |
  1695     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1799     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1696     "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1800     "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1697     "Modified: / 05-03-2012 / 09:02:56 / cg"
  1801     "Modified: / 05-03-2012 / 09:02:56 / cg"
  1698 !
  1802 !
  1699 
  1803 
  1700 sendersMenu: senders  selector: selector  
  1804 sendersMenu: senders  selector: selector
  1701     | menu shownSenderItems numCut sendersSorted|
  1805     | menu shownSenderItems numCut sendersSorted|
  1702 
  1806 
  1703     menu := Menu new.
  1807     menu := Menu new.
  1704     senders isEmptyOrNil ifTrue:[
  1808     senders isEmptyOrNil ifTrue:[
  1705         menu addItem:(MenuItem label:'No senders found') disable
  1809 	menu addItem:(MenuItem label:'No senders found') disable
  1706     ] ifFalse:[
  1810     ] ifFalse:[
  1707         menu addItem:(MenuItem 
  1811 	menu addItem:(MenuItem
  1708                     label:(selector "storeString" , (' (all senders)') asText allItalic)
  1812 		    label:(selector storeString , (' (all senders)') asText allItalic)
  1709                     itemValue:[
  1813 		    itemValue:[
  1710                         self browseMethods:senders
  1814 			self browseMethods:senders
  1711                             label:'Senders of ' , selector "storeString"
  1815 			    label:'Senders of ' , selector storeString
  1712                     ]).
  1816 		    ]).
  1713         menu addSeparator.
  1817 	menu addSeparator.
  1714         "/ sendersSorted := senders asOrderedCollection 
  1818 	sendersSorted := senders asOrderedCollection
  1715         "/                    sort:[:a :b | a whoString < b whoString].
  1819 			    sort:[:a :b | a whoString < b whoString].
  1716         sendersSorted := senders asOrderedCollection 
  1820 	shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted].
  1717                             sort:[:a :b | a selector < b selector].
  1821 	numCut := senders size - 20.
  1718         shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted].
  1822 	shownSenderItems do:[:mth |
  1719         numCut := senders size - 20.
  1823 	    menu
  1720         shownSenderItems do:[:mth | 
  1824 		addItem:(MenuItem label:(mth selector storeString
  1721             menu 
  1825 				, (' in ' , mth containingClass nameInBrowser asText allBold))
  1722                 addItem:(MenuItem label:(mth selector "storeString" allBold
  1826 			itemValue:[ self browseMethod:mth label: 'Sender of ' , selector storeString ])
  1723                                 , (' in ' , mth containingClass name "asText allBold"))
  1827 	].
  1724                         value:[ self browseMethod:mth label: 'Sender of ' , selector "storeString" ])
  1828 	numCut > 0 ifTrue:[
  1725         ].
  1829 	    menu addSeparator.
  1726         numCut > 0 ifTrue:[
  1830 	    menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable
  1727             menu addSeparator.
  1831 	].
  1728             menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable
       
  1729         ].
       
  1730     ].
  1832     ].
  1731     ^ menu
  1833     ^ menu
  1732 
  1834 
  1733     "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1835     "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1734     "Created: / 14-02-2010 / 19:40:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1836     "Created: / 14-02-2010 / 19:40:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1735     "Modified: / 07-07-2011 / 14:51:54 / jv"
  1837     "Modified: / 07-07-2011 / 14:51:54 / jv"
  1736     "Modified: / 28-08-2013 / 22:03:57 / cg"
  1838     "Modified: / 07-03-2012 / 12:58:31 / cg"
       
  1839     "Modified: / 14-10-2013 / 10:47:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1737 !
  1840 !
  1738 
  1841 
  1739 servicesMenu
  1842 servicesMenu
  1740     |menu item anyService|
  1843     |menu item anyService|
  1741 
  1844 
  1865 
  1968 
  1866 syntaxElementSelection
  1969 syntaxElementSelection
  1867     ^ syntaxElementSelection
  1970     ^ syntaxElementSelection
  1868 !
  1971 !
  1869 
  1972 
  1870 syntaxElementSelection:something
  1973 syntaxElementSelection:anElement
  1871     syntaxElementSelection := something.
  1974     syntaxElementSelection := anElement.
       
  1975 "/    anElement isNil ifTrue:[
       
  1976 "/        currentParseNodeHolder value: nil.
       
  1977 "/"/        currentBlockNodeHolder value: nil.
       
  1978 "/    ] ifFalse:[
       
  1979 "/        currentParseNodeHolder value: anElement node.
       
  1980 "/"/        currentBlockNodeHolder value: anElement node enclosingBlock.
       
  1981 "/    ]
       
  1982 
       
  1983     "Modified: / 24-09-2013 / 00:14:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1872 !
  1984 !
  1873 
  1985 
  1874 syntaxElements
  1986 syntaxElements
  1875     ^ syntaxElements
  1987     ^ syntaxElements
  1876 !
  1988 !
  2014     ^(self height * 0.6) ceiling.
  2126     ^(self height * 0.6) ceiling.
  2015 
  2127 
  2016     "Created: / 07-10-2011 / 19:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2128     "Created: / 07-10-2011 / 19:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2017 !
  2129 !
  2018 
  2130 
       
  2131 acceptCancelRight
       
  2132     ^((self paddingLeft) + (widthAcceptCancel ? 0))
       
  2133 
       
  2134     "Created: / 10-09-2013 / 03:00:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2135 !
       
  2136 
  2019 cancelButtonBottom  
  2137 cancelButtonBottom  
  2020 
  2138 
  2021     ^(self height * 0.8) ceiling.
  2139     ^(self height * 0.8) ceiling.
  2022 
  2140 
  2023     "Created: / 07-10-2011 / 19:54:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2141     "Created: / 07-10-2011 / 19:54:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2043     "Modified: / 16-06-2011 / 13:47:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2161     "Modified: / 16-06-2011 / 13:47:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2044 !
  2162 !
  2045 
  2163 
  2046 paddingRight
  2164 paddingRight
  2047 
  2165 
  2048     ^0"px"
  2166     ^3"px"
  2049 
  2167 
  2050     "Created: / 14-02-2010 / 22:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2168     "Created: / 14-02-2010 / 22:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2051     "Modified: / 16-06-2011 / 13:47:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2169     "Modified: / 16-02-2012 / 22:40:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2052 !
  2170 !
  2053 
  2171 
  2054 preferredExtent
  2172 preferredExtent
  2055     | font w h |
  2173     | font w h |
  2056 
  2174 
  2100 
  2218 
  2101 middleButtonMenu    
  2219 middleButtonMenu    
  2102     menuHolder notNil ifTrue:[^ menuHolder value].
  2220     menuHolder notNil ifTrue:[^ menuHolder value].
  2103     codeView isNil ifTrue:[^ nil].
  2221     codeView isNil ifTrue:[^ nil].
  2104     ^ codeView servicesMenu
  2222     ^ codeView servicesMenu
       
  2223 ! !
       
  2224 
       
  2225 !CodeView2::GutterView methodsFor:'aspects'!
       
  2226 
       
  2227 currentBlockNodeHolder
       
  2228     "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
       
  2229 
       
  2230     currentBlockNodeHolder isNil ifTrue:[
       
  2231 	currentBlockNodeHolder := ValueHolder new.
       
  2232 	currentBlockNodeHolder addDependent:self.
       
  2233     ].
       
  2234     ^ currentBlockNodeHolder
       
  2235 !
       
  2236 
       
  2237 currentBlockNodeHolder:something
       
  2238     "set the 'currentBlockNodeHolder' value holder (automatically generated)"
       
  2239 
       
  2240     |oldValue newValue|
       
  2241 
       
  2242     currentBlockNodeHolder notNil ifTrue:[
       
  2243 	oldValue := currentBlockNodeHolder value.
       
  2244 	currentBlockNodeHolder removeDependent:self.
       
  2245     ].
       
  2246     currentBlockNodeHolder := something.
       
  2247     currentBlockNodeHolder notNil ifTrue:[
       
  2248 	currentBlockNodeHolder addDependent:self.
       
  2249     ].
       
  2250     newValue := currentBlockNodeHolder value.
       
  2251     oldValue ~~ newValue ifTrue:[
       
  2252 	self update:#value with:newValue from:currentBlockNodeHolder.
       
  2253     ].
  2105 ! !
  2254 ! !
  2106 
  2255 
  2107 !CodeView2::GutterView methodsFor:'change & update'!
  2256 !CodeView2::GutterView methodsFor:'change & update'!
  2108 
  2257 
  2109 adjustSizeForLongestLine
  2258 adjustSizeForLongestLine
  2140 
  2289 
  2141 update:something with:aParameter from:changedObject
  2290 update:something with:aParameter from:changedObject
  2142 "/    self shown ifFalse:[^self].
  2291 "/    self shown ifFalse:[^self].
  2143 
  2292 
  2144     (changedObject == textView) ifTrue:[
  2293     (changedObject == textView) ifTrue:[
  2145         ((something == #sizeOfContents)
  2294 	((something == #sizeOfContents)
  2146         or:[ false "(something == #sizeOfView)" ]) ifTrue:[
  2295 	or:[ false "(something == #sizeOfView)" ]) ifTrue:[
  2147             self adjustSizeForLongestLine.
  2296 	    self adjustSizeForLongestLine.
  2148 
  2297 
  2149 "/            (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[
  2298 "/            (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[
  2150 "/                self invalidate.
  2299 "/                self invalidate.
  2151 "/            ].
  2300 "/            ].
  2152             ^ self.
  2301 	    ^ self.
  2153         ].
  2302 	].
  2154         something == #originOfContents ifTrue:[     
  2303 	something == #originOfContents ifTrue:[
  2155             self invalidate.
  2304 	    self invalidateLines.
  2156             ^ self.
  2305 	    ^ self.
  2157         ].
  2306 	].
  2158         "/ something printCR.
  2307 	"/ something printCR.
  2159     ].
  2308     ].
  2160 
  2309 
  2161     (changedObject == textView reallyModifiedChannel) ifTrue:[
  2310     (changedObject == textView reallyModifiedChannel) ifTrue:[
  2162         "/ cg: I think this is rubbish: if any service needs that, it should make itself
  2311 	self invalidateAcceptCancelBar.
  2163         "/ dependent of it itself (leads to many redraws for non-existing accept-cancel bar,
  2312 	^self.
  2164         "/ if no such service is active)
       
  2165         "/ self invalidate.
       
  2166         ^ self.
       
  2167     ].
  2313     ].
  2168 
  2314 
  2169     super update:something with:aParameter from:changedObject
  2315     super update:something with:aParameter from:changedObject
  2170 
  2316 
  2171     "Modified (format): / 15-07-2011 / 20:14:04 / cg"
  2317     "Modified (format): / 15-07-2011 / 20:14:04 / cg"
  2172     "Modified: / 07-10-2011 / 19:25:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2318     "Modified: / 10-09-2013 / 03:15:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2173 ! !
  2319 ! !
  2174 
  2320 
  2175 !CodeView2::GutterView methodsFor:'event handling'!
  2321 !CodeView2::GutterView methodsFor:'event handling'!
  2176 
  2322 
  2177 buttonPress: btn x: x y: y
  2323 buttonPress: btn x: x y: y
  2207     ].
  2353     ].
  2208     super buttonPress: btn x: x y: y
  2354     super buttonPress: btn x: x y: y
  2209 
  2355 
  2210     "Created: / 17-06-2011 / 13:02:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2356     "Created: / 17-06-2011 / 13:02:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2211     "Modified (comment): / 18-05-2012 / 10:56:54 / cg"
  2357     "Modified (comment): / 18-05-2012 / 10:56:54 / cg"
       
  2358 !
       
  2359 
       
  2360 sizeChanged:how
       
  2361     super sizeChanged:how.
       
  2362     self invalidateAcceptCancelBar.
       
  2363 
       
  2364     "Created: / 10-09-2013 / 03:19:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2212 ! !
  2365 ! !
  2213 
  2366 
  2214 !CodeView2::GutterView methodsFor:'help'!
  2367 !CodeView2::GutterView methodsFor:'help'!
  2215 
  2368 
  2216 flyByHelpText
  2369 flyByHelpText
  2231     super initialize.
  2384     super initialize.
  2232 
  2385 
  2233     showLineNumbers := true.
  2386     showLineNumbers := true.
  2234 
  2387 
  2235     widthAcceptCancel := 16.
  2388     widthAcceptCancel := 16.
  2236     widthAnnotations := 8.
  2389     widthAnnotations := "16"8.
  2237     widthDiffInfo := 5.
  2390     widthDiffInfo := 5.
  2238 
  2391 
  2239     acceptColor := Color green lighter onDevice:device.
  2392     acceptColor := Color green lighter onDevice:device.
  2240     cancelColor := Color red lighter lighter onDevice:device.
  2393     cancelColor := Color red lighter lighter onDevice:device.
  2241     diffColor := Color yellow lighter lighter onDevice:device.
  2394     diffColor := Color yellow lighter lighter onDevice:device.
  2244 !
  2397 !
  2245 
  2398 
  2246 setCodeView: aCodeView2
  2399 setCodeView: aCodeView2
  2247 
  2400 
  2248     codeView := aCodeView2.
  2401     codeView := aCodeView2.
  2249     textView := aCodeView2 textView.
       
  2250 
  2402 
  2251     codeView addDependent: self.
  2403     codeView addDependent: self.
  2252     codeView reallyModifiedChannel addDependent: self.
  2404     codeView reallyModifiedChannel addDependent: self.
       
  2405     codeView currentBlockNodeHolder addDependent: self.
       
  2406 
       
  2407     textView := aCodeView2 textView.
  2253     textView addDependent: self.
  2408     textView addDependent: self.
       
  2409     self currentBlockNodeHolder: codeView currentBlockNodeHolder.
  2254     textViewScroller := aCodeView2 textViewScroller.
  2410     textViewScroller := aCodeView2 textViewScroller.
  2255     "/ self backgroundPaint: (textView viewBackground "backgroundPaint" blendWith: (Color gray:80)).
  2411     "/ self backgroundPaint: (textView viewBackground "backgroundPaint" blendWith: (Color gray:80)).
  2256     self viewBackground: (View defaultBackgroundColor).
  2412     self viewBackground: (View defaultBackgroundColor).
  2257 
  2413 
  2258     "Created: / 14-02-2010 / 15:19:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2414     "Created: / 14-02-2010 / 15:19:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2259     "Modified: / 17-08-2011 / 15:15:55 / cg"
  2415     "Modified: / 17-08-2011 / 15:15:55 / cg"
  2260     "Modified: / 08-10-2011 / 11:58:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2416     "Modified: / 05-04-2012 / 17:46:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2261 ! !
  2417 ! !
  2262 
  2418 
  2263 !CodeView2::GutterView methodsFor:'queries'!
  2419 !CodeView2::GutterView methodsFor:'queries'!
  2264 
  2420 
  2265 displayedString: line
  2421 displayedString: line
  2303      the textView (because gutter may become higher than textView, iff
  2459      the textView (because gutter may become higher than textView, iff
  2304      the textView has a horizontal scrollbar"
  2460      the textView has a horizontal scrollbar"
  2305 
  2461 
  2306     |visibleLineNr "{ Class: SmallInteger }"|
  2462     |visibleLineNr "{ Class: SmallInteger }"|
  2307 
  2463 
       
  2464     "/JV: BAD, BAD BAD - check senders, they are not prepared
       
  2465     "/    to get nil!!
  2308     shown ifFalse:[^ nil].
  2466     shown ifFalse:[^ nil].
  2309     lineNr isNil ifTrue:[^ nil].
  2467     lineNr isNil ifTrue:[^ nil].
  2310     visibleLineNr := lineNr - textView firstLineShown + 1.
  2468     visibleLineNr := lineNr - textView firstLineShown + 1.
  2311     ^ textView yOfVisibleLine:visibleLineNr
  2469     ^ textView yOfVisibleLine:visibleLineNr
       
  2470 
       
  2471     "Modified (format): / 28-08-2013 / 12:49:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2312 ! !
  2472 ! !
  2313 
  2473 
  2314 !CodeView2::GutterView methodsFor:'redrawing'!
  2474 !CodeView2::GutterView methodsFor:'redrawing'!
       
  2475 
       
  2476 invalidateAcceptCancelBar
       
  2477     | w |
       
  2478 
       
  2479     (widthAcceptCancel ? 0) == 0 ifTrue:[ ^ self ].
       
  2480     w := ((self paddingLeft) + (widthAcceptCancel ? 0)) + 1.
       
  2481     self
       
  2482 	invalidateX: 0
       
  2483 		  y: 0
       
  2484 	      width: w
       
  2485 	     height: self height.
       
  2486 
       
  2487     "Created: / 10-09-2013 / 03:07:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2488 !
  2315 
  2489 
  2316 invalidateDeviceRectangle:aRectangle repairNow:doRepairNow
  2490 invalidateDeviceRectangle:aRectangle repairNow:doRepairNow
  2317     ^ super invalidateDeviceRectangle:aRectangle repairNow:doRepairNow
  2491     ^ super invalidateDeviceRectangle:aRectangle repairNow:doRepairNow
  2318 !
  2492 !
  2319 
  2493 
       
  2494 invalidateLines
       
  2495 
       
  2496     | x0 |
       
  2497     x0 := ((self paddingLeft) + (widthAcceptCancel ? 0)) + 1.
       
  2498     self
       
  2499 	invalidateX: x0
       
  2500 		  y: 0
       
  2501 	      width: self width - x0
       
  2502 	     height: self height.
       
  2503 
       
  2504     "Created: / 10-09-2013 / 03:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2505 !
       
  2506 
  2320 redrawAcceptCancelBarX: x y: y width:w height:h
  2507 redrawAcceptCancelBarX: x y: y width:w height:h
  2321 
  2508 
  2322     | rw acceptBottom cancelBottom |
  2509     | rw acceptBottom cancelBottom |
  2323 
  2510 
  2324     x > ((self paddingLeft) + (widthAcceptCancel ? 0)) ifTrue:[
  2511     x > ((self paddingLeft) + (widthAcceptCancel ? 0)) ifTrue:[
  2325         ^self.
  2512 	^self.
  2326     ].
  2513     ].
  2327     rw := ((x + w) min: (self paddingLeft + (widthAcceptCancel ? 0))) - x.
  2514     rw := ((x + w) min: (self paddingLeft + (widthAcceptCancel ? 0))) - x.
  2328     
  2515 
  2329 
  2516 
  2330     textView reallyModified ifFalse:[
  2517     textView reallyModified ifFalse:[
  2331         self fillRectangleX:x y:y width:rw height:h color: self viewBackground
  2518 	self fillRectangleX:x y:y width:rw height:h color: self viewBackground
  2332     ] ifTrue:[
  2519     ] ifTrue:[
  2333         acceptBottom := self acceptButtonBottom.
  2520 	acceptBottom := self acceptButtonBottom.
  2334         cancelBottom := self cancelButtonBottom.
  2521 	cancelBottom := self cancelButtonBottom.
  2335         y < acceptBottom ifTrue:[
  2522 	y < acceptBottom ifTrue:[
  2336             self fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor.
  2523 	    self fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor.
  2337         ].
  2524 	].
  2338         (y < cancelBottom) ifTrue:[
  2525 	(y < cancelBottom) ifTrue:[
  2339             self fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor.
  2526 	    self fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor.
  2340         ].  
  2527 	].
  2341         (y + h >= cancelBottom) ifTrue:[
  2528 	(y + h >= cancelBottom) ifTrue:[
  2342             self fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor.
  2529 	    self fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor.
  2343         ]
  2530 	]
  2344     
  2531 
  2345     ]
  2532     ]
  2346 
  2533 
  2347     "Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2534     "Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2535     "Modified: / 10-09-2013 / 03:03:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2348 !
  2536 !
  2349 
  2537 
  2350 redrawBackgroundX:x y:y width:w height:h
  2538 redrawBackgroundX:x y:y width:w height:h
  2351     "redraws gutter background"
  2539     "redraws gutter background"
  2352 
  2540 
  2389     
  2577     
  2390     ^ self redrawLine:line cleared:cleared drawServices:true
  2578     ^ self redrawLine:line cleared:cleared drawServices:true
  2391 !
  2579 !
  2392 
  2580 
  2393 redrawLine:line cleared:cleared drawServices:drawServices
  2581 redrawLine:line cleared:cleared drawServices:drawServices
  2394     "redraws specified line. Returns width of drawn object. 
  2582     "redraws specified line. Returns width of drawn object.
  2395      Color of drawn objects should be taken from lineFont, lineColor"
  2583      Color of drawn objects should be taken from lineFont, lineColor"
  2396     
  2584 
  2397     |lineString yTop yBaseline fontAscent fontDescent
  2585     |lineString yTop yBaseline fontAscent fontDescent
  2398      textW requiredW oldFont newFont oldColor newColor|
  2586      textW requiredW oldFont newFont oldColor newColor|
  2399 
  2587 
       
  2588     shown ifFalse:[ ^ self ]. "/ Do not bother if the view is not shown.
  2400     textView isNil ifTrue:[^ self].     "/ happens when shown in UIPainter
  2589     textView isNil ifTrue:[^ self].     "/ happens when shown in UIPainter
  2401 
  2590 
  2402     requiredW := self width.
  2591     requiredW := self width.
  2403 
  2592 
  2404     showLineNumbers ifTrue:[
  2593     showLineNumbers ifTrue:[
  2405         lineString := self displayedString:line.
  2594 	lineString := self displayedString:line.
  2406 
  2595 
  2407         textW := (lineString widthOn:self).
  2596 	textW := (lineString widthOn:self).
  2408         requiredW := textW + self padding.
  2597 	requiredW := textW + self padding.
  2409 
  2598 
  2410         oldFont := self font.
  2599 	oldFont := self font.
  2411         oldColor := self paint.
  2600 	oldColor := self paint.
  2412 
  2601 
  2413         newFont := self lineFontForLine:line.
  2602 	newFont := self lineFontForLine:line.
  2414         newFont isNil ifTrue:[ 
  2603 	newFont isNil ifTrue:[
  2415             newFont := oldFont.
  2604 	    newFont := oldFont.
  2416             newColor := self lineColorForLine:line.
  2605 	    newColor := self lineColorForLine:line.
  2417             newColor ifNotNil:[ self paint:newColor ].
  2606 	    newColor ifNotNil:[ self paint:newColor ].
  2418         ].
  2607 	].
  2419         newFont ~~ oldFont ifTrue:[
  2608 	newFont ~~ oldFont ifTrue:[
  2420             "/ ensure that the line number lines are not higher than the text lines
  2609 	    "/ ensure that the line number lines are not higher than the text lines
  2421             (newFont heightOn:device) > (textView font heightOn:device) ifTrue:[
  2610 	    (newFont heightOn:device) > (textView font heightOn:device) ifTrue:[
  2422                 newFont := textView font.
  2611 		newFont := textView font.
  2423             ].
  2612 	    ].
  2424             newFont ~~ oldFont ifTrue:[
  2613 	    newFont ~~ oldFont ifTrue:[
  2425                 self font:newFont
  2614 		self font:newFont
  2426             ].
  2615 	    ].
  2427         ].
  2616 	].
  2428     ].
  2617     ].
  2429 
  2618 
  2430     fontAscent := textView font ascentOn:device.
  2619     fontAscent := textView font ascentOn:device.
  2431     fontDescent := textView font descentOn:device.
  2620     fontDescent := textView font descentOn:device.
  2432 
  2621 
  2433     yTop := (self yOfTextViewLine:line) ? 0.
  2622     yTop := (self yOfTextViewLine:line) ? 0.
  2434     yBaseline := yTop + fontAscent.
  2623     yBaseline := yTop + fontAscent.
  2435 
  2624 
  2436     cleared ifFalse:[
  2625     cleared ifFalse:[
  2437         self clearRectangleX:0 y:yBaseline - font ascent 
  2626 	self clearRectangleX:0 y:yBaseline - font ascent
  2438             width: width - 2 
  2627 	    width: width - 2
  2439             height: font ascent + font descent.
  2628 	    height: font ascent + font descent.
  2440     ].
  2629     ].
  2441 
  2630 
  2442     "/ cg: this should be done differently: services know about the
  2631     "/ cg: this should be done differently: services know about the
  2443     "/ gutter, so they should respond to a special drawGutter message.
  2632     "/ gutter, so they should respond to a special drawGutter message.
  2444     "/ otherwise, some redraws become unusably slow (especially
  2633     "/ otherwise, some redraws become unusably slow (especially
  2445     "/ with multiple fonts/colors/emphases)...
  2634     "/ with multiple fonts/colors/emphases)...
  2446     drawServices ifTrue:[
  2635     drawServices ifTrue:[
  2447         "Let services draw annotations and other stuff"
  2636 	"Let services draw annotations and other stuff"
  2448         codeView notNil ifTrue:[
  2637 	codeView notNil ifTrue:[
  2449             codeView
  2638 	    codeView
  2450                 drawLine:line in: self 
  2639 		drawLine:line in: self
  2451                 atX: (self paddingLeft + self usedWidthForAcceptCancel) y:yBaseline width: widthAnnotations height: font height
  2640 		atX: (self paddingLeft + self usedWidthForAcceptCancel) y:yBaseline width: widthAnnotations height: font height
  2452                 from:nil to:nil with:self paint and: self backgroundColor.
  2641 		from:nil to:nil with:self paint and: self backgroundColor.
  2453         ]
  2642 	]
  2454     ].
  2643     ].
  2455 
  2644 
  2456     showLineNumbers ifTrue:[
  2645     showLineNumbers ifTrue:[
  2457         self 
  2646 	self
  2458             displayString:lineString
  2647 	    displayString:lineString
  2459             x:(width - textW - 2 - self paddingRight - widthDiffInfo)
  2648 	    x:(width - textW - 2 - self paddingRight - widthDiffInfo)
  2460             y:yBaseline.
  2649 	    y:yBaseline.
  2461 
  2650 
  2462         newFont 
  2651 	newFont
  2463             ifNotNil:[
  2652 	    ifNotNil:[
  2464                 self font:oldFont.
  2653 		self font:oldFont.
  2465                 self paint:oldColor
  2654 		self paint:oldColor
  2466             ]
  2655 	    ]
  2467             ifNil:[ 
  2656 	    ifNil:[
  2468                 newColor ifNotNil:[ self paint:oldColor ]. 
  2657 		newColor ifNotNil:[ self paint:oldColor ].
  2469             ].
  2658 	    ].
  2470     ].
  2659     ].
  2471 
  2660 
       
  2661     "/ If the view has been cleared here, we have also to redraw corresponding portion
       
  2662     "/ of accept/cancel bar !!
       
  2663     cleared ifFalse:[
       
  2664 	"/ In that case it was cleared above.
       
  2665 	self redrawAcceptCancelBarX:0 y:yBaseline - font ascent
       
  2666 	    width: width - 2
       
  2667 	   height: font ascent + font descent.
       
  2668     ].
  2472     ^ requiredW.
  2669     ^ requiredW.
  2473 
  2670 
  2474     "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>"
  2671     "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>"
  2475     "Created: / 17-06-2011 / 14:11:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2672     "Created: / 17-06-2011 / 14:11:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2476     "Modified: / 18-07-2012 / 19:05:24 / cg"
  2673     "Modified: / 18-07-2012 / 19:05:24 / cg"
       
  2674     "Modified: / 28-08-2013 / 15:17:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2477 !
  2675 !
  2478 
  2676 
  2479 redrawLinesFrom:start
  2677 redrawLinesFrom:start
  2480     "/ cg: obsolete?
  2678     "/ cg: obsolete?
  2481     start to: (textView lastLineShown - 1 min: textView list size) do:[:line|
  2679     start to: (textView lastLineShown - 1 min: textView list size) do:[:line|
  2549     reallyModifiedChannel value: false.
  2747     reallyModifiedChannel value: false.
  2550 
  2748 
  2551     "Created: / 07-10-2011 / 20:32:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2749     "Created: / 07-10-2011 / 20:32:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2552 !
  2750 !
  2553 
  2751 
       
  2752 contents: text clear: clearPrevious
       
  2753 
       
  2754     | savedListOriginal |
       
  2755     savedListOriginal := listOriginal.
       
  2756     super contents: text.
       
  2757     listOriginal := savedListOriginal.
       
  2758     self updateReallyModified.
       
  2759 
       
  2760     "Created: / 17-02-2012 / 00:35:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2761 !
       
  2762 
  2554 deletedLines
  2763 deletedLines
  2555     ^  deletedLines
  2764     ^  deletedLines
  2556 
  2765 
  2557     "Modified: / 26-04-2010 / 21:48:23 / Jakub <zelenja7@fel.cvut.cz>"
  2766     "Modified: / 26-04-2010 / 21:48:23 / Jakub <zelenja7@fel.cvut.cz>"
  2558 !
  2767 !
  2576     ^ emptyLines
  2785     ^ emptyLines
  2577 !
  2786 !
  2578 
  2787 
  2579 emptyLines:something
  2788 emptyLines:something
  2580     emptyLines := something.
  2789     emptyLines := something.
       
  2790 !
       
  2791 
       
  2792 fontAscent
       
  2793     ^fontAscent notNil ifTrue:[fontAscent] ifFalse:[super fontAscent]
       
  2794 
       
  2795     "Created: / 19-05-2012 / 14:13:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2581 !
  2796 !
  2582 
  2797 
  2583 insertedLines
  2798 insertedLines
  2584     ^  insertedLines
  2799     ^  insertedLines
  2585 
  2800 
  2644 
  2859 
  2645     super list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings.
  2860     super list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings.
  2646 
  2861 
  2647     listOriginal := aCollection copy.
  2862     listOriginal := aCollection copy.
  2648     reallyModifiedChannel value: false.
  2863     reallyModifiedChannel value: false.
  2649     self notifyLinesModifiedFrom: 1 to: list size.
  2864 
       
  2865     "/JV: used to be notifyLines... but that method
       
  2866     "/    leaves suppressNotifications to true, which is not what
       
  2867     "/    we want!!
       
  2868     self updateReallyModified.
       
  2869     codeView linesModifiedFrom: 1 to: list size.
  2650 
  2870 
  2651     "Created: / 08-10-2011 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2871     "Created: / 08-10-2011 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2872     "Modified (comment): / 03-08-2013 / 13:35:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2652 !
  2873 !
  2653 
  2874 
  2654 setList:aCollection expandTabs:expandTabs redraw:doRedraw
  2875 setList:aCollection expandTabs:expandTabs redraw:doRedraw
  2655 
  2876 
  2656     super setList:aCollection expandTabs:expandTabs redraw:doRedraw.
  2877     super setList:aCollection expandTabs:expandTabs redraw:doRedraw.
  2657     listOriginal := aCollection copy.
  2878     listOriginal := aCollection copy.
  2658     reallyModifiedChannel value: false.
  2879     reallyModifiedChannel value: false.
  2659     self notifyLinesModifiedFrom: 1 to: list size.
  2880 
       
  2881     "/JV: used to be notifyLines... but that method
       
  2882     "/    leaves suppressNotifications to true, which is not what
       
  2883     "/    we want!!
       
  2884     self updateReallyModified.
       
  2885     codeView linesModifiedFrom: 1 to: list size.
  2660 
  2886 
  2661     "Created: / 07-10-2011 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2887     "Created: / 07-10-2011 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2888     "Modified (comment): / 03-08-2013 / 13:35:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2889 ! !
       
  2890 
       
  2891 !CodeView2::TextView methodsFor:'accessing-look'!
       
  2892 
       
  2893 lineSpacing
       
  2894 
       
  2895     ^lineSpacing
       
  2896 
       
  2897     "Modified: / 22-05-1996 / 12:22:29 / cg"
       
  2898     "Created: / 19-03-2012 / 13:22:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2662 ! !
  2899 ! !
  2663 
  2900 
  2664 !CodeView2::TextView methodsFor:'accessing-state'!
  2901 !CodeView2::TextView methodsFor:'accessing-state'!
  2665 
  2902 
  2666 beUnmodified
  2903 beUnmodified
  2682 isReallyModified
  2919 isReallyModified
  2683 
  2920 
  2684     ^self reallyModified
  2921     ^self reallyModified
  2685 
  2922 
  2686     "Created: / 08-10-2011 / 12:52:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2923     "Created: / 08-10-2011 / 12:52:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  2924 ! !
       
  2925 
       
  2926 !CodeView2::TextView methodsFor:'bit blitting'!
       
  2927 
       
  2928 copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
       
  2929     "/ a vertical scroll operation ?
       
  2930     aDrawable == self ifTrue:[
       
  2931 	((srcY ~= dstY) and:[srcX = dstX]) ifTrue:[
       
  2932 	    "/ Do copy in gutter, but not accept-cancel bar!!
       
  2933 	    | x0 |
       
  2934 
       
  2935 	    x0 := gutterView acceptCancelRight.
       
  2936 	    gutterView
       
  2937 		copyFrom:gutterView
       
  2938 		       x:x0
       
  2939 		       y:srcY
       
  2940 		     toX:x0
       
  2941 		       y:dstY
       
  2942 		   width:(gutterView width - x0)
       
  2943 		  height:h
       
  2944 		   async:false
       
  2945 	]
       
  2946     ].
       
  2947     ^ super
       
  2948 	copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
       
  2949 
       
  2950     "Modified (comment): / 10-09-2013 / 03:13:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2687 ! !
  2951 ! !
  2688 
  2952 
  2689 !CodeView2::TextView methodsFor:'channels'!
  2953 !CodeView2::TextView methodsFor:'channels'!
  2690 
  2954 
  2691 reallyModifiedChannel
  2955 reallyModifiedChannel
  2719 ! !
  2983 ! !
  2720 
  2984 
  2721 !CodeView2::TextView methodsFor:'delegation-events'!
  2985 !CodeView2::TextView methodsFor:'delegation-events'!
  2722 
  2986 
  2723 isQuickMenuModifierPressed
  2987 isQuickMenuModifierPressed
  2724     |sensor|
       
  2725 
       
  2726     sensor := self sensor.
       
  2727     UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
  2988     UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
  2728         ^ sensor ctrlDown
  2989 	^ self sensor ctrlDown
  2729     ].
  2990     ].
  2730     ^ sensor metaDown
  2991     ^ self sensor metaDown
  2731 
       
  2732     "Modified: / 29-08-2013 / 16:22:30 / cg"
       
  2733 !
  2992 !
  2734 
  2993 
  2735 isQuickMenuModifierReleased
  2994 isQuickMenuModifierReleased
  2736     UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
  2995     UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
  2737         ^ self sensor ctrlDown not
  2996         ^ self sensor ctrlDown not
  2739     ^ self sensor metaDown not
  2998     ^ self sensor metaDown not
  2740 ! !
  2999 ! !
  2741 
  3000 
  2742 !CodeView2::TextView methodsFor:'drawing'!
  3001 !CodeView2::TextView methodsFor:'drawing'!
  2743 
  3002 
  2744 drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg 
  3003 backgroundForVisibleLine:visLineNr default:bg
  2745 
  3004     | lineNr |
  2746     super 
  3005 
  2747         drawFromVisibleLine:startVisLineNr
  3006 
  2748         to:endVisLineNr
  3007     diffMode ifTrue:[
  2749         with:fg
  3008 	lineNr := self visibleLineToListLine:visLineNr.
  2750         and:bg.
  3009 	(insertedLines notEmptyOrNil and:[insertedLines includes:lineNr]) ifTrue:[
  2751 
  3010 	    ^self colorInserted
  2752     "/ if in diffmode...
  3011 	].
  2753     self redrawLines.
  3012 	(changedLines notEmptyOrNil and:[changedLines includes:lineNr]) ifTrue:[
  2754 
  3013 	    ^self colorChanged
  2755     "Created: / 05-04-2010 / 12:08:38 / Jakub <zelenja7@fel.cvut.cz>"
  3014 	].
  2756     "Modified: / 02-05-2010 / 18:46:04 / Jakub <zelenja7@fel.cvut.cz>"
  3015 	(deletedLines notEmptyOrNil and:[deletedLines includes:lineNr]) ifTrue:[
  2757 !
  3016 	    ^self colorDeleted
  2758 
  3017 	].
  2759 drawLine:line fromX:x inVisible:visLineNr with:fg and:bg 
  3018     ].
  2760 
  3019     ^ bg
  2761     super 
  3020 
  2762         drawLine:line
  3021     "Modified: / 17-03-2012 / 12:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2763         fromX:x
  3022 !
  2764         inVisible:visLineNr
  3023 
  2765         with:fg
  3024 drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg
  2766         and:bg.
  3025     "draw a visible line range in fg/bg"
  2767 
  3026 
  2768     "/ if in diffmode...
  3027     diffMode ifFalse:[
  2769     self redrawLines.
  3028 	super drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg.
       
  3029 	^self.
       
  3030     ].
       
  3031 
       
  3032     startVisLineNr to: endVisLineNr do:[:visLineNr|
       
  3033 	self drawVisibleLine: visLineNr with:fg and:bg
       
  3034     ]
       
  3035 
       
  3036     "Modified: / 15-12-1999 / 23:19:39 / cg"
       
  3037     "Created: / 17-03-2012 / 09:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3038 !
       
  3039 
       
  3040 drawLine:line fromX:x inVisible:visLineNr with:fg and:bg
       
  3041     super
       
  3042 	drawLine:line
       
  3043 	fromX:x
       
  3044 	inVisible:visLineNr
       
  3045 	with:fg
       
  3046 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2770 
  3047 
  2771     "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>"
  3048     "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>"
  2772     "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>"
  3049     "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>"
  2773 !
  3050     "Modified: / 17-03-2012 / 10:05:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2774 
  3051 !
  2775 drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg 
  3052 
  2776 
  3053 drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg
  2777     super 
  3054     super
  2778         drawLine:lineStringArg
  3055 	drawLine:lineStringArg
  2779         inVisible:visLineNr
  3056 	inVisible:visLineNr
  2780         col:col
  3057 	col:col
  2781         with:fg
  3058 	with:fg
  2782         and:bg.
  3059 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2783 
       
  2784     "/ if in diffmode...
       
  2785     self redrawLines.
       
  2786 
  3060 
  2787     "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
  3061     "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
  2788     "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>"
  3062     "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>"
  2789 !
  3063     "Modified: / 17-03-2012 / 10:04:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2790 
  3064 !
  2791 drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg 
  3065 
  2792 
  3066 drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg
  2793     super 
  3067     super
  2794         drawLine:lineStringArg
  3068 	drawLine:lineStringArg
  2795         inVisible:visLineNr
  3069 	inVisible:visLineNr
  2796         from:startCol
  3070 	from:startCol
  2797         to:endColOrNil
  3071 	to:endColOrNil
  2798         with:fg
  3072 	with:fg
  2799         and:bg.
  3073 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2800 
       
  2801     "/ if in diffmode...
       
  2802     self redrawLines.
       
  2803 
  3074 
  2804     "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>"
  3075     "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>"
  2805     "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>"
  3076     "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>"
  2806 !
  3077     "Modified: / 17-03-2012 / 10:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2807 
  3078 !
  2808 drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg 
  3079 
  2809 
  3080 drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg
  2810     super 
  3081     super
  2811         drawLine:lineString
  3082 	drawLine:lineString
  2812         inVisible:visLineNr
  3083 	inVisible:visLineNr
  2813         from:startCol
  3084 	from:startCol
  2814         with:fg
  3085 	with:fg
  2815         and:bg.
  3086 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2816 
       
  2817     "/ if in diffmode...
       
  2818     self redrawLines.
       
  2819 
  3087 
  2820     "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>"
  3088     "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>"
  2821     "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>"
  3089     "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>"
  2822 !
  3090     "Modified: / 17-03-2012 / 10:04:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2823 
  3091 !
  2824 drawVisibleLine:visLineNr with:fg and:bg 
  3092 
  2825     super 
  3093 drawVisibleLine:visLineNr with:fg and:bg
  2826         drawVisibleLine:visLineNr
  3094     super
  2827         with:fg
  3095 	drawVisibleLine:visLineNr
  2828         and:bg.
  3096 	with:fg
  2829 
  3097 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2830     gutterView redrawVisibleLine:visLineNr.
       
  2831 
       
  2832     "/ if in diffmode...
       
  2833     self redrawLines.
       
  2834 
  3098 
  2835     "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
  3099     "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
  2836     "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>"
  3100     "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>"
       
  3101     "Modified: / 17-03-2012 / 10:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2837 !
  3102 !
  2838 
  3103 
  2839 redraw
  3104 redraw
  2840     "/ thisContext fullPrintAll.   
  3105     "/ thisContext fullPrintAll.   
  2841     super redraw.
  3106     super redraw.
  2847     "redraw diff lines"
  3112     "redraw diff lines"
  2848 
  3113 
  2849     |i pom|
  3114     |i pom|
  2850 
  3115 
  2851     diffMode ifFalse:[^self].
  3116     diffMode ifFalse:[^self].
       
  3117     true ifTrue:[^self].
       
  3118 
  2852 
  3119 
  2853     pom := self hasSelection.
  3120     pom := self hasSelection.
  2854     (pom) ifTrue:[ ^ self. ].
  3121     (pom) ifTrue:[ ^ self. ].
  2855 
  3122 
  2856     i := 1.
  3123     i := 1.
  2857     [
  3124     [
  2858         i <= (deletedLines size)
  3125 	i <= (deletedLines size)
  2859     ] whileTrue:[
  3126     ] whileTrue:[
  2860         ((deletedLines at:i) > 0) ifTrue:[
  3127 	((deletedLines at:i) > 0) ifTrue:[
  2861             super 
  3128 	    super
  2862                 drawVisibleLine:(deletedLines at:i)
  3129 		drawVisibleLine:(deletedLines at:i)
  2863                 with:fgColor
  3130 		with:fgColor
  2864                 and:self colorDeleted.
  3131 		and:self colorDeleted.
  2865         ].
  3132 	].
  2866         i := i + 1.
  3133 	i := i + 1.
  2867     ].
  3134     ].
  2868     i := 1.
  3135     i := 1.
  2869     [
  3136     [
  2870         i <= (insertedLines size)
  3137 	i <= (insertedLines size)
  2871     ] whileTrue:[
  3138     ] whileTrue:[
  2872         ((insertedLines at:i) > 0) ifTrue:[
  3139 	((insertedLines at:i) > 0) ifTrue:[
  2873             super 
  3140 	    super
  2874                 drawVisibleLine:(insertedLines at:i)
  3141 		drawVisibleLine:(insertedLines at:i)
  2875                 with:fgColor
  3142 		with:fgColor
  2876                 and:self colorInserted.
  3143 		and:self colorInserted.
  2877         ].
  3144 	].
  2878         i := i + 1.
  3145 	i := i + 1.
  2879     ].
  3146     ].
  2880     i := 1.
  3147     i := 1.
  2881     [
  3148     [
  2882         i <= (changedLines size)
  3149 	i <= (changedLines size)
  2883     ] whileTrue:[
  3150     ] whileTrue:[
  2884         ((changedLines at:i) > 0) ifTrue:[
  3151 	((changedLines at:i) > 0) ifTrue:[
  2885             super 
  3152 	    super
  2886                 drawVisibleLine:(changedLines at:i)
  3153 		drawVisibleLine:(changedLines at:i)
  2887                 with:fgColor
  3154 		with:fgColor
  2888                 and:self colorChanged.
  3155 		and:self colorChanged.
  2889         ].
  3156 	].
  2890         i := i + 1.
  3157 	i := i + 1.
  2891     ].
  3158     ].
  2892 
  3159 
  2893     "Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>"
  3160     "Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>"
  2894     "Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>"
  3161     "Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>"
  2895     "Modified: / 08-04-2011 / 20:52:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3162     "Modified: / 17-03-2012 / 09:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2896 ! !
  3163 ! !
  2897 
  3164 
  2898 !CodeView2::TextView methodsFor:'editing'!
  3165 !CodeView2::TextView methodsFor:'editing'!
  2899 
  3166 
  2900 contentsChanged
  3167 contentsChanged
  3197     | lang |
  3464     | lang |
  3198     lang := codeView language.
  3465     lang := codeView language.
  3199     "Bit hacky here, should ask language some language toolbox
  3466     "Bit hacky here, should ask language some language toolbox
  3200     for formatting helper, that should do it..."
  3467     for formatting helper, that should do it..."
  3201     (lang notNil and:[lang isSmalltalk]) ifTrue:[
  3468     (lang notNil and:[lang isSmalltalk]) ifTrue:[
  3202         | line lineNo indent |
  3469 	| line lineNo indent |
  3203         lineNo := lineNr.    
  3470 	lineNo := lineNr.
  3204         [lineNo ~~ 1] whileTrue:[
  3471 	[lineNo ~~ 1] whileTrue:[
  3205             lineNo  := lineNo - 1.
  3472 	    lineNo  := lineNo - 1.
  3206             line := self listAt:lineNo.
  3473 	    line := self listAt:lineNo.
  3207 
  3474 
  3208             line notNil ifTrue:[
  3475 	    line notNil ifTrue:[
  3209                 indent := line indexOfNonSeparatorStartingAt:1.
  3476 		indent := line indexOfNonSeparatorStartingAt:1.
  3210                 "beggining of block"
  3477 		"beggining od block"
  3211                 line notEmptyOrNil ifTrue:[
  3478 		line notEmptyOrNil ifTrue:[
  3212                     line last == $[ ifTrue:[
  3479 		    line last == $[ ifTrue:[
  3213                         indent := indent + 4.
  3480 			indent := indent + 4.
  3214                     ] ifFalse:[
  3481 		    ] ifFalse:[
  3215                         "end of block args"
  3482 			"end of block args"
  3216                         (line last == $| and: [line includes: $[]) ifTrue:[
  3483 			(line last == $| and: [line includes: $[]) ifTrue:[
  3217                             indent := indent + 4.
  3484 			    indent := indent + 4.
  3218                         ]   
  3485 			]
  3219                     ].        
  3486 		    ].
  3220                 ].
  3487 		].
  3221                 indent ~~ 0 ifTrue:[
  3488 		indent ~~ 0 ifTrue:[
  3222                     ^ indent - 1
  3489 		^ indent - 1
  3223                 ]
  3490 		]
  3224             ]            
  3491 	    ]
  3225         ].
  3492 	].
  3226         ^0.
  3493 	^0.
  3227     ].
  3494     ].
  3228     ^super leftIndentForLine:lineNr
  3495     ^super leftIndentForLine:lineNr
  3229 
  3496 
  3230     "Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3497     "Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3231 ! !
  3498 ! !
  3238 
  3505 
  3239     changedDiffText := true.
  3506     changedDiffText := true.
  3240     diffMode := false.
  3507     diffMode := false.
  3241     suppressNotifications := false.
  3508     suppressNotifications := false.
  3242     reallyModifiedChannel := false asValue.
  3509     reallyModifiedChannel := false asValue.
       
  3510     autoIndent := UserPreferences current codeView2AutoIndent.
  3243 
  3511 
  3244     self enableMotionEvents.
  3512     self enableMotionEvents.
  3245 
  3513 
  3246     "Created: / 23-06-2010 / 17:28:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3514     "Created: / 23-06-2010 / 17:28:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3247     "Modified: / 06-07-2011 / 17:46:31 / jv"
  3515     "Modified: / 06-07-2011 / 17:46:31 / jv"
  3248     "Modified: / 21-08-2011 / 10:09:29 / cg"
  3516     "Modified: / 21-08-2011 / 10:09:29 / cg"
  3249     "Modified: / 07-10-2011 / 19:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3517     "Modified: / 15-07-2013 / 13:15:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3250 !
  3518 !
  3251 
  3519 
  3252 setCodeView: aCodeView2
  3520 setCodeView: aCodeView2
  3253 
  3521 
  3254     codeView := aCodeView2.
  3522     codeView := aCodeView2.
  3580 
  3848 
  3581     "Created: / 06-04-2010 / 14:03:28 / Jakub <zelenja7@fel.cvut.cz>"
  3849     "Created: / 06-04-2010 / 14:03:28 / Jakub <zelenja7@fel.cvut.cz>"
  3582     "Modified: / 02-05-2010 / 19:29:23 / Jakub <zelenja7@fel.cvut.cz>"
  3850     "Modified: / 02-05-2010 / 19:29:23 / Jakub <zelenja7@fel.cvut.cz>"
  3583 !
  3851 !
  3584 
  3852 
       
  3853 basicScrollTo:anOrigin redraw:doRedraw
       
  3854     super scrollTo:anOrigin redraw:doRedraw
       
  3855 
       
  3856     "Modified: / 06-04-2010 / 14:05:40 / Jakub <zelenja7@fel.cvut.cz>"
       
  3857     "Modified: / 17-03-2012 / 10:06:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3858     "Created: / 19-03-2012 / 17:01:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3859 !
       
  3860 
  3585 basicScrollUp:nLines 
  3861 basicScrollUp:nLines 
  3586     |i|
  3862     |i|
  3587 
  3863 
  3588     (scrolled isNil) ifTrue:[
  3864     (scrolled isNil) ifTrue:[
  3589         scrolled := false.
  3865         scrolled := false.
  3649     self basicScrollDown: nLines.
  3925     self basicScrollDown: nLines.
  3650 
  3926 
  3651     "Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>"
  3927     "Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>"
  3652 !
  3928 !
  3653 
  3929 
       
  3930 scrollTo:anOrigin redraw:doRedraw
       
  3931 
       
  3932     codeView scrollTo:anOrigin redraw:doRedraw in: self.
       
  3933     self basicScrollTo:anOrigin redraw:doRedraw
       
  3934 
       
  3935     "Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>"
       
  3936     "Modified: / 17-03-2012 / 10:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3937     "Created: / 19-03-2012 / 17:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  3938 !
       
  3939 
  3654 scrollUp:nLines
  3940 scrollUp:nLines
  3655 
  3941 
  3656     codeView scrollUp: nLines in: self.
  3942     codeView scrollUp: nLines in: self.
  3657     self basicScrollUp: nLines.
  3943     self basicScrollUp: nLines.
  3658 
  3944 
  3678 ! !
  3964 ! !
  3679 
  3965 
  3680 !CodeView2 class methodsFor:'documentation'!
  3966 !CodeView2 class methodsFor:'documentation'!
  3681 
  3967 
  3682 version
  3968 version
  3683     ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.129 2013-10-09 16:16:02 cg Exp $'
  3969     ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.130 2014-02-05 18:56:57 cg Exp $'
  3684 !
  3970 !
  3685 
  3971 
  3686 version_CVS
  3972 version_CVS
  3687     ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.129 2013-10-09 16:16:02 cg Exp $'
  3973     ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.130 2014-02-05 18:56:57 cg Exp $'
  3688 !
  3974 !
  3689 
  3975 
  3690 version_SVN
  3976 version_SVN
  3691     ^ '$Id: Tools__CodeView2.st,v 1.129 2013-10-09 16:16:02 cg Exp $'
  3977     ^ '$Id: Tools__CodeView2.st,v 1.130 2014-02-05 18:56:57 cg Exp $'
  3692 ! !
  3978 ! !
  3693 
  3979 
  3694 
  3980 
  3695 CodeView2 initialize!
  3981 CodeView2 initialize!