"Fossies" - the Fresh Open Source Software Archive

Member "darktable-3.6.1/src/gui/accelerators.h" (10 Sep 2021, 6047 Bytes) of package /linux/misc/darktable-3.6.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "accelerators.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3.2.1_vs_3.4.0.

    1 /*
    2     This file is part of darktable,
    3     Copyright (C) 2011-2020 darktable developers.
    4 
    5     darktable is free software: you can redistribute it and/or modify
    6     it under the terms of the GNU 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 General Public License for more details.
   14 
   15     You should have received a copy of the GNU General Public License
   16     along with darktable.  If not, see <http://www.gnu.org/licenses/>.
   17 */
   18 
   19 #pragma once
   20 
   21 #include <gtk/gtk.h>
   22 
   23 #include "develop/imageop.h"
   24 #include "libs/lib.h"
   25 #include "views/view.h"
   26 
   27 typedef struct dt_accel_t
   28 {
   29 
   30   gchar path[256];
   31   gchar translated_path[256];
   32   gchar module[256];
   33   gboolean local;
   34   dt_view_type_flags_t views;
   35   GClosure *closure;
   36 
   37 } dt_accel_t;
   38 
   39 typedef enum dt_accel_iop_slider_scale_t
   40 {
   41   DT_IOP_PRECISION_NORMAL = 0,
   42   DT_IOP_PRECISION_FINE = 1,
   43   DT_IOP_PRECISION_COARSE = 2
   44 } dt_accel_iop_slider_scale_t;
   45 
   46 // Accel path string building functions
   47 void dt_accel_path_global(char *s, size_t n, const char *path);
   48 void dt_accel_path_view(char *s, size_t n, char *module, const char *path);
   49 void dt_accel_path_iop(char *s, size_t n, char *module, const char *path);
   50 void dt_accel_path_lib(char *s, size_t n, char *module, const char *path);
   51 void dt_accel_path_lua(char *s, size_t n, const char *path);
   52 void dt_accel_path_manual(char *s, size_t n, const char *full_path);
   53 
   54 // Accelerator search functions
   55 dt_accel_t *dt_accel_find_by_path(const gchar *path);
   56 
   57 // Accelerator registration functions
   58 void dt_accel_register_global(const gchar *path, guint accel_key, GdkModifierType mods);
   59 void dt_accel_register_view(dt_view_t *self, const gchar *path, guint accel_key, GdkModifierType mods);
   60 void dt_accel_register_iop(dt_iop_module_so_t *so, gboolean local, const gchar *path, guint accel_key,
   61                            GdkModifierType mods);
   62 void dt_accel_register_lib(dt_lib_module_t *self, const gchar *path, guint accel_key, GdkModifierType mods);
   63 void dt_accel_register_lib_for_views(dt_lib_module_t *self, dt_view_type_flags_t views, const gchar *path,
   64                                      guint accel_key, GdkModifierType mods);
   65 //register lib shortcut but make it look like a view shortcut
   66 void dt_accel_register_lib_as_view(gchar *view_name, const gchar *path, guint accel_key, GdkModifierType mods);
   67 void dt_accel_register_common_iop(dt_iop_module_so_t *so);
   68 void dt_accel_register_slider_iop(dt_iop_module_so_t *so, gboolean local, const gchar *path);
   69 void dt_accel_register_combobox_iop(dt_iop_module_so_t *so, gboolean local, const gchar *path);
   70 void dt_accel_register_lua(const gchar *path, guint accel_key, GdkModifierType mods);
   71 void dt_accel_register_manual(const gchar *full_path, dt_view_type_flags_t views, guint accel_key,
   72                               GdkModifierType mods);
   73 
   74 // Accelerator connection functions
   75 void dt_accel_connect_global(const gchar *path, GClosure *closure);
   76 void dt_accel_connect_view(dt_view_t *self, const gchar *path, GClosure *closure);
   77 dt_accel_t *dt_accel_connect_iop(dt_iop_module_t *module, const gchar *path, GClosure *closure);
   78 dt_accel_t *dt_accel_connect_lib(dt_lib_module_t *module, const gchar *path, GClosure *closure);
   79 //connect lib as a view shortcut
   80 dt_accel_t *dt_accel_connect_lib_as_view(dt_lib_module_t *module, gchar *view_name, const gchar *path, GClosure *closure);
   81 //connect lib as a global shortcut
   82 dt_accel_t *dt_accel_connect_lib_as_global(dt_lib_module_t *module, const gchar *path, GClosure *closure);
   83 void dt_accel_connect_button_lib_as_global(dt_lib_module_t *module, const gchar *path, GtkWidget *button);
   84 void dt_accel_connect_button_iop(dt_iop_module_t *module, const gchar *path, GtkWidget *button);
   85 void dt_accel_connect_button_lib(dt_lib_module_t *module, const gchar *path, GtkWidget *button);
   86 void dt_accel_connect_slider_iop(dt_iop_module_t *module, const gchar *path, GtkWidget *slider);
   87 void dt_accel_connect_combobox_iop(dt_iop_module_t *module, const gchar *path, GtkWidget *combobox);
   88 void dt_accel_connect_instance_iop(dt_iop_module_t *module);
   89 void dt_accel_connect_locals_iop(dt_iop_module_t *module);
   90 void dt_accel_connect_preset_iop(dt_iop_module_t *so, const gchar *path);
   91 void dt_accel_connect_preset_lib(dt_lib_module_t *so, const gchar *path);
   92 void dt_accel_connect_lua(const gchar *path, GClosure *closure);
   93 void dt_accel_connect_manual(GSList **list_ptr, const gchar *full_path, GClosure *closure);
   94 
   95 // Disconnect function
   96 void dt_accel_disconnect_list(GSList **accels_ptr);
   97 void dt_accel_disconnect_locals_iop(dt_iop_module_t *module);
   98 void dt_accel_cleanup_closures_iop(dt_iop_module_t *module);
   99 
  100 // Deregister functions
  101 void dt_accel_deregister_iop(dt_iop_module_t *module, const gchar *path);
  102 void dt_accel_deregister_lib(dt_lib_module_t *module, const gchar *path);
  103 void dt_accel_deregister_global(const gchar *path);
  104 void dt_accel_deregister_lua(const gchar *path);
  105 void dt_accel_deregister_manual(GSList *list, const gchar *full_path);
  106 // Rename functions
  107 void dt_accel_rename_preset_iop(dt_iop_module_t *module, const gchar *path, const gchar *new_path);
  108 void dt_accel_rename_preset_lib(dt_lib_module_t *module, const gchar *path, const gchar *new_path);
  109 void dt_accel_rename_global(const gchar *path, const gchar *new_path);
  110 void dt_accel_rename_lua(const gchar *path, const gchar *new_path);
  111 
  112 // UX miscellaneous functions
  113 void dt_accel_widget_toast(GtkWidget *widget);
  114 
  115 // Get the scale multiplier for adjusting sliders with shortcuts
  116 float dt_accel_get_slider_scale_multiplier();
  117 
  118 // modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh
  119 // vim: shiftwidth=2 expandtab tabstop=2 cindent
  120 // kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;