shims: Add support the new .data property

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-09-30 11:03:56 +02:00
parent 9566defa93
commit f9775b91de
6 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,7 @@ local gears_obj = require("gears.object")
-- handlers.
local function _shim_fake_class()
local obj = gears_obj()
obj.data = {}
local meta = {
__index = function()end,

View File

@ -1,3 +1,4 @@
return function() return {
data = {},
connect_signal = function() end
} end

View File

@ -17,6 +17,7 @@ end
-- Create fake clients to move around
function client.gen_fake(args)
local ret = gears_obj()
ret.data = {}
ret.type = "normal"
ret.valid = true
ret.size_hints = {}

View File

@ -4,6 +4,7 @@ local drawin, meta = awesome._shim_fake_class()
local function new_drawin(_, args)
local ret = gears_obj()
ret.data = {}
for k, v in pairs(args) do
rawset(ret, k, v)

View File

@ -6,6 +6,7 @@ screen.count = 1
local function create_screen(args)
local s = gears_obj()
s.data = {}
-- Copy the geo in case the args are mutated
local geo = {

View File

@ -5,6 +5,7 @@ local tag, meta = awesome._shim_fake_class()
local function new_tag(_, args)
local ret = gears_obj()
ret.data = {}
ret.name = args.name or "test"
ret.activated = true
ret.selected = true