accelerators.h 4.26 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
    This file is part of darktable,
    copyright (c) 2011 robert bieber.

    darktable is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    darktable is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with darktable.  If not, see <http://www.gnu.org/licenses/>.
*/

19
#pragma once
20 21 22 23 24

#include <gtk/gtk.h>

#include "develop/imageop.h"
#include "libs/lib.h"
25
#include "views/view.h"
26 27 28 29 30

typedef struct dt_accel_t
{

  gchar path[256];
31 32
  gchar translated_path[256];
  gchar module[256];
33
  gboolean local;
34
  GClosure *closure;
35 36 37 38

} dt_accel_t;

// Accel path string building functions
39 40 41 42 43
void dt_accel_path_global(char *s, size_t n, const char *path);
void dt_accel_path_view(char *s, size_t n, char *module, const char *path);
void dt_accel_path_iop(char *s, size_t n, char *module, const char *path);
void dt_accel_path_lib(char *s, size_t n, char *module, const char *path);
void dt_accel_path_lua(char *s, size_t n, const char *path);
44 45 46 47 48 49 50
/**
  * Accepts an array of 4 char*, writes the following paths to them
  * 0 - Slider increase path
  * 1 - Slider decrease path
  * 2 - Slider reset path
  * 3 - Slider edit path
  */
51
void dt_accel_paths_slider_iop(char *s[], size_t n, char *module, const char *path);
52 53

// Accelerator registration functions
54 55 56
void dt_accel_register_global(const gchar *path, guint accel_key, GdkModifierType mods);
void dt_accel_register_view(dt_view_t *self, const gchar *path, guint accel_key, GdkModifierType mods);
void dt_accel_register_iop(dt_iop_module_so_t *so, gboolean local, const gchar *path, guint accel_key,
57
                           GdkModifierType mods);
58 59 60
void dt_accel_register_lib(dt_lib_module_t *self, const gchar *path, guint accel_key, GdkModifierType mods);
void dt_accel_register_slider_iop(dt_iop_module_so_t *so, gboolean local, const gchar *path);
void dt_accel_register_lua(const gchar *path, guint accel_key, GdkModifierType mods);
61 62 63

// Accelerator connection functions
void dt_accel_connect_global(const gchar *path, GClosure *closure);
64
void dt_accel_connect_view(dt_view_t *self, const gchar *path, GClosure *closure);
65 66
dt_accel_t *dt_accel_connect_iop(dt_iop_module_t *module, const gchar *path, GClosure *closure);
dt_accel_t *dt_accel_connect_lib(dt_lib_module_t *module, const gchar *path, GClosure *closure);
67 68 69
void dt_accel_connect_button_iop(dt_iop_module_t *module, const gchar *path, GtkWidget *button);
void dt_accel_connect_button_lib(dt_lib_module_t *module, const gchar *path, GtkWidget *button);
void dt_accel_connect_slider_iop(dt_iop_module_t *module, const gchar *path, GtkWidget *slider);
70
void dt_accel_connect_locals_iop(dt_iop_module_t *module);
71
void dt_accel_connect_preset_iop(dt_iop_module_t *so, const gchar *path);
72
void dt_accel_connect_preset_lib(dt_lib_module_t *so, const gchar *path);
73
void dt_accel_connect_lua(const gchar *path, GClosure *closure);
74 75 76

// Disconnect function
void dt_accel_disconnect_list(GSList *accels);
77 78 79
void dt_accel_disconnect_locals_iop(dt_iop_module_t *module);
void dt_accel_cleanup_locals_iop(dt_iop_module_t *module);

80
// Deregister functions
81 82
void dt_accel_deregister_iop(dt_iop_module_t *module, const gchar *path);
void dt_accel_deregister_lib(dt_lib_module_t *module, const gchar *path);
83
void dt_accel_deregister_global(const gchar *path);
84
void dt_accel_deregister_lua(const gchar *path);
Boucman's avatar
Boucman committed
85
// Rename functions
86 87 88 89
void dt_accel_rename_preset_iop(dt_iop_module_t *module, const gchar *path, const gchar *new_path);
void dt_accel_rename_preset_lib(dt_lib_module_t *module, const gchar *path, const gchar *new_path);
void dt_accel_rename_global(const gchar *path, const gchar *new_path);
void dt_accel_rename_lua(const gchar *path, const gchar *new_path);
90

Richard Wonka's avatar
Richard Wonka committed
91
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
92
// vim: shiftwidth=2 expandtab tabstop=2 cindent
Tobias Ellinghaus's avatar
Tobias Ellinghaus committed
93
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;