Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2009-2012 johannes hanika.
4 Copyright (C) 2010-2012 Henrik Andersson.
5 Copyright (C) 2011 Brian Teague.
6 Copyright (C) 2011 Robert Bieber.
7 Copyright (C) 2011-2014, 2016-2017 Tobias Ellinghaus.
8 Copyright (C) 2012 Richard Wonka.
9 Copyright (C) 2014-2016 Jérémy Rosen.
10 Copyright (C) 2014, 2016 Roman Lebedev.
11 Copyright (C) 2019-2021 Aldric Renaudin.
12 Copyright (C) 2019 Edgardo Hoszowski.
13 Copyright (C) 2019 Heiko Bauke.
14 Copyright (C) 2019-2021 Pascal Obry.
15 Copyright (C) 2020-2021 Dan Torop.
16 Copyright (C) 2020-2022 Diederik Ter Rahe.
17 Copyright (C) 2020 Matthias Vogelgesang.
18 Copyright (C) 2020, 2022 Philippe Weyland.
19 Copyright (C) 2020 Ralf Brown.
20 Copyright (C) 2021 Mark-64.
21 Copyright (C) 2022 luzpaz.
22 Copyright (C) 2022 Martin Bařinka.
23 Copyright (C) 2024-2025 Aurélien PIERRE.
24
25 darktable is free software: you can redistribute it and/or modify
26 it under the terms of the GNU General Public License as published by
27 the Free Software Foundation, either version 3 of the License, or
28 (at your option) any later version.
29
30 darktable is distributed in the hope that it will be useful,
31 but WITHOUT ANY WARRANTY; without even the implied warranty of
32 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 GNU General Public License for more details.
34
35 You should have received a copy of the GNU General Public License
36 along with darktable. If not, see <http://www.gnu.org/licenses/>.
37*/
38
39#ifndef DT_LIBS_LIB_H
40#define DT_LIBS_LIB_H
41
43#include "views/view.h"
44#include <gmodule.h>
45#include <gtk/gtk.h>
46#include <glib.h>
47
48struct dt_lib_module_t;
50
52typedef struct dt_lib_t
53{
54 GList *plugins;
56
58 struct
59 {
60 struct
61 {
62 struct dt_lib_module_t *module;
66
67
68typedef struct dt_lib_module_t
69{
70 // Needs to stay on top for casting
72
73#define INCLUDE_API_FROM_MODULE_H
74#include "libs/lib_api.h"
75
77 GModule *module;
79 void *data;
81 char plugin_name[128];
90
94
96
97void dt_lib_init(dt_lib_t *lib);
98
99// Interim accessor (Strategy B, doc/globals-migration.md): implemented by the orchestrator; long-term the handle should be carried on the job/view context (Strategy C).
100struct dt_lib_t *dt_lib_get_global(void);
101void dt_lib_cleanup(dt_lib_t *lib);
102
106void dt_lib_gui_set_expanded(dt_lib_module_t *module, gboolean expanded);
109
112
114gboolean dt_lib_is_visible(dt_lib_module_t *module);
116void dt_lib_set_visible(dt_lib_module_t *module, gboolean visible);
119
121gchar *dt_lib_get_localized_name(const gchar *plugin_name);
122
126void dt_lib_presets_add(const char *name, const char *plugin_name, const int32_t version, const void *params,
127 const int32_t params_size, gboolean readonly);
128
130void dt_lib_queue_postponed_update(dt_lib_module_t *mod, void (*update_fn)(dt_lib_module_t *self));
133
134// apply a preset to the given module
135gboolean dt_lib_presets_apply(const gchar *preset, const gchar *module_name, int module_version);
136// duplicate a preset
137gchar *dt_lib_presets_duplicate(const gchar *preset, const gchar *module_name, int module_version);
138// remove a preset
139void dt_lib_presets_remove(const gchar *preset, const gchar *module_name, int module_version);
140// update a preset
141void dt_lib_presets_update(const gchar *preset, const gchar *module_name, int module_version, const gchar *newname,
142 const gchar *desc, const void *params, const int32_t params_size);
143// know if the module can autoapply presets
145
146/*
147 * Proxy functions
148 */
149
152
154void dt_lib_colorpicker_set_point(dt_lib_t *lib, const float pos[2]);
155
157gint dt_lib_sort_plugins(gconstpointer a, gconstpointer b);
160
162gboolean dt_handle_dialog_enter(GtkWidget *widget, GdkEventKey *event, gpointer data);
163
165GtkWidget *dt_action_button_new(dt_lib_module_t *self, const gchar *label, gpointer callback, gpointer data,
166 const gchar *tooltip, guint accel_key, GdkModifierType mods);
167
168#endif // DT_LIBS_LIB_H
169
170// clang-format off
171// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
172// vim: shiftwidth=2 expandtab tabstop=2 cindent
173// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
174// clang-format on
size_t params_size(dt_imageio_module_format_t *self)
Definition avif.c:571
typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
GtkWidget * view
the tree view
float dt_boundingbox_t[4]
Definition image.h:83
const char * tooltip
Definition image.h:310
struct dt_iop_tonecurve_params_t preset
gboolean dt_handle_dialog_enter(GtkWidget *widget, GdkEventKey *event, gpointer data)
Definition lib.c:1324
gboolean dt_lib_presets_can_autoapply(dt_lib_module_t *mod)
Definition lib.c:1319
gint dt_lib_sort_plugins(gconstpointer a, gconstpointer b)
Definition lib.c:492
void dt_lib_colorpicker_set_box_area(dt_lib_t *lib, const dt_boundingbox_t box)
Definition lib.c:1229
void dt_lib_cancel_postponed_update(dt_lib_module_t *mod)
Definition lib.c:1309
gboolean dt_lib_gui_get_expanded(dt_lib_module_t *module)
Definition lib.c:914
void dt_lib_init(dt_lib_t *lib)
Definition lib.c:1123
void dt_lib_presets_remove(const gchar *preset, const gchar *module_name, int module_version)
Definition lib.c:285
void dt_lib_init_presets(dt_lib_module_t *module)
Definition lib.c:618
struct dt_lib_t * dt_lib_get_global(void)
Definition darktable.c:621
GtkWidget * dt_action_button_new(dt_lib_module_t *self, const gchar *label, gpointer callback, gpointer data, const gchar *tooltip, guint accel_key, GdkModifierType mods)
Definition lib.c:1336
gboolean dt_lib_is_visible_in_view(dt_lib_module_t *module, const dt_view_t *view)
Definition lib.c:114
void dt_lib_queue_postponed_update(dt_lib_module_t *mod, void(*update_fn)(dt_lib_module_t *self))
Definition lib.c:1297
void dt_lib_presets_add(const char *name, const char *plugin_name, const int32_t version, const void *params, const int32_t params_size, gboolean readonly)
Definition lib.c:1152
gboolean dt_lib_presets_apply(const gchar *preset, const gchar *module_name, int module_version)
Definition lib.c:290
void dt_lib_colorpicker_set_point(dt_lib_t *lib, const float pos[2])
Definition lib.c:1251
gboolean dt_lib_is_visible(dt_lib_module_t *module)
Definition lib.c:1178
gchar * dt_lib_presets_duplicate(const gchar *preset, const gchar *module_name, int module_version)
Definition lib.c:265
void dt_lib_gui_set_expanded(dt_lib_module_t *module, gboolean expanded)
Definition lib.c:854
void dt_lib_presets_update(const gchar *preset, const gchar *module_name, int module_version, const gchar *newname, const gchar *desc, const void *params, const int32_t params_size)
Definition lib.c:330
dt_lib_module_t * dt_lib_get_module(const char *name)
Definition lib.c:1272
void dt_lib_set_visible(dt_lib_module_t *module, gboolean visible)
Definition lib.c:1188
void dt_lib_cleanup(dt_lib_t *lib)
Definition lib.c:1131
GtkWidget * dt_lib_gui_get_expander(dt_lib_module_t *module)
Definition lib.c:1039
gchar * dt_lib_get_localized_name(const gchar *plugin_name)
Definition lib.c:1212
const char * name
Definition pdf.h:90
The dt_gui_module_t type is the intersection between a dt_lib_module_t and a dt_iop_module_t structur...
GtkWidget * expander
Definition lib.h:85
GtkWidget * reset_button
Definition lib.h:92
GtkWidget * presets_button
Definition lib.h:93
void(* _postponed_update)(struct dt_lib_module_t *self)
Definition lib.h:87
char plugin_name[128]
Definition lib.h:81
dt_gui_module_t common_fields
Definition lib.h:71
GModule *void * data
Definition lib.h:79
GtkWidget * arrow
Definition lib.h:91
GtkWidget * widget
Definition lib.h:83
guint timeout_handle
Definition lib.h:89
Definition lib.h:53
struct dt_lib_t::@48::@49 navigation
struct dt_lib_t::@48 proxy
struct dt_lib_module_t * gui_module
Definition lib.h:55
GList * plugins
Definition lib.h:54