int dt_lua_init_widget(lua_State* L) { lua_newtable(L); lua_setfield(L, LUA_REGISTRYINDEX,"dt_lua_widget_bind_table"); dt_lua_module_new(L,"widget"); widget_type.associated_type = dt_lua_init_gpointer_type(L,lua_widget); lua_pushcfunction(L,tooltip_member); dt_lua_gtk_wrap(L); dt_lua_type_register(L, lua_widget, "tooltip"); lua_pushcfunction(L,widget_gc); dt_lua_gtk_wrap(L); dt_lua_type_setmetafield(L,lua_widget,"__gc"); lua_pushcfunction(L,reset_member); dt_lua_type_register(L, lua_widget, "reset_callback"); lua_pushcfunction(L,widget_call); dt_lua_type_setmetafield(L,lua_widget,"__call"); lua_pushcfunction(L,sensitive_member); dt_lua_gtk_wrap(L); dt_lua_type_register(L, lua_widget, "sensitive"); lua_pushcfunction(L, dt_lua_widget_tostring_member); dt_lua_gtk_wrap(L); dt_lua_type_setmetafield(L,lua_widget,"__tostring"); dt_lua_init_widget_container(L); dt_lua_init_widget_box(L); dt_lua_init_widget_button(L); dt_lua_init_widget_check_button(L); dt_lua_init_widget_combobox(L); dt_lua_init_widget_label(L); dt_lua_init_widget_entry(L); dt_lua_init_widget_file_chooser_button(L); dt_lua_init_widget_separator(L); dt_lua_init_widget_slider(L); dt_lua_init_widget_stack(L); dt_lua_init_widget_text_view(L); dt_lua_push_darktable_lib(L); lua_pushstring(L, "new_widget"); lua_pushcfunction(L, &new_widget); lua_settable(L, -3); lua_pop(L, 1); return 0; }
int dt_lua_init_widget(lua_State* L) { dt_lua_module_new(L,"widget"); widget_type.associated_type = dt_lua_init_gpointer_type(L,lua_widget); lua_pushcfunction(L,tooltip_member); lua_pushcclosure(L,dt_lua_gtk_wrap,1); dt_lua_type_register(L, lua_widget, "tooltip"); lua_pushcfunction(L,widget_gc); lua_pushcclosure(L,dt_lua_gtk_wrap,1); dt_lua_type_setmetafield(L,lua_widget,"__gc"); lua_pushcfunction(L,reset_member); dt_lua_type_register(L, lua_widget, "reset_callback"); lua_pushcfunction(L,widget_call); dt_lua_type_setmetafield(L,lua_widget,"__call"); lua_pushcfunction(L,sensitive_member); lua_pushcclosure(L,dt_lua_gtk_wrap,1); dt_lua_type_register(L, lua_widget, "sensitive"); dt_lua_init_widget_container(L); dt_lua_init_widget_box(L); dt_lua_init_widget_button(L); dt_lua_init_widget_check_button(L); dt_lua_init_widget_combobox(L); dt_lua_init_widget_label(L); dt_lua_init_widget_entry(L); dt_lua_init_widget_file_chooser_button(L); dt_lua_init_widget_separator(L); dt_lua_init_widget_slider(L); dt_lua_init_widget_stack(L); luaA_enum(L,dt_lua_orientation_t); luaA_enum_value_name(L,dt_lua_orientation_t,GTK_ORIENTATION_HORIZONTAL,"horizontal"); luaA_enum_value_name(L,dt_lua_orientation_t,GTK_ORIENTATION_VERTICAL,"vertical"); dt_lua_push_darktable_lib(L); lua_pushstring(L, "new_widget"); lua_pushcfunction(L, &new_widget); lua_settable(L, -3); lua_pop(L, 1); return 0; }