about summary refs log tree commit diff stats
path: root/themes/original
blob: ef325bd0c7d89937d7383fb6c48a7c481c72cb46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
[colours]
bkgnd=default
titlebar=blue
titlebar.text=white
titlebar.brackets=cyan
titlebar.unencrypted=red
titlebar.encrypted=white
titlebar.untrusted=yellow
titlebar.trusted=white
titlebar.online=white
titlebar.offline=white
titlebar.away=white
titlebar.chat=white
titlebar.dnd=white
titlebar.xa=white
statusbar=blue
statusbar.text=white
statusbar.time=white
statusbar.brackets=cyan
statusbar.active=cyan
statusbar.new=white
main.text=white
main.text.me=white
main.text.them=white
main.splash=cyan
main.help.header=white
main.time=white
input.text=white
subscribed=green
unsubscribed=red
otr.started.trusted=green
otr.started.untrusted=yellow
otr.ended=red
otr.trusted=green
otr.untrusted=yellow
online=green
away=cyan
chat=green
dnd=red
xa=cyan
offline=red
incoming=yellow
mention=yellow
trigger=yellow
typing=yellow
gone=yellow
error=red
roominfo=yellow
roommention=yellow
roommention.term=yellow
roomtrigger=yellow
roomtrigger.term=yellow
me=yellow
them=green
roster.header=yellow
roster.chat=green
roster.online=green
roster.away=cyan
roster.xa=cyan
roster.dnd=red
roster.offline=red
roster.chat.active=green
roster.online.active=green
roster.away.active=cyan
roster.xa.active=cyan
roster.dnd.active=red
roster.offline.active=red
roster.chat.unread=green
roster.online.unread=green
roster.away.unread=cyan
roster.xa.unread=cyan
roster.dnd.unread=red
roster.offline.unread=red
roster.room=green
roster.room.unread=green
roster.room.mention=green
roster.room.trigger=green
occupants.header=yellow
receipt.sent=red

[ui]
titlebar.position=1
mainwin.position=2
statusbar.position=3
inputwin.position=4
highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
fn draw-line screen: (addr screen), x0: int, y0: int, x1: int, y1: int, color: int {
  var dx: int
  var dy: int
  var sx: int
  var sy: int
  var err: int
  # dx = abs(x1-x0)
  var tmp2/ecx: int <- copy x1
  tmp2 <- subtract x0
  var tmp/eax: int <- abs tmp2
  copy-to dx, tmp
  # sx = sgn(x1-x0)
  tmp <- sgn tmp2
  copy-to sx, tmp
  # dy = -abs(y1-y0)
  tmp2 <- copy y1
  tmp2 <- subtract y0
  tmp <- abs tmp2
  tmp <- negate
  copy-to dy, tmp
  # sy = sgn(y1-y0)
  tmp <- sgn tmp2
  copy-to sy, tmp
  # err = dx + dy
  tmp <- copy dy
  tmp <- add dx
  copy-to err, tmp
  #
  var x/ecx: int <- copy x0
  var y/edx: int <- copy y0
  $draw-line:loop: {
    pixel screen, x, y, color
    # if (x == x1 && y == y1) break
    {
      compare x, x1
      break-if-!=
      compare y, y1
      break-if-!=
      break $draw-line:loop
    }
    # e2 = err*2
    var e2/ebx: int <- copy err
    e2 <- shift-left 1
    # if (e2 >= dy) { err += dy; x += sx; }
    {
      compare e2, dy
      break-if-<
      tmp <- copy dy
      add-to err, tmp
      x <- add sx
    }
    # if (e2 <= dx) { err += dx; y += sy; }
    {
      compare e2, dx
      break-if->
      tmp <- copy dx
      add-to err, tmp
      y <- add sy
    }
    loop
  }
}

fn draw-horizontal-line screen: (addr screen), y: int, x0: int, x1: int, color: int {
  var x/eax: int <- copy x0
  {
    compare x, x1
    break-if->=
    pixel screen, x, y, color
    x <- increment
    loop
  }
}

fn draw-vertical-line screen: (addr screen), x: int, y0: int, y1: int, color: int {
  var y/eax: int <- copy y0
  {
    compare y, y1
    break-if->=
    pixel screen, x, y, color
    y <- increment
    loop
  }
}

fn draw-rect screen: (addr screen), xmin: int, ymin: int, xmax: int, ymax: int, color: int {
  var y/eax: int <- copy ymin
  {
    compare y, ymax
    break-if->=
    draw-horizontal-line screen, y, xmin, xmax, color
    y <- increment
    loop
  }
}

# 0 <= u <= 1
fn line-point u: float, x0: int, x1: int -> _/eax: int {
  var one/eax: int <- copy 1
  var u-prime/xmm0: float <- convert one
  u-prime <- subtract u
  var result/xmm1: float <- convert x0
  result <- multiply u-prime
  var term2/xmm2: float <- convert x1
  term2 <- multiply u
  result <- add term2
  var result/eax: int <- convert result
  return result
}