src/Pure/PIDE/rendering.scala
changeset 65144 b5782e996651
parent 65143 36cd85caf09a
child 65145 576d52aa0a78
     1.1 --- a/src/Pure/PIDE/rendering.scala	Tue Mar 07 17:21:41 2017 +0100
     1.2 +++ b/src/Pure/PIDE/rendering.scala	Tue Mar 07 17:56:57 2017 +0100
     1.3 @@ -50,6 +50,31 @@
     1.4      val error_message = Value("error_message")
     1.5      val message_background_colors =
     1.6        values -- background_colors -- foreground_colors -- message_underline_colors
     1.7 +
     1.8 +    // text
     1.9 +    val text = Value("text")
    1.10 +    val keyword1 = Value("keyword1")
    1.11 +    val keyword2 = Value("keyword2")
    1.12 +    val keyword3 = Value("keyword3")
    1.13 +    val quasi_keyword = Value("quasi_keyword")
    1.14 +    val improper = Value("improper")
    1.15 +    val operator = Value("operator")
    1.16 +    val tfree = Value("tfree")
    1.17 +    val tvar = Value("tvar")
    1.18 +    val free = Value("free")
    1.19 +    val skolem = Value("skolem")
    1.20 +    val bound = Value("bound")
    1.21 +    val var_ = Value("var")
    1.22 +    val inner_numeral = Value("inner_numeral")
    1.23 +    val inner_quoted = Value("inner_quoted")
    1.24 +    val inner_cartouche = Value("inner_cartouche")
    1.25 +    val inner_comment = Value("inner_comment")
    1.26 +    val dynamic = Value("dynamic")
    1.27 +    val class_parameter = Value("class_parameter")
    1.28 +    val antiquote = Value("antiquote")
    1.29 +    val text_colors =
    1.30 +      values -- background_colors -- foreground_colors -- message_underline_colors --
    1.31 +      message_background_colors
    1.32    }
    1.33  
    1.34  
    1.35 @@ -96,6 +121,45 @@
    1.36      error_pri -> Color.error_message)
    1.37  
    1.38  
    1.39 +  /* text color */
    1.40 +
    1.41 +  val text_color = Map(
    1.42 +    Markup.KEYWORD1 -> Color.keyword1,
    1.43 +    Markup.KEYWORD2 -> Color.keyword2,
    1.44 +    Markup.KEYWORD3 -> Color.keyword3,
    1.45 +    Markup.QUASI_KEYWORD -> Color.quasi_keyword,
    1.46 +    Markup.IMPROPER -> Color.improper,
    1.47 +    Markup.OPERATOR -> Color.operator,
    1.48 +    Markup.STRING -> Color.text,
    1.49 +    Markup.ALT_STRING -> Color.text,
    1.50 +    Markup.VERBATIM -> Color.text,
    1.51 +    Markup.CARTOUCHE -> Color.text,
    1.52 +    Markup.LITERAL -> Color.keyword1,
    1.53 +    Markup.DELIMITER -> Color.text,
    1.54 +    Markup.TFREE -> Color.tfree,
    1.55 +    Markup.TVAR -> Color.tvar,
    1.56 +    Markup.FREE -> Color.free,
    1.57 +    Markup.SKOLEM -> Color.skolem,
    1.58 +    Markup.BOUND -> Color.bound,
    1.59 +    Markup.VAR -> Color.var_,
    1.60 +    Markup.INNER_STRING -> Color.inner_quoted,
    1.61 +    Markup.INNER_CARTOUCHE -> Color.inner_cartouche,
    1.62 +    Markup.INNER_COMMENT -> Color.inner_comment,
    1.63 +    Markup.DYNAMIC_FACT -> Color.dynamic,
    1.64 +    Markup.CLASS_PARAMETER -> Color.class_parameter,
    1.65 +    Markup.ANTIQUOTE -> Color.antiquote,
    1.66 +    Markup.ML_KEYWORD1 -> Color.keyword1,
    1.67 +    Markup.ML_KEYWORD2 -> Color.keyword2,
    1.68 +    Markup.ML_KEYWORD3 -> Color.keyword3,
    1.69 +    Markup.ML_DELIMITER -> Color.text,
    1.70 +    Markup.ML_NUMERAL -> Color.inner_numeral,
    1.71 +    Markup.ML_CHAR -> Color.inner_quoted,
    1.72 +    Markup.ML_STRING -> Color.inner_quoted,
    1.73 +    Markup.ML_COMMENT -> Color.inner_comment,
    1.74 +    Markup.SML_STRING -> Color.inner_quoted,
    1.75 +    Markup.SML_COMMENT -> Color.inner_comment)
    1.76 +
    1.77 +
    1.78    /* markup elements */
    1.79  
    1.80    val active_elements =
    1.81 @@ -142,6 +206,8 @@
    1.82      Pretty.block(XML.Text(kind) :: Pretty.brk(1) :: body)
    1.83  
    1.84    val caret_focus_elements = Markup.Elements(Markup.ENTITY)
    1.85 +
    1.86 +  val text_color_elements = Markup.Elements(text_color.keySet)
    1.87  }
    1.88  
    1.89  abstract class Rendering(