Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
view_api.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2016 Roman Lebedev.
4 Copyright (C) 2016 Tobias Ellinghaus.
5 Copyright (C) 2017 luzpaz.
6 Copyright (C) 2018, 2020-2021 Pascal Obry.
7 Copyright (C) 2018 Rikard Öxler.
8 Copyright (C) 2019 Aldric Renaudin.
9 Copyright (C) 2021-2022 Diederik Ter Rahe.
10 Copyright (C) 2022 Martin Bařinka.
11 Copyright (C) 2025 Aurélien PIERRE.
12 Copyright (C) 2025 Guillaume Stutin.
13
14 darktable is free software: you can redistribute it and/or modify
15 it under the terms of the GNU Lesser General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 darktable is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public License
25 along with darktable. If not, see <http://www.gnu.org/licenses/>.
26*/
27#include "common/module_api.h"
28#include "gui/gtk.h"
29
30#ifdef FULL_API_H
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#include <cairo/cairo.h>
37#include <glib.h>
38#include <stdint.h>
39
40struct dt_view_t;
41
42/* early definition of modules to do type checking */
43
44#pragma GCC visibility push(default)
45
46#endif // FULL_API_H
47
48OPTIONAL(const char *, name, const struct dt_view_t *self); // get translatable name
49OPTIONAL(uint32_t, view, const struct dt_view_t *self); // get the view type
50DEFAULT(uint32_t, flags, ); // get flags of the view
51OPTIONAL(void, init, struct dt_view_t *self); // init *data
52OPTIONAL(void, gui_init, struct dt_view_t *self); // create gtk elements, called after libs are created
53OPTIONAL(void, cleanup, struct dt_view_t *self); // cleanup *data
54OPTIONAL(void, expose, struct dt_view_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx,
55 int32_t pointery); // expose the module (gtk callback)
56OPTIONAL(int, try_enter, struct dt_view_t *self); // test if enter can succeed.
57OPTIONAL(void, enter, struct dt_view_t *self); // mode entered, this module got focus. return non-null on failure.
58OPTIONAL(void, leave, struct dt_view_t *self); // mode left (is called after the new try_enter has succeeded).
59OPTIONAL(void, reset, struct dt_view_t *self); // reset default appearance
60
61// event callbacks:
62OPTIONAL(void, mouse_enter, struct dt_view_t *self);
63OPTIONAL(void, mouse_leave, struct dt_view_t *self);
64OPTIONAL(void, mouse_moved, struct dt_view_t *self, double x, double y, double pressure, int which);
65
66OPTIONAL(int, button_released, struct dt_view_t *self, double x, double y, int which, uint32_t state);
67OPTIONAL(int, button_pressed, struct dt_view_t *self, double x, double y, double pressure,
68 int which, int type, uint32_t state);
69OPTIONAL(int, key_pressed, struct dt_view_t *self, GdkEventKey *event);
70
71OPTIONAL(void, configure, struct dt_view_t *self, int width, int height);
72OPTIONAL(int, scrolled, struct dt_view_t *self, double x, double y, int up, int state, int delta_y); // mouse scrolled in view
73OPTIONAL(void, scrollbar_changed, struct dt_view_t *self, double x, double y); // scrollbars changed in view
74
75#ifdef FULL_API_H
76
77#pragma GCC visibility pop
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif // FULL_API_H
84
85// clang-format off
86// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
87// vim: shiftwidth=2 expandtab tabstop=2 cindent
88// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
89// clang-format on
int scrolled(struct dt_iop_module_t *self, double x, double y, int up, uint32_t state)
Definition ashift.c:4969
int button_pressed(struct dt_iop_module_t *self, double x, double y, double pressure, int which, int type, uint32_t state)
Definition ashift.c:4583
int button_released(struct dt_iop_module_t *self, double x, double y, int which, uint32_t state)
Definition ashift.c:4798
int mouse_moved(struct dt_iop_module_t *self, double x, double y, double pressure, int which)
Definition ashift.c:4360
void cleanup(dt_imageio_module_format_t *self)
Definition avif.c:213
void init(dt_imageio_module_format_t *self)
Definition avif.c:151
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
int type
Definition common/metadata.c:62
char * name
Definition common/metadata.c:61
int mouse_leave(struct dt_iop_module_t *self)
Definition crop.c:1735
void leave(dt_view_t *self)
Definition darkroom.c:2464
void reset(dt_view_t *self)
Definition darkroom.c:1102
int key_pressed(dt_view_t *self, GdkEventKey *event)
Definition darkroom.c:3085
void configure(dt_view_t *self, int wd, int ht)
Definition darkroom.c:3167
uint32_t view(const dt_view_t *self)
Definition darkroom.c:194
void enter(dt_view_t *self)
Definition darkroom.c:2382
void expose(dt_view_t *self, cairo_t *cri, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
Definition darkroom.c:790
int try_enter(dt_view_t *self)
Definition darkroom.c:1208
void mouse_enter(dt_view_t *self)
Definition darkroom.c:2665
static void gui_init(dt_lib_import_t *d)
Definition import.c:939
static const float x
Definition iop_profile.h:239
dt_mipmap_buffer_dsc_flags flags
Definition mipmap_cache.c:4
#define DEFAULT(return_type, function_name,...)
Definition module_api.h:81
#define OPTIONAL(return_type, function_name,...)
Definition module_api.h:79
Definition views/view.h:123