2016-05-03 05:56:08 +02:00
|
|
|
local gears_obj = require("gears.object")
|
|
|
|
|
|
|
|
local drawin, meta = awesome._shim_fake_class()
|
2017-05-15 08:24:52 +02:00
|
|
|
local drawins = setmetatable({}, {__mode="v"})
|
2016-05-03 05:56:08 +02:00
|
|
|
|
|
|
|
local function new_drawin(_, args)
|
|
|
|
local ret = gears_obj()
|
2017-05-29 10:53:49 +02:00
|
|
|
ret.data = {drawable = gears_obj()}
|
2016-05-03 05:56:08 +02:00
|
|
|
|
2017-05-15 08:24:52 +02:00
|
|
|
ret.x=0
|
|
|
|
ret.y=0
|
|
|
|
ret.width=1
|
|
|
|
ret.height=1
|
|
|
|
|
|
|
|
ret.geometry = function(_, new)
|
|
|
|
new = new or {}
|
|
|
|
ret.x = new.x or ret.x
|
|
|
|
ret.y = new.y or ret.y
|
|
|
|
ret.width = new.width or ret.width
|
|
|
|
ret.height = new.height or ret.height
|
|
|
|
return {
|
|
|
|
x = ret.x,
|
|
|
|
y = ret.y,
|
|
|
|
width = ret.width,
|
|
|
|
height = ret.height
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
for _, k in pairs{ "buttons", "struts", "get_xproperty", "set_xproperty" } do
|
|
|
|
ret[k] = function() end
|
2016-05-03 05:56:08 +02:00
|
|
|
end
|
|
|
|
|
2017-05-15 08:24:52 +02:00
|
|
|
local md = setmetatable(ret, {
|
2016-12-27 21:39:08 +01:00
|
|
|
__index = function(...) return meta.__index(...) end,
|
|
|
|
__newindex = function(...) return meta.__newindex(...) end
|
|
|
|
})
|
2017-05-15 08:24:52 +02:00
|
|
|
|
|
|
|
for k, v in pairs(args) do
|
|
|
|
ret[k] = v
|
|
|
|
end
|
|
|
|
|
|
|
|
table.insert(drawins, md)
|
|
|
|
|
|
|
|
return md
|
|
|
|
end
|
|
|
|
|
|
|
|
function drawin.get()
|
|
|
|
return drawins
|
2016-05-03 05:56:08 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
return setmetatable(drawin, {
|
2016-12-27 21:39:08 +01:00
|
|
|
__call = new_drawin,
|
|
|
|
})
|
2016-05-03 05:56:08 +02:00
|
|
|
|
|
|
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|