Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
expander_box.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2021, 2024 Alexandros Theodotou
2// <alex@zrythm.org> SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
9
10#ifndef __GUI_WIDGETS_EXPANDER_BOX_H__
11#define __GUI_WIDGETS_EXPANDER_BOX_H__
12
13#include "common/utils/resources.h"
14#include "gui/backend/gtk_widgets/gtk_wrapper.h"
15
16#define EXPANDER_BOX_WIDGET_TYPE (expander_box_widget_get_type ())
17G_DECLARE_DERIVABLE_TYPE (
18 ExpanderBoxWidget,
19 expander_box_widget,
20 Z,
21 EXPANDER_BOX_WIDGET,
22 GtkBox)
23
24typedef struct _GtkFlipper GtkFlipper;
25
31
35typedef void (*ExpanderBoxRevealFunc) (
36 ExpanderBoxWidget * expander_box,
37 bool revealed,
38 void * user_data);
39
44typedef struct
45{
46 GtkButton * button;
47 GtkBox * btn_box;
48 GtkLabel * btn_label;
49 GtkFlipper * btn_label_flipper;
50 GtkImage * btn_img;
51 GtkRevealer * revealer;
52 GtkBox * content;
53
55 GtkOrientation orientation;
56
57 ExpanderBoxRevealFunc reveal_cb;
58
59 void * user_data;
60
62
63typedef struct _ExpanderBoxWidgetClass
64{
65 GtkBoxClass parent_class;
67
72expander_box_widget_get_private (ExpanderBoxWidget * self);
73
77void
78expander_box_widget_set_label (ExpanderBoxWidget * self, const char * label);
79
83void
85 ExpanderBoxWidget * self,
86 const char * icon_name);
87
88void
89expander_box_widget_add_content (ExpanderBoxWidget * self, GtkWidget * content);
90
94void
95expander_box_widget_set_reveal (ExpanderBoxWidget * self, int reveal);
96
97void
98expander_box_widget_set_reveal_callback (
99 ExpanderBoxWidget * self,
101 void * user_data);
102
103void
104expander_box_widget_set_orientation (
105 ExpanderBoxWidget * self,
106 GtkOrientation orientation);
107
108void
109expander_box_widget_set_vexpand (ExpanderBoxWidget * self, bool expand);
110
111ExpanderBoxWidget *
112expander_box_widget_new (
113 const char * label,
114 const char * icon_name,
115 GtkOrientation orientation);
116
120
121#endif
void expander_box_widget_set_icon_name(ExpanderBoxWidget *self, const char *icon_name)
Sets the icon name to show.
void(* ExpanderBoxRevealFunc)(ExpanderBoxWidget *expander_box, bool revealed, void *user_data)
Reveal callback prototype.
ExpanderBoxWidgetPrivate * expander_box_widget_get_private(ExpanderBoxWidget *self)
Gets the private.
void expander_box_widget_set_reveal(ExpanderBoxWidget *self, int reveal)
Reveals or hides the expander box's contents.
void expander_box_widget_set_label(ExpanderBoxWidget *self, const char *label)
Sets the label to show.
An expander box is a base widget with a button that when clicked expands the contents.
GtkOrientation orientation
Horizontal or vertical.