summaryrefslogtreecommitdiff
path: root/x11-themes/gtk-engines/files/gtk-engines-2.20.2-lua.patch
blob: 683fe7505dfe57d1daeb04834cda84dea08c662c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Change non-returning gtk macros to returning gtk macros and add correct values
to them.
Deal with bad "convenience" redefine of lua API function, so it works with system
lua.
Add missing includes, both from system gtk-2 and this library.
https://bugs.gentoo.org/919421
--- a/engines/lua/src/lua_style.c
+++ b/engines/lua/src/lua_style.c
@@ -21,6 +21,7 @@
 
 
 #include <gtk/gtk.h>
+#include <glib/gprintf.h>
 #include <cairo.h>
 #include <math.h>
 #include <string.h>
@@ -34,6 +35,7 @@
 
 #include "lua_utils.h"
 #include "misc_utils.h"
+#include "draw_lib.h"
 
 /* #define DEBUG 1 */
 
@@ -142,8 +144,8 @@
 lua_style_draw (LuaStyle *style, GtkWidget *widget, GtkStateType state_type,
                 gchar *name, gint width, gint height)
 {
-	g_return_if_fail (style);
-	g_return_if_fail (style->L);
+	g_return_val_if_fail (style, FALSE);
+	g_return_val_if_fail (style->L, FALSE);
 
 	lua_style_push_widget_params (style, widget, state_type);
 
@@ -175,9 +177,9 @@
 	gchar *state;
 	int i;
 
-	g_return_if_fail (style);
+	g_return_val_if_fail (style, NULL);
 	
-	L = lua_open ();
+	L = luaL_newstate ();
 	luaopen_base (L);
 	luaopen_math (L);
 	luaopen_draw (L);
@@ -233,8 +235,8 @@
 lua_style_prepare_cairo (LuaStyle *style, GdkWindow *window, GdkRectangle *area, gint x, gint y)
 {
 	cairo_t *cr;
-	g_return_if_fail (style);
-	g_return_if_fail (style->L);
+	g_return_val_if_fail (style, FALSE);
+	g_return_val_if_fail (style->L, FALSE);
 	
 	cr = gdk_cairo_create (window);
 	cairo_set_source_rgb (cr, 0, 0, 0);
--- a/engines/lua/src/lua_utils.c
+++ b/engines/lua/src/lua_utils.c
@@ -27,7 +27,7 @@
 {
 	void *res;
 	
-	g_return_if_fail (L);
+	g_return_val_if_fail (L, NULL);
 	
 	lua_getfield (L, LUA_REGISTRYINDEX, name);
 	if (!lua_isuserdata (L, -1))