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#ifndef DT_GUI_WINDOW_MANAGER_H
20#define DT_GUI_WINDOW_MANAGER_H
21
23#include "gui/dtgtk/thumbnail.h"
24#include <gtk/gtk.h>
25#include <stdint.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#define DT_UI_PANEL_MODULE_SPACING 0
32#define DT_UI_PANEL_SIDE_DEFAULT_SIZE 350
33#define DT_UI_PANEL_BOTTOM_DEFAULT_SIZE 120
34
35typedef enum dt_ui_panel_t
36{
37 /* the header panel */
39 /* left panel */
41 /* right panel */
43 /* bottom panel */
45
48
50{
51 /* the top container of left panel, the top container
52 disables the module expander and does not scroll with other modules
53 */
55
56 /* the center container of left panel, the center container
57 contains the scrollable area that all plugins are placed within and last
58 widget is the end marker.
59 This container will always expand|fill empty vertical space
60 */
62
63 /* the bottom container of left panel, this container works just like
64 the top container but will be attached to bottom in the panel, such as
65 plugins like background jobs module in lighttable and the plugin selection
66 module in darkroom,
67 */
69
73
74 /* menu bar and toolbar */
76
77 /* Count of containers */
79
80 // The following are special containers linked to the header bar,
81 // they will never be destroyed in loops, so put them after the container "size"
83
84typedef struct dt_ui_t
85{
86 /* container widgets */
88
89 /* panel widgets */
91
92 /* The top panel contains the global menu and is not to be deleted/recreated between each view change */
94
95 /* center widget */
98
99 /* main widget */
101
102 /* thumb table */
105
106 /* log msg and toast labels */
108
109 /* Header/title bar */
112
113gchar *panels_get_view_path(char *suffix);
114gchar *panels_get_panel_path(dt_ui_panel_t panel, char *suffix);
115
117
118gboolean dt_ui_panel_ancestor(dt_ui_t *ui, const dt_ui_panel_t p, GtkWidget *w);
119
120// Drawing area used to paint background image.
121// Hide it in lighttable mode.
127
130
131GtkBox *dt_ui_get_container(dt_ui_t *ui, const dt_ui_container_t c);
133
135
139void dt_ui_set_window_buttons_visible(dt_ui_t *ui, gboolean visible);
140
141void dt_hinter_set_message(dt_ui_t *ui, const char *message);
142void dt_ui_set_image_info_label(dt_ui_t *ui, const char *label);
143
144
145#ifdef __cplusplus
146}
147#endif
148#endif // DT_GUI_WINDOW_MANAGER_H
uint32_t container(dt_lib_module_t *self)
struct _GtkWidget GtkWidget
GtkWidget, opaque, spelled exactly as GTK spells it.
Definition colorspaces.h:98
GtkWidget * top_panel
dt_thumbtable_t * thumbtable_lighttable
GtkWidget * containers[DT_UI_CONTAINER_SIZE]
GtkWidget * main_window
GtkWidget * center_base
struct dt_header_t * header
GtkWidget * log_msg
dt_thumbtable_t * thumbtable_filmstrip
GtkWidget * center
GtkWidget * panels[DT_UI_PANEL_SIZE]
GtkWidget * toast_msg
A widget to manage and display image thumbnails in Ansel's lighttable and filmstrip views.
GtkWidget * dt_ui_toast_msg(dt_ui_t *ui)
GtkWidget * dt_ui_center(dt_ui_t *ui)
gchar * panels_get_view_path(char *suffix)
void dt_ui_cleanup_titlebar(dt_ui_t *ui)
dt_ui_container_t
@ DT_UI_CONTAINER_SIZE
@ DT_UI_CONTAINER_PANEL_LEFT_BOTTOM
@ DT_UI_CONTAINER_PANEL_RIGHT_BOTTOM
@ DT_UI_CONTAINER_PANEL_RIGHT_CENTER
@ DT_UI_CONTAINER_PANEL_LEFT_CENTER
@ DT_UI_CONTAINER_PANEL_LEFT_TOP
@ DT_UI_CONTAINER_PANEL_RIGHT_TOP
@ DT_UI_CONTAINER_PANEL_TOP_SECOND_ROW
gchar * panels_get_panel_path(dt_ui_panel_t panel, char *suffix)
void dt_ui_init_titlebar(dt_ui_t *ui)
int dt_ui_panel_get_size(dt_ui_t *ui, const dt_ui_panel_t p)
void dt_ui_set_window_buttons_visible(dt_ui_t *ui, gboolean visible)
gboolean dt_ui_panel_ancestor(dt_ui_t *ui, const dt_ui_panel_t p, GtkWidget *w)
void dt_ui_cleanup_main_table(dt_ui_t *ui)
dt_ui_panel_t
@ DT_UI_PANEL_TOP
@ DT_UI_PANEL_SIZE
@ DT_UI_PANEL_BOTTOM
@ DT_UI_PANEL_LEFT
@ DT_UI_PANEL_RIGHT
void dt_ui_init_main_table(GtkWidget *container, dt_ui_t *ui)
GtkWidget * dt_ui_log_msg(dt_ui_t *ui)
void dt_ui_init_global_menu(dt_ui_t *ui)
GtkWidget * dt_ui_main_window(dt_ui_t *ui)
void dt_ui_restore_panels(dt_ui_t *ui)
void dt_ui_set_image_info_label(dt_ui_t *ui, const char *label)
void dt_ui_container_add_widget(dt_ui_t *ui, const dt_ui_container_t c, GtkWidget *w)
void dt_hinter_set_message(dt_ui_t *ui, const char *message)
GtkWidget * dt_ui_center_base(dt_ui_t *ui)
GtkBox * dt_ui_get_container(dt_ui_t *ui, const dt_ui_container_t c)