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 "bauhaus/bauhaus.h"
77#include "common/collection.h"
78#include "common/colorlabels.h"
79#include "common/darktable.h"
80#include "common/debug.h"
82#include "common/grouping.h"
83#include "common/history.h"
84#include "common/image_cache.h"
85#include "common/ratings.h"
86#include "common/selection.h"
87#include "common/undo.h"
88#include "control/conf.h"
89#include "control/control.h"
90#include "control/jobs.h"
91#include "control/settings.h"
92#include "dtgtk/button.h"
93#include "dtgtk/thumbtable.h"
94
95#include "gui/drag_and_drop.h"
96#include "gui/draw.h"
97#include "gui/gtk.h"
98#include "libs/lib.h"
99#include "views/view.h"
100#include "views/view_api.h"
101
102#include <assert.h>
103#include <dirent.h>
104#include <errno.h>
105#include <gdk/gdkkeysyms.h>
106#include <math.h>
107#include <pthread.h>
108#include <stdio.h>
109#include <stdlib.h>
110#include <string.h>
111#include <strings.h>
112#include <sys/stat.h>
113#include <sys/types.h>
114#include <unistd.h>
115
116DT_MODULE(1)
117
118
122typedef struct dt_library_t
123{
125
126const char *name(const dt_view_t *self)
127{
128 return _("Lighttable");
129}
130
131
132uint32_t view(const dt_view_t *self)
133{
134 return DT_VIEW_LIGHTTABLE;
135}
136
138{
139 dt_free(self->data);
140}
141
142
143static void _view_lighttable_activate_callback(gpointer instance, int32_t imgid, gpointer user_data)
144{
145 if(imgid > UNKNOWN_IMAGE)
146 {
148 }
149}
150
151void configure(dt_view_t *self, int width, int height)
152{
156 g_idle_add((GSourceFunc)dt_thumbtable_scroll_to_active_rowid, table);
157}
158
159
184
185void init(dt_view_t *self)
186{
187 self->data = calloc(1, sizeof(dt_library_t));
188 // ensure the memory table is up to date
190}
191
192void leave(dt_view_t *self)
193{
194 // Detach shortcuts
196
197 // ensure we have no active image remaining
199
202 gtk_widget_show(dt_ui_center(darktable.gui->ui));
203
204 /* disconnect from filmstrip image activate */
206 (gpointer)self);
207}
208
209void reset(dt_view_t *self)
210{
212}
213
214// clang-format off
215// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
216// vim: shiftwidth=2 expandtab tabstop=2 cindent
217// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
218// 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.
#define TRUE
Definition ashift_lsd.c:162
#define FALSE
Definition ashift_lsd.c:158
int width
Definition bilateral.h:1
int height
Definition bilateral.h:1
void dt_collection_update_query(const dt_collection_t *collection, dt_collection_change_t query_change, dt_collection_properties_t changed_property, GList *list)
void dt_collection_memory_update()
Definition collection.c:201
void dt_collection_hint_message(const dt_collection_t *collection)
@ DT_COLLECTION_PROP_UNDEF
Definition collection.h:142
@ DT_COLLECTION_CHANGE_RELOAD
Definition collection.h:151
char * name
void dt_control_set_mouse_over_id(int32_t value)
Definition control.c:931
darktable_t darktable
Definition darktable.c:181
#define UNKNOWN_IMAGE
Definition darktable.h:182
#define DT_MODULE(MODVER)
Definition darktable.h:140
#define dt_free(ptr)
Definition darktable.h:456
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:124
void dt_gui_refocus_center()
Definition gtk.c:3234
GtkWidget * dt_ui_center(dt_ui_t *ui)
get the center drawable widget
#define DT_DEBUG_CONTROL_SIGNAL_DISCONNECT(ctlsig, cb, user_data)
Definition signal.h:368
@ DT_SIGNAL_VIEWMANAGER_THUMBTABLE_ACTIVATE
Definition signal.h:95
#define DT_DEBUG_CONTROL_SIGNAL_CONNECT(ctlsig, signal, cb, user_data)
Definition signal.h:357
struct dt_undo_t * undo
Definition darktable.h:787
struct dt_gui_gtk_t * gui
Definition darktable.h:775
struct dt_collection_t * collection
Definition darktable.h:781
struct dt_control_signal_t * signals
Definition darktable.h:774
struct dt_view_manager_t * view_manager
Definition darktable.h:772
dt_accels_t * accels
Definition gtk.h:194
dt_ui_t * ui
Definition gtk.h:164
dt_thumbtable_t * thumbtable_lighttable
GModule *void * data
Definition view.h:157
void dt_thumbtable_set_active_rowid(dt_thumbtable_t *table)
Update internal active row tracking.
Definition thumbtable.c:496
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:562
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:380
static void dt_thumbtable_hide(dt_thumbtable_t *table)
Hide the thumbnail table widget.
Definition thumbtable.h:395
#define dt_thumbtable_redraw(table)
Definition thumbtable.h:372
void dt_undo_clear(dt_undo_t *self, uint32_t filter)
Definition undo.c:337
@ DT_UNDO_LIGHTTABLE
Definition undo.h:54
void dt_view_active_images_reset(gboolean raise)
Definition view.c:1267
int dt_view_manager_switch(dt_view_manager_t *vm, const char *view_name)
Definition view.c:235
@ 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)
uint32_t view(const 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