summaryrefslogtreecommitdiff
path: root/share/library/Misc
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2012-08-12 06:10:27 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2012-08-12 06:10:27 +0200
commita1b79a55d2d70660aa156da460ee2e55ebc99183 (patch)
tree974fa7c63c175d507f66599c5563345a87f5ffe1 /share/library/Misc
parent9366c420264bb48460ec606c3d77c7a504db52f0 (diff)
downloadlogdiag-a1b79a55d2d70660aa156da460ee2e55ebc99183.tar.gz
logdiag-a1b79a55d2d70660aa156da460ee2e55ebc99183.tar.xz
logdiag-a1b79a55d2d70660aa156da460ee2e55ebc99183.zip
Change how Cairo is presented to Lua scripts.
Makes the whole thing a bit more stable and less weird.
Diffstat (limited to 'share/library/Misc')
-rw-r--r--share/library/Misc/cell.lua18
-rw-r--r--share/library/Misc/ground.lua18
-rw-r--r--share/library/Misc/junction.lua4
-rw-r--r--share/library/Misc/lamp.lua30
-rw-r--r--share/library/Misc/meters.lua44
-rw-r--r--share/library/Misc/signs.lua16
-rw-r--r--share/library/Misc/switch.lua14
-rw-r--r--share/library/Misc/terminal.lua8
-rw-r--r--share/library/Misc/voltage-source.lua24
9 files changed, 88 insertions, 88 deletions
diff --git a/share/library/Misc/cell.lua b/share/library/Misc/cell.lua
index 8a6a575..541e44c 100644
--- a/share/library/Misc/cell.lua
+++ b/share/library/Misc/cell.lua
@@ -17,20 +17,20 @@ local terminals = {{-1, 0}, {1, 0}}
-- Rendering
local render = function (cr)
-- The vertical lines
- cr.move_to (-0.2, -1)
- cr.line_to (-0.2, 1)
+ cr:move_to (-0.2, -1)
+ cr:line_to (-0.2, 1)
- cr.move_to (0.2, -2)
- cr.line_to (0.2, 2)
+ cr:move_to (0.2, -2)
+ cr:line_to (0.2, 2)
-- The terminals
- cr.move_to (-1, 0)
- cr.line_to (-0.2, 0)
+ cr:move_to (-1, 0)
+ cr:line_to (-0.2, 0)
- cr.move_to (0.2, 0)
- cr.line_to (1, 0)
+ cr:move_to (0.2, 0)
+ cr:line_to (1, 0)
- cr.stroke ()
+ cr:stroke ()
end
-- Register the symbol
diff --git a/share/library/Misc/ground.lua b/share/library/Misc/ground.lua
index 6d20b57..2209718 100644
--- a/share/library/Misc/ground.lua
+++ b/share/library/Misc/ground.lua
@@ -17,20 +17,20 @@ local terminals = {{0, -1}}
-- Rendering
local render = function (cr)
-- The vertical line
- cr.move_to (0, -1)
- cr.line_to (0, 0.5)
+ cr:move_to (0, -1)
+ cr:line_to (0, 0.5)
-- The horizontal lines
- cr.move_to (-1, 0.5)
- cr.line_to (1, 0.5)
+ cr:move_to (-1, 0.5)
+ cr:line_to (1, 0.5)
- cr.move_to (-0.75, 1.1)
- cr.line_to (0.75, 1.1)
+ cr:move_to (-0.75, 1.1)
+ cr:line_to (0.75, 1.1)
- cr.move_to (-0.5, 1.7)
- cr.line_to (0.5, 1.7)
+ cr:move_to (-0.5, 1.7)
+ cr:line_to (0.5, 1.7)
- cr.stroke ()
+ cr:stroke ()
end
-- Register the symbol
diff --git a/share/library/Misc/junction.lua b/share/library/Misc/junction.lua
index 75fbafb..c7c399b 100644
--- a/share/library/Misc/junction.lua
+++ b/share/library/Misc/junction.lua
@@ -17,8 +17,8 @@ local terminals = {}
-- Rendering
local render = function (cr)
-- The disk
- cr.arc (0, 0, 0.3, 0, math.pi * 2)
- cr.fill ()
+ cr:arc (0, 0, 0.3, 0, math.pi * 2)
+ cr:fill ()
end
-- Register the symbol
diff --git a/share/library/Misc/lamp.lua b/share/library/Misc/lamp.lua
index f543bde..d6dd411 100644
--- a/share/library/Misc/lamp.lua
+++ b/share/library/Misc/lamp.lua
@@ -17,29 +17,29 @@ local terminals = {{-2, 0}, {2, 0}}
-- Rendering
local render = function (cr)
-- The circle
- cr.save ()
+ cr:save ()
- cr.arc (0, 0, 1, 0, 2 * math.pi)
- cr.stroke_preserve ()
- cr.clip ()
+ cr:arc (0, 0, 1, 0, 2 * math.pi)
+ cr:stroke_preserve ()
+ cr:clip ()
- cr.move_to (-1, -1)
- cr.line_to (1, 1)
+ cr:move_to (-1, -1)
+ cr:line_to (1, 1)
- cr.move_to (1, -1)
- cr.line_to (-1, 1)
+ cr:move_to (1, -1)
+ cr:line_to (-1, 1)
- cr.stroke ()
- cr.restore ()
+ cr:stroke ()
+ cr:restore ()
-- The terminals
- cr.move_to (-2, 0)
- cr.line_to (-1, 0)
+ cr:move_to (-2, 0)
+ cr:line_to (-1, 0)
- cr.move_to (1, 0)
- cr.line_to (2, 0)
+ cr:move_to (1, 0)
+ cr:line_to (2, 0)
- cr.stroke ()
+ cr:stroke ()
end
-- Register the symbol
diff --git a/share/library/Misc/meters.lua b/share/library/Misc/meters.lua
index 55b6e28..1fb0394 100644
--- a/share/library/Misc/meters.lua
+++ b/share/library/Misc/meters.lua
@@ -35,45 +35,45 @@ local terminals = {{-2, 0}, {2, 0}, {0, -2}, {0, 2}}
-- Rendering
local render_A = function (cr)
-- The circle
- cr.arc (0, 0, 2, 0, math.pi * 2)
+ cr:arc (0, 0, 2, 0, math.pi * 2)
-- The letter A
- cr.move_to (-0.4, 0.5)
- cr.line_to (0, -0.5)
- cr.line_to (0.4, 0.5)
+ cr:move_to (-0.4, 0.5)
+ cr:line_to (0, -0.5)
+ cr:line_to (0.4, 0.5)
- cr.move_to (-0.3, 0.25)
- cr.line_to (0.3, 0.25)
+ cr:move_to (-0.3, 0.25)
+ cr:line_to (0.3, 0.25)
- cr.stroke ()
+ cr:stroke ()
end
local render_V = function (cr)
-- The circle
- cr.arc (0, 0, 2, 0, math.pi * 2)
+ cr:arc (0, 0, 2, 0, math.pi * 2)
-- The letter V
- cr.move_to (-0.4, -0.5)
- cr.line_to (0, 0.5)
- cr.line_to (0.4, -0.5)
+ cr:move_to (-0.4, -0.5)
+ cr:line_to (0, 0.5)
+ cr:line_to (0.4, -0.5)
- cr.stroke ()
+ cr:stroke ()
end
local render_ohm = function (cr)
-- The circle
- cr.arc (0, 0, 2, 0, math.pi * 2)
+ cr:arc (0, 0, 2, 0, math.pi * 2)
-- The capital letter omega
- cr.move_to (-0.5, 0.5)
- cr.line_to (-0.15, 0.5)
- cr.curve_to (-0.15, 0.5, -0.4, 0.3, -0.4, 0)
- cr.curve_to (-0.4, -0.25, -0.25, -0.5, 0, -0.5)
- cr.curve_to (0.25, -0.5, 0.4, -0.25, 0.4, 0)
- cr.curve_to (0.4, 0.3, 0.15, 0.5, 0.15, 0.5)
- cr.line_to (0.5, 0.5)
-
- cr.stroke ()
+ cr:move_to (-0.5, 0.5)
+ cr:line_to (-0.15, 0.5)
+ cr:curve_to (-0.15, 0.5, -0.4, 0.3, -0.4, 0)
+ cr:curve_to (-0.4, -0.25, -0.25, -0.5, 0, -0.5)
+ cr:curve_to (0.25, -0.5, 0.4, -0.25, 0.4, 0)
+ cr:curve_to (0.4, 0.3, 0.15, 0.5, 0.15, 0.5)
+ cr:line_to (0.5, 0.5)
+
+ cr:stroke ()
end
-- Register the symbols
diff --git a/share/library/Misc/signs.lua b/share/library/Misc/signs.lua
index d2efe45..158d9b2 100644
--- a/share/library/Misc/signs.lua
+++ b/share/library/Misc/signs.lua
@@ -26,21 +26,21 @@ local terminals = {}
-- Rendering
local render_plus = function (cr)
-- The plus sign
- cr.move_to (0, -0.4)
- cr.line_to (0, 0.4)
+ cr:move_to (0, -0.4)
+ cr:line_to (0, 0.4)
- cr.move_to (-0.4, 0)
- cr.line_to (0.4, 0)
+ cr:move_to (-0.4, 0)
+ cr:line_to (0.4, 0)
- cr.stroke ()
+ cr:stroke ()
end
local render_minus = function (cr)
-- The minus sign
- cr.move_to (-0.4, 0)
- cr.line_to (0.4, 0)
+ cr:move_to (-0.4, 0)
+ cr:line_to (0.4, 0)
- cr.stroke ()
+ cr:stroke ()
end
-- Register the symbols
diff --git a/share/library/Misc/switch.lua b/share/library/Misc/switch.lua
index 2cae086..2d95b6b 100644
--- a/share/library/Misc/switch.lua
+++ b/share/library/Misc/switch.lua
@@ -17,17 +17,17 @@ local terminals = {{-2, 0}, {2, 0}}
-- Rendering
local render = function (cr)
-- The switch contact
- cr.move_to (1.3, -1.3)
- cr.line_to (-1, 0)
+ cr:move_to (1.3, -1.3)
+ cr:line_to (-1, 0)
-- The terminals
- cr.move_to (-2, 0)
- cr.line_to (-1, 0)
+ cr:move_to (-2, 0)
+ cr:line_to (-1, 0)
- cr.move_to (1, 0)
- cr.line_to (2, 0)
+ cr:move_to (1, 0)
+ cr:line_to (2, 0)
- cr.stroke ()
+ cr:stroke ()
end
-- Register the symbol
diff --git a/share/library/Misc/terminal.lua b/share/library/Misc/terminal.lua
index 3d31537..4bc2f2f 100644
--- a/share/library/Misc/terminal.lua
+++ b/share/library/Misc/terminal.lua
@@ -17,13 +17,13 @@ local terminals = {{-1, 0}}
-- Rendering
local render = function (cr)
-- The circle
- cr.arc (0, 0, 0.3, 0, math.pi * 2)
+ cr:arc (0, 0, 0.3, 0, math.pi * 2)
-- The contact
- cr.move_to (-1, 0)
- cr.line_to (-0.3, 0)
+ cr:move_to (-1, 0)
+ cr:line_to (-0.3, 0)
- cr.stroke ()
+ cr:stroke ()
end
-- Register the symbol
diff --git a/share/library/Misc/voltage-source.lua b/share/library/Misc/voltage-source.lua
index 456310b..9003364 100644
--- a/share/library/Misc/voltage-source.lua
+++ b/share/library/Misc/voltage-source.lua
@@ -26,35 +26,35 @@ local terminals = {{-2, 0}, {2, 0}, {0, -2}, {0, 2}}
-- Rendering
local render = function (cr)
-- The circle
- cr.arc (0, 0, 2, 0, math.pi * 2)
+ cr:arc (0, 0, 2, 0, math.pi * 2)
- cr.stroke ()
+ cr:stroke ()
end
local render_ac = function (cr)
render (cr)
-- The AC symbol
- cr.move_to (-1, 0.25)
- cr.curve_to (-0.4, -1.5, 0.4, 1.5, 1, -0.25)
+ cr:move_to (-1, 0.25)
+ cr:curve_to (-0.4, -1.5, 0.4, 1.5, 1, -0.25)
- cr.stroke ()
+ cr:stroke ()
end
local render_dc = function (cr)
render (cr)
-- The DC symbol
- cr.move_to (-1, -0.25)
- cr.line_to (1, -0.25)
+ cr:move_to (-1, -0.25)
+ cr:line_to (1, -0.25)
- cr.move_to (-1, 0.25)
- cr.line_to (-0.2, 0.25)
+ cr:move_to (-1, 0.25)
+ cr:line_to (-0.2, 0.25)
- cr.move_to (0.2, 0.25)
- cr.line_to (1, 0.25)
+ cr:move_to (0.2, 0.25)
+ cr:line_to (1, 0.25)
- cr.stroke ()
+ cr:stroke ()
end
-- Register the symbols