view oldXMenu/SetSel.c @ 31633:829ed9cc42da

(QCmatrix, QCcolor_adjustment, QCmask, Qemboss) (Qedge_detection, Qheuristic): New symbols. (syms_of_xfns): Initialize new symbols. (lookup_image): Handle `:mask X', `:algorithm emboss', and `algorithm (edge-detection ...)'. (xbm_format, xpm_format, pbm_format, png_format, jpeg_format): (tiff_format, gif_format, gs_format): Add `:mask'. (XBM_MASK, XPM_MASK, PBM_MASK, PNG_MASK, JPEG_MASK, TIFF_MASK) (GIF_MASK, GS_MASK): New enumerators. (x_laplace_read_row, x_laplace_write_row): Functions removed. (emboss_matrix, laplace_matrix): New variables. (x_to_xcolors, x_from_xcolors, x_detect_edges, x_emboss) (x_edge_detection): New functions. (x_laplace): Rewritten in terms of x_detect_edges. (x_build_heuristic_mask): If image has a mask, free it.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 15 Sep 2000 11:48:16 +0000
parents bbce331da1be
children 23a1cea22d13
line wrap: on
line source

#include "copyright.h"

/* $Header: /u/src/emacs/19.0/oldXMenu/RCS/SetSel.c,v 1.1 1992/04/11 22:10:21 jimb Exp $ */
/* Copyright    Massachusetts Institute of Technology    1985	*/

/*
 * XMenu:	MIT Project Athena, X Window system menu package
 *
 *	XMenuSetSelection - Set a menu selection to be active or inactive.
 *
 *	Author:		Tony Della Fera, DEC
 *			August, 1985
 *
 */

#include "XMenuInt.h"

int
XMenuSetSelection(menu, p_num, s_num, active)
    register XMenu *menu;	/* Menu object to be modified. */
    register int p_num;		/* Pane number to be modified. */
    register int s_num;		/* Selection number to modified. */
    int active;			/* Make selection active? */
{
    register XMPane *p_ptr;	/* XMPane pointer. */
    register XMSelect *s_ptr;	/* XMSelect pointer. */
    
    /*
     * Find the right pane.
     */
    p_ptr = _XMGetPanePtr(menu, p_num);
    if (p_ptr == NULL) return(XM_FAILURE);

    /*
     * Find the right selection.
     */
    s_ptr = _XMGetSelectionPtr(p_ptr, s_num);
    if (s_ptr == NULL) return(XM_FAILURE);

    /*
     * Set its active switch.
     */
    s_ptr->active = active;

    /*
     * Return the selection number just set.
     */
    _XMErrorCode = XME_NO_ERROR;
    return(s_num);
}