1 /* measurebtn.h -
2  * declarations and definitions for the "measurebutton" functions
3  * of the gwave waveform viewer
4  *
5  * Copyright 1998, 1999, 2000, 2001 Stephen G. Tell
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the Free
19  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  */
22 
23 /*
24  * A measurebutton is simply a button containing a label that displays
25  * some kind of measurement result.
26  * The measurement function defines how that measurement is performed.
27  * Currently, measurement functions can involve up to a single waveform
28  * variable (WaveVar) and the vertical-bar cursor values.
29  *
30  * We define a number of useful built-in measurement functions, and soon hope
31  * to allow user-defined measurement functions.
32  */
33 
34 struct _MeasureBtn {
35 	int measurefunc;
36 	WaveVar *var;		// note: might be NULL
37 
38 	GtkWidget *button;
39 	GtkWidget *label;
40 };
41 
42 #define MBF_NONE	0
43 #define MBF_CURSOR0	1
44 #define MBF_CURSOR1	2
45 #define MBF_CURSORDIFF	3
46 #define MBF_VARC0	4
47 #define MBF_VARC1	5
48 #define MBF_VARDIFF	6
49 #define MBF_RECIPCURDIFF	7
50 #define MBF_MAX_FUNC MBF_RECIPCURDIFF
51 
52 extern MeasureBtn *measure_button_new(WaveVar *wv, int mfunc);
53 extern void mbtn_set_func(MeasureBtn *mbtn, int mfunc);
54 extern void mbtn_delete(MeasureBtn *mbtn);
55 extern void mbtn_hide(MeasureBtn *mbtn);
56 extern void mbtn_show(MeasureBtn *mbtn);
57 extern void mbtn_update(MeasureBtn *mbtn, gpointer *d);
58 extern void mbtn_update_var(MeasureBtn *mbtn, WaveVar *wv);
59 extern void mbtn_update_all();
60