EditorP.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  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 librararies 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. /* $XConsortium: EditorP.h /main/4 1996/06/19 11:28:20 cde-dec $ */
  24. /**********************************<+>*************************************
  25. ***************************************************************************
  26. **
  27. ** File: EditorP.h
  28. **
  29. ** Project: DtEditor widget
  30. **
  31. ** Description:
  32. ** -----------
  33. ** Private include file for the DtEditor widget, text editor class.
  34. **
  35. *******************************************************************
  36. *
  37. * (c) Copyright 1993, 1994 Hewlett-Packard Company
  38. * (c) Copyright 1993, 1994 International Business Machines Corp.
  39. * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  40. * (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.
  41. *
  42. ********************************************************************
  43. **
  44. **
  45. **************************************************************************
  46. **********************************<+>*************************************/
  47. #ifndef _DtEditorP_h
  48. #define _DtEditorP_h
  49. #include <Dt/Editor.h>
  50. #include <stdio.h>
  51. #include <stdlib.h>
  52. #include <fcntl.h>
  53. #include <sys/types.h>
  54. #include <sys/stat.h>
  55. #include <X11/StringDefs.h>
  56. #include <X11/Intrinsic.h>
  57. #include <X11/Xatom.h>
  58. #include <Xm/Protocols.h>
  59. #include <Xm/XmP.h>
  60. #include <Xm/FormP.h>
  61. #include <Xm/TextP.h>
  62. #include "MacrosP.h"
  63. #include <Dt/Dts.h>
  64. #ifdef SENTINEL
  65. #include <sentinel.h>
  66. #endif /* SENTINEL */
  67. /****************************************************************
  68. *
  69. * Defines
  70. *
  71. ****************************************************************/
  72. #define READ_ACCESS 1
  73. #define WRITE_ACCESS 2
  74. #define REPLACE 0
  75. #define FIND 1
  76. #define SPELL 2
  77. #define UNKNOWN_ACTION -1
  78. #define EXTEND_SELECTION 0
  79. #define ICON_FOCUSED 1
  80. #define NO_DELETION_IN_PROGRESS -999
  81. #ifndef DtUNSPECIFIED
  82. #define DtUNSPECIFIED (~0)
  83. #endif
  84. #define CLOSE_BUTTON DTWIDGET_GETMESSAGE( \
  85. MS_Common, MSG_CLOSE, _DtMsgCommon_0000)
  86. #define HELP_BUTTON DTWIDGET_GETMESSAGE( \
  87. MS_Common, MSG_HELP, _DtMsgCommon_0001)
  88. #define FORMAT_SETTINGS DTWIDGET_GETMESSAGE( \
  89. MS_Editor, EDITOR_FORMAT_SETTINGS, _DtMsgEditor_0000)
  90. #define RIGHT_MARGIN DTWIDGET_GETMESSAGE( \
  91. MS_Editor, EDITOR_RIGHT_MARGIN, _DtMsgEditor_0001)
  92. #define LEFT_MARGIN DTWIDGET_GETMESSAGE( \
  93. MS_Editor, EDITOR_LEFT_MARGIN, _DtMsgEditor_0002)
  94. #define LEFT_ALIGN DTWIDGET_GETMESSAGE( \
  95. MS_Editor, EDITOR_LEFT_ALIGN, _DtMsgEditor_0003)
  96. #define RIGHT_ALIGN DTWIDGET_GETMESSAGE( \
  97. MS_Editor, EDITOR_RIGHT_ALIGN, _DtMsgEditor_0004)
  98. #define JUSTIFY DTWIDGET_GETMESSAGE( \
  99. MS_Editor, EDITOR_JUSTIFY, _DtMsgEditor_0005)
  100. #define CENTER DTWIDGET_GETMESSAGE( \
  101. MS_Editor, EDITOR_CENTER, _DtMsgEditor_0006)
  102. #define PARAGRAPH DTWIDGET_GETMESSAGE( \
  103. MS_Editor, EDITOR_PARAGRAPH, _DtMsgEditor_0007)
  104. #define ALL DTWIDGET_GETMESSAGE( \
  105. MS_Editor, EDITOR_ALL, _DtMsgEditor_0008)
  106. #define SPELL_TITLE DTWIDGET_GETMESSAGE( \
  107. MS_Editor, EDITOR_SPELL_TITLE, _DtMsgEditor_0009)
  108. #define FIND_TITLE DTWIDGET_GETMESSAGE( \
  109. MS_Editor, EDITOR_FIND_TITLE, _DtMsgEditor_0010)
  110. #define MISSPELLED DTWIDGET_GETMESSAGE( \
  111. MS_Editor, EDITOR_MISSPELLED, _DtMsgEditor_0011)
  112. #define FIND_LABEL DTWIDGET_GETMESSAGE( \
  113. MS_Editor, EDITOR_FIND_LABEL, _DtMsgEditor_0012)
  114. #define CHANGE_LABEL DTWIDGET_GETMESSAGE( \
  115. MS_Editor, EDITOR_CHANGE_LABEL, _DtMsgEditor_0013)
  116. #define FIND_BUTTON DTWIDGET_GETMESSAGE( \
  117. MS_Editor, EDITOR_FIND_BUTTON, _DtMsgEditor_0014)
  118. #define CHANGE_BUTTON DTWIDGET_GETMESSAGE( \
  119. MS_Editor, EDITOR_CHANGE_BUTTON, _DtMsgEditor_0015)
  120. #define CHNG_ALL_BUTTON DTWIDGET_GETMESSAGE( \
  121. MS_Editor, EDITOR_CHNG_ALL_BUTTON, _DtMsgEditor_0016)
  122. #define NO_FIND DTWIDGET_GETMESSAGE( \
  123. MS_Editor, EDITOR_NO_FIND, _DtMsgEditor_0017)
  124. #define INFO_TITLE DTWIDGET_GETMESSAGE( \
  125. MS_Editor, EDITOR_INFO_TITLE, _DtMsgEditor_0018)
  126. #define LINE DTWIDGET_GETMESSAGE( \
  127. MS_Editor, EDITOR_LINE, _DtMsgEditor_0019)
  128. #define TOTAL DTWIDGET_GETMESSAGE( \
  129. MS_Editor, EDITOR_TOTAL, _DtMsgEditor_0020)
  130. #define OVR DTWIDGET_GETMESSAGE( \
  131. MS_Editor, EDITOR_OVR, _DtMsgEditor_0021)
  132. #define INS DTWIDGET_GETMESSAGE( \
  133. MS_Editor, EDITOR_INS, _DtMsgEditor_0022)
  134. #define BAD_FILTER DTWIDGET_GETMESSAGE( \
  135. MS_Editor, EDITOR_FILTER_ERROR, _DtMsgEditor_0023)
  136. #define BAD_FILTER2 DTWIDGET_GETMESSAGE( \
  137. MS_Editor, EDITOR_FILTER_ERROR2, _DtMsgEditor_0024)
  138. #define ERROR_TITLE DTWIDGET_GETMESSAGE( \
  139. MS_Editor, EDITOR_ERROR_TITLE, _DtMsgEditor_0025)
  140. /****************************************************************
  141. *
  142. * Structures
  143. *
  144. ****************************************************************/
  145. typedef struct _AdjRec {
  146. int bflag; /* -b (blanks) option */
  147. int cflag; /* -c (center) option */
  148. int jflag; /* -j (justify) option */
  149. int rflag; /* -r (right justify) */
  150. int tabsize; /* tab size in use */
  151. long margin;
  152. FILE *infp; /* file pointer for unformatted data */
  153. FILE *outfp; /* file pointer for formatted data */
  154. } AdjRec, *AdjRecPtr;
  155. /****************************************************************
  156. *
  157. * Deleted text structure definition
  158. *
  159. ****************************************************************/
  160. typedef struct _DtEditorUndoRec {
  161. char *deletedText;
  162. XmTextPosition deletionStart;
  163. XmTextPosition insertStart;
  164. int insertionLength;
  165. } DtEditorUndoRec;
  166. /****************************************************************
  167. *
  168. * Data structures for miscellaneous edit information
  169. *
  170. ****************************************************************/
  171. typedef struct _DtEditorEditStuff
  172. {
  173. int blinkRate,
  174. maxLength;
  175. short columns, rows;
  176. XmTextPosition cursorPos,
  177. topCharacter;
  178. Boolean autoShowCursorPos,
  179. cursorPosVisible,
  180. editable,
  181. overstrikeMode,
  182. scrollHorizontal,
  183. scrollLeft,
  184. scrollTop,
  185. scrollVertical,
  186. wordWrap;
  187. Pixel background,
  188. foreground;
  189. int fontWidth, /* widest font, used for formatting */
  190. fontHeight; /* font height; used for WM size hints */
  191. DtEditorUndoRec undo; /* holds deleted text for undo */
  192. Boolean loadingAllNewData,
  193. unreadChanges; /* Data changed since read by app? */
  194. SetSelectionProc setSelection;
  195. } DtEditorEditStuff;
  196. /****************************************************************
  197. *
  198. * Data structures for Search
  199. *
  200. ****************************************************************/
  201. typedef struct _DtEditorSearchWidgets {
  202. Widget formDlg,
  203. listLbl,
  204. spellList,
  205. findLbl,
  206. findText,
  207. replaceLbl,
  208. replaceText,
  209. separator,
  210. findBtn,
  211. replaceBtn,
  212. replaceAllBtn,
  213. closeBtn,
  214. helpBtn;
  215. } DtEditorSearchWidgets;
  216. typedef struct _DtEditorSearchStuff {
  217. DtEditorSearchWidgets widgets;
  218. int search_dialog_mode;
  219. char *search_string, /* last string searched for */
  220. *replace_string, /* last replacement string */
  221. *misspelled_string, /* last misspelled word selected */
  222. *spellFilter;
  223. Boolean misspelled_found;
  224. Dimension buttonHeight;
  225. XmString spellTitle,
  226. fndChngTitle,
  227. changeAllButtonLabel,
  228. changeButtonLabel,
  229. changeFieldLabel,
  230. findButtonLabel,
  231. findFieldLabel,
  232. misspelledListLabel;
  233. } DtEditorSearchStuff;
  234. /****************************************************************
  235. *
  236. * Data structures for Format
  237. *
  238. ****************************************************************/
  239. typedef struct _DtEditorFormatWidgets {
  240. Widget format_dialog,
  241. right_label,
  242. left_label,
  243. rightMargField, /* format right margin text field */
  244. leftMargField, /* format left margin text field */
  245. radio_box,
  246. left_just, /* format type toggle button */
  247. right_just, /* format type toggle button */
  248. both_just, /* format type toggle button */
  249. center, /* format type toggle button */
  250. separator,
  251. paragraph,
  252. all,
  253. close,
  254. help;
  255. } DtEditorFormatWidgets;
  256. typedef struct _DtEditorFormatStuff {
  257. DtEditorFormatWidgets widgets;
  258. XmString centerToggleLabel,
  259. formatAllButtonLabel,
  260. formatParaButtonLabel,
  261. formatDialogTitle,
  262. justifyToggleLabel,
  263. leftAlignToggleLabel,
  264. leftMarginFieldLabel,
  265. rightAlignToggleLabel,
  266. rightMarginFieldLabel;
  267. } DtEditorFormatStuff;
  268. /****************************************************************
  269. *
  270. * Data structures for the Status Line
  271. *
  272. ****************************************************************/
  273. typedef struct _status {
  274. Boolean showStatusLine;
  275. int currentLine,
  276. lastLine;
  277. XmString ovr,
  278. ins,
  279. currentLineLabel,
  280. totalLineLabel;
  281. Widget statusArea,
  282. lineLabel,
  283. lineText,
  284. totalLabel,
  285. totalText,
  286. overstrikeLabel,
  287. messageText;
  288. } DtEditorStatusStuff;
  289. /****************************************************************
  290. *
  291. * Data structures for holding warning dialogs
  292. *
  293. ****************************************************************/
  294. typedef struct _textlibwarning {
  295. Widget warningDialog;
  296. XmString infoDialogTitle;
  297. } DtEditorWarningStuff;
  298. /****************************************************************
  299. *
  300. * Class Part structure definition
  301. *
  302. ****************************************************************/
  303. typedef struct _DtEditorClassPart
  304. {
  305. int ignore;
  306. } DtEditorClassPart;
  307. /****************************************************************
  308. *
  309. * Full Class Record declaration
  310. *
  311. ****************************************************************/
  312. typedef struct _DtEditorClassRec
  313. {
  314. CoreClassPart core_class;
  315. CompositeClassPart composite_class;
  316. ConstraintClassPart constraint_class;
  317. XmManagerClassPart manager_class;
  318. XmBulletinBoardClassPart bulletin_board_class;
  319. XmFormClassPart form_class;
  320. DtEditorClassPart editor_class;
  321. } DtEditorClassRec;
  322. externalref DtEditorClassRec dtEditorClassRec;
  323. /****************************************************************
  324. *
  325. * Resources added by the Editor widget
  326. *
  327. ****************************************************************/
  328. typedef struct _DtEditorPart
  329. {
  330. Display *display;
  331. Widget topLevelShell,
  332. /*
  333. * scrolled text widget
  334. */
  335. text;
  336. Dimension width; /* the text widget width */
  337. /* All data for Edit functions */
  338. DtEditorEditStuff editStuff;
  339. /* All data for Search functions */
  340. DtEditorSearchStuff searchStuff;
  341. /* All data for Format functions */
  342. DtEditorFormatStuff formatStuff;
  343. /* All data for warning dialogs functions */
  344. DtEditorWarningStuff warningStuff;
  345. /* All data for the status line */
  346. DtEditorStatusStuff statusStuff;
  347. XtAppContext app_context;
  348. /*
  349. * The editor widget's callbacks
  350. */
  351. Boolean textSelectCbCalled;
  352. XtCallbackList textSelect;
  353. XtCallbackList textDeselect;
  354. } DtEditorPart;
  355. /****************************************************************
  356. *
  357. * Full Instance Record declaration
  358. *
  359. ****************************************************************/
  360. typedef struct _DtEditorRec
  361. {
  362. CorePart core;
  363. CompositePart composite;
  364. ConstraintPart constraint;
  365. XmManagerPart manager;
  366. XmBulletinBoardPart bulletin_board;
  367. XmFormPart form;
  368. DtEditorPart editor;
  369. } DtEditorRec;
  370. /****************************************************************
  371. *
  372. * MACRO DEFINITIONS
  373. *
  374. ****************************************************************/
  375. /*
  376. * Class and Instance Macros
  377. */
  378. /*
  379. * Note: DtEditor utilizes the bulletin board's dialog_title and
  380. * text_translations fields to hold its dialogTitle and textTranslations
  381. * resources
  382. */
  383. #define E_dialogTitle(m) (m -> bulletin_board.dialog_title)
  384. #define E_textTranslations(m) (m -> bulletin_board.text_translations)
  385. #define E_buttonFontList(m) (m -> bulletin_board.button_font_list)
  386. #define E_labelFontList(m) (m -> bulletin_board.label_font_list)
  387. #define E_textFontList(m) (m -> bulletin_board.text_font_list)
  388. #define M_app_context(m) (m -> editor.app_context)
  389. #define M_display(m) (m -> editor.display)
  390. #define M_topLevelShell(m) (m -> editor.topLevelShell)
  391. #define M_text(m) (m -> editor.text)
  392. #define M_textWidth(m) (m -> editor.width)
  393. /* callbacks */
  394. #define M_textSelect(m) (m -> editor.textSelect)
  395. #define M_textDeselect(m) (m -> editor.textDeselect)
  396. #define M_textSelectCbCalled(m) (m -> editor.textSelectCbCalled)
  397. /* editStuff - scrolled text resources */
  398. #define M_autoShowCursorPos(m) (m->editor.editStuff.autoShowCursorPos)
  399. #define M_blinkRate(m) (m -> editor.editStuff.blinkRate)
  400. #define M_columns(m) (m -> editor.editStuff.columns)
  401. #define M_cursorPos(m) (m -> editor.editStuff.cursorPos)
  402. #define M_cursorPosVisible(m) (m -> editor.editStuff.cursorPosVisible)
  403. #define M_editable(m) (m -> editor.editStuff.editable)
  404. #define M_fontWidth(m) (m -> editor.editStuff.fontWidth)
  405. #define M_fontHeight(m) (m -> editor.editStuff.fontHeight)
  406. #define M_maxLength(m) (m -> editor.editStuff.maxLength)
  407. #define M_overstrikeMode(m) (m -> editor.editStuff.overstrikeMode)
  408. #define M_rows(m) (m -> editor.editStuff.rows)
  409. #define M_scrollHorizontal(m) (m -> editor.editStuff.scrollHorizontal)
  410. #define M_scrollLeftSide(m) (m -> editor.editStuff.scrollLeft)
  411. #define M_scrollTopSide(m) (m -> editor.editStuff.scrollTop)
  412. #define M_scrollVertical(m) (m -> editor.editStuff.scrollVertical)
  413. #define M_topCharacter(m) (m -> editor.editStuff.topCharacter)
  414. #define M_wordWrap(m) (m -> editor.editStuff.wordWrap)
  415. #define M_textBackground(m) (m -> editor.editStuff.background)
  416. #define M_textForeground(m) (m -> editor.editStuff.foreground)
  417. /* editStuff - scrolled text related data */
  418. #define M_deletionStart(m) (m -> editor.editStuff.undo.deletionStart)
  419. #define M_deletedText(m) (m -> editor.editStuff.undo.deletedText)
  420. #define M_insertStart(m) (m -> editor.editStuff.undo.insertStart)
  421. #define M_insertionLength(m) (m -> editor.editStuff.undo.insertionLength)
  422. #define M_loadingAllNewData(m) (m -> editor.editStuff.loadingAllNewData)
  423. #define M_unreadChanges(m) (m -> editor.editStuff.unreadChanges)
  424. #define M_setSelection(m) (m -> editor.editStuff.setSelection)
  425. /* searchStuff */
  426. #define M_search_dialogMode(m) (m ->editor.searchStuff.search_dialog_mode)
  427. #define M_spellTitle(m) (m -> editor.searchStuff.spellTitle)
  428. #define M_fndChngTitle(m) (m -> editor.searchStuff.fndChngTitle)
  429. #define E_changeAllButtonLabel(m) (m->editor.searchStuff.changeAllButtonLabel)
  430. #define E_changeButtonLabel(m) (m->editor.searchStuff.changeButtonLabel)
  431. #define E_changeFieldLabel(m) (m->editor.searchStuff.changeFieldLabel)
  432. #define E_findButtonLabel(m) (m->editor.searchStuff.findButtonLabel)
  433. #define E_findFieldLabel(m) (m->editor.searchStuff.findFieldLabel)
  434. #define E_misspelledListLabel(m) (m->editor.searchStuff.misspelledListLabel)
  435. #define M_search_string(m) (m -> editor.searchStuff.search_string)
  436. #define M_replace_string(m) (m -> editor.searchStuff.replace_string)
  437. #define M_misspelled_string(m) (m -> editor.searchStuff.misspelled_string)
  438. #define M_misspelled_found(m) (m -> editor.searchStuff.misspelled_found)
  439. #define M_spellFilter(m) (m -> editor.searchStuff.spellFilter)
  440. #define M_replaceText(m) (m -> editor.searchStuff.widgets.replaceText)
  441. #define M_findText(m) (m -> editor.searchStuff.widgets.findText)
  442. #define M_search_replaceLbl(m) (m -> editor.searchStuff.widgets.replaceLbl)
  443. #define M_search_buttonHeight(m) (m -> editor.searchStuff.buttonHeight)
  444. #define M_search_dialog(m) (m -> editor.searchStuff.widgets.formDlg)
  445. #define M_search_closeBtn(m) (m -> editor.searchStuff.widgets.closeBtn)
  446. #define M_search_helpBtn(m) (m -> editor.searchStuff.widgets.helpBtn)
  447. #define M_search_findBtn(m) (m -> editor.searchStuff.widgets.findBtn)
  448. #define M_search_replaceBtn(m) (m -> editor.searchStuff.widgets.replaceBtn)
  449. #define M_search_replaceAllBtn(m)\
  450. (m -> editor.searchStuff.widgets.replaceAllBtn)
  451. #define M_search_spellList(m) (m -> editor.searchStuff.widgets.spellList)
  452. #define M_search_listLbl(m) (m -> editor.searchStuff.widgets.listLbl)
  453. #define M_search_findLbl(m) (m -> editor.searchStuff.widgets.findLbl)
  454. #define M_search_separator(m) (m -> editor.searchStuff.widgets.separator)
  455. /* formatStuff */
  456. #define E_format_centerToggleLabel(m) (m->editor.formatStuff.centerToggleLabel)
  457. #define E_format_formatAllButtonLabel(m)\
  458. (m->editor.formatStuff.formatAllButtonLabel)
  459. #define E_format_formatParagraphButtonLabel(m)\
  460. (m->editor.formatStuff.formatParaButtonLabel)
  461. #define E_format_dialogTitle(m) (m->editor.formatStuff.formatDialogTitle)
  462. #define E_format_justifyToggleLabel(m)\
  463. (m->editor.formatStuff.justifyToggleLabel)
  464. #define E_format_leftAlignToggleLabel(m)\
  465. (m->editor.formatStuff.leftAlignToggleLabel)
  466. #define E_format_leftMarginFieldLabel(m)\
  467. (m->editor.formatStuff.leftMarginFieldLabel)
  468. #define E_format_rightAlignToggleLabel(m)\
  469. (m->editor.formatStuff.rightAlignToggleLabel)
  470. #define E_format_rightMarginFieldLabel(m)\
  471. (m->editor.formatStuff.rightMarginFieldLabel)
  472. #define M_format_all(m) (m -> editor.formatStuff.widgets.all)
  473. #define M_format_bothJust(m) (m -> editor.formatStuff.widgets.both_just)
  474. #define M_format_center(m) (m -> editor.formatStuff.widgets.center)
  475. #define M_format_close(m) (m -> editor.formatStuff.widgets.close)
  476. #define M_format_dialog(m) (m -> editor.formatStuff.widgets.format_dialog)
  477. #define M_format_help(m) (m -> editor.formatStuff.widgets.help)
  478. #define M_format_leftJust(m) (m -> editor.formatStuff.widgets.left_just)
  479. #define M_format_leftLabel(m) (m -> editor.formatStuff.widgets.left_label)
  480. #define M_format_leftMarginField(m) (m -> editor.formatStuff.widgets.leftMargField)
  481. #define M_format_paragraph(m) (m -> editor.formatStuff.widgets.paragraph)
  482. #define M_format_radioBox(m) (m -> editor.formatStuff.widgets.radio_box)
  483. #define M_format_rightJust(m) (m -> editor.formatStuff.widgets.right_just)
  484. #define M_format_rightLabel(m) (m -> editor.formatStuff.widgets.right_label)
  485. #define M_format_rightMarginField(m) (m -> editor.formatStuff.widgets.rightMargField)
  486. #define M_format_separator(m) (m -> editor.formatStuff.widgets.separator)
  487. /* statusStuff */
  488. #define M_status_showStatusLine(m) (m -> editor.statusStuff.showStatusLine)
  489. #define M_status_currentLine(m) (m -> editor.statusStuff.currentLine)
  490. #define M_status_lastLine(m) (m -> editor.statusStuff.lastLine)
  491. #define M_status_overstrikeLabel(m) (m -> editor.statusStuff.ovr)
  492. #define M_status_insertLabel(m) (m -> editor.statusStuff.ins)
  493. #define E_status_currentLineLabel(m) (m -> editor.statusStuff.currentLineLabel)
  494. #define E_status_totalLineCountLabel(m) (m->editor.statusStuff.totalLineLabel)
  495. #define M_status_statusArea(m) (m -> editor.statusStuff.statusArea)
  496. #define M_status_lineLabel(m) (m -> editor.statusStuff.lineLabel)
  497. #define M_status_lineText(m) (m -> editor.statusStuff.lineText)
  498. #define M_status_totalLabel(m) (m -> editor.statusStuff.totalLabel)
  499. #define M_status_totalText(m) (m -> editor.statusStuff.totalText)
  500. #define M_status_overstrikeWidget(m) (m->editor.statusStuff.overstrikeLabel)
  501. #define M_status_messageText(m) (m -> editor.statusStuff.messageText)
  502. /* warningStuff */
  503. #define M_gen_warning(m) (m ->editor.warningStuff.warningDialog)
  504. #define E_infoDialogTitle(m) (m ->editor.warningStuff.infoDialogTitle)
  505. /*
  506. * Misc macros
  507. */
  508. #define M_editor(m) ((DtEditorWidget) m ->core.parent -> core.parent)
  509. /****************************************************************
  510. *
  511. * Private library functions
  512. *
  513. ****************************************************************/
  514. /*** library-private functions in Editor.c ***/
  515. extern void _DtEditorResetUndo(
  516. DtEditorWidget editor);
  517. extern void _DtEditorUpdateLineDisplay(
  518. DtEditorWidget editor,
  519. int currentLine,
  520. Boolean forceUpdate );
  521. extern int _DtEditorGetLineIndex(
  522. XmTextWidget tw,
  523. XmTextPosition pos);
  524. extern void _DtEditorWarning(
  525. DtEditorWidget pPriv,
  526. char *mess,
  527. unsigned char dialogType);
  528. extern DtEditorErrorCode _DtEditorValidateFileAccess(
  529. char *fileName,
  530. int accessType );
  531. extern void _DtEditorHelpSearchCB (
  532. Widget w,
  533. caddr_t client_data ,
  534. caddr_t call_data );
  535. extern void _DtEditorHelpSearchSpellCB (
  536. Widget w,
  537. caddr_t client_data ,
  538. caddr_t call_data );
  539. extern void _DtEditorHelpSearchFindCB (
  540. Widget w,
  541. caddr_t client_data ,
  542. caddr_t call_data );
  543. extern void _DtEditorHelpSearchChangeCB (
  544. Widget w,
  545. caddr_t client_data ,
  546. caddr_t call_data );
  547. /*** library-private functions in EditAreaData.c ***/
  548. extern char *_DtEditorGetPointer(
  549. char *pString,
  550. int startChar);
  551. /*** library-private functions in EditorCalls.c ***/
  552. extern void _DtEditorModifyVerifyCB(
  553. Widget w,
  554. caddr_t client_data,
  555. caddr_t call_data );
  556. /*** library-private functions in SearchCalls.c ***/
  557. extern void _DtEditorSearchMapCB(
  558. Widget w,
  559. caddr_t client_data,
  560. caddr_t call_data );
  561. extern int _DtEditor_CountCharacters(
  562. char *str,
  563. int num_count_bytes);
  564. extern void _DtEditorDialogSearchCB(
  565. Widget w,
  566. caddr_t client_data,
  567. caddr_t call_data );
  568. extern void _DtEditorDialogReplaceCB(
  569. Widget w,
  570. caddr_t client_data,
  571. caddr_t call_data );
  572. extern void _DtEditorDialogReplaceAllCB(
  573. Widget w,
  574. caddr_t client_data,
  575. caddr_t call_data );
  576. extern void _DtEditorDialogFindCancelCB(
  577. Widget w,
  578. caddr_t client_data,
  579. caddr_t call_data );
  580. extern void _DtEditorMisspelledSelectCB(
  581. Widget w,
  582. caddr_t client_data,
  583. caddr_t call_data );
  584. extern void _DtEditorMisspelledDblClickCB(
  585. Widget w,
  586. caddr_t client_data,
  587. caddr_t call_data );
  588. extern void _DtEditorFindTextChangedCB(
  589. Widget w,
  590. caddr_t client_data,
  591. caddr_t call_data );
  592. extern void _DtEditorReplaceTextChangedCB(
  593. Widget w,
  594. caddr_t client_data,
  595. caddr_t call_data );
  596. extern void _DtEditorSetFindSensitivity(
  597. DtEditorWidget pPriv,
  598. Boolean sensitivity);
  599. extern void _DtEditorSetReplaceSensitivity(
  600. DtEditorWidget pPriv,
  601. Boolean sensitivity);
  602. extern void _DtEditorSetReplaceAllSensitivity(
  603. DtEditorWidget pPriv,
  604. Boolean sensitivity);
  605. /*** library-private functions in SearchDlg.c ***/
  606. extern void _DtEditorSearch(
  607. DtEditorWidget pPriv,
  608. Boolean spell,
  609. Boolean createonly );
  610. #endif /* _DtEditorP_h */