1999-10-03 19:36:13 +00:00
|
|
|
/* Copyright Massachusetts Institute of Technology 1985 */
|
2007-02-27 03:03:56 +00:00
|
|
|
|
2021-08-29 11:28:36 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright 1985, 1986, 1987 by the Massachusetts Institute of Technology
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this
|
|
|
|
software and its documentation for any purpose and without
|
|
|
|
fee is hereby granted, provided that the above copyright
|
|
|
|
notice appear in all copies and that both that copyright
|
|
|
|
notice and this permission notice appear in supporting
|
|
|
|
documentation, and that the name of M.I.T. not be used in
|
|
|
|
advertising or publicity pertaining to distribution of the
|
|
|
|
software without specific, written prior permission.
|
|
|
|
M.I.T. makes no representations about the suitability of
|
|
|
|
this software for any purpose. It is provided "as is"
|
|
|
|
without express or implied warranty.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2007-02-27 03:03:56 +00:00
|
|
|
|
1999-10-03 19:36:13 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* XMenu: MIT Project Athena, X Window system menu package
|
|
|
|
*
|
|
|
|
* XMenuInternal.h - Internal menu system include file for the
|
|
|
|
* MIT Project Athena XMenu X window system
|
|
|
|
* menu package.
|
2003-02-04 14:56:31 +00:00
|
|
|
*
|
1999-10-03 19:36:13 +00:00
|
|
|
* Author: Tony Della Fera, DEC
|
|
|
|
* October, 1985
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _XMenuInternal_h_
|
|
|
|
#define _XMenuInternal_h_
|
|
|
|
|
Include <config.h> uniformly in oldXMenu sources.
* Activate.c, AddPane.c, AddSel.c, ChgPane.c, ChgSel.c, Create.c:
* InsPane.c, InsSel.c, Internal.c, XMakeAssoc.c:
Do not include <config.h>, since XMenuInt.h does that now.
* XLookAssoc.c, XMenuInt.h: Include <config.h>.
This avoids a build failure when configuring on Fedora 17
--with-x-toolkit=no, reported by Dmitry Andropov in
<http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00078.html>.
2012-12-04 20:42:29 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
1999-10-03 19:36:13 +00:00
|
|
|
/* Avoid warnings about redefining NULL by including <stdio.h> first;
|
|
|
|
the other file which wants to define it (<stddef.h> on Ultrix
|
|
|
|
systems) can deal if NULL is already defined, but <stdio.h> can't. */
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include "X10.h"
|
|
|
|
#include "XMenu.h"
|
|
|
|
|
|
|
|
#define min(x, y) ((x) <= (y) ? (x) : (y))
|
|
|
|
#define max(x, y) ((x) >= (y) ? (x) : (y))
|
|
|
|
#define abs(a) ((a) < 0 ? -(a) : (a))
|
|
|
|
|
|
|
|
#define _X_FAILURE -1
|
|
|
|
|
|
|
|
#define _SUCCESS 1
|
|
|
|
#define _FAILURE -1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XMenu internal event handler variable.
|
|
|
|
*/
|
2010-07-04 05:57:11 +00:00
|
|
|
extern int (*_XMEventHandler)(XEvent*);
|
1999-10-03 19:36:13 +00:00
|
|
|
|
|
|
|
#ifndef Pixel
|
|
|
|
#define Pixel unsigned long
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal routine declarations.
|
|
|
|
*/
|
Modernize to C89, for better static checking.
* Activate.c (XMenuActivate): Callback's first arg is readonly.
* AddPane.c (XMenuAddPane): Label is readonly. Rename local
to avoid shadowing.
* AddSel.c (XMenuAddSelection): Help arg is readonly. Rename local.
* Create.c (atoi, atof): Remove decls; include <stdlib.h>.
(MAX_INACT_PNUM, TILE_BUF_SIZE): Remove; unused.
(x_get_resource_string): Args are readonly.
(XAllocDisplayColor): colorName is readonly.
(XMenuCreate): def_env is readonly. Remove unused locals. Avoid
"else;".
* Destroy.c (XMenuDestroy): Return void.
* Error.c (XMenuError): Remove const pointer.
* EvHand.c (XMenuEventHandler): Return void.
* FindPane.c, FindSel.c: Include <string.h>.
* InsPane.c (XMenuInsertPane): Rename local to avoid shadowing.
* InsSel.c (XMenuInsertSelection): Likewise.
* Internal.c (toggle_color, BUFFER_SIZE): Remove; unused.
(_XMErrorList): Now const.
(_XMWinQueInit, _XMRecomputeGlobals, _XMTransToOrigin, _XMRefreshPane):
(_XMRefreshSelection): Return void.
(_XMWinQueFlush, _XMRefreshSelection): Rename locals to avoid
shadowing.
(_XMWinQueFlush): Use stack, not heap. Don't use uninitialized var.
* SetAEQ.c (XMenuSetAEQ): Now returns void.
* SetFrz.c (XMenuSetFreeze): Likewise.
* X10.h (XAssoc): Use void * for generic pointer.
* XDelAssoc.c: Include XMenuInt.h rather than duplicating part of it.
* XDestAssoc.c, XMakeAssoc.c: Likewise.
* XDestAssoc.c (XDestroyAssocTable): Return void.
* XMakeAssoc.c (XMakeAssoc): Use void * for generic pointer.
* XMenu.h, XMenuInt.h: Adjust to signature changes. Use const
for pointers to readonly storage.
* insque.c: Include XMenuInt.h, to check our own signature.
(emacs_insque, emacs_remque): Use void * for generic pointers.
2011-04-16 08:25:42 +00:00
|
|
|
void _XMWinQueInit(void);
|
|
|
|
int _XMWinQueAddPane(Display *display, XMenu *menu, XMPane *p_ptr);
|
|
|
|
int _XMWinQueAddSelection(Display *display, XMenu *menu, XMSelect *s_ptr);
|
|
|
|
int _XMWinQueFlush(Display *display, XMenu *menu, XMPane *pane, XMSelect *select);
|
|
|
|
XMPane *_XMGetPanePtr(XMenu *menu, int p_num);
|
|
|
|
XMSelect *_XMGetSelectionPtr(XMPane *p_ptr, int s_num);
|
|
|
|
void _XMRecomputeGlobals(Display *display, XMenu *menu);
|
|
|
|
int _XMRecomputePane(Display *display, XMenu *menu, XMPane *p_ptr, int p_num);
|
|
|
|
int _XMRecomputeSelection(Display *display, XMenu *menu, XMSelect *s_ptr, int s_num);
|
|
|
|
void _XMTransToOrigin(Display *display, XMenu *menu, XMPane *p_ptr, XMSelect *s_ptr, int x_pos, int y_pos, int *orig_x, int *orig_y);
|
|
|
|
void _XMRefreshPane(Display *display, XMenu *menu, XMPane *pane);
|
|
|
|
void _XMRefreshSelection(Display *display, XMenu *menu, XMSelect *select);
|
|
|
|
void emacs_insque (void *elem, void *prev);
|
|
|
|
void emacs_remque (void *elem);
|
|
|
|
void XDestroyAssocTable(XAssocTable *table);
|
|
|
|
void XMakeAssoc(Display *dpy, XAssocTable *table, XID x_id, void *data);
|
|
|
|
void XDeleteAssoc(Display *dpy, XAssocTable *table, XID x_id);
|
1999-10-03 19:36:13 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
/* Don't add stuff after this #endif */
|