"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "menu.c" between
xterm-367.tgz and xterm-368.tgz

About: xterm is a terminal emulator for X with ISO/ANSI color and vt220 enhancements.

menu.c  (xterm-367.tgz):menu.c  (xterm-368.tgz)
/* $XTermId: menu.c,v 1.365 2021/03/21 20:03:03 tom Exp $ */ /* $XTermId: menu.c,v 1.367 2021/06/03 21:23:40 tom Exp $ */
/* /*
* Copyright 1999-2020,2021 by Thomas E. Dickey * Copyright 1999-2020,2021 by Thomas E. Dickey
* *
* All Rights Reserved * All Rights Reserved
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, * without limitation the rights to use, copy, modify, merge, publish,
skipping to change at line 698 skipping to change at line 698
XCreateBitmapFromData(XtDisplay(xw), XCreateBitmapFromData(XtDisplay(xw),
RootWindowOfScreen(XtScreen(xw)), RootWindowOfScreen(XtScreen(xw)),
(char *) check_bits, check_width, check_height) ; (char *) check_bits, check_width, check_height) ;
} }
#if !OPT_TOOLBAR #if !OPT_TOOLBAR
saveLocale = xtermSetLocale(LC_CTYPE, resource.menuLocale); saveLocale = xtermSetLocale(LC_CTYPE, resource.menuLocale);
list->w = XtCreatePopupShell(data->internal_name, list->w = XtCreatePopupShell(data->internal_name,
simpleMenuWidgetClass, simpleMenuWidgetClass,
toplevel, toplevel,
NULL, 0); NULL, 0);
TRACE(("created popupShell(%s) widget %p, window %#lx\n",
data->internal_name, list->w, XtWindow(list->w)));
#endif #endif
if (list->w != 0) { if (list->w != 0) {
Boolean *unused = unusedEntries(xw, num); Boolean *unused = unusedEntries(xw, num);
Cardinal n; Cardinal n;
#if OPT_TOOLBAR #if OPT_TOOLBAR
Boolean useLocale = !strcmp(resource.menuLocale, ""); Boolean useLocale = !strcmp(resource.menuLocale, "");
XtErrorMsgHandler warningHandler = 0; XtErrorMsgHandler warningHandler = 0;
if (!useLocale) if (!useLocale)
warningHandler = XtAppSetWarningMsgHandler(app_con, ignoreWarning); warningHandler = XtAppSetWarningMsgHandler(app_con, ignoreWarning);
#endif #endif
skipping to change at line 721 skipping to change at line 723
for (n = 0; n < nentries; ++n) { for (n = 0; n < nentries; ++n) {
if (!unused[n]) { if (!unused[n]) {
cb[0].callback = (XtCallbackProc) entries[n].function; cb[0].callback = (XtCallbackProc) entries[n].function;
cb[0].closure = (XtPointer) entries[n].name; cb[0].closure = (XtPointer) entries[n].name;
entries[n].widget = XtCreateManagedWidget(entries[n].name, entries[n].widget = XtCreateManagedWidget(entries[n].name,
(entries[n].function (entries[n].function
? smeBSBObjectClass ? smeBSBObjectClass
: smeLineObjectClass), : smeLineObjectClass),
list->w, list->w,
&arg, (Cardinal) 1); &arg, (Cardinal) 1);
TRACE(("created menuEntry[%d] widget %p, window %#lx\n",
n, (void *) entries[n].widget, XtWindow(entries[n].widget)
));
list->entries++; list->entries++;
} }
} }
#if OPT_TOOLBAR #if OPT_TOOLBAR
if (!useLocale) if (!useLocale)
XtAppSetWarningMsgHandler(app_con, warningHandler); XtAppSetWarningMsgHandler(app_con, warningHandler);
#endif #endif
} }
#if !OPT_TOOLBAR #if !OPT_TOOLBAR
xtermResetLocale(LC_CTYPE, saveLocale); xtermResetLocale(LC_CTYPE, saveLocale);
skipping to change at line 3034 skipping to change at line 3038
char *external_name = 0; char *external_name = 0;
Dimension button_height; Dimension button_height;
Dimension button_border; Dimension button_border;
char *saveLocale = xtermSetLocale(LC_CTYPE, resource.menuLocale); char *saveLocale = xtermSetLocale(LC_CTYPE, resource.menuLocale);
shell[n].w = XtVaCreatePopupShell(menu_names[n].internal_name, shell[n].w = XtVaCreatePopupShell(menu_names[n].internal_name,
simpleMenuWidgetClass, simpleMenuWidgetClass,
*menus, *menus,
XtNgeometry, NULL, XtNgeometry, NULL,
(XtPointer) 0); (XtPointer) 0);
TRACE(("created popupShel widget %p, window %#lx\n",
(void *) shell[n].w, XtWindow(shell[n].w)));
XtAddCallback(shell[n].w, XtNpopupCallback, InitPopup, menu_names[n].interna l_name); XtAddCallback(shell[n].w, XtNpopupCallback, InitPopup, menu_names[n].interna l_name);
XtVaGetValues(shell[n].w, XtVaGetValues(shell[n].w,
XtNlabel, &external_name, XtNlabel, &external_name,
(XtPointer) 0); (XtPointer) 0);
TRACE(("...SetupShell(%s) -> %s -> %#lx\n", TRACE(("...SetupShell(%s) -> %s -> %#lx\n",
menu_names[n].internal_name, menu_names[n].internal_name,
external_name, external_name,
(long) shell[n].w)); (long) shell[n].w));
skipping to change at line 3055 skipping to change at line 3061
sprintf(temp, "%sButton", menu_names[n].internal_name); sprintf(temp, "%sButton", menu_names[n].internal_name);
shell[n].b = XtVaCreateManagedWidget(temp, shell[n].b = XtVaCreateManagedWidget(temp,
menuButtonWidgetClass, menuButtonWidgetClass,
*menus, *menus,
XtNfromHoriz, ((m >= 0) XtNfromHoriz, ((m >= 0)
? shell[m].b ? shell[m].b
: 0), : 0),
XtNmenuName, menu_names[n].internal_name , XtNmenuName, menu_names[n].internal_name ,
XtNlabel, external_name, XtNlabel, external_name,
(XtPointer) 0); (XtPointer) 0);
TRACE(("created menuButton[%d] widget %p, window %#lx\n",
n, (void *) shell[n].b, XtWindow(shell[n].b)));
XtVaGetValues(shell[n].b, XtVaGetValues(shell[n].b,
XtNheight, &button_height, XtNheight, &button_height,
XtNborderWidth, &button_border, XtNborderWidth, &button_border,
(XtPointer) 0); (XtPointer) 0);
xtermResetLocale(LC_CTYPE, saveLocale); xtermResetLocale(LC_CTYPE, saveLocale);
return (Dimension) (button_height + (button_border * 2)); return (Dimension) (button_height + (button_border * 2));
} }
#endif /* OPT_TOOLBAR */ #endif /* OPT_TOOLBAR */
skipping to change at line 3088 skipping to change at line 3096
if (shell == toplevel) { if (shell == toplevel) {
XawSimpleMenuAddGlobalActions(app_con); XawSimpleMenuAddGlobalActions(app_con);
XtRegisterGrabAction(HandlePopupMenu, True, XtRegisterGrabAction(HandlePopupMenu, True,
(unsigned) (ButtonPressMask | ButtonReleaseMask), (unsigned) (ButtonPressMask | ButtonReleaseMask),
GrabModeAsync, GrabModeAsync); GrabModeAsync, GrabModeAsync);
} }
#if OPT_TOOLBAR #if OPT_TOOLBAR
*forms = XtVaCreateManagedWidget("form", *forms = XtVaCreateManagedWidget("form",
formWidgetClass, shell, formWidgetClass, shell,
(XtPointer) 0); (XtPointer) 0);
TRACE(("created form widget %p, window %#lx\n",
(void *) *forms, XtWindow(*forms)));
xtermAddInput(*forms); xtermAddInput(*forms);
/* /*
* Set a nominal value for the preferred pane size, which lets the * Set a nominal value for the preferred pane size, which lets the
* buttons determine the actual height of the menu bar. We don't show * buttons determine the actual height of the menu bar. We don't show
* the grip, because it's too easy to make the toolbar look bad that * the grip, because it's too easy to make the toolbar look bad that
* way. * way.
*/ */
XtSetArg(args[0], XtNorientation, XtorientHorizontal); XtSetArg(args[0], XtNorientation, XtorientHorizontal);
XtSetArg(args[1], XtNtop, XawChainTop); XtSetArg(args[1], XtNtop, XawChainTop);
XtSetArg(args[2], XtNbottom, XawChainTop); XtSetArg(args[2], XtNbottom, XawChainTop);
XtSetArg(args[3], XtNleft, XawChainLeft); XtSetArg(args[3], XtNleft, XawChainLeft);
XtSetArg(args[4], XtNright, XawChainLeft); XtSetArg(args[4], XtNright, XawChainLeft);
if (resource.toolBar) { if (resource.toolBar) {
*menus = XtCreateManagedWidget("menubar", boxWidgetClass, *forms, *menus = XtCreateManagedWidget("menubar", boxWidgetClass, *forms,
args, 5); args, 5);
} else { } else {
*menus = XtCreateWidget("menubar", boxWidgetClass, *forms, args, 5); *menus = XtCreateWidget("menubar", boxWidgetClass, *forms, args, 5);
} }
TRACE(("created menubar widget %p, window %#lx\n",
(void *) *menus, XtWindow(*menus)));
/* /*
* The toolbar widget's height is not necessarily known yet. If the * The toolbar widget's height is not necessarily known yet. If the
* toolbar is not created as a managed widget, we can still make a good * toolbar is not created as a managed widget, we can still make a good
* guess about its height by collecting the widget's other resource values. * guess about its height by collecting the widget's other resource values.
*/ */
XtVaGetValues(*menus, XtVaGetValues(*menus,
XtNhSpace, &toolbar_hSpace, XtNhSpace, &toolbar_hSpace,
(XtPointer) 0); (XtPointer) 0);
 End of changes. 7 change blocks. 
1 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)