diff options
Diffstat (limited to 'scripts/gen_iface.lua')
-rwxr-xr-x | scripts/gen_iface.lua | 73 |
1 files changed, 35 insertions, 38 deletions
diff --git a/scripts/gen_iface.lua b/scripts/gen_iface.lua index 917ffeae..62f972f8 100755 --- a/scripts/gen_iface.lua +++ b/scripts/gen_iface.lua @@ -30,52 +30,50 @@ out = out..[[ -- Scintilla constants. -- @class table -- @name constants -constants = { -]] +constants = {]] -- {"constant", value} for item in constants:sub(2, -2):gmatch('%b{}') do local name, value = item:match('^{"(.-)",(.-)}') if not name:find('^IDM_') then if name == 'SC_MASK_FOLDERS' then value = '-33554432' end - local line = (" %s = %s,\n"):format(name, value) + local line = (" %s = %s,"):format(name, value) out = out..line end end -out = out..[[ - SCN_STYLENEEDED = 2000, - SCN_CHARADDED = 2001, - SCN_SAVEPOINTREACHED = 2002, - SCN_SAVEPOINTLEFT = 2003, - SCN_MODIFYATTEMPTRO = 2004, - SCN_KEY = 2005, - SCN_DOUBLECLICK =2006, - SCN_UPDATEUI = 2007, - SCN_MODIFIED = 2008, - SCN_MACRORECORD = 2009, - SCN_MARGINCLICK = 2010, - SCN_NEEDSHOWN = 2011, - SCN_PAINTED = 2013, - SCN_USERLISTSELECTION = 2014, - SCN_URIDROPPED = 2015, - SCN_DWELLSTART = 2016, - SCN_DWELLEND = 2017, - SCN_ZOOM = 2018, - SCN_HOTSPOTCLICK = 2019, - SCN_HOTSPOTDOUBLECLICK = 2020, - SCN_CALLTIPCLICK = 2021, - SCN_AUTOCSELECTION = 2022, - SCN_INDICATORCLICK = 2023, - SCN_INDICATORRELEASE = 2024, -]] -out = out..'}\n\n' + +out = out..string.gsub([[ +SCN_STYLENEEDED = 2000, +SCN_CHARADDED = 2001, +SCN_SAVEPOINTREACHED = 2002, +SCN_SAVEPOINTLEFT = 2003, +SCN_MODIFYATTEMPTRO = 2004, +SCN_KEY = 2005, +SCN_DOUBLECLICK =2006, +SCN_UPDATEUI = 2007, +SCN_MODIFIED = 2008, +SCN_MACRORECORD = 2009, +SCN_MARGINCLICK = 2010, +SCN_NEEDSHOWN = 2011, +SCN_PAINTED = 2013, +SCN_USERLISTSELECTION = 2014, +SCN_URIDROPPED = 2015, +SCN_DWELLSTART = 2016, +SCN_DWELLEND = 2017, +SCN_ZOOM = 2018, +SCN_HOTSPOTCLICK = 2019, +SCN_HOTSPOTDOUBLECLICK = 2020, +SCN_CALLTIPCLICK = 2021, +SCN_AUTOCSELECTION = 2022, +SCN_INDICATORCLICK = 2023, +SCN_INDICATORRELEASE = 2024,]], '\n', ' ') +out = out..' }\n\n' out = out..[[ --- -- Scintilla functions. -- @class table -- @name functions -functions = { -]] +functions = {]] -- {"function", msg_id, iface_*, {iface_*, iface_*}} for item in functions:sub(2, -2):gmatch('%b{}') do local name, msg_id, rt_type, p1_type, p2_type = @@ -83,19 +81,18 @@ for item in functions:sub(2, -2):gmatch('%b{}') do name = name:gsub('([a-z])([A-Z])', '%1_%2') name = name:gsub('([A-Z])([A-Z][a-z])', '%1_%2') name = name:lower() - local line = (" %s = {%d, %d, %d, %d},\n"):format( + local line = (" %s = {%d, %d, %d, %d},"):format( name, msg_id, types[rt_type], types[p1_type], types[p2_type]) out = out..line end -out = out..'}\n\n' +out = out..' }\n\n' out = out..[[ --- -- Scintilla properties. -- @class table -- @name properties -properties = { -]] +properties = {]] -- {"property", get_id, set_id, rt_type, p1_type} for item in properties:sub(2, -2):gmatch('%b{}') do local name, get_id, set_id, rt_type, p1_type = @@ -103,11 +100,11 @@ for item in properties:sub(2, -2):gmatch('%b{}') do name = name:gsub('([a-z])([A-Z])', '%1_%2') name = name:gsub('([A-Z])([A-Z][a-z])', '%1_%2') name = name:lower() - local line = (" %s = {%d, %d, %d, %d},\n"):format( + local line = (" %s = {%d, %d, %d, %d},"):format( name, get_id, set_id, types[rt_type], types[p1_type]) out = out..line end -out = out..'}\n' +out = out..' }\n' f = io.open('../core/iface.lua', 'w') f:write(out) |