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 <stdbool.h>
14
15#include "utils/resources.h"
16
17#include <gtk/gtk.h>
18
19#define EXPANDER_BOX_WIDGET_TYPE (expander_box_widget_get_type ())
20G_DECLARE_DERIVABLE_TYPE (
21 ExpanderBoxWidget,
22 expander_box_widget,
23 Z,
24 EXPANDER_BOX_WIDGET,
25 GtkBox)
26
27typedef struct _GtkFlipper GtkFlipper;
28
38typedef void (*ExpanderBoxRevealFunc) (
39 ExpanderBoxWidget * expander_box,
40 bool revealed,
41 void * user_data);
42
47typedef struct
48{
49 GtkButton * button;
50 GtkBox * btn_box;
51 GtkLabel * btn_label;
52 GtkFlipper * btn_label_flipper;
53 GtkImage * btn_img;
54 GtkRevealer * revealer;
55 GtkBox * content;
56
58 GtkOrientation orientation;
59
60 ExpanderBoxRevealFunc reveal_cb;
61
62 void * user_data;
63
65
66typedef struct _ExpanderBoxWidgetClass
67{
68 GtkBoxClass parent_class;
70
75expander_box_widget_get_private (ExpanderBoxWidget * self);
76
80void
81expander_box_widget_set_label (ExpanderBoxWidget * self, const char * label);
82
86void
88 ExpanderBoxWidget * self,
89 const char * icon_name);
90
91void
92expander_box_widget_add_content (ExpanderBoxWidget * self, GtkWidget * content);
93
97void
98expander_box_widget_set_reveal (ExpanderBoxWidget * self, int reveal);
99
100void
101expander_box_widget_set_reveal_callback (
102 ExpanderBoxWidget * self,
104 void * user_data);
105
106void
107expander_box_widget_set_orientation (
108 ExpanderBoxWidget * self,
109 GtkOrientation orientation);
110
111void
112expander_box_widget_set_vexpand (ExpanderBoxWidget * self, bool expand);
113
114ExpanderBoxWidget *
115expander_box_widget_new (
116 const char * label,
117 const char * icon_name,
118 GtkOrientation orientation);
119
124#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.