Ansel 0.0
A darktable fork - bloat + design vision
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
view_api.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2016-2021 darktable developers.
4
5 darktable is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 darktable is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include "common/module_api.h"
20#include "gui/gtk.h"
21
22#ifdef FULL_API_H
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#include <cairo/cairo.h>
29#include <glib.h>
30#include <stdint.h>
31
32struct dt_view_t;
33
34/* early definition of modules to do type checking */
35
36#pragma GCC visibility push(default)
37
38#endif // FULL_API_H
39
40OPTIONAL(const char *, name, const struct dt_view_t *self); // get translatable name
41OPTIONAL(uint32_t, view, const struct dt_view_t *self); // get the view type
42DEFAULT(uint32_t, flags, ); // get flags of the view
43OPTIONAL(void, init, struct dt_view_t *self); // init *data
44OPTIONAL(void, gui_init, struct dt_view_t *self); // create gtk elements, called after libs are created
45OPTIONAL(void, cleanup, struct dt_view_t *self); // cleanup *data
46OPTIONAL(void, expose, struct dt_view_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx,
47 int32_t pointery); // expose the module (gtk callback)
48OPTIONAL(int, try_enter, struct dt_view_t *self); // test if enter can succeed.
49OPTIONAL(void, enter, struct dt_view_t *self); // mode entered, this module got focus. return non-null on failure.
50OPTIONAL(void, leave, struct dt_view_t *self); // mode left (is called after the new try_enter has succeeded).
51OPTIONAL(void, reset, struct dt_view_t *self); // reset default appearance
52
53// event callbacks:
54OPTIONAL(void, mouse_enter, struct dt_view_t *self);
55OPTIONAL(void, mouse_leave, struct dt_view_t *self);
56OPTIONAL(void, mouse_moved, struct dt_view_t *self, double x, double y, double pressure, int which);
57
58OPTIONAL(int, button_released, struct dt_view_t *self, double x, double y, int which, uint32_t state);
59OPTIONAL(int, button_pressed, struct dt_view_t *self, double x, double y, double pressure,
60 int which, int type, uint32_t state);
61OPTIONAL(int, key_pressed, struct dt_view_t *self, GdkEventKey *event);
62
63OPTIONAL(void, configure, struct dt_view_t *self, int width, int height);
64OPTIONAL(int, scrolled, struct dt_view_t *self, double x, double y, int up, int state); // mouse scrolled in view
65OPTIONAL(void, scrollbar_changed, struct dt_view_t *self, double x, double y); // scrollbars changed in view
66
67#ifdef FULL_API_H
68
69#pragma GCC visibility pop
70
71#ifdef __cplusplus
72}
73#endif
74
75#endif // FULL_API_H
76
77// clang-format off
78// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
79// vim: shiftwidth=2 expandtab tabstop=2 cindent
80// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
81// clang-format on
int scrolled(struct dt_iop_module_t *self, double x, double y, int up, uint32_t state)
Definition ashift.c:4682
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:4309
int button_released(struct dt_iop_module_t *self, double x, double y, int which, uint32_t state)
Definition ashift.c:4516
int mouse_moved(struct dt_iop_module_t *self, double x, double y, double pressure, int which)
Definition ashift.c:4090
void cleanup(dt_imageio_module_format_t *self)
Definition avif.c:204
void init(dt_imageio_module_format_t *self)
Definition avif.c:142
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
int type
Definition common/metadata.c:42
char * name
Definition common/metadata.c:41
void leave(dt_view_t *self)
Definition darkroom.c:1994
void reset(dt_view_t *self)
Definition darkroom.c:545
int key_pressed(dt_view_t *self, GdkEventKey *event)
Definition darkroom.c:2693
void configure(dt_view_t *self, int wd, int ht)
Definition darkroom.c:2698
uint32_t view(const dt_view_t *self)
Definition darkroom.c:114
void enter(dt_view_t *self)
Definition darkroom.c:1875
void expose(dt_view_t *self, cairo_t *cri, int32_t width, int32_t height, int32_t pointerx, int32_t pointery)
Definition darkroom.c:312
int try_enter(dt_view_t *self)
Definition darkroom.c:553
void mouse_enter(dt_view_t *self)
Definition darkroom.c:2150
static void gui_init(dt_lib_import_t *d)
Definition import.c:926
dt_mipmap_buffer_dsc_flags flags
Definition mipmap_cache.c:4
#define DEFAULT(return_type, function_name,...)
Definition module_api.h:75
#define OPTIONAL(return_type, function_name,...)
Definition module_api.h:73
Definition views/view.h:95
int mouse_leave(struct dt_iop_module_t *self)
Definition toneequal.c:2023