Zrythm
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
10#ifndef __GUI_WIDGETS_EXPANDER_BOX_H__
11#define __GUI_WIDGETS_EXPANDER_BOX_H__
12
13#include "utils/resources.h"
14
15#include "gtk_wrapper.h"
16
17#define EXPANDER_BOX_WIDGET_TYPE (expander_box_widget_get_type ())
18G_DECLARE_DERIVABLE_TYPE (
19 ExpanderBoxWidget,
20 expander_box_widget,
21 Z,
22 EXPANDER_BOX_WIDGET,
23 GtkBox)
24
25typedef struct _GtkFlipper GtkFlipper;
26
36typedef void (*ExpanderBoxRevealFunc) (
37 ExpanderBoxWidget * expander_box,
38 bool revealed,
39 void * user_data);
40
45typedef struct
46{
47 GtkButton * button;
48 GtkBox * btn_box;
49 GtkLabel * btn_label;
50 GtkFlipper * btn_label_flipper;
51 GtkImage * btn_img;
52 GtkRevealer * revealer;
53 GtkBox * content;
54
56 GtkOrientation orientation;
57
58 ExpanderBoxRevealFunc reveal_cb;
59
60 void * user_data;
61
63
64typedef struct _ExpanderBoxWidgetClass
65{
66 GtkBoxClass parent_class;
68
73expander_box_widget_get_private (ExpanderBoxWidget * self);
74
78void
79expander_box_widget_set_label (ExpanderBoxWidget * self, const char * label);
80
84void
86 ExpanderBoxWidget * self,
87 const char * icon_name);
88
89void
90expander_box_widget_add_content (ExpanderBoxWidget * self, GtkWidget * content);
91
95void
96expander_box_widget_set_reveal (ExpanderBoxWidget * self, int reveal);
97
98void
99expander_box_widget_set_reveal_callback (
100 ExpanderBoxWidget * self,
102 void * user_data);
103
104void
105expander_box_widget_set_orientation (
106 ExpanderBoxWidget * self,
107 GtkOrientation orientation);
108
109void
110expander_box_widget_set_vexpand (ExpanderBoxWidget * self, bool expand);
111
112ExpanderBoxWidget *
113expander_box_widget_new (
114 const char * label,
115 const char * icon_name,
116 GtkOrientation orientation);
117
122#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.
Helpers for loading and using resources such as icons.
An expander box is a base widget with a button that when clicked expands the contents.
GtkOrientation orientation
Horizontal or vertical.