mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
UI: add "compositor" layer to merge grids for TUI use in a correct way
Initially we will use this for the popupmenu, floating windows will follow soon NB: writedelay + compositor is weird, we need more flexible redraw introspection.
This commit is contained in:
@@ -25,6 +25,7 @@ local c_id = (
|
||||
local c_void = P('void')
|
||||
local c_param_type = (
|
||||
((P('Error') * fill * P('*') * fill) * Cc('error')) +
|
||||
C((P('const ') ^ -1) * (c_id) * (ws ^ 1) * P('*')) +
|
||||
(C(c_id) * (ws ^ 1))
|
||||
)
|
||||
local c_type = (C(c_void) * (ws ^ 1)) + c_param_type
|
||||
@@ -43,6 +44,7 @@ local c_proto = Ct(
|
||||
(fill * Cg((P('FUNC_API_REMOTE_ONLY') * Cc(true)), 'remote_only') ^ -1) *
|
||||
(fill * Cg((P('FUNC_API_REMOTE_IMPL') * Cc(true)), 'remote_impl') ^ -1) *
|
||||
(fill * Cg((P('FUNC_API_BRIDGE_IMPL') * Cc(true)), 'bridge_impl') ^ -1) *
|
||||
(fill * Cg((P('FUNC_API_COMPOSITOR_IMPL') * Cc(true)), 'compositor_impl') ^ -1) *
|
||||
fill * P(';')
|
||||
)
|
||||
|
||||
|
@@ -54,7 +54,7 @@ for i = 1, #events do
|
||||
ev = events[i]
|
||||
assert(ev.return_type == 'void')
|
||||
|
||||
if ev.since == nil then
|
||||
if ev.since == nil and not ev.noexport then
|
||||
print("Ui event "..ev.name.." lacks since field.\n")
|
||||
os.exit(1)
|
||||
end
|
||||
@@ -65,7 +65,7 @@ for i = 1, #events do
|
||||
write_signature(proto_output, ev, 'UI *ui')
|
||||
proto_output:write(';\n')
|
||||
|
||||
if not ev.remote_impl then
|
||||
if not ev.remote_impl and not ev.noexport then
|
||||
remote_output:write('static void remote_ui_'..ev.name)
|
||||
write_signature(remote_output, ev, 'UI *ui')
|
||||
remote_output:write('\n{\n')
|
||||
@@ -74,8 +74,7 @@ for i = 1, #events do
|
||||
remote_output:write('}\n\n')
|
||||
end
|
||||
|
||||
if not ev.bridge_impl then
|
||||
|
||||
if not ev.bridge_impl and not ev.noexport then
|
||||
send, argv, recv, recv_argv, recv_cleanup = '', '', '', '', ''
|
||||
argc = 1
|
||||
for j = 1, #ev.parameters do
|
||||
@@ -138,21 +137,36 @@ for i = 1, #events do
|
||||
call_output:write('\n{\n')
|
||||
if ev.remote_only then
|
||||
write_arglist(call_output, ev, false)
|
||||
call_output:write(' UI_LOG('..ev.name..', 0);\n')
|
||||
call_output:write(' UI_LOG('..ev.name..');\n')
|
||||
call_output:write(' ui_event("'..ev.name..'", args);\n')
|
||||
elseif ev.compositor_impl then
|
||||
call_output:write(' UI_CALL')
|
||||
write_signature(call_output, ev, '!ui->composed, '..ev.name..', ui', true)
|
||||
call_output:write(";\n")
|
||||
else
|
||||
call_output:write(' UI_CALL')
|
||||
write_signature(call_output, ev, ev.name, true)
|
||||
write_signature(call_output, ev, 'true, '..ev.name..', ui', true)
|
||||
call_output:write(";\n")
|
||||
end
|
||||
call_output:write("}\n\n")
|
||||
end
|
||||
|
||||
if ev.compositor_impl then
|
||||
call_output:write('void ui_composed_call_'..ev.name)
|
||||
write_signature(call_output, ev, '')
|
||||
call_output:write('\n{\n')
|
||||
call_output:write(' UI_CALL')
|
||||
write_signature(call_output, ev, 'ui->composed, '..ev.name..', ui', true)
|
||||
call_output:write(";\n")
|
||||
call_output:write("}\n\n")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
proto_output:close()
|
||||
call_output:close()
|
||||
remote_output:close()
|
||||
bridge_output:close()
|
||||
|
||||
-- don't expose internal attributes like "impl_name" in public metadata
|
||||
exported_attributes = {'name', 'parameters',
|
||||
@@ -168,7 +182,9 @@ for _,ev in ipairs(events) do
|
||||
p[1] = 'Dictionary'
|
||||
end
|
||||
end
|
||||
exported_events[#exported_events+1] = ev_exported
|
||||
if not ev.noexport then
|
||||
exported_events[#exported_events+1] = ev_exported
|
||||
end
|
||||
end
|
||||
|
||||
packed = mpack.pack(exported_events)
|
||||
|
Reference in New Issue
Block a user