diff options
Diffstat (limited to 'oldXMenu')
34 files changed, 639 insertions, 80 deletions
diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c index c27005fd9e3..e679c2ffed6 100644 --- a/oldXMenu/Activate.c +++ b/oldXMenu/Activate.c @@ -1,9 +1,27 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* -Copyright (C) 2001-2017 Free Software Foundation, Inc. +Copyright (C) 2001-2022 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -103,6 +121,8 @@ int x_menu_grab_keyboard = 1; static Wait_func wait_func; static void* wait_data; +static Translate_func translate_func = NULL; +static Expose_func expose_func = NULL; void XMenuActivateSetWaitFunction (Wait_func func, void *data) @@ -111,6 +131,18 @@ XMenuActivateSetWaitFunction (Wait_func func, void *data) wait_data = data; } +void +XMenuActivateSetTranslateFunction (Translate_func func) +{ + translate_func = func; +} + +void +XMenuActivateSetExposeFunction (Expose_func func) +{ + expose_func = func; +} + int XMenuActivate( register Display *display, /* Display to put menu on. */ @@ -314,6 +346,9 @@ XMenuActivate( feq = feq_tmp; } else if (_XMEventHandler) (*_XMEventHandler)(&event); + + if (expose_func) + expose_func (&event); break; } if (event_xmp->activated) { @@ -431,6 +466,9 @@ XMenuActivate( * If the current selection was activated then * deactivate it. */ + /* Emacs specific, HELP_STRING cannot be validly NULL + * in the real XMenu library. */ + help_callback (NULL, cur_p->serial, cur_s->serial); if (cur_s->activated) { cur_s->activated = False; _XMRefreshSelection(display, menu, cur_s); @@ -497,6 +535,12 @@ XMenuActivate( feq = feq_tmp; } else if (_XMEventHandler) (*_XMEventHandler)(&event); + break; +#ifdef HAVE_XINPUT2 + case GenericEvent: + if (translate_func) + translate_func (&event); +#endif } /* * If a selection has been made, break out of the event loop. @@ -571,6 +615,7 @@ XMenuActivate( event.xbutton.window ); if (event_xmp != NULL) continue; + FALLTHROUGH; default: /* * This is a foreign event. diff --git a/oldXMenu/AddPane.c b/oldXMenu/AddPane.c index e7246f2faa0..8616de804f4 100644 --- a/oldXMenu/AddPane.c +++ b/oldXMenu/AddPane.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* * XMenu: MIT Project Athena, X Window system menu package @@ -12,8 +30,8 @@ * */ -#include <string.h> #include "XMenuInt.h" +#include <string.h> int XMenuAddPane(Display *display, register XMenu *menu, register char const *label, int active) diff --git a/oldXMenu/AddSel.c b/oldXMenu/AddSel.c index 2a52a6a6c8c..d81c54b8707 100644 --- a/oldXMenu/AddSel.c +++ b/oldXMenu/AddSel.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* @@ -13,8 +31,8 @@ * */ -#include <string.h> #include "XMenuInt.h" +#include <string.h> int XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, char *data, char *label, int active, char const *help) diff --git a/oldXMenu/ChangeLog.1 b/oldXMenu/ChangeLog.1 index 2bc61ac4a85..ebbbcd2df24 100644 --- a/oldXMenu/ChangeLog.1 +++ b/oldXMenu/ChangeLog.1 @@ -67,7 +67,7 @@ * 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 - <https://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00078.html>. + <https://lists.gnu.org/r/emacs-devel/2012-12/msg00078.html>. 2012-10-06 Ulrich Müller <ulm@gentoo.org> @@ -712,7 +712,7 @@ ;; coding: utf-8 ;; End: - Copyright (C) 1993-1999, 2001-2017 Free Software Foundation, Inc. + Copyright (C) 1993-1999, 2001-2022 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/oldXMenu/ChgPane.c b/oldXMenu/ChgPane.c index 733f65950f5..c9c4a5e8a42 100644 --- a/oldXMenu/ChgPane.c +++ b/oldXMenu/ChgPane.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/ChgSel.c b/oldXMenu/ChgSel.c index 5a46b5cf587..c26781b014d 100644 --- a/oldXMenu/ChgSel.c +++ b/oldXMenu/ChgSel.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/Create.c b/oldXMenu/Create.c index 83e6c8e38c7..69e52349402 100644 --- a/oldXMenu/Create.c +++ b/oldXMenu/Create.c @@ -1,9 +1,27 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* -Copyright (C) 1993-1994, 2001-2017 Free Software Foundation, Inc. +Copyright (C) 1993-1994, 2001-2022 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -87,7 +105,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ #define XASSOC_TABLE_SIZE 64 -char *x_get_resource_string (char const *, char const *); +const char *x_get_resource_string (char const *, char const *); @@ -107,7 +125,7 @@ XMenuCreate(Display *display, Window parent, register char const *def_env) /* Window ID of the menu's parent window. */ /* X Defaults program environment name. */ { - register char *def_val; /* X Default value temp variable. */ + register const char *def_val; /* X Default value temp variable. */ register XMenu *menu; /* Pointer to the new menu. */ XMStyle menu_style; /* Menu display style. */ @@ -598,6 +616,8 @@ XMenuCreate(Display *display, Window parent, register char const *def_env) * Create pane, active, and inactive GC's. */ values = (XGCValues *)malloc(sizeof(XGCValues)); + if (!values) + return NULL; valuemask = (GCForeground | GCBackground | GCFont | GCLineWidth); /* diff --git a/oldXMenu/DelPane.c b/oldXMenu/DelPane.c index 10234e02902..37a2095c55d 100644 --- a/oldXMenu/DelPane.c +++ b/oldXMenu/DelPane.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/DelSel.c b/oldXMenu/DelSel.c index ca2ea28c4bd..47cc1685f06 100644 --- a/oldXMenu/DelSel.c +++ b/oldXMenu/DelSel.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/Destroy.c b/oldXMenu/Destroy.c index 7f0f6146316..fdaa69b8d1c 100644 --- a/oldXMenu/Destroy.c +++ b/oldXMenu/Destroy.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/Error.c b/oldXMenu/Error.c index 01738458b6a..b49e172f0e9 100644 --- a/oldXMenu/Error.c +++ b/oldXMenu/Error.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/EvHand.c b/oldXMenu/EvHand.c index bd15359d919..94789c296f0 100644 --- a/oldXMenu/EvHand.c +++ b/oldXMenu/EvHand.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/FindPane.c b/oldXMenu/FindPane.c index 8101d009a2f..3e763215ddd 100644 --- a/oldXMenu/FindPane.c +++ b/oldXMenu/FindPane.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/FindSel.c b/oldXMenu/FindSel.c index 37a87a819af..2db43df2f94 100644 --- a/oldXMenu/FindSel.c +++ b/oldXMenu/FindSel.c @@ -1,9 +1,27 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* -Copyright (C) 2001-2017 Free Software Foundation, Inc. +Copyright (C) 2001-2022 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/oldXMenu/InsPane.c b/oldXMenu/InsPane.c index da92f49aa77..89253e1db0f 100644 --- a/oldXMenu/InsPane.c +++ b/oldXMenu/InsPane.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/InsSel.c b/oldXMenu/InsSel.c index f5380437958..527a7a0da85 100644 --- a/oldXMenu/InsSel.c +++ b/oldXMenu/InsSel.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/Internal.c b/oldXMenu/Internal.c index 913904474c5..5d1a5d2bbc8 100644 --- a/oldXMenu/Internal.c +++ b/oldXMenu/Internal.c @@ -1,9 +1,27 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* -Copyright (C) 1993, 1996, 2001-2017 Free Software Foundation, Inc. +Copyright (C) 1993, 1996, 2001-2022 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -534,7 +552,6 @@ _XMRecomputePane(register Display *display, register XMenu *menu, register XMPan register int window_y; /* Recomputed window Y coordinate. */ unsigned long change_mask; /* Value mask to reconfigure window. */ - XWindowChanges *changes; /* Values to use in configure window. */ register Bool config_p = False; /* Reconfigure pane window? */ @@ -612,21 +629,19 @@ _XMRecomputePane(register Display *display, register XMenu *menu, register XMPan * it for creation with the new configuration. */ if (p_ptr->window) { + XWindowChanges changes; change_mask = (CWX | CWY | CWWidth | CWHeight); - changes = (XWindowChanges *)malloc(sizeof(XWindowChanges)); - changes->x = p_ptr->window_x; - changes->y = p_ptr->window_y; - changes->width = p_ptr->window_w; - changes->height = p_ptr->window_h; + changes.x = p_ptr->window_x; + changes.y = p_ptr->window_y; + changes.width = p_ptr->window_w; + changes.height = p_ptr->window_h; XConfigureWindow( display, p_ptr->window, change_mask, - changes + &changes ); - free(changes); - } else { if (_XMWinQueAddPane(display, menu, p_ptr) == _FAILURE) { @@ -681,7 +696,6 @@ _XMRecomputeSelection(register Display *display, register XMenu *menu, register /* Selection sequence number. */ { register Bool config_s = False; /* Reconfigure selection window? */ - XWindowChanges *changes; /* Values to change in configure. */ unsigned long change_mask; /* Value mask for XConfigureWindow. */ /* @@ -738,22 +752,19 @@ _XMRecomputeSelection(register Display *display, register XMenu *menu, register * for creation with the new configuration. */ if (s_ptr->window) { - changes = (XWindowChanges *)malloc(sizeof(XWindowChanges)); + XWindowChanges changes; change_mask = (CWX | CWY | CWWidth | CWHeight); - changes = (XWindowChanges *)malloc(sizeof(XWindowChanges)); - changes->x = s_ptr->window_x; - changes->y = s_ptr->window_y; - changes->width = s_ptr->window_w; - changes->height = s_ptr->window_h; + changes.x = s_ptr->window_x; + changes.y = s_ptr->window_y; + changes.width = s_ptr->window_w; + changes.height = s_ptr->window_h; XConfigureWindow( display, s_ptr->window, change_mask, - changes + &changes ); - free(changes); - } else { if (_XMWinQueAddSelection(display, menu, s_ptr) == _FAILURE) { diff --git a/oldXMenu/Locate.c b/oldXMenu/Locate.c index 1605b4bbb29..bd126660116 100644 --- a/oldXMenu/Locate.c +++ b/oldXMenu/Locate.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/Makefile.in b/oldXMenu/Makefile.in index 59a6c7465b4..5cbc8a48294 100644 --- a/oldXMenu/Makefile.in +++ b/oldXMenu/Makefile.in @@ -15,7 +15,7 @@ ## without express or implied warranty. -## Copyright (C) 2001-2017 Free Software Foundation, Inc. +## Copyright (C) 2001-2022 Free Software Foundation, Inc. ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -43,6 +43,7 @@ ### Code: srcdir=@srcdir@ +top_builddir = @top_builddir@ # MinGW CPPFLAGS may use this. abs_top_srcdir=@abs_top_srcdir@ VPATH=@srcdir@ @@ -93,23 +94,7 @@ OBJS = Activate.o \ all: libXMenu11.a .PHONY: all -# 'make' verbosity. -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ - -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = - -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = - -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = +-include ${top_builddir}/src/verbose.mk AUTO_DEPEND = @AUTO_DEPEND@ DEPDIR = deps @@ -138,7 +123,7 @@ libXMenu11.a: $(OBJS) $(EXTRA) .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean clean mostlyclean: - rm -f libXMenu11.a *.o $(DEPDIR)/* + rm -f libXMenu11.a ./*.o $(DEPDIR)/* bootstrap-clean maintainer-clean distclean: clean rm -f Makefile diff --git a/oldXMenu/Post.c b/oldXMenu/Post.c index e78fedcf77a..524773673bc 100644 --- a/oldXMenu/Post.c +++ b/oldXMenu/Post.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/Recomp.c b/oldXMenu/Recomp.c index 2aec87a51dd..5c129fc5432 100644 --- a/oldXMenu/Recomp.c +++ b/oldXMenu/Recomp.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/SetAEQ.c b/oldXMenu/SetAEQ.c index ee2d64b8806..57debf0dd71 100644 --- a/oldXMenu/SetAEQ.c +++ b/oldXMenu/SetAEQ.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/SetFrz.c b/oldXMenu/SetFrz.c index c8998eeb66b..eb54dd671ed 100644 --- a/oldXMenu/SetFrz.c +++ b/oldXMenu/SetFrz.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/SetPane.c b/oldXMenu/SetPane.c index f29a81c5ca0..b43c777f278 100644 --- a/oldXMenu/SetPane.c +++ b/oldXMenu/SetPane.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/SetSel.c b/oldXMenu/SetSel.c index 2f950d49fd6..251b5f95159 100644 --- a/oldXMenu/SetSel.c +++ b/oldXMenu/SetSel.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* diff --git a/oldXMenu/XCrAssoc.c b/oldXMenu/XCrAssoc.c index 7150cbc53d6..e017cbbbccf 100644 --- a/oldXMenu/XCrAssoc.c +++ b/oldXMenu/XCrAssoc.c @@ -1,5 +1,23 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + #include <config.h> diff --git a/oldXMenu/XDelAssoc.c b/oldXMenu/XDelAssoc.c index ec1d09d46ec..26a635eef58 100644 --- a/oldXMenu/XDelAssoc.c +++ b/oldXMenu/XDelAssoc.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + #include "XMenuInt.h" diff --git a/oldXMenu/XDestAssoc.c b/oldXMenu/XDestAssoc.c index 94c0454756a..73069444344 100644 --- a/oldXMenu/XDestAssoc.c +++ b/oldXMenu/XDestAssoc.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + #include "XMenuInt.h" diff --git a/oldXMenu/XLookAssoc.c b/oldXMenu/XLookAssoc.c index fad960d7a4c..577e63f42f2 100644 --- a/oldXMenu/XLookAssoc.c +++ b/oldXMenu/XLookAssoc.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + #include <config.h> #include <X11/Xlib.h> diff --git a/oldXMenu/XMakeAssoc.c b/oldXMenu/XMakeAssoc.c index 9bbde2cf94d..256d4ebb0e2 100644 --- a/oldXMenu/XMakeAssoc.c +++ b/oldXMenu/XMakeAssoc.c @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + #include "XMenuInt.h" @@ -69,6 +87,8 @@ XMakeAssoc(register Display *dpy, register XAssocTable *table, register XID x_id /* before the current value of "Entry". */ /* Create a new XAssoc and load it with new provided data. */ new_entry = (XAssoc *) malloc(sizeof(XAssoc)); + if (!new_entry) + return; /* This obsolete API has no way to report failure! */ new_entry->display = dpy; new_entry->x_id = x_id; new_entry->data = data; diff --git a/oldXMenu/XMenu.h b/oldXMenu/XMenu.h index 8e4292f5088..54061235ae7 100644 --- a/oldXMenu/XMenu.h +++ b/oldXMenu/XMenu.h @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* @@ -237,6 +255,12 @@ typedef struct _xmenu { typedef void (*Wait_func)(void*); +/* Function for translating GenericEvents. It is should call + XPutBackEvent on an equivalent artificial core event on any + function it wants to translate. */ +typedef void (*Translate_func)(XEvent *); +typedef void (*Expose_func)(XEvent *); + /* * XMenu library routine declarations. */ @@ -256,6 +280,8 @@ void XMenuEventHandler(int (*handler) (XEvent *)); int XMenuLocate(Display *display, XMenu *menu, int p_num, int s_num, int x_pos, int y_pos, int *ul_x, int *ul_y, int *width, int *height); void XMenuSetFreeze(XMenu *menu, int freeze); void XMenuActivateSetWaitFunction(Wait_func func, void *data); +void XMenuActivateSetTranslateFunction(Translate_func func); +void XMenuActivateSetExposeFunction(Expose_func func); int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char const *, int, int)); char *XMenuPost(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, int event_mask); int XMenuDeletePane(Display *display, XMenu *menu, int p_num); diff --git a/oldXMenu/XMenuInt.h b/oldXMenu/XMenuInt.h index 369b8c1a4a9..5d5365ad8f2 100644 --- a/oldXMenu/XMenuInt.h +++ b/oldXMenu/XMenuInt.h @@ -1,6 +1,24 @@ /* Copyright Massachusetts Institute of Technology 1985 */ -#include "copyright.h" +/* + +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. + +*/ + + /* @@ -19,6 +37,8 @@ #include <config.h> +#include <attribute.h> + /* 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. */ diff --git a/oldXMenu/deps.mk b/oldXMenu/deps.mk index acb42e491ad..cef392815df 100644 --- a/oldXMenu/deps.mk +++ b/oldXMenu/deps.mk @@ -15,7 +15,7 @@ ## without express or implied warranty. -## Copyright (C) 2001-2017 Free Software Foundation, Inc. +## Copyright (C) 2001-2022 Free Software Foundation, Inc. ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by diff --git a/oldXMenu/insque.c b/oldXMenu/insque.c index 0c6afc6f622..75e59f3b338 100644 --- a/oldXMenu/insque.c +++ b/oldXMenu/insque.c @@ -1,5 +1,5 @@ /* -Copyright (C) 1993-1998, 2001-2017 Free Software Foundation, Inc. +Copyright (C) 1993-1998, 2001-2022 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by |