-
Notifications
You must be signed in to change notification settings - Fork 0
/
gtkwave.h
128 lines (112 loc) · 5.04 KB
/
gtkwave.h
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* Metaann
*
* Copyright (C) 1990-2005 George B. Moody
* Copyright (C) 2014 Benjamin Moody
*
* Based on 'xvwave.h' from the WAVE package (revised 10 June 2005);
* modified by Benjamin Moody, 22 August 2014.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtk/gtk.h>
#include "gtk-compat.h"
/* Default screen resolution. All known X servers seem to know something about
the screen size, even if what they know isn't true. Just in case, these
constants define default values to be used if Height/WidthMMOfScreen give
non-positive results. If your screen doesn't have square pixels, define
DPMMX and DPMMY differently. Note that these definitions can be made using
-D... options on the C compiler's command line.
If your X server is misinformed about your screen size, there are three
possible remedies. All of the X11R4 sample servers from MIT accept a `-dpi'
option that allows you to override the server default at the time the
server is started. See the X man page for details. Alternatively, use
WAVE's `-dpi' option or `dpi' resource (less desirable solutions, since they
don't solve similar problems that other applications are likely to
encounter). */
#ifndef DPMM
#define DPMM 4.0 /* default screen resolution (pixels per millimeter) */
#endif
#ifndef DPMMX
#define DPMMX DPMM
#endif
#ifndef DPMMY
#define DPMMY DPMM
#endif
/* Annotations are displayed in the font specified by DEFANNFONT if no
other choice is specified. At present, there is no other way to specify
a choice. Ultimately, this should be done by reading a resource file. */
#ifndef DEFANNFONT
#define DEFANNFONT "Sans 10"
#endif
/* Globally visible GTK+ objects. */
COMMON GtkWidget *wave_view;
COMMON PangoLayout *wave_text_layout;
COMMON int wave_view_font_offset;
/* Graphics contexts. For each displayed object (signal, annotation, cursor,
and grid) there are drawing and erasing graphics contexts; in addition,
there is a `clear_all' GC for erasing everything at once. If change_color
is zero (i.e., if we have not installed a customized color map), all of the
clear_* contexts are equivalent to clear_all, except that clear_crs is
equivalent to draw_crs (which uses GXinvert for the drawing function in this
case). */
COMMON GdkGC *draw_sig, *clear_sig,
*draw_ann, *clear_ann,
*draw_crs, *clear_crs,
*draw_grd, *draw_cgrd, *clear_grd,
*highlight_sig, *unhighlight_sig,
*clear_all;
/* Display lists
A display list contains all information needed to draw a screenful of signals.
For each of the nsig signals, a display list contains a list of the
(x, y) pixel coordinate pairs that specify the vertices of the polyline
that represents the signal.
A cache of recently-used display lists (up to MAX_DISPLAY_LISTS of them) is
maintained as a singly-linked list; the first display list is pointed
to by first_list.
*/
struct display_list {
struct display_list *next; /* link to next display list */
long start; /* time of first sample */
int nsig; /* number of signals */
int npoints; /* number of (input) points per signal */
int ndpts; /* number of (output) points per signal */
int xmax; /* largest x, expressed as window abscissa */
int *sb; /* signal baselines, expressed as window ordinates */
GdkPoint **vlist; /* vertex list pointers for each signal */
};
COMMON struct display_list *first_list;
COMMON GdkSegment *level;
extern int wave_text_width(const char *str, int length); /* in annot.c */
extern void wave_draw_string(GdkDrawable *drawable, GdkGC *gc,
int x, int y, const char *str, int length); /* in annot.c */
extern struct display_list *find_display_list( /* in signal.c */
long time);
GtkWidget *create_wave_view(void);
void wave_view_force_reload(void);
void wave_view_force_recalibrate(void);
GtkWidget *create_wave_window(void);
const char * defaults_get_string(const char *name, const char *classname,
const char *ddefault);
int defaults_get_integer(const char *name, const char *classname, int ddefault);
int defaults_get_boolean(const char *name, const char *classname, int ddefault);
double defaults_get_double(const char *name, const char *classname, double ddefault);
void set_grid_mode(int mode);
void set_sig_mode(int mode);
void set_ann_mode(int mode);
void set_overlap(int mode);
void set_time_scale(int i);
void set_ampl_scale(int i);
void set_record_and_annotator(const char *rec, const char *ann);
void set_display_start_time(WFDB_Time t);