summaryrefslogtreecommitdiff
path: root/dalos-hexview.lua
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-12-20 16:38:06 +0100
committerPixel <pixel@nobis-crew.org>2009-12-20 16:38:06 +0100
commit775500b709be0d14ad89f63970bf971d68c89407 (patch)
tree0fcff665cf2a8b4df43b21f0ca95f911e71c1376 /dalos-hexview.lua
parentcb7c8031ced6e9a393e8bdc3f409687741ef9feb (diff)
Introducing serialization / deserialization mechanism.
Diffstat (limited to 'dalos-hexview.lua')
-rw-r--r--dalos-hexview.lua32
1 files changed, 31 insertions, 1 deletions
diff --git a/dalos-hexview.lua b/dalos-hexview.lua
index 381ffd4..f3111d7 100644
--- a/dalos-hexview.lua
+++ b/dalos-hexview.lua
@@ -34,6 +34,22 @@ dalosp.hexview = {
configure = function (self)
end,
+ get_settings = function (self)
+ local hv = extra.hv
+ local r = {
+ mcursor = hv.mcursor + 0,
+ kcursor = hv.kcursor + 0,
+ markers = {},
+ filecursor = hv.filecursor + 0,
+ nbbytes = hv.nbbytes + 0,
+ nblines = hv.nblines + 0,
+ }
+ for i = 1, 10 do
+ rmarkers[i] = hv.markers[i] + 0
+ end
+ return r
+ end,
+
output_change = function (self, ind)
self.watchees[ind] = self.outputs[ind] and true or false
end,
@@ -87,12 +103,13 @@ dalosp.hexview = {
end
end,
- create = function (d, tab)
+ create = function (d, tab, settings)
tab.otype = dalos.objtype.LUA_FILTER
tab.activate = dalosp.hexview.activate
tab.input_change = dalosp.hexview.input_change
tab.output_change = dalosp.hexview.output_change
tab.configure = dalosp.hexview.configure
+ tab.get_settings = dalosp.get_settings
tab.ninputs = 1
tab.noutputs = 12
tab.default_name = "Hexview"
@@ -114,6 +131,19 @@ dalosp.hexview = {
obj.update_houtput = dalosp.hexview.update_houtput
for i = 1, 12 do obj.oldcursors[i] = -1 end
+ if settings then
+ if settings.markers then
+ for i = 1, 10 do
+ hv.markers[i] = settings.markers[i]
+ end
+ end
+ hv.mcursor = settings.mcursor
+ hv.kcursor = settings.kcursor
+ hv.filecursor = settings.filecursor
+ hv.nbbytes = settings.nbbytes
+ hv.nblines = settings.nblines
+ end
+
hv:registercb(dalosp.hexview.dalos_hv_cb, obj)
return obj