Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
modules.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2013-2020 darktable developers.
4
5 darktable is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 darktable is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
22#include <lua/lua.h>
23
24
25#define dt_lua_register_module_member(L, storage, struct_type, member, member_type) \
26 luaA_struct_member_type(L, storage->parameter_lua_type, #member, luaA_type(L, member_type), \
27 offsetof(struct_type, member))
28
29#define dt_lua_register_module_member_indirect(L, storage, struct_type, struct_member, child_type,child_member, member_type) \
30 luaA_struct_member_type(L, storage->parameter_lua_type, #child_member, luaA_type(L, member_type), \
31 offsetof(struct_type, struct_member)+offsetof( child_type, child_member))
32
33// define a new module type
34void dt_lua_module_new(lua_State *L, const char *module_type_name);
35// get the singleton object that represent this module type
36void dt_lua_module_push(lua_State *L, const char *module_type_name);
37
38
40void dt_lua_module_entry_new(lua_State *L, int index, const char *module_type_name, const char *entry_name);
42void dt_lua_module_entry_new_singleton(lua_State *L, const char *module_type_name, const char *entry_name,
43 void *entry);
45void dt_lua_module_entry_push(lua_State *L, const char *module_type_name, const char *entry_name);
47luaA_Type dt_lua_module_entry_get_type(lua_State *L, const char *module_type_name, const char *entry_name);
48
50#define dt_lua_register_module_presets(L, module, entry, type) \
51 dt_lua_register_module_presets_type(L, module, entry, luaA_type_id(type))
52void dt_lua_register_module_presets_type(lua_State *L, const char *module_type_name, const char *entry_name,
53 luaA_Type preset_type);
54luaA_Type dt_lua_module_get_preset_type(lua_State *L, const char *module_type_name, const char *entry_name);
55void dt_lua_register_current_preset(lua_State *L, const char *module_type_name, const char *entry_name,
56 lua_CFunction pusher, lua_CFunction getter);
57
58
60
61// clang-format off
62// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
63// vim: shiftwidth=2 expandtab tabstop=2 cindent
64// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
65// clang-format on
66
int luaA_Type
Definition lua.h:92
int(* lua_CFunction)(lua_State *L)
Definition lua.h:91
int lua_State
Definition lua.h:90
luaA_Type dt_lua_module_entry_get_type(lua_State *L, const char *module_type_name, const char *entry_name)
get the type of an entry
Definition modules.c:77
void dt_lua_module_push(lua_State *L, const char *module_type_name)
Definition modules.c:38
void dt_lua_register_current_preset(lua_State *L, const char *module_type_name, const char *entry_name, lua_CFunction pusher, lua_CFunction getter)
Definition modules.c:107
void dt_lua_register_module_presets_type(lua_State *L, const char *module_type_name, const char *entry_name, luaA_Type preset_type)
Definition modules.c:87
void dt_lua_module_entry_push(lua_State *L, const char *module_type_name, const char *entry_name)
get the singleton reprensenting an entry
Definition modules.c:69
void dt_lua_module_new(lua_State *L, const char *module_type_name)
Definition modules.c:25
luaA_Type dt_lua_module_get_preset_type(lua_State *L, const char *module_type_name, const char *entry_name)
Definition modules.c:98
void dt_lua_module_entry_new(lua_State *L, int index, const char *module_type_name, const char *entry_name)
create a new entry into the module, the object to be the entry is taken from the index)
Definition modules.c:56
void dt_lua_module_entry_new_singleton(lua_State *L, const char *module_type_name, const char *entry_name, void *entry)
create a new entry into the module, a singleton is created for you that contains entry
Definition modules.c:46
int dt_lua_init_early_modules(lua_State *L)
Definition modules.c:125