Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
widget.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2015-2016 Jérémy Rosen.
4 Copyright (C) 2015-2016 Tobias Ellinghaus.
5 Copyright (C) 2016 Roman Lebedev.
6 Copyright (C) 2020-2021 Pascal Obry.
7 Copyright (C) 2021 Bill Ferguson.
8 Copyright (C) 2022 Martin Bařinka.
9
10 darktable is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14
15 darktable is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with darktable. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#pragma once
25
26#include "lua/call.h"
27#include "lua/lua.h"
28#include <gtk/gtk.h>
34
36
48
50
51
52
56void dt_lua_widget_set_callback(lua_State *L,int index,const char* name);
58void dt_lua_widget_get_callback(lua_State *L,int index,const char* name);
69
70/* wrapper to automatically implement a callback on a GTK signal */
71#define dt_lua_widget_register_gtk_callback(L,widget_type,signal_name,lua_name,callback) \
72 dt_lua_widget_register_gtk_callback_type(L,luaA_type_find(L, #widget_type),signal_name,lua_name,callback)
73void dt_lua_widget_register_gtk_callback_type(lua_State *L,luaA_Type type_id,const char* signal_name, const char* lua_name,GCallback callback);
74
75
76#define dt_lua_init_widget_type(L, widget_type,lua_type,gtk_type) \
77 dt_lua_init_widget_type_type(L, widget_type, #lua_type,gtk_type)
79
89
90
92
93// clang-format off
94// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
95// vim: shiftwidth=2 expandtab tabstop=2 cindent
96// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
97// clang-format on
98
const float L
Definition colorspaces_inline_conversions.h:724
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
char * name
Definition common/metadata.c:61
int luaA_Type
Definition lua.h:97
int lua_State
Definition lua.h:95
struct _GtkWidget GtkWidget
Definition splash.h:29
Definition widget.h:30
GtkWidget * widget
Definition widget.h:31
struct dt_lua_widget_type_t * type
Definition widget.h:32
Definition widget.h:37
luaA_Type associated_type
Definition widget.h:45
size_t alloc_size
Definition widget.h:42
gboolean visible
Definition widget.h:41
GType gtk_type
Definition widget.h:46
void(* gui_init)(lua_State *L)
Definition widget.h:38
void(* gui_cleanup)(lua_State *L, lua_widget widget)
Definition widget.h:39
struct dt_lua_widget_type_t * parent
Definition widget.h:43
const char * name
Definition widget.h:40
int dt_lua_widget_trigger_callback(lua_State *L)
Definition widget.c:177
void dt_lua_widget_register_gtk_callback_type(lua_State *L, luaA_Type type_id, const char *signal_name, const char *lua_name, GCallback callback)
Definition widget.c:305
void dt_lua_widget_set_callback(lua_State *L, int index, const char *name)
Definition widget.c:159
void dt_lua_widget_get_callback(lua_State *L, int index, const char *name)
Definition widget.c:169
dt_lua_widget_t * lua_widget
Definition widget.h:35
void dt_lua_widget_bind(lua_State *L, lua_widget widget)
Definition widget.c:333
void dt_lua_widget_unbind(lua_State *L, lua_widget widget)
Definition widget.c:348
int dt_lua_init_widget(lua_State *L)
Definition widget.c:358
dt_lua_widget_type_t widget_type
Definition widget.c:47
luaA_Type dt_lua_init_widget_type_type(lua_State *L, dt_lua_widget_type_t *widget_type, const char *lua_type, GType gtk_type)
Definition widget.c:130