Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
usermanual_url.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2018, 2020 rawfiner.
4 Copyright (C) 2020-2021 Aldric Renaudin.
5 Copyright (C) 2020-2021 Pascal Obry.
6 Copyright (C) 2021 Chris Elston.
7 Copyright (C) 2021 Hubert Kowalski.
8 Copyright (C) 2021 Jim Robinson.
9 Copyright (C) 2022-2023 Aurélien PIERRE.
10 Copyright (C) 2022 Diederik Ter Rahe.
11 Copyright (C) 2022 Martin Bařinka.
12
13 darktable is free software: you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 darktable is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with darktable. If not, see <http://www.gnu.org/licenses/>.
25*/
26
28#include "common/darktable.h"
29#include "common/l10n.h"
30
31
32// The base_url is: ansel.photos/
33// The full format for the documentation pages is:
34// <base-url>/<lang>/doc[/path/to/page]
35// Where:
36// <lang> = en / fr ... (default = en)
37
38const char *base_url = "https://ansel.photos/";
39const char *doc_url = "doc/";
40
41
42const char *get_lang()
43{
44 char *lang = "en";
45
46 // array of languages the usermanual supports.
47 // NULL MUST remain the last element of the array
48 const char *supported_languages[] =
49 { "en", "fr", NULL };
50
51 int lang_index = 0;
52 gboolean is_language_supported = FALSE;
53
55 {
56 dt_l10n_language_t *language = NULL;
57
58 if(darktable.l10n->selected != -1)
59 language = (dt_l10n_language_t *)g_list_nth(darktable.l10n->languages, darktable.l10n->selected)->data;
60
61 if (!IS_NULL_PTR(language))
62 lang = language->code;
63
64 while(supported_languages[lang_index])
65 {
66 gchar *nlang = g_strdup(lang);
67 is_language_supported = !g_ascii_strcasecmp(nlang, supported_languages[lang_index]);
68
69 if(!is_language_supported)
70 {
71 // keep only first part up to _
72 for(gchar *p = nlang; *p; p++)
73 if(*p == '_') *p = '\0';
74
75 if(!g_ascii_strcasecmp(nlang, supported_languages[lang_index]))
76 {
77 is_language_supported = TRUE;
78 }
79 }
80
81 dt_free(nlang);
82 if(is_language_supported) break;
83
84 lang_index++;
85 }
86 }
87
88 // language not found, default to EN
89 if(!is_language_supported) lang_index = 0;
90
91 return supported_languages[lang_index];
92}
93
94typedef struct _help_url
95{
96 char *name;
97 char *url;
99
101{
102 {"ratings", "views/lighttable/digital-asset-management/star-color/#star-ratings"},
103 {"layout_filemanager", "views/lighttable/lighttable-modes/filemanager/"},
104 {"layout_zoomable", "views/lighttable/lighttable-modes/zoomable-lighttable/"},
105 {"layout_preview", "views/lighttable/lighttable-modes/full-preview/"},
106 {"filter", NULL},
107 {"colorlabels", "views/lighttable/digital-asset-management/star-color/#color-labels"},
108 {"import", "modules/utility-modules/lighttable/import/"},
109 {"select", "modules/utility-modules/lighttable/select/"},
110 {"image", "modules/utility-modules/lighttable/selected-image/"},
111 {"copy_history", "modules/utility-modules/lighttable/history-stack/"},
112 {"styles", "modules/utility-modules/lighttable/styles/#module-controls"},
113 {"metadata", "modules/utility-modules/shared/metadata-editor/"},
114 {"tagging", "modules/utility-modules/shared/tagging/"},
115 {"geotagging", "modules/utility-modules/shared/geotagging/"},
116 {"collect", "modules/utility-modules/shared/collections/"},
117 {"recentcollect", "modules/utility-modules/shared/recent-collections/"},
118 {"metadata_view", "modules/utility-modules/shared/image-information/"},
119 {"export", "modules/utility-modules/shared/export/"},
120 {"histogram", "modules/utility-modules/shared/histogram/"},
121 {"navigation", "modules/utility-modules/darkroom/navigation/"},
122 {"snapshots", "modules/utility-modules/darkroom/snapshots/"},
123 {"modulegroups", "modules/utility-modules/darkroom/manage-module-layouts/"},
124 {"history", "modules/utility-modules/darkroom/history-stack/"},
125 {"colorpicker", "modules/utility-modules/darkroom/global-color-picker/"},
126 {"masks", "modules/utility-modules/darkroom/mask-manager/"},
127 {"masks_drawn", "views/darkroom/masking-and-blending/masks/drawn/"},
128 {"masks_parametric", "views/darkroom/masking-and-blending/masks/parametric/"},
129 {"masks_raster", "views/darkroom/masking-and-blending/masks/raster/"},
130 {"masks_blending_op", "views/darkroom/masking-and-blending/masks/drawn-and-parametric/"},
131 {"masks_blending", "views/darkroom/masking-and-blending/overview/"},
132 {"masks_combined", "views/darkroom/masking-and-blending/masks/drawn-and-parametric/"},
133 {"masks_refinement", "views/darkroom/masking-and-blending/masks/refinement-controls/"},
134 {"duplicate", "modules/utility-modules/darkroom/duplicate-manager/"},
135 {"location", "modules/utility-modules/map/find-location/"},
136 {"map_settings", "modules/utility-modules/map/map-settings/"},
137 {"print_settings", "modules/utility-modules/print/print-settings/"},
138 {"print_settings_printer" "modules/utility-modules/print/print-settings/#printer"},
139 {"print_settings_page" "modules/utility-modules/print/print-settings/#page"},
140 {"print_settings_button" "modules/utility-modules/print/print-settings/#print-button"},
141 {"print_overview", "print/overview/"},
142 {"camera", "modules/utility-modules/tethering/camera-settings/"},
143 {"import_camera", "overview/workflow/import-rate-tag/"},
144 {"import_fr", "overview/workflow/import-rate-tag/"},
145 {"global_toolbox", "overview/user-interface/top-panel/#on-the-right-hand-side"},
146 {"views/lighttable_mode", "views/lighttable/overview/"},
147 {"views/lighttable_filemanager", "views/lighttable/lighttable-modes/filemanager/"},
148 {"views/lighttable_zoomable", "views/lighttable/lighttable-modes/zoomable-lighttable/"},
149 {"views/darkroom_bottom_panel", "views/darkroom/darkroom-view-layout/#bottom-panel"},
150 {"module_header", "views/darkroom/processing-modules/module-header/"},
151 {"session", "modules/utility-modules/tethering/session/"},
152 {"live_view", "modules/utility-modules/tethering/live-view/"},
153 {"module_toolbox", NULL},
154 {"view_toolbox", NULL},
155 {"backgroundjobs", NULL},
156 {"hinter", NULL},
157 {"filter", NULL},
158 {"filmstrip", "overview/user-interface/filmstrip/"},
159 {"viewswitcher", "overview/user-interface/views/"},
160 {"favorite_presets", "views/darkroom/darkroom-view-layout/#bottom-panel"},
161 {"bottom_panel_styles", "views/darkroom/darkroom-view-layout/#bottom-panel"},
162 {"rawoverexposed", "modules/utility-modules/darkroom/raw-overexposed/"},
163 {"overexposed", "modules/utility-modules/darkroom/clipping/"},
164 {"softproof", "modules/utility-modules/darkroom/soft-proof/"},
165 {"gamut", "modules/utility-modules/darkroom/gamut/"},
166 {"focuspeaking", "modules/utility-modules/shared/focus-peaking/"},
167
168 // iop links
169 {"ashift", "modules/processing-modules/rotate-perspective/"},
170 {"atrous", "modules/processing-modules/contrast-equalizer/"},
171 {"basecurve", "modules/processing-modules/base-curve/"},
172 {"bilateral", "modules/processing-modules/surface-blur/"},
173 {"bilat", "modules/processing-modules/local-contrast/"},
174 {"bloom", "modules/processing-modules/bloom/"},
175 {"borders", "modules/processing-modules/framing/"},
176 {"cacorrect", "modules/processing-modules/raw-chromatic-aberrations/"},
177 {"cacorrectrgb", "modules/processing-modules/chromatic-aberrations/"},
178 {"censorize", "modules/processing-modules/censorize/"},
179 {"channelmixer", "modules/processing-modules/channel-mixer/"},
180 {"channelmixerrgb", "modules/processing-modules/color-calibration/"},
181 {"clipping", "modules/processing-modules/crop-rotate/"},
182 {"colisa", "modules/processing-modules/contrast-brightness-saturation/"},
183 {"colorbalance", "modules/processing-modules/color-balance/"},
184 {"colorbalancergb", "modules/processing-modules/color-balance-rgb/"},
185 {"colorchecker", "modules/processing-modules/color-look-up-table/"},
186 {"colorcontrast", "modules/processing-modules/color-contrast/"},
187 {"colorcorrection", "modules/processing-modules/color-correction/"},
188 {"colorin", "modules/processing-modules/input-color-profile/"},
189 {"colorize", "modules/processing-modules/colorize/"},
190 {"colormapping", "modules/processing-modules/color-mapping/"},
191 {"colorout", "modules/processing-modules/output-color-profile/"},
192 {"colorreconstruct", "modules/processing-modules/color-reconstruction/"},
193 {"colorzones", "modules/processing-modules/color-zones/"},
194 {"crop", "modules/processing-modules/crop/"},
195 {"defringe", "modules/processing-modules/defringe/"},
196 {"demosaic", "modules/processing-modules/demosaic/"},
197 {"denoiseprofile", "modules/processing-modules/denoise-profiled/"},
198 {"dither", "modules/processing-modules/dithering/"},
199 {"exposure", "modules/processing-modules/exposure/"},
200 {"filmic", "modules/processing-modules/filmic-rgb/"},
201 {"filmicrgb", "modules/processing-modules/filmic-rgb/"},
202 {"flip", "modules/processing-modules/orientation/"},
203 {"globaltonemap", "modules/processing-modules/global-tonemap/"},
204 {"graduatednd", "modules/processing-modules/graduated-density/"},
205 {"grain", "modules/processing-modules/grain/"},
206 {"hazeremoval", "modules/processing-modules/haze-removal/"},
207 {"highlights", "modules/processing-modules/highlight-reconstruction/"},
208 {"highpass", "modules/processing-modules/highpass/"},
209 {"hotpixels", "modules/processing-modules/hot-pixels/"},
210 {"invert", "modules/processing-modules/invert/"},
211 {"lens", "modules/processing-modules/lens-correction/"},
212 {"levels", "modules/processing-modules/levels/"},
213 {"liquify", "modules/processing-modules/liquify/"},
214 {"lowlight", "modules/processing-modules/lowlight-vision/"},
215 {"lowpass", "modules/processing-modules/lowpass/"},
216 {"lut3d", "modules/processing-modules/lut-3d/"},
217 {"monochrome", "modules/processing-modules/monochrome/"},
218 {"negadoctor", "modules/processing-modules/negadoctor/"},
219 {"nlmeans", "modules/processing-modules/astrophoto-denoise/"},
220 {"profile_gamma", "modules/processing-modules/unbreak-input-profile/"},
221 {"rawdenoise", "modules/processing-modules/raw-denoise/"},
222 {"rawprepare", "modules/processing-modules/raw-black-white-point/"},
223 {"relight", "modules/processing-modules/fill-light/"},
224 {"retouch", "modules/processing-modules/retouch/"},
225 {"rgbcurve", "modules/processing-modules/rgb-curve/"},
226 {"rgblevels", "modules/processing-modules/rgb-levels/"},
227 {"rotatepixels", "modules/processing-modules/rotate-pixels/"},
228 {"scalepixels", "modules/processing-modules/scale-pixels/"},
229 {"shadhi", "modules/processing-modules/shadows-and-highlights/"},
230 {"sharpen", "modules/processing-modules/sharpen/"},
231 {"soften", "modules/processing-modules/soften/"},
232 {"splittoning", "modules/processing-modules/split-toning/"},
233 {"spots", "modules/processing-modules/spot-removal/"},
234 {"temperature", "modules/processing-modules/white-balance/"},
235 {"tonecurve", "modules/processing-modules/tone-curve/"},
236 {"toneequal", "modules/processing-modules/tone-equalizer/"},
237 {"tonemap", "modules/processing-modules/tone-mapping/"},
238 {"velvia", "modules/processing-modules/velvia/"},
239 {"vibrance", "modules/processing-modules/vibrance/"},
240 {"vignette", "modules/processing-modules/vignetting/"},
241 {"watermark", "modules/processing-modules/watermark/"},
242 {"zonesystem", "modules/processing-modules/zone-system/"},
243};
244
246{
247 if(IS_NULL_PTR(name)) return NULL;
248
249 for(int k=0; k< sizeof(urls_db)/2/sizeof(char *); k++)
250 if(!strcmp(urls_db[k].name, name))
251 return g_build_path("/", base_url, get_lang(), doc_url, urls_db[k].url, NULL);
252
253 return NULL;
254}
255// clang-format off
256// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
257// vim: shiftwidth=2 expandtab tabstop=2 cindent
258// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
259// clang-format on
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
char * name
darktable_t darktable
Definition darktable.c:181
#define dt_free(ptr)
Definition darktable.h:456
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
Definition darktable.h:281
float *const restrict const size_t k
struct dt_l10n_t * l10n
Definition darktable.h:789
char * code
Definition l10n.h:29
int selected
Definition l10n.h:37
GList * languages
Definition l10n.h:36
const char * get_lang()
const char * base_url
const char * doc_url
struct _help_url dt_help_url
char * dt_get_help_url(char *name)
dt_help_url urls_db[]