author | wenzelm |
Tue, 13 Jun 2017 21:15:40 +0200 | |
changeset 66084 | 7f8eeff20f7a |
parent 66082 | 2d12a730a380 |
child 66094 | 24658c9d7c78 |
permissions | -rw-r--r-- |
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
1 |
/* Title: Pure/PIDE/editor.scala |
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
3 |
|
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
4 |
General editor operations. |
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
5 |
*/ |
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
6 |
|
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
7 |
package isabelle |
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
8 |
|
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
9 |
|
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
10 |
abstract class Editor[Context] |
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
11 |
{ |
66082 | 12 |
/* session */ |
13 |
||
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
14 |
def session: Session |
66084 | 15 |
def flush(): Unit |
54461 | 16 |
def invoke(): Unit |
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
17 |
def current_node(context: Context): Option[Document.Node.Name] |
52978 | 18 |
def current_node_snapshot(context: Context): Option[Document.Snapshot] |
52974 | 19 |
def node_snapshot(name: Document.Node.Name): Document.Snapshot |
53844
71f103629327
skip ignored commands, similar to former proper_command_at (see d68ea01d5084) -- relevant to Output, Query_Operation etc.;
wenzelm
parents:
52980
diff
changeset
|
20 |
def current_command(context: Context, snapshot: Document.Snapshot): Option[Command] |
52977
15254e32d299
central management of Document.Overlays, independent of Document_Model;
wenzelm
parents:
52974
diff
changeset
|
21 |
|
66082 | 22 |
|
23 |
/* overlays */ |
|
24 |
||
25 |
private val overlays = Synchronized(Document.Overlays.empty) |
|
26 |
||
27 |
def node_overlays(name: Document.Node.Name): Document.Node.Overlays = |
|
28 |
overlays.value(name) |
|
29 |
||
30 |
def insert_overlay(command: Command, fn: String, args: List[String]): Unit = |
|
31 |
overlays.change(_.insert(command, fn, args)) |
|
32 |
||
33 |
def remove_overlay(command: Command, fn: String, args: List[String]): Unit = |
|
34 |
overlays.change(_.remove(command, fn, args)) |
|
35 |
||
36 |
||
37 |
/* hyperlinks */ |
|
52980 | 38 |
|
66084 | 39 |
abstract class Hyperlink |
40 |
{ |
|
64663 | 41 |
def external: Boolean = false |
56494
1b74abf064e1
avoid confusion about pointless cursor movement with external links;
wenzelm
parents:
55884
diff
changeset
|
42 |
def follow(context: Context): Unit |
1b74abf064e1
avoid confusion about pointless cursor movement with external links;
wenzelm
parents:
55884
diff
changeset
|
43 |
} |
66084 | 44 |
|
52980 | 45 |
def hyperlink_command( |
64664 | 46 |
focus: Boolean, snapshot: Document.Snapshot, id: Document_ID.Generic, offset: Symbol.Offset = 0) |
60893 | 47 |
: Option[Hyperlink] |
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
diff
changeset
|
48 |
} |