File: spectool_gtk_channel.h

package info (click to toggle)
spectools 201601r1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,272 kB
  • ctags: 1,837
  • sloc: ansic: 18,708; sh: 2,476; makefile: 85
file content (84 lines) | stat: -rw-r--r-- 2,252 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* Spectool signal graph
 *
 * GTK widget implementation
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#include "config.h"

#ifndef __SPECTOOL_CHANNEL_WIDGET_H__
#define __SPECTOOL_CHANNEL_WIDGET_H__

#ifdef HAVE_GTK

#include <glib.h>
#include <glib-object.h>

#include "spectool_container.h"
#include "spectool_gtk_hw_registry.h"
#include "spectool_gtk_widget.h"

G_BEGIN_DECLS

#define SPECTOOL_TYPE_CHANNEL \
	(spectool_channel_get_type())
#define SPECTOOL_CHANNEL(obj) \
	(G_TYPE_CHECK_INSTANCE_CAST((obj), \
	SPECTOOL_TYPE_CHANNEL, SpectoolChannel))
#define SPECTOOL_CHANNEL_CLASS(klass) \
	(G_TYPE_CHECK_CLASS_CAST((klass), \
	SPECTOOL_TYPE_CHANNEL, SpectoolChannelClass))
#define IS_SPECTOOL_CHANNEL(obj) \
	(G_TYPE_CHECK_INSTANCE_TYPE((obj), \
	SPECTOOL_TYPE_CHANNEL))
#define IS_SPECTOOL_CHANNEL_CLASS(klass) \
	(G_TYPE_CHECK_CLASS_TYPE((class), \
	SPECTOOL_TYPE_CHANNEL))

typedef struct _SpectoolChannel SpectoolChannel;
typedef struct _SpectoolChannelClass SpectoolChannelClass;

#define SPECTOOL_CHANNEL_NUM_SAMPLES		0

struct _SpectoolChannel {
	SpectoolWidget parent;

	/* is the mouse down during an event? */
	int mouse_down;

	/* channel clickable rectangle */
	int chan_start_x, chan_start_y, chan_end_x, chan_end_y;
	GdkPoint *chan_points;
	int chan_h;

	GList *update_list;
};

struct _SpectoolChannelClass {
	SpectoolWidgetClass parent_class;
};

GType spectool_channel_get_type(void);
GtkWidget *spectool_channel_new();
void spectool_channel_append_update(GtkWidget *widget, GtkWidget *update);

G_END_DECLS

#endif
#endif