aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/generators/gen_api_ui_events.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-02-02 21:27:09 +0100
committerGitHub <noreply@github.com>2019-02-02 21:27:09 +0100
commit79a0ea2bec7c4a1c82990c07c87098b87bc2a1da (patch)
treeffdf0820ab0b70622d58d40936ac6f0d9e2658fd /src/nvim/generators/gen_api_ui_events.lua
parentf89d0d8230f34dca49eddbea179d274955b572b9 (diff)
parent0f96a21e3fd6ba989e27a992e48c084dd02d8885 (diff)
downloadrneovim-79a0ea2bec7c4a1c82990c07c87098b87bc2a1da.tar.gz
rneovim-79a0ea2bec7c4a1c82990c07c87098b87bc2a1da.tar.bz2
rneovim-79a0ea2bec7c4a1c82990c07c87098b87bc2a1da.zip
Merge pull request #9530 from bfredl/pum_float
Implement popupmenu as a floating grid internally to reduce flicker
Diffstat (limited to 'src/nvim/generators/gen_api_ui_events.lua')
-rw-r--r--src/nvim/generators/gen_api_ui_events.lua30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/nvim/generators/gen_api_ui_events.lua b/src/nvim/generators/gen_api_ui_events.lua
index e76b601d8a..c8ab310b02 100644
--- a/src/nvim/generators/gen_api_ui_events.lua
+++ b/src/nvim/generators/gen_api_ui_events.lua
@@ -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)