dtpad.h 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $TOG: dtpad.h /main/20 1999/09/15 15:14:33 mgreess $ */
  24. /**********************************<+>*************************************
  25. ***************************************************************************
  26. **
  27. ** File: dtpad.h
  28. **
  29. ** Project: COSE dtpad, a memo maker type editor based on the motif
  30. ** text widget.
  31. **
  32. ** Description:
  33. ** -----------
  34. ** This is the header file for the dtpad list of file which include:
  35. ** dtpad.c
  36. **
  37. *******************************************************************
  38. ** (c) Copyright Hewlett-Packard Company, 1990. All rights are
  39. ** reserved. Copying or other reproduction of this program
  40. ** except for archival purposes is prohibited without prior
  41. ** written consent of Hewlett-Packard Company.
  42. ********************************************************************
  43. **
  44. ********************************************************************
  45. ** (c) Copyright 1993, 1994 Hewlett-Packard Company
  46. ** (c) Copyright 1993, 1994 International Business Machines Corp.
  47. ** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  48. ** (c) Copyright 1993, 1994 Novell, Inc.
  49. ********************************************************************
  50. **
  51. **
  52. **************************************************************************
  53. **********************************<+>*************************************/
  54. #ifndef DTPAD_H
  55. #define DTPAD_H
  56. #include <stdio.h>
  57. #include <stdint.h>
  58. #include <fcntl.h>
  59. #include <errno.h>
  60. #include <limits.h>
  61. #include <sys/types.h>
  62. #include <sys/stat.h>
  63. #include <X11/Xatom.h>
  64. #include <X11/Intrinsic.h>
  65. #include <X11/Shell.h>
  66. #include <Xm/Protocols.h>
  67. #include <Xm/Xm.h>
  68. #include <Xm/XmP.h>
  69. #include <Xm/CascadeB.h>
  70. #include <Xm/CascadeBG.h>
  71. #include <Xm/FileSB.h>
  72. #include <Xm/LabelG.h>
  73. #include <Xm/List.h>
  74. #include <Xm/MainW.h>
  75. #include <Xm/MessageB.h>
  76. #include <Xm/PushB.h>
  77. #include <Xm/PushBG.h>
  78. #include <Xm/RowColumn.h>
  79. #include <Xm/SelectioB.h>
  80. #include <Xm/SeparatoG.h>
  81. #include <Xm/Text.h>
  82. #include <Xm/TextF.h>
  83. #include <Xm/ToggleB.h>
  84. #include <Xm/ToggleBG.h>
  85. #include <Dt/Session.h>
  86. #include <Dt/Dt.h>
  87. #include <Dt/Dts.h>
  88. #include <Dt/Message.h>
  89. #include <Dt/UserMsg.h>
  90. #include <Dt/Editor.h>
  91. #include <Dt/Print.h>
  92. #include <Dt/PrintOptionsP.h>
  93. #include <Tt/tttk.h>
  94. #define DTPAD_CLASS_NAME "Dtpad"
  95. #define CHECKSPELLING 0
  96. #define FINDCHANGE 1
  97. #define OPTIONS 2
  98. #define UNKNOWN_ACTION -1
  99. #define EXTEND_SELECTION 0
  100. #define OPEN 0
  101. #define INCLUDE 1
  102. #define DEFAULT_GEOMETRY_STR "80x24"
  103. #define DEFAULT_COLS 80
  104. #define DEFAULT_ROWS 24
  105. typedef enum {
  106. SUCCESS,
  107. COPYOFTEMPFAILED,
  108. UNWRITABLEFILE,
  109. NOTEMPFILE
  110. } WriteStatus;
  111. /************************************************************************
  112. * Resources
  113. ************************************************************************/
  114. typedef struct {
  115. Boolean statusLine;
  116. Boolean wordWrap;
  117. Boolean overstrike;
  118. Boolean saveOnClose;
  119. Boolean missingFileWarning;
  120. Boolean readOnlyWarning;
  121. Boolean nameChange;
  122. Boolean viewOnly;
  123. String workspaceList;
  124. String session;
  125. Boolean standAlone;
  126. Boolean blocking;
  127. Boolean server;
  128. Boolean exitOnLastClose;
  129. } ApplicationData, *ApplicationDataPtr;
  130. /************************************************************************
  131. * structures related to various dialogs
  132. ************************************************************************/
  133. typedef struct {
  134. Widget newl_radio,
  135. with_newl,
  136. without_newl;
  137. } ToggleWidgets;
  138. /* -----> "Open" file selection box and "Save?" dialog widgets
  139. * (indentation indicates widget hierarchy) */
  140. typedef struct {
  141. Widget file_dialog,
  142. dir_list,
  143. filter_text,
  144. select_text,
  145. file_list,
  146. save_warning,
  147. work_area,
  148. row_col,
  149. wkArea_textLabel,
  150. separator,
  151. cancelBtn;
  152. ToggleWidgets toggleWidgets;
  153. } Select;
  154. /* -----> "Save As" file selection box and "Already Exists" dialog widgets
  155. * (indentation indicates widget hierarchy) */
  156. typedef struct {
  157. Widget saveAs_form,
  158. alrdy_exist;
  159. ToggleWidgets toggleWidgets;
  160. } SaveAs;
  161. /* -----> */
  162. typedef struct _confirm {
  163. int confirmationStatus; /* status from resource-spec'd comfirm dlg */
  164. Widget dialog,
  165. wk_area,
  166. wkArea_textLabel;
  167. } ConfirmStuff;
  168. /************************************************************************
  169. * structures related to menu bar functions
  170. ************************************************************************/
  171. /* -----> structs related to "File" pulldown menu */
  172. typedef struct {
  173. Select select;
  174. SaveAs saveAs;
  175. Widget gen_warning;
  176. Widget newBtn;
  177. Widget openBtn;
  178. Widget includeBtn;
  179. Widget saveBtn;
  180. Widget saveAsBtn;
  181. Widget printBtn;
  182. Widget silentPrintBtn;
  183. Widget xprintBtn; /* Added temporarily to support X Print Service */
  184. Widget exitBtn;
  185. } FileWidgets;
  186. typedef struct {
  187. void (*pendingFileFunc)();
  188. void (*pendingFileHelpFunc)();
  189. Boolean fileExists,
  190. saveWithNewlines,
  191. readOnly;
  192. char *fileName,
  193. *netfile, /* obpaque Took Talk string handle to file */
  194. *savingName,
  195. *lastIncludeName,
  196. pathDir[512], /* dir in specified path */
  197. includePathDir[512]; /* dir in specified path */
  198. FileWidgets fileWidgets;
  199. XmString openTitle,
  200. includeTitle,
  201. saveBtnLabel,
  202. saveNeededBtnLabel;
  203. } FileStuff;
  204. /* -----> structs related to "Edit" pulldown menu */
  205. typedef struct {
  206. Widget undoBtn,
  207. cutBtn,
  208. copyBtn,
  209. pasteBtn,
  210. clearBtn,
  211. deleteBtn,
  212. selectAllBtn,
  213. findChangeBtn,
  214. checkSpellingBtn;
  215. } EditWidgets;
  216. typedef struct {
  217. EditWidgets widgets;
  218. } EditStuff;
  219. /* -----> structs related to "Format" pulldown menu */
  220. typedef struct {
  221. Widget separator,
  222. paragraph,
  223. all,
  224. close,
  225. help,
  226. formatBtn;
  227. } FormatWidgets;
  228. typedef struct {
  229. FormatWidgets widgets;
  230. int right_margin; /* format size */
  231. int left_margin;
  232. } FormatStuff;
  233. /* -----> structs related to "Options" pulldown menu */
  234. typedef struct {
  235. Widget overstrikeBtn,
  236. wordWrapBtn,
  237. statusLineBtn,
  238. helpBtn,
  239. optionsBtn;
  240. } OptionsMenuWidgets;
  241. typedef struct {
  242. OptionsMenuWidgets widgets;
  243. } OptionsStuff;
  244. /* -----> structs related to "Help" pulldown menu */
  245. typedef struct _helpStruct {
  246. struct _helpStruct *pNext;
  247. struct _helpStruct *pPrev;
  248. Widget dialog;
  249. Boolean inUse;
  250. } HelpStruct;
  251. /************************************************************************
  252. * structs related to the status line
  253. ************************************************************************/
  254. typedef struct _statusWidgets {
  255. Widget container,
  256. lineLabel,
  257. lineText,
  258. colLabel,
  259. colText;
  260. } StatusWidgets;
  261. typedef struct _status {
  262. StatusWidgets widgets;
  263. int currentLine,
  264. currentCol;
  265. } StatusStuff;
  266. /************************************************************************
  267. * structs related to a ToolTalk Edit/Display/Instantiate message and any
  268. * related Quit and Save messages.
  269. ************************************************************************/
  270. typedef struct _ttEditRequest {
  271. Tt_message contract; /* media request */
  272. char *msg_id; /* id of ToolTalk media request */
  273. Tttk_op op; /* op code = Edit/Display/Instantiate */
  274. char *vtype; /* media type */
  275. Boolean contents; /* indicates file or buffer request */
  276. Boolean returnBufContents; /* indicates if contents returned in reply */
  277. char *fileName; /* file name supplied in media request */
  278. char *docName; /* title of file/buffer */
  279. Tt_pattern savePattern; /* pattern to handle Save requests */
  280. } TTEditRequest;
  281. typedef struct _ttQuitRequest {
  282. Tt_message contract; /* original TTDT_QUIT request */
  283. Boolean silent; /* arg #1 */
  284. Boolean force; /* arg #2 */
  285. char * operation2Quit; /* arg #3 - window to quit (its Edit msg ID) */
  286. } TTQuitRequest;
  287. typedef struct _ttSaveRequest {
  288. Tt_message contract; /* original TTDT_SAVE request */
  289. char * messageID; /* window to save (i.e. its Edit message ID) */
  290. } TTSaveRequest;
  291. /************************************************************************
  292. * Editor struct - the primary sturcture for each Editor instance
  293. ************************************************************************/
  294. typedef struct _editor {
  295. char *progname; /* program name without the full pathname */
  296. char *dialogTitle; /* string retrieved from message catalog */
  297. Display *display; /* Display */
  298. XtAppContext app_context; /* Application Context */
  299. ApplicationData xrdb;
  300. TTEditRequest ttEditReq; /* ToolTalk Edit/Display/Instantiate msg info */
  301. TTQuitRequest ttQuitReq; /* ToolTalk Quit msg info */
  302. TTSaveRequest ttSaveReq; /* ToolTalk Save msg info */
  303. HelpStruct *pHelpCache;
  304. FileStuff fileStuff; /* all data for File functions */
  305. EditStuff editStuff; /* all data for Edit functions */
  306. FormatStuff formatStuff; /* all data for Format functions */
  307. OptionsStuff optionsStuff; /* all data for Options functions */
  308. ConfirmStuff confirmStuff; /* data for resource spec'd confirm dialog */
  309. StatusStuff statusStuff;
  310. Boolean nodo,
  311. saveRestore;
  312. Boolean iconic;
  313. Position x,y;
  314. Dimension width, height;
  315. String geometry;
  316. char select_string[512];
  317. Widget app_shell, /* ApplicationShell */
  318. editor, /* Dt Editor widget */
  319. statusLineMsg, /* Dt Editor widget status line text field */
  320. panedWindow, /* Paned window */
  321. mainWindow, /* MainWindow */
  322. menu_bar, /* RowColumn */
  323. #ifdef POPUP
  324. popup,
  325. #endif
  326. ExitWid,
  327. MainHelp,
  328. pseudo;
  329. unsigned short group_id, /* users group id - for file type checking */
  330. user_id; /* the users id - for file type checking */
  331. struct _editor *pNextPad;
  332. struct _editor *pPrevPad;
  333. Boolean inUse;
  334. char *blockChannel;
  335. int numPendingTasks;
  336. XtWorkProcId fileExitWorkprocID;
  337. } Editor;
  338. typedef struct {
  339. Editor *pPad;
  340. int argc;
  341. char **argv;
  342. } StartupStruct;
  343. /************************************************************************
  344. * Printing structs - structures to support prining using the X Print Service
  345. ************************************************************************/
  346. /*
  347. * Enums for the strings that appear in the header and footer fields
  348. * on each page.
  349. */
  350. typedef enum {
  351. PRINT_NONE_STRING_TYPE_ENUM,
  352. PRINT_DATE_STRING_TYPE_ENUM,
  353. PRINT_DOCNAME_STRING_TYPE_ENUM,
  354. PRINT_PAGE_NUMBER_STRING_TYPE_ENUM,
  355. PRINT_USER_NAME_STRING_TYPE_ENUM
  356. } PrintStringTypeEnum;
  357. /*
  358. * Data structure to saving print options from the PrintSetup GUI.
  359. */
  360. typedef struct {
  361. Boolean wordWrap;
  362. char *marginBottom,
  363. *marginLeft,
  364. *marginRight,
  365. *marginTop;
  366. PrintStringTypeEnum
  367. footerLeft,
  368. footerRight,
  369. headerLeft,
  370. headerRight;
  371. } PrintOptions;
  372. /*
  373. * Structure summarizing the setup context for a print job.
  374. * Includes the widgets which make up the print setup dialog,
  375. * and the printing options retrieved from the print setup dialog.
  376. */
  377. typedef struct print_setup_widgets {
  378. Widget parent;
  379. Widget dtprintSetup;
  380. Widget form;
  381. Widget hdrftrFrame;
  382. Widget marginFrame;
  383. Widget docLabel;
  384. Widget docNameLabel;
  385. Widget wordWrapTB;
  386. } psWidgets;
  387. typedef struct print_setup {
  388. char *docName;
  389. XtCallbackProc
  390. cancelCB,
  391. closeDisplayCB,
  392. printCB,
  393. setupCB;
  394. XtPointer cancelClosure,
  395. closeDisplayClosure,
  396. printClosure,
  397. setupClosure;
  398. Editor *pPad;
  399. Widget parent;
  400. Widget dtprintSetup;
  401. psWidgets *widgets;
  402. PrintOptions
  403. options;
  404. } PrintSetup;
  405. /*
  406. * Structure summarizing a print job including the print options used
  407. * and the current state of the job.
  408. */
  409. typedef struct print_output {
  410. Widget pShell;
  411. Widget page;
  412. Widget innerPage;
  413. Widget headerLeft;
  414. Widget headerRight;
  415. Widget editor;
  416. Widget footerLeft;
  417. Widget footerRight;
  418. int currentLine;
  419. int linesPerPage;
  420. Dimension marginTop;
  421. Dimension marginRight;
  422. Dimension marginBottom;
  423. Dimension marginLeft;
  424. } PrintOutput;
  425. /*
  426. * Structure summarizing a print job including the print options used
  427. * and the current state of the job.
  428. */
  429. typedef struct print_job {
  430. struct _editor *pPad;
  431. Widget parentShell;
  432. char *tempFileName;
  433. char *documentName;
  434. Boolean silent;
  435. PrintOutput *pOutput;
  436. PrintSetup *pSetup;
  437. Widget pShell;
  438. DtPrintSetupData *printData;
  439. int npagesDone;
  440. int npagesTotal;
  441. Widget nextpageShell,
  442. nextpageButton;
  443. } PrintJob;
  444. /************************************************************************
  445. * macro to get message catalog strings
  446. ************************************************************************/
  447. #ifndef NO_MESSAGE_CATALOG
  448. # define GETMESSAGE(set, number, string)\
  449. _DtpadGetMessage(set, number, string)
  450. #else
  451. # define GETMESSAGE(set, number, string)\
  452. string
  453. #endif
  454. #define UNNAMED_TITLE ((char *)GETMESSAGE(7, 6, "(UNTITLED)"))
  455. /*[SuG 5/10/95] Added for fixing print bug. */
  456. #define UNNAMED_TITLE_P ((char *)GETMESSAGE(5, 21, "UNTITLED"))
  457. /************************************************************************
  458. * functions in fileCB.c
  459. ************************************************************************/
  460. extern void FileCascadingCB(
  461. Widget w,
  462. caddr_t client_data,
  463. caddr_t call_data);
  464. extern void FileNewCB(
  465. Widget w,
  466. caddr_t client_data,
  467. caddr_t call_data);
  468. extern void FileOpenCB(
  469. Widget w,
  470. caddr_t client_data,
  471. caddr_t call_data);
  472. extern void FileIncludeCB(
  473. Widget w,
  474. caddr_t client_data,
  475. caddr_t call_data);
  476. extern void FileSaveCB(
  477. Widget w,
  478. caddr_t client_data,
  479. caddr_t call_data);
  480. extern void FileSaveAsCB(
  481. Widget w,
  482. caddr_t client_data,
  483. caddr_t call_data);
  484. extern void FilePrintCB(
  485. Widget w,
  486. caddr_t client_data,
  487. caddr_t call_data);
  488. extern void FileXpPrintCB(
  489. Widget w,
  490. caddr_t client_data,
  491. caddr_t call_data);
  492. extern void FileExitCB(
  493. Widget w,
  494. caddr_t client_data,
  495. caddr_t call_data);
  496. extern void NoSaveCB(
  497. Widget w,
  498. caddr_t client_data,
  499. caddr_t call_data);
  500. extern void CancelFileSelectCB(
  501. Widget w,
  502. caddr_t client_data,
  503. caddr_t call_data);
  504. extern void SaveNewLinesCB(
  505. Widget w,
  506. XtPointer client_data,
  507. XtPointer call_data);
  508. extern void SaveAsOkCB(
  509. Widget w,
  510. caddr_t client_data,
  511. caddr_t call_data);
  512. extern void AlrdyExistsOkCB(
  513. Widget w,
  514. caddr_t client_data,
  515. caddr_t call_data);
  516. extern void SaveAsCancelCB(
  517. Widget w,
  518. caddr_t client_data,
  519. caddr_t call_data);
  520. extern void AlrdyExistsCancelCB(
  521. Widget w,
  522. caddr_t client_data,
  523. caddr_t call_data);
  524. extern void AskIfSaveCancelCB(
  525. Widget w,
  526. caddr_t client_data,
  527. caddr_t call_data);
  528. /************************************************************************
  529. * functions in fileDlg.c
  530. ************************************************************************/
  531. extern void PostAlreadyExistsDlg(
  532. Editor *pPad);
  533. extern void SetSaveAsDefaultString(Editor *pPad);
  534. extern void CreateSaveAsDialog(
  535. Editor *pPad);
  536. extern void ExtractAndStoreDir(
  537. Editor *pPad,
  538. char *fileName,
  539. short type);
  540. extern void GetFileName(
  541. Editor *pPad,
  542. XmString title,
  543. short type);
  544. extern char *DialogTitle(
  545. Editor *pPad);
  546. extern void Warning(
  547. Editor *pPad,
  548. char *mess,
  549. unsigned char dialogType);
  550. extern void AskIfSave(
  551. Editor *pPad);
  552. extern void PostSaveError(
  553. Editor *pPad,
  554. char *saveName,
  555. DtEditorErrorCode errorCode);
  556. extern void AskForConfirmation(
  557. Editor *pPad);
  558. /************************************************************************
  559. * functions in editCB.c
  560. ************************************************************************/
  561. extern void EditUndoCB(
  562. Widget w,
  563. caddr_t client_data,
  564. caddr_t call_data);
  565. extern void EditCutCB(
  566. Widget w,
  567. caddr_t client_data,
  568. caddr_t call_data);
  569. extern void EditCopyCB(
  570. Widget w,
  571. caddr_t client_data,
  572. caddr_t call_data);
  573. extern void EditPasteCB(
  574. Widget w,
  575. caddr_t client_data,
  576. caddr_t call_data);
  577. extern void EditClearCB(
  578. Widget w,
  579. caddr_t client_data,
  580. caddr_t call_data);
  581. extern void EditDeleteCB(
  582. Widget w,
  583. caddr_t client_data,
  584. caddr_t call_data);
  585. extern void SelectAllCB(
  586. Widget w,
  587. caddr_t client_data,
  588. caddr_t call_data);
  589. extern void FindChangeCB(
  590. Widget w,
  591. caddr_t client_data,
  592. caddr_t call_data);
  593. extern void CheckSpellingCB(
  594. Widget w,
  595. caddr_t client_data,
  596. caddr_t call_data);
  597. extern void SetSelectionMenuItems(
  598. Editor *pPad,
  599. Boolean sensitivity);
  600. extern void TextSelectedCB(
  601. Widget w,
  602. caddr_t client_data,
  603. caddr_t call_data);
  604. extern void TextDeselectedCB(
  605. Widget w,
  606. caddr_t client_data,
  607. caddr_t call_data);
  608. /************************************************************************
  609. * functions in formatCB.c
  610. ************************************************************************/
  611. extern void FormatCB(
  612. Widget w,
  613. caddr_t client_data,
  614. caddr_t call_data);
  615. extern void FormatParaCB(
  616. Widget w,
  617. caddr_t client_data,
  618. caddr_t call_data);
  619. extern void FormatAllCB(
  620. Widget w,
  621. caddr_t client_data,
  622. caddr_t call_data);
  623. /************************************************************************
  624. * functions in optionsCB.c
  625. ************************************************************************/
  626. extern void OverstrikeCB(
  627. Widget w,
  628. caddr_t client_data,
  629. caddr_t call_data);
  630. extern void WordWrapCB(
  631. Widget w,
  632. caddr_t client_data,
  633. caddr_t call_data);
  634. extern void StatusLineCB(
  635. Widget w,
  636. caddr_t client_data,
  637. caddr_t call_data);
  638. /************************************************************************
  639. * functions in main.c
  640. ************************************************************************/
  641. extern void CreatePad(
  642. Editor **ppPad);
  643. extern void StartDbUpdate(
  644. XtPointer clientData);
  645. extern void exitCB(
  646. Widget w,
  647. XtPointer callData,
  648. XtPointer clientData);
  649. extern void setPanicConditions(void);
  650. extern void SetWindowSize(
  651. Editor *pPad);
  652. extern void SetAppShellResizeHints(
  653. Editor *pPad);
  654. extern void RealizeNewPad(
  655. Editor *pPad);
  656. extern void ManageOldPad(
  657. Editor *pPad,
  658. Boolean isCurrentlyVisible);
  659. extern void InitDtEditSession(
  660. Editor *pPad,
  661. int argc,
  662. char **argv);
  663. extern void SigcldHndlr(
  664. int dummy);
  665. extern void UnmanageAllDialogs(
  666. Editor *pPad);
  667. extern void RestoreInitialServerResources(
  668. Editor *pPad);
  669. #ifndef NO_MESSAGE_CATALOG
  670. extern char * _DtpadGetMessage(
  671. int set,
  672. int number,
  673. char *string);
  674. #endif
  675. /************************************************************************
  676. * functions in dtpad.c
  677. ************************************************************************/
  678. extern void CreateDefaultImage(
  679. char *bits,
  680. int width,
  681. int height,
  682. char *name);
  683. extern void ChangeMainWindowTitle(
  684. Editor *pPad);
  685. extern void SetWindowTitles(
  686. Editor *pPad);
  687. extern void SetSaveAsLabelAndDialog(
  688. Editor *pPad);
  689. extern void CreateMenuBar(
  690. Editor *pPad);
  691. extern void CreateEditorWidget(
  692. Editor *pPad);
  693. extern Boolean FindOrCreatePad(
  694. Editor **ppPad);
  695. extern char *MbStrchr(
  696. char *str,
  697. int ch);
  698. extern char *MbStrchri(
  699. char *str,
  700. int ch,
  701. int* in);
  702. extern char *MbStrrchr(
  703. char *str,
  704. int ch);
  705. extern char *MbBasename(
  706. char *str);
  707. #ifndef NO_MESSAGE_CATALOG
  708. extern char *GetMessage(
  709. int set,
  710. int n,
  711. char *s);
  712. #endif
  713. extern void SetStatusMessage(
  714. Editor *pPad,
  715. char *str);
  716. extern void ClearStatusMessage(
  717. Editor *pPad);
  718. /************************************************************************
  719. * functions in session.c
  720. ************************************************************************/
  721. extern void SaveSessionCB(
  722. Widget w,
  723. caddr_t client_data,
  724. caddr_t call_data );
  725. extern void closeCB(
  726. Widget w,
  727. caddr_t client_data,
  728. caddr_t call_data );
  729. extern void restoreSession(
  730. Editor *pPad);
  731. extern void RestorePad(
  732. Editor *pPad,
  733. int padNum,
  734. XrmDatabase db);
  735. /************************************************************************
  736. * functions in fileIo.c
  737. ************************************************************************/
  738. extern void LoadFile(
  739. Editor *pPad,
  740. char *include);
  741. extern char * GetTempFile(
  742. void);
  743. extern void PanicSave(
  744. void);
  745. extern void SetStatusLineMsg(
  746. Editor *pPad);
  747. /************************************************************************
  748. * functions in helpDlg.c
  749. ************************************************************************/
  750. extern void SetHelpVolAndDisplayHelp(
  751. Editor *pPad,
  752. char *locationId,
  753. char *helpVolume);
  754. extern void DisplayHelp(
  755. Editor *pPad,
  756. char *helpVolume,
  757. char *locationId);
  758. extern void DisplayNewHelpWindow(
  759. Editor *pPad,
  760. char *helpVolume,
  761. char *locationId);
  762. extern Widget CreateHelpDialog(
  763. Editor *pPad);
  764. extern void DisplayHelpDialog(
  765. Editor *pPad,
  766. Widget helpDialog,
  767. char *helpVolume,
  768. char *locationId);
  769. /************************************************************************
  770. * functions in helpCB.c
  771. ************************************************************************/
  772. extern void HelpMenubarCB(
  773. Widget w,
  774. caddr_t client_data,
  775. caddr_t call_data );
  776. extern void HelpFileCB(
  777. Widget w,
  778. caddr_t client_data,
  779. caddr_t call_data );
  780. extern void HelpEditCB(
  781. Widget w,
  782. caddr_t client_data,
  783. caddr_t call_data );
  784. extern void HelpFormatCB(
  785. Widget w,
  786. caddr_t client_data,
  787. caddr_t call_data );
  788. extern void HelpOptionsCB(
  789. Widget w,
  790. caddr_t client_data,
  791. caddr_t call_data );
  792. extern void HelpHelpCB(
  793. Widget w,
  794. caddr_t client_data,
  795. caddr_t call_data );
  796. extern void HelpOpenDialogCB(
  797. Widget w,
  798. caddr_t client_data,
  799. caddr_t call_data );
  800. extern void HelpIncludeDialogCB(
  801. Widget w,
  802. caddr_t client_data,
  803. caddr_t call_data );
  804. extern void HelpSaveAsDialogCB(
  805. Widget w,
  806. caddr_t client_data,
  807. caddr_t call_data );
  808. extern void HelpFileSaveNewLinesCB(
  809. Widget w,
  810. caddr_t client_data,
  811. caddr_t call_data );
  812. extern void HelpAskIfSaveDialogCB(
  813. Widget w,
  814. caddr_t client_data,
  815. caddr_t call_data );
  816. extern void HelpFileAlreadyExistsCB(
  817. Widget w,
  818. caddr_t client_data,
  819. caddr_t call_data );
  820. extern void HelpEditorWidgetCB(
  821. Widget w,
  822. caddr_t client_data,
  823. caddr_t call_data );
  824. extern void HelpPrintSetupDialogCB(
  825. Widget w,
  826. XtPointer client_data,
  827. XtPointer call_data );
  828. extern void HelpPrintSetupAppSpecificCB(
  829. Widget w,
  830. XtPointer client_data,
  831. XtPointer call_data );
  832. extern void HelpPrintSetupGenericCB(
  833. Widget w,
  834. XtPointer client_data,
  835. XtPointer call_data );
  836. extern void HelpPrintSetupPageHeadersFootersCB(
  837. Widget w,
  838. XtPointer client_data,
  839. XtPointer call_data );
  840. extern void HelpPrintSetupPageMargins(
  841. Widget w,
  842. XtPointer client_data,
  843. XtPointer call_data );
  844. extern void HelpOverviewCB(
  845. Widget w,
  846. caddr_t client_data,
  847. caddr_t call_data );
  848. extern void HelpTasksCB(
  849. Widget w,
  850. caddr_t client_data,
  851. caddr_t call_data );
  852. extern void HelpTOCCB(
  853. Widget w,
  854. caddr_t client_data,
  855. caddr_t call_data );
  856. extern void HelpReferenceCB(
  857. Widget w,
  858. caddr_t client_data,
  859. caddr_t call_data );
  860. extern void HelpOnItemCB(
  861. Widget w,
  862. caddr_t client_data,
  863. caddr_t call_data );
  864. extern void HelpUsingHelpCB(
  865. Widget w,
  866. caddr_t client_data,
  867. caddr_t call_data );
  868. extern void HelpAboutCB(
  869. Widget w,
  870. caddr_t client_data,
  871. caddr_t call_data );
  872. extern void HelpHyperlinkCB(
  873. Widget w,
  874. caddr_t client_data,
  875. caddr_t call_data );
  876. extern void HelpCloseCB(
  877. Widget w,
  878. caddr_t client_data,
  879. caddr_t call_data );
  880. /************************************************************************
  881. * functions in ttMsgSupport.c
  882. ************************************************************************/
  883. extern Tt_status TTstartDesktopMediaExchange(
  884. Widget topLevelWithWmCommand,
  885. Editor *pPad);
  886. extern Boolean TTmediaDepositContents(
  887. Editor *pPad);
  888. extern Boolean TTmediaReply(
  889. Editor *pPad);
  890. extern void TTresetQuitArgs(
  891. Editor *pPad);
  892. extern void TTfailPendingQuit(
  893. Editor *pPad);
  894. extern Tt_status TTdesktopOpen(
  895. int *ttFd,
  896. Editor *pPad,
  897. Boolean sendStarted );
  898. extern void TTwarning(
  899. Editor *pPad,
  900. Tt_status status,
  901. char *errsuff);
  902. /************************************************************************
  903. * functions in printJob.c
  904. ************************************************************************/
  905. extern PrintJob * PrintJobCreate(
  906. char *documentName,
  907. char *tempFileName,
  908. Boolean silent,
  909. Editor *pPad);
  910. extern void PrintJobDestroy(
  911. PrintJob *pJob);
  912. extern void PrintJobExecute(
  913. PrintJob *pJob);
  914. extern void PrintJobCancel(
  915. PrintJob *pJob);
  916. extern Display * PrintJobGetErrorPrintDisplay();
  917. extern void PrintJobSetErrorPrintDisplay(Display *display);
  918. extern Boolean PrintJobIsActivePrintDisplay(Display *display);
  919. /************************************************************************
  920. * functions in printOption.c
  921. ************************************************************************/
  922. extern void PrintOptionsGetCurrent(
  923. PrintOptions *pOptions);
  924. extern void PrintOptionsGetDefault(
  925. PrintOptions *pOptions);
  926. extern void PrintOptionsSave(
  927. PrintOptions *pOptions);
  928. /************************************************************************
  929. * functions in printOutput.c
  930. ************************************************************************/
  931. extern PrintOutput *PrintOutputCreate(
  932. Widget shell);
  933. extern void PrintOutputDestroy(
  934. PrintOutput *pOutput);
  935. extern void PrintOutputHideFooters(
  936. PrintOutput *pOutput);
  937. extern void PrintOutputShowFooters(
  938. PrintOutput *pOutput);
  939. extern void PrintOutputHideHeaders(
  940. PrintOutput *pOutput);
  941. extern void PrintOutputShowHeaders(
  942. PrintOutput *pOutput);
  943. extern void PrintOutputSetHdrFtrString(
  944. PrintOutput *pOutput,
  945. _DtPrintHdrFtrEnum which,
  946. char *contents);
  947. extern void PrintOutputSetHdrFtrStrings(
  948. PrintOutput *pOutput,
  949. char *hdrLeft,
  950. char *hdrRight,
  951. char *ftrLeft,
  952. char *ftrRight);
  953. extern void PrintOutputSetPageMargin(
  954. PrintOutput *pOutput,
  955. _DtPrintMarginEnum which,
  956. const char *margin,
  957. Boolean *parseError);
  958. extern void PrintOutputSetPageMargins(
  959. PrintOutput *pOutput,
  960. const char *marginTop,
  961. const char *marginRight,
  962. const char *marginBottom,
  963. const char *marginLeft,
  964. Boolean *parseError);
  965. extern void PrintOutputSetWordWrap(
  966. PrintOutput *pOutput,
  967. Boolean onOff);
  968. extern int PrintOutputGetLinesPerPage(
  969. PrintOutput *pOutput);
  970. extern int PrintOutputGetNumLines(
  971. PrintOutput *pOutput);
  972. extern Boolean PrintOutputPageUp(
  973. PrintOutput *pOutput);
  974. extern Boolean PrintOutputPageDown(
  975. PrintOutput *pOutput);
  976. extern void PrintOutputFirstPage(
  977. PrintOutput *pOutput);
  978. extern DtEditorErrorCode PrintOutputLoadFile(
  979. PrintOutput *pOutput,
  980. char *file);
  981. /************************************************************************
  982. * functions in printSetup.c
  983. ************************************************************************/
  984. extern PrintSetup *PrintSetupCreate(
  985. Widget parent,
  986. char *docName,
  987. Boolean wordWrap,
  988. Editor *pPad,
  989. XtCallbackProc cancelCB, XtPointer cancelClosure,
  990. XtCallbackProc closeDisplayCB, XtPointer closeDisplayClosure,
  991. XtCallbackProc printCB, XtPointer printClosure,
  992. XtCallbackProc setupCB, XtPointer setupClosure
  993. );
  994. extern void PrintSetupDestroy(
  995. PrintSetup *pSetup);
  996. extern void PrintSetupDisplay(
  997. PrintSetup *pSetup);
  998. extern void PrintSetupSaveOptions(
  999. PrintSetup *pSetup);
  1000. extern PrintStringTypeEnum PrintSetupGetHdrFtrSpec(
  1001. PrintSetup *pSetup,
  1002. _DtPrintHdrFtrEnum which);
  1003. extern char *PrintSetupGetMarginSpec(
  1004. PrintSetup *pSetup,
  1005. _DtPrintMarginEnum which);
  1006. extern Boolean PrintSetupGetDefaultPrintData(
  1007. PrintSetup *pSetup,
  1008. DtPrintSetupData *pData);
  1009. extern Boolean PrintSetupUseWordWrap(
  1010. PrintSetup *pSetup);
  1011. #endif /* DTPAD_H */