From dec3f7e6c7e5b7ed5ef94b68456bd267ea62143b Mon Sep 17 00:00:00 2001
From: Pixel <pixel@nobis-crew.org>
Date: Mon, 28 Dec 2009 17:16:21 +0100
Subject: Adding framebuffer skeleton.

---
 dalos-framebuffer.lua | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
 dalos.lua             |  5 ++++-
 2 files changed, 58 insertions(+), 1 deletion(-)
 create mode 100644 dalos-framebuffer.lua

diff --git a/dalos-framebuffer.lua b/dalos-framebuffer.lua
new file mode 100644
index 0000000..ab3e593
--- /dev/null
+++ b/dalos-framebuffer.lua
@@ -0,0 +1,54 @@
+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"
+        }
+        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")
diff --git a/dalos.lua b/dalos.lua
index 68dd7a2..94a16e3 100644
--- a/dalos.lua
+++ b/dalos.lua
@@ -907,7 +907,9 @@ dalosp.object = {
     end,
     
     default_configure = function (self)
-        print "default configure"
+        local s, n = iup.GetParam("Change name", nil, "Name: %s\n", self.name)
+        
+        if s then self.name = n end
     end,
     
     change_curinput = function (self, delta)
@@ -1087,6 +1089,7 @@ load "dalos-luafilter.lua"
 load "dalos-struct.lua"
 load "dalos-textview.lua"
 load "dalos-cd.lua"
+load "dalos-framebuffer.lua"
 
 ----------------
 
-- 
cgit v1.2.3