From 6e42c0f5d1eea184aba6e6e69befe89450f8bb78 Mon Sep 17 00:00:00 2001 From: osch Date: Sun, 8 Dec 2019 11:11:33 +0100 Subject: [PATCH 1/3] avoid compiler warning regarding incompatible pointer types --- obj_surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obj_surface.c b/obj_surface.c index 643c6b7..1fbda57 100644 --- a/obj_surface.c +++ b/obj_surface.c @@ -769,7 +769,7 @@ map_to_image(lua_State *L) from_lua_rectangle(L, prect, 2); } - res = create_surface_userdata(L); + res = &create_surface_userdata(L)->surface; *res = cairo_surface_map_to_image(*obj, prect); return 1; } From 0e270297341984631fc81eaa2d6672c80b4f8587 Mon Sep 17 00:00:00 2001 From: osch Date: Sun, 8 Dec 2019 11:18:45 +0100 Subject: [PATCH 2/3] luarocks rockspec for development (current git master) --- oocairo-scm-0.rockspec | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 oocairo-scm-0.rockspec diff --git a/oocairo-scm-0.rockspec b/oocairo-scm-0.rockspec new file mode 100644 index 0000000..084f730 --- /dev/null +++ b/oocairo-scm-0.rockspec @@ -0,0 +1,49 @@ +package = "oocairo" +version = "scm-0" +local versionNumber = version:gsub("^(.*)-.-$", "%1") +source = { + url = "https://github.com/awesomeWM/oocairo/archive/master.zip", + dir = "oocairo-master", +} +description = { + summary = "Cairo bindings for lua ", + homepage = "https://github.com/awesomeWM/oocairo", + license = "MIT/X11", + detailed = [[ + Lua-OOCairo provides Lua with full access to the Cairo vector graphics API. + It can be used for drawing onto bitmap images and saving the resulting files + in PNG format, or for generating files in vector formats like SVG and PDF. + ]], +} +dependencies = { + "lua >= 5.1, < 5.4", +} +external_dependencies = { + CAIRO = { + header = "cairo/cairo.h", + library = "cairo", + } +} + +build = { + type = "builtin", + modules = { + oocairo = { + defines = { + "VERSION=\""..versionNumber.."\"" + }, + sources = { + "oocairo.c", + }, + libraries = { + "cairo" + }, + incdirs = { + "$(CAIRO_INCDIR)/cairo" + }, + libdirs = { + "$(CAIRO_LIBDIR)" + }, + }, + } +} From 573399eb1dd1c6f79acb8f413da59227db38973c Mon Sep 17 00:00:00 2001 From: osch Date: Sun, 8 Dec 2019 11:38:40 +0100 Subject: [PATCH 3/3] Lua 5.3 support: set __name field in metatables to debug_name for better error messages (e.g. tostring and luaL_check... functions) --- oocairo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oocairo.c b/oocairo.c index d9622d7..235ccff 100644 --- a/oocairo.c +++ b/oocairo.c @@ -953,6 +953,9 @@ create_object_metatable (lua_State *L, const char *mt_name, lua_pushliteral(L, "_NAME"); lua_pushstring(L, debug_name); lua_rawset(L, -3); + lua_pushliteral(L, "__name"); + lua_pushstring(L, debug_name); + lua_rawset(L, -3); add_funcs_to_table(L, methods); lua_pushliteral(L, "__index"); lua_pushvalue(L, -2);