11 elm_callback (void *data
, Evas_Object
*obj
, void *event_info
)
13 luaobj_Ref
*ref1
= evas_object_data_get (obj
, "luaobj");
14 luaobj_Ref
*ref2
= data
;
15 luaobj_get_ref (ref1
->L
, ref2
);
16 luaobj_get_ref (ref1
->L
, ref1
);
17 if (lua_pcall (ref1
->L
, 1, 0, 0))
18 fprintf (stderr
, "elm_callback: %s\n", lua_tostring (ref1
->L
, -1));
20 #define ELM_CB(FUNC, NAME) \
24 luaobj_Object *obj = (luaobj_Object *) lua_touserdata (L, 1); \
25 evas_object_smart_callback_add ( \
29 (void *) luaobj_new_ref (L, 2)); \
38 licon_set_file (lua_State
*L
)
40 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
41 int key
= luaL_checknumber (L
, 2);
43 sprintf (buf
, "images/%i", key
);
44 lua_getfield (L
, LUA_REGISTRYINDEX
, "ego_file");
45 const char *file
= luaL_checkstring (L
, -1);
46 elm_icon_file_set (obj
->data
, file
, buf
);
50 SET_STRING (licon_set_standard
, elm_icon_standard_set
);
51 SET_BOOL (licon_set_smooth
, elm_icon_smooth_set
);
52 SET_BOOL (licon_set_no_scale
, elm_icon_no_scale_set
);
53 SET_TAB2BOOL (licon_set_scale
, elm_icon_scale_set
);
54 SET_BOOL (licon_set_fill_outside
, elm_icon_fill_outside_set
);
56 const struct luaL_Reg lNil
[] = {
57 {NULL
, NULL
} // sentinel
60 const struct luaL_Reg lIcon_set
[] = {
61 {"file", licon_set_file
},
62 {"standard", licon_set_standard
},
63 {"smooth", licon_set_smooth
},
64 {"no_scale", licon_set_no_scale
},
65 {"scale", licon_set_scale
},
66 {"fill_outside", licon_set_fill_outside
},
67 {NULL
, NULL
} // sentinel
70 const luaobj_Reg mIcon
= {
77 const luaobj_Reg
*cIcon
[] = {
88 SET_BOOL (lbox_set_horizontal
, elm_box_horizontal_set
);
89 SET_BOOL (lbox_set_homogenous
, elm_box_homogenous_set
);
90 FN_OBJ (lbox_fn_pack_start
, elm_box_pack_start
);
91 FN_OBJ (lbox_fn_pack_end
, elm_box_pack_end
);
92 FN_2OBJ (lbox_fn_pack_before
, elm_box_pack_before
);
93 FN_2OBJ (lbox_fn_pack_after
, elm_box_pack_after
);
95 const struct luaL_Reg lBox_set
[] = {
96 {"horizontal", lbox_set_horizontal
},
97 {"homogenous", lbox_set_homogenous
},
98 {NULL
, NULL
} // sentinel
101 const struct luaL_Reg lBox_fn
[] = {
102 {"pack_start", lbox_fn_pack_start
},
103 {"pack_end", lbox_fn_pack_end
},
104 {"pack_before", lbox_fn_pack_before
},
105 {"pack_after", lbox_fn_pack_after
},
106 {NULL
, NULL
} // sentinel
109 const luaobj_Reg mBox
= {
116 const luaobj_Reg
*cBox
[] = {
127 SET_STRING (lbutton_set_label
, elm_button_label_set
);
128 SET_OBJ (lbutton_set_icon
, elm_button_icon_set
);
129 ELM_CB (lbutton_set_clicked
, "clicked")
131 const struct luaL_Reg lButton_set
[] = {
132 {"label", lbutton_set_label
},
133 {"icon", lbutton_set_icon
},
134 {"clicked", lbutton_set_clicked
},
135 {NULL
, NULL
} // sentinel
138 const luaobj_Reg mButton
= {
145 const luaobj_Reg
*cButton
[] = {
153 * Elementary Scroller
156 SET_OBJ (lscroller_set_content
, elm_scroller_content_set
);
157 SET_TAB2BOOL (lscroller_set_content_min_limit
, elm_scroller_content_min_limit
);
159 const struct luaL_Reg lScroller_set
[] = {
160 {"content", lscroller_set_content
},
161 {"content_min_limit", lscroller_set_content_min_limit
},
162 {NULL
, NULL
} // sentinel
165 const luaobj_Reg mScroller
= {
172 const luaobj_Reg
*cScroller
[] = {
183 SET_STRING (llabel_set_label
, elm_label_label_set
);
185 const struct luaL_Reg lLabel_set
[] = {
186 {"label", llabel_set_label
},
187 {NULL
, NULL
} // sentinel
190 const luaobj_Reg mLabel
= {
197 const luaobj_Reg
*cLabel
[] = {
208 SET_STRING (ltoggle_set_label
, elm_toggle_label_set
);
209 SET_OBJ (ltoggle_set_icon
, elm_toggle_icon_set
);
210 SET_TAB2STRING (ltoggle_set_states_labels
, elm_toggle_states_labels_set
);
211 SET_BOOL (ltoggle_set_state
, elm_toggle_state_set
);
212 ELM_CB (ltoggle_set_changed
, "changed")
215 ltoggle_get_state (lua_State
*L
)
217 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
219 elm_toggle_state_pointer_set (obj
->data
, &state
);
220 lua_pushnumber (L
, state
);
224 const struct luaL_Reg lToggle_get
[] = {
225 {"state", ltoggle_get_state
},
226 {NULL
, NULL
} // sentinel
229 const struct luaL_Reg lToggle_set
[] = {
230 {"label", ltoggle_set_label
},
231 {"icon", ltoggle_set_icon
},
232 {"states_labels", ltoggle_set_states_labels
},
233 {"state", ltoggle_set_state
},
234 {"changed", ltoggle_set_changed
},
235 {NULL
, NULL
} // sentinel
238 const luaobj_Reg mToggle
= {
245 const luaobj_Reg
*cToggle
[] = {
256 SET_STRING (lframe_set_label
, elm_frame_label_set
);
257 SET_OBJ (lframe_set_content
, elm_frame_content_set
);
259 const struct luaL_Reg lFrame_set
[] = {
260 {"label", lframe_set_label
},
261 {"content", lframe_set_content
},
262 {NULL
, NULL
} // sentinel
265 const luaobj_Reg mFrame
= {
272 const luaobj_Reg
*cFrame
[] = {
283 SET_BOOL (ltable_set_homogenous
, elm_table_homogenous_set
);
286 ltable_fn_pack (lua_State
*L
)
288 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
289 luaobj_Object
*pac
= (luaobj_Object
*) lua_touserdata (L
, 2);
291 obj
->data
, pac
->data
,
292 luaL_checkint (L
, 3), luaL_checkint (L
, 4), // x, y
293 luaL_checkint (L
, 5), luaL_checkint (L
, 6)); // w, h
297 const struct luaL_Reg lTable_set
[] = {
298 {"homogenous", ltable_set_homogenous
},
299 {NULL
, NULL
} // sentinel
302 const struct luaL_Reg lTable_fn
[] = {
303 {"pack", ltable_fn_pack
},
304 {NULL
, NULL
} // sentinel
307 const luaobj_Reg mTable
= {
314 const luaobj_Reg
*cTable
[] = {
321 GET_STRING (lentry_get_entry
, elm_entry_entry_get
);
322 GET_STRING (lentry_get_selection
, elm_entry_selection_get
);
323 SET_BOOL (lentry_set_single_line
, elm_entry_single_line_set
);
324 SET_BOOL (lentry_set_password
, elm_entry_password_set
);
325 SET_STRING (lentry_set_entry
, elm_entry_entry_set
);
326 SET_BOOL (lentry_set_line_wrap
, elm_entry_line_wrap_set
);
327 SET_BOOL (lentry_set_editable
, elm_entry_editable_set
);
328 FN_STRING (lentry_fn_entry_insert
, elm_entry_entry_insert
);
330 ELM_CB (lentry_set_changed
, "changed")
331 ELM_CB (lentry_set_selection_start
, "selection,start")
332 ELM_CB (lentry_set_selection_changed
, "selection,changed")
333 ELM_CB (lentry_set_selection_cleared
, "selection,cleared")
334 ELM_CB (lentry_set_selection_paste
, "selection,paste")
335 ELM_CB (lentry_set_selection_copy
, "selection,copy")
336 ELM_CB (lentry_set_selection_cut
, "selection,cut")
337 ELM_CB (lentry_set_cursor_changed
, "cursor,changed")
338 ELM_CB (lentry_set_anchor_clicked
, "anchor,clicked")
339 ELM_CB (lentry_set_activated
, "activated")
341 const struct luaL_Reg lEntry_get
[] = {
342 {"entry", lentry_get_entry
},
343 {"selection", lentry_get_selection
},
344 {NULL
, NULL
} // sentinel
347 const struct luaL_Reg lEntry_set
[] = {
348 {"single_line", lentry_set_single_line
},
349 {"password", lentry_set_password
},
350 {"entry", lentry_set_entry
},
351 {"line_wrap", lentry_set_line_wrap
},
352 {"editable", lentry_set_editable
},
354 {"changed", lentry_set_changed
},
355 {"selection,start", lentry_set_selection_start
},
356 {"selection,changed", lentry_set_selection_changed
},
357 {"selection,cleard", lentry_set_selection_cleared
},
358 {"selection,paste", lentry_set_selection_paste
},
359 {"selection,copy", lentry_set_selection_copy
},
360 {"selection,cut", lentry_set_selection_cut
},
361 {"cursor,changed", lentry_set_cursor_changed
},
362 {"anchor,clicked", lentry_set_anchor_clicked
},
363 {"activated", lentry_set_activated
},
365 {NULL
, NULL
} // sentinel
368 const struct luaL_Reg lEntry_fn
[] = {
369 {"entry_insert", lentry_fn_entry_insert
},
370 {NULL
, NULL
} // sentinel
373 const luaobj_Reg mEntry
= {
380 const luaobj_Reg
*cEntry
[] = {
391 SET_STRING (lbubble_set_label
, elm_bubble_label_set
);
392 SET_STRING (lbubble_set_info
, elm_bubble_info_set
);
393 SET_OBJ (lbubble_set_content
, elm_bubble_content_set
);
394 SET_OBJ (lbubble_set_icon
, elm_bubble_icon_set
);
396 const struct luaL_Reg lBubble_set
[] = {
397 {"label", lbubble_set_label
},
398 {"content", lbubble_set_content
},
399 {"info", lbubble_set_info
},
400 {"icon", lbubble_set_icon
},
401 {NULL
, NULL
} // sentinel
404 const luaobj_Reg mBubble
= {
411 const luaobj_Reg
*cBubble
[] = {
422 SET_OBJ (lhover_set_target
, elm_hover_target_set
);
423 SET_OBJ (lhover_set_parent
, elm_hover_parent_set
);
424 SET_STRING (lhover_set_style
, elm_hover_style_set
);
425 ELM_CB (lhover_set_clicked
, "clicked")
428 lhover_set_content (lua_State
*L
)
430 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
431 lua_rawgeti (L
, 2, 1);
432 lua_rawgeti (L
, 2, 2);
433 luaobj_Object
*con
= (luaobj_Object
*) lua_touserdata (L
, -1);
434 elm_hover_content_set (
436 luaL_checkstring (L
, -2),
441 const struct luaL_Reg lHover_set
[] = {
442 {"target", lhover_set_target
},
443 {"parent", lhover_set_parent
},
444 {"content", lhover_set_content
},
445 {"style", lhover_set_style
},
446 {"clicked", lhover_set_clicked
},
447 {NULL
, NULL
} // sentinel
450 const luaobj_Reg mHover
= {
457 const luaobj_Reg
*cHover
[] = {
469 llayout_set_group (lua_State
*L
)
471 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
472 const char *group
= luaL_checkstring (L
, 2);
473 lua_getfield (L
, LUA_REGISTRYINDEX
, "ego_file");
474 const char *file
= luaL_checkstring (L
, -1);
475 elm_layout_file_set (obj
->data
, file
, group
);
480 llayout_set_content (lua_State
*L
)
482 luaobj_Object
*obj
= (luaobj_Object
*) lua_touserdata (L
, 1);
483 lua_rawgeti (L
, 2, 1);
484 lua_rawgeti (L
, 2, 2);
485 luaobj_Object
*con
= (luaobj_Object
*) lua_touserdata (L
, -1);
486 elm_layout_content_set (
488 luaL_checkstring (L
, -2),
493 const struct luaL_Reg lLayout_set
[] = {
494 {"group", llayout_set_group
},
495 {"content", llayout_set_content
},
496 {NULL
, NULL
} // sentinel
499 const luaobj_Reg mLayout
= {
506 const luaobj_Reg
*cLayout
[] = {
517 SET_TAB3INTEGER (lclock_set_time
, elm_clock_time_set
);
518 GET_TAB3INTEGER (lclock_get_time
, elm_clock_time_get
);
519 SET_BOOL (lclock_set_edit
, elm_clock_edit_set
);
520 SET_BOOL (lclock_set_show_am_pm
, elm_clock_show_am_pm_set
);
521 SET_BOOL (lclock_set_show_seconds
, elm_clock_show_seconds_set
);
523 const struct luaL_Reg lClock_set
[] = {
524 {"time", lclock_set_time
},
525 {"edit", lclock_set_edit
},
526 {"show_am_pm", lclock_set_show_am_pm
},
527 {"show_seconds", lclock_set_show_seconds
},
528 {NULL
, NULL
} // sentinel
531 const struct luaL_Reg lClock_get
[] = {
532 {"time", lclock_get_time
},
533 {NULL
, NULL
} // sentinel
536 const luaobj_Reg mClock
= {
543 const luaobj_Reg
*cClock
[] = {