From 36ba3f639e337cac041a192ac1b67039f20aa747 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Tue, 3 Jan 2012 21:34:35 -0200 Subject: [PATCH] add lua and otml syntax highlighting spec for usage with kate --- modules/core_scripts/effects.lua | 4 +- modules/core_scripts/hotkeys.lua | 6 + modules/core_styles/styles/checkboxes.otui | 3 +- tools/katepart-syntax/README | 6 + tools/katepart-syntax/lua.xml | 379 +++++++++++++++++++++ tools/katepart-syntax/otml.xml | 38 +++ 6 files changed, 432 insertions(+), 4 deletions(-) create mode 100644 modules/core_scripts/hotkeys.lua create mode 100644 tools/katepart-syntax/README create mode 100644 tools/katepart-syntax/lua.xml create mode 100644 tools/katepart-syntax/otml.xml diff --git a/modules/core_scripts/effects.lua b/modules/core_scripts/effects.lua index b92307a8..621f737c 100644 --- a/modules/core_scripts/effects.lua +++ b/modules/core_scripts/effects.lua @@ -6,7 +6,7 @@ function Effects.fadeIn(widget, time, elapsed) widget:setOpacity(math.min((255*elapsed)/time, 255)) if elapsed < time then scheduleEvent(function() - GFX.fadeIn(widget, time, elapsed + 30) + Effects.fadeIn(widget, time, elapsed + 30) end, 30) end end @@ -17,7 +17,7 @@ function Effects.fadeOut(widget, time, elapsed) widget:setOpacity((255*(time - elapsed))/time) if elapsed < time then scheduleEvent(function() - GFX.fadeOut(widget, time, elapsed + 30) + Effects.fadeOut(widget, time, elapsed + 30) end, 30) else widget:destroy() diff --git a/modules/core_scripts/hotkeys.lua b/modules/core_scripts/hotkeys.lua new file mode 100644 index 00000000..9c609c4b --- /dev/null +++ b/modules/core_scripts/hotkeys.lua @@ -0,0 +1,6 @@ +Hotkeys = {} + +function Hotkeys.bindKey(keyDesc, func) + +end + diff --git a/modules/core_styles/styles/checkboxes.otui b/modules/core_styles/styles/checkboxes.otui index bf1171e9..0d098bcb 100644 --- a/modules/core_styles/styles/checkboxes.otui +++ b/modules/core_styles/styles/checkboxes.otui @@ -46,7 +46,7 @@ ColorBox < UICheckBox image: source: /core_styles/images/colorbox.png coords: 0 0 16 16 - + ButtonBox < UICheckBox font: verdana-11px-antialised background-color: white @@ -74,4 +74,3 @@ ButtonBox < UICheckBox $disabled: color: #f0ad4d88 background-color: #ffffff88 - diff --git a/tools/katepart-syntax/README b/tools/katepart-syntax/README new file mode 100644 index 00000000..3dc38736 --- /dev/null +++ b/tools/katepart-syntax/README @@ -0,0 +1,6 @@ +Syntax for OTML files for kate/kwrite/kdevelop +Place the xml files in $HOME/.kde4/share/apps/katepart/syntax/ + +After installing the files to go in "Configure Kate->Editor Component->Open/Save->Mode & Filetypes" +select "Markup/OTML" and add "kate: space-indent on; indent-width 2;" in Variables field, +do the same for "Scripts/Lua". \ No newline at end of file diff --git a/tools/katepart-syntax/lua.xml b/tools/katepart-syntax/lua.xml new file mode 100644 index 00000000..038362db --- /dev/null +++ b/tools/katepart-syntax/lua.xml @@ -0,0 +1,379 @@ + + + + + + and + function + in + local + not + or + + + break + do + else + elseif + end + for + if + repeat + return + then + until + while + + + nil + false + true + + + string.byte string.char + string.find string.len + string.lower string.rep + string.sub string.upper + string.format string.gfind + string.gsub table.concat + table.getn table.sort + table.insert table.remove + table.setn math.abs + math.sin math.cos + math.tan math.asin + math.acos math.atan + math.atan2 math.ceil + math.floor math.mod + math.frexp math.ldexp + math.squrt math.min + math.max math.log + math.log10 math.exp + math.deg math.rad + math.random math.randomseed + io.close io.flush + io.input io.lines + io.open io.output + io.read io.stderr + io.stdin io.stdout + io.tmpfile io.write + os.clock os.date + os.difftime os.execute + os.exit os.getenv + os.remove os.rename + os.setlocale os.time + os.tmpname debug.getinfo + debug.getlocal debug.setlocal + debug.sethook debug.gethook + assert collectgarbage + dofile error + next print + rawget rawset + tonumber tostring + type _ALERT + _ERRORMESSAGE call + getmetatable gcinfo + ipairs loadfile + loadstring pairs + pcall require + LUA_PATH setmetatable + _LOADED _VERSION + gettagmethod globals + newtag setglobal + settag settagmethod + setlinehook getglobals + copytagmethods dostring + getglobal tag + setglobals unpack + exit readfrom + writeto appendto + read write + getinfo getlocal + setlocal setcallhook + tinsert tremove + flush seek + setlocale execute + remove rename + tmpname getenv + getn sort + table.foreach table.foreachi + foreach foreachi + abs sin + cos tan + asin acos + atan atan2 + ceil floor + mod frexp + ldexp squrt + min max + log log10 + exp deg + rad random + randomseed strlen + strsub strlower + strupper strchar + strrep ascii + strbyte format + strfind gsub + openfile closefile + date clock + + string.trim string.starts + string.split + table.dump table.copy + table.selective_copy table.merge + toboolean + + + connect + extends + print + fatal + + scheduleEvent + addEvent + removeEvent + + displayUI + createWidget + + + AnchorNone + AnchorTop + AnchorBottom + AnchorLeft + AnchorRight + AnchorVerticalCenter + AnchorHorizontalCenter + + LogDebug + LogInfo + LogWarning + LogError + LogFatal + + ActiveFocusReason + + KeyUnknown + KeyEscape + KeyTab + KeyBackspace + KeyReturn + KeyEnter + KeyInsert + KeyDelete + KeyPause + KeyPrintScreen + KeyHome + KeyEnd + KeyPageUp + KeyPageDown + KeyUp + KeyDown + KeyLeft + KeyRight + KeyNumLock + KeyScrollLock + KeyCapsLock + KeyCtrl + KeyShift + KeyAlt + KeyAltGr + KeyMeta + KeyMenu + KeySpace + KeyExclamation + KeyQuote + KeyNumberSign + KeyDollar + KeyPercent + KeyAmpersand + KeyApostrophe + KeyLeftParen + KeyRightParen + KeyAsterisk + KeyPlus + KeyComma + KeyMinus + KeyPeriod + KeySlash + Key0 + Key1 + Key2 + Key3 + Key4 + Key5 + Key6 + Key7 + Key8 + Key9 + KeyColon + KeySemicolon + KeyLess + KeyEqual + KeyGreater + KeyQuestion + KeyAtSign + KeyA + KeyB + KeyC + KeyD + KeyE + KeyF + KeyG + KeyH + KeyI + KeyJ + KeyK + KeyL + KeyM + KeyN + KeyO + KeyP + KeyQ + KeyR + KeyS + KeyT + KeyU + KeyV + KeyW + KeyX + KeyY + KeyZ + KeyLeftBracket + KeyBackslash + KeyRightBracket + KeyCaret + KeyUnderscore + KeyGrave + KeyLeftCurly + KeyBar + KeyRightCurly + KeyTilde + KeyF1 + KeyF2 + KeyF3 + KeyF4 + KeyF5 + KeyF6 + KeyF7 + KeyF8 + KeyF9 + KeyF10 + KeyF11 + KeyF12 + + KeyboardNoModifier + KeyboardCtrlModifier + KeyboardAltModifier + KeyboardShiftModifier + + MouseNoButton + MouseLeftButton + MouseRightButton + MouseMidButton + + + TODO + FIXME + NOTE + + + table.foreach table.foreachi + foreach foreachi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/katepart-syntax/otml.xml b/tools/katepart-syntax/otml.xml new file mode 100644 index 00000000..d762126e --- /dev/null +++ b/tools/katepart-syntax/otml.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +