![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Go to the source code of this file.
Macros | |
#define | dt_lua_init_type(L, type_name) dt_lua_init_type_type(L, luaA_type(L, type_name)) |
#define | dt_lua_type_register_const(L, type_name, name) dt_lua_type_register_const_type(L, luaA_type_find(L, #type_name), name) |
register a read-only member, the member function is popped from the stack | |
#define | dt_lua_type_register(L, type_name, name) dt_lua_type_register_type(L, luaA_type_find(L, #type_name), name) |
register a read-write member, the member function is popped from the stack | |
#define | dt_lua_type_register_struct(L, type_name) dt_lua_type_register_struct_type(L, luaA_type_find(L, #type_name)) |
#define | dt_lua_type_register_number(L, type_name) dt_lua_type_register_number_type(L, luaA_type_find(L, #type_name)) |
#define | dt_lua_type_register_number_const(L, type_name) dt_lua_type_register_number_const_type(L, luaA_type_find(L, #type_name)) |
#define | dt_lua_type_register_parent(L, type_name, parent_type_name) dt_lua_type_register_parent_type(L, luaA_type_find(L, #type_name), luaA_type_find(L, #parent_type_name)) |
#define | dt_lua_init_int_type(L, type_name) dt_lua_init_int_type_type(L, luaA_type(L, type_name)) |
#define | dt_lua_init_gpointer_type(L, type_name) dt_lua_init_gpointer_type_type(L, luaA_type(L, type_name)) |
#define | dt_lua_type_gpointer_alias(L, type_name, pointer, alias) dt_lua_type_gpointer_alias_type(L,luaA_type(L,type_name),pointer,alias) |
#define | dt_lua_isa(L, index, type) dt_lua_isa_type(L, index, luaA_type(L, type)) |
#define | dt_lua_type_setmetafield(L, type_name, name) dt_lua_type_setmetafield_type(L,luaA_type(L,type_name),name) |
Typedefs | |
typedef char * | char_20 |
typedef char * | char_32 |
typedef char * | char_52 |
typedef char * | char_64 |
typedef char * | char_128 |
typedef char * | char_256 |
typedef char * | char_512 |
typedef char * | char_1024 |
typedef char * | char_filename_length |
typedef char * | char_path_length |
typedef const char * | const_string |
typedef double | protected_double |
typedef double | progress_double |
typedef GtkOrientation | dt_lua_orientation_t |
typedef GtkAlign | dt_lua_align_t |
typedef PangoEllipsizeMode | dt_lua_ellipsize_mode_t |
#define dt_lua_init_gpointer_type | ( | L, | |
type_name | |||
) | dt_lua_init_gpointer_type_type(L, luaA_type(L, type_name)) |
#define dt_lua_init_int_type | ( | L, | |
type_name | |||
) | dt_lua_init_int_type_type(L, luaA_type(L, type_name)) |
similar to dt_lua_init_type but creates a type for int or gpointer singletons the type must match and will guarantee a singleton per value i.e if you push the same int twice, you will push the same lua object not recreate a different one each time the singleton objects will still correctly be garbage collected
#define dt_lua_init_type | ( | L, | |
type_name | |||
) | dt_lua_init_type_type(L, luaA_type(L, type_name)) |
(0,0) register a C type to the dt-lua subsystem
the type can be converted to/from C using the usual luaA functions. the type becomes a full userdata (i.e malloc+memcpy then pushed on the lua stack, released when not referenced in lua) you can use luaL_checkudata to get and check the data from the stack
the following metamethods are defined for the type __luaA_TypeName : string with the associated C type __luaA_Type : int, the associated luaA_Type __pairs : will return (__next,obj,nil) __next : will iteratethrough the __get table of obj __index : will look into the __get table to find a callback, then raise an error __newindex : will look into the __set table to find a callback, then raise an error __get : empty table, contains getters, similar API to __index __set : empty table, contains setters, similar API to __newindex
#define dt_lua_isa | ( | L, | |
index, | |||
type | |||
) | dt_lua_isa_type(L, index, luaA_type(L, type)) |
#define dt_lua_type_gpointer_alias | ( | L, | |
type_name, | |||
pointer, | |||
alias | |||
) | dt_lua_type_gpointer_alias_type(L,luaA_type(L,type_name),pointer,alias) |
make a pointer an alias of another pointer. Both pointers will push the same lua object when pushed on the stack. The object contains the original pointer
#define dt_lua_type_register | ( | L, | |
type_name, | |||
name | |||
) | dt_lua_type_register_type(L, luaA_type_find(L, #type_name), name) |
register a read-write member, the member function is popped from the stack
#define dt_lua_type_register_const | ( | L, | |
type_name, | |||
name | |||
) | dt_lua_type_register_const_type(L, luaA_type_find(L, #type_name), name) |
register a read-only member, the member function is popped from the stack
#define dt_lua_type_register_number | ( | L, | |
type_name | |||
) | dt_lua_type_register_number_type(L, luaA_type_find(L, #type_name)) |
#define dt_lua_type_register_number_const | ( | L, | |
type_name | |||
) | dt_lua_type_register_number_const_type(L, luaA_type_find(L, #type_name)) |
#define dt_lua_type_register_parent | ( | L, | |
type_name, | |||
parent_type_name | |||
) | dt_lua_type_register_parent_type(L, luaA_type_find(L, #type_name), luaA_type_find(L, #parent_type_name)) |
register a type as a parent type the type will reuse all members and metafiels from the parent (unless it has its own) inheritance will be marked in __luaA_ParentMetatable THIS FUNCTION MUST BE CALLED AFTER PARENT WAS COMPLETELY DEFINED
#define dt_lua_type_register_struct | ( | L, | |
type_name | |||
) | dt_lua_type_register_struct_type(L, luaA_type_find(L, #type_name)) |
register a function for all fields of luaautoc struct, the member function is popped from the stack detects red-only vs read-write automatically
#define dt_lua_type_setmetafield | ( | L, | |
type_name, | |||
name | |||
) | dt_lua_type_setmetafield_type(L,luaA_type(L,type_name),name) |
typedef char* char_1024 |
typedef char* char_128 |
typedef char* char_20 |
these defines can be used with luaA_struct_member to have checks on read added
typedef char* char_256 |
typedef char* char_32 |
typedef char* char_512 |
typedef char* char_52 |
typedef char* char_64 |
typedef char* char_filename_length |
typedef char* char_path_length |
typedef const char* const_string |
typedef GtkAlign dt_lua_align_t |
typedef PangoEllipsizeMode dt_lua_ellipsize_mode_t |
typedef GtkOrientation dt_lua_orientation_t |
typedef double progress_double |
typedef double protected_double |
int dt_lua_init_early_types | ( | lua_State * | L | ) |
References gpointer_pushfunc(), gpointer_tofunc(), gpointer_wrapper(), and init_metatable().
Referenced by dt_lua_init_widget_type_type().
References init_metatable(), int_pushfunc(), and int_tofunc().
similar to dt_lua_init_type but creates a singleton type that is : a type who has only one instance (which is a void* pointer) returns the associated luaA_Type so it can be decorated push the single instance of the object on the stack
References init_metatable().
Referenced by dt_lua_init_call(), dt_lua_init_database(), dt_lua_init_film(), dt_lua_init_gui(), dt_lua_init_styles(), dt_lua_init_tags(), dt_lua_init_wrapped_singleton(), dt_lua_module_entry_new_singleton(), and dt_lua_module_new().
References full_pushfunc(), full_tofunc(), and init_metatable().
Referenced by register_storage().
luaA_Type dt_lua_init_wrapped_singleton | ( | lua_State * | L, |
lua_CFunction | pusher, | ||
lua_CFunction | getter, | ||
const char * | unique_name, | ||
void * | data | ||
) |
similar to dt_lua_init_singleton but the singleton has push and pop functions to save/restore the lua object called on
References dt_lua_init_singleton(), wrapped_index(), wrapped_newindex(), wrapped_pairs(), and wrapped_tostring().
Referenced by dt_lua_register_current_preset().
References dt_lua_typeisa_type().
Referenced by full_tofunc(), gpointer_tofunc(), and int_tofunc().
void dt_lua_type_gpointer_alias_type | ( | lua_State * | L, |
luaA_Type | type_id, | ||
void * | pointer, | ||
void * | alias | ||
) |
Referenced by get_widget_params().
drop a gpointer. Pushing the pointer again will create a new object. We can't guarantee when the original object will be GC, but it will point to NULL instead of its normal content. accessing it from the lua side will cause an error luaA_to will also raise an error NOTE : if the object had aliases, the aliases will return NULL too.
Referenced by _guides_draw_callback().
int dt_lua_type_member_common | ( | lua_State * | L | ) |
member function for common members. The common member must be the only upvalue of the function
Referenced by dt_lua_init_cairo(), dt_lua_init_call(), dt_lua_init_database(), dt_lua_init_early_format(), dt_lua_init_early_lib(), dt_lua_init_early_storage(), dt_lua_init_film(), dt_lua_init_gui(), dt_lua_init_image(), dt_lua_init_styles(), dt_lua_init_tags(), dt_lua_module_entry_new(), dt_lua_register_current_preset(), and init().
int dt_lua_type_member_luaautoc | ( | lua_State * | L | ) |
member function for luaautoc struct, will use luaautoc to push/pull content
Referenced by dt_imageio_load_module_format(), dt_imageio_load_module_storage(), and dt_lua_init_styles().
Referenced by dt_lua_init_database(), dt_lua_init_film(), dt_lua_init_styles(), and dt_lua_init_tags().
References dt_lua_type_register_const_type(), and dt_lua_type_register_type().
Referenced by dt_imageio_load_module_format(), and dt_imageio_load_module_storage().
References name.
Referenced by dt_lua_init_gui(), dt_lua_type_register_struct_type(), dt_lua_widget_register_gtk_callback_type(), init(), and init().
References dt_lua_typeisa_type().
Referenced by dt_lua_init_widget_type_type(), dt_lua_lib_register(), dt_lua_register_format_type(), dt_lua_register_storage_type(), and dt_lua_register_view().
References dt_lua_typeisa_type().
Referenced by dt_lua_isa_type(), dt_lua_type_setmetafield_type(), and dt_lua_typeisa_type().