Browse Source

Merge branch 'master' of github.com:silverkorn/Urho3D.

Yao Wei Tjong 姚伟忠 11 years ago
parent
commit
9248cdb19c

+ 22 - 0
Source/Engine/LuaScript/pkgs/ToCppHook.lua

@@ -1,3 +1,25 @@
+--
+-- Copyright (c) 2008-2014 the Urho3D project.
+--
+-- Permission is hereby granted, free of charge, to any person obtaining a copy
+-- of this software and associated documentation files (the "Software"), to deal
+-- in the Software without restriction, including without limitation the rights
+-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-- copies of the Software, and to permit persons to whom the Software is
+-- furnished to do so, subject to the following conditions:
+--
+-- The above copyright notice and this permission notice shall be included in
+-- all copies or substantial portions of the Software.
+--
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+-- THE SOFTWARE.
+--
+
 local toWrite = {}
 local toWrite = {}
 local currentString = ''
 local currentString = ''
 local out
 local out

+ 29 - 7
Source/Engine/LuaScript/pkgs/ToDoxHook.lua

@@ -1,10 +1,32 @@
-local classes = {}
-local enumerates = {}
-local globalConstants = {}
-local globalFunctions = {}
-local globalProperties = {}
-local currentClass = nil
-local currentFunction = nil
+--
+-- Copyright (c) 2008-2014 the Urho3D project.
+--
+-- Permission is hereby granted, free of charge, to any person obtaining a copy
+-- of this software and associated documentation files (the "Software"), to deal
+-- in the Software without restriction, including without limitation the rights
+-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-- copies of the Software, and to permit persons to whom the Software is
+-- furnished to do so, subject to the following conditions:
+--
+-- The above copyright notice and this permission notice shall be included in
+-- all copies or substantial portions of the Software.
+--
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+-- THE SOFTWARE.
+--
+
+classes = {}
+enumerates = {}
+globalConstants = {}
+globalFunctions = {}
+globalProperties = {}
+currentClass = nil
+currentFunction = nil
 
 
 function classClass:print(ident,close)
 function classClass:print(ident,close)
   local class = {}
   local class = {}

+ 1 - 126
Source/Engine/LuaScript/pkgs/ToZerobraneStudioHook.lua

@@ -27,94 +27,7 @@
      "interpreters" file with the filename (excluding it's lua extension) into the 
      "interpreters" file with the filename (excluding it's lua extension) into the 
      "api" table variable. ]]--
      "api" table variable. ]]--
 
 
-local classes = {}
-local enumerates = {}
-local globalConstants = {}
-local globalFunctions = {}
-local globalProperties = {}
-local currentClass = nil
-local currentFunction = nil
- 
-function classClass:print(ident,close)
-  local class = {}
-  class.name = self.name
-  class.base = self.base
-  class.lname = self.lname
-  class.type = self.type
-  class.btype = self.btype
-  class.ctype = self.ctype
- 
-  currentClass = class
-  local i = 1
-  while self[i] do
-    self[i]:print(ident.." ",",")
-    i = i + 1
-  end
-  currentClass = nil
- 
-  table.insert(classes, class)
-end
- 
-function classCode:print(ident,close)
-end
- 
-function classDeclaration:print(ident,close)
-  local declaration = {}
-  declaration.mod  = self.mod
-  declaration.type = self.type
-  declaration.ptr  = self.ptr
-  declaration.name = self.name
-  declaration.dim  = self.dim
-  declaration.def  = self.def
-  declaration.ret  = self.ret
- 
-  if currentFunction ~= nil then
-    if currentFunction.declarations == nil then
-      currentFunction.declarations = { declaration }
-    else
-      table.insert(currentFunction.declarations, declaration)
-    end
-  end
-end
- 
-function classEnumerate:print(ident,close)
-  local enumerate = {}
-  enumerate.name = self.name
- 
-  local i = 1
-  while self[i] do
-    if self[i] ~= "" then
-      if enumerate.values == nil then
-        enumerate.values = { self[i] }
-      else
-        table.insert(enumerate.values, self[i])
-      end
-    end
-    i = i + 1
-  end
- 
-  if enumerate.values ~= nil then
-    table.insert(enumerates, enumerate)
-  end
-end
-
-function deepCopy(t)
-  if type(t) ~= "table" then
-    return t
-  end
-
-  local mt = getmetatable(t)
-  local ret = {}
-  for k, v in pairs(t) do
-    if type(v) == "table" then
-      v = deepCopy(v)
-    end
-    ret[k] = v
-  end
-  setmetatable(ret, mt)
-
-  return ret
-end
+require "ToDoxHook"
 
 
 function printFunction(self,ident,close,isfunc)
 function printFunction(self,ident,close,isfunc)
   local func = {}
   local func = {}
@@ -154,44 +67,6 @@ function printFunction(self,ident,close,isfunc)
   end
   end
 end
 end
  
  
-function classFunction:print(ident,close)
-  printFunction(self,ident,close, true)
-end
- 
-function classOperator:print(ident,close)
-  printFunction(self,ident,close, false)
-end
- 
-function classVariable:print(ident,close)
-  local property = {}
-  property.mod  = self.mod
-  property.type = self.type
-  property.ptr  = self.ptr
-  property.name = self.lname
-  property.def  = self.def
-  property.ret  = self.ret
- 
-  if currentClass == nil then
-    if property.mod:find("tolua_property__") == nil then
-      table.insert(globalConstants, property)
-    else
-      table.insert(globalProperties, property)
-    end
-  else
-    if currentClass.properties == nil then
-      currentClass.properties = { property }
-    else
-      table.insert(currentClass.properties, property)
-    end
-  end
-end
- 
-function classVerbatim:print(ident,close) 
-end
- 
-function sortByName(t)
-  table.sort(t, function(a, b) return a.name < b.name end)
-end
  
  
 -- Workaround for Zerobrane Studio's tool-tip with overloaded functions
 -- Workaround for Zerobrane Studio's tool-tip with overloaded functions
 function adjustClassesOverloadFuncs()
 function adjustClassesOverloadFuncs()