Clean up tooltips-related warnings by rejiggering how the GtkTooltips instance
[gwave-svn.git] / src / gwave.h
blobc38e4ff4f86d045c3645c82e617c74f6c7d4a0bb
2 /*
3 * declarations and definitions for gwave - waveform viewer
4 * Copyright 1998, 1999 Stephen G. Tell
6 * This program 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 2 of the License, or
9 * (at your option) any later version.
11 * This program 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.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef GWAVE_H
23 #define GWAVE_H
25 #ifndef SCWM_GUILE_H__
26 #include <scwm_guile.h>
27 #endif
29 #include <wavefile.h>
31 typedef struct _VBCursor VBCursor;
32 typedef struct _SelRange SelRange;
33 typedef struct _VisibleWave VisibleWave;
34 typedef struct _WavePanel WavePanel;
35 typedef struct _WaveTable WaveTable;
36 typedef struct _GWDataFile GWDataFile;
37 typedef struct _GWDnDData GWDnDData;
38 typedef enum _GWMouseState GWMouseState;
39 typedef struct _MeasureBtn MeasureBtn;
43 * state of mouse for drag operations
45 enum _GWMouseState { M_NONE, M_CURSOR_DRAG,
46 M_SELRANGE_ARMED, M_SELRANGE_ACTIVE};
48 /* VBCursor - structure describing a vertical bar cursor */
49 struct _VBCursor {
50 int shown; /* vertical bar cursor */
51 double xval;
52 char *color_name;
53 GdkColor gdk_color;
54 GdkGC *gdk_gc;
58 #define N_WTABLE_MBTNS 4
60 #define N_MOUSE_BUTTONS 6
62 /* rows of the WaveTable's ftable */
63 #define WTABLE_FTR_TOOLBAR 0
64 #define WTABLE_FTR_XMHBOX 1
65 #define WTABLE_FTR_PTABLE 2
66 #define WTABLE_FTR_BHBOX 3
68 * WaveTable - structure describing
69 * all of the waveform-display panels and related elements
71 struct _WaveTable {
72 int npanels;
73 WavePanel **panels;
74 GtkWidget *window; // formerly window_main
75 GtkWidget *menubar;
76 GtkWidget *var_list_submenu;
78 GtkWidget *ftable; /* outer table framing most of the rest */
80 GtkWidget *toolbar;
81 GtkWidget *xmeasure_hbox; /* hbox with cursor measurements */
82 MeasureBtn *cursor_mbtn[N_WTABLE_MBTNS]; /* someday: make this dynamic */
83 GtkWidget *vswindow; /* GtkSrolledWindow to hold panel table */
84 GtkWidget *table; /* scrolled table containing all panels */
86 GtkWidget *bot_vbox;
87 GtkWidget *bot_hbox3;
88 GtkWidget *xlhbox; /* GtkHBox containing x-axis labels */
89 GtkAdjustment *hsadj; // horizontal scrollbar
90 GtkWidget *hsbar;
91 GtkWidget *xlabel_left, *xlabel_right;
92 GtkWidget *lab_xlogscale;
94 VBCursor *cursor[2];
95 SelRange *srange;
96 double min_xval; /* minimum and maximum data x values, */
97 double max_xval; /* over all panels */
98 double start_xval; /* starting drawn x-value (independent var) */
99 double end_xval; /* ending drawn x-value */
100 int suppress_redraw; /* don't re-draw if 1 */
101 int logx; /* X axis scaling: 0=linear 1=log base 10 */
103 GtkWidget *popup_menu;
104 WavePanel *popup_panel; /*panel cursor was in when panel-popup popped*/
105 GWMouseState mstate;
106 VBCursor *drag_cursor;
107 int button_down;
108 GtkTooltips *ttips;
112 * structure sent as drag-and-drop-data for selecting waveforms.
114 struct _GWDnDData {
115 int magic;
116 WaveVar *dv;
119 /* globals defined in gwave.c */
120 extern char *prog_name;
121 extern WaveTable *wtable;
122 extern const int NWColors;
123 extern int colors_initialized;
124 extern char *bg_color_name;
125 extern GdkColor bg_gdk_color;
126 extern GdkGC *bg_gdk_gc;
127 extern char *pg_color_name;
128 extern GdkColor pg_gdk_color;
129 extern GdkGC *pg_gdk_gc;
130 extern char *hl_color_name;
131 extern GdkColor hl_gdk_color;
132 extern GdkGC *hl_gdk_gc;
133 extern GdkColormap *win_colormap; /* colormap for main waveform window */
134 extern void create_about_window();
135 extern int v_flag;
136 extern SCM scm_gwave_debug;
137 #define gwave_debug SCM_NFALSEP(SCM_CDR(scm_gwave_debug))
139 /* defined in cmd.c */
140 extern gint cmd_zoom_full(GtkWidget *widget);
141 extern gint cmd_zoom_in(GtkWidget *widget);
142 extern gint cmd_zoom_out(GtkWidget *widget);
143 extern gint cmd_zoom_cursors(GtkWidget *widget);
144 extern gint cmd_zoom_window(GtkWidget *widget);
145 extern gint cmd_delete_selected_waves(GtkWidget *widget);
146 extern void remove_wfile_waves(GWDataFile *wdata);
147 extern void remove_wave_from_panel(WavePanel *wp, VisibleWave *vw);
148 extern SCM add_var_to_panel(WavePanel *wp, WaveVar *dv);
149 extern void wavepanel_update_data(WavePanel *wp);
150 extern void wavetable_update_data();
151 extern void update_wfile_waves(GWDataFile *wdata);
153 /* defined in draw.c */
154 extern void vw_wp_visit_draw(VisibleWave *vw, WavePanel *wp);
155 extern void draw_wavepanel(GtkWidget *widget, GdkEventExpose *event,
156 WavePanel *wp);
157 extern void draw_labels(WaveTable *wt);
158 extern double y2val(WavePanel *wp, int y);
159 extern int val2y(WavePanel *wp, double val);
160 extern double x2val(WavePanel *wp, int x, int log);
161 extern int val2x(WavePanel *wp, double val, int log);
162 extern char *val2txt(double val, int style);
163 extern void alloc_colors(GtkWidget *widget);
164 extern void setup_colors(WaveTable *wtable);
165 extern void vw_wp_setup_gc(VisibleWave *vw, WavePanel *wp);
166 extern SCM wtable_redraw_x();
168 /* defined in event.c */
169 extern void draw_srange(SelRange *sr);
170 extern gint button_press_handler(GtkWidget *widget, GdkEventButton *event,
171 gpointer data);
172 extern gint button_release_handler(GtkWidget *widget, GdkEventButton *event,
173 gpointer data);
174 extern gint motion_handler(GtkWidget *widget, GdkEventMotion *event,
175 gpointer data);
176 extern gint scroll_handler(GtkWidget *widget);
177 extern gint expose_handler(GtkWidget *widget, GdkEventExpose *ev,
178 WavePanel *wp);
179 extern void destroy_handler(GtkWidget *widget, gpointer data);
180 extern void wavepanel_dnd_drop (GtkWidget *button, GdkEvent *ev, gpointer d);
181 extern void update_cursor(VBCursor *csp, double xval);
183 /* defined in pixmaps.c */
184 extern char *drag_no_xpm[];
185 extern char *wave_drag_ok_xpm[];
187 /* defined in wavelist.c */
188 void cmd_show_wave_list(GtkWidget *widget, GWDataFile *wdata);
189 extern GWDataFile *load_wave_file(char *name, char *type);
190 extern void get_fname_load_file(GtkWidget *w, gpointer d);
191 extern void reload_all_wave_files(GtkWidget *w);
193 extern char *possible_drag_types[];
194 extern char *accepted_drop_types[];
195 extern GList *wdata_list; /* List of GWDataFile *'s */
196 extern GtkTooltips *get_gwave_tooltips();
197 extern SCM glist2scm(GList *list, SCM (*toscm)(void*));
199 #endif