1 #include <X11/Intrinsic.h>
2 #include <X11/StringDefs.h>
3 #include <X11/Xaw/Paned.h>
4 #include <X11/Xaw/Label.h>
5 #include <X11/Xaw/Form.h>
6 #include <X11/Xaw/Command.h>
7 #include <X11/Xaw/AsciiText.h>
11 extern Widget toplevel, editor, editTitle;
13 extern DestRec current_dest;
17 edit_set_title(¤t_dest);
26 /* I should do more interesting things with these error conditions */
28 XtVaGetValues(editor, XtNstring, (XtArgVal) &buf,
29 XtNtextSource, (XtArgVal) &text_source, NULL);
31 ret = zeph_send_message(¤t_dest, buf);
32 XawAsciiSourceFreeString(text_source);
41 XBell(XtDisplay(toplevel), 0);
45 /* Only the second argument matters */
46 if (defs.close_on_send)
47 XtCallActionProc(toplevel, "CloseSend", NULL, NULL, 0);
49 if (defs.clear_on_send)
50 XtCallActionProc(toplevel, "ClearEditor", NULL, NULL, 0);
53 void edit_set_title(dest)
58 /* alloc two extra bytes for * in case zinst or zrecip are "" */
59 title = (char *) Malloc( strlen(dest->zclass) + strlen(dest->zinst) +
60 strlen(dest->zrecip) + 20, "while setting title",
62 sprintf(title, "Sending to <%s, %s, %s>", dest->zclass,
63 *dest->zinst ? dest->zinst : "*",
64 *dest->zrecip ? dest->zrecip : "*");
66 XtVaSetValues(editTitle,
89 XtNstring, (XtArgVal) yank->msg,
92 dest_set_current_dest(&yank->dest);
93 edit_set_title(&yank->dest);
105 XtVaSetValues(editor,
106 XtNstring, (XtArgVal) yank->msg,
108 if (defs.yank_dest) {
109 dest_set_current_dest(&yank->dest);
110 edit_set_title(&yank->dest);
114 void edit_yank_store()
119 XtVaGetValues(editor, XtNstring, (XtArgVal) &buf,
120 XtNtextSource, (XtArgVal) &text_source, NULL);
122 if (buf != NULL && *buf != '\0')
123 yank_store(¤t_dest, buf);
125 XawAsciiSourceFreeString(text_source);