diff --git a/src/awesomewmdtl/init.tl b/src/awesomewmdtl/init.tl index 05cf543..9134041 100644 --- a/src/awesomewmdtl/init.tl +++ b/src/awesomewmdtl/init.tl @@ -149,6 +149,7 @@ for _, node in dag.iter_global_nodes(module_dag) do end local global_module_ast = ast.create_node("module", "global_env_def", "global_env_def", true) -- Declare global types +table.insert(global_module_ast.children, ast.create_node("type", "Gears_Shape_Function", { "(function(cr: any, width: integer, height: integer))" }, true)) table.insert(global_module_ast.children, ast.create_node("type", "Color", { "any" }, true)) table.insert(global_module_ast.children, ast.create_node("type", "Surface", { "any" }, true)) table.insert(global_module_ast.children, ast.create_node("type", "Cairo_Context", { "any" }, true)) diff --git a/src/awesomewmdtl/visitors/type_mapping.tl b/src/awesomewmdtl/visitors/type_mapping.tl index 9439aae..770ab3a 100644 --- a/src/awesomewmdtl/visitors/type_mapping.tl +++ b/src/awesomewmdtl/visitors/type_mapping.tl @@ -1,19 +1,21 @@ local type Node = require("awesomewmdtl.types.Node") --- Special types I don't want to deal with for now -local gears_shape_function = "function(cr: any, width: integer, height: integer)" - local type_map : { string : string } = { awesome = "Awesome", bool = "boolean", + ["surface._native"] = "Surface", + cairo_context = "Cairo_Context", + color = "Color", client = "Client", - ["gears.shape"] = gears_shape_function, + ["gears.shape"] = "Gears_Shape_Function", ["gears.surface"] = "Surface", image = "Image", int = "integer", layout = "Layout", + raw_surface = "Surface", + raw_curface = "Surface", -- typo that should be fixed in the Client doc screen = "Screen", - shape = gears_shape_function, + shape = "Gears_Shape_Function", surface = "Surface", tag = "Tag", widget = "wibox.widget",