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-2015 Jérémy Rosen.
4 Copyright (C) 2014, 2016 Tobias Ellinghaus.
5 Copyright (C) 2016 Roman Lebedev.
6 Copyright (C) 2020 Pascal Obry.
7 Copyright (C) 2022 Martin Bařinka.
8
9 darktable is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 darktable is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with darktable. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23#pragma once
24
26#include <lua/lua.h>
27
28
29#define dt_lua_register_module_member(L, storage, struct_type, member, member_type) \
30 luaA_struct_member_type(L, storage->parameter_lua_type, #member, luaA_type(L, member_type), \
31 offsetof(struct_type, member))
32
33#define dt_lua_register_module_member_indirect(L, storage, struct_type, struct_member, child_type,child_member, member_type) \
34 luaA_struct_member_type(L, storage->parameter_lua_type, #child_member, luaA_type(L, member_type), \
35 offsetof(struct_type, struct_member)+offsetof( child_type, child_member))
36
37// define a new module type
38void dt_lua_module_new(lua_State *L, const char *module_type_name);
39// get the singleton object that represent this module type
40void dt_lua_module_push(lua_State *L, const char *module_type_name);
41
42
44void dt_lua_module_entry_new(lua_State *L, int index, const char *module_type_name, const char *entry_name);
46void dt_lua_module_entry_new_singleton(lua_State *L, const char *module_type_name, const char *entry_name,
47 void *entry);
49void dt_lua_module_entry_push(lua_State *L, const char *module_type_name, const char *entry_name);
51luaA_Type dt_lua_module_entry_get_type(lua_State *L, const char *module_type_name, const char *entry_name);
52
54#define dt_lua_register_module_presets(L, module, entry, type) \
55 dt_lua_register_module_presets_type(L, module, entry, luaA_type_id(type))
56void dt_lua_register_module_presets_type(lua_State *L, const char *module_type_name, const char *entry_name,
57 luaA_Type preset_type);
58luaA_Type dt_lua_module_get_preset_type(lua_State *L, const char *module_type_name, const char *entry_name);
59void dt_lua_register_current_preset(lua_State *L, const char *module_type_name, const char *entry_name,
60 lua_CFunction pusher, lua_CFunction getter);
61
62
64
65// clang-format off
66// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
67// vim: shiftwidth=2 expandtab tabstop=2 cindent
68// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
69// clang-format on
70
const float L
Definition colorspaces_inline_conversions.h:724
int luaA_Type
Definition lua.h:97
int(* lua_CFunction)(lua_State *L)
Definition lua.h:96
int lua_State
Definition lua.h:95
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:82
void dt_lua_module_push(lua_State *L, const char *module_type_name)
Definition modules.c:43
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:112
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:92
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:74
void dt_lua_module_new(lua_State *L, const char *module_type_name)
Definition modules.c:30
luaA_Type dt_lua_module_get_preset_type(lua_State *L, const char *module_type_name, const char *entry_name)
Definition modules.c:103
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:61
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:51
int dt_lua_init_early_modules(lua_State *L)
Definition modules.c:130