1 /* GSequencer - Advanced GTK Sequencer
2  * Copyright (C) 2005-2019 Joël Krähemann
3  *
4  * This file is part of GSequencer.
5  *
6  * GSequencer is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * GSequencer is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GSequencer.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include "ags_hled_array.h"
21 
22 void ags_hled_array_class_init(AgsHLedArrayClass *hled_array);
23 void ags_hled_array_init(AgsHLedArray *hled_array);
24 
25 /**
26  * SECTION:ags_hled_array
27  * @short_description: A horizontal led array widget
28  * @title: AgsHLedArray
29  * @section_id:
30  * @include: ags/widget/ags_hled_array.h
31  *
32  * #AgsHLedArray is a widget representing an array of horizontal leds.
33  */
34 
35 static gpointer ags_hled_array_parent_class = NULL;
36 
37 GType
ags_hled_array_get_type(void)38 ags_hled_array_get_type(void)
39 {
40   static volatile gsize g_define_type_id__volatile = 0;
41 
42   if(g_once_init_enter (&g_define_type_id__volatile)){
43     GType ags_type_hled_array = 0;
44 
45     static const GTypeInfo ags_hled_array_info = {
46       sizeof(AgsHLedArrayClass),
47       NULL, /* base_init */
48       NULL, /* base_finalize */
49       (GClassInitFunc) ags_hled_array_class_init,
50       NULL, /* class_finalize */
51       NULL, /* class_data */
52       sizeof(AgsHLedArray),
53       0,    /* n_preallocs */
54       (GInstanceInitFunc) ags_hled_array_init,
55     };
56 
57     ags_type_hled_array = g_type_register_static(AGS_TYPE_LED_ARRAY,
58 						 "AgsHLedArray",
59 						 &ags_hled_array_info,
60 						 0);
61 
62     g_once_init_leave(&g_define_type_id__volatile, ags_type_hled_array);
63   }
64 
65   return g_define_type_id__volatile;
66 }
67 
68 void
ags_hled_array_class_init(AgsHLedArrayClass * hled_array)69 ags_hled_array_class_init(AgsHLedArrayClass *hled_array)
70 {
71   /* empty */
72 }
73 
74 void
ags_hled_array_init(AgsHLedArray * hled_array)75 ags_hled_array_init(AgsHLedArray *hled_array)
76 {
77   AGS_LED_ARRAY(hled_array)->box = (GtkBox *) gtk_hbox_new(FALSE,
78 							   0);
79   gtk_container_add((GtkContainer *) hled_array,
80 		    (GtkWidget *) AGS_LED_ARRAY(hled_array)->box);
81   gtk_widget_show((GtkWidget *) AGS_LED_ARRAY(hled_array)->box);
82 }
83 
84 /**
85  * ags_hled_array_new:
86  *
87  * Creates an #AgsHLedArray.
88  *
89  * Returns: a new #AgsHLedArray
90  *
91  * Since: 3.0.0
92  */
93 AgsHLedArray*
ags_hled_array_new()94 ags_hled_array_new()
95 {
96   AgsHLedArray *hled_array;
97 
98   hled_array = (AgsHLedArray *) g_object_new(AGS_TYPE_HLED_ARRAY,
99 					     NULL);
100 
101   return(hled_array);
102 }
103