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