Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
window_manager.h
Go to the documentation of this file.
1/*
2 This file is part of the Ansel project.
3 Copyright (C) 2023, 2025 Aurélien PIERRE.
4 Copyright (C) 2025 Alynx Zhou.
5
6 Ansel is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 Ansel is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Ansel. If not, see <http://www.gnu.org/licenses/>.
18*/
19#pragma once
20
21#include "common/darktable.h"
22
23#include <gtk/gtk.h>
24#include <stdint.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#define DT_UI_PANEL_MODULE_SPACING 0
31#define DT_UI_PANEL_SIDE_DEFAULT_SIZE 350
32#define DT_UI_PANEL_BOTTOM_DEFAULT_SIZE 120
33
34typedef enum dt_ui_panel_t
35{
36 /* the header panel */
38 /* left panel */
40 /* right panel */
42 /* bottom panel */
44
47
49{
50 /* the top container of left panel, the top container
51 disables the module expander and does not scroll with other modules
52 */
54
55 /* the center container of left panel, the center container
56 contains the scrollable area that all plugins are placed within and last
57 widget is the end marker.
58 This container will always expand|fill empty vertical space
59 */
61
62 /* the bottom container of left panel, this container works just like
63 the top container but will be attached to bottom in the panel, such as
64 plugins like background jobs module in lighttable and the plugin selection
65 module in darkroom,
66 */
68
72
73 /* menu bar and toolbar */
75
76 /* Count of containers */
78
79 // The following are special containers linked to the header bar,
80 // they will never be destroyed in loops, so put them after the container "size"
82
83typedef struct dt_ui_t
84{
85 /* container widgets */
87
88 /* panel widgets */
90
91 /* The top panel contains the global menu and is not to be deleted/recreated between each view change */
93
94 /* center widget */
97
98 /* main widget */
100
101 /* thumb table */
104
105 /* log msg and toast labels */
107
108 /* Header/title bar */
111
112gchar *panels_get_view_path(char *suffix);
113gchar *panels_get_panel_path(dt_ui_panel_t panel, char *suffix);
114
116
117gboolean dt_ui_panel_ancestor(dt_ui_t *ui, const dt_ui_panel_t p, GtkWidget *w);
118
119// Drawing area used to paint background image.
120// Hide it in lighttable mode.
126
129
132
134
138void dt_ui_set_window_buttons_visible(dt_ui_t *ui, gboolean visible);
139
140void dt_hinter_set_message(dt_ui_t *ui, const char *message);
141void dt_ui_set_image_info_label(dt_ui_t *ui, const char *label);
142
143
144#ifdef __cplusplus
145}
146#endif
uint32_t container(dt_lib_module_t *self)
Definition backgroundjobs.c:77
static const dt_aligned_pixel_simd_t const dt_adaptation_t const float p
Definition chromatic_adaptation.h:315
const float c
Definition colorspaces_inline_conversions.h:1365
struct _GtkWidget GtkWidget
Definition splash.h:29
Definition window_manager.c:30
Definition thumbtable.h:96
Definition window_manager.h:84
GtkWidget * top_panel
Definition window_manager.h:92
dt_thumbtable_t * thumbtable_lighttable
Definition window_manager.h:102
GtkWidget * containers[DT_UI_CONTAINER_SIZE]
Definition window_manager.h:86
GtkWidget * main_window
Definition window_manager.h:99
GtkWidget * center_base
Definition window_manager.h:96
struct dt_header_t * header
Definition window_manager.h:109
GtkWidget * log_msg
Definition window_manager.h:106
dt_thumbtable_t * thumbtable_filmstrip
Definition window_manager.h:103
GtkWidget * center
Definition window_manager.h:95
GtkWidget * panels[DT_UI_PANEL_SIZE]
Definition window_manager.h:89
GtkWidget * toast_msg
Definition window_manager.h:106
GtkWidget * dt_ui_toast_msg(dt_ui_t *ui)
get the toast message widget
Definition window_manager.c:114
GtkWidget * dt_ui_center(dt_ui_t *ui)
get the center drawable widget
Definition window_manager.c:101
gchar * panels_get_view_path(char *suffix)
Definition window_manager.c:46
void dt_ui_cleanup_titlebar(dt_ui_t *ui)
Definition window_manager.c:772
dt_ui_container_t
Definition window_manager.h:49
@ DT_UI_CONTAINER_SIZE
Definition window_manager.h:77
@ DT_UI_CONTAINER_PANEL_LEFT_BOTTOM
Definition window_manager.h:67
@ DT_UI_CONTAINER_PANEL_RIGHT_BOTTOM
Definition window_manager.h:71
@ DT_UI_CONTAINER_PANEL_RIGHT_CENTER
Definition window_manager.h:70
@ DT_UI_CONTAINER_PANEL_LEFT_CENTER
Definition window_manager.h:60
@ DT_UI_CONTAINER_PANEL_LEFT_TOP
Definition window_manager.h:53
@ DT_UI_CONTAINER_PANEL_RIGHT_TOP
Definition window_manager.h:69
@ DT_UI_CONTAINER_PANEL_TOP_SECOND_ROW
Definition window_manager.h:74
gchar * panels_get_panel_path(dt_ui_panel_t panel, char *suffix)
Definition window_manager.c:62
void dt_ui_init_titlebar(dt_ui_t *ui)
Definition window_manager.c:593
int dt_ui_panel_get_size(dt_ui_t *ui, const dt_ui_panel_t p)
get width of right, left, or bottom panel
Definition window_manager.c:69
void dt_ui_set_window_buttons_visible(dt_ui_t *ui, gboolean visible)
Definition window_manager.c:755
gboolean dt_ui_panel_ancestor(dt_ui_t *ui, const dt_ui_panel_t p, GtkWidget *w)
is the panel ancestor of widget
Definition window_manager.c:95
void dt_ui_cleanup_main_table(dt_ui_t *ui)
Definition window_manager.c:578
dt_ui_panel_t
Definition window_manager.h:35
@ DT_UI_PANEL_TOP
Definition window_manager.h:37
@ DT_UI_PANEL_SIZE
Definition window_manager.h:45
@ DT_UI_PANEL_BOTTOM
Definition window_manager.h:43
@ DT_UI_PANEL_LEFT
Definition window_manager.h:39
@ DT_UI_PANEL_RIGHT
Definition window_manager.h:41
void dt_ui_init_main_table(GtkWidget *container, dt_ui_t *ui)
Definition window_manager.c:521
GtkWidget * dt_ui_log_msg(dt_ui_t *ui)
get the log message widget
Definition window_manager.c:110
void dt_ui_init_global_menu(dt_ui_t *ui)
Definition window_manager.c:658
GtkWidget * dt_ui_main_window(dt_ui_t *ui)
get the main window widget
Definition window_manager.c:119
void dt_ui_restore_panels(dt_ui_t *ui)
Definition window_manager.c:180
void dt_ui_set_image_info_label(dt_ui_t *ui, const char *label)
Definition window_manager.c:749
void dt_ui_container_add_widget(dt_ui_t *ui, const dt_ui_container_t c, GtkWidget *w)
Definition window_manager.c:129
void dt_hinter_set_message(dt_ui_t *ui, const char *message)
Definition window_manager.c:761
GtkWidget * dt_ui_center_base(dt_ui_t *ui)
Definition window_manager.c:105
GtkBox * dt_ui_get_container(dt_ui_t *ui, const dt_ui_container_t c)
Definition window_manager.c:124