annotate man/external-widget.texi @ 811:7778a469a8ac

[xemacs-hg @ 2002-04-07 19:36:13 by wmperry] Fix menubar-less builds.
author wmperry
date Sun, 07 Apr 2002 19:36:14 +0000
parents da44ff90109f
children 42375619fa45
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 \input texinfo @c -*-texinfo-*-
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 @setfilename ../info/external-widget.info
675
bb2ecf4a4a16 [xemacs-hg @ 2001-11-27 18:53:47 by adrian]
adrian
parents: 428
diff changeset
3 @settitle The External Client Widget
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 @ifinfo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 @dircategory XEmacs Editor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 @direntry
721
f72a191f8ecf [xemacs-hg @ 2002-01-02 20:56:32 by adrian]
adrian
parents: 675
diff changeset
8 * External Widget: (external-widget). External Client Widget.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 @end direntry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 @end ifinfo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 @node Top, Using an External Client Widget,, (dir)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 An @dfn{external client widget} is a widget that is part of another program
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 but functions as an Emacs frame. This is intended to be a more
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 powerful replacement for standard text widgets.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 * Using an External Client Widget::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 * External Client Widget Resource Settings::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 * Motif-Specific Info About the External Client Widget::
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
22 * Example Program Using the External Client Widget::
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 @node Using an External Client Widget, External Client Widget Resource Settings, Top, Top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 @chapter Using an External Client Widget
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 There are three different implementations of the external client widget.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 One is designed for use in Motif applications and is linked with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 option @code{-lextcli_Xm}. Another is designed for non-Motif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 applications that still use the X toolkit; it is linked with the option
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 @code{-lextcli_Xt}. The third is designed for applications that do not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 use the X toolkit; it is linked with the option @code{-lextcli_Xlib}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 In order to use an external client widget in a client program that uses
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 the X toolkit (i.e. either of the first two options described above),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 simply create an instance of widget type ExternalClient and link your
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 program with the appropriate library. The corresponding header file is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 called @file{ExternalClient.h}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 Documentation still needs to be provided for using the raw Xlib
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 version of the external client widget.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 The external client widget will not do anything until an instance of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 Emacs is told about this particular widget. To do that, call the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 function @code{make-frame}, specifying a value for the frame parameter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 @code{window-id}. This value should be a string containing the decimal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 representation of the widget's X window ID number (this can be obtained
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 by the Xt function @code{XtWindow()}). In order for the client program
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 to communicate this information to Emacs, a method such as sending a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 ToolTalk message needs to be used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 Once @code{make-frame} has been called, Emacs will create a frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 that occupies the client widget's window. This frame can be used just
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 like any other frame in Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 @node External Client Widget Resource Settings, Motif-Specific Info About the External Client Widget, Using an External Client Widget, Top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 @chapter External Client Widget Resource Settings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 The external client widget is a subclass of the Motif widget XmPrimitive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 and thus inherits all its resources. In addition, the following new
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 resources are defined:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 @table @samp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 @item deadShell (class DeadShell)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 A boolean resource indicating whether the last request to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 ExternalShell widget that contains the frame corresponding to this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 widget timed out. If true, no further requests will be made (all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 requests will automatically fail) until a response to the last
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 request is received. This resource should normally not be set by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 user.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 @item shellTimeout (class ShellTimeout)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 A value specifying how long (in milliseconds) the client should wait
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 for a response when making a request to the corresponding ExternalShell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 widget. If this timeout is exceeded, the client will assume that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 shell is dead and will fail the request and all subsequent requests
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 until a response to the request is received. Default value is 5000,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 or 5 seconds.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 The shell that contains the frame corresponding to an external client
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 widget is of type ExternalShell, as opposed to standard frames, whose
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 shell is of type TopLevelShell. The ExternalShell widget is a direct
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 subclass of Shell and thus inherits its resources. In addition, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 following new resources are defined:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 @table @samp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 @item window (class Window)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 The X window ID of the widget to use for this Emacs frame. This is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 normally set by the call to @code{x-create-frame} and should not be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 modified by the user.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 @item deadClient (class DeadClient)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 A boolean resource indicating whether the last request to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 corresponding ExternalClient widget timed out. If true, no further
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 requests will be made (all requests will automatically fail) until a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 response to the last request is received. This resource should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 normally not be set by the user.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 @item ClientTimeout (class ClientTimeout)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 A value specifying how long (in milliseconds) the shell should wait
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 for a response when making a request to the corresponding ExternalClient
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 widget. If this timeout is exceeded, the shell will assume that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 client is dead and will fail the request and all subsequent requests
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 until a response to the request is received. Default value is 5000,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 or 5 seconds.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 Note that the requests that are made between the client and the shell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 are primarily for handling query-geometry and geometry-manager requests
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 made by parent or child widgets.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
116 @node Motif-Specific Info About the External Client Widget, Example Program Using the External Client Widget, External Client Widget Resource Settings, Top
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 @chapter Motif-Specific Info About the External Client Widget
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 By default, the external client widget has navigation type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 @samp{XmTAB_GROUP}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 The widget traversal keystrokes are modified slightly from the standard
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 XmPrimitive keystrokes. In particular, @kbd{@key{TAB}} alone does not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 traverse to the next widget (@kbd{Ctrl-@key{TAB}} must be used instead),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 but functions like a normal @key{TAB} in Emacs. This follows the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 semantics of the Motif text widget. The traversal keystrokes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 @kbd{Ctrl-@key{TAB}} and @kbd{Shift-@key{TAB}} are silently filtered by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 the external client widget and are not seen by Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
130
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
131 @node Example Program Using the External Client Widget, , Motif-Specific Info About the External Client Widget, Top
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
132 @chapter Example Program Using the External Client Widget
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
133
753
41528f633ff7 [xemacs-hg @ 2002-02-13 15:28:56 by stephent]
stephent
parents: 750
diff changeset
134 This is a very simple program. It has some issues with exiting.
41528f633ff7 [xemacs-hg @ 2002-02-13 15:28:56 by stephent]
stephent
parents: 750
diff changeset
135 Be careful to destroy the Emacs frame in the client window before
41528f633ff7 [xemacs-hg @ 2002-02-13 15:28:56 by stephent]
stephent
parents: 750
diff changeset
136 exiting the client program.
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
137
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
138 @example
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
139 /*
753
41528f633ff7 [xemacs-hg @ 2002-02-13 15:28:56 by stephent]
stephent
parents: 750
diff changeset
140 XEmacsInside.c
41528f633ff7 [xemacs-hg @ 2002-02-13 15:28:56 by stephent]
stephent
parents: 750
diff changeset
141
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
142 Copyright (C) 2002 Free Software Foundation
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
143
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
144 This program is part of XEmacs. XEmacs is free software. See the
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
145 file COPYING that came with XEmacs for conditions on redistribution.
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
146
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
147 This is an example of the XEmacs external widget facility.
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
148
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
149 It uses libextcli-Xt.a to interface to the X Toolkit Intrinsics.
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
150
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
151 Compile with
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
152
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
153 gcc -I/path/to/XEmacs/source/src -L/path/to/XEmacs/build/src -static \
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
154 -lextcli_Xt -lXt -lX11 -lSM -lICE \
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
155 -o XEmacsInside XEmacsInside.c
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
156
753
41528f633ff7 [xemacs-hg @ 2002-02-13 15:28:56 by stephent]
stephent
parents: 750
diff changeset
157 Run it with the resource "*input: True" and a reasonable geometry spec.
41528f633ff7 [xemacs-hg @ 2002-02-13 15:28:56 by stephent]
stephent
parents: 750
diff changeset
158 It pops up a window, and prints a Lisp form on stdout. Eval the form
41528f633ff7 [xemacs-hg @ 2002-02-13 15:28:56 by stephent]
stephent
parents: 750
diff changeset
159 in an XEmacs configured with --external-widget.
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
160
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
161 Written by Stephen J. Turnbull <stephen@@xemacs.org>
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
162
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
163 Based on simple_text.c from _The Motif Programming Manual_ by Heller
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
164 and Ferguson, O'Reilly.
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
165 */
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
166
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
167 #include <stdio.h>
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
168
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
169 #include <X11/Intrinsic.h>
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
170 #include <X11/StringDefs.h>
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
171 #include <X11/Shell.h>
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
172
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
173 #include "ExternalClient.h"
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
174
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
175 main (int argc, char *argv[])
755
da44ff90109f [xemacs-hg @ 2002-02-16 07:25:39 by stephent]
stephent
parents: 753
diff changeset
176 @{
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
177 Widget toplevel, emacs;
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
178 XtAppContext app;
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
179
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
180 XtSetLanguageProc (NULL, NULL, NULL);
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
181
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
182 toplevel = XtVaOpenApplication (&app, "Demo",
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
183 NULL, 0, &argc, argv,
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
184 NULL, sessionShellWidgetClass,
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
185 NULL);
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
186
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
187 emacs = XtVaCreateManagedWidget ("externalWidget", externalClientWidgetClass,
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
188 toplevel,
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
189 NULL);
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
190
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
191 XtRealizeWidget (toplevel);
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
192
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
193 printf ("(make-frame '(window-id \"%d\"))\n", XtWindow(emacs));
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
194
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
195 XtAppMainLoop (app);
755
da44ff90109f [xemacs-hg @ 2002-02-16 07:25:39 by stephent]
stephent
parents: 753
diff changeset
196 @}
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
197
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
198 /* This function doesn't belong here but somehow it's not getting resolved
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
199 from the library. */
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
200 void
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
201 fatal (char *msg)
755
da44ff90109f [xemacs-hg @ 2002-02-16 07:25:39 by stephent]
stephent
parents: 753
diff changeset
202 @{
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
203 fprintf (stderr, "%s", msg);
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
204 exit (1);
755
da44ff90109f [xemacs-hg @ 2002-02-16 07:25:39 by stephent]
stephent
parents: 753
diff changeset
205 @}
750
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
206 @end example
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
207
f929ab5ec903 [xemacs-hg @ 2002-02-13 12:52:03 by stephent]
stephent
parents: 721
diff changeset
208
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 @summarycontents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 @contents
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 @bye