home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume19 / xgetftp / part04 < prev    next >
Encoding:
Text File  |  1993-04-27  |  42.7 KB  |  1,346 lines

  1. Newsgroups: comp.sources.x
  2. From: salim@tigger.cs.colorado.edu (Salim Alam)
  3. Subject: v19i025:  xgetftp - Friendly anonymous ftp tool, Part04/04
  4. Message-ID: <1993Mar10.164918.21761@sparky.imd.sterling.com>
  5. X-Md4-Signature: d5707a911ae842939e0c1d46f8175397
  6. Date: Wed, 10 Mar 1993 16:49:18 GMT
  7. Approved: chris@sparky.imd.sterling.com
  8.  
  9. Submitted-by: salim@tigger.cs.colorado.edu (Salim Alam)
  10. Posting-number: Volume 19, Issue 25
  11. Archive-name: xgetftp/part04
  12. Environment: X11, OSF/Motif
  13.  
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 4 (of 4)."
  22. # Contents:  ui_funcs.c ui_funcs.h xgetftp.doc xgetftp.man
  23. # Wrapped by salim@anchor on Mon Mar  8 14:08:44 1993
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. if test -f 'ui_funcs.c' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'ui_funcs.c'\"
  27. else
  28. echo shar: Extracting \"'ui_funcs.c'\" \(22906 characters\)
  29. sed "s/^X//" >'ui_funcs.c' <<'END_OF_FILE'
  30. X/*************************************************************************
  31. X * MODULE
  32. X *  ui_funcs
  33. X *
  34. X * DESCRIPTION
  35. X *  Provides misc. functions for creating and using the user interface
  36. X *
  37. X * AUTHOR:
  38. X *  Salim Alam
  39. X *  University of Colorado, Boulder
  40. X *
  41. X * MODIFICATION LOG:
  42. X *
  43. X **************************************************************************/
  44. X
  45. X#include <X11/cursorfont.h>
  46. X#include <Xm/Xm.h>
  47. X#include <Xm/MainW.h>
  48. X#include <Xm/List.h>
  49. X#include <Xm/RowColumn.h>
  50. X#include <Xm/PushBG.h>
  51. X#include <Xm/Form.h>
  52. X#include <Xm/CascadeB.h>
  53. X#include <Xm/Frame.h>
  54. X#include <Xm/LabelG.h>
  55. X#include <Xm/Text.h>
  56. X#include <Xm/MessageB.h>
  57. X#include <Xm/ToggleBG.h>
  58. X#include <Xm/SelectioB.h>
  59. X#include <stdio.h>
  60. X#include "prefs.h"
  61. X#include "control.h"
  62. X#include "ui_funcs.h"
  63. X
  64. X
  65. X/*
  66. X * Global & Exported variables
  67. X */
  68. XDisplay         *display;            /* The X display       */
  69. XXtAppContext app_context;        /* The application context */
  70. X
  71. XWidget toplevelW;            /* The top level Widget       */
  72. XWidget mainwindowW;            /* The main window Widget  */
  73. XWidget workframeW;            /* Frame of list, currdir  */
  74. XWidget prefdialogW;            /* User Preferences dialog */
  75. XWidget aboutdialogW;            /* The "About..." Dialog   */
  76. XWidget menubarW;            /* The menu bar           */
  77. XWidget filelistW;            /* The scrolled list widget*/
  78. XWidget statuslineW;            /* Status line label       */
  79. XWidget cmdrowcolW;            /* The commands rowcolumn  */
  80. XWidget opendlgW;            /* Open Connection dialog  */
  81. XWidget viewbbW;                /* Dialog for text viewer  */
  82. XWidget viewtextW;            /* Text for file viewed    */
  83. XWidget archiebbW;            /* Dialog for Archie query */
  84. XWidget archietextW;            /* Result of Archie query  */
  85. XWidget archiefindtextW;            /* String to look for      */
  86. XWidget retrievedirdlgW;            /* Dialog for Retrieve dir */
  87. X
  88. X/*
  89. X * Private Global variables
  90. X */
  91. Xstatic Widget currdirtextW;        /* Curr Dir Label       */
  92. Xstatic Widget currdirlabelW;        /* Text for curr dir       */
  93. X
  94. X
  95. X
  96. Xvoid ui_initialize(int * pargc, char **argv)
  97. X{
  98. X    Arg args[2];
  99. X
  100. X    /*
  101. X     * init toolkit & create toplevel widgets 
  102. X     */
  103. X    toplevelW = XtAppInitialize(&app_context, "Xgetftp",
  104. X    NULL, 0, pargc, argv, NULL, NULL, 0);
  105. X
  106. X    display = XtDisplay(toplevelW);
  107. X
  108. X    XtSetArg(args[0], XmNmainWindowMarginWidth, 5);
  109. X    XtSetArg(args[1], XmNmainWindowMarginHeight, 1);
  110. X
  111. X    mainwindowW = XmCreateMainWindow(toplevelW, "mainw", (ArgList)args, 2);
  112. X    XtManageChild(mainwindowW);
  113. X}
  114. X
  115. X
  116. X
  117. Xvoid prefbtn_cb(Widget w, int what, XmPushButtonCallbackStruct *cb)
  118. X{
  119. X    switch (what)
  120. X    {
  121. X      case 0:
  122. X    prefs_save(user_prefs);
  123. X
  124. X      case 1:    
  125. X    XtUnmanageChild(prefdialogW);
  126. X    break;
  127. X    }
  128. X}
  129. X
  130. Xvoid ui_create_pref_dialog(Widget parent, XtCallbackProc cbproc, Prefs *pprefs)
  131. X{
  132. X    Widget rowcolW;
  133. X    Widget donebtnW;
  134. X    Widget savebtnW;
  135. X    Widget itemsW[5];
  136. X    int nargs;
  137. X    Arg args[3];
  138. X    XmString xmstr[1];
  139. X
  140. X    prefs_load(pprefs);
  141. X
  142. X    xmstr[0] = XmStringCreateSimple("User Preferences");
  143. X    XtSetArg(args[0], XmNdialogTitle, xmstr[0]);
  144. X    XtSetArg(args[1], XmNwidth, 200);
  145. X    XtSetArg(args[2], XmNheight, 250);
  146. X    prefdialogW = XmCreateBulletinBoardDialog(parent, "prefdlg", args, 3);
  147. X    XmStringFree(xmstr[0]);
  148. X
  149. X    XtSetArg(args[0], XmNpacking, XmPACK_COLUMN);
  150. X    rowcolW = XmCreateRowColumn(prefdialogW, "prefrowcol", args, 1);
  151. X    XtManageChild(rowcolW);
  152. X
  153. X    nargs = 0;
  154. X    if (pprefs->cache_view)
  155. X    {
  156. X    XtSetArg(args[nargs], XmNset, True);
  157. X    nargs++;
  158. X    }
  159. X    xmstr[0] = XmStringCreateSimple("View Cache On");
  160. X    XtSetArg(args[nargs], XmNlabelString, xmstr[0]);
  161. X    nargs++;
  162. X    itemsW[0] = XmCreateToggleButtonGadget(rowcolW, "preftb1", args, nargs);
  163. X    XmStringFree(xmstr[0]);
  164. X
  165. X    nargs = 0;
  166. X    if (pprefs->reuse_view)
  167. X    {
  168. X    XtSetArg(args[nargs], XmNset, True);
  169. X    nargs++;
  170. X    }
  171. X    xmstr[0] = XmStringCreateSimple("Reuse View Cache");
  172. X    XtSetArg(args[nargs], XmNlabelString, xmstr[0]);
  173. X    nargs++;
  174. X    itemsW[1] = XmCreateToggleButtonGadget(rowcolW, "preftb2", args, nargs);
  175. X    XmStringFree(xmstr[0]);
  176. X
  177. X    nargs = 0;
  178. X    if (pprefs->reuse_dir)
  179. X    {
  180. X    XtSetArg(args[nargs], XmNset, True);
  181. X    nargs++;
  182. X    }
  183. X    xmstr[0] = XmStringCreateSimple("Reuse Directory Cache");
  184. X    XtSetArg(args[nargs], XmNlabelString, xmstr[0]);
  185. X    nargs++;
  186. X    itemsW[2] = XmCreateToggleButtonGadget(rowcolW, "preftb3", args, nargs);
  187. X    XmStringFree(xmstr[0]);
  188. X
  189. X    nargs = 0;
  190. X    if (pprefs->autosave_dir)
  191. X    {
  192. X    XtSetArg(args[nargs], XmNset, True);
  193. X    nargs++;
  194. X    }
  195. X    xmstr[0] = XmStringCreateSimple("Autosave Directory Cache");
  196. X    XtSetArg(args[nargs], XmNlabelString, xmstr[0]);
  197. X    nargs++;
  198. X    itemsW[3] = XmCreateToggleButtonGadget(rowcolW, "preftb4", args, nargs);
  199. X    XmStringFree(xmstr[0]);
  200. X
  201. X    nargs = 0;
  202. X    if (pprefs->confirm)
  203. X    {
  204. X    XtSetArg(args[nargs], XmNset, True);
  205. X    nargs++;
  206. X    }
  207. X    xmstr[0] = XmStringCreateSimple("Confirm Cache Reuse");
  208. X    XtSetArg(args[nargs], XmNlabelString, xmstr[0]);
  209. X    nargs++;
  210. X    itemsW[4] = XmCreateToggleButtonGadget(rowcolW, "preftb5", args, nargs);
  211. X    XmStringFree(xmstr[0]);
  212. X
  213. X
  214. X    XtAddCallback(itemsW[0], XmNvalueChangedCallback, (XtCallbackProc)
  215. X    cbproc, (XtPointer) prefCACHE_VIEW);
  216. X    XtAddCallback(itemsW[1], XmNvalueChangedCallback, (XtCallbackProc)
  217. X    cbproc, (XtPointer) prefREUSE_VIEW);
  218. X    XtAddCallback(itemsW[2], XmNvalueChangedCallback, (XtCallbackProc)
  219. X    cbproc, (XtPointer) prefREUSE_DIR);
  220. X    XtAddCallback(itemsW[3], XmNvalueChangedCallback, (XtCallbackProc)
  221. X    cbproc, (XtPointer) prefAUTOSAVE_DIR);
  222. X    XtAddCallback(itemsW[4], XmNvalueChangedCallback, (XtCallbackProc)
  223. X    cbproc, (XtPointer) prefCONFIRM);
  224. X
  225. X
  226. X    XtManageChildren(itemsW, 5);
  227. X
  228. X
  229. X    XtSetArg(args[0], XmNx, 10);
  230. X    XtSetArg(args[1], XmNy, 215);
  231. X    xmstr[0] = XmStringCreateSimple("Done");
  232. X    XtSetArg(args[2], XmNlabelString, xmstr[0]);
  233. X    donebtnW = XmCreatePushButtonGadget(prefdialogW, "prefdone", args, 3);
  234. X    XmStringFree(xmstr[0]);
  235. X    XtAddCallback(donebtnW, XmNactivateCallback, (XtCallbackProc) prefbtn_cb,
  236. X    (XtPointer)1);
  237. X    XtManageChild(donebtnW);
  238. X
  239. X    XtSetArg(args[0], XmNx, 80);
  240. X    XtSetArg(args[1], XmNy, 215);
  241. X    xmstr[0] = XmStringCreateSimple("Save");
  242. X    XtSetArg(args[2], XmNlabelString, xmstr[0]);
  243. X    savebtnW = XmCreatePushButtonGadget(prefdialogW, "prefsave", args, 3);
  244. X    XmStringFree(xmstr[0]);
  245. X    XtAddCallback(savebtnW, XmNactivateCallback, (XtCallbackProc) prefbtn_cb,
  246. X    (XtPointer)0);
  247. X    XtManageChild(savebtnW);
  248. X}
  249. X
  250. X
  251. X
  252. Xvoid ui_create_about_dialog(Widget parent)
  253. X{
  254. X    Arg args[3];
  255. X    XmString xmstr[2];
  256. X    char mesg[] = "xgetftp v1.0\n\nSalim Alam\nUniversity of Colorado, Boulder\n\nPlease email all bug reports and\ncomments to: salim@cs.colorado.edu";
  257. X
  258. X    xmstr[0] = XmStringCreateLtoR(mesg, XmSTRING_DEFAULT_CHARSET);
  259. X    XtSetArg(args[0], XmNmessageString, xmstr[0]);
  260. X    xmstr[1] = XmStringCreateLtoR("About xgetftp...", XmSTRING_DEFAULT_CHARSET);
  261. X    XtSetArg(args[1], XmNdialogTitle, xmstr[1]);
  262. X    XtSetArg(args[2], XmNwidth, 275);
  263. X    aboutdialogW = XmCreateInformationDialog(parent, "aboutdlg", args, 3);
  264. X    XmStringFree(xmstr[0]);
  265. X    XmStringFree(xmstr[1]);
  266. X
  267. X    XtUnmanageChild(XmMessageBoxGetChild(aboutdialogW, XmDIALOG_HELP_BUTTON));
  268. X}
  269. X
  270. X
  271. Xvoid ui_create_work_window(Widget parent, XtCallbackProc dblclkcb,
  272. X    XtCallbackProc selectcb)
  273. X{
  274. X    Widget workformW;
  275. X    Arg args[10];
  276. X
  277. X    XtSetArg(args[0], XmNmarginWidth, 5);
  278. X    XtSetArg(args[1], XmNmarginHeight, 5);
  279. X    workframeW = XmCreateFrame(parent, "frame", args, 2);
  280. X    XtManageChild(workframeW);
  281. X
  282. X    XtSetArg(args[0], XmNresizable, False);
  283. X    workformW = XmCreateForm(workframeW, "form", args, 1);
  284. X    XtManageChild(workformW);
  285. X
  286. X    ui_create_currdir_widget(workformW);
  287. X
  288. X    XtSetArg(args[0], XmNselectionPolicy, XmEXTENDED_SELECT);
  289. X    XtSetArg(args[1], XmNdoubleClickInterval, 400);
  290. X    filelistW = XmCreateScrolledList(workformW, "filelist", args, 2);
  291. X
  292. X    XtSetArg(args[0], XmNwidth, 500);
  293. X    XtSetArg(args[1], XmNheight, 390);
  294. X    XtSetArg(args[2], XmNleftOffset, 10);
  295. X    XtSetArg(args[3], XmNleftAttachment, XmATTACH_FORM);
  296. X    XtSetArg(args[4], XmNrightOffset, 10);
  297. X    XtSetArg(args[5], XmNrightAttachment, XmATTACH_FORM);
  298. X    XtSetArg(args[6], XmNtopOffset, 40);
  299. X    XtSetArg(args[7], XmNtopAttachment, XmATTACH_FORM);
  300. X    XtSetArg(args[8], XmNbottomOffset, 5);
  301. X    XtSetArg(args[9], XmNbottomAttachment, XmATTACH_FORM);
  302. X    XtSetValues(XtParent(filelistW), args, 10);
  303. X
  304. X    XtAddCallback(filelistW, XmNdefaultActionCallback, dblclkcb, NULL);
  305. X    XtAddCallback(filelistW, XmNextendedSelectionCallback, selectcb, NULL);
  306. X    XtManageChild(filelistW);
  307. X}
  308. X
  309. X
  310. Xvoid ui_create_commands(Widget parent, XtCallbackProc cmdcbproc,
  311. X    XtCallbackProc typecbproc)
  312. X{
  313. X    Widget cmdbtnsW[3];
  314. X    Widget typeboxW;
  315. X    Widget typebtnsW[2];
  316. X    Arg args[2];
  317. X    XmString xmstr[1];
  318. X
  319. X    /*
  320. X     * Create Command Buttons
  321. X     */
  322. X    XtSetArg(args[0], XmNorientation, XmHORIZONTAL);
  323. X    XtSetArg(args[1], XmNpacking, XmPACK_COLUMN);
  324. X    cmdrowcolW = XmCreateRowColumn(parent, "commands", args, 2);
  325. X    XtManageChild(cmdrowcolW);
  326. X
  327. X    xmstr[0] = XmStringCreateLtoR("View", XmSTRING_DEFAULT_CHARSET);
  328. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  329. X    cmdbtnsW[0] = XmCreatePushButtonGadget(cmdrowcolW, "cmdb1", args, 1);
  330. X    XmStringFree(xmstr[0]);
  331. X
  332. X    xmstr[0] = XmStringCreateLtoR("Retrieve", XmSTRING_DEFAULT_CHARSET);
  333. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  334. X    cmdbtnsW[1] = XmCreatePushButtonGadget(cmdrowcolW, "cmdb2", args, 1);
  335. X    XmStringFree(xmstr[0]);
  336. X
  337. X    xmstr[0] = XmStringCreateLtoR("Cd ..", XmSTRING_DEFAULT_CHARSET);
  338. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  339. X    cmdbtnsW[2] = XmCreatePushButtonGadget(cmdrowcolW, "cmdb3", args, 1);
  340. X    XmStringFree(xmstr[0]);
  341. X
  342. X    XtAddCallback(cmdbtnsW[0], XmNactivateCallback, cmdcbproc, 
  343. X    (XtPointer) cmdVIEW);
  344. X    XtAddCallback(cmdbtnsW[1], XmNactivateCallback, cmdcbproc, 
  345. X    (XtPointer) cmdRETRIEVE);
  346. X    XtAddCallback(cmdbtnsW[2], XmNactivateCallback, cmdcbproc, 
  347. X    (XtPointer) cmdCD_UP);
  348. X
  349. X    XtManageChildren(cmdbtnsW, 3);
  350. X
  351. X
  352. X    /*
  353. X     * Create "Type" Toggles
  354. X     */
  355. X    XtSetArg(args[0], XmNorientation, XmHORIZONTAL);
  356. X    typeboxW = XmCreateRadioBox(cmdrowcolW, "typebox", args, 1);
  357. X    XtManageChild(typeboxW);
  358. X
  359. X    xmstr[0] = XmStringCreateLtoR("ASCII", XmSTRING_DEFAULT_CHARSET);
  360. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  361. X    typebtnsW[0] = XmCreateToggleButtonGadget(typeboxW, "type_a", args, 1);
  362. X    XmStringFree(xmstr[0]);
  363. X
  364. X    xmstr[0] = XmStringCreateLtoR("BINARY", XmSTRING_DEFAULT_CHARSET);
  365. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  366. X    XtSetArg(args[1], XmNset, True);
  367. X    typebtnsW[1] = XmCreateToggleButtonGadget(typeboxW, "type_i", args, 2);
  368. X    XmStringFree(xmstr[0]);
  369. X
  370. X    XtAddCallback(typebtnsW[0], XmNvalueChangedCallback, typecbproc, 
  371. X    (XtPointer) cmdASCII);
  372. X    XtAddCallback(typebtnsW[1], XmNvalueChangedCallback, typecbproc, 
  373. X    (XtPointer) cmdIMAGE);
  374. X
  375. X    XtManageChildren(typebtnsW, 2);
  376. X}
  377. X
  378. X
  379. X
  380. Xvoid ui_create_menus(Widget parent, XtCallbackProc cbproc)
  381. X/*
  382. X * Create all the menus needed.  "parent" is the parent Widget,
  383. X * and "cbproc" is the callback procedure.  Returns the menubar
  384. X * Widget
  385. X */
  386. X{
  387. X    Widget pulldownsW[4];    /* The menu bar pulldows    */
  388. X    Widget menubarbtnsW[4];    /* The menu bar buttons        */
  389. X    Widget buttons1W[3];    /* Menu#1 items            */
  390. X    Widget buttons2W[4];    /* Menu#2 items            */
  391. X    Widget buttons3W[3];    /* Menu#3 items            */
  392. X    Widget buttons4W[1];    /* Menu#4 items            */
  393. X    Arg args[3];
  394. X    XmString xmstr[1];
  395. X
  396. X
  397. X    /*
  398. X     * create menubar, pulldowns and cascade buttons
  399. X     */
  400. X    menubarW = XmCreateMenuBar(parent, "menubar", (ArgList)NULL, 0);
  401. X    XtManageChild(menubarW);
  402. X
  403. X    pulldownsW[0] = XmCreatePulldownMenu(menubarW, "pulldown1", NULL, 0);
  404. X    XtSetArg(args[0], XmNsubMenuId, pulldownsW[0]);
  405. X    xmstr[0] = XmStringCreateLtoR("File", XmSTRING_DEFAULT_CHARSET);
  406. X    XtSetArg(args[1], XmNlabelString, xmstr[0]);
  407. X    menubarbtnsW[0] = XmCreateCascadeButton(menubarW, "m1cascade", args, 2);
  408. X    XmStringFree(xmstr[0]);
  409. X
  410. X    pulldownsW[1] = XmCreatePulldownMenu(menubarW, "pulldown2", NULL, 0);
  411. X    XtSetArg(args[0], XmNsubMenuId, pulldownsW[1]);
  412. X    xmstr[0] = XmStringCreateLtoR("FTP", XmSTRING_DEFAULT_CHARSET);
  413. X    XtSetArg(args[1], XmNlabelString, xmstr[0]);
  414. X    menubarbtnsW[1] = XmCreateCascadeButton(menubarW, "m2cascade", args, 2);
  415. X    XmStringFree(xmstr[0]);
  416. X
  417. X    pulldownsW[2] = XmCreatePulldownMenu(menubarW, "pulldown3", NULL, 0);
  418. X    XtSetArg(args[0], XmNsubMenuId, pulldownsW[2]);
  419. X    xmstr[0] = XmStringCreateLtoR("Cache", XmSTRING_DEFAULT_CHARSET);
  420. X    XtSetArg(args[1], XmNlabelString, xmstr[0]);
  421. X    menubarbtnsW[2] = XmCreateCascadeButton(menubarW, "m3cascade", args, 2);
  422. X    XmStringFree(xmstr[0]);
  423. X
  424. X    pulldownsW[3] = XmCreatePulldownMenu(menubarW, "pulldown4", NULL, 0);
  425. X    XtSetArg(args[0], XmNsubMenuId, pulldownsW[3]);
  426. X    xmstr[0] = XmStringCreateLtoR("Archie", XmSTRING_DEFAULT_CHARSET);
  427. X    XtSetArg(args[1], XmNlabelString, xmstr[0]);
  428. X    menubarbtnsW[3] = XmCreateCascadeButton(menubarW, "m4cascade", args, 2);
  429. X    XmStringFree(xmstr[0]);
  430. X
  431. X    XtManageChildren(menubarbtnsW, 4);
  432. X
  433. X
  434. X
  435. X    /*
  436. X     * add pushbuttons to menu cascade buttons 
  437. X     */
  438. X    xmstr[0] = XmStringCreateLtoR("About xgetftp...", XmSTRING_DEFAULT_CHARSET);
  439. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  440. X    buttons1W[0] = XmCreatePushButtonGadget(pulldownsW[0], "m1b1", args, 1);
  441. X    XmStringFree(xmstr[0]);
  442. X    XtAddCallback(buttons1W[0], XmNactivateCallback, cbproc, 
  443. X    (XtPointer) menuFILE_ABOUT);
  444. X
  445. X    xmstr[0] = XmStringCreateLtoR("Set Preferences...", XmSTRING_DEFAULT_CHARSET);
  446. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  447. X    buttons1W[1] = XmCreatePushButtonGadget(pulldownsW[0], "m1b2", args, 1);
  448. X    XmStringFree(xmstr[0]);
  449. X    XtAddCallback(buttons1W[1],XmNactivateCallback,cbproc,
  450. X    (XtPointer) menuFILE_SET_PREFS);
  451. X
  452. X    xmstr[0] = XmStringCreateLtoR("Exit", XmSTRING_DEFAULT_CHARSET);
  453. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  454. X    buttons1W[2] = XmCreatePushButtonGadget(pulldownsW[0], "m1b3", args, 1);
  455. X    XmStringFree(xmstr[0]);
  456. X    XtAddCallback(buttons1W[2], XmNactivateCallback, cbproc, 
  457. X    (XtPointer) menuFILE_EXIT);
  458. X
  459. X    XtManageChildren(buttons1W, 3);
  460. X
  461. X
  462. X    xmstr[0] = XmStringCreateLtoR("Open Connection...", XmSTRING_DEFAULT_CHARSET);
  463. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  464. X    buttons2W[0] = XmCreatePushButtonGadget(pulldownsW[1], "m2b1", args, 1);
  465. X    XmStringFree(xmstr[0]);
  466. X    XtAddCallback(buttons2W[0], XmNactivateCallback, cbproc, 
  467. X    (XtPointer) menuFTP_OPEN);
  468. X
  469. X    xmstr[0] = XmStringCreateLtoR("Close Connection", XmSTRING_DEFAULT_CHARSET);
  470. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  471. X    buttons2W[1] = XmCreatePushButtonGadget(pulldownsW[1], "m2b2", args, 1);
  472. X    XmStringFree(xmstr[0]);
  473. X    XtAddCallback(buttons2W[1], XmNactivateCallback, cbproc, 
  474. X    (XtPointer) menuFTP_CLOSE);
  475. X
  476. X    xmstr[0] = XmStringCreateLtoR("Set Destination Dir...",
  477. X    XmSTRING_DEFAULT_CHARSET);
  478. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  479. X    buttons2W[2] = XmCreatePushButtonGadget(pulldownsW[1], "m2b3", args, 1);
  480. X    XmStringFree(xmstr[0]);
  481. X    XtAddCallback(buttons2W[2], XmNactivateCallback, cbproc, 
  482. X    (XtPointer) menuFTP_SET_DIR);
  483. X
  484. X/*
  485. X    buttons2W[3] = XmCreatePushButtonGadget(pulldownsW[1], "m2b4", NULL, 0);
  486. X    XtAddCallback(buttons2W[2], XmNactivateCallback, cbproc, 
  487. X    (XtPointer) menuFTP_SHOW_WIN);
  488. X*/
  489. X
  490. X    XtManageChildren(buttons2W, 3);
  491. X
  492. X
  493. X    xmstr[0] = XmStringCreateLtoR("Purge Dir Cache", XmSTRING_DEFAULT_CHARSET);
  494. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  495. X    buttons3W[0] = XmCreatePushButtonGadget(pulldownsW[2], "m3b1", args, 1);
  496. X    XmStringFree(xmstr[0]);
  497. X    XtAddCallback(buttons3W[0], XmNactivateCallback, cbproc, 
  498. X    (XtPointer) menuCACHE_PURGE_DIR);
  499. X
  500. X    xmstr[0] = XmStringCreateLtoR("Purge View Cache", XmSTRING_DEFAULT_CHARSET);
  501. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  502. X    buttons3W[1] = XmCreatePushButtonGadget(pulldownsW[2], "m3b2", args, 1);
  503. X    XmStringFree(xmstr[0]);
  504. X    XtAddCallback(buttons3W[1], XmNactivateCallback, cbproc, 
  505. X    (XtPointer) menuCACHE_PURGE_VIEW);
  506. X
  507. X    xmstr[0] = XmStringCreateLtoR("Save Dir Cache", XmSTRING_DEFAULT_CHARSET);
  508. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  509. X    buttons3W[2] = XmCreatePushButtonGadget(pulldownsW[2], "m3b3", args, 1);
  510. X    XmStringFree(xmstr[0]);
  511. X    XtAddCallback(buttons3W[2], XmNactivateCallback, cbproc, 
  512. X    (XtPointer) menuCACHE_SAVE_DIR);
  513. X
  514. X    XtManageChildren(buttons3W, 3);
  515. X
  516. X
  517. X    xmstr[0] = XmStringCreateLtoR("Search...", XmSTRING_DEFAULT_CHARSET);
  518. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  519. X    buttons4W[0] = XmCreatePushButtonGadget(pulldownsW[3], "m4b1", args, 1);
  520. X    XmStringFree(xmstr[0]);
  521. X    XtAddCallback(buttons4W[0], XmNactivateCallback, cbproc, 
  522. X    (XtPointer) menuARCHIE_SEARCH);
  523. X
  524. X    XtManageChildren(buttons4W, 1);
  525. X}
  526. X
  527. X
  528. X
  529. Xvoid ui_create_view_dialog(Widget parent)
  530. X{
  531. X    Arg args[6];
  532. X    XmString xmstr[1];
  533. X    Widget viewdoneW;
  534. X
  535. X    xmstr[0] = XmStringCreateSimple("File Viewer");
  536. X    XtSetArg(args[0], XmNdialogTitle, xmstr[0]);
  537. X    XtSetArg(args[1], XmNwidth, 550);
  538. X    XtSetArg(args[2], XmNheight, 430);
  539. X    viewbbW = XmCreateBulletinBoardDialog(parent, "popbb", args, 3);
  540. X    XmStringFree(xmstr[0]);
  541. X
  542. X    XtSetArg(args[0], XmNx, 10);
  543. X    XtSetArg(args[1], XmNy, 20);
  544. X    XtSetArg(args[2], XmNeditable, False);
  545. X    XtSetArg(args[3], XmNeditMode, XmMULTI_LINE_EDIT);
  546. X    XtSetArg(args[4], XmNrows, 24);
  547. X    XtSetArg(args[5], XmNcolumns, 80);
  548. X    viewtextW = XmCreateScrolledText(viewbbW, "poptext", args, 6);
  549. X    XtManageChild(viewtextW);
  550. X
  551. X    XtSetArg(args[0], XmNx, 15);
  552. X    XtSetArg(args[1], XmNy, 380);
  553. X    xmstr[0] = XmStringCreateSimple("Done");
  554. X    XtSetArg(args[2], XmNlabelString, xmstr[0]);
  555. X    viewdoneW = XmCreatePushButtonGadget(viewbbW, "popdone", args, 3);
  556. X    XmStringFree(xmstr[0]);
  557. X    XtManageChild(viewdoneW);
  558. X    XtSetArg(args[0], XmNdefaultButton, viewdoneW);
  559. X    XtSetValues(viewbbW, args, 1);
  560. X}
  561. X
  562. X
  563. X
  564. Xvoid archiedoneCB(Widget w, caddr_t data, XmPushButtonCallbackStruct *cb)
  565. X{
  566. X    XtUnmanageChild(archiebbW);
  567. X}
  568. X
  569. Xvoid ui_create_archie_dialog(Widget parent, XtCallbackProc cbproc)
  570. X{
  571. X    Widget findlabelW;
  572. X    Widget archiedoneW;
  573. X    XmString xmstr[1];
  574. X    Arg args[5];
  575. X
  576. X    xmstr[0] = XmStringCreateSimple("Archie Search");
  577. X    XtSetArg(args[0], XmNdialogTitle, xmstr[0]);
  578. X    XtSetArg(args[1], XmNwidth, 550);
  579. X    XtSetArg(args[2], XmNheight, 430);
  580. X    XtSetArg(args[3], XmNautoUnmanage, False);
  581. X    archiebbW = XmCreateBulletinBoardDialog(parent, "popbb2", args, 4);
  582. X    XmStringFree(xmstr[0]);
  583. X
  584. X    xmstr[0] = XmStringCreateSimple("Find:");
  585. X    XtSetArg(args[0], XmNlabelString, xmstr[0]);
  586. X    XtSetArg(args[1], XmNx, 10);
  587. X    XtSetArg(args[2], XmNy, 13);
  588. X    findlabelW = XmCreatePushButtonGadget(archiebbW, "findlabel", args, 3);
  589. X    XmStringFree(xmstr[0]);
  590. X    XtAddCallback(findlabelW, XmNactivateCallback, cbproc, (XtPointer) NULL);
  591. X    XtManageChild(findlabelW);
  592. X
  593. X    XtSetArg(args[0], XmNx, 60);
  594. X    XtSetArg(args[1], XmNy, 10);
  595. X    XtSetArg(args[2], XmNeditable, True);
  596. X    XtSetArg(args[3], XmNrows, 1);
  597. X    XtSetArg(args[4], XmNcolumns, 60);
  598. X    archiefindtextW = XmCreateText(archiebbW, "findtext", args, 5);
  599. X    XtManageChild(archiefindtextW);
  600. X
  601. X    XtSetArg(args[0], XmNeditable, False);
  602. X    XtSetArg(args[1], XmNeditMode, XmMULTI_LINE_EDIT);
  603. X    XtSetArg(args[2], XmNrows, 20);
  604. X    XtSetArg(args[3], XmNcolumns, 80);
  605. X    archietextW = XmCreateScrolledText(archiebbW,"archietext", args, 4);
  606. X
  607. X    XtSetArg(args[0], XmNx, 10);
  608. X    XtSetArg(args[1], XmNy, 70);
  609. X    XtSetValues(XtParent(archietextW), args, 2);
  610. X    XtManageChild(archietextW);
  611. X
  612. X    XtSetArg(args[0], XmNx, 15);
  613. X    XtSetArg(args[1], XmNy, 380);
  614. X    xmstr[0] = XmStringCreateSimple("Done");
  615. X    XtSetArg(args[2], XmNlabelString, xmstr[0]);
  616. X    archiedoneW = XmCreatePushButtonGadget(archiebbW, "archiedone", args, 3);
  617. X    XmStringFree(xmstr[0]);
  618. X    XtAddCallback(archiedoneW, XmNactivateCallback, (XtCallbackProc) 
  619. X    archiedoneCB, NULL);
  620. X    XtManageChild(archiedoneW);
  621. X}
  622. X
  623. X
  624. Xvoid ui_create_retrieve_dir_dialog(Widget parent, XtCallbackProc cbproc,
  625. X    char *retrieve_dir)
  626. X{
  627. X    Arg args[3];
  628. X    XmString xmstr[2];
  629. X
  630. X    xmstr[0] = XmStringCreateLtoR(retrieve_dir, XmSTRING_DEFAULT_CHARSET);
  631. X    XtSetArg(args[0], XmNtextString, xmstr[0]);
  632. X    xmstr[1] = XmStringCreateSimple("Set Retrieve Directory");
  633. X    XtSetArg(args[1], XmNdialogTitle, xmstr[1]);
  634. X    XtSetArg(args[2], XmNwidth, 275);
  635. X    retrievedirdlgW = XmCreatePromptDialog(parent, "retrievedirdlg", args, 3);
  636. X    XmStringFree(xmstr[0]);
  637. X    XmStringFree(xmstr[1]);
  638. X    XtUnmanageChild(XmSelectionBoxGetChild(retrievedirdlgW,
  639. X    XmDIALOG_HELP_BUTTON));
  640. X    XtAddCallback(retrievedirdlgW, XmNokCallback, cbproc, (XtPointer) NULL);
  641. X}
  642. X
  643. X
  644. Xvoid ui_create_currdir_widget(Widget parent)
  645. X{
  646. X    Arg args[6];
  647. X    XmString xmstr[1];
  648. X
  649. X    XtSetArg(args[0], XmNleftOffset, 10);
  650. X    XtSetArg(args[1], XmNleftAttachment, XmATTACH_FORM);
  651. X    XtSetArg(args[2], XmNy, 10);
  652. X    xmstr[0] = XmStringCreateSimple("Current Dir:");
  653. X    XtSetArg(args[3], XmNlabelString, xmstr[0]);
  654. X    currdirlabelW = XmCreateLabelGadget(parent, "currdirlabel", args, 4);
  655. X    XmStringFree(xmstr[0]);
  656. X    XtManageChild(currdirlabelW);
  657. X
  658. X    XtSetArg(args[0], XmNleftOffset, 86);
  659. X    XtSetArg(args[1], XmNleftAttachment, XmATTACH_FORM);
  660. X    XtSetArg(args[2], XmNy, 5);
  661. X    XtSetArg(args[3], XmNeditable, False);
  662. X    XtSetArg(args[4], XmNrows, 1);
  663. X    XtSetArg(args[5], XmNcolumns, 67);
  664. X    currdirtextW  = XmCreateText(parent, "currdirtext", args, 6);
  665. X    XtManageChild(currdirtextW);
  666. X}
  667. X
  668. X
  669. X
  670. Xvoid ui_set_currdir(char *str)
  671. X{
  672. X    XmTextSetString(currdirtextW, str);
  673. X}
  674. X
  675. X
  676. X
  677. Xvoid ui_create_open_dialog(Widget parent, XtCallbackProc cbproc)
  678. X{
  679. X    Arg args[5];
  680. X    XmString xmstr[2];
  681. X
  682. X    XtSetArg(args[0], XmNwidth, 275);
  683. X    XtSetArg(args[1], XmNheight, 120);
  684. X    XtSetArg(args[2], XmNtextColumns, 1);
  685. X    xmstr[0] = XmStringCreateSimple("Please type in host name:");
  686. X    XtSetArg(args[3], XmNselectionLabelString, xmstr[0]);
  687. X    xmstr[1] = XmStringCreateSimple("cs.colorado.edu");
  688. X    XtSetArg(args[4], XmNtextString, xmstr[1]);
  689. X    opendlgW = XmCreatePromptDialog(parent, "hprompt", args, 5);
  690. X    XmStringFree(xmstr[0]);
  691. X    XmStringFree(xmstr[1]);
  692. X    XtUnmanageChild(XmSelectionBoxGetChild(opendlgW, XmDIALOG_HELP_BUTTON));
  693. X    XtAddCallback(opendlgW, XmNokCallback, cbproc, (XtPointer) NULL);
  694. X}
  695. X
  696. X
  697. X
  698. Xvoid ui_create_status_line(Widget parent)
  699. X{
  700. X    statuslineW = XmCreateLabelGadget(parent, "status", (ArgList)NULL, 0);
  701. X    XtManageChild(statuslineW);
  702. X}
  703. X
  704. X
  705. X
  706. Xvoid ui_set_status_line(char *str)
  707. X/*
  708. X * Set the status line to 'str'
  709. X */
  710. X{
  711. X    XmString labeltext;
  712. X    Arg args[1];
  713. X
  714. X    labeltext = XmStringCreateLtoR(str, XmSTRING_DEFAULT_CHARSET);
  715. X    XtSetArg(args[0], XmNlabelString, labeltext);
  716. X    XtSetValues(statuslineW, args, 1);
  717. X    XmStringFree(labeltext);
  718. X}
  719. X
  720. X
  721. X
  722. Xvoid ui_set_cursor_busy(Widget w)
  723. X/*
  724. X * Sets the cursor to be a "watch" symbol in the Widget w
  725. X */
  726. X{
  727. X    Cursor cursor;
  728. X
  729. X    cursor = XCreateFontCursor(XtDisplay(w), XC_watch);
  730. X    XDefineCursor(XtDisplay(w), XtWindow(w), cursor);
  731. X    XFlush(XtDisplay(w));
  732. X}
  733. X
  734. X
  735. X
  736. Xvoid ui_set_cursor_normal(Widget w)
  737. X/*
  738. X * Resets the cursor in Widget w
  739. X */
  740. X{
  741. X    XUndefineCursor(XtDisplay(w), XtWindow(w));
  742. X    XFlush(XtDisplay(w));
  743. X}
  744. X
  745. END_OF_FILE
  746. if test 22906 -ne `wc -c <'ui_funcs.c'`; then
  747.     echo shar: \"'ui_funcs.c'\" unpacked with wrong size!
  748. fi
  749. # end of 'ui_funcs.c'
  750. fi
  751. if test -f 'ui_funcs.h' -a "${1}" != "-c" ; then 
  752.   echo shar: Will not clobber existing file \"'ui_funcs.h'\"
  753. else
  754. echo shar: Extracting \"'ui_funcs.h'\" \(2813 characters\)
  755. sed "s/^X//" >'ui_funcs.h' <<'END_OF_FILE'
  756. X/*************************************************************************
  757. X *
  758. X * HEADER: 
  759. X *  ui_funcs
  760. X *
  761. X **************************************************************************/
  762. X
  763. X/*
  764. X * Menu ids
  765. X */
  766. X#define menuFILE_ABOUT        101
  767. X#define menuFILE_SET_PREFS    102
  768. X#define menuFILE_EXIT        103
  769. X
  770. X#define menuFTP_OPEN        201
  771. X#define menuFTP_CLOSE        202
  772. X#define menuFTP_SET_DIR        203
  773. X#define menuFTP_SHOW_WIN    204
  774. X
  775. X#define menuCACHE_PURGE_DIR    301
  776. X#define menuCACHE_PURGE_VIEW    302
  777. X#define menuCACHE_SAVE_DIR    303
  778. X
  779. X#define menuARCHIE_SEARCH    401
  780. X
  781. X
  782. X/*
  783. X * Command ids
  784. X */
  785. X#define cmdVIEW            1
  786. X#define cmdRETRIEVE        2
  787. X#define cmdCD_UP        3
  788. X#define cmdASCII        4
  789. X#define cmdIMAGE        5
  790. X
  791. X
  792. X/*
  793. X * Exported variables
  794. X */
  795. Xextern Display      *display;   /* The X display                 */   
  796. Xextern XtAppContext app_context;/* The application context      */
  797. X
  798. Xextern Widget toplevelW;        /* The top level Widget          */
  799. Xextern Widget mainwindowW;      /* The main window Widget        */
  800. Xextern Widget workframeW;       /* Frame of list, currdir      */
  801. Xextern Widget prefdialogW;      /* User Preferences dialog      */
  802. Xextern Widget aboutdialogW;     /* The "About..." Dialog        */
  803. Xextern Widget menubarW;         /* The menu bar                 */
  804. Xextern Widget filelistW;        /* The scrolled list widget      */
  805. Xextern Widget statuslineW;    /* The status line label      */
  806. Xextern Widget cmdrowcolW;       /* The commands rowcolumn        */
  807. Xextern Widget opendlgW;         /* Open Connection dialog      */
  808. Xextern Widget viewbbW;          /* Dialog for text viewer       */
  809. Xextern Widget viewtextW;        /* Text for file viewed         */
  810. Xextern Widget archiebbW;        /* Dialog for Archie query      */
  811. Xextern Widget archietextW;      /* Result of Archie query       */
  812. Xextern Widget archiefindtextW;  /* String to look for           */
  813. Xextern Widget retrievedirdlgW;    /* Retrieve directory dialog      */
  814. X
  815. X
  816. X
  817. X/*
  818. X * Public functions
  819. X */
  820. X#define ui_beep(x)        XBell(display, x)
  821. X
  822. Xvoid
  823. Xui_initialize(int *pargc, char **argv);
  824. X
  825. Xvoid
  826. Xui_create_pref_dialog(Widget parent, XtCallbackProc cbproc, Prefs *pprefs);
  827. X
  828. Xvoid
  829. Xui_create_about_dialog(Widget parent);
  830. X
  831. Xvoid
  832. Xui_create_view_dialog(Widget parent);
  833. X
  834. Xvoid
  835. Xui_create_archie_dialog(Widget parent, XtCallbackProc cbproc);
  836. X
  837. Xvoid
  838. Xui_create_menus(Widget parent, XtCallbackProc cbproc);
  839. X
  840. Xvoid
  841. Xui_create_work_window(Widget parent, XtCallbackProc cb1, XtCallbackProc cb2);
  842. X
  843. Xvoid
  844. Xui_create_commands(Widget parent, XtCallbackProc cmdcb, XtCallbackProc typecb);
  845. X
  846. Xvoid
  847. Xui_create_currdir_widget(Widget parent);
  848. X
  849. Xvoid
  850. Xui_create_open_dialog(Widget parent, XtCallbackProc cbproc);
  851. X
  852. Xvoid
  853. Xui_create_retrieve_dir_dialog(Widget parent, XtCallbackProc cbproc, char *dir);
  854. X
  855. Xvoid
  856. Xui_set_currdir(char *str);
  857. X
  858. Xvoid
  859. Xui_create_status_line(Widget parent);
  860. X
  861. Xvoid
  862. Xui_set_status_line(char *str);
  863. X
  864. Xvoid
  865. Xui_set_cursor_busy(Widget w);
  866. X
  867. Xvoid
  868. Xui_set_cursor_normal(Widget w);
  869. END_OF_FILE
  870. if test 2813 -ne `wc -c <'ui_funcs.h'`; then
  871.     echo shar: \"'ui_funcs.h'\" unpacked with wrong size!
  872. fi
  873. # end of 'ui_funcs.h'
  874. fi
  875. if test -f 'xgetftp.doc' -a "${1}" != "-c" ; then 
  876.   echo shar: Will not clobber existing file \"'xgetftp.doc'\"
  877. else
  878. echo shar: Extracting \"'xgetftp.doc'\" \(6834 characters\)
  879. sed "s/^X//" >'xgetftp.doc' <<'END_OF_FILE'
  880. XNAME
  881. Xxgetftp - an X-based tool for browsing anonymous ftp sites
  882. X
  883. X
  884. XSYNOPSIS
  885. Xxgetftp [-q] [hostname]
  886. X
  887. X
  888. XDESCRIPTION
  889. Xxgetftp is a sophisticated browsing and file retrieval tool for anonymous
  890. Xftp.  It has an X-window user-interface based on the Motif widget set.
  891. XAvailable features include caching of directories, simple
  892. Xfile/directory retrieval, remote file viewing, caching of viewed files,
  893. Xand re-use of previously cached files and directories, and also a
  894. Xsimple interface to Archie.
  895. X
  896. X
  897. XOPTIONS
  898. X  -q        This is the "quiet" flag, which will disable the
  899. X        printing of responses from the ftp server to standard
  900. X        output.
  901. X
  902. X  hostname    If a hostname is given at startup, the program will
  903. X        attempt to connect to that host.
  904. X
  905. X
  906. XUSER INTERFACE
  907. XThe user interface is organized as follows:
  908. X
  909. X  Main Window
  910. X   Pops up after program is started, and contains the entire user
  911. X   interface.
  912. X
  913. X  File List Window
  914. X   Holds a list of all items in a given directory on the remote
  915. X   host.  The user can manipulate the files and directories in this
  916. X   window by either single-clicking or double-clicking on a file or
  917. X   directory.  A double click on a directory will move the user 'into'
  918. X   that directory and the contents will be displayed in the File List
  919. X   Window.  A single-click selects the file or directory for further
  920. X   action (see below).  Multiple files and/or directories may be selected
  921. X   by dragging with the mouse.
  922. X
  923. X  Current Directory Name 
  924. X   Holds complete pathname of current remote directory.
  925. X
  926. X  Status Line
  927. X   Located at the very bottom of the main window, this tells the user
  928. X   what host is currently connected to, what file is being retrieved,
  929. X   and when the retrieval is complete.  Information about deletion and
  930. X   saving of caches is also given on the status line.
  931. X
  932. X  Command Buttons
  933. X   For performing actions on selected items (see below).
  934. X
  935. X  Mode Buttons
  936. X   For selecting Ascii/Binary mode.  Simply clicking on one of the
  937. X   buttons selects the appropriate mode.  The default mode is binary.
  938. X
  939. X  Menus
  940. X   For other interaction (see below).
  941. X
  942. X
  943. XCOMMANDS
  944. XThere are three command buttons, located below the menu:
  945. X
  946. X  "View"
  947. X    The user can view a selected remote file in a separate window.
  948. X    Viewed files may be cached, if caching is turned on (the default).
  949. X    Files will be cached in a directory called the "cache root" -- this
  950. X    is normally the directory $HOME/.xgetftpcachedir . However, the 
  951. X    user may specify an alternative directory using the environment
  952. X    variable $XGETFTPCACHEDIR.  Within the cache root directory, each
  953. X    host has its own directory, which has the same name as the complete
  954. X    host address -- this is known as the "host cache root".  All the cache
  955. X    information for a host will be stored it's cache root.
  956. X
  957. X    When the "view" command is given, a separate child window will pop
  958. X    up and the contents of the file will be displayed in it.  The user
  959. X    can navigate through the contents by using the scroll bar.  Pressing
  960. X    the "Done" button will close the view window.
  961. X
  962. X  "Retrieve"
  963. X    All the selected files and directories will be retrieved from the
  964. X    remote host and stored in the "Destination Directory".  The Destination
  965. X    Directory is the user's current working directory by default.
  966. X
  967. X  "Cd Up"
  968. X    This moves the user up the remote directory hierarchy. 
  969. X
  970. X
  971. XMENUS
  972. X  "File Menu"
  973. X   About xgetftp... 
  974. X     Gives some information about the program.
  975. X
  976. X   Set Preferences...
  977. X     Allows the user to set and save preferences.  Preferences may be
  978. X     saved, and are stored in the file $HOME/.xgetftp.
  979. X
  980. X     The user preferences are:
  981. X     Cache View   - Whether to cache remote files viewed
  982. X     Reuse View      - Whether to reuse previously cached/viewed files
  983. X     Reuse Dir      - Whether to reuse previously cached directory information
  984. X     Autosave Dir - Whether to save directory information upon disconnection
  985. X            or exit
  986. X     Confirm      - Confirm cache reuse  (NOT YET IMPLEMENTED)
  987. X
  988. X   Exit
  989. X     Exits the program.
  990. X
  991. X
  992. X  "Ftp Menu"
  993. X   Open Connection...
  994. X     Closes the current connection and prompts the user for a hostname.
  995. X     If the "autosave dir" preference is set, the directory cache for the
  996. X     host will be saved before the connection is closed.  A connection will
  997. X     be attempted to the new host, and upon success the root directory will
  998. X     be displayed in the File List Window.
  999. X
  1000. X   Close Connection...
  1001. X    Closes the connection to the current host. If the "autosave dir"
  1002. X    preference is set, the directory cache for the host will be saved before
  1003. X    the connection is closed.
  1004. X
  1005. X   Set Directory...
  1006. X    Sets the destination directory for retrieved files.  The default is
  1007. X    the user's current working directory.
  1008. X
  1009. X
  1010. X  "Cache Menu"
  1011. X   Purge Dir Cache
  1012. X    Deletes the previously saved directory information (if any) about the
  1013. X    host currently connected to.  After the info is deleted, the ftp server
  1014. X    is queried for its root level directory listing and the user is moved
  1015. X    to the root level.  
  1016. X
  1017. X    This function should be executed if the user believes the cache to
  1018. X    be stale.  If xgetftp starts doing wierd things like showing blank
  1019. X    lines in the directory listing or if double-clicking a directory
  1020. X    doesn't work, then it is very likely that there have been major
  1021. X    changes to the ftp server structure and the cache is out of date.
  1022. X
  1023. X   Purge View Cache
  1024. X    Deletes the viewed file hierarchy for the host currently connected to.
  1025. X
  1026. X   Save Dir Cache
  1027. X    Saves all known directory information about the host currently connected
  1028. X    to.  The directory information is stored in the host's root cache
  1029. X    directory in a file called "DIRCACHE".
  1030. X
  1031. X
  1032. X  "Archie Menu"
  1033. X   Search...
  1034. X    Search for a file using Archie.  A new child window will pop up, which
  1035. X    will have three main areas : the search string area, a "Find" action
  1036. X    button, and a large text view area.  The user should select the 
  1037. X    search string area, type in the string to be searched for, and then
  1038. X    select the "Find" button.  After a brief delay (which will depend
  1039. X    on the archie server), any information found will be displayed in
  1040. X    the text view area.  The user may scroll through the text view area
  1041. X    by using the scroll-bars.
  1042. X
  1043. X
  1044. XFILES
  1045. X $HOME/.xgetftprc
  1046. X  This is the file that stores the user preferences.
  1047. X
  1048. X $XGETFTPCACHEDIR/*
  1049. X  This directory (if specified) holds all the cache information. 
  1050. X
  1051. X $HOME/.xgetftpcachedir
  1052. X  This is the default directory for the cache information.
  1053. X
  1054. X
  1055. XSEE ALSO
  1056. Xftp
  1057. X
  1058. X
  1059. XDIAGNOSTICS 
  1060. Xxgetftp will print messages to stderr if compiled with the DEBUG
  1061. Xflag defined.
  1062. X
  1063. X
  1064. XBUGS 
  1065. XSymbolic links on the remote host will not be handled.  Trying to
  1066. Xretrieve or traverse a symbolic link will result in a warning bell.
  1067. X
  1068. XHosts cannot be specified using an IP address, the actual hostname
  1069. Xmust be used.
  1070. X
  1071. X
  1072. XAUTHOR
  1073. XSalim Alam
  1074. XUniversity of Colorado, Boulder
  1075. Xsalim@cs.colorado.edu
  1076. X
  1077. END_OF_FILE
  1078. if test 6834 -ne `wc -c <'xgetftp.doc'`; then
  1079.     echo shar: \"'xgetftp.doc'\" unpacked with wrong size!
  1080. fi
  1081. # end of 'xgetftp.doc'
  1082. fi
  1083. if test -f 'xgetftp.man' -a "${1}" != "-c" ; then 
  1084.   echo shar: Will not clobber existing file \"'xgetftp.man'\"
  1085. else
  1086. echo shar: Extracting \"'xgetftp.man'\" \(6782 characters\)
  1087. sed "s/^X//" >'xgetftp.man' <<'END_OF_FILE'
  1088. X.TH XGETFTP 1
  1089. X.SH NAME
  1090. Xxgetftp \- an X-based tool for browsing anonymous ftp sites
  1091. X.SH SYNOPSIS
  1092. X.B xgetftp
  1093. X[ 
  1094. X.B \-q
  1095. X] 
  1096. X[
  1097. X.I hostname
  1098. X]
  1099. X.SH DESCRIPTION
  1100. X.B xgetftp
  1101. Xis a sophisticated browsing and file retrieval tool for anonymous
  1102. Xftp.  It has an X-window user-interface based on the Motif widget set.
  1103. XAvailable features include caching of directories, simple
  1104. Xfile/directory retrieval, remote file viewing, caching of viewed files,
  1105. Xand re-use of previously cached files and directories, and also a
  1106. Xsimple interface to Archie.
  1107. X.SH OPTIONS
  1108. X.TP
  1109. X.B \-q
  1110. XThis is the "quiet" flag, which will disable the
  1111. Xprinting of responses from the ftp server to standard
  1112. Xoutput.
  1113. X.TP
  1114. X.B hostname
  1115. XIf a hostname is given at startup, the program will
  1116. Xattempt to connect to that host.
  1117. X.SH USER INTERFACE
  1118. XThe user interface is organized as follows:
  1119. X.HP
  1120. X.B Main Window
  1121. X.br
  1122. XPops up after program is started, and contains the entire user
  1123. Xinterface.
  1124. X.HP
  1125. X.B File List Window
  1126. X.br
  1127. XHolds a list of all items in a given directory on the remote
  1128. Xhost.  The user can manipulate the files and directories in this
  1129. Xwindow by either single-clicking or double-clicking on a file or
  1130. Xdirectory.  A double click on a directory will move the user 'into'
  1131. Xthat directory and the contents will be displayed in the File List
  1132. XWindow.  A single-click selects the file or directory for further
  1133. Xaction (see below).  Multiple files and/or directories may be selected
  1134. Xby dragging with the mouse.
  1135. X.HP
  1136. X.B Current Directory Name
  1137. X.br
  1138. XHolds complete pathname of current remote directory.
  1139. X.HP
  1140. X.B Status Line
  1141. X.br
  1142. XLocated at the very bottom of the main window, this tells the user
  1143. Xwhat host is currently connected to, what file is being retrieved,
  1144. Xand when the retrieval is complete.  Information about deletion and
  1145. Xsaving of caches is also given on the status line.
  1146. X.HP
  1147. X.B Command Buttons
  1148. X.br
  1149. XFor performing actions on selected items (see below).
  1150. X.HP
  1151. X.B Mode Buttons
  1152. X.br
  1153. XFor selecting Ascii/Binary mode.  Simply clicking on one of the
  1154. Xbuttons selects the appropriate mode.  The default mode is binary.
  1155. X.HP
  1156. X.B Menus
  1157. X.br
  1158. XFor other interaction (see below).
  1159. X.SH COMMANDS
  1160. XThere are three command buttons, located below the menu:
  1161. X.HP
  1162. X.B "View"
  1163. X.br
  1164. XThe user can view a selected remote file in a separate window.
  1165. XViewed files may be cached, if caching is turned on (the default).
  1166. XFiles will be cached in a directory called the "cache root" -- this
  1167. Xis normally the directory $HOME/.xgetftpcachedir . However, the 
  1168. Xuser may specify an alternative directory using the environment
  1169. Xvariable $XGETFTPCACHEDIR.  Within the cache root directory, each
  1170. Xhost has its own directory, which has the same name as the complete
  1171. Xhost address -- this is known as the "host cache root".  All the cache
  1172. Xinformation for a host will be stored it's cache root.
  1173. X
  1174. XWhen the "view" command is given, a separate child window will pop
  1175. Xup and the contents of the file will be displayed in it.  The user
  1176. Xcan navigate through the contents by using the scroll bar.  Pressing
  1177. Xthe "Done" button will close the view window.
  1178. X.HP
  1179. X.B "Retrieve"
  1180. X.br
  1181. XAll the selected files and directories will be retrieved from the
  1182. Xremote host and stored in the "Destination Directory".  The Destination
  1183. XDirectory is the user's current working directory by default.
  1184. X.HP
  1185. X.B "Cd Up"
  1186. X.br
  1187. XThis moves the user up the remote directory hierarchy. 
  1188. X.SH MENUS
  1189. X.HP
  1190. X.B "File Menu"
  1191. X.br
  1192. XAbout xgetftp...
  1193. X.br
  1194. XGives some information about the program.
  1195. X
  1196. XSet Preferences...
  1197. X.br
  1198. XAllows the user to set and save preferences.  Preferences may be
  1199. Xsaved, and are stored in the file $HOME/.xgetftp.
  1200. X
  1201. XThe user preferences are:
  1202. X.br
  1203. XCache View - Whether to cache remote files viewed
  1204. X.br
  1205. XReuse View - Whether to reuse previously cached/viewed files
  1206. X.br
  1207. XReuse Dir - Whether to reuse previously cached directory information
  1208. X.br
  1209. XAutosave Dir - Whether to save directory information upon disconnection or exit
  1210. X.br
  1211. XConfirm - Confirm cache reuse  (NOT YET IMPLEMENTED)
  1212. X
  1213. XExit
  1214. X.br
  1215. XExits the program.
  1216. X
  1217. X.HP
  1218. X.B "Ftp Menu"
  1219. X.br
  1220. XOpen Connection...
  1221. X.br
  1222. XCloses the current connection and prompts the user for a hostname.
  1223. XIf the "autosave dir" preference is set, the directory cache for the
  1224. Xhost will be saved before the connection is closed.  A connection will
  1225. Xbe attempted to the new host, and upon success the root directory will
  1226. Xbe displayed in the File List Window.
  1227. X
  1228. X.br
  1229. XClose Connection...
  1230. X.br
  1231. XCloses the connection to the current host. If the "autosave dir"
  1232. Xpreference is set, the directory cache for the host will be saved before
  1233. Xthe connection is closed.
  1234. X
  1235. X.br
  1236. XSet Directory...
  1237. X.br
  1238. XSets the destination directory for retrieved files.  The default is
  1239. Xthe user's current working directory.
  1240. X
  1241. X.HP
  1242. X.B "Cache Menu"
  1243. X.br
  1244. XPurge Dir Cache
  1245. X.br
  1246. XDeletes the previously saved directory information (if any) about the
  1247. Xhost currently connected to.  After the info is deleted, the ftp server
  1248. Xis queried for its root level directory listing and the user is moved
  1249. Xto the root level.  
  1250. X
  1251. XThis function should be executed if the user believes the cache to
  1252. Xbe stale.  If xgetftp starts doing wierd things like showing blank
  1253. Xlines in the directory listing or if double-clicking a directory
  1254. Xdoesn't work, then it is very likely that there have been major
  1255. Xchanges to the ftp server structure and the cache is out of date.
  1256. X
  1257. X.br
  1258. XPurge View Cache
  1259. X.br
  1260. XDeletes the viewed file hierarchy for the host currently connected to.
  1261. X
  1262. X.br
  1263. XSave Dir Cache
  1264. X.br
  1265. XSaves all known directory information about the host currently connected
  1266. Xto.  The directory information is stored in the host's root cache
  1267. Xdirectory in a file called "DIRCACHE".
  1268. X
  1269. X.HP
  1270. X.B "Archie Menu"
  1271. X.br
  1272. XSearch...
  1273. X.br
  1274. XSearch for a file using Archie.  A new child window will pop up, which
  1275. Xwill have three main areas : the search string area, a "Find" action
  1276. Xbutton, and a large text view area.  The user should select the 
  1277. Xsearch string area, type in the string to be searched for, and then
  1278. Xselect the "Find" button.  After a brief delay (which will depend
  1279. Xon the archie server), any information found will be displayed in
  1280. Xthe text view area.  The user may scroll through the text view area
  1281. Xby using the scroll-bars.
  1282. X
  1283. X.SH FILES
  1284. X.PD 0
  1285. X.TP 20
  1286. X.B $HOME/.xgetftprc
  1287. XThis is the file that stores the user preferences.
  1288. X.TP 20
  1289. X.B $XGETFTPCACHEDIR/*
  1290. XThis directory (if specified) holds all the cache information. 
  1291. X.TP 20
  1292. X.B $HOME/.xgetftpcachedir
  1293. XThis is the default directory for the cache information.
  1294. X
  1295. X.SH "SEE ALSO"
  1296. X.BR ftp (1)
  1297. X
  1298. X.SH DIAGNOSTICS
  1299. Xxgetftp will print messages to stderr if compiled with the DEBUG
  1300. Xflag defined.
  1301. X
  1302. X.SH BUGS
  1303. XSymbolic links on the remote host will not be handled.  Trying to
  1304. Xretrieve or traverse a symbolic link will result in a warning bell.
  1305. X
  1306. XHosts cannot be specified using an IP address, the actual hostname
  1307. Xmust be used.
  1308. X
  1309. X.SH AUTHOR
  1310. XSalim Alam
  1311. X.br
  1312. XUniversity of Colorado, Boulder
  1313. X.br
  1314. Xsalim@cs.colorado.edu
  1315. X
  1316. END_OF_FILE
  1317. if test 6782 -ne `wc -c <'xgetftp.man'`; then
  1318.     echo shar: \"'xgetftp.man'\" unpacked with wrong size!
  1319. fi
  1320. # end of 'xgetftp.man'
  1321. fi
  1322. echo shar: End of archive 4 \(of 4\).
  1323. cp /dev/null ark4isdone
  1324. MISSING=""
  1325. for I in 1 2 3 4 ; do
  1326.     if test ! -f ark${I}isdone ; then
  1327.     MISSING="${MISSING} ${I}"
  1328.     fi
  1329. done
  1330. if test "${MISSING}" = "" ; then
  1331.     echo You have unpacked all 4 archives.
  1332.     rm -f ark[1-9]isdone
  1333. else
  1334.     echo You still need to unpack the following archives:
  1335.     echo "        " ${MISSING}
  1336. fi
  1337. ##  End of shell archive.
  1338. exit 0
  1339.  
  1340. exit 0 # Just in case...
  1341. -- 
  1342.   // chris@IMD.Sterling.COM            | Send comp.sources.x submissions to:
  1343. \X/  Amiga - The only way to fly!      |
  1344.  "It's intuitively obvious to the most |    sources-x@imd.sterling.com
  1345.   casual observer..."                  |
  1346.