Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
views/lighttable.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2009-2015 johannes hanika.
4 Copyright (C) 2010-2012 Henrik Andersson.
5 Copyright (C) 2010-2018 Tobias Ellinghaus.
6 Copyright (C) 2011 Antony Dovgal.
7 Copyright (C) 2011 Jérémy Rosen.
8 Copyright (C) 2011 Omari Stephens.
9 Copyright (C) 2011 Robert Bieber.
10 Copyright (C) 2011 Rostyslav Pidgornyi.
11 Copyright (C) 2011 Simon Spannagel.
12 Copyright (C) 2012 Christian Tellefsen.
13 Copyright (C) 2012-2014 José Carlos García Sogo.
14 Copyright (C) 2012 Petr Styblo.
15 Copyright (C) 2012 Richard Wonka.
16 Copyright (C) 2012 Ulrich Pegelow.
17 Copyright (C) 2013 Eckhart Pedersen.
18 Copyright (C) 2013 Jochem Kossen.
19 Copyright (C) 2013-2016, 2018-2021 Pascal Obry.
20 Copyright (C) 2013 Pierre Le Magourou.
21 Copyright (C) 2013-2016 Roman Lebedev.
22 Copyright (C) 2014-2015, 2019-2022 Aldric Renaudin.
23 Copyright (C) 2014 Matthias Gehre.
24 Copyright (C) 2014 Mikhail Trishchenkov.
25 Copyright (C) 2014 moopmonster.
26 Copyright (C) 2014-2015 Pedro Côrte-Real.
27 Copyright (C) 2015 Jan Kundrát.
28 Copyright (C) 2015 JohnnyRun.
29 Copyright (C) 2016 Asma.
30 Copyright (C) 2017 Dan Torop.
31 Copyright (C) 2017 itinerarium.
32 Copyright (C) 2017, 2019 luzpaz.
33 Copyright (C) 2017, 2019 Marcello Mamino.
34 Copyright (C) 2017 Matthieu Moy.
35 Copyright (C) 2017 parafin.
36 Copyright (C) 2017-2018 Peter Budai.
37 Copyright (C) 2018 Frederic Chanal.
38 Copyright (C) 2018-2019 Heiko Bauke.
39 Copyright (C) 2018 Mario Lueder.
40 Copyright (C) 2018 Rick Yorgason.
41 Copyright (C) 2018-2019 Rikard Öxler.
42 Copyright (C) 2019-2020, 2022-2023, 2025 Aurélien PIERRE.
43 Copyright (C) 2019 Edgardo Hoszowski.
44 Copyright (C) 2019 jakubfi.
45 Copyright (C) 2019, 2022 Philippe Weyland.
46 Copyright (C) 2019 Sam Smith.
47 Copyright (C) 2019 vacaboja.
48 Copyright (C) 2020 Bill Ferguson.
49 Copyright (C) 2020-2021 Chris Elston.
50 Copyright (C) 2020-2022 Diederik Ter Rahe.
51 Copyright (C) 2020 EdgarLux.
52 Copyright (C) 2020 Hanno Schwalm.
53 Copyright (C) 2020 Hubert Kowalski.
54 Copyright (C) 2021 domosbg.
55 Copyright (C) 2021 Fabio Heer.
56 Copyright (C) 2021 Ralf Brown.
57 Copyright (C) 2022 Martin Bařinka.
58 Copyright (C) 2022 Sakari Kapanen.
59 Copyright (C) 2022 solarer.
60
61 darktable is free software: you can redistribute it and/or modify
62 it under the terms of the GNU General Public License as published by
63 the Free Software Foundation, either version 3 of the License, or
64 (at your option) any later version.
65
66 darktable is distributed in the hope that it will be useful,
67 but WITHOUT ANY WARRANTY; without even the implied warranty of
68 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
69 GNU General Public License for more details.
70
71 You should have received a copy of the GNU General Public License
72 along with darktable. If not, see <http://www.gnu.org/licenses/>.
73*/
76#include "widgets/bauhaus.h"
77#include "common/collection.h"
78#include "history/history.h"
80#include "common/undo.h"
81#include "control/control.h"
82#include "control/jobs.h"
84
85#include "views/view.h"
86#include "views/view_api.h"
87
88#include <assert.h>
89#include <dirent.h>
90#include <errno.h>
91#include <gdk/gdkkeysyms.h>
92#include <math.h>
93#include <pthread.h>
94#include <stdio.h>
95#include <stdlib.h>
96#include <string.h>
97#include <strings.h>
98#include <sys/stat.h>
99#include <sys/types.h>
100#include <unistd.h>
101#include "gui/application.h"
102#include "control/signal.h"
103#include "gui/window_manager.h"
104#include "widgets/accelerators.h"
105
106DT_MODULE(1)
107
108
112typedef struct dt_library_t
113{
115
116const char *name(const dt_view_t *self)
117{
118 return _("Lighttable");
119}
120
121
122uint32_t view(const dt_view_t *self)
123{
124 return DT_VIEW_LIGHTTABLE;
125}
126
128{
129 dt_free(self->data);
130}
131
132
133static void _view_lighttable_activate_callback(gpointer instance, int32_t imgid, gpointer user_data)
134{
135 if(imgid > UNKNOWN_IMAGE)
136 {
138 }
139}
140
141void configure(dt_view_t *self, int width, int height)
142{
146 g_idle_add((GSourceFunc)dt_thumbtable_scroll_to_active_rowid, table);
147}
148
149
174
175void init(dt_view_t *self)
176{
177 self->data = calloc(1, sizeof(dt_library_t));
178 // ensure the memory table is up to date
180}
181
182void leave(dt_view_t *self)
183{
184 // Detach shortcuts
186
187 // ensure we have no active image remaining
189
190 dt_thumbtable_stop(dt_gui_get_ui()->thumbtable_lighttable);
191 dt_thumbtable_hide(dt_gui_get_ui()->thumbtable_lighttable);
192 gtk_widget_show(dt_gui_center_widget());
193
194 /* disconnect from filmstrip image activate */
196 (gpointer)self);
197}
198
199void reset(dt_view_t *self)
200{
202}
203
204// clang-format off
205// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
206// vim: shiftwidth=2 expandtab tabstop=2 cindent
207// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
208// clang-format on
void dt_accels_connect_accels(dt_accels_t *accels)
Actually enable accelerators after having loaded user config.
void dt_accels_connect_active_group(dt_accels_t *accels, const gchar *group)
Connect the contextual active accels group to the window. Views can declare their own set of contextu...
void dt_accels_disconnect_active_group(dt_accels_t *accels)
Disconnect the contextual active accels group from the window.
Handle default and user-set shortcuts (accelerators)
struct dt_accels_t * dt_gui_get_accels(void)
struct dt_ui_t * dt_gui_get_ui(void)
GtkWidget * dt_gui_center_widget(void)
void dt_gui_refocus_center()
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
void dt_collection_update_query(const dt_collection_t *collection, dt_collection_change_t query_change, dt_collection_properties_t changed_property, GList *list)
Definition collection.c:837
dt_collection_t * dt_collection_get_global(void)
Definition collection.c:138
void dt_collection_memory_update()
Definition collection.c:216
void dt_collection_hint_message(const dt_collection_t *collection)
Definition collection.c:912
@ DT_COLLECTION_PROP_UNDEF
Definition collection.h:155
@ DT_COLLECTION_CHANGE_RELOAD
Definition collection.h:164
void dt_control_set_mouse_over_id(int32_t value)
Definition control.c:994
struct dt_view_manager_t * dt_view_manager_get_global(void)
Definition darktable.c:599
void dt_ui_panel_show(dt_ui_t *ui, const dt_ui_panel_t p, gboolean show, gboolean write)
shows/hide a panel
Definition display.c:129
GtkWidget * view
the tree view
#define UNKNOWN_IMAGE
Definition image.h:78
#define dt_free(ptr)
g_free() ptr and set it to NULL, skipping both if it is already NULL.
Definition mem_alloc.h:171
uint32_t width
Definition mipmap_cache.c:0
uint32_t height
Definition mipmap_cache.c:1
#define DT_MODULE(MODVER)
Instantiate the version handshake every module must export. Use once, at file scope,...
const char * name
Definition pdf.h:90
#define DT_DEBUG_CONTROL_SIGNAL_DISCONNECT(ctlsig, cb, user_data)
Definition signal.h:407
struct dt_control_signal_t * dt_control_signal_get_global(void)
Definition darktable.c:616
@ DT_SIGNAL_VIEWMANAGER_THUMBTABLE_ACTIVATE
Definition signal.h:98
#define DT_DEBUG_CONTROL_SIGNAL_CONNECT(ctlsig, signal, cb, user_data)
Definition signal.h:396
dt_thumbtable_t * thumbtable_lighttable
GModule *void * data
Definition view.h:159
void dt_thumbtable_set_active_rowid(dt_thumbtable_t *table)
Update internal active row tracking.
Definition thumbtable.c:381
void dt_thumbtable_stop(dt_thumbtable_t *table)
int dt_thumbtable_scroll_to_active_rowid(dt_thumbtable_t *table)
Scroll to show the active row.
Definition thumbtable.c:447
void dt_thumbtable_update_parent(dt_thumbtable_t *table)
A widget to manage and display image thumbnails in Ansel's lighttable and filmstrip views.
static void dt_thumbtable_show(dt_thumbtable_t *table)
Show the thumbnail table widget.
Definition thumbtable.h:395
static void dt_thumbtable_hide(dt_thumbtable_t *table)
Hide the thumbnail table widget.
Definition thumbtable.h:410
#define dt_thumbtable_redraw(table)
Definition thumbtable.h:387
void dt_undo_clear(dt_undo_t *self, uint32_t filter)
Definition undo.c:367
@ DT_UNDO_LIGHTTABLE
Definition undo.h:56
dt_undo_t * dt_undo_get_global(void)
Definition darktable.c:611
void dt_view_active_images_reset(gboolean raise)
Definition view.c:1266
int dt_view_manager_switch(dt_view_manager_t *vm, const char *view_name)
Definition view.c:234
@ DT_VIEW_LIGHTTABLE
Definition view.h:77
void init(dt_view_t *self)
void leave(dt_view_t *self)
void cleanup(dt_view_t *self)
static void _view_lighttable_activate_callback(gpointer instance, int32_t imgid, gpointer user_data)
void reset(dt_view_t *self)
void enter(dt_view_t *self)
void configure(dt_view_t *self, int width, int height)
@ DT_UI_PANEL_BOTTOM
@ DT_UI_PANEL_RIGHT