annotate src/console-gtk.c @ 863:42375619fa45

[xemacs-hg @ 2002-06-04 06:03:59 by andyp] merge 21.4 windows changes, minimally tested
author andyp
date Tue, 04 Jun 2002 06:05:53 +0000
parents 190b164ddcac
children 79c6ff3eef26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
1 /* Console functions for X windows.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
2 Copyright (C) 1996 Ben Wing.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
3
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
4 This file is part of XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
5
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
9 later version.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
10
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
14 for more details.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
15
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
20
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
22
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
23 /* Authorship:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
24
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
25 Ben Wing: January 1996, for 19.14.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
26 William Perry: April 2000, for 21.1 (Gtk version)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
27 */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
28
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
29 #include <config.h>
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
30 #include "lisp.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
31
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
32 #include "console-gtk.h"
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
33 #include "process.h" /* canonicalize_host_name */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
34 #include "redisplay.h" /* for display_arg */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
35
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
36 DEFINE_CONSOLE_TYPE (gtk);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
37
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
38 static int
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
39 gtk_initially_selected_for_input (struct console *con)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
40 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
41 return 1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
42 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
43
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
44 /* Remember, in all of the following functions, we have to verify
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
45 the integrity of our input, because the generic functions don't. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
47 static Lisp_Object
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
48 gtk_device_to_console_connection (Lisp_Object connection, Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
49 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50 /* Strip the trailing .# off of the connection, if it's there. */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52 if (NILP (connection))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53 return Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54 else
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 connection = build_string ("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58 return connection;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61 static Lisp_Object
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62 gtk_semi_canonicalize_console_connection (Lisp_Object connection,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
63 Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65 struct gcpro gcpro1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67 GCPRO1 (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69 connection = build_string ("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74 static Lisp_Object
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
75 gtk_canonicalize_console_connection (Lisp_Object connection, Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
76 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
77 Lisp_Object hostname = Qnil;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
78 struct gcpro gcpro1, gcpro2;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80 GCPRO2 (connection, hostname);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82 connection = build_string ("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
84 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
85 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
86
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
87 static Lisp_Object
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 gtk_semi_canonicalize_device_connection (Lisp_Object connection,
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
89 Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
90 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
91 struct gcpro gcpro1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
92
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
93 GCPRO1 (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
94
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
95 connection = build_string("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
98 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
99
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100 static Lisp_Object
578
190b164ddcac [xemacs-hg @ 2001-05-25 11:26:50 by ben]
ben
parents: 462
diff changeset
101 gtk_canonicalize_device_connection (Lisp_Object connection, Error_Behavior errb)
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
102 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103 struct gcpro gcpro1;
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
104
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
105 GCPRO1 (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 connection = build_string("gtk");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108 RETURN_UNGCPRO (connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111 void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
112 console_type_create_gtk (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
113 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
114 INITIALIZE_CONSOLE_TYPE (gtk, "gtk", "console-gtk-p");
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
115
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_console_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117 CONSOLE_HAS_METHOD (gtk, canonicalize_console_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 CONSOLE_HAS_METHOD (gtk, semi_canonicalize_device_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 CONSOLE_HAS_METHOD (gtk, canonicalize_device_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120 CONSOLE_HAS_METHOD (gtk, device_to_console_connection);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 CONSOLE_HAS_METHOD (gtk, initially_selected_for_input);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 /* CONSOLE_HAS_METHOD (gtk, delete_console); */
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 }
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125 void
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 reinit_console_type_create_gtk (void)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 {
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 REINITIALIZE_CONSOLE_TYPE (gtk);
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129 }