Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
foldable_notebook.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_WIDGETS_FOLDABLE_NOTEBOOK_H__
11#define __GUI_WIDGETS_FOLDABLE_NOTEBOOK_H__
12
13#include <stdbool.h>
14
15#include <gtk/gtk.h>
16
17#define FOLDABLE_NOTEBOOK_WIDGET_TYPE (foldable_notebook_widget_get_type ())
18G_DECLARE_FINAL_TYPE (
20 foldable_notebook_widget,
21 Z,
22 FOLDABLE_NOTEBOOK_WIDGET,
23 GtkBox);
24
31#define MW_BOT_FOLDABLE_NOTEBOOK MW_BOT_DOCK_EDGE->bot_notebook
32
42typedef struct _FoldableNotebookWidget
43{
44 GtkBox parent_instance;
45
46 GtkNotebook * notebook;
47
48 GtkGestureClick * mp;
49
52 GtkPaned * paned;
53
55 GtkPositionType pos_in_paned;
56
59 // int prev_paned_pos;
60
63
67
74 GtkWidget * tab_during_press;
75
76 gulong switch_page_handler_id;
78
83foldable_notebook_widget_new (GtkPositionType pos_in_paned, bool with_text);
84
88GtkWidget *
91 int page);
92
100GtkWidget *
102
106void
109 bool new_visibility);
110
115int
117
121GtkNotebook *
123
124void
125foldable_notebook_widget_set_current_page (
127 int page_num,
128 bool block_signals);
129
130int
131foldable_notebook_widget_get_current_page (FoldableNotebookWidget * self);
132
133void
134foldable_notebook_widget_add_page (
136 GtkWidget * child,
137 const char * tab_icon_name,
138 const char * tab_label,
139 const char * tooltip);
140
144void
146
150void
153 GtkPaned * paned,
154 GtkPositionType pos_in_paned,
155 bool with_text);
156
161#endif
void foldable_notebook_widget_toggle_visibility(FoldableNotebookWidget *self)
Combines the above.
GtkWidget * foldable_notebook_widget_get_current_widget(FoldableNotebookWidget *self)
Get the widget currently visible.
FoldableNotebookWidget * foldable_notebook_widget_new(GtkPositionType pos_in_paned, bool with_text)
Creates a FoldableNotebookWidget.
int foldable_notebook_widget_is_content_visible(FoldableNotebookWidget *self)
Returns if the content of the foldable notebook is visible.
void foldable_notebook_widget_set_visibility(FoldableNotebookWidget *self, bool new_visibility)
Sets the folded space visible or not.
void foldable_notebook_widget_setup(FoldableNotebookWidget *self, GtkPaned *paned, GtkPositionType pos_in_paned, bool with_text)
Sets up an existing FoldableNotebookWidget.
GtkWidget * foldable_notebook_widget_get_widget_at_page(FoldableNotebookWidget *self, int page)
Get the widget at the given page.
GtkNotebook * foldable_notebook_widget_get_notebook(FoldableNotebookWidget *self)
Gets the internal notebook.
A GtkNotebook that shows or hides itself when the same page tab is clicked.
int prev_pos
Previous paned position before setting it to max/min.
GtkPaned * paned
Paned associated with this notebook to set it to max/min when hiding.
GtkPositionType pos_in_paned
Notebook position in the paned.
GtkWidget * tab_during_press
Current tab during a press action.
bool with_text
Whether to add text to the tab labels (otherwise just icons).