1-- ---------------------------------------------------------------------------- 2-- Rules to build wxWidgets' wxXRC binding for wxLua 3-- load using : $lua -e"rulesFilename=\"rules.lua\"" genwxbind.lua 4-- ---------------------------------------------------------------------------- 5 6-- ---------------------------------------------------------------------------- 7-- Set the root directory of the wxLua distribution, used only in this file 8wxlua_dir = "../" 9 10-- ============================================================================ 11-- Set the Lua namespace (Lua table) that the bindings will be placed into. 12-- See wxLuaBinding::GetLuaNamespace(); eg. wx.wxWindow(...) 13hook_lua_namespace = "wx" 14 15-- Set the unique C++ "namespace" for the bindings, not a real namespace, but 16-- a string used in declared C++ objects to prevent duplicate names. 17-- See wxLuaBinding::GetBindingName(). 18hook_cpp_namespace = "wxxrc" 19 20-- ============================================================================ 21-- Set the directory to output the bindings to, both C++ header and source files 22output_cpp_header_filepath = wxlua_dir.."modules/wxbind/include" 23output_cpp_filepath = wxlua_dir.."modules/wxbind/src" 24 25-- ============================================================================ 26-- Set the DLLIMPEXP macros for compiling these bindings into a DLL 27-- Use "WXLUA_NO_DLLIMPEXP" and "WXLUA_NO_DLLIMPEXP_DATA" for no IMPEXP macros 28 29output_cpp_impexpsymbol = "WXDLLIMPEXP_BINDWXXRC" 30output_cpp_impexpdatasymbol = "WXDLLIMPEXP_DATA_BINDWXXRC" 31 32-- ---------------------------------------------------------------------------- 33-- Set the name of the header file that will have the #includes from the 34-- bindings in it. This will be used as #include "hook_cpp_header_filename" in 35-- the C++ wrapper files, so it must include the proper #include path. 36hook_cpp_header_filename = "wxbind/include/"..hook_cpp_namespace.."_bind.h" 37 38-- ---------------------------------------------------------------------------- 39-- Set the name of the main binding file that will have the glue code for the 40-- bindings in it. This file along with the output from the *.i files will be 41-- placed in the "output_cpp_filepath". 42hook_cpp_binding_filename = hook_cpp_namespace.."_bind.cpp" 43 44-- ---------------------------------------------------------------------------- 45-- Generate only a single output C++ binding source file with the name of 46-- hook_cpp_binding_filename, as opposed to generating a single cpp file 47-- for each *.i file plus the hook_cpp_binding_filename file. 48output_single_cpp_binding_file = true 49 50-- ---------------------------------------------------------------------------- 51-- Set the name of the subclassed wxLuaBinding class 52hook_cpp_binding_classname = "wxLuaBinding_"..hook_cpp_namespace 53 54-- ---------------------------------------------------------------------------- 55-- Set the function names that wrap the output structs of defined values, 56-- objects, events, functions, and classes. 57hook_cpp_define_funcname = "wxLuaGetDefineList_"..hook_cpp_namespace 58hook_cpp_string_funcname = "wxLuaGetStringList_"..hook_cpp_namespace 59hook_cpp_object_funcname = "wxLuaGetObjectList_"..hook_cpp_namespace 60hook_cpp_event_funcname = "wxLuaGetEventList_"..hook_cpp_namespace 61hook_cpp_function_funcname = "wxLuaGetFunctionList_"..hook_cpp_namespace 62hook_cpp_class_funcname = "wxLuaGetClassList_"..hook_cpp_namespace 63 64-- ---------------------------------------------------------------------------- 65-- Set any #includes or other C++ code to be placed verbatim at the top of 66-- every generated cpp file or "" for none 67hook_cpp_binding_includes = "" 68 69-- ---------------------------------------------------------------------------- 70-- Set any #includes or other C++ code to be placed verbatim below the 71-- #includes of every generated cpp file or "" for none 72hook_cpp_binding_post_includes = "" 73 74-- ---------------------------------------------------------------------------- 75-- Add additional include information or C++ code for the binding header file. 76-- This code will be place directly after any #includes at the top of the file 77hook_cpp_binding_header_includes = 78 "#include \"wxbind/include/wxbinddefs.h\"\n".. 79 "#include \"wxluasetup.h\"\n".. 80 "#include \"wxbind/include/wxcore_bind.h\"\n" 81 82-- ---------------------------------------------------------------------------- 83-- Set any #includes or other C++ code to be placed verbatim at the top of 84-- the single hook_cpp_binding_filename generated cpp file or "" for none 85hook_cpp_binding_source_includes = "" 86 87-- ============================================================================ 88-- Set the bindings directory that contains the *.i interface files 89interface_filepath = wxlua_dir.."bindings/wxwidgets" 90 91-- ---------------------------------------------------------------------------- 92-- A list of interface files to use to make the bindings. These files will be 93-- converted into *.cpp and placed in the output_cpp_filepath directory. 94-- The files are loaded from the interface_filepath. 95interface_fileTable = 96{ 97 "wxxrc_xrc.i" 98} 99 100-- ---------------------------------------------------------------------------- 101-- A list of files that contain bindings that need to be overridden or empty 102-- table {} for none. 103-- The files are loaded from the interface_filepath. 104--override_fileTable = { "wxxrc_override.hpp" } 105 106-- ============================================================================ 107-- A table containing filenames of XXX_datatype.lua from other wrappers to 108-- to define classes and data types used in this wrapper 109-- NOTE: for the base wxWidgets wrappers we don't load the cache since they 110-- don't depend on other wrappers and can cause problems when interface 111-- files are updated. Make sure you delete or have updated any cache file 112-- that changes any data types used by this binding. 113 114datatype_cache_input_fileTable = { wxlua_dir.."bindings/wxwidgets/wxcore_datatypes.lua" } 115 116-- ---------------------------------------------------------------------------- 117-- The file to output the data type cache for later use with a binding that 118-- makes use of data types (classes, enums, etc) that are declared in this 119-- binding. The file will be generated in the interface_filepath. 120 121datatypes_cache_output_filename = hook_cpp_namespace.."_datatypes.lua" 122 123-- ============================================================================ 124-- Declare functions or member variables for the derived wxLuaBinding class 125-- that will be generated for this binding. The string will be copied verbatim 126-- into the body of the hook_cpp_binding_classname class declaration in the 127-- hook_cpp_header_filename header file. May be remmed out to ignore it. 128-- See usage in the wxWidgets wxbase_rules.lua file. 129 130--wxLuaBinding_class_declaration = nothing to do here 131 132-- ---------------------------------------------------------------------------- 133-- Implement the functions or member variables for the derived wxLuaBinding 134-- class that you have declared. The string will be copied into the 135-- hook_cpp_binding_filename source file. May be remmed out to ignore it. 136-- See usage in the wxWidgets wxbase_rules.lua file. 137 138--wxLuaBinding_class_implementation = nothing to do here 139 140-- ============================================================================ 141-- Add additional conditions here 142-- example: conditions["DOXYGEN_INCLUDE"] = "defined(DOXYGEN_INCLUDE)" 143 144-- ---------------------------------------------------------------------------- 145-- Add additional data types here 146-- example: AllocDataType("wxArrayInt", "class",false) 147 148-- ============================================================================ 149-- Generate comments into binding C++ code 150comment_cpp_binding_code = true 151