Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
color_area.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2018-2022, 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#ifndef __GUI_WIDGETS_COLOR_AREA_H__
5#define __GUI_WIDGETS_COLOR_AREA_H__
6
12
13#include <string>
14
15#include "common/utils/color.h"
16#include "gui/backend/gtk_widgets/gtk_wrapper.h"
17
18#define COLOR_AREA_WIDGET_TYPE (color_area_widget_get_type ())
20 ColorAreaWidget,
21 color_area_widget,
22 Z,
23 COLOR_AREA_WIDGET,
24 GtkWidget)
25
26
28enum class ColorAreaType
29{
31 COLOR_AREA_TYPE_GENERIC,
32
39 COLOR_AREA_TYPE_TRACK,
40};
41
42class Track;
43
44using ColorAreaWidget = struct _ColorAreaWidget
45{
46 GtkWidget parent_instance;
47
49 Color color;
50
52 ColorAreaType type;
53
55 Track * track;
56
57 bool hovered;
58
60 // GPtrArray * parents;
61
62 GdkTexture * track_icon;
63 std::string last_track_icon_name;
64};
65
72void
73color_area_widget_setup_generic (ColorAreaWidget * self, Color * color);
74
78void
79color_area_widget_setup_track (ColorAreaWidget * self, Track * track);
80
87void
88color_area_widget_set_color (ColorAreaWidget * widget, Color color);
89
90#endif
G_DECLARE_FINAL_TYPE(ColorAreaWidget, color_area_widget, Z, COLOR_AREA_WIDGET, GtkWidget) enum class ColorAreaType
Type of ColorAreaWidget this is.
Definition color_area.h:19
void color_area_widget_set_color(ColorAreaWidget *widget, Color color)
Changes the color.
void color_area_widget_setup_generic(ColorAreaWidget *self, Color *color)
Creates a generic color widget using the given color pointer.
void color_area_widget_setup_track(ColorAreaWidget *self, Track *track)
Creates a ColorAreaWidget for use inside TrackWidget implementations.