viewEvents.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. export class ViewCompositionStartEvent {
  6. constructor() {
  7. this.type = 0 /* ViewCompositionStart */;
  8. }
  9. }
  10. export class ViewCompositionEndEvent {
  11. constructor() {
  12. this.type = 1 /* ViewCompositionEnd */;
  13. }
  14. }
  15. export class ViewConfigurationChangedEvent {
  16. constructor(source) {
  17. this.type = 2 /* ViewConfigurationChanged */;
  18. this._source = source;
  19. }
  20. hasChanged(id) {
  21. return this._source.hasChanged(id);
  22. }
  23. }
  24. export class ViewCursorStateChangedEvent {
  25. constructor(selections, modelSelections) {
  26. this.type = 3 /* ViewCursorStateChanged */;
  27. this.selections = selections;
  28. this.modelSelections = modelSelections;
  29. }
  30. }
  31. export class ViewDecorationsChangedEvent {
  32. constructor(source) {
  33. this.type = 4 /* ViewDecorationsChanged */;
  34. if (source) {
  35. this.affectsMinimap = source.affectsMinimap;
  36. this.affectsOverviewRuler = source.affectsOverviewRuler;
  37. }
  38. else {
  39. this.affectsMinimap = true;
  40. this.affectsOverviewRuler = true;
  41. }
  42. }
  43. }
  44. export class ViewFlushedEvent {
  45. constructor() {
  46. this.type = 5 /* ViewFlushed */;
  47. // Nothing to do
  48. }
  49. }
  50. export class ViewFocusChangedEvent {
  51. constructor(isFocused) {
  52. this.type = 6 /* ViewFocusChanged */;
  53. this.isFocused = isFocused;
  54. }
  55. }
  56. export class ViewLanguageConfigurationEvent {
  57. constructor() {
  58. this.type = 7 /* ViewLanguageConfigurationChanged */;
  59. }
  60. }
  61. export class ViewLineMappingChangedEvent {
  62. constructor() {
  63. this.type = 8 /* ViewLineMappingChanged */;
  64. // Nothing to do
  65. }
  66. }
  67. export class ViewLinesChangedEvent {
  68. constructor(fromLineNumber, toLineNumber) {
  69. this.type = 9 /* ViewLinesChanged */;
  70. this.fromLineNumber = fromLineNumber;
  71. this.toLineNumber = toLineNumber;
  72. }
  73. }
  74. export class ViewLinesDeletedEvent {
  75. constructor(fromLineNumber, toLineNumber) {
  76. this.type = 10 /* ViewLinesDeleted */;
  77. this.fromLineNumber = fromLineNumber;
  78. this.toLineNumber = toLineNumber;
  79. }
  80. }
  81. export class ViewLinesInsertedEvent {
  82. constructor(fromLineNumber, toLineNumber) {
  83. this.type = 11 /* ViewLinesInserted */;
  84. this.fromLineNumber = fromLineNumber;
  85. this.toLineNumber = toLineNumber;
  86. }
  87. }
  88. export class ViewRevealRangeRequestEvent {
  89. constructor(source, range, selections, verticalType, revealHorizontal, scrollType) {
  90. this.type = 12 /* ViewRevealRangeRequest */;
  91. this.source = source;
  92. this.range = range;
  93. this.selections = selections;
  94. this.verticalType = verticalType;
  95. this.revealHorizontal = revealHorizontal;
  96. this.scrollType = scrollType;
  97. }
  98. }
  99. export class ViewScrollChangedEvent {
  100. constructor(source) {
  101. this.type = 13 /* ViewScrollChanged */;
  102. this.scrollWidth = source.scrollWidth;
  103. this.scrollLeft = source.scrollLeft;
  104. this.scrollHeight = source.scrollHeight;
  105. this.scrollTop = source.scrollTop;
  106. this.scrollWidthChanged = source.scrollWidthChanged;
  107. this.scrollLeftChanged = source.scrollLeftChanged;
  108. this.scrollHeightChanged = source.scrollHeightChanged;
  109. this.scrollTopChanged = source.scrollTopChanged;
  110. }
  111. }
  112. export class ViewThemeChangedEvent {
  113. constructor() {
  114. this.type = 14 /* ViewThemeChanged */;
  115. }
  116. }
  117. export class ViewTokensChangedEvent {
  118. constructor(ranges) {
  119. this.type = 15 /* ViewTokensChanged */;
  120. this.ranges = ranges;
  121. }
  122. }
  123. export class ViewTokensColorsChangedEvent {
  124. constructor() {
  125. this.type = 16 /* ViewTokensColorsChanged */;
  126. // Nothing to do
  127. }
  128. }
  129. export class ViewZonesChangedEvent {
  130. constructor() {
  131. this.type = 17 /* ViewZonesChanged */;
  132. // Nothing to do
  133. }
  134. }