2017-05-15 08:24:52 +02:00
|
|
|
local lgi = require("lgi")
|
2016-03-19 09:57:37 +01:00
|
|
|
local gears_obj = require("gears.object")
|
|
|
|
|
|
|
|
-- Emulate the C API classes. They differ from C API objects as connect_signal
|
|
|
|
-- doesn't take an object as first argument and they support fallback properties
|
|
|
|
-- handlers.
|
|
|
|
local function _shim_fake_class()
|
|
|
|
local obj = gears_obj()
|
2016-09-30 11:03:56 +02:00
|
|
|
obj.data = {}
|
2016-03-19 09:57:37 +01:00
|
|
|
|
|
|
|
local meta = {
|
|
|
|
__index = function()end,
|
2016-04-05 09:02:00 +02:00
|
|
|
__newindex = function()end,
|
2016-03-19 09:57:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
obj._connect_signal = obj.connect_signal
|
|
|
|
|
|
|
|
function obj.connect_signal(name, func)
|
|
|
|
return obj._connect_signal(obj, name, func)
|
|
|
|
end
|
|
|
|
|
|
|
|
function obj.set_index_miss_handler(handler)
|
|
|
|
meta.__index = handler
|
|
|
|
end
|
|
|
|
|
|
|
|
function obj.set_newindex_miss_handler(handler)
|
2016-04-05 09:02:00 +02:00
|
|
|
meta.__newindex = handler
|
2016-03-19 09:57:37 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function obj.emit_signal(name, c, ...)
|
|
|
|
local conns = obj._signals[name] or {strong={}}
|
|
|
|
for func in pairs(conns.strong) do
|
|
|
|
func(c, ...)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return obj, meta
|
|
|
|
end
|
|
|
|
|
|
|
|
local awesome = _shim_fake_class()
|
|
|
|
awesome._shim_fake_class = _shim_fake_class
|
|
|
|
|
|
|
|
-- Avoid c.screen = acreen.focused() to be called, all tests will fail
|
|
|
|
awesome.startup = true
|
|
|
|
|
|
|
|
function awesome.register_xproperty()
|
|
|
|
end
|
|
|
|
|
2018-07-24 23:08:10 +02:00
|
|
|
function awesome.xkb_get_group_names()
|
|
|
|
return "pc+us+inet(evdev)"
|
|
|
|
end
|
|
|
|
|
|
|
|
function awesome.xkb_get_layout_group()
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
|
2018-01-13 04:58:06 +01:00
|
|
|
awesome.load_image = lgi.cairo.ImageSurface.create_from_png
|
2017-05-15 08:24:52 +02:00
|
|
|
|
2018-01-13 04:58:06 +01:00
|
|
|
function awesome.pixbuf_to_surface(_, path)
|
|
|
|
return awesome.load_image(path)
|
2017-05-15 08:24:52 +02:00
|
|
|
end
|
|
|
|
|
2017-03-03 00:54:10 +01:00
|
|
|
-- Always show deprecated messages
|
|
|
|
awesome.version = "v9999"
|
|
|
|
|
2016-03-19 09:57:37 +01:00
|
|
|
return awesome
|
|
|
|
|
|
|
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|