mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-11 09:04:01 +03:00
mruby-lvgui-native: Bind more lv_task functions
This commit is contained in:
parent
8f78c7d9b1
commit
ea26e77b7b
@ -11366,6 +11366,78 @@ mrb_mruby_lvgui_native_lv_task_create(mrb_state *mrb, mrb_value self)
|
||||
//
|
||||
////////
|
||||
|
||||
////////
|
||||
// Bindings for: `void lv_task_del(lv_task_t * task)`
|
||||
|
||||
static mrb_value
|
||||
mrb_mruby_lvgui_native_lv_task_del(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
/* No return value */
|
||||
|
||||
//
|
||||
// Parameters handling
|
||||
//
|
||||
|
||||
// Parameter handling for native parameter `lv_task_t * task`
|
||||
mrb_value param_task_instance;
|
||||
lv_task_t * param_task;
|
||||
|
||||
mrb_get_args(
|
||||
mrb,
|
||||
"o",
|
||||
¶m_task_instance
|
||||
);
|
||||
param_task = mrb_mruby_lvgui_native_unwrap_pointer(
|
||||
mrb,
|
||||
param_task_instance
|
||||
);
|
||||
|
||||
// Calling native function
|
||||
lv_task_del(param_task);
|
||||
|
||||
// Converts return value back to a valid mruby value
|
||||
return mrb_nil_value();
|
||||
}
|
||||
|
||||
//
|
||||
////////
|
||||
|
||||
////////
|
||||
// Bindings for: `void lv_task_once(lv_task_t * task)`
|
||||
|
||||
static mrb_value
|
||||
mrb_mruby_lvgui_native_lv_task_once(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
/* No return value */
|
||||
|
||||
//
|
||||
// Parameters handling
|
||||
//
|
||||
|
||||
// Parameter handling for native parameter `lv_task_t * task`
|
||||
mrb_value param_task_instance;
|
||||
lv_task_t * param_task;
|
||||
|
||||
mrb_get_args(
|
||||
mrb,
|
||||
"o",
|
||||
¶m_task_instance
|
||||
);
|
||||
param_task = mrb_mruby_lvgui_native_unwrap_pointer(
|
||||
mrb,
|
||||
param_task_instance
|
||||
);
|
||||
|
||||
// Calling native function
|
||||
lv_task_once(param_task);
|
||||
|
||||
// Converts return value back to a valid mruby value
|
||||
return mrb_nil_value();
|
||||
}
|
||||
|
||||
//
|
||||
////////
|
||||
|
||||
////////
|
||||
//
|
||||
|
||||
@ -16185,6 +16257,38 @@ mrb_mruby_lvgui_native_gem_init(mrb_state* mrb)
|
||||
mrb_mruby_lvgui_native_wrap_pointer(mrb, (void *) lv_task_create)
|
||||
);
|
||||
|
||||
// ```void lv_task_del(lv_task_t * task);```
|
||||
mrb_define_module_function(
|
||||
mrb,
|
||||
mLVGUI__Native,
|
||||
"lv_task_del",
|
||||
mrb_mruby_lvgui_native_lv_task_del,
|
||||
MRB_ARGS_REQ(1)
|
||||
);
|
||||
|
||||
mrb_hash_set(
|
||||
mrb,
|
||||
mLVGUI__Native__References,
|
||||
mrb_symbol_value(mrb_intern_lit(mrb, "lv_task_del")),
|
||||
mrb_mruby_lvgui_native_wrap_pointer(mrb, (void *) lv_task_del)
|
||||
);
|
||||
|
||||
// ```void lv_task_once(lv_task_t * task);```
|
||||
mrb_define_module_function(
|
||||
mrb,
|
||||
mLVGUI__Native,
|
||||
"lv_task_once",
|
||||
mrb_mruby_lvgui_native_lv_task_once,
|
||||
MRB_ARGS_REQ(1)
|
||||
);
|
||||
|
||||
mrb_hash_set(
|
||||
mrb,
|
||||
mLVGUI__Native__References,
|
||||
mrb_symbol_value(mrb_intern_lit(mrb, "lv_task_once")),
|
||||
mrb_mruby_lvgui_native_wrap_pointer(mrb, (void *) lv_task_once)
|
||||
);
|
||||
|
||||
// Custom handler for tasks callbacks
|
||||
mrb_hash_set(
|
||||
mrb,
|
||||
|
Loading…
Reference in New Issue
Block a user