home *** CD-ROM | disk | FTP | other *** search
- /* cat > headers/animation.h << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* animation.h: header for animation.c file */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- #define animation_h 1
-
- #include "all.h"
- #include "newext.h"
-
- static Notify_value movie_frame();
-
- /* EOF */
- /* cat > src+obj/animation/animate_proc.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* animate_proc: notify proc for animation menu */
- /* selection - works whether you use */
- /* the load_menu pull right or not! */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- animate_proc (m, mi)
- Menu m;
- Menu_item mi;
- {
- invalid_stack ();
- if (!strcmp ("Regular size", (char *) menu_get (mi, MENU_STRING)))
- animation (0);
- else
- animation (1);
- }
- /* EOF */
- /* cat > src+obj/animation/animation.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* animation: animation function accepts filename */
- /* with a wildcard. For example, 'dena*' */
- /* includes files starting with 'dena'. */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- animation (exp_factor)
- {
- char filename[MAXNAMELEN];
- int xdim, ydim, i;
- int status;
- int err;
- enum desired_img_type in_type;
- enum img_type out_type;
- int index_type;
- uint16 iref;
- bool load_pal, load_pal_old;
-
- if (animation_go) /* don't overlay images */
- return;
-
- clear_request = pause_request = 0;
- square_drawn = line_drawn = 0;
- first_middle_down = 0;
-
- /* get name */
- fn = get_imagename (); /* fn is a global! */
- if (fn == NULL || fn[0] == NULL)
- return;
- else if (fn[1] == NULL)
- { /* only one image */
- msg_write ("Warning: Only one image selected. No animation.");
- load_single ((int) panel_get_value (load_toggle));
- return;
- }
- else
- { /* a sequence of images */
- nseq = 0; /* nseq is a global! */
- while (fn[nseq] != NULL)
- image[nseq++] = NULL;
- if (nseq > MAXFRAMES)
- nseq = MAXFRAMES;
- }
-
- /* get the dimensions from the first file fn[0] */
- index_type = (int) panel_get_value (load_toggle);
- in_type = index_type % 3;
- load_pal = (index_type < 2) ? TRUE : FALSE;
-
- load_pal_old = load_pal;
-
- switch ((err = check_image (in_type, fn[0], &out_type, &xdim, &ydim, &iref, &load_pal)))
- {
- case 0: /* no error */
- break;
- case 1:
- msg_write ("Error: Image file does not exist for first image.");
- msg_write ("Animation failed.");
- return;
- case 2:
- msg_write ("Error: Dimension(s) are bad for first image.");
- msg_write ("Animation failed.");
- return;
- case 3:
- msg_write ("Error: Size of image doesn't match dimensions for first image.");
- msg_write ("Animation failed.");
- return;
- case 4:
- msg_write ("Error: No 8-bit Raster Image Set found in first image file.");
- msg_write ("Animation failed.");
- return;
- case 5:
- msg_write ("Error: No 2D Scientific Data Set found in first image file.");
- msg_write ("Animation failed.");
- return;
- case 6:
- msg_write ("Error: No 8-bit Raster Image Set or 2D Scientific Data Set found in first image file.");
- msg_write ("Animation failed.");
- return;
- case 7:
- sprintf (wkstr, "Error: Firts image too big!. (x, y) size = (%d, %d) not in range (%d, %d)", xdim, ydim, XMAX_IMAGE, YMAX_IMAGE);
- msg_write (wkstr);
- msg_write ("Animation failed.");
- return;
- default:
- sprintf (wkstr, "HDF file error (DFerror = %d): While checking first image file.", err);
- msg_write (wkstr);
- msg_write ("Animation failed.");
- return;
- }
-
- /* allow loading frames */
- curr_movie.startx = startx;
- curr_movie.starty = starty;
- curr_movie.org_xdim = xdim;
- curr_movie.org_ydim = ydim;
- curr_movie.nth_image = 0;
- curr_movie.expanded = exp_factor;
- if (exp_factor)
- {
- curr_movie.xdim = 2 * xdim;
- curr_movie.ydim = 2 * ydim;
- curr_movie.zoomx = curr_movie.zoomy = 2;
- }
- else
- {
- curr_movie.xdim = xdim;
- curr_movie.ydim = ydim;
- curr_movie.zoomx = curr_movie.zoomy = 1;
- }
-
- /* start animation */
- animation_go = 1;
-
- /* show buttons for fast operations */
- valid_ani ();
-
- /* start timer for animation */
- (void) notify_set_itimer_func (canvas, movie_frame,
- ITIMER_REAL, &NOTIFY_POLLING_ITIMER, NULL);
- }
- /* EOF */
- /* cat > src+obj/animation/create_animation_panel.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* create_animation_panel: create animation buttons */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "animation.h" */
-
- int
- create_animation_panel ()
- {
- int x, y, ix;
-
- x = 50;
- ix = 75;
- y = 50;
-
- /* buttons for animation - visible only for animation */
-
- pause_but = panel_create_item (panel, PANEL_BUTTON,
- PANEL_ITEM_X, x,
- PANEL_ITEM_Y, y,
- PANEL_LABEL_IMAGE, panel_button_image (panel, "Pause", 6, font_panel_button),
- PANEL_MENU_CHOICE_STRINGS, "Pause animation", 0,
- PANEL_SHOW_MENU, TRUE,
- PANEL_SHOW_ITEM, FALSE,
- PANEL_NOTIFY_PROC, pause_seq,
- 0);
- last_but = panel_create_item (panel, PANEL_BUTTON,
- PANEL_ITEM_X, x + ix,
- PANEL_ITEM_Y, y,
- PANEL_LABEL_IMAGE, panel_button_image (panel, "Last", 6, font_panel_button),
- PANEL_MENU_CHOICE_STRINGS, "Last frame", 0,
- PANEL_SHOW_MENU, TRUE,
- PANEL_SHOW_ITEM, FALSE,
- PANEL_NOTIFY_PROC, last_seq,
- 0);
- next_but = panel_create_item (panel, PANEL_BUTTON,
- PANEL_ITEM_X, x + 2 * ix,
- PANEL_ITEM_Y, y,
- PANEL_LABEL_IMAGE, panel_button_image (panel, "Next", 6, font_panel_button),
- PANEL_MENU_CHOICE_STRINGS, "Next frame", 0,
- PANEL_SHOW_MENU, TRUE,
- PANEL_SHOW_ITEM, FALSE,
- PANEL_NOTIFY_PROC, next_seq,
- 0);
- inc_but = panel_create_item (panel, PANEL_BUTTON,
- PANEL_ITEM_X, x + 3 * ix,
- PANEL_ITEM_Y, y,
- PANEL_LABEL_IMAGE, panel_button_image (panel, "+", 1, font_panel_button),
- PANEL_MENU_CHOICE_STRINGS, "Increase speed", 0,
- PANEL_SHOW_MENU, TRUE,
- PANEL_SHOW_ITEM, FALSE,
- PANEL_NOTIFY_PROC, inc_speed,
- 0);
- dec_but = panel_create_item (panel, PANEL_BUTTON,
- PANEL_ITEM_X, x + 3 * ix + 40,
- PANEL_ITEM_Y, y,
- PANEL_LABEL_IMAGE, panel_button_image (panel, "-", 1, font_panel_button),
- PANEL_MENU_CHOICE_STRINGS, "Decrease speed", 0,
- PANEL_SHOW_MENU, TRUE,
- PANEL_SHOW_ITEM, FALSE,
- PANEL_NOTIFY_PROC, dec_speed,
- 0);
- }
- /* EOF */
- /* cat > src+obj/animation/dec_speed.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* dec_speed: decrease speed */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- dec_speed (item, event)
- Panel_item item;
- Event *event;
- {
- if (repeat_index < 20)
- repeat_index++;
- }
- /* EOF */
- /* cat > src+obj/animation/done_seq.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* done_seq: clean up when animation ends */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- done_seq ()
- {
- register i;
-
- if (!animation_go)
- return;
-
- (void) notify_set_itimer_func (canvas, movie_frame, ITIMER_REAL, NULL, NULL);
- msg_write ("Note: Flushing images from memory . . .");
- for (i = 0; i < nseq; i++)
- {
- if (image[i] != NULL)
- {
- /* printf */
- /* sprintf (wkstr2, "done_seq: %d", i);
- msg_write (wkstr2); */
- pr_close (image[i]);
- image[i] = NULL;
- }
- }
- (void) free_list (fn);
-
- /* clean the image area on the canvas */
- pw_write (pw, curr_movie.startx, curr_movie.starty, curr_movie.xdim,
- curr_movie.ydim, PIX_CLR, NULL, 0, 0);
-
- pause_request = 0;
- animation_go = 0;
- nseq = 0;
- curr_movie.image = NULL;
-
- invalid_ani ();
- }
- /* EOF */
- /* cat > src+obj/animation/expand2.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* expand2: expand2 */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- struct pixrect *
- expand2 (pr1, xdim, ydim, zz)
- struct pixrect *pr1;
- int xdim, ydim;
- {
- struct pixrect *pr2;
- struct mpr_data *mpr1, *mpr2;
- char *s, *t;
-
- if ((pr2 = mem_create (xdim * zz, ydim * zz, 8)) == NULL)
- {
- msg_write ("Error: Not enough memory to expand image.");
- return (NULL);
- }
- mpr1 = mpr_d (pr1);
- mpr2 = mpr_d (pr2);
- s = (char *) mpr1->md_image;
- t = (char *) mpr2->md_image;
- pix_expand (s, t, xdim, ydim, zz, zz);
- return (pr2);
- }
- /* EOF */
- /* cat > src+obj/animation/inc_speed.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* inc_speed: increase speed */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- inc_speed (item, event)
- Panel_item item;
- Event *event;
- {
- if (repeat_index > 0)
- repeat_index--;
- }
- /* EOF */
- /* cat > src+obj/animation/invalid_ani.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* invalid_ani: invalid animation */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- invalid_ani ()
- {
- Menu_item item;
-
- /* make all the animation buttons invisible */
- if (panel_get (pause_but, PANEL_SHOW_ITEM, 0))
- {
- panel_set (pause_but, PANEL_SHOW_ITEM, FALSE, 0);
- panel_set (last_but, PANEL_SHOW_ITEM, FALSE, 0);
- panel_set (next_but, PANEL_SHOW_ITEM, FALSE, 0);
- panel_set (inc_but, PANEL_SHOW_ITEM, FALSE, 0);
- panel_set (dec_but, PANEL_SHOW_ITEM, FALSE, 0);
- }
-
- /* disable stacking */
- item = menu_get (image_menu, MENU_NTH_ITEM, 4, 0);
- menu_set (item, MENU_INACTIVE, FALSE, 0);
- }
- /* EOF */
- /* cat > src+obj/animation/last_seq.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* last_seq: display previous frame in sequence when */
- /* pause */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- last_seq (item, event)
- Panel_item item;
- Event *event;
- {
- clear_request = 0;
-
- if (animation_go && pause_request)
- {
- if (--curr_movie.nth_image < 0)
- curr_movie.nth_image = nseq - 1;
- if (image[curr_movie.nth_image] == NULL)
- {
- if (++curr_movie.nth_image == nseq)
- curr_movie.nth_image = 0;
- return;
- }
- panel_set_value (image_board, fn[curr_movie.nth_image]);
- pw_write (pw, curr_movie.startx, curr_movie.starty, curr_movie.xdim,
- curr_movie.ydim, PIX_SRC, image[curr_movie.nth_image], 0, 0);
- }
- return;
-
- }
- /* EOF */
- /* cat > src+obj/animation/load_movie_frame.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* load_movie_frame: load one frame into memory */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- load_movie_frame (i)
- int i;
- {
- enum desired_img_type in_type;
- enum img_type out_type;
- int index_type, err;
- int dim_x, dim_y;
- uint16 iref;
- bool load_pal, load_pal_old;
-
- dim_x = curr_movie.org_xdim;
- dim_y = curr_movie.org_ydim;
- startx = curr_movie.startx;
- starty = curr_movie.starty;
-
- if (fn[i] != NULL && animation_go)
- {
- index_type = (int) panel_get_value (load_toggle);
- in_type = index_type % 3;
- load_pal = (index_type < 2) ? TRUE : FALSE;
-
- load_pal_old = load_pal;
-
- /* the global fn[i] contains the single filename */
- switch ((err = check_image (in_type, fn[i], &out_type, &dim_x, &dim_y, &iref, &load_pal)))
- {
- case 0: /* no error */
- break;
- case 1:
- msg_write ("Error: Image file does not exist.");
- /* printf */
- /* sprintf (wkstr2, "load_movie_frame: %d, %s", i, fn[i]);
- msg_write (wkstr2); */
- return (-1);
- case 2:
- msg_write ("Error: Dimension(s) are bad.");
- return (-1);
- case 3:
- msg_write ("Error: Size of image doesn't match dimensions.");
- return (-1);
- case 4:
- msg_write ("Error: No 8-bit Raster Image Set found in image file.");
- return (-1);
- case 5:
- msg_write ("Error: No 2D Scientific Data Set found in image file.");
- return (-1);
- case 6:
- msg_write ("Error: No 8-bit Raster Image Set or 2D Scientific Data Set found in image file.");
- return (-1);
- case 7:
- sprintf (wkstr, "Error: Image too big!. (x, y) size = (%d, %d) not in range (%d, %d)", dim_x, dim_y, XMAX_IMAGE, YMAX_IMAGE);
- msg_write (wkstr);
- return (-1);
- default:
- sprintf (wkstr, "HDF file error (DFerror = %d): While checking image file.", err);
- msg_write (wkstr);
- return (-1);
- }
- if (out_type == RIS8 && (load_pal != load_pal_old))
- msg_write ("Warning: No palette with 8-bit Raster Image Set in image file.");
- switch (out_type)
- {
- case RAWI:
- if (load_RAWI (fn[i], dim_x, dim_y, ANIMATION))
- return (-1);
- break;
- case RIS8:
- if (load_RIS8 (fn[i], dim_x, dim_y, iref, load_pal, ANIMATION))
- return (-1);
- break;
- case SDS2D:
- if (load_SDS2D (fn[i], dim_x, dim_y, ANIMATION))
- return (-1);
- break;
- }
- }
- /* printf ("in_type = %d\n", in_type); */
- return (0);
- }
- /* EOF */
- /* cat > src+obj/animation/load_single.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* load_single: load a single image from disk */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- int
- load_single (index_type)
- /* returns: 0 - success
- -1 - error */
- int index_type;
- /* input: index of what to load from load_toggle */
- {
- enum desired_img_type in_type;
- enum img_type out_type;
- int err;
- int dim_x, dim_y;
- uint16 iref;
- bool load_pal, load_pal_old;
-
- in_type = index_type % 3;
- load_pal = (index_type < 2) ? TRUE : FALSE;
-
- load_pal_old = load_pal;
-
- /* the global fn[0] contains the single filename */
- switch ((err = check_image (in_type, fn[0], &out_type, &dim_x, &dim_y, &iref, &load_pal)))
- {
- case 0: /* no error */
- break;
- case 1:
- msg_write ("Error: Image file does not exist.");
- return (-1);
- case 2:
- msg_write ("Error: Dimension(s) are bad.");
- return (-1);
- case 3:
- msg_write ("Error: Size of image doesn't match dimensions.");
- return (-1);
- case 4:
- msg_write ("Error: No 8-bit Raster Image Set found in image file.");
- return (-1);
- case 5:
- msg_write ("Error: No 2D Scientific Data Set found in image file.");
- return (-1);
- case 6:
- msg_write ("Error: No 8-bit Raster Image Set or 2D Scientific Data Set found in image file.");
- return (-1);
- case 7:
- sprintf (wkstr, "Error: Image too big!. (x, y) size = (%d, %d) not in range (%d, %d)", dim_x, dim_y, XMAX_IMAGE, YMAX_IMAGE);
- msg_write (wkstr);
- return (-1);
- default:
- sprintf (wkstr, "HDF file error (DFerror = %d): While checking image file.", err);
- msg_write (wkstr);
- return (-1);
- }
- if (out_type == RIS8 && (load_pal != load_pal_old))
- msg_write ("Warning: No palette with 8-bit Raster Image Set in image file.");
- switch (out_type)
- {
- case RAWI:
- if (load_RAWI (fn[0], dim_x, dim_y, SINGLE_IMAGE))
- return (-1);
- break;
- case RIS8:
- if (load_RIS8 (fn[0], dim_x, dim_y, iref, load_pal, SINGLE_IMAGE))
- return (-1);
- break;
- case SDS2D:
- if (load_SDS2D (fn[0], dim_x, dim_y, SINGLE_IMAGE))
- return (-1);
- break;
- }
- /* printf ("in_type = %d\n", in_type); */
- return (0);
- }
- /* EOF */
- /* cat > src+obj/animation/movie_frame.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* movie_frame: (static) timer function called each */
- /* time when timer sends a signal */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- static Notify_value
- movie_frame (client, itimer_type)
- Notify_client client;
- int itimer_type;
- {
- int i;
- /* printf */
- /* sprintf (wkstr, "movie_frame: %d %d", animation_go, curr_movie.nth_image);
- msg_write (wkstr); */
- if (!animation_go)
- { /* interrupt */
- done_seq ();
- return (NOTIFY_DONE);
- }
-
- if (image[curr_movie.nth_image] != NULL)
- { /* loaded, then playback */
- panel_set_value (image_board, fn[curr_movie.nth_image]);
- for (i = 0; i <= repeat_index; i++)
- {
- pw_write (pw, curr_movie.startx, curr_movie.starty,
- curr_movie.xdim, curr_movie.ydim, PIX_SRC,
- image[curr_movie.nth_image], 0, 0);
- }
- }
- else
- { /* load movie frame */
- if (load_movie_frame (curr_movie.nth_image) == -1)
- { /* terminate */
- nseq = curr_movie.nth_image;
- curr_movie.nth_image = 0;
- return (NOTIFY_DONE);
- }
- else
- panel_set_value (image_board, fn[curr_movie.nth_image]);
- }
-
- /* advance a frame */
- if (++curr_movie.nth_image >= nseq)
- curr_movie.nth_image = 0;
- return (NOTIFY_DONE);
- }
- /* EOF */
- /* cat > src+obj/animation/next_seq.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* next_seq: display next frame in sequence when pause */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- next_seq (item, event)
- Panel_item item;
- Event *event;
- {
- clear_request = 0;
-
- if (animation_go && pause_request)
- {
- if (++curr_movie.nth_image >= nseq)
- curr_movie.nth_image = 0;
- if (image[curr_movie.nth_image] == NULL)
- {
- if (--curr_movie.nth_image < 0)
- curr_movie.nth_image = nseq - 1;
- return;
- }
- panel_set_value (image_board, fn[curr_movie.nth_image]);
- pw_write (pw, curr_movie.startx, curr_movie.starty, curr_movie.xdim,
- curr_movie.ydim, PIX_SRC, image[curr_movie.nth_image], 0, 0);
- }
- return;
- }
- /* EOF */
- /* cat > src+obj/animation/pause_seq.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* pause_seq: pause animation */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- pause_seq (item, event)
- Panel_item item;
- Event *event;
- {
- register i;
-
- /* printf */
- /* sprintf (wkstr, "pause_seq: %d %d", animation_go, pause_request);
- msg_write (wkstr); */
- if (animation_go)
- {
- if (!pause_request)
- {
- (void) notify_set_itimer_func (canvas, movie_frame,
- ITIMER_REAL, NULL, NULL);
- pause_request = 1;
- if (--curr_movie.nth_image < 0)
- curr_movie.nth_image = nseq - 1;
-
- curr_image.startx = curr_movie.startx;
- curr_image.starty = curr_movie.starty;
- curr_image.org_xdim = curr_movie.org_xdim;
- curr_image.org_ydim = curr_movie.org_ydim;
- curr_image.xdim = curr_movie.xdim;
- curr_image.ydim = curr_movie.ydim;
- curr_image.zoomx = curr_movie.zoomx;
- curr_image.zoomy = curr_movie.zoomy;
- curr_image.expanded = curr_movie.expanded;
- curr_image.nth_image = curr_movie.nth_image;
- curr_image.image = NULL;
- }
- else
- {
- (void) notify_set_itimer_func (canvas, movie_frame,
- ITIMER_REAL, &NOTIFY_POLLING_ITIMER, NULL);
- pause_request = 0;
- }
- }
- return;
- }
- /* EOF */
- /* cat > src+obj/animation/valid_ani.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* valid_ani: valid animation */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "image.h" */
-
- valid_ani ()
- {
- Menu_item item;
-
- panel_set (pause_but, PANEL_SHOW_ITEM, TRUE, 0);
- panel_set (next_but, PANEL_SHOW_ITEM, TRUE, 0);
- panel_set (last_but, PANEL_SHOW_ITEM, TRUE, 0);
- panel_set (inc_but, PANEL_SHOW_ITEM, TRUE, 0);
- panel_set (dec_but, PANEL_SHOW_ITEM, TRUE, 0);
- item = menu_get (image_menu, MENU_NTH_ITEM, 4, 0);
- menu_set (item, MENU_INACTIVE, TRUE, 0);
- }
- /* EOF */
-