File: spectool_gtk_spectral.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 (89 lines) | stat: -rw-r--r-- 2,294 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
85
86
87
88
89
/* 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_SPECTRAL_WIDGET_H__
#define __SPECTOOL_SPECTRAL_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_SPECTRAL \
	(spectool_spectral_get_type())
#define SPECTOOL_SPECTRAL(obj) \
	(G_TYPE_CHECK_INSTANCE_CAST((obj), \
	SPECTOOL_TYPE_SPECTRAL, SpectoolSpectral))
#define SPECTOOL_SPECTRAL_CLASS(klass) \
	(G_TYPE_CHECK_CLASS_CAST((klass), \
	SPECTOOL_TYPE_SPECTRAL, SpectoolSpectralClass))
#define IS_SPECTOOL_SPECTRAL(obj) \
	(G_TYPE_CHECK_INSTANCE_TYPE((obj), \
	SPECTOOL_TYPE_SPECTRAL))
#define IS_SPECTOOL_SPECTRAL_CLASS(klass) \
	(G_TYPE_CHECK_CLASS_TYPE((class), \
	SPECTOOL_TYPE_SPECTRAL))

typedef struct _SpectoolSpectral SpectoolSpectral;
typedef struct _SpectoolSpectralClass SpectoolSpectralClass;

#define SPECTOOL_SPECTRAL_NUM_SAMPLES		100

/* Access the color array */
#define SPECTOOL_SPECTRAL_COLOR(a, b, c)	((a)[((b) * 3) + c])

struct _SpectoolSpectral {
	SpectoolWidget parent;

	GtkWidget *sweepinfo;

	GtkWidget *legend_pix;

	float *colormap;
	int colormap_len;

	GdkPixmap **line_cache;
	int line_cache_len;
	int n_sweeps_delta;

	int oldx, oldy;
};

struct _SpectoolSpectralClass {
	SpectoolWidgetClass parent_class;
};

GType spectool_spectral_get_type(void);
GtkWidget *spectool_spectral_new(void);
void spectool_spectral_clear(void);

G_END_DECLS

#endif
#endif