Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
imageop_gui.h
Go to the documentation of this file.
1 /*
2 This file is part of darktable,
3 Copyright (C) 2009-2011, 2014 johannes hanika.
4 Copyright (C) 2012 Richard Wonka.
5 Copyright (C) 2016 Tobias Ellinghaus.
6 Copyright (C) 2020, 2022 Diederik Ter Rahe.
7 Copyright (C) 2020-2021 Pascal Obry.
8 Copyright (C) 2022 Martin Bařinka.
9 Copyright (C) 2025 Alynx Zhou.
10
11 darktable is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
15
16 darktable is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with darktable. If not, see <http://www.gnu.org/licenses/>.
23*/
24
25#ifndef DT_DEVELOP_IMAGEOP_GUI_H
26#define DT_DEVELOP_IMAGEOP_GUI_H
27
28#include "develop/imageop.h"
29
76
77
82{
83 return m->gui ? m->gui->gui_data : NULL;
84}
85
87{
88 // Align so that DT_ALIGNED_ARRAY may be used within gui_data struct
89 module->gui->gui_data = (dt_iop_gui_data_t*)dt_calloc_align(size);
90 dt_pthread_mutex_init(&module->gui->gui_lock,NULL);
91 return module->gui->gui_data;
92}
93#define IOP_GUI_ALLOC(module) \
94 (dt_iop_##module##_gui_data_t *)_iop_gui_alloc(self,sizeof(dt_iop_##module##_gui_data_t))
95
96#define IOP_GUI_FREE \
97 dt_pthread_mutex_destroy(&self->gui->gui_lock); \
98 if(self->gui->gui_data) \
99 { \
100 dt_free_align(self->gui->gui_data); \
101 self->gui->gui_data = NULL; \
102 } \
103 self->gui->gui_data = NULL;
104
105#include "widgets/paint.h" // DTGTKCairoPaintIconFunc, named in three declarations below
106
107#ifdef __cplusplus
108extern "C" {
109#endif
110
112
114
116
117GtkWidget *dt_iop_togglebutton_new(dt_iop_module_t *self, const char *section, const gchar *label, const gchar *ctrl_label,
118 GCallback callback, gboolean local, guint accel_key, GdkModifierType mods,
121GtkWidget *dt_iop_togglebutton_new_no_register(dt_iop_module_t *self, const char *section, const gchar *label,
122 const gchar *ctrl_label, GCallback callback, gboolean local,
123 guint accel_key, GdkModifierType mods,
125
126GtkWidget *dt_iop_button_new(dt_iop_module_t *self, const gchar *label,
127 GCallback callback, gboolean local, guint accel_key, GdkModifierType mods,
128 DTGTKCairoPaintIconFunc paint, gint paintflags, GtkWidget *box);
129
130/* returns up or !up depending on the masks_updown preference */
131gboolean dt_mask_scroll_increases(int up);
132
133
134/* The IOP-parameter flavour of widgets/resetlabel.h: a label that, when double-clicked,
135 * restores one parameter to its default, refreshes the module GUI and records history.
136 *
137 * The widget itself knows none of that -- it only emits "reset". This wrapper is where the
138 * IOP meaning is attached, which is why it lives in develop/ and not in widgets/. */
139GtkWidget *dt_iop_gui_reset_label_new(const gchar *label, dt_iop_module_t *module, void *param,
140 int param_size);
141
142#ifdef __cplusplus
143}
144#endif
145
146#endif // DT_DEVELOP_IMAGEOP_GUI_H
147
148// clang-format off
149// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
150// vim: shiftwidth=2 expandtab tabstop=2 cindent
151// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
152// clang-format on
#define m
Definition basecurve.c:283
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
static int dt_pthread_mutex_init(dt_pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr)
Initialise a mutex. With mutexattr NULL – which is how 54 of the 56 call sites in this tree spell it ...
Definition dtpthread.h:104
GtkWidget * dt_iop_togglebutton_new_no_register(dt_iop_module_t *self, const char *section, const gchar *label, const gchar *ctrl_label, GCallback callback, gboolean local, guint accel_key, GdkModifierType mods, DTGTKCairoPaintIconFunc paint, GtkWidget *box)
GtkWidget * dt_iop_button_new(dt_iop_module_t *self, const gchar *label, GCallback callback, gboolean local, guint accel_key, GdkModifierType mods, DTGTKCairoPaintIconFunc paint, gint paintflags, GtkWidget *box)
GtkWidget * dt_iop_gui_reset_label_new(const gchar *label, dt_iop_module_t *module, void *param, int param_size)
GtkWidget * dt_iop_togglebutton_new(dt_iop_module_t *self, const char *section, const gchar *label, const gchar *ctrl_label, GCallback callback, gboolean local, guint accel_key, GdkModifierType mods, DTGTKCairoPaintIconFunc paint, GtkWidget *box)
GtkWidget * dt_bauhaus_toggle_from_params(dt_iop_module_t *self, const char *param)
GtkWidget * dt_bauhaus_slider_from_params(dt_iop_module_t *self, const char *param)
static dt_iop_gui_data_t * dt_iop_gui_data(const struct dt_iop_module_t *m)
The module's GUI data blob, NULL-safe for headless callers: IOP process() implementations read it for...
Definition imageop_gui.h:81
gboolean dt_mask_scroll_increases(int up)
GtkWidget * dt_bauhaus_combobox_from_params(dt_iop_module_t *self, const char *param)
static dt_iop_gui_data_t * _iop_gui_alloc(dt_iop_module_t *module, size_t size)
Definition imageop_gui.h:86
size_t size
Definition mipmap_cache.c:3
const float const float param
The interactive half of a module instance, owned by the GUI.
Definition imageop_gui.h:40
GtkWidget * header
Definition imageop_gui.h:53
GtkWidget * presets_button
Definition imageop_gui.h:62
GtkWidget * guides_combo
Definition imageop_gui.h:67
GtkWidget * guides_toggle
Definition imageop_gui.h:66
dt_iop_gui_data_t * gui_data
Definition imageop_gui.h:42
GtkWidget * reset_button
Definition imageop_gui.h:60
gboolean multi_show_down
Definition imageop_gui.h:70
gboolean multi_show_new
Definition imageop_gui.h:71
GtkWidget * mask_indicator
Definition imageop_gui.h:55
GtkWidget * expander
Definition imageop_gui.h:57
GtkWidget * fusion_slider
Definition imageop_gui.h:64
GtkWidget * multimenu_button
Definition imageop_gui.h:72
GtkWidget * widget
Definition imageop_gui.h:47
gboolean multi_show_close
Definition imageop_gui.h:68
dt_pthread_mutex_t gui_lock
Definition imageop_gui.h:43
struct dt_iop_module_gui_t * gui
Definition imageop.h:346
void(* DTGTKCairoPaintIconFunc)(cairo_t *cr, gint x, gint y, gint w, gint h, gint flags, void *data)