1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
3 /*----------------------------------------------------------------------
5 gpiv - Graphic program for Particle Image Velocimetry, based on gtk/gnome
8 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
11 This file is part of gpiv.
13 Gpiv is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2, or (at your option)
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 ----------------------------------------------------------------------*/
30 * interface for create_display
31 * $Log: display_interface.c,v $
32 * Revision 1.19 2008-04-28 12:00:57 gerber
33 * hdf-formatted files are now with .hdf extension (previously: .gpi)
35 * Revision 1.18 2007-12-19 08:42:35 gerber
38 * Revision 1.17 2007-11-23 16:24:07 gerber
39 * release 0.5.0: Kafka
41 * Revision 1.16 2007-06-06 17:00:48 gerber
42 * Retreives images/data from URI using Gnome Virtual File System.
44 * Revision 1.15 2007-03-22 16:00:32 gerber
45 * Added image processing tabulator
47 * Revision 1.14 2007-02-16 17:09:48 gerber
48 * added Gauss weighting on I.A. and SPOF filtering (on correlation function)
50 * Revision 1.13 2007/02/05 15:17:09 gerber
51 * auto stretching, broadcast display settings to buffers from preferences
53 * Revision 1.12 2007-01-29 11:27:43 gerber
54 * added image formats png, gif, tif png, bmp, improved buffer display
56 * Revision 1.11 2006-09-18 07:27:05 gerber
57 * *** empty log message ***
59 * Revision 1.10 2006/01/31 14:28:12 gerber
62 * Revision 1.9 2005/06/15 15:03:54 gerber
63 * Optional Anti Aliased canvas for viewer
65 * Revision 1.8 2005/06/15 09:40:40 gerber
68 * Revision 1.7 2005/01/19 15:53:41 gerber
69 * Initiation of Data Acquisition (DAC); trigerring of lasers and camera
70 * by using RTAI and Realtime Linux, recording images from IEEE1394
71 * (Firewire) IIDC compliant camera's
73 * Revision 1.6 2004/10/15 19:24:05 gerber
74 * GPIV_ and Gpiv prefix to defines and structure names of libgpiv
76 * Revision 1.5 2004/06/14 21:19:23 gerber
77 * Image depth up to 16 bits.
78 * Improvement "single int" and "drag int" in Eval tab.
79 * Viewer's pop-up menu.
80 * Adaption for gpiv_matrix_* and gpiv_vector_*.
82 * See Changelog for further info.
84 * Revision 1.4 2003/09/01 11:17:14 gerber
85 * improved monitoring of interrogation process
87 * Revision 1.3 2003/07/04 10:47:01 gerber
90 * Revision 1.2 2003/06/27 13:47:26 gerber
91 * display ruler, line/point evaluation
93 * Revision 1.1.1.1 2003/06/17 17:10:52 gerber
100 #include "display_interface.h"
101 #include "display_menus.h"
104 #define EVENT_METHOD(i, x) GTK_WIDGET_GET_CLASS(i)->x
108 create_display (gchar
*fname
,
113 /*-----------------------------------------------------------------------------
133 -----------------------------------------------------------------------------*/
136 Display
*disp
= g_new0 (Display
, 1);
137 Image
*img
= g_new0 (Image
, 1);
138 Intreg
*intreg
= g_new0 (Intreg
, 1);
139 GpivPivPar
*intreg_pivp
= g_new0 (GpivPivPar
, 1);
140 PivData
*pd
= g_new0 (PivData
, 1);
141 GpivValidPar
*pd_valp
= g_new0 (GpivValidPar
, 1);
142 GpivPostPar
*pd_postp
= g_new0 (GpivPostPar
, 1);
144 static gint width
= 0, height
= 0;
145 static gchar title
[GPIV_MAX_CHARS
];
146 static GdkPixbuf
*icon
= NULL
;
151 static const gchar
* zoom_label
[8] = {
162 static const gchar
* vector_scale_label
[9] = {
177 disp
->zoom_group
= NULL
;
178 disp
->background_group
= NULL
;
179 disp
->scalar_group
= NULL
;
180 disp
->vector_scale_group
= NULL
;
181 disp
->vector_color_group
= NULL
;
188 g_snprintf (disp
->msg_display_default
,
193 disp
->id
= display_id
;
194 disp
->zoom_index
= gpiv_par
->display__zoom_index
;
195 disp
->zoom_factor
= zfactor
[disp
->zoom_index
];
196 disp
->zoom_factor_old
= zfactor
[disp
->zoom_index
];
197 /* g_message ("CREATE_DISPLAY:: zoom_factor = %f zoom_factor_old = %f", */
198 /* disp->zoom_factor, disp->zoom_factor_old); */
199 disp
->vector_scale
= gpiv_par
->display__vector_scale
;
200 disp
->vector_color
= gpiv_par
->display__vector_color
;
201 disp
->display_backgrnd
= gpiv_par
->display__backgrnd
;
202 /* disp->display_img1 = gpiv_par->display__img1; */
203 /* disp->display_img2 = gpiv_par->display__img2; */
204 disp
->display_intregs
= gpiv_par
->display__intregs
;
205 disp
->display_piv
= gpiv_par
->display__piv
;
206 disp
->display_scalar
= gpiv_par
->display__scalar
;
207 /* disp->display_vor = gpiv_par->display__vor; */
208 /* disp->display_sstrain = gpiv_par->display__sstrain; */
209 /* disp->display_nstrain = gpiv_par->display__nstrain; */
211 disp
->file_uri_name
= g_strdup_printf ("%s" , fname
);
215 disp
->img
->exist_img
= FALSE
;
216 disp
->img
->saved_img
= FALSE
;
217 disp
->img
->rgb_img_width
= 0;
218 disp
->img
->img_mean
= 0.0;
221 * PIV data and related do not exist, yet. 'Saved' is set TRUE to avoid
222 * message of unsaved data while deleting display or console
223 * Values of these boolean variables are updated in the 'exec_' functions.
226 disp
->pida
->exist_piv
= FALSE
;
227 disp
->pida
->saved_piv
= TRUE
;
228 disp
->pida
->scaled_piv
= FALSE
;
229 disp
->pida
->exist_histo
= FALSE
;
230 disp
->pida
->saved_histo
= TRUE
;
231 disp
->pida
->exist_valid
= FALSE
;
232 disp
->pida
->exist_vor
= FALSE
;
233 disp
->pida
->exist_vor_scaled
= FALSE
;
234 disp
->pida
->saved_vor
= TRUE
;
235 disp
->pida
->exist_sstrain
= FALSE
;
236 disp
->pida
->exist_sstrain_scaled
= FALSE
;
237 disp
->pida
->saved_sstrain
= TRUE
;
238 disp
->pida
->exist_nstrain
= FALSE
;
239 disp
->pida
->exist_nstrain_scaled
= FALSE
;
240 disp
->pida
->saved_nstrain
= TRUE
;
245 * Initialising of parameter values for image, evaluation and interrogation regions
247 disp
->img
->image
= image
;
248 /* disp->img->image->header = gpiv_img_cp_parameters (gl_image_par); */
249 disp
->pida
->piv_par
= gpiv_piv_cp_parameters (gl_piv_par
);
250 disp
->pida
->valid_par
= pd_valp
;
251 disp
->pida
->post_par
= pd_postp
;
254 if (disp
->pida
->piv_par
->row_start
> disp
->img
->image
->header
->nrows
255 - disp
->pida
->piv_par
->pre_shift_row
- 1) {
256 disp
->pida
->piv_par
->row_start
= 0;
258 disp
->pida
->piv_par
->row_end
=
259 MIN (disp
->img
->image
->header
->nrows
, gl_piv_par
->row_end
);
260 if (disp
->pida
->piv_par
->col_start
> disp
->img
->image
->header
->ncolumns
261 - disp
->pida
->piv_par
->pre_shift_col
- 1) {
262 disp
->pida
->piv_par
->col_start
= 0;
264 disp
->pida
->piv_par
->col_end
=
265 MIN (disp
->img
->image
->header
->ncolumns
, gl_piv_par
->col_end
);
268 * Copy _PART_ of piv_par to intreg for displaying Interrogation Area contours
270 disp
->intreg
= intreg
;
271 disp
->intreg
->exist_int
= FALSE
;
272 disp
->intreg
->row_start_old
= 0;
273 disp
->intreg
->col_start_old
= 0;
275 disp
->intreg
->par
= intreg_pivp
;
276 disp
->intreg
->par
->row_start
= disp
->pida
->piv_par
->row_start
;
277 disp
->intreg
->par
->row_end
= disp
->pida
->piv_par
->row_end
;
278 disp
->intreg
->par
->col_start
= disp
->pida
->piv_par
->col_start
;
279 disp
->intreg
->par
->col_end
= disp
->pida
->piv_par
->col_end
;
280 disp
->intreg
->par
->int_size_f
= disp
->pida
->piv_par
->int_size_f
;
281 disp
->intreg
->par
->int_size_i
= disp
->pida
->piv_par
->int_size_i
;
282 disp
->intreg
->par
->int_shift
= disp
->pida
->piv_par
->int_shift
;
283 disp
->intreg
->par
->pre_shift_row
= disp
->pida
->piv_par
->pre_shift_row
;
284 disp
->intreg
->par
->pre_shift_col
= disp
->pida
->piv_par
->pre_shift_col
;
286 disp
->intreg
->par
->row_start__set
= TRUE
;
287 disp
->intreg
->par
->row_end__set
= TRUE
;
288 disp
->intreg
->par
->col_start__set
= TRUE
;
289 disp
->intreg
->par
->col_end__set
= TRUE
;
290 disp
->intreg
->par
->int_size_f__set
= TRUE
;
291 disp
->intreg
->par
->int_size_i__set
= TRUE
;
292 disp
->intreg
->par
->int_shift__set
= TRUE
;
293 disp
->intreg
->par
->pre_shift_row__set
= TRUE
;
294 disp
->intreg
->par
->pre_shift_col__set
= TRUE
;
298 width
= (gint
) (disp
->zoom_factor
* disp
->img
->image
->header
->ncolumns
+ VIEW_HMARGE
);
299 height
= (gint
) (disp
->zoom_factor
* disp
->img
->image
->header
->nrows
+ VIEW_VMARGE
);
300 /* disp->mwin = g_object_new (GTK_TYPE_WINDOW, */
301 /* "default-height", height, */
302 /* "default-width", width, */
303 /* "title", title, */
309 disp
->mwin
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
310 gtk_window_set_title (GTK_WINDOW (disp
->mwin
), title
);
311 /* gtk_window_set_default_size (GTK_WINDOW (disp->mwin), width, height); */
312 gtk_window_set_default_size (GTK_WINDOW (disp
->mwin
), 20, 20);
313 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
316 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
323 g_signal_connect (GTK_OBJECT (disp
->mwin
),
325 G_CALLBACK (delete_display
),
329 * focussing the actual display
331 g_signal_connect (GTK_OBJECT (disp
->mwin
),
333 G_CALLBACK (on_display_set_focus
),
335 gtk_window_set_resizable (GTK_WINDOW (disp
->mwin
), FALSE
);
340 icon
= gdk_pixbuf_new_from_file(PIXMAPSDIR
"gpiv_logo.png", NULL
);
341 gtk_window_set_icon(GTK_WINDOW(disp
->mwin
), icon
);
344 disp
->vbox
= gtk_vbox_new ( FALSE
/* TRUE */, 0);
345 gtk_widget_show (disp
->vbox
);
346 gtk_container_add (GTK_CONTAINER (disp
->mwin
), disp
->vbox
);
351 disp
->menubar
= gtk_menu_bar_new ();
352 gtk_box_pack_start (GTK_BOX (disp
->vbox
),
357 if (gpiv_par
->display__view_menubar
) {
358 gtk_widget_show (GTK_WIDGET (disp
->menubar
));
360 gtk_widget_hide (GTK_WIDGET (disp
->menubar
));
367 disp
->menuitem_view
=
368 gtk_menu_item_new_with_mnemonic (_("_View"));
369 gtk_widget_show (disp
->menuitem_view
);
370 gtk_container_add (GTK_CONTAINER (disp
->menubar
),
371 disp
->menuitem_view
);
373 /* gtk_object_set_data_full (GTK_OBJECT (disp->mwin), */
374 /* "menuitem_view", */
375 /* disp->menuitem_view, */
376 /* (GtkDestroyNotify) gtk_widget_unref); */
379 disp
->menuitem_view_menu
= gtk_menu_new ();
380 gtk_menu_item_set_submenu (GTK_MENU_ITEM
381 (disp
->menuitem_view
),
382 disp
->menuitem_view_menu
);
387 gtk_check_menu_item_new_with_mnemonic (_("View menu bar"));
388 gtk_widget_show (disp
->view_menubar
);
389 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_menu
),
391 g_signal_connect ((gpointer
) disp
->view_menubar
, "activate",
392 G_CALLBACK (on_menu_synchronize_popup
),
393 (int *) VIEW_MENUBAR
);
398 gtk_check_menu_item_new_with_mnemonic (_("View rulers"));
399 gtk_widget_show (disp
->view_rulers
);
400 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_menu
),
402 g_signal_connect ((gpointer
) disp
->view_rulers
, "activate",
403 G_CALLBACK (on_menu_synchronize_popup
),
404 (int *) VIEW_RULERS
);
407 * Menu for automatic stretching the window when zooming in
410 gtk_check_menu_item_new_with_mnemonic (_("Stretch auto"));
411 gtk_widget_show (disp
->stretch_auto
);
412 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_menu
),
414 g_signal_connect ((gpointer
) disp
->stretch_auto
, "activate",
415 G_CALLBACK (on_menu_synchronize_popup
),
416 (int *) STRETCH_AUTO
);
419 * Menu for stretching the window
422 gtk_menu_item_new_with_label (_("Stretch display"));
423 gtk_widget_show (disp
->stretch
);
424 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_menu
),
426 gtk_tooltips_set_tip (gpiv
->tooltips
,
428 _("Stretch or fit display window to the image area"),
430 g_signal_connect ((gpointer
) disp
->stretch
,
432 G_CALLBACK (on_stretch_activate
),
438 disp
->separator_zoom
= gtk_separator_menu_item_new ();
439 gtk_widget_show (disp
->separator_zoom
);
440 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_menu
),
441 disp
->separator_zoom
);
446 for (i
= 0; i
< 8; i
++) {
447 /* gchar *zoom_index = g_strdup_printf ("zoom_%d", i) */
448 disp
->zoom_key
[i
] = g_strdup_printf ("zoom_menu_%d", i
);
449 disp
->zoom_menu
[i
] = gtk_radio_menu_item_new_with_label
450 (disp
->zoom_group
, zoom_label
[i
]);
451 disp
->zoom_group
= gtk_radio_menu_item_get_group
452 (GTK_RADIO_MENU_ITEM (disp
->zoom_menu
[i
]));
453 gtk_widget_show (disp
->zoom_menu
[i
]);
454 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_menu
),
456 gtk_tooltips_set_tip (gpiv
->tooltips
,
458 _("set zoom factor"),
460 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
463 g_signal_connect ((gpointer
) disp
->zoom_menu
[i
],
465 G_CALLBACK (on_zoom_activate
),
469 /* if (disp->zoom_index == i) { */
470 /* gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM */
471 /* (disp->zoom_menu[i]), */
478 * Background (image) menu
480 disp
->menuitem_background
=
481 gtk_menu_item_new_with_mnemonic (_("_Background"));
482 gtk_widget_show (disp
->menuitem_background
);
483 gtk_container_add (GTK_CONTAINER (disp
->menubar
),
484 disp
->menuitem_background
);
487 disp
->menuitem_background_menu
= gtk_menu_new ();
488 gtk_menu_item_set_submenu (GTK_MENU_ITEM
489 (disp
->menuitem_background
),
490 disp
->menuitem_background_menu
);
494 disp
->view_blue
= gtk_radio_menu_item_new_with_mnemonic
495 (disp
->background_group
, _("Blue"));
496 disp
->background_group
= gtk_radio_menu_item_get_group
497 (GTK_RADIO_MENU_ITEM (disp
->view_blue
));
498 gtk_widget_show (disp
->view_blue
);
499 gtk_container_add (GTK_CONTAINER (disp
->menuitem_background_menu
),
501 gtk_tooltips_set_tip (gpiv
->tooltips
,
503 _("set blue background"),
505 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
506 "blue_background_menu",
508 g_signal_connect ((gpointer
) disp
->view_blue
, "activate",
509 G_CALLBACK (on_menu_synchronize_popup
),
514 disp
->view_black
= gtk_radio_menu_item_new_with_mnemonic
515 (disp
->background_group
, _("Black"));
516 disp
->background_group
= gtk_radio_menu_item_get_group
517 (GTK_RADIO_MENU_ITEM (disp
->view_black
));
518 gtk_widget_show (disp
->view_black
);
519 gtk_container_add (GTK_CONTAINER (disp
->menuitem_background_menu
),
521 gtk_tooltips_set_tip (gpiv
->tooltips
,
523 _("set black background"),
525 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
526 "black_background_menu",
528 g_signal_connect ((gpointer
) disp
->view_black
, "activate",
529 G_CALLBACK (on_menu_synchronize_popup
),
534 disp
->view_image_a
= gtk_radio_menu_item_new_with_mnemonic
535 (disp
->background_group
, _("Image_A"));
536 disp
->background_group
= gtk_radio_menu_item_get_group
537 (GTK_RADIO_MENU_ITEM (disp
->view_image_a
));
538 gtk_widget_show (disp
->view_image_a
);
539 gtk_container_add (GTK_CONTAINER (disp
->menuitem_background_menu
),
541 gtk_tooltips_set_tip (gpiv
->tooltips
,
543 _("set first image as background"),
545 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
546 "image_a_background_menu",
548 g_signal_connect ((gpointer
) disp
->view_image_a
, "activate",
549 G_CALLBACK (on_menu_synchronize_popup
),
550 (int *) VIEW_IMAGE_A
);
554 disp
->view_image_b
= gtk_radio_menu_item_new_with_mnemonic
555 (disp
->background_group
, ("Image_B"));
556 disp
->background_group
= gtk_radio_menu_item_get_group
557 (GTK_RADIO_MENU_ITEM (disp
->view_image_b
));
558 gtk_widget_show (disp
->view_image_b
);
559 gtk_container_add (GTK_CONTAINER (disp
->menuitem_background_menu
),
561 gtk_tooltips_set_tip (gpiv
->tooltips
,
563 _("set second image as background"),
565 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
566 "image_b_background_menu",
568 g_signal_connect ((gpointer
) disp
->view_image_b
, "activate",
569 G_CALLBACK (on_menu_synchronize_popup
),
570 (int *) VIEW_IMAGE_B
);
576 disp
->menuitem_view_piv_data
=
577 gtk_menu_item_new_with_mnemonic (_("_Piv"));
578 gtk_widget_show (disp
->menuitem_view_piv_data
);
579 gtk_container_add (GTK_CONTAINER (disp
->menubar
),
580 disp
->menuitem_view_piv_data
);
583 disp
->menuitem_view_piv_data_menu
= gtk_menu_new ();
584 gtk_menu_item_set_submenu (GTK_MENU_ITEM (disp
->menuitem_view_piv_data
),
585 disp
->menuitem_view_piv_data_menu
);
588 disp
->view_interrogation_areas
=
589 gtk_check_menu_item_new_with_mnemonic (_("Interrogation area's"));
590 gtk_widget_show (disp
->view_interrogation_areas
);
591 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_piv_data_menu
),
592 disp
->view_interrogation_areas
);
593 g_signal_connect ((gpointer
) disp
->view_interrogation_areas
, "activate",
594 G_CALLBACK (on_menu_synchronize_popup
),
595 (int *) VIEW_INTERROGATION_AREAS
);
598 disp
->view_velocity_vectors
=
599 gtk_check_menu_item_new_with_mnemonic (_("Velocity vectors"));
600 gtk_widget_show (disp
->view_velocity_vectors
);
601 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_piv_data_menu
),
602 disp
->view_velocity_vectors
);
603 g_signal_connect ((gpointer
) disp
->view_velocity_vectors
, "activate",
604 G_CALLBACK (on_menu_synchronize_popup
),
605 (int *) VIEW_VELOCITY_VECTORS
);
608 * Scalar data display menu
611 disp
->menuitem_view_scalar_data
=
612 gtk_menu_item_new_with_mnemonic (_("_Scalar"));
613 gtk_widget_show (disp
->menuitem_view_scalar_data
);
614 gtk_container_add (GTK_CONTAINER (disp
->menubar
), disp
->menuitem_view_scalar_data
);
616 disp
->menuitem_view_scalar_data_menu
= gtk_menu_new ();
617 gtk_menu_item_set_submenu (GTK_MENU_ITEM (disp
->menuitem_view_scalar_data
),
618 disp
->menuitem_view_scalar_data_menu
);
623 gtk_radio_menu_item_new_with_mnemonic (disp
->scalar_group
, _("None"));
625 gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (disp
->view_none
));
626 gtk_widget_show (disp
->view_none
);
627 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_scalar_data_menu
),
629 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
632 g_signal_connect ((gpointer
) disp
->view_none
, "activate",
633 G_CALLBACK (on_menu_synchronize_popup
),
634 (int *) VIEW_NONE_SCALARS
);
637 disp
->view_vorticity
=
638 gtk_radio_menu_item_new_with_mnemonic (disp
->scalar_group
,
641 gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (disp
->view_vorticity
));
642 gtk_widget_show (disp
->view_vorticity
);
643 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_scalar_data_menu
),
644 disp
->view_vorticity
);
645 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
647 disp
->view_vorticity
);
648 g_signal_connect ((gpointer
) disp
->view_vorticity
, "activate",
649 G_CALLBACK (on_menu_synchronize_popup
),
650 (int *) VIEW_VORTICITY
);
653 disp
->view_shear_strain
=
654 gtk_radio_menu_item_new_with_mnemonic (disp
->scalar_group
, _("Shear strain"));
656 gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (disp
->view_shear_strain
));
657 gtk_widget_show (disp
->view_shear_strain
);
658 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_scalar_data_menu
),
659 disp
->view_shear_strain
);
660 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
662 disp
->view_shear_strain
);
663 g_signal_connect ((gpointer
) disp
->view_shear_strain
, "activate",
664 G_CALLBACK (on_menu_synchronize_popup
),
665 (int *) VIEW_SHEAR_STRAIN
);
668 disp
->view_normal_strain
=
669 gtk_radio_menu_item_new_with_mnemonic (disp
->scalar_group
,
672 gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (disp
->view_normal_strain
));
673 gtk_widget_show (disp
->view_normal_strain
);
674 gtk_container_add (GTK_CONTAINER (disp
->menuitem_view_scalar_data_menu
),
675 disp
->view_normal_strain
);
676 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
677 "view_normal_strain",
678 disp
->view_normal_strain
);
679 g_signal_connect ((gpointer
) disp
->view_normal_strain
, "activate",
680 G_CALLBACK (on_menu_synchronize_popup
),
681 (int *) VIEW_NORMAL_STRAIN
);
686 disp
->menuitem_vector_scale
=
687 gtk_menu_item_new_with_mnemonic (_("Scal_e"));
688 gtk_widget_show (disp
->menuitem_vector_scale
);
689 gtk_container_add (GTK_CONTAINER (disp
->menubar
),
690 disp
->menuitem_vector_scale
);
692 disp
->menuitem_vector_scale_menu
= gtk_menu_new ();
693 gtk_menu_item_set_submenu (GTK_MENU_ITEM (disp
->menuitem_vector_scale
),
694 disp
->menuitem_vector_scale_menu
);
697 for (i
= 0; i
< 9; i
++) {
698 disp
->vector_scale_key
[i
] = g_strdup_printf ("vector_scale_menu_%d", i
);
700 disp
->vector_scale_menu
[i
] = gtk_radio_menu_item_new_with_label
701 (disp
->vector_scale_group
, vector_scale_label
[i
]);
703 disp
->vector_scale_group
= gtk_radio_menu_item_get_group
704 (GTK_RADIO_MENU_ITEM (disp
->vector_scale_menu
[i
]));
706 gtk_widget_show (disp
->vector_scale_menu
[i
]);
708 gtk_container_add (GTK_CONTAINER (disp
->menuitem_vector_scale_menu
),
709 disp
->vector_scale_menu
[i
]);
710 gtk_tooltips_set_tip (gpiv
->tooltips
,
711 disp
->vector_scale_menu
[i
],
712 _("set vector_scale"),
714 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
715 disp
->vector_scale_key
[i
],
716 disp
->vector_scale_menu
[i
]);
717 g_signal_connect ((gpointer
) disp
->vector_scale_menu
[i
],
719 G_CALLBACK (on_vector_scale_activate
),
726 disp
->menuitem_vector_color
=
727 gtk_menu_item_new_with_mnemonic (_("C_olor"));
728 gtk_widget_show (disp
->menuitem_vector_color
);
729 gtk_container_add (GTK_CONTAINER (disp
->menubar
),
730 disp
->menuitem_vector_color
);
732 disp
->menuitem_vector_color_menu
= gtk_menu_new ();
733 gtk_menu_item_set_submenu (GTK_MENU_ITEM (disp
->menuitem_vector_color
),
734 disp
->menuitem_vector_color_menu
);
737 disp
->vector_color_peak_nr
=
738 gtk_radio_menu_item_new_with_mnemonic (disp
->vector_color_group
,
740 disp
->vector_color_group
=
741 gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM
742 (disp
->vector_color_peak_nr
));
743 gtk_widget_show (disp
->vector_color_peak_nr
);
744 gtk_container_add (GTK_CONTAINER (disp
->menuitem_vector_color_menu
),
745 disp
->vector_color_peak_nr
);
746 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
747 "vector_color_peak_nr",
748 disp
->vector_color_peak_nr
);
749 g_signal_connect ((gpointer
) disp
->vector_color_peak_nr
, "activate",
750 G_CALLBACK (on_menu_synchronize_popup
),
751 (int *) VECTOR_COLOR_PEAK
);
754 disp
->vector_color_snr
=
755 gtk_radio_menu_item_new_with_mnemonic (disp
->vector_color_group
,
757 /* disp->vector_color_snr = */
758 /* gtk_radio_menu_item_new_with_mnemonic (disp->vector_color_group, */
760 disp
->vector_color_group
=
761 gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM
762 (disp
->vector_color_snr
));
763 gtk_widget_show (disp
->vector_color_snr
);
764 gtk_container_add (GTK_CONTAINER (disp
->menuitem_vector_color_menu
),
765 disp
->vector_color_snr
);
766 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
768 disp
->vector_color_snr
);
769 g_signal_connect ((gpointer
) disp
->vector_color_snr
, "activate",
770 G_CALLBACK (on_menu_synchronize_popup
),
771 (int *) VECTOR_COLOR_SNR
);
774 disp
->vector_color_magngray
=
775 gtk_radio_menu_item_new_with_mnemonic (disp
->vector_color_group
,
777 disp
->vector_color_group
=
778 gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM
779 (disp
->vector_color_magngray
));
780 gtk_widget_show (disp
->vector_color_magngray
);
781 gtk_container_add (GTK_CONTAINER (disp
->menuitem_vector_color_menu
),
782 disp
->vector_color_magngray
);
783 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
784 "vector_color_magngray",
785 disp
->vector_color_magngray
);
786 g_signal_connect ((gpointer
) disp
->vector_color_magngray
, "activate",
787 G_CALLBACK (on_menu_synchronize_popup
),
788 (int *) VECTOR_COLOR_MAGNGRAY
);
792 disp
->vector_color_magncolor
=
793 gtk_radio_menu_item_new_with_mnemonic (disp
->vector_color_group
,
794 ("Magnitude color"));
795 disp
->vector_color_group
=
796 gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM
797 (disp
->vector_color_magncolor
));
798 gtk_widget_show (disp
->vector_color_magncolor
);
799 gtk_container_add (GTK_CONTAINER (disp
->menuitem_vector_color_menu
),
800 disp
->vector_color_magncolor
);
801 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
802 "vector_color_magncolor",
803 disp
->vector_color_magncolor
);
804 g_signal_connect ((gpointer
) disp
->vector_color_magncolor
, "activate",
805 G_CALLBACK (on_menu_synchronize_popup
),
806 (int *) VECTOR_COLOR_MAGNCOLOR
);
811 disp
->table
= gtk_table_new (4,
814 gtk_widget_ref (disp
->table
);
815 gtk_object_set_data_full (GTK_OBJECT (disp
->mwin
),
818 (GtkDestroyNotify
) gtk_widget_unref
);
819 gtk_box_pack_start (GTK_BOX (disp
->vbox
),
824 gtk_widget_show (disp
->table
);
828 * Adjustments for scrollbars or scrolled window
831 gtk_adjustment_new (0.0,
833 (gdouble
) disp
->img
->image
->header
->ncolumns
- 1.0,
836 (gdouble
) disp
->img
->image
->header
->ncolumns
- 1.0
837 /* * disp->zoom_factor */
839 gtk_object_set_data (GTK_OBJECT (disp
->hadj
),
842 gtk_object_set_data (GTK_OBJECT (disp
->hadj
),
845 g_signal_connect (GTK_OBJECT (disp
->hadj
),
854 gtk_adjustment_new (0.0,
856 (gdouble
) disp
->img
->image
->header
->nrows
- 1.0,
859 (gfloat
) disp
->img
->image
->header
->nrows
- 1.0
860 /* * disp->zoom_factor */
863 gtk_object_set_data (GTK_OBJECT (disp
->vadj
),
866 gtk_object_set_data (GTK_OBJECT (disp
->vadj
),
869 g_signal_connect (GTK_OBJECT (disp
->vadj
),
879 disp
->hruler
= gtk_hruler_new();
880 gtk_widget_ref(disp
->hruler
);
881 gtk_object_set_data_full(GTK_OBJECT(disp
->mwin
),
884 (GtkDestroyNotify
) gtk_widget_unref
);
886 gtk_table_attach (GTK_TABLE (disp
->table
),
892 (GtkAttachOptions
) (GTK_EXPAND
| GTK_SHRINK
| GTK_FILL
),
893 (GtkAttachOptions
) (GTK_FILL
),
896 if (gpiv_par
->display__view_rulers
) {
897 gtk_widget_show (GTK_WIDGET (disp
->hruler
));
899 gtk_widget_hide (GTK_WIDGET (disp
->hruler
));
903 gtk_ruler_set_range (GTK_RULER (disp
->hruler
),
905 (gfloat
) (disp
->img
->image
->header
->ncolumns
- 1),
907 (gfloat
) (disp
->img
->image
->header
->ncolumns
- 1));
908 /* gtk_widget_set_size_request (disp->hruler, */
909 /* (gint) (disp->zoom_factor * */
910 /* disp->img.image_par->ncolumns), */
916 disp
->vruler
= gtk_vruler_new ();
917 gtk_widget_ref (disp
->vruler
);
918 gtk_object_set_data_full (GTK_OBJECT (disp
->mwin
),
921 (GtkDestroyNotify
) gtk_widget_unref
);
922 if (gpiv_par
->display__view_rulers
) {
923 gtk_widget_show (GTK_WIDGET (disp
->vruler
));
925 gtk_widget_hide (GTK_WIDGET (disp
->vruler
));
927 gtk_table_attach (GTK_TABLE (disp
->table
),
933 (GtkAttachOptions
) (GTK_EXPAND
),
934 (GtkAttachOptions
) (GTK_EXPAND
| GTK_SHRINK
| GTK_FILL
),
938 gtk_ruler_set_range (GTK_RULER (disp
->vruler
),
940 (gfloat
) (disp
->img
->image
->header
->nrows
- 1),
942 (gfloat
) (disp
->img
->image
->header
->nrows
- 1));
943 /* gtk_widget_set_size_request (disp->vruler, */
945 /* (gint) (disp->zoom_factor * */
946 /* disp->img.image_par->nrows)); */
952 gtk_vscrollbar_new( GTK_ADJUSTMENT (disp
->vadj
));
953 gtk_widget_ref (disp
->vscrollbar
);
954 gtk_object_set_data_full (GTK_OBJECT (disp
->mwin
),
957 (GtkDestroyNotify
) gtk_widget_unref
);
958 gtk_widget_show (disp
->vscrollbar
);
959 gtk_table_attach (GTK_TABLE (disp
->table
),
965 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
966 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
970 /* gtk_viewport_get_vadjustment (viewport) */
973 gtk_hscrollbar_new (GTK_ADJUSTMENT (disp
->hadj
));
974 gtk_widget_ref (disp
->hscrollbar
);
975 gtk_object_set_data_full (GTK_OBJECT (disp
->mwin
),
978 (GtkDestroyNotify
) gtk_widget_unref
);
979 gtk_widget_show (disp
->hscrollbar
);
980 gtk_table_attach (GTK_TABLE (disp
->table
),
986 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
987 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
995 gtk_widget_push_visual (gdk_rgb_get_visual ());
996 gtk_widget_push_colormap (gdk_rgb_get_cmap ());
997 disp
->canvas
= gnome_canvas_new_aa ();
999 gtk_widget_push_visual (gdk_imlib_get_visual ());
1000 gtk_widget_push_colormap (NULL
);
1001 disp
->canvas
= gnome_canvas_new ();
1004 gtk_widget_pop_colormap ();
1005 gtk_widget_pop_visual ();
1006 gtk_widget_ref (disp
->canvas
);
1007 gtk_object_set_data_full (GTK_OBJECT (disp
->mwin
),
1010 (GtkDestroyNotify
) gtk_widget_unref
);
1011 gtk_widget_show (disp
->canvas
);
1012 gnome_canvas_set_scroll_region (GNOME_CANVAS (disp
->canvas
),
1015 disp
->img
->image
->header
->ncolumns
- 1,
1016 disp
->img
->image
->header
->nrows
- 1);
1018 gtk_table_attach (GTK_TABLE (disp
->table
),
1024 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1025 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1031 gtk_widget_set_events (GTK_WIDGET (disp
->canvas
),
1032 GDK_LEAVE_NOTIFY_MASK
1033 | GDK_BUTTON_PRESS_MASK
1034 | GDK_BUTTON_RELEASE_MASK
1035 | GDK_POINTER_MOTION_MASK
1036 | GDK_POINTER_MOTION_HINT_MASK
1041 gtk_object_set_data (GTK_OBJECT (disp
->canvas
),
1044 gtk_object_set_data (GTK_OBJECT (disp
->canvas
),
1050 * connect rulers to gnome_canvas drawing area
1052 g_signal_connect_swapped (G_OBJECT (disp
->canvas
),
1053 "motion_notify_event",
1054 G_CALLBACK (EVENT_METHOD (disp
->hruler
, motion_notify_event
)),
1055 G_OBJECT (disp
->hruler
));
1057 g_signal_connect_swapped (G_OBJECT (disp
->canvas
),
1058 "motion_notify_event",
1059 G_CALLBACK (GTK_WIDGET_GET_CLASS (disp
->vruler
)->motion_notify_event
),
1060 G_OBJECT (disp
->vruler
));
1063 g_signal_connect (G_OBJECT (disp
->canvas
),
1064 "enter_notify_event",
1065 G_CALLBACK (canvas_display_enter_notify
),
1067 g_signal_connect (G_OBJECT (disp
->canvas
),
1068 "motion_notify_event",
1069 G_CALLBACK (canvas_display_motion_notify
),
1071 g_signal_connect (G_OBJECT (disp
->canvas
),
1072 "button_press_event",
1073 G_CALLBACK (canvas_display_button_press
),
1075 g_signal_connect (G_OBJECT (disp
->canvas
),
1076 "button_release_event",
1077 G_CALLBACK (canvas_display_button_release
),
1079 g_signal_connect (G_OBJECT (disp
->canvas
),
1080 "leave_notify_event",
1081 G_CALLBACK (canvas_display_leave_notify
),
1083 g_signal_connect (G_OBJECT (disp
->canvas
),
1085 G_CALLBACK (canvas_display_button_scroll
),
1090 * application/status bar
1092 disp
->appbar
= gnome_appbar_new (FALSE
,
1094 GNOME_PREFERENCES_NEVER
);
1095 gtk_widget_ref (disp
->appbar
);
1096 gtk_object_set_data_full (GTK_OBJECT (disp
->mwin
),
1099 (GtkDestroyNotify
) gtk_widget_unref
);
1100 gtk_table_attach (GTK_TABLE (disp
->table
),
1106 (GtkAttachOptions
) (GTK_EXPAND
| GTK_FILL
),
1107 (GtkAttachOptions
) (GTK_FILL
),
1110 gtk_widget_show (disp
->appbar
);
1111 gnome_appbar_set_default (GNOME_APPBAR (disp
->appbar
),
1112 disp
->msg_display_default
);
1116 gtk_widget_show (disp
->mwin
);
1123 create_display_popupmenu (Display
*disp
1125 /*-----------------------------------------------------------------------------
1128 GtkWidget
*display_menu
= NULL
;
1131 display_menu
= gtk_menu_new ();
1132 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1135 gnome_app_fill_menu (GTK_MENU_SHELL (display_menu
),
1136 display_menu_uiinfo
,
1143 * view menubar widget
1145 gtk_widget_ref (display_menu_uiinfo
[0].widget
);
1146 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1147 "view_menubar_popup_menu",
1148 display_menu_uiinfo
[0].widget
,
1149 (GtkDestroyNotify
) gtk_widget_unref
);
1150 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1151 "view_menubar_popup_menu",
1152 display_menu_uiinfo
[0].widget
);
1153 if (gpiv_par
->display__view_menubar
) {
1154 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1155 (display_menu_uiinfo
[0].widget
),
1158 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1159 (display_menu_uiinfo
[0].widget
),
1162 gtk_object_set_data (GTK_OBJECT (display_menu_uiinfo
[0].widget
),
1168 * view rulers widget
1170 gtk_widget_ref (display_menu_uiinfo
[1].widget
);
1171 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1172 "view_rulers_popup_menu",
1173 display_menu_uiinfo
[1].widget
,
1174 (GtkDestroyNotify
) gtk_widget_unref
);
1175 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1176 "view_rulers_popup_menu",
1177 display_menu_uiinfo
[1].widget
);
1178 if (gpiv_par
->display__view_rulers
) {
1179 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1180 (display_menu_uiinfo
[1].widget
),
1183 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1184 (display_menu_uiinfo
[1].widget
),
1187 gtk_object_set_data (GTK_OBJECT (display_menu_uiinfo
[1].widget
),
1193 * stretch when zoom automatic
1195 gtk_widget_ref (display_menu_uiinfo
[2].widget
);
1196 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1197 "stretch_auto_popup_menu",
1198 display_menu_uiinfo
[2].widget
,
1199 (GtkDestroyNotify
) gtk_widget_unref
);
1200 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1201 "stretch_auto_popup_menu",
1202 display_menu_uiinfo
[2].widget
);
1203 if (gpiv_par
->display__stretch_auto
) {
1204 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1205 (display_menu_uiinfo
[2].widget
),
1208 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1209 (display_menu_uiinfo
[2].widget
),
1212 gtk_object_set_data (GTK_OBJECT (display_menu_uiinfo
[2].widget
),
1220 gtk_widget_ref (zoomscale_menu_display
[0].widget
);
1221 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1223 zoomscale_menu_display
[0].widget
,
1224 (GtkDestroyNotify
) gtk_widget_unref
);
1225 if (disp
->zoom_index
== ZOOM_0
) {
1226 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1227 (zoomscale_menu_display
[0].widget
),
1230 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1232 zoomscale_menu_display
[0].widget
);
1233 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[0].widget
),
1236 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[0].widget
),
1242 gtk_widget_ref (zoomscale_menu_display
[1].widget
);
1243 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1245 zoomscale_menu_display
[1].widget
,
1246 (GtkDestroyNotify
) gtk_widget_unref
);
1247 if (disp
->zoom_index
== ZOOM_1
) {
1248 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1249 (zoomscale_menu_display
[1].widget
),
1252 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1254 zoomscale_menu_display
[1].widget
);
1255 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[1].widget
),
1258 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[1].widget
),
1264 gtk_widget_ref (zoomscale_menu_display
[2].widget
);
1265 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1267 zoomscale_menu_display
[2].widget
,
1268 (GtkDestroyNotify
) gtk_widget_unref
);
1269 if (disp
->zoom_index
== ZOOM_2
) {
1270 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1271 (zoomscale_menu_display
[2].widget
),
1274 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1276 zoomscale_menu_display
[2].widget
);
1277 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[2].widget
),
1280 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[2].widget
),
1286 gtk_widget_ref (zoomscale_menu_display
[3].widget
);
1287 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1289 zoomscale_menu_display
[3].widget
,
1290 (GtkDestroyNotify
) gtk_widget_unref
);
1291 if (disp
->zoom_index
== ZOOM_3
) {
1292 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1293 (zoomscale_menu_display
[3].widget
),
1296 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1298 zoomscale_menu_display
[3].widget
);
1299 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[3].widget
),
1302 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[3].widget
),
1308 gtk_widget_ref (zoomscale_menu_display
[4].widget
);
1309 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1311 zoomscale_menu_display
[4].widget
,
1312 (GtkDestroyNotify
) gtk_widget_unref
);
1313 if (disp
->zoom_index
== ZOOM_4
) {
1314 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1315 (zoomscale_menu_display
[4].widget
),
1318 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1320 zoomscale_menu_display
[4].widget
);
1321 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[4].widget
),
1324 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[4].widget
),
1330 gtk_widget_ref (zoomscale_menu_display
[5].widget
);
1331 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1333 zoomscale_menu_display
[5].widget
,
1334 (GtkDestroyNotify
) gtk_widget_unref
);
1335 if (disp
->zoom_index
== ZOOM_5
) {
1336 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1337 (zoomscale_menu_display
[5].widget
),
1340 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1342 zoomscale_menu_display
[5].widget
);
1343 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[5].widget
),
1346 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[5].widget
),
1351 gtk_widget_ref (zoomscale_menu_display
[6].widget
);
1352 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1354 zoomscale_menu_display
[6].widget
,
1355 (GtkDestroyNotify
) gtk_widget_unref
);
1356 if (disp
->zoom_index
== ZOOM_6
) {
1357 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1358 (zoomscale_menu_display
[6].widget
),
1361 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1363 zoomscale_menu_display
[6].widget
);
1364 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[6].widget
),
1367 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[6].widget
),
1372 gtk_widget_ref (zoomscale_menu_display
[7].widget
);
1373 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1375 zoomscale_menu_display
[7].widget
,
1376 (GtkDestroyNotify
) gtk_widget_unref
);
1377 if (disp
->zoom_index
== ZOOM_7
) {
1378 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1379 (zoomscale_menu_display
[7].widget
),
1382 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1384 zoomscale_menu_display
[7].widget
);
1385 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[7].widget
),
1388 gtk_object_set_data (GTK_OBJECT (zoomscale_menu_display
[7].widget
),
1394 * background menu widgets
1396 gtk_widget_ref (view_background_display
[0].widget
);
1397 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1399 view_background_display
[0].widget
,
1400 (GtkDestroyNotify
) gtk_widget_unref
);
1401 if (gpiv_par
->display__backgrnd
== SHOW_BG_DARKBLUE
) {
1402 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1403 (view_background_display
[0].widget
),
1406 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1407 "view_background_display0",
1408 view_background_display
[0].widget
);
1409 gtk_object_set_data (GTK_OBJECT (view_background_display
[0].widget
),
1415 gtk_widget_ref (view_background_display
[1].widget
);
1416 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1418 view_background_display
[1].widget
,
1419 (GtkDestroyNotify
) gtk_widget_unref
);
1420 if (gpiv_par
->display__backgrnd
== SHOW_BG_BLACK
) {
1421 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1422 (view_background_display
[1].widget
),
1425 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1426 "view_background_display1",
1427 view_background_display
[1].widget
);
1428 gtk_object_set_data (GTK_OBJECT (view_background_display
[1].widget
),
1434 gtk_widget_ref (view_background_display
[2].widget
);
1435 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1437 view_background_display
[2].widget
,
1438 (GtkDestroyNotify
) gtk_widget_unref
);
1439 if (gpiv_par
->display__backgrnd
== SHOW_BG_IMG1
) {
1440 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1441 (view_background_display
[2].widget
),
1444 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1445 "view_background_display2",
1446 view_background_display
[2].widget
);
1447 gtk_object_set_data (GTK_OBJECT (view_background_display
[2].widget
),
1453 gtk_widget_ref (view_background_display
[3].widget
);
1454 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1456 view_background_display
[3].widget
,
1457 (GtkDestroyNotify
) gtk_widget_unref
);
1458 if (gpiv_par
->display__backgrnd
== SHOW_BG_IMG2
) {
1459 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1460 (view_background_display
[3].widget
),
1463 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1464 "view_background_display3",
1465 view_background_display
[3].widget
);
1466 gtk_object_set_data (GTK_OBJECT (view_background_display
[3].widget
),
1472 * view menu widgets to display PIV data and interrrogation area's
1474 gtk_widget_ref (view_piv_display
[0].widget
);
1475 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1477 view_piv_display
[0].widget
,
1478 (GtkDestroyNotify
) gtk_widget_unref
);
1479 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1480 "view_piv_display0",
1481 view_piv_display
[0].widget
);
1482 if (disp
->display_intregs
) {
1483 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1484 (view_piv_display
[0].widget
),
1487 gtk_object_set_data (GTK_OBJECT (view_piv_display
[0].widget
),
1493 gtk_widget_ref (view_piv_display
[1].widget
);
1494 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1496 view_piv_display
[1].widget
,
1497 (GtkDestroyNotify
) gtk_widget_unref
);
1498 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1499 "view_piv_display1",
1500 view_piv_display
[1].widget
);
1501 if (disp
->display_piv
) {
1502 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1503 (view_piv_display
[1].widget
),
1506 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1507 (view_piv_display
[1].widget
),
1510 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1511 "view_piv_display1",
1512 view_piv_display
[1].widget
);
1515 * Display scalar data
1517 gtk_widget_ref (view_scalardata_display
[0].widget
);
1518 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1520 view_scalardata_display
[0].widget
,
1521 (GtkDestroyNotify
) gtk_widget_unref
);
1522 if (gpiv_par
->display__scalar
== SHOW_SC_NONE
) {
1523 if (gpiv_par
->verbose
) g_message ("create_display_popupmenu:: display__scalar == SHOW_SC_NONE");
1524 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1525 (view_scalardata_display
[0].widget
),
1528 gtk_object_set_data (GTK_OBJECT (view_scalardata_display
[0].widget
),
1531 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1532 "view_scalardata_display0",
1533 view_scalardata_display
[0].widget
);
1537 gtk_widget_ref (view_scalardata_display
[1].widget
);
1538 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1540 view_scalardata_display
[1].widget
,
1541 (GtkDestroyNotify
) gtk_widget_unref
);
1542 if (gpiv_par
->display__scalar
== SHOW_SC_VORTICITY
) {
1543 if (gpiv_par
->verbose
) g_message ("create_display_popupmenu:: display__scalar == SHOW_SC_VORTICITY");
1544 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1545 (view_scalardata_display
[1].widget
),
1548 gtk_object_set_data (GTK_OBJECT (view_scalardata_display
[1].widget
),
1551 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1552 "view_scalardata_display1",
1553 view_scalardata_display
[1].widget
);
1557 gtk_widget_ref (view_scalardata_display
[2].widget
);
1558 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1560 view_scalardata_display
[2].widget
,
1561 (GtkDestroyNotify
) gtk_widget_unref
);
1562 if (gpiv_par
->display__scalar
== SHOW_SC_SSTRAIN
) {
1563 if (gpiv_par
->verbose
) g_message ("create_display_popupmenu:: display__scalar == SHOW_SC_SSTRAIN");
1564 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1565 (view_scalardata_display
[2].widget
),
1568 gtk_object_set_data (GTK_OBJECT (view_scalardata_display
[2].widget
),
1571 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1572 "view_scalardata_display2",
1573 view_scalardata_display
[2].widget
);
1577 gtk_widget_ref (view_scalardata_display
[3].widget
);
1578 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1580 view_scalardata_display
[3].widget
,
1581 (GtkDestroyNotify
) gtk_widget_unref
);
1582 if (gpiv_par
->display__scalar
== SHOW_SC_NSTRAIN
) {
1583 if (gpiv_par
->verbose
) g_message ("create_display_popupmenu:: display__scalar == SHOW_SC_NSTRAIN");
1584 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1585 (view_scalardata_display
[3].widget
),
1588 gtk_object_set_data (GTK_OBJECT (view_scalardata_display
[3].widget
),
1591 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1592 "view_scalardata_display3",
1593 view_scalardata_display
[3].widget
);
1596 * vectorscale menu widgets
1598 gtk_widget_ref (vectorscale_menu_display
[0].widget
);
1599 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1601 vectorscale_menu_display
[0].widget
,
1602 (GtkDestroyNotify
) gtk_widget_unref
);
1603 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1605 vectorscale_menu_display
[0].widget
);
1606 if (gpiv_par
->display__vector_scale
== 1) {
1607 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1608 (vectorscale_menu_display
[0].widget
),
1614 gtk_widget_ref (vectorscale_menu_display
[1].widget
);
1615 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1617 vectorscale_menu_display
[1].widget
,
1618 (GtkDestroyNotify
) gtk_widget_unref
);
1619 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1621 vectorscale_menu_display
[1].widget
);
1622 if (gpiv_par
->display__vector_scale
== 2) {
1623 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1624 (vectorscale_menu_display
[1].widget
),
1630 gtk_widget_ref (vectorscale_menu_display
[2].widget
);
1631 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1633 vectorscale_menu_display
[2].widget
,
1634 (GtkDestroyNotify
) gtk_widget_unref
);
1635 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1637 vectorscale_menu_display
[2].widget
);
1638 if (gpiv_par
->display__vector_scale
== 4) {
1639 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1640 (vectorscale_menu_display
[2].widget
),
1646 gtk_widget_ref (vectorscale_menu_display
[3].widget
);
1647 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1649 vectorscale_menu_display
[3].widget
,
1650 (GtkDestroyNotify
) gtk_widget_unref
);
1651 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1653 vectorscale_menu_display
[3].widget
);
1654 if (gpiv_par
->display__vector_scale
== 8) {
1655 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1656 (vectorscale_menu_display
[3].widget
),
1662 gtk_widget_ref (vectorscale_menu_display
[4].widget
);
1663 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1665 vectorscale_menu_display
[0].widget
,
1666 (GtkDestroyNotify
) gtk_widget_unref
);
1667 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1669 vectorscale_menu_display
[4].widget
);
1670 if (gpiv_par
->display__vector_scale
== 16) {
1671 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1672 (vectorscale_menu_display
[4].widget
),
1678 gtk_widget_ref (vectorscale_menu_display
[5].widget
);
1679 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1681 vectorscale_menu_display
[5].widget
,
1682 (GtkDestroyNotify
) gtk_widget_unref
);
1683 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1685 vectorscale_menu_display
[5].widget
);
1686 if (gpiv_par
->display__vector_scale
== 32) {
1687 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1688 (vectorscale_menu_display
[5].widget
),
1694 gtk_widget_ref (vectorscale_menu_display
[6].widget
);
1695 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1697 vectorscale_menu_display
[6].widget
,
1698 (GtkDestroyNotify
) gtk_widget_unref
);
1699 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1701 vectorscale_menu_display
[6].widget
);
1702 if (gpiv_par
->display__vector_scale
== 64) {
1703 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1704 (vectorscale_menu_display
[6].widget
),
1710 gtk_widget_ref (vectorscale_menu_display
[7].widget
);
1711 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1713 vectorscale_menu_display
[7].widget
,
1714 (GtkDestroyNotify
) gtk_widget_unref
);
1715 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1717 vectorscale_menu_display
[7].widget
);
1718 if (gpiv_par
->display__vector_scale
== 128) {
1719 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1720 (vectorscale_menu_display
[7].widget
),
1726 gtk_widget_ref (vectorscale_menu_display
[8].widget
);
1727 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1729 vectorscale_menu_display
[8].widget
,
1730 (GtkDestroyNotify
) gtk_widget_unref
);
1731 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1733 vectorscale_menu_display
[8].widget
);
1734 if (gpiv_par
->display__vector_scale
== 256) {
1735 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1736 (vectorscale_menu_display
[8].widget
),
1742 * vectorcolor menu widgets
1744 gtk_widget_ref (vectorcolor_menu_display
[0].widget
);
1745 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1747 vectorcolor_menu_display
[0].widget
,
1748 (GtkDestroyNotify
) gtk_widget_unref
);
1749 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1750 "vectorcolor_menu_display0",
1751 vectorcolor_menu_display
[0].widget
);
1752 if (gpiv_par
->display__vector_color
== SHOW_PEAKNR
) {
1753 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1754 (vectorcolor_menu_display
[0].widget
),
1760 gtk_widget_ref (vectorcolor_menu_display
[1].widget
);
1761 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1763 vectorcolor_menu_display
[1].widget
,
1764 (GtkDestroyNotify
) gtk_widget_unref
);
1765 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1766 "vectorcolor_menu_display1",
1767 vectorcolor_menu_display
[1].widget
);
1768 if (gpiv_par
->display__vector_color
== SHOW_SNR
) {
1769 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1770 (vectorcolor_menu_display
[1].widget
),
1776 gtk_widget_ref (vectorcolor_menu_display
[2].widget
);
1777 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1779 vectorcolor_menu_display
[2].widget
,
1780 (GtkDestroyNotify
) gtk_widget_unref
);
1781 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1782 "vectorcolor_menu_display2",
1783 vectorcolor_menu_display
[2].widget
);
1784 if (gpiv_par
->display__vector_color
== SHOW_MAGNITUDE_GRAY
) {
1785 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1786 (vectorcolor_menu_display
[2].widget
),
1792 gtk_widget_ref (vectorcolor_menu_display
[3].widget
);
1793 gtk_object_set_data_full (GTK_OBJECT (display_menu
),
1795 vectorcolor_menu_display
[3].widget
,
1796 (GtkDestroyNotify
) gtk_widget_unref
);
1797 gtk_object_set_data (GTK_OBJECT (disp
->mwin
),
1798 "vectorcolor_menu_display3",
1799 vectorcolor_menu_display
[3].widget
);
1800 if (gpiv_par
->display__vector_color
== SHOW_MAGNITUDE
) {
1801 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM
1802 (vectorcolor_menu_display
[3].widget
),
1808 return display_menu
;