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 21 #ifdef FULL_API_H 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 #include <cairo/cairo.h> 28 #include <glib.h> 29 #include <stdint.h> 30 31 struct dt_view_t; 32 33 /* early definition of modules to do type checking */ 34 35 #pragma GCC visibility push(default) 36 37 #endif // FULL_API_H 38 39 OPTIONAL(const char *, name, const struct dt_view_t *self); // get translatable name 40 OPTIONAL(uint32_t, view, const struct dt_view_t *self); // get the view type 41 DEFAULT(uint32_t, flags, ); // get flags of the view 42 OPTIONAL(void, init, struct dt_view_t *self); // init *data 43 OPTIONAL(void, gui_init, struct dt_view_t *self); // create gtk elements, called after libs are created 44 OPTIONAL(void, cleanup, struct dt_view_t *self); // cleanup *data 45 OPTIONAL(void, expose, struct dt_view_t *self, cairo_t *cr, int32_t width, int32_t height, int32_t pointerx, 46 int32_t pointery); // expose the module (gtk callback) 47 OPTIONAL(int, try_enter, struct dt_view_t *self); // test if enter can succeed. 48 OPTIONAL(void, enter, struct dt_view_t *self); // mode entered, this module got focus. return non-null on failure. 49 OPTIONAL(void, leave, struct dt_view_t *self); // mode left (is called after the new try_enter has succeeded). 50 OPTIONAL(void, reset, struct dt_view_t *self); // reset default appearance 51 52 // event callbacks: 53 OPTIONAL(void, mouse_enter, struct dt_view_t *self); 54 OPTIONAL(void, mouse_leave, struct dt_view_t *self); 55 OPTIONAL(void, mouse_moved, struct dt_view_t *self, double x, double y, double pressure, int which); 56 57 OPTIONAL(int, button_released, struct dt_view_t *self, double x, double y, int which, uint32_t state); 58 OPTIONAL(int, button_pressed, struct dt_view_t *self, double x, double y, double pressure, 59 int which, int type, uint32_t state); 60 OPTIONAL(void, configure, struct dt_view_t *self, int width, int height); 61 OPTIONAL(void, scrolled, struct dt_view_t *self, double x, double y, int up, int state); // mouse scrolled in view 62 OPTIONAL(void, scrollbar_changed, struct dt_view_t *self, double x, double y); // scrollbars changed in view 63 64 // keyboard accel callbacks 65 OPTIONAL(void, init_key_accels, struct dt_view_t *self); 66 OPTIONAL(void, connect_key_accels, struct dt_view_t *self); 67 68 // list of mouse actions 69 OPTIONAL(GSList *, mouse_actions, const struct dt_view_t *self); 70 71 #ifdef FULL_API_H 72 73 #pragma GCC visibility pop 74 75 #ifdef __cplusplus 76 } 77 #endif 78 79 #endif // FULL_API_H 80 81 // modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh 82 // vim: shiftwidth=2 expandtab tabstop=2 cindent 83 // kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified; 84