summaryrefslogtreecommitdiff
path: root/dalos-framebuffer.lua
blob: b3b3706851139fcac340e97956a5278e678dbd81 (plain)
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
load "iupe-dbuffer.lua"

dalosp.framebuffer = {   
    get_settings = function (self)
        return { }
    end,
    
    input_change = function (self)
        local h = self:get_linked_input(1)
        
        if h then
        else
        end
    end,
    
    activate = function (self)
        self.extra.dlg:show()
    end,
    
    configure = function (self)
        dalosp.object.default_configure(self)
    end,
    
    create = function (d, tab, settings)
        tab.ninputs = 2
        tab.noutputs = 0
        tab.otype = dalos.objtype.LUA_VIEWER
        tab.activate = dalosp.framebuffer.activate
        tab.configure = dalosp.framebuffer.configure
        tab.input_change = dalosp.framebuffer.input_change
        tab.default_name = "Framebuffer"
        tab.ntype = "Framebuffer"
        tab.get_settings = dalosp.framebuffer.get_settings
        local extra = { }
        
        local obj = dalos.object(d, tab, extra)

        local fb = iup.canvas {
            expand = "Yes",
            font = "Courier, 8",
            action = iupep.dbuffer.action,
            draw = dalos.framebuffer.draw,
        }
        local dlg = iup.dialog {
            fb,
            size = "320x200",
            title = obj.name,
            shrink = "Yes",
        }
        extra.dlg = dlg
        extra.fb = fb
        
        return obj
    end,
}

dalos.framebuffer = dalosp.framebuffer.create
dalos:register_obj("Framebuffer", dalos.framebuffer, "Basic Viewers")