Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
types.c File Reference
#include "lua/types.h"
#include "common/darktable.h"
#include "common/file_location.h"
#include "control/control.h"
#include "lua/call.h"
#include <math.h>
#include <stdarg.h>
#include <string.h>
+ Include dependency graph for types.c:

Functions

static void to_char_array (lua_State *L, luaA_Type type_id, void *c_out, int index, int size)
 
static int push_char_array (lua_State *L, luaA_Type type_id, const void *c_in)
 
static void to_char20 (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static void to_char32 (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static void to_char52 (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static void to_char64 (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static void to_char128 (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static void to_char256 (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static void to_char512 (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static void to_char1024 (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static void to_charfilename_length (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static void to_charpath_length (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static int push_protected_double (lua_State *L, luaA_Type type_id, const void *c_in)
 
static int push_progress_double (lua_State *L, luaA_Type type_id, const void *c_in)
 
static void to_progress_double (lua_State *L, luaA_Type type_id, void *c_out, int index)
 
static int autotype_next (lua_State *L)
 
static int autotype_pairs (lua_State *L)
 
static int autotype_index (lua_State *L)
 
static int autotype_newindex (lua_State *L)
 
static int autotype_tostring (lua_State *L)
 
static int full_pushfunc (lua_State *L, luaA_Type type_id, const void *cin)
 
static void full_tofunc (lua_State *L, luaA_Type type_id, void *cout, int index)
 
static int int_pushfunc (lua_State *L, luaA_Type type_id, const void *cin)
 
static void int_tofunc (lua_State *L, luaA_Type type_id, void *cout, int index)
 
static int gpointer_pushfunc (lua_State *L, luaA_Type type_id, const void *cin)
 
static void gpointer_tofunc (lua_State *L, luaA_Type type_id, void *cout, int index)
 
static int unknown_pushfunc (lua_State *L, luaA_Type type_id, const void *cin)
 
void dt_lua_type_register_type (lua_State *L, luaA_Type type_id, const char *name)
 
void dt_lua_type_register_const_type (lua_State *L, luaA_Type type_id, const char *name)
 
void dt_lua_type_register_number_const_type (lua_State *L, luaA_Type type_id)
 
void dt_lua_type_register_number_type (lua_State *L, luaA_Type type_id)
 
int dt_lua_type_member_luaautoc (lua_State *L)
 member function for luaautoc struct, will use luaautoc to push/pull content
 
void dt_lua_type_register_struct_type (lua_State *L, luaA_Type type_id)
 
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
 
void dt_lua_type_register_parent_type (lua_State *L, luaA_Type type_id, luaA_Type parent_type_id)
 
static void init_metatable (lua_State *L, luaA_Type type_id)
 
luaA_Type dt_lua_init_type_type (lua_State *L, luaA_Type type_id)
 
luaA_Type dt_lua_init_singleton (lua_State *L, const char *unique_name, void *data)
 
static int wrapped_index (lua_State *L)
 
static int wrapped_pairs (lua_State *L)
 
static int wrapped_newindex (lua_State *L)
 
static int wrapped_tostring (lua_State *L)
 
luaA_Type dt_lua_init_wrapped_singleton (lua_State *L, lua_CFunction pusher, lua_CFunction getter, const char *unique_name, void *data)
 
luaA_Type dt_lua_init_int_type_type (lua_State *L, luaA_Type type_id)
 
static int gpointer_wrapper (lua_State *L)
 
luaA_Type dt_lua_init_gpointer_type_type (lua_State *L, luaA_Type type_id)
 
void dt_lua_type_gpointer_alias_type (lua_State *L, luaA_Type type_id, void *pointer, void *alias)
 
void dt_lua_type_gpointer_drop (lua_State *L, void *pointer)
 
gboolean dt_lua_isa_type (lua_State *L, int index, luaA_Type type_id)
 
gboolean dt_lua_typeisa_type (lua_State *L, luaA_Type obj_type, luaA_Type type_id)
 
void dt_lua_type_setmetafield_type (lua_State *L, luaA_Type type_id, const char *method_name)
 
int dt_lua_init_early_types (lua_State *L)
 

Function Documentation

◆ autotype_index()

static int autotype_index ( lua_State L)
static

Referenced by init_metatable().

◆ autotype_newindex()

static int autotype_newindex ( lua_State L)
static

Referenced by init_metatable().

◆ autotype_next()

static int autotype_next ( lua_State L)
static

References dt_lua_treated_pcall(), and key.

Referenced by init_metatable().

◆ autotype_pairs()

static int autotype_pairs ( lua_State L)
static

Referenced by init_metatable().

◆ autotype_tostring()

static int autotype_tostring ( lua_State L)
static

Referenced by init_metatable().

◆ dt_lua_init_early_types()

◆ dt_lua_init_gpointer_type_type()

luaA_Type dt_lua_init_gpointer_type_type ( lua_State L,
luaA_Type  type_id 
)

◆ dt_lua_init_int_type_type()

luaA_Type dt_lua_init_int_type_type ( lua_State L,
luaA_Type  type_id 
)

◆ dt_lua_init_singleton()

luaA_Type dt_lua_init_singleton ( lua_State L,
const char *  unique_name,
void data 
)

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().

◆ dt_lua_init_type_type()

luaA_Type dt_lua_init_type_type ( lua_State L,
luaA_Type  type_id 
)

◆ dt_lua_init_wrapped_singleton()

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().

◆ dt_lua_isa_type()

gboolean dt_lua_isa_type ( lua_State L,
int  index,
luaA_Type  type_id 
)

◆ dt_lua_type_gpointer_alias_type()

void dt_lua_type_gpointer_alias_type ( lua_State L,
luaA_Type  type_id,
void pointer,
void alias 
)

Referenced by get_widget_params().

◆ dt_lua_type_gpointer_drop()

void dt_lua_type_gpointer_drop ( lua_State L,
void pointer 
)

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().

◆ dt_lua_type_member_common()

◆ dt_lua_type_member_luaautoc()

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().

◆ dt_lua_type_register_const_type()

◆ dt_lua_type_register_number_const_type()

void dt_lua_type_register_number_const_type ( lua_State L,
luaA_Type  type_id 
)

◆ dt_lua_type_register_number_type()

void dt_lua_type_register_number_type ( lua_State L,
luaA_Type  type_id 
)

◆ dt_lua_type_register_parent_type()

◆ dt_lua_type_register_struct_type()

void dt_lua_type_register_struct_type ( lua_State L,
luaA_Type  type_id 
)

◆ dt_lua_type_register_type()

void dt_lua_type_register_type ( lua_State L,
luaA_Type  type_id,
const char *  name 
)

◆ dt_lua_type_setmetafield_type()

void dt_lua_type_setmetafield_type ( lua_State L,
luaA_Type  type_id,
const char *  method_name 
)

◆ dt_lua_typeisa_type()

gboolean dt_lua_typeisa_type ( lua_State L,
luaA_Type  obj_type,
luaA_Type  type_id 
)

◆ full_pushfunc()

static int full_pushfunc ( lua_State L,
luaA_Type  type_id,
const void cin 
)
static

Referenced by dt_lua_init_type_type().

◆ full_tofunc()

static void full_tofunc ( lua_State L,
luaA_Type  type_id,
void cout,
int  index 
)
static

References dt_lua_isa_type().

Referenced by dt_lua_init_type_type().

◆ gpointer_pushfunc()

static int gpointer_pushfunc ( lua_State L,
luaA_Type  type_id,
const void cin 
)
static

◆ gpointer_tofunc()

static void gpointer_tofunc ( lua_State L,
luaA_Type  type_id,
void cout,
int  index 
)
static

◆ gpointer_wrapper()

static int gpointer_wrapper ( lua_State L)
static

◆ init_metatable()

◆ int_pushfunc()

static int int_pushfunc ( lua_State L,
luaA_Type  type_id,
const void cin 
)
static

◆ int_tofunc()

static void int_tofunc ( lua_State L,
luaA_Type  type_id,
void cout,
int  index 
)
static

References dt_lua_isa_type().

Referenced by dt_lua_init_int_type_type().

◆ push_char_array()

static int push_char_array ( lua_State L,
luaA_Type  type_id,
const void c_in 
)
static

Referenced by dt_lua_init_early_types().

◆ push_progress_double()

static int push_progress_double ( lua_State L,
luaA_Type  type_id,
const void c_in 
)
static

Referenced by dt_lua_init_early_types().

◆ push_protected_double()

static int push_protected_double ( lua_State L,
luaA_Type  type_id,
const void c_in 
)
static

Referenced by dt_lua_init_early_types().

◆ to_char1024()

static void to_char1024 ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

References to_char_array().

Referenced by dt_lua_init_early_types().

◆ to_char128()

static void to_char128 ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

References to_char_array().

Referenced by dt_lua_init_early_types().

◆ to_char20()

static void to_char20 ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

References to_char_array().

Referenced by dt_lua_init_early_types().

◆ to_char256()

static void to_char256 ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

References to_char_array().

Referenced by dt_lua_init_early_types().

◆ to_char32()

static void to_char32 ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

References to_char_array().

Referenced by dt_lua_init_early_types().

◆ to_char512()

static void to_char512 ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

References to_char_array().

Referenced by dt_lua_init_early_types().

◆ to_char52()

static void to_char52 ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

References to_char_array().

Referenced by dt_lua_init_early_types().

◆ to_char64()

static void to_char64 ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

References to_char_array().

Referenced by dt_lua_init_early_types().

◆ to_char_array()

static void to_char_array ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index,
int  size 
)
static

◆ to_charfilename_length()

static void to_charfilename_length ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

◆ to_charpath_length()

static void to_charpath_length ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

References PATH_MAX, and to_char_array().

Referenced by dt_lua_init_early_types().

◆ to_progress_double()

static void to_progress_double ( lua_State L,
luaA_Type  type_id,
void c_out,
int  index 
)
static

Referenced by dt_lua_init_early_types().

◆ unknown_pushfunc()

static int unknown_pushfunc ( lua_State L,
luaA_Type  type_id,
const void cin 
)
static

Referenced by dt_lua_init_early_types().

◆ wrapped_index()

static int wrapped_index ( lua_State L)
static

◆ wrapped_newindex()

static int wrapped_newindex ( lua_State L)
static

◆ wrapped_pairs()

static int wrapped_pairs ( lua_State L)
static

◆ wrapped_tostring()

static int wrapped_tostring ( lua_State L)
static