18 #include "gradient2.h"
20 #include "textblock.h"
21 #include "textblock_style.h"
24 #include "elementary.h"
25 #include "transform.h"
28 luaopen_ego (lua_State
*L
)
31 luaobj_new_class (L
, "cEgo", cEgo
);
32 luaobj_new_class (L
, "cObject", cObject
);
33 luaobj_new_class (L
, "cRect", cRect
);
34 luaobj_new_class (L
, "cImage", cImage
);
35 luaobj_new_class (L
, "cAnimator", cAnimator
);
36 luaobj_new_class (L
, "cSmart", cSmart
);
37 luaobj_new_class (L
, "cEdje", cEdje
);
38 luaobj_new_class (L
, "cPart", cPart
);
39 luaobj_new_class (L
, "cLine", cLine
);
40 luaobj_new_class (L
, "cPolygon", cPolygon
);
41 luaobj_new_class (L
, "cGradient", cGradient
);
42 luaobj_new_class (L
, "cGradient2_Linear", cGradient2_Linear
);
43 luaobj_new_class (L
, "cGradient2_Radial", cGradient2_Radial
);
44 luaobj_new_class (L
, "cText", cText
);
45 luaobj_new_class (L
, "cTextblock", cTextblock
);
46 luaobj_new_class (L
, "cStyle", cStyle
);
47 luaobj_new_class (L
, "cTransform", cTransform
);
48 luaobj_new_class (L
, "cTable", cTable
);
49 luaobj_new_class (L
, "cBox", cBox
);
51 luaobj_new_class (L
, "cIcon", cIcon
);
52 luaobj_new_class (L
, "cBox2", cBox2
);
53 luaobj_new_class (L
, "cButton", cButton
);
54 luaobj_new_class (L
, "cScroller", cScroller
);
55 luaobj_new_class (L
, "cLabel", cLabel
);
56 luaobj_new_class (L
, "cToggle", cToggle
);
57 luaobj_new_class (L
, "cFrame", cFrame
);
58 luaobj_new_class (L
, "cTable2", cTable2
);
59 luaobj_new_class (L
, "cEntry", cEntry
);
60 luaobj_new_class (L
, "cBubble", cBubble
);
61 luaobj_new_class (L
, "cHover", cHover
);
62 luaobj_new_class (L
, "cLayout", cLayout
);
63 luaobj_new_class (L
, "cClock", cClock
);
67 ego_sandbox (lua_State
*L
, int level
)
73 *access to io and os routines
79 * no access to io and os routines
88 * no access to io and os routines
89 * no loading and execution of script files
96 lua_setglobal (L
, "loadfile");
98 lua_setglobal (L
, "dofile");
102 * no access to io and os routines
103 * no loading and execution of script files
104 * no loading and execution of script strings
111 lua_setglobal (L
, "loadfile");
113 lua_setglobal (L
, "dofile");
115 lua_setglobal (L
, "loadstring");
117 lua_setglobal (L
, "dostring");
121 * no access to io and os routines
122 * no loading and execution of script files
123 * no loading and execution of script strings
124 * no manipulation of environmental variables
131 lua_setglobal (L
, "loadfile");
133 lua_setglobal (L
, "dofile");
135 lua_setglobal (L
, "loadstring");
137 lua_setglobal (L
, "dostring");
139 lua_setglobal (L
, "getfenv");
141 lua_setglobal (L
, "setfenv");
147 * ego smart class implementatoin
149 static lua_State
*glob_L
= NULL
;
150 static Evas_Smart_Class parent_sc
= {NULL
};
151 static Evas_Smart_Class sc
= {NULL
};
154 ego_smart_class_add (Evas_Object
*obj
)
156 lua_State
*L
= glob_L
;
159 // register main class
160 luaobj_Object
*lobj
= lua_newuserdata (L
, sizeof (luaobj_Object
));
161 luaobj_set_class (L
, -1, lobj
, "cEgo");
163 evas_object_data_set (lobj
->data
, "luaobj", luaobj_new_ref (L
, -1));
164 lua_setglobal (L
, "ego");
166 // read in buffer at index -1
167 if (lua_pcall (L
, 0, LUA_MULTRET
, 0))
169 fprintf (stderr
, "ego parse error: %s\n", lua_tostring (L
, -1));
175 ego_smart_class_new (void)
179 parent_sc
.name
= "parent_ego";
180 parent_sc
.version
= EVAS_SMART_CLASS_VERSION
;
181 evas_object_smart_clipped_smart_set (&parent_sc
);
186 sc
.version
= EVAS_SMART_CLASS_VERSION
;
187 evas_object_smart_clipped_smart_set (&sc
);
188 sc
.add
= ego_smart_class_add
;
190 return evas_smart_class_new (&sc
);
194 * ego smart class creation
197 ego_object_add (Evas
*evas
, lua_State
*L
)
199 // create smart object
202 return evas_object_smart_add (evas
, ego_smart_class_new ());