Split xhistory.c in front-end and middle-end part
[xboard.git] / xaw / xedittags.c
1 /*
2  * xedittags.c -- Tags edit window, part of X front end for XBoard
3  *
4  * Copyright 1995, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
5  *
6  * ------------------------------------------------------------------------
7  *
8  * GNU XBoard is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or (at
11  * your option) any later version.
12  *
13  * GNU XBoard is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see http://www.gnu.org/licenses/.  *
20  *
21  *------------------------------------------------------------------------
22  ** See the file ChangeLog for a revision history.  */
23
24 #include "config.h"
25
26 #include <stdio.h>
27 #include <ctype.h>
28 #include <errno.h>
29 #include <sys/types.h>
30
31 #if STDC_HEADERS
32 # include <stdlib.h>
33 # include <string.h>
34 #else /* not STDC_HEADERS */
35 extern char *getenv();
36 # if HAVE_STRING_H
37 #  include <string.h>
38 # else /* not HAVE_STRING_H */
39 #  include <strings.h>
40 # endif /* not HAVE_STRING_H */
41 #endif /* not STDC_HEADERS */
42
43 #if HAVE_UNISTD_H
44 # include <unistd.h>
45 #endif
46
47 #include <X11/Intrinsic.h>
48 #include <X11/StringDefs.h>
49 #include <X11/Shell.h>
50 #include <X11/cursorfont.h>
51 #if USE_XAW3D
52 #include <X11/Xaw3d/Dialog.h>
53 #include <X11/Xaw3d/Form.h>
54 #include <X11/Xaw3d/List.h>
55 #include <X11/Xaw3d/Label.h>
56 #include <X11/Xaw3d/SimpleMenu.h>
57 #include <X11/Xaw3d/SmeBSB.h>
58 #include <X11/Xaw3d/SmeLine.h>
59 #include <X11/Xaw3d/Box.h>
60 #include <X11/Xaw3d/MenuButton.h>
61 #include <X11/Xaw3d/Text.h>
62 #include <X11/Xaw3d/AsciiText.h>
63 #include <X11/Xaw3d/Viewport.h>
64 #else
65 #include <X11/Xaw/Dialog.h>
66 #include <X11/Xaw/Form.h>
67 #include <X11/Xaw/List.h>
68 #include <X11/Xaw/Label.h>
69 #include <X11/Xaw/SimpleMenu.h>
70 #include <X11/Xaw/SmeBSB.h>
71 #include <X11/Xaw/SmeLine.h>
72 #include <X11/Xaw/Box.h>
73 #include <X11/Xaw/MenuButton.h>
74 #include <X11/Xaw/Text.h>
75 #include <X11/Xaw/AsciiText.h>
76 #include <X11/Xaw/Viewport.h>
77 #endif
78
79 #include "common.h"
80 #include "frontend.h"
81 #include "backend.h"
82 #include "xboard.h"
83 #include "xedittags.h"
84 #include "dialogs.h"
85 #include "gettext.h"
86
87 #ifdef ENABLE_NLS
88 # define  _(s) gettext (s)
89 # define N_(s) gettext_noop (s)
90 #else
91 # define  _(s) (s)
92 # define N_(s)  s
93 #endif
94
95 Position tagsX = -1, tagsY = -1;
96
97 void
98 TagsPopUp (char *tags, char *msg)
99 {
100     NewTagsPopup(tags, cmailMsgLoaded ? msg : NULL);
101 }
102
103
104 void
105 EditTagsPopUp (char *tags, char **dest)
106 {
107     NewTagsPopup(tags, NULL);
108 }
109
110 void
111 TagsPopDown()
112 {
113     PopDown(TagsDlg);
114     bookUp = False;
115 }
116
117 void
118 EditTagsProc ()
119 {
120   if (bookUp || !PopDown(TagsDlg)) EditTagsEvent();
121 }