 /*
  * Khoros: $Id: run_cmap.c,v 1.1 1991/05/10 15:58:30 khoros Exp $
  */

#if !defined(lint) && !defined(SABER)
static char rcsid[] = "Khoros: $Id: run_cmap.c,v 1.1 1991/05/10 15:58:30 khoros Exp $";
#endif

 /*
  * $Log: run_cmap.c,v $
 * Revision 1.1  1991/05/10  15:58:30  khoros
 * Initial revision
 *
  */ 

/*
 *----------------------------------------------------------------------
 *
 * Copyright 1990, University of New Mexico.  All rights reserved.
 * 
 * Permission to copy and modify this software and its documen-
 * tation only for internal use in your organization is hereby
 * granted, provided that this notice is retained thereon and
 * on all copies.  UNM makes no representations as too the sui-
 * tability and operability of this software for any purpose.
 * It is provided "as is" without express or implied warranty.
 * 
 * UNM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
 * NESS.  IN NO EVENT SHALL UNM BE LIABLE FOR ANY SPECIAL,
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHAT-
 * SOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PER-
 * FORMANCE OF THIS SOFTWARE.
 * 
 * No other rights, including for example, the right to redis-
 * tribute this software and its documentation or the right to
 * prepare derivative works, are granted unless specifically
 * provided in a separate license agreement.
 *----------------------------------------------------------------------
 */

#include "unmcopyright.h"	 /* Copyright 1990 by UNM */
#include "editimage.h"



/********************************************************
*
*  Routine Name:  run_colormap
*
*       Purpose:  drives the pane 'colormap'
*
*         Input:  form - pointer to the form tree 
*		  colormap_info  - information structure for pane 'colormap'
*        Output:  action of the application program
*
*     Called By:  run_function()
*
*   Automatically Generated By:  conductor
*
********************************************************/


run_colormap(form, colormap_info)

xvf_form *form;
colormap_subform_colormap *colormap_info;
{
	if (xvdisplay->image == NULL)
	{
	    xvf_error_wait("Please display an image before attempting to change its colormap!", "run_colormap", NULL);
	    return;
	}

	_xvf_get_colormap(form, colormap_info);

	/*
	 * user clicked on pane action button 'color'
	 */
	if (colormap_info->color_type_selected)
	{
  	   xvd_autocolor(xvdisplay, colormap_info->color_type_val);
	   refresh_displays(0, MAX_PIXELS);
	}
}

