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()
|
2019-10-13 03:01:18 +02:00
|
|
|
obj._private = {}
|
|
|
|
|
|
|
|
-- Deprecated.
|
|
|
|
obj.data = obj._private
|
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
|
|
|
}
|
|
|
|
|
2019-03-08 19:40:21 +01:00
|
|
|
obj._connect_signal = obj.connect_signal
|
|
|
|
obj._disconnect_signal = obj.disconnect_signal
|
2016-03-19 09:57:37 +01:00
|
|
|
|
|
|
|
function obj.connect_signal(name, func)
|
|
|
|
return obj._connect_signal(obj, name, func)
|
|
|
|
end
|
|
|
|
|
2019-03-08 19:40:21 +01:00
|
|
|
function obj.disconnect_signal(name, func)
|
|
|
|
return obj._disconnect_signal(obj, name, func)
|
|
|
|
end
|
|
|
|
|
2016-03-19 09:57:37 +01:00
|
|
|
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
|
|
|
|
|
2019-03-08 19:55:55 +01:00
|
|
|
local function forward_class(obj, class)
|
|
|
|
assert(obj.emit_signal)
|
|
|
|
local es = obj.emit_signal
|
|
|
|
function obj:emit_signal(name, ...)
|
|
|
|
es(obj, name, ...)
|
|
|
|
class.emit_signal(name, obj, ...)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-03-19 09:57:37 +01:00
|
|
|
local awesome = _shim_fake_class()
|
|
|
|
awesome._shim_fake_class = _shim_fake_class
|
2019-03-08 19:55:55 +01:00
|
|
|
awesome._forward_class = forward_class
|
2016-03-19 09:57:37 +01:00
|
|
|
|
|
|
|
-- 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
|
|
|
|
|
2019-07-18 06:19:31 +02:00
|
|
|
function awesome.xrdb_get_value()
|
|
|
|
return nil
|
|
|
|
end
|
2020-08-31 11:11:01 +02:00
|
|
|
|
|
|
|
function awesome.spawn() end
|
2019-07-18 06:19:31 +02:00
|
|
|
|
2017-03-03 00:54:10 +01:00
|
|
|
-- Always show deprecated messages
|
2020-02-03 00:57:26 +01:00
|
|
|
awesome.version = "v9999"
|
|
|
|
awesome.api_level = 9999
|
2017-03-03 00:54:10 +01:00
|
|
|
|
2018-09-30 08:12:57 +02:00
|
|
|
-- SVG are composited. Without it we need a root surface
|
|
|
|
awesome.composite_manager_running = true
|
|
|
|
|
2019-01-21 05:04:29 +01:00
|
|
|
awesome._modifiers = {
|
|
|
|
Shift = {
|
|
|
|
{keycode = 50 , keysym = 'Shift_L' },
|
|
|
|
{keycode = 62 , keysym = 'Shift_R' },
|
|
|
|
},
|
|
|
|
Lock = {},
|
|
|
|
Control = {
|
|
|
|
{keycode = 37 , keysym = 'Control_L' },
|
|
|
|
{keycode = 105, keysym = 'Control_R' },
|
|
|
|
},
|
|
|
|
Mod1 = {
|
|
|
|
{keycode = 64 , keysym = 'Alt_L' },
|
|
|
|
{keycode = 108, keysym = 'Alt_R' },
|
|
|
|
},
|
|
|
|
Mod2 = {
|
|
|
|
{keycode = 77 , keysym = 'Num_Lock' },
|
|
|
|
},
|
|
|
|
Mod3 = {},
|
|
|
|
Mod4 = {
|
|
|
|
{keycode = 133, keysym = 'Super_L' },
|
|
|
|
{keycode = 134, keysym = 'Super_R' },
|
|
|
|
},
|
|
|
|
Mod5 = {
|
|
|
|
{keycode = 203, keysym = 'Mode_switch'},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-06-14 09:41:25 +02:00
|
|
|
function awesome._get_key_name(key)
|
|
|
|
return key
|
|
|
|
end
|
|
|
|
|
2019-01-21 05:04:29 +01:00
|
|
|
awesome._active_modifiers = {}
|
|
|
|
|
2016-03-19 09:57:37 +01:00
|
|
|
return awesome
|
|
|
|
|
|
|
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|