comment -*- mode: text -*-
comment $Id$

mlterm configuration protocol(main)
version 20091211

* Protocol
  set              = "\x1b" "]" "5379" ( ";" [ "/dev/..." ":" ] <key> [ "=" <value> ] )* "\x07"
  get(pty)         = "\x1b" "]" "5380" ";" <challenge> ";" [ "/dev/..." ":" ] <key> "\x07"
  get(GUI menu)    = "\x1b" "]" "5381" ";" [ "/dev/..." ":" ] <key> "\x07"
  save             = "\x1b" "]" "5382" ( ";" [ "/dev/..." ":" ] <key> [ "=" <value> ] )* "\x07"
  set&save         = "\x1b" "]" "5383" ( ";" [ "/dev/..." ":" ] <key> [ "=" <value> ] )* "\x07"
  return value     = "#" <key> "=" <value> "\x0a" | "#error" "\x0a" | "#forbidden" "\x0a"
  set key          = encoding | fg_color | bg_color | tabsize | logsize |
                     fontsize | fade_ratio | mod_meta_key | mod_meta_mode |
                     bel_mode | type_engine | use_anti_alias | use_variable_column_width |
                     use_combining | use_transbg | use_bidi |
                     receive_string_via_ucs | input_method | wall_picture |
                     full_reset | brightness | gamma | contrast | line_space |
                     screen_width_ratio | screen_height_ratio | vertical_mode |
                     scrollbar_mode | stataic_backscroll_mode | use_multi_column_char |
                     col_size_of_width_a | scrollbar_view_name | sb_fg_color | sb_bg_color |
                     iscii_lang | use_dynamic_comb | cursor_fg_color |
                     cursor_bg_color | open_pty | open_screen | select_pty |
                     snapshot | gen_proto_challenge | icon_path | logging_vt_seq |
		     title | paste | mlclient <prefix options> <options> |
		     mlclientx <prefix options> <options>
  get key          = encoding | is_auto_encoding | fg_color | bg_color |
                     tabsize | logsize | fontsize | fade_ratio | mod_meta_key |
                     mod_meta_mode | bel_mode | type_engine | use_anti_alias |
                     use_variable_column_width | use_combining | use_transbg |
                     use_bidi | receive_string_via_ucs | xim | locale |
                     wall_picture | pwd | brightness | gamma | contrast |
                     line_space | screen_width_ratio | screen_height_ratio |
                     vertical_mode | scrollbar_mode | use_multi_column_char |
                     col_size_of_width_a | scrollbar_view_name | sb_fg_color | sb_bg_color |
                     iscii_lang | use_dynamic_comb | rows | cols |
                     cursor_fg_color | cursor_bg_color | pty_list | pty_name
		     icon_path | logging_vt_seq | selected_text(:encoding) | gui

  value            = <values for each key>
  challenge        = <string in ~/.mlterm/challenge>

* Compatibility with other terminals
  set fg color     = "\x1b" "]" "39" ";" <color name> "\x07"
  set bg color     = "\x1b" "]" "49" ";" <color name> "\x07"
  set picture      = "\x1b" "]" "20" ";" <path> "[" ";" <adjusting> "]" "[" ":" <operation> "]" "\x07"

* Values for each key
  bel_mode = none | sound | visual
  bg_color = <color name> | <color rgb>
  brightness = <any ASCII decimal digit>
  cols = <any ASCII decimal digit>
  col_size_of_width_a = 1 | 2
  contrast = <any ASCII decimal digit>
  cursor_bg_color = <color name> | <color rgb>
  cursor_fg_color = <color name> | <color rgb>
  encoding = <encoding name> | auto
  fade_ratio = <any ASCII decimal digit>
  fg_color = <color name> | <color rgb>
  fontsize = <any ASCII decimal digit> | larger | smaller
  full_reset = <none>
  gamma = <any ASCII decimal digit>
  gen_proto_challenge = <none>
  icon_path = <file path>
  input_method = <input method> ":" <input method specific options> ...
  iscii_lang = Assamese | Bengali | Gujarati | Hindi | Kannada | Malayalam | Oriya | Punjabi | Roman | Tamil | Telugu
  line_space = <any ASCII decimal digit>
  locale = <locale name>
  logsize = <any ASCII decimal digit>
  mlclient <prefix options> <options> = <none>
  mlclientx <prefix options> <options> = <none>
  mod_meta_key = none | mod1 | mod2 | mod3 | mod4 | meta | alt | super | hyper
  mod_meta_mode = none | esc | 8bit
  open_pty = <none>
  open_screen = <none>
  pty_list = (<pty dev>:<active flag>;)*
  pty_name = <pty dev> | <pty title>
  pwd = <current working directory>
  receive_string_via_ucs = true | false
  rows = <any ASCII decimal digit>
  sb_bg_color = <color name> | <color rgb>
  sb_fg_color = <color name> | <color rgb>
  screen_height_ratio = <any ASCII decimal digit>
  screen_width_ratio = <any ASCII decimal digit>
  scrollbar_mode = none | left | right
  scrollbar_view_name = <name>
  select_pty = <pty dev name>
  snapshot = <encoding name>:<file name> | <none>
  stataic_backscroll_mode = true | false
  tabsize = <any ASCII decimal digit>
  title = <pty title>
  type_engine = xcore | xft
  use_anti_alias = true | false
  use_bidi = true | false
  use_combining = true | false
  use_dynamic_comb = true | false
  use_multi_column_char = true | false
  use_transbg = true | false
  use_variable_column_width = true | false
  vertical_mode = none | cjk | mongol
  wall_picture = <file path>
  logging_vt_seq = true | false
  selected_text(:encoding) = <none>
  paste = <none>

* Note
  o Encoding names are regularized , that is , `-' , `_' are removed , and only
    upper case letters are used. But encoding names which are not regularized
    can be used in ESC ] 5379 ; encoding= <value> BEL sequence by secondary
    effect.
  o Adjusting and operation arguments of  ESC ] 20 ; pt BEL sequence are not
    used for now.
  o Return value of ESC ] 5380 ; xim BEL is <xim name> only , never <xim name>
    ":" <locale name>.
  o It is configuration programs themselves that search ~/.mlterm/xim and
    ${SYSCONFDIR}/mlterm/xim files for pairs of xim name and its preferable
    locale.
  o If /dev/... is specified with 'pty_name' key, <pty title> is returned.
    Otherwise, <pty dev> returned.
  o /dev/... in 5379,5382,5383 proto is ignored for now.
  o If "snapshot" protocol issued without <file name> or with no value,
    screen snapshot is output to ~/.mlterm/[tty].snp.
  o "mlclient" protocol accepts arguments like mlclient comman except '='.
    mlclient or mlclientx command is recommended to use.
    e.g. "\x1b]5379;mlclient --km utf8\x07"
  o "mlclientx" protocol is similar to "mlclient" one except for not creating
    any new window.
  o "selected_text(:encoding)" protocol returns selected text in which NL is
    replaced to CR.
  o "paste" protocol works like INSERT_SELECTION.
