Remove some useless macros.

This commit is contained in:
Mid Favila 2022-08-21 22:12:07 -04:00
parent 9977646e06
commit 2a49564ca9
3 changed files with 41 additions and 14 deletions

View File

@ -3,6 +3,7 @@
* Convert build system to plain Make.
* Start removing references to FreeNode.
* Move the repeated copyright banners out to a single header.
* Replace some of the macros with actual function calls.
2005-04-01 Riccardo Mottola <rmottola@users.sf.net>
* network.c : removed useless statement

View File

@ -61,46 +61,73 @@ int main (int argc, char *argv[])
Widget userForm;
/* Menu Stuff */
XmString filestr, userstr, prefstr, savconstr, quitstr, whostr, cliverstr, opstr, deopstr, abtstr, cmdstr;
Widget menuBar, helpMenu;
filestr = XmStringCreateLocalized("File");
userstr = XmStringCreateLocalized("User");
prefstr = XmStringCreateLocalized("Preferences...");
savconstr = XmStringCreateLocalized("Save Conversation");
quitstr = XmStringCreateLocalized("Quit");
whostr = XmStringCreateLocalized("Whois");
cliverstr = XmStringCreateLocalized("Client version");
opstr = XmStringCreateLocalized("Op");
deopstr = XmStringCreateLocalized("Deop");
abtstr = XmStringCreateLocalized("About");
cmdstr = XmStringCreateLocalized("Commands");
topWidget = XtVaAppInitialize(&nebulaIrcAppContext, "Nebula IRC", NULL, 0, &argc, argv, NULL, NULL);
mainWindow = XtVaCreateManagedWidget("main_window", xmMainWindowWidgetClass, topWidget, XmNcommandWindowLocation, XmCOMMAND_BELOW_WORKSPACE, XmNwidth, 600, XmNheight, 500, NULL);
menuBar = XmVaCreateSimpleMenuBar(mainWindow, "menubar",
XmVaCASCADEBUTTON, XmStringCreateLocalized("File"), 'F',
XmVaCASCADEBUTTON, XmStringCreateLocalized("User"), 'U',
XmVaCASCADEBUTTON, filestr, 'F',
XmVaCASCADEBUTTON, userstr, 'U',
NULL);
XmVaCreateSimplePulldownMenu(menuBar, "file_menu", 0,
fileMenuCall,
XmVaPUSHBUTTON, XmStringCreateLocalized("Preferences..."), 'P', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Save Conversation"), 'S', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Quit"), 'Q', NULL, NULL,
XmVaPUSHBUTTON, prefstr, 'P', NULL, NULL,
XmVaPUSHBUTTON, savconstr, 'S', NULL, NULL,
XmVaPUSHBUTTON, quitstr, 'Q', NULL, NULL,
NULL);
XmVaCreateSimplePulldownMenu(menuBar, "user_menu", 1,
userMenuCall,
XmVaPUSHBUTTON, XmStringCreateLocalized("Whois"), 'W', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Client version"), '\0', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Op"), 'O', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Deop"), 'D', NULL, NULL,
XmVaPUSHBUTTON, whostr, 'W', NULL, NULL,
XmVaPUSHBUTTON, cliverstr, '\0', NULL, NULL,
XmVaPUSHBUTTON, opstr, 'O', NULL, NULL,
XmVaPUSHBUTTON, deopstr, 'D', NULL, NULL,
NULL);
helpMenu = XtVaCreateManagedWidget("Help",
xmCascadeButtonWidgetClass, menuBar,
XmNmnemonic, 'H',
NULL);
XmVaCreateSimplePulldownMenu(menuBar, "Help", 2,
helpMenuCall,
XmVaPUSHBUTTON, XmStringCreateLocalized("About..."), 'A', NULL, NULL,
XmVaPUSHBUTTON, XmStringCreateLocalized("Commands"), 'C', NULL, NULL,
XmVaPUSHBUTTON, abtstr, 'A', NULL, NULL,
XmVaPUSHBUTTON, cmdstr, 'C', NULL, NULL,
NULL);
XtVaSetValues(menuBar, XmNmenuHelpWidget, helpMenu, NULL);
XtManageChild(menuBar);
XmStringFree(filestr);
XmStringFree(userstr);
XmStringFree(prefstr);
XmStringFree(savconstr);
XmStringFree(quitstr);
XmStringFree(whostr);
XmStringFree(cliverstr);
XmStringFree(opstr);
XmStringFree(deopstr);
XmStringFree(abtstr);
XmStringFree(cmdstr);
mainForm = XtVaCreateWidget("form", xmFormWidgetClass, mainWindow, XmNfractionBase, 3, NULL);
userForm = XtVaCreateWidget("userform", xmFormWidgetClass, mainForm,

View File

@ -4,8 +4,7 @@
* This file is part of the nebula irc client *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <netdb.h> /* for MAXHOSTNAMELEN */
#include <sys/param.h> /* for MAXHOSTNAMELEN on other systems */
#include <sys/param.h> /* for MAXHOSTNAMELEN */
#define PREF_FILE_NAME ".nebula.rc"