Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / tt / lib / tttk / tttk.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: tttk.h /main/3 1995/10/23 10:33:00 rswiston $ */
24 /*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                   */
25 /*%%  (c) Copyright 1993, 1994 International Business Machines Corp.     */
26 /*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                    */
27 /*%%  (c) Copyright 1993, 1994 Novell, Inc.                              */
28
29 /*
30  * @(#)tttk.h   1.11 93/09/29
31  */
32
33 #ifndef tttk_h
34 #define tttk_h
35
36 #include <Tt/tt_c.h>
37 #include <X11/Intrinsic.h>
38
39 #if defined(__cplusplus)
40 extern "C" {
41 #endif
42
43 typedef enum {
44         TTDT_OP_NONE,
45         TTDT_CREATED,
46         TTDT_DELETED,
47         TTDT_DO_COMMAND,
48         TTDT_SET_ENVIRONMENT,
49         TTDT_GET_ENVIRONMENT,
50         TTDT_SET_GEOMETRY,
51         TTDT_GET_GEOMETRY,
52         TTDT_SET_ICONIFIED,
53         TTDT_GET_ICONIFIED,
54         TTDT_SET_LOCALE,
55         TTDT_GET_LOCALE,
56         TTDT_SET_MAPPED,
57         TTDT_GET_MAPPED,
58         TTDT_MODIFIED,
59         TTDT_REVERTED,
60         TTDT_GET_MODIFIED,
61         TTDT_MOVED,
62         TTDT_PAUSE,
63         TTDT_RESUME,
64         TTDT_QUIT,
65         TTDT_RAISE,
66         TTDT_LOWER,
67         TTDT_SAVE,
68         TTDT_REVERT,
69         TTDT_SAVED,
70         TTDT_SET_SITUATION,
71         TTDT_GET_SITUATION,
72         TTDT_SIGNAL,
73         TTDT_STARTED,
74         TTDT_STOPPED,
75         TTDT_STATUS,
76         TTDT_GET_STATUS,
77         TTDT_GET_SYSINFO,
78         TTDT_SET_XINFO,
79         TTDT_GET_XINFO,
80         TTME_ABSTRACT,
81         TTME_DEPOSIT,
82         TTME_DISPLAY,
83         TTME_EDIT,
84         TTME_COMPOSE,
85         TTME_INTERPRET,
86         TTME_PRINT,
87         TTME_TRANSLATE,
88         TTME_MAIL,
89         TTME_MAIL_COMPOSE,
90         TTME_MAIL_EDIT,
91         TTME_INSTANTIATE,
92         TTDT_OP_LAST
93 } Tttk_op;
94
95 /*
96  * Standard vtype names
97  */
98 extern const char      *Tttk_integer;
99 extern const char      *Tttk_string;
100 extern const char      *Tttk_boolean;
101 extern const char      *Tttk_file;
102 extern const char      *Tttk_message_id;
103 extern const char      *Tttk_title;
104 extern const char      *Tttk_width;
105 extern const char      *Tttk_height;
106 extern const char      *Tttk_xoffset;
107 extern const char      *Tttk_yoffset;
108
109 /*
110  **********************************************************************
111  *
112  * Procid lifecycle
113  *
114  **********************************************************************
115  */
116 char                   *ttdt_open(
117                                 int            *tt_fd,
118                                 const char     *toolname,
119                                 const char     *vendor,
120                                 const char     *version,
121                                 int             sendStarted
122                         );
123 Tt_status               ttdt_sender_imprint_on(
124                                 const char     *handler,
125                                 Tt_message      commission,
126                                 char          **display,
127                                 int            *width,
128                                 int            *height,
129                                 int            *xoffset,
130                                 int            *yoffset,
131                                 XtAppContext    app2run,
132                                 int             ms_timeout
133                         );
134 Tt_status               ttdt_close(
135                                 const char     *procid,
136                                 const char     *newprocid,
137                                 int             sendStopped
138                         );
139 /*
140  **********************************************************************
141  *
142  * Sessions
143  *
144  **********************************************************************
145  */
146 typedef Tt_message      (*Ttdt_contract_cb)(
147                                 Tt_message      msg,
148                                 void           *clientdata,
149                                 Tt_message      contract
150                         );
151 Tt_pattern             *ttdt_session_join(
152                                 const char             *sessid,
153                                 Ttdt_contract_cb        cb,
154                                 Widget                  shell,
155                                 void                   *clientdata,
156                                 int                     join
157                         );
158 Tt_status               ttdt_session_quit(
159                                 const char     *sessid,
160                                 Tt_pattern     *sess_pats,
161                                 int             quit
162                         );
163 /*
164  **********************************************************************
165  *
166  * Contracts
167  *
168  **********************************************************************
169  */
170 Tt_pattern             *ttdt_message_accept(
171                                 Tt_message      contract,
172                                 Ttdt_contract_cb        cb,
173                                 Widget          shell,
174                                 void           *clientdata,
175                                 int             accept,
176                                 int             sendStatus
177                         );
178 Tt_pattern             *ttdt_subcontract_manage(
179                                 Tt_message      subcontract,
180                                 Ttdt_contract_cb cb,
181                                 Widget          shell,
182                                 void           *clientdata
183                         );
184 /*
185  **********************************************************************
186  *
187  * Desktop: Files
188  *
189  **********************************************************************
190  */
191 typedef Tt_message      (*Ttdt_file_cb)(
192                                 Tt_message      msg,
193                                 Tttk_op         op,
194                                 char           *pathname,
195                                 void           *clientdata,
196                                 int             same_euid_egid,
197                                 int             same_procid
198                         );
199 Tt_pattern             *ttdt_file_join(
200                                 const char     *pathname,
201                                 Tt_scope        scope,
202                                 int             join,
203                                 Ttdt_file_cb    cb,
204                                 void           *clientdata
205                         );
206 Tt_status               ttdt_file_event(
207                                 Tt_message      context,
208                                 Tttk_op         event,
209                                 Tt_pattern     *patterns,
210                                 int             send
211                         );
212 Tt_status               ttdt_file_quit(
213                                 Tt_pattern     *patterns,
214                                 int             quit
215                         );
216 int                     ttdt_Get_Modified(
217                                 Tt_message      context,
218                                 const char     *pathname,
219                                 Tt_scope        scope,
220                                 XtAppContext    app2run,
221                                 int             ms_timeout
222                         );
223 Tt_status               ttdt_Save(
224                                 Tt_message      context,
225                                 const char     *pathname,
226                                 Tt_scope        scope,
227                                 XtAppContext    app2run,
228                                 int             ms_timeout
229                         );
230 Tt_status               ttdt_Revert(
231                                 Tt_message      context,
232                                 const char     *pathname,
233                                 Tt_scope        scope,
234                                 XtAppContext    app2run,
235                                 int             ms_timeout
236                         );
237 Tt_message              ttdt_file_notice(
238                                 Tt_message      context,
239                                 Tttk_op         op,
240                                 Tt_scope        scope,
241                                 const char     *file,
242                                 int             send_and_destroy
243                         );
244 Tt_message              ttdt_file_request(
245                                 Tt_message      context,
246                                 Tttk_op         op,
247                                 Tt_scope        scope,
248                                 const char     *file,
249                                 Ttdt_file_cb    cb,
250                                 void           *clientdata,
251                                 int             send
252                         );
253 /*
254  **********************************************************************
255  *
256  * Media Exchange
257  *
258  **********************************************************************
259  */
260 typedef Tt_message      (*Ttmedia_load_pat_cb)(
261                                 Tt_message      msg,
262                                 void           *clientdata,
263                                 Tttk_op         op,
264                                 Tt_status       diagnosis,
265                                 unsigned char  *contents,
266                                 int             len,
267                                 char           *file,
268                                 char           *docname
269                         );
270 Tt_status               ttmedia_ptype_declare(
271                                 const char     *ptype,
272                                 int             base_opnum,
273                                 Ttmedia_load_pat_cb     cb,
274                                 void           *clientdata,
275                                 int             declare
276                         );
277 typedef Tt_message      (*Ttmedia_load_msg_cb)(
278                                 Tt_message      msg,
279                                 void           *clientdata,
280                                 Tttk_op         op,
281                                 unsigned char  *contents,
282                                 int             len,
283                                 char           *file
284                         );
285 Tt_message              ttmedia_load(
286                                 Tt_message              context,
287                                 Ttmedia_load_msg_cb     cb,
288                                 void                   *clientdata,
289                                 Tttk_op                 op,
290                                 const char             *media_type,
291                                 const unsigned char    *contents,
292                                 int                     len,
293                                 const char             *file,
294                                 const char             *docname,
295                                 int                     send
296                         );
297 Tt_status               ttmedia_load_reply(
298                                 Tt_message              contract,
299                                 const unsigned char    *new_contents,
300                                 int                     new_len,
301                                 int                     reply_and_destroy
302                         );
303 Tt_status               ttmedia_Deposit(
304                                 Tt_message              contract,
305                                 const char             *buffer_id,
306                                 const char             *media_type,
307                                 const unsigned char    *new_contents,
308                                 int                     new_len,
309                                 const char             *file,
310                                 XtAppContext            app2run,
311                                 int                     ms_timeout
312                         );
313 /*
314  **********************************************************************
315  *
316  * ToolTalk Toolkit
317  *
318  **********************************************************************
319  */
320 void                    tttk_Xt_input_handler(
321                                 XtPointer               procid,
322                                 int                    *,
323                                 XtInputId              *
324                         );
325 Tt_status               tttk_block_while(
326                                 XtAppContext            app2run,
327                                 const int              *blocked,
328                                 int                     ms_timeout
329                         );
330 Tt_message              tttk_message_create(
331                                 Tt_message              context,
332                                 Tt_class                the_class,
333                                 Tt_scope                the_scope,
334                                 const char             *handler,
335                                 const char             *op,
336                                 Tt_message_callback     callback
337                         );
338 Tt_status               tttk_message_destroy(
339                                 Tt_message              msg
340                         );
341 Tt_status               tttk_message_reject(
342                                 Tt_message              msg,
343                                 Tt_status               status,
344                                 const char             *status_string,
345                                 int                     destroy
346                         );
347 Tt_status               tttk_message_fail(
348                                 Tt_message              msg,
349                                 Tt_status               status,
350                                 const char              *status_string,
351                                 int                     destroy
352                         );
353 Tt_status               tttk_message_abandon(
354                                 Tt_message              msg
355                         );
356 Tttk_op                 tttk_string_op(
357                                 const char     *s
358                         );
359 char                   *tttk_op_string(
360                                 Tttk_op         op
361                         );
362 #if defined(__cplusplus)
363 }
364 #endif
365
366 #endif